hexsha
stringlengths 40
40
| size
int64 5
1.04M
| ext
stringclasses 6
values | lang
stringclasses 1
value | max_stars_repo_path
stringlengths 3
344
| max_stars_repo_name
stringlengths 5
125
| max_stars_repo_head_hexsha
stringlengths 40
78
| max_stars_repo_licenses
listlengths 1
11
| max_stars_count
int64 1
368k
⌀ | max_stars_repo_stars_event_min_datetime
stringlengths 24
24
⌀ | max_stars_repo_stars_event_max_datetime
stringlengths 24
24
⌀ | max_issues_repo_path
stringlengths 3
344
| max_issues_repo_name
stringlengths 5
125
| max_issues_repo_head_hexsha
stringlengths 40
78
| max_issues_repo_licenses
listlengths 1
11
| max_issues_count
int64 1
116k
⌀ | max_issues_repo_issues_event_min_datetime
stringlengths 24
24
⌀ | max_issues_repo_issues_event_max_datetime
stringlengths 24
24
⌀ | max_forks_repo_path
stringlengths 3
344
| max_forks_repo_name
stringlengths 5
125
| max_forks_repo_head_hexsha
stringlengths 40
78
| max_forks_repo_licenses
listlengths 1
11
| max_forks_count
int64 1
105k
⌀ | max_forks_repo_forks_event_min_datetime
stringlengths 24
24
⌀ | max_forks_repo_forks_event_max_datetime
stringlengths 24
24
⌀ | content
stringlengths 5
1.04M
| avg_line_length
float64 1.14
851k
| max_line_length
int64 1
1.03M
| alphanum_fraction
float64 0
1
| lid
stringclasses 191
values | lid_prob
float64 0.01
1
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
58e094c2d2783e3804cf7cf55792e043b7afca87
| 6,443
|
md
|
Markdown
|
README.md
|
alfovo/mysterious-comments
|
ff6ce556879755d514e92ee5d8341f1393844e8a
|
[
"MIT"
] | 1
|
2020-07-06T20:49:48.000Z
|
2020-07-06T20:49:48.000Z
|
README.md
|
alfovo/mysterious-comments
|
ff6ce556879755d514e92ee5d8341f1393844e8a
|
[
"MIT"
] | 10
|
2021-05-11T19:07:41.000Z
|
2022-02-28T16:32:56.000Z
|
README.md
|
alfovo/mysterious-comments
|
ff6ce556879755d514e92ee5d8341f1393844e8a
|
[
"MIT"
] | null | null | null |
# mysterious-comments
a simple API in node to store anonymous comments in a SQL db, only GET, POST and DELETE available.
- has a simple cache layer (redis) ✅
- no ORMs ✅
- uses es6, es7 syntax ✅
- Grapql ✅
- look ma, no express! ✅
## Prerequisites
1. Make sure you have MySQL and Redis installed and running.
2. Create a `.env` file in your config directory and set the following variables to allow the app to connect with MySQL. You can copy the variables from the `config/example.env` file into a new `.env` file and then set at minimum:
- DB_HOST
- DB_USERNAME
- DB_PASSWORD
- DB_NAME
You can also set custom values for `REDIS_HOST`, `REDIS_PORT`, if you'd like to use something other than the default 'localhost' and '6379' for port and host respectively. The app will run on 7555 unless you set `APP_PORT`.
3. Once you have installed the dependencies via `npm install`, please run:
```
npm run migrations
```
to set up your database with the `comment` table.
## To run
You can run the app with:
```
npm run start
```
And to run the tests, run:
```
npm run test
```
Please note that the tests tear down the comments table after running, so you'll need to run the latest migration after running the tests to be able to start the app.
## GraphQL
To run GraphQL queries, you can go to wherever the server is running, i.e. `http://localhost:7555/` in your browser to access the graphiQL interface.
To look at the listed content of all your comments run the following query in your graphiQL interface:
```
{
comment {
id
content
}
}
```
To look at a specific comment by id you can run:
```
{
comment(id: 2) {
id
content
}
}
```
Add a new comment:
```
mutation {
addComment(content: "pls mysq, no!") {
content
}
}
```
or remove a comment:
```
mutation {
removeComment(id: 2) {
content
}
}
```
I'm not as familiar with GraphQL best practices as I would like, so hopefully the error handling or schema definition isn't too unusual.
## Koa REST API
There is also a more conventional REST api with the following endpoints:
```
POST comments/
GET comments/
GET comments/:id
DELETE comments/:id
```
## Why I chose MySQL over PostgreSQL
The advantages of MySQL over PostgreSQL are that MySQL is incredibly easy to install and set up, and is notably more popular than PostgreSQL. Its disadvantages are that it's not as fully SQL standard compliant as PostgreSQL and while it performs well with read-heavy operations, concurrent read-writes can be problematic at large data volumes.
Since I am building a fun, simple, low traffic API for mysterious posters, I don't think the likelihood of encountering read-write concurrency issues is very high, nor do I think I will need a more fully SQL compliant DBMS than MySQL.
## Why I used knex
Although it's a bit overkill for this project, I used knex to access the MySQL database and knex migrations to create the comment database schema. In general, I feel strongly about making schema changes programmatically, having a history of schema updates, and being able to rollback schema changes. Most importantly for this project, I wanted to make it as easy as possible for project collaborators to set up their database and test out the API. Finally, I consider knex to be a query builder and not an ORM because it's at a lower level of abstraction than an ORM and doesn't directly map a record in our relational database to an object in our application. In retrospect I wish I had used the simple mysql database driver for this particular assignment.
## How I chose my cache writing policy
I considered three cache writing policies: the cache-aside, the write-through, and the write-back. I ruled out the write-back method because it's the most difficult to implement of the other three options, as it would require another service to sync the cache and database asynchronously. When deciding between write-through and cache-aside, I weighed whether my comment API would most likely be part of a write-heavy or read-heavy application.
I imagine my comment API backing a front-end that displays a queue of comments with the option to post a new comment. After posting a comment, the user would want to see an updated queue of comments with their recently written comment posted at the top. Each post to add a comment would result in a subsequent call to get an updated list of all the comments. Also, some users might even want to view the comments without posting.
Given this possible use of my API, wherein it writes and then re-reads data frequently, I am inclined to use a write-through caching policy with a slightly higher write latency but low read latency. However, the drawbacks of using the cache as the primary data source to read and write were enough to change my mind. As a cache, Redis is not designed to be resilient like an RDBMS, so changes to the data could be lost before they can be replicated to MySQL. For our hypothetical anonymous forum, I don't think performance improvements from caching are worth risking data loss. I think pagination would be a better way to improve the performance of the getAll comments endpoint than caching all the comment data in Redis. Plus, although it is unlikely because the comment data is simple and I imagine the comments themselves will not be numerous, caching all that data could be expensive.
So I decided to use the famous cache-aside pattern! The API will check the cache for individual reads, and if the comment isn't in the cache, it will search the database, and if the comment is in the database, update the cache and return the comment. We don't search the cache when listing all comments; instead, we query the database directly. For mutable operations, the API will update MySQL and only update Redis in the case of deletes. I won't spend too long mentioning the drawbacks of the cache-aside algorithm, but suffice to say it can guarantee eventual consistency if MySQL and Redis never fail. The edge case I'm most worried about is when a process is killed after deleting a record in MySQL but before deleting an entry in Redis. In this case, if the user retries the delete, the API will try again to delete the entry in Redis.
## For the future
If I had more time to work on this app I'd think harder about my tests and write tests for the caching logic or GraphQL layer. I would also solve the very annoying `TCPSERVERWRAP` problem in my integration tests.
| 49.561538
| 888
| 0.769052
|
eng_Latn
| 0.999551
|
58e136c1c4a85900a8513aa385af6de66d00a1c6
| 1,759
|
markdown
|
Markdown
|
_posts/2019-12-02-what_is_kubernetes.markdown
|
JustineGB/JustineGB.github.io
|
7e4e7d78a27de1396c9d6da10c1c202100ad7179
|
[
"MIT"
] | null | null | null |
_posts/2019-12-02-what_is_kubernetes.markdown
|
JustineGB/JustineGB.github.io
|
7e4e7d78a27de1396c9d6da10c1c202100ad7179
|
[
"MIT"
] | null | null | null |
_posts/2019-12-02-what_is_kubernetes.markdown
|
JustineGB/JustineGB.github.io
|
7e4e7d78a27de1396c9d6da10c1c202100ad7179
|
[
"MIT"
] | null | null | null |
---
layout: post
title: "What is Kubernetes?"
date: 2019-12-02 21:28:51 +0000
permalink: what_is_kubernetes
---
I have been hearing a lot about Kubernetes (k8s). It has become very popular since its release in 2014. Kubernetes was created to manage large complex container based applications (container orchestration). Building applications using containers or microservices is becoming very popular, and for good reason, but it has also created new challenges and complexities. Kubernetes is an open-source software system that was created by Google and allows you to manage and deploy these containers at large. The creators said they selected the name Kubernetes based on the Greek word for helmsman or captain. It is portable, scalable, and easily extended. It utilizes a cluster orchestration system that will allow your program to still run even if one node fails (i.e. a cluster of nodes, so if one fails, you will still have a number of other working nodes receiving information). We are moving away from companies issuing one huge release after working on a project for a year or more and then dealing with all of the errors and problems that arise (that were not found during testing). Instead we are moving towards a more agile future with small, targeted releases and upgrades with DevOps teams and systems like Kubernetes that allow our agile container based applications to function at a high level - continuous integration and continuous deployment. The Kubernetes production cluster manages this workflow beautifully. Kubernetes is just one of the elements, albeit an important one, of the future of software development where development is more flexible and fluid.

| 135.307692
| 1,572
| 0.801592
|
eng_Latn
| 0.999832
|
58e1b0636102ea5fa53ac932b5c8776fc34b0c35
| 2,778
|
md
|
Markdown
|
README.md
|
FukurouMakoto/hephaestus
|
e6477321898bf7c7d7ef1c20fff9456a5435ef28
|
[
"Apache-2.0"
] | null | null | null |
README.md
|
FukurouMakoto/hephaestus
|
e6477321898bf7c7d7ef1c20fff9456a5435ef28
|
[
"Apache-2.0"
] | null | null | null |
README.md
|
FukurouMakoto/hephaestus
|
e6477321898bf7c7d7ef1c20fff9456a5435ef28
|
[
"Apache-2.0"
] | null | null | null |
[](https://github.com/zepfietje/starware)
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
<!-- ALL-CONTRIBUTORS-BADGE:END -->
### Contributing 🎃
------------
This repository is one of the many repositories maintained by the NIT Rourkela tech community. To get more info about all of our projects, visit our [Info Doc](https://www.notion.so/c019f8d965c24047b92f227a1b20fe4b?v=b1de077e3ea54a7daf480e8ca59e3167) <br>
We are super happy that you are here and invite you to join us at [our Hacktoberfest Meetup](http://bit.ly/NITR-HF). <br>
Our Slack Community: [Slack Invite](http://bit.ly/NITRDevs) <br>
#### We are are excited to see your awesome PRs. As a recognition of your awesome efforts, we would be giving a badge of gratitute to you to showcase your fantastic contribution on sending your first PR in October 2020
`Contributions for Hacktoberfest 2020 are welcome 🎉🎉`
Please refer to the project's style and contribution guidelines for submitting patches and additions. In general, we follow the "fork-and-pull" Git workflow.
1. **Fork** the repo on GitHub
2. **Clone** the project to your own machine
3. **Commit** changes to your own branch
4. **Push** your work back up to your fork
5. Submit a **Pull request** so that we can review your changes
NOTE 1: Please abide by the [Code of Conduct](https://github.com/007vedant/hephaestus/blob/main/Code_Of_Conduct.md).
## Starware
opencodenitr/hephaestus is Starware.
This means you're free to use the project, as long as you star its GitHub repository.
Your appreciation makes us grow and glow up. ⭐
## Projects
This repository will contain small automation/crazy/fun projects made using Python Programming Language. At present, the projects contained in this repository are:
1. [Star Wars Lite](https://github.com/opencodenitr/hephaestus/tree/main/Star%20Wars%20Lite)
## Running Projects
1. Although every project can be run in a global environment after installing the required dependencies, we strongly recommend using a virtual environment for each project to avoid clashes and compatibility issues and to ease the contribution. A virtual environment can be setup using [this](https://www.youtube.com/watch?v=APOPm01BVrk).
2. Inside the virtual environment, install the dependencies and libraries for each project using the requirements.txt file available in the project directories. To install the dependencies use the following in the terminal
`python -m pip install -r requirements.txt`
3. The project can be run directly via any text editor using main.py file present in the project directories. To run the project via terminal, use the following command.
`python main.py`
| 57.875
| 337
| 0.771418
|
eng_Latn
| 0.989024
|
58e1b355d2b7a2f6c016c38ef566cf249431f368
| 2,646
|
md
|
Markdown
|
_posts/2018/08/2018-08-14-windows-batch-rename.md
|
googol4u/googol4u.github.io
|
602e28d7a53b7990a86c440f6f66c4ccac743a7d
|
[
"MIT"
] | null | null | null |
_posts/2018/08/2018-08-14-windows-batch-rename.md
|
googol4u/googol4u.github.io
|
602e28d7a53b7990a86c440f6f66c4ccac743a7d
|
[
"MIT"
] | 275
|
2019-01-26T12:37:32.000Z
|
2020-08-05T09:42:41.000Z
|
_posts/2018/08/2018-08-14-windows-batch-rename.md
|
googol4u/googol4u.github.io
|
602e28d7a53b7990a86c440f6f66c4ccac743a7d
|
[
"MIT"
] | null | null | null |
---
layout: post
title: Windows下如何批量更改文件名
tagline: "windows"
category: 技术
tags: [windows]
published: true
github_comments_issueid: "2"
---
题目应该是普通用户Windows下如何不写脚本、程序,批量地更改文件名。借助了excel,但是尽量不要写VBA,因为VBA对于普通用户还是有一定的难度。
## 获取文件名
尽量不使用Excel的VBA函数,如何能把一个目录的所有文件的文件名写到Excel里面?
首先,打开目录。

按Ctrl-C或者右键菜单复制:

打开浏览器,将复制的路径粘贴到地址栏并打回车:

出现文件夹内容:

按CTRL-A全选,再CTRL-C或者右键菜单复制。

再打开Excel,按CTRL-V粘贴进去。

删除第一、二行,再调整好宽度,顺序等。

至此,文件名导入EXCEL的工作完成
## 生成目标文件名
一般这种批量更改的情况下,目标文件名都有规律的,无非就是对原来的文件名进行某种更改,比如在这个例子中,可以将DSC替换成PIC等,或者按照一定的排序,用序号方式对文件进行命名,例如:PIC001,PIC002等。这些都需要使用到一点EXCEL的公式。
### 替换原文件名中的部分字符
在这里,将用到EXCEL公式里面的SUBSTITUE这个函数。具体用法是:
```vbscript
=SUBSTITUTE(单元格, "旧文本", "新文本")
```
我们选中,D2单元格,在里面打入:
```vbscript
=SUBSTITUTE(A2, "DSC_", "PIC")
```
回车:

然后选中D2单元格,把光标移到右下角,光标变成实心十字时,双击,这样整列到最后一行都会应用这个公式。

这个是替换原文件字符的做法。
### 用序号对文件进行命名
在这里会用到EXCEL的几个公式的函数:
- 行号,表示目前是EXCEL表的第几行:
```vbscript
ROW()
```
- 取单元格或者字符串结束部分,因为文件的扩展名有可能不同,我们要保留原来的扩展名:
```vbscript
RIGHT(单元格,长度)
```
- 替换单元格或者字符串的中间一段字符:
```vbscript
REPLACE(单元格, 开始位置, 结束位置, "字符串")
```
- 格式化数字的输出,比如我们想文件名呈现0001、0002这样的编号,而不是1、2这样。
```vbscript
text(数值, 格式)
```
- 将将各个单元格或者字符串连接起来。
```vbscript
CONCATENATE(文本1, 文本2, ... )
```
取A2的扩展名(包含”.“)就是:
```vbscript
REPLACE(RIGHT(A2,5),1,SEARCH(".",RIGHT(A2,5))-1,"")
```
格式化行号(第一行是标题,所以是:row()-1)的公式就是:
```vbscript
text(row()-1,"0000")
```
合起来就是
```vbscript
CONCATENATE("PIC",TEXT(ROW()-1,"0000"),REPLACE(RIGHT(A2,5),1,SEARCH(".",RIGHT(A2,5))-1,""))
```
在EXCEL中的D2写入以上公式,并打回车,再双击D2的右下角,把公式复制到整列直到最后一行。

这样就完成了按序号的新文件名的生成。
## 生成更改文件名的语句
利用Windows命令行中的命令:
```
ren 旧文件名 新文件名
```
为每个文件生成一个改名的语句,并将其放入一个批处理文件运行。
在E2中,打入以下公式(注意ren后面的空格和中间第三个参数的空格:
```vbscript
CONCATENATE("ren ",A2," ",D2)
```
同样,回车后,双击右下角,使公式应用到每一行中:

然后选中E列,复制,打开记事本,粘贴进去。并另存为文件所在目录下的rename.bat文件。

**备份好原来的文件**,在批量文件所在的目录中,双击运行此文件:

如果一切正常,所有的文件都将按excel的设置改好名字:

| 15.473684
| 125
| 0.746788
|
yue_Hant
| 0.627757
|
58e229ebf22dd9204da050860fabf1e771c99eef
| 468
|
md
|
Markdown
|
README.md
|
cznno/mycloud
|
98b4da477cfd28362643fe3e4cf39889b3ca7f56
|
[
"MIT"
] | null | null | null |
README.md
|
cznno/mycloud
|
98b4da477cfd28362643fe3e4cf39889b3ca7f56
|
[
"MIT"
] | null | null | null |
README.md
|
cznno/mycloud
|
98b4da477cfd28362643fe3e4cf39889b3ca7f56
|
[
"MIT"
] | null | null | null |
# my-cloud
A demo of Spring Cloud.
## Base Module
### discovery-server
port: 8050
eureka: service registry
### gateway
port: 8051
spring cloud zuul
### monitor-server
port: 8060
spring boot admin
### hystrix-dashboard
port: 8061
### turbine-server
port: 8062
## Service Module
### admin
port: 9000
backend admin platform
### common
common resources
### feign-consumer
port: 9001
### feign-service
port: 9002
### vertx-service
port: 9003
| 8.666667
| 24
| 0.679487
|
eng_Latn
| 0.566138
|
58e30ffabe57fd479da22255714fa65f9cb60a46
| 1,638
|
md
|
Markdown
|
docs/Model/ActivesessionResponseCompound.md
|
ezmaxinc/eZmax-SDK-php
|
e594ad304c4d114d2259ae700633209778471e3b
|
[
"MIT"
] | null | null | null |
docs/Model/ActivesessionResponseCompound.md
|
ezmaxinc/eZmax-SDK-php
|
e594ad304c4d114d2259ae700633209778471e3b
|
[
"MIT"
] | null | null | null |
docs/Model/ActivesessionResponseCompound.md
|
ezmaxinc/eZmax-SDK-php
|
e594ad304c4d114d2259ae700633209778471e3b
|
[
"MIT"
] | null | null | null |
# # ActivesessionResponseCompound
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**eActivesessionSessiontype** | [**\eZmaxAPI\Model\FieldEActivesessionSessiontype**](FieldEActivesessionSessiontype.md) | |
**eActivesessionWeekdaystart** | [**\eZmaxAPI\Model\FieldEActivesessionWeekdaystart**](FieldEActivesessionWeekdaystart.md) | |
**fkiLanguageID** | **int** | The unique ID of the Language. Valid values: |Value|Description| |-|-| |1|French| |2|English| |
**sCompanyNameX** | **string** | The Name of the Company in the language of the requester |
**sDepartmentNameX** | **string** | The Name of the Department in the language of the requester |
**bActivesessionDebug** | **bool** | Whether the active session is in debug or not |
**pksCustomerCode** | **string** | The customer code assigned to your account |
**aPkiPermissionID** | **int[]** | An array of permissions granted to the user or api key |
**objUserReal** | [**\eZmaxAPI\Model\ActivesessionResponseCompoundUser**](ActivesessionResponseCompoundUser.md) | |
**objUserCloned** | [**\eZmaxAPI\Model\ActivesessionResponseCompoundUser**](ActivesessionResponseCompoundUser.md) | | [optional]
**objApikey** | [**\eZmaxAPI\Model\ActivesessionResponseCompoundApikey**](ActivesessionResponseCompoundApikey.md) | | [optional]
**aEModuleInternalname** | **string[]** | An Array of Registered modules. These are the modules that are Licensed to be used by the User or the API Key. |
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
| 78
| 155
| 0.703297
|
yue_Hant
| 0.533469
|
58e31c21a4fef367694d2e508e6d78b79925b896
| 17,394
|
md
|
Markdown
|
articles/virtual-machines/workloads/mainframe-rehosting/microfocus/demo.md
|
Aisark/azure-docs.es-es
|
5078f9c88984709a7ffdfce8baab7cfbf42674c9
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
articles/virtual-machines/workloads/mainframe-rehosting/microfocus/demo.md
|
Aisark/azure-docs.es-es
|
5078f9c88984709a7ffdfce8baab7cfbf42674c9
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
articles/virtual-machines/workloads/mainframe-rehosting/microfocus/demo.md
|
Aisark/azure-docs.es-es
|
5078f9c88984709a7ffdfce8baab7cfbf42674c9
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
---
title: Configuración de Micro Focus CICS BankDemo para Micro Focus Enterprise Developer 4.0 en Azure Virtual Machines
description: Ejecute la aplicación Micro Focus BankDemo en Azure Virtual Machines (VM) para aprender a utilizar Micro Focus Enterprise Server y Enterprise Developer.
author: sread
ms.author: sread
ms.date: 03/30/2020
ms.topic: article
ms.service: multiple
ms.openlocfilehash: 7fb72b9a7d0d655f99d1e5cf194f7c6f26976a37
ms.sourcegitcommit: a43a59e44c14d349d597c3d2fd2bc779989c71d7
ms.translationtype: HT
ms.contentlocale: es-ES
ms.lasthandoff: 11/25/2020
ms.locfileid: "95976200"
---
# <a name="set-up-micro-focus-cics-bankdemo-for-micro-focus-enterprise-developer-40-on-azure"></a>Configuración de Micro Focus CICS BankDemo para Micro Focus Enterprise Developer 4.0 en Azure
Al configurar Micro Focus Enterprise Server 4.0 y Enterprise Developer 4.0 en Azure, puede probar las implementaciones de cargas de trabajo de IBM z/OS. En este artículo se muestra cómo configurar CICS BankDemo, una aplicación de ejemplo que se incluye con Enterprise Developer.
CICS significa Customer Information Control System, la plataforma de transacciones utilizada por muchas de las aplicaciones de sistema central en línea. La aplicación BankDemo es ideal para aprender cómo funcionan Enterprise Server y Enterprise Developer y cómo administrar e implementar una aplicación real completa con terminales de pantalla verde.
> [!NOTE]
> Próximamente: instrucciones para configurar [Micro Focus Enterprise Server 5.0](https://techcommunity.microsoft.com/t5/azurecat/micro-focus-enterprise-server-5-0-quick-start-template-on-azure/ba-p/1160110) en máquinas virtuales de Azure.
## <a name="prerequisites"></a>Requisitos previos
- Una máquina virtual con [Enterprise Developer](set-up-micro-focus-azure.md). Tenga en cuenta que Enterprise Developer tiene incluida una instancia completa de Enterprise Server para fines de desarrollo y pruebas. Esta instancia es la instancia de Enterprise Server utilizada para la demostración.
- [SQL Server 2017 Express Edition](https://www.microsoft.com/sql-server/sql-server-editions-express). Descárguelo e instálelo en la máquina virtual de Enterprise Developer. Enterprise Server requiere una base de datos para la administración de las regiones de CICS y la aplicación BankDemo también usa una base de datos de SQL Server llamada BANKDEMO. En esta demostración se asume que usa SQL Server Express para ambas bases de datos. Al instalar, seleccione la instalación básica.
- [SQL Server Management Studio](/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-2017) (SSMS). SSMS se usa para administrar las bases de datos y ejecutar un script de T-SQL. Descárguelo e instálelo en la máquina virtual de Enterprise Developer.
- [Visual Studio 2019](https://azure.microsoft.com/downloads/) con el Service Pack más reciente o [Visual Studio Community](https://visualstudio.microsoft.com/vs/community/), que puede descargar de forma gratuita.
- Rumba Desktop u otro emulador 3270.
## <a name="configure-the-windows-environment"></a>Configuración del entorno de Windows
Después de instalar Enterprise Developer 4.0 en la máquina virtual, debe configurar la instancia de Enterprise Server que se incluye con él. Para ello, deberá instalar algunas características adicionales de Windows como se indica a continuación.
1. Use RDP para iniciar sesión en la máquina virtual de Enterprise Server 4.0 que creó.
2. Haga clic en el icono **Buscar** situado junto al botón **Inicio** y escriba **características de Windows**. Se abre el asistente Agregar roles y características del Administrador del servidor.
3. Seleccione **Rol de servidor web (IIS)** y, a continuación, active las opciones siguientes:
- Herramientas de administración web
- Compatibilidad con la administración de IIS 6 (seleccionar todas las características disponibles)
- Consola de administración de IIS
- Scripts y herramientas de administración de IIS
- Servicio de administración de IIS
4. Seleccione **Servicios World Wide Web** y active las opciones siguientes:
Características de desarrollo de aplicaciones:
- Extensibilidad de .NET
- ASP.NET
- Características HTTP comunes: Agregar todas las características disponibles
- Estado y diagnóstico: Agregar todas las características disponibles
- Seguridad:
- Autenticación básica
- Autenticación de Windows
5. Seleccione **Servicio WAS (Windows Process Activation Service)** y todos sus elementos secundarios.
6. Para **Características**, active **Microsoft .NET Framework 3.5.1** y active las opciones siguientes:
- Windows Communication Foundation HTTP Activation
- Windows Communication Foundation Non-HTTP Activation
7. Para **Características**, active **Microsoft .NET Framework 4.6** y active las opciones siguientes:
- Activación de canalización con nombre
- Activación de TCP
- Uso compartido de puertos TCP

8. Cuando haya seleccionado todas las opciones, haga clic en **Siguiente** para instalar.
9. Después de las características de Windows, vaya a **Panel de Control \> Sistema y seguridad \> Herramientas administrativas** y seleccione **Servicios**. Desplácese hacia abajo y asegúrese de que los siguientes servicios están en ejecución y establecidos en **Automático**:
- **NetTcpPortSharing**
- **Adaptador de escucha Net.Pipe**
- **Adaptador de escucha Net.Tcp**
10. Para configurar IIS y la compatibilidad con WAS, en el menú, busque **Micro Focus Enterprise Developer Command Prompt (64 bits)** y ejecútelo como **Administrador**.
11. Escriba **wassetup –i** y presione **Entrar**.
12. Después de ejecutar el script, puede cerrar la ventana.
## <a name="configure-the-local-system-account-for-sql-server"></a>Configuración de la cuenta del sistema local para SQL Server
Algunos procesos de Enterprise Server deben poder iniciar sesión en SQL Server y crear bases de datos y otros objetos. Estos procesos usan la cuenta del sistema local, por lo que debe dar autoridad sysadmin a esa cuenta.
1. Inicie **SSMS** y haga clic en **Conectar** para conectarse al servidor local SQLEXPRESS con la autenticación de Windows. Debe estar disponible en la lista **Nombre del servidor**.
2. En el lado izquierdo, expanda la carpeta **Seguridad** y seleccione **Inicios de sesión**.
3. Seleccione **NT AUTHORITY\\SYSTEM** y seleccione **Propiedades**.
4. Seleccione **Roles de servidor** y active **sysadmin**.

## <a name="create-the-bankdemo-database-and-all-its-objects"></a>Creación de la base de datos BankDemo y todos sus objetos
1. Abra el **Explorador de Windows** y vaya a **C:\\Users\\Public\\Documents\\Micro Focus\\Enterprise Developer\\Samples\\Mainframe\\CICS\\DotNet\\BankDemo\\SQL**.
2. Copie el contenido del archivo **BankDemoCreateAll.SQL** en el Portapapeles.
3. Abra **SSMS**. A la derecha, haga clic en **Servidor** y seleccione **Nueva consulta**.
4. Pegue el contenido del Portapapeles en el cuadro de texto **Nueva consulta**.
5. Haga clic en **Ejecutar** desde la pestaña **Comando** encima de la consulta para ejecutar el archivo SQL.
La consulta se debería ejecutar sin errores. Cuando finalice, tendrá la base de datos de ejemplo para la aplicación BankDemo.

## <a name="verify-that-the-database-tables-and-objects-have-been-created"></a>Comprobación de la creación de las tablas y los objetos de la base de datos
1. Haga clic con el botón derecho en la base de datos **BANKDEMO** y seleccione **Actualizar**.
2. Expanda el elemento **Base de datos** y seleccione **Tablas**. Debe ver algo parecido a lo siguiente.

## <a name="build-the-application-in-enterprise-developer"></a>Compilación de la aplicación en Enterprise Developer
1. Abra Visual Studio e inicie sesión.
2. En la opción de menú **Archivo**, seleccione **Abrir proyecto/solución**, vaya a **C:\\Users\\Public\\Documents\\Micro Focus\\Enterprise Developer\\Samples\\Mainframe\\CICS\\DotNet\\BankDemo** y seleccione el archivo **sln**.
3. Examine con detenimiento los objetos. Los programas COBOL se muestran en el Explorador de soluciones con la extensión CBL junto con los CopyBooks (CPY) y JCL.
4. Haga clic con el botón derecho en el proyecto **BankDemo2** y seleccione **Establecer como proyecto de inicio**.
> [!NOTE]
> El proyecto BankDemo utiliza HCOSS (Opción de compatibilidad de host para SQL Server,) que no se utiliza para esta demostración.
5. En el **Explorador de soluciones**, haga clic con el botón derecho en el proyecto **BankDemo2** y seleccione **Compilar**.
> [!NOTE]
> La compilación en el nivel de solución produce errores, ya que no se ha configurado HCOSS.
6. Una vez compilado el proyecto, examine la ventana **Salida**. Debería parecerse a la imagen siguiente.

## <a name="deploy-the-bankdemo-application-into-the-region-database"></a>Implementación de la aplicación BankDemo en la base de datos de la región
1. Abra un símbolo del sistema de Enterprise Developer (64 bits) como Administrador.
2. Vaya a **%PUBLIC%\\Documents\\Micro Focus\\Enterprise Developer\\samples\\Mainframe\\CICS\\DotNet\\BankDemo**.
3. En el símbolo del sistema, ejecute **bankdemodbdeploy** e incluya el parámetro de la base de datos en la que se va a implementar, por ejemplo:
```
bankdemodbdeploy (local)/sqlexpress
```
> [!NOTE]
> Asegúrese de usar una barra diagonal (/) y no una barra diagonal inversa (\\). Este script se ejecuta durante un tiempo.

## <a name="create-the-bankdemo-region-in-enterprise-administrator-for-net"></a>Creación de la región BankDemo en Enterprise Administrator for .NET
1. Abra la interfaz de usuario **Enterprise Server for .NET Administration**.
2. Para iniciar el complemento de MMC, desde el menú **Inicio** de Windows, elija **Micro Focus Enterprise Developer \> Configuration \> Enterprise Server for .NET Admin**. (Para Windows Server, elija **Micro Focus Enterprise Developer \> Enterprise Server for .NET Admin**).
3. Expanda el contenedor **Regions** (Regiones) en el panel izquierdo y, a continuación, haga clic con el botón derecho en **CICS**.
4. Seleccione **Define Region** (Definir región) para crear una nueva región de CICS llamada **BANKDEMO**, hospedada en la base de datos (local).
5. Proporcione la instancia del servidor de base de datos, haga clic en **Next** (Siguiente) y, a continuación, escriba el nombre de la región **BANKDEMO**.

6. Para seleccionar el archivo de definición de región para la base de datos de regiones, busque **region\_bankdemo\_db.config** en **C:\\Users\\Public\\Documents\\Micro Focus\\Enterprise Developer\\Samples\\Mainframe\\CICS\\DotNet\\BankDemo**.

7. Haga clic en **Finalizar**
## <a name="create-xa-resource-definitions"></a>Creación de las definiciones de recursos XA
1. En el panel izquierdo de la interfaz de usuario **Enterprise Server for .NET Administration**, expanda **System** (Sistema) y, a continuación, **XA Resource Definitions** (Definiciones de recursos XA). Esta configuración define cómo interactúa la región con Enterprise Server y las bases de datos de la aplicación.
2. Haga clic con el botón derecho en **XA Resource Definitions** (Definiciones de recursos XA) y seleccione **Add Server Instance** (Agregar instancia de servidor).
3. En el cuadro de lista desplegable, seleccione **Database Service Instance** (Instancia de servicio de base de datos). Será SQLEXPRESS del equipo local.
4. Seleccione la instancia en el contenedor **XA Resource Definitions (machinename\\sqlexpress)** y haga clic en **Add** (Agregar).
5. Seleccione **Database XA Resource Definition** (Definición de recurso XA de base de datos) y, a continuación, escriba **BANKDEMO** para los campos **Name** (Nombre) y **Region** (Región).

6. Haga clic en el botón de puntos suspensivos ( **...** ) para mostrar el Asistente para la cadena de conexión. En **Nombre del servidor**, escriba **(local)\\SQLEXPRESS**. Para **Inicio de sesión**, seleccione **Autenticación de Windows**. En Nombre de la base de datos, escriba **BANKDEMO**.

7. Pruebe la conexión.
## <a name="start-the-bankdemo-region"></a>Inicio de la región BANKDEMO
> [!NOTE]
> El primer paso es importante: Debe establecer la región para que utilice la definición de recurso XA que acaba de crear.
1. Vaya a la región **BANKDEMO CICS Region** en la sección **Regions Container** (Contenedor de regiones) y, a continuación, seleccione **Edit Region Startup File** (Editar archivo de inicio de región) desde el panel **Actions** (Acciones). Desplácese hacia abajo hasta las propiedades de SQL y escriba **bankdemo** para el campo **XA resource name** (Nombre del recurso XA) o use el botón de puntos suspensivos para seleccionarlo.
2. Haga clic en el icono **Save** (Guardar) para guardar los cambios.
3. Haga clic con el botón derecho en **BANKDEMO CICS Region** en el panel **Console** (Consola) y seleccione **Start/Stop Region** (Iniciar/Detener región).
4. En la parte inferior del cuadro de texto **Start/Stop Region** (Iniciar/Detener región) que aparece en el panel central, seleccione **Start** (Iniciar). Después de unos segundos, se inicia la región.


## <a name="create-a-listener"></a>Creación de un agente de escucha
Cree un agente de escucha para las sesiones de TN3270 que tienen acceso a la aplicación BankDemo.
1. En el panel izquierdo, expanda **Configuration Editors** (Editores de configuración) y seleccione **Listener** (Agente de escucha).
2. Haga clic en el icono **Open File** (Abrir archivo) y seleccione el archivo **seelistener.exe.config**. Este archivo se va a editar y se carga cada vez que se inicia Enterprise Server.
3. Observe las dos regiones definidas previamente (ESDEMO y JCLDEMO).
4. Para crear una nueva región para BANKDEMO, haga clic con el botón derecho en **Regions** (Regiones) y seleccione **Add Region** (Agregar región).
5. Seleccione **BANKDEMO Region**.
6. Agregue un canal de TN3270; para ello, haga clic con el botón derecho en **BANKDEMO Region** y seleccione **Add Channel** (Agregar canal).
7. En el campo **Name** (Nombre), escriba **TN3270**. En el campo **Port** (Puerto), escriba **9024**. La aplicación ESDEMO utiliza el puerto 9230, por lo que deberá usar un puerto diferente.
8. Para guardar el archivo, haga clic en el icono **Guardar** o seleccione **Archivo** \> **Guardar**.
9. Para iniciar el cliente de escucha, haga clic en **Iniciar el agente de escucha** o elija **Opciones** \> **Iniciar el agente de escucha**.

## <a name="configure-rumba-to-access-the-bankdemo-application"></a>Configuración de Rumba para el acceso a la aplicación BankDemo
Lo último que debe hacer es configurar una sesión de 3270 con Rumba, un emulador 3270. Este paso le permite acceder a la aplicación BankDemo mediante el agente de escucha que creó.
1. Desde el menú **Inicio** de Windows, inicie Rumba Desktop.
2. En el elemento de menú **Connections** (Conexiones), seleccione **TN3270**.
3. Haga clic en **Insert** (Insertar) y escriba **127.0.0.1** para la dirección IP y **9024** para el puerto definido por el usuario.
4. En la parte inferior del cuadro de diálogo, haga clic en **Connect** (Conectar). Aparece una pantalla de CICS en negro.
5. Escriba **bank** para mostrar la pantalla inicial de 3270 para la aplicación BankDemo.
6. Para el identificador de usuario, escriba **B0001** y para la contraseña, escriba cualquier cosa. Se abre la primera pantalla BANK20.


Felicidades. Ahora tiene una aplicación de CICS en ejecución en Azure con Micro Focus Enterprise Server.
## <a name="next-steps"></a>Pasos siguientes
- [Ejecución de Enterprise Server en contenedores de Docker en Azure](run-enterprise-server-container.md)
- [Migración del sistema central: portal](/archive/blogs/azurecat/mainframe-migration-to-azure-portal)
- [Máquinas virtuales](../../../linux/overview.md)
- [Solución de problemas](../../../troubleshooting/index.yml)
- [Demystifying mainframe to Azure migration](https://azure.microsoft.com/resources/demystifying-mainframe-to-azure-migration/en-us/) (Desmitificación de la migración del sistema central a Azure)
| 62.121429
| 483
| 0.760262
|
spa_Latn
| 0.967664
|
58e37b5f4550ee14b500b89cd1aabf8d126a4aab
| 1,194
|
md
|
Markdown
|
_posts/2018-07-02-reonomy.md
|
Pascamel/pascamel.github.io
|
98c5f48c6dff95998647760a252f136ab7f36e0a
|
[
"MIT"
] | null | null | null |
_posts/2018-07-02-reonomy.md
|
Pascamel/pascamel.github.io
|
98c5f48c6dff95998647760a252f136ab7f36e0a
|
[
"MIT"
] | 1
|
2020-05-16T14:17:45.000Z
|
2020-05-16T14:17:45.000Z
|
_posts/2018-07-02-reonomy.md
|
Pascamel/pascamel.github.io
|
98c5f48c6dff95998647760a252f136ab7f36e0a
|
[
"MIT"
] | null | null | null |
---
title: reonomy
tag: work
layout: article
permalink: /reonomy/
excerpt: >
Reonomy leverages big data, partnerships and machine learning to connect the fragmented, disparate world of commercial real estate.
article_header:
type: cover
image:
src: /assets/images/reonomy.jpg
---
#### info
- [https://www.reonomy.com/](https://www.reonomy.com/)
- Software engineer from 7/2018 to 10/2019
#### presentation
Reonomy leverages big data, partnerships and machine learning to connect the fragmented, disparate world of commercial real estate. By providing unparalleled access to property intelligence, Reonomy products empower individuals, teams, and companies to unlock insights and discover new opportunities.
Headquartered in New York, Reonomy has raised $128 million from top investors, including Sapphire Ventures, Bain Capital, Softbank, Primary Ventures, Georgian Partners, Wells Fargo Strategic Capital, Citi Ventures, and Untitled Investors. Our clients represent the biggest names in CRE, including Newmark Knight Frank, Cushman & Wakefield, Tishman Speyer and WeWork.
#### Tech stack:
- React
- Typescript
- RxJS
- AngularJS
- Python
- Flask
- PostgreSQL
- Elasticsearch
| 34.114286
| 366
| 0.779732
|
eng_Latn
| 0.958173
|
58e39b0cae9e6dd715c9c0b7e2d114b5ca799082
| 1,170
|
md
|
Markdown
|
docs/rules/en/Azure.SQL.DBName.md
|
rayhogan/PSRule.Rules.Azure
|
f0b48d5726a169f7b39d5baa0bc63b03a94f9db0
|
[
"MIT"
] | 1
|
2021-03-21T13:31:00.000Z
|
2021-03-21T13:31:00.000Z
|
docs/rules/en/Azure.SQL.DBName.md
|
rayhogan/PSRule.Rules.Azure
|
f0b48d5726a169f7b39d5baa0bc63b03a94f9db0
|
[
"MIT"
] | 6
|
2021-03-22T19:51:55.000Z
|
2021-04-02T07:44:42.000Z
|
docs/rules/en/Azure.SQL.DBName.md
|
Tryweirder/PSRule.Rules.Azure
|
7474b0c524e68d19d41df95ce290e561f659e23a
|
[
"MIT"
] | 1
|
2021-03-21T13:31:03.000Z
|
2021-03-21T13:31:03.000Z
|
---
severity: Awareness
pillar: Operational Excellence
category: Tagging and resource naming
resource: SQL Database
online version: https://github.com/Microsoft/PSRule.Rules.Azure/blob/main/docs/rules/en/Azure.SQL.DBName.md
---
# Use valid SQL Database names
## SYNOPSIS
Azure SQL Database names should meet naming requirements.
## DESCRIPTION
When naming Azure resources, resource names must meet service requirements.
The requirements for SQL Database names are:
- Between 1 and 128 characters long.
- Letters, numbers, and special characters except: `<>*%&:\/?`
- Can't end with period or a space.
- Azure SQL Database names must be unique for each logical server.
The following reserved database names can not be used:
- `master`
- `model`
- `tempdb`
## RECOMMENDATION
Consider using names that meet Azure SQL Database naming requirements.
Additionally consider naming resources with a standard naming convention.
## NOTES
This rule does not check if Azure SQL Database names are unique.
## LINKS
- [Naming rules and restrictions for Azure resources](https://docs.microsoft.com/azure/azure-resource-manager/management/resource-name-rules#microsoftsql)
| 27.209302
| 154
| 0.778632
|
eng_Latn
| 0.825355
|
58e3e66544340e903cf3182600bfd27289c743c8
| 766
|
md
|
Markdown
|
site/doc/pt/cookbook/content_in_div.md
|
martinphellwig/brython_wf
|
e169afc1e048cba0c12118b4cd6f109df6fe67c9
|
[
"BSD-3-Clause"
] | 2
|
2018-06-09T15:29:48.000Z
|
2019-11-13T09:15:08.000Z
|
site/doc/pt/cookbook/content_in_div.md
|
martinphellwig/brython_wf
|
e169afc1e048cba0c12118b4cd6f109df6fe67c9
|
[
"BSD-3-Clause"
] | 2
|
2017-04-14T03:52:41.000Z
|
2017-04-14T04:02:06.000Z
|
site/doc/pt/cookbook/content_in_div.md
|
martinphellwig/brython_wf
|
e169afc1e048cba0c12118b4cd6f109df6fe67c9
|
[
"BSD-3-Clause"
] | 2
|
2018-02-22T09:48:18.000Z
|
2020-06-04T17:00:09.000Z
|
Problema
--------
Mostrar conteúdo em um elemento da página web
Solução
-------
<table width="100%">
<tr>
<td style="width:50%;">
<html>
<head>
<script src="brython.js"></script>
</head>
<body onload="brython()">
<script type="text/python">
from browser import doc
doc['zone'] <= "blah "
</script>
</body>
</html>
<button id="fill_zone">Teste</button>
</td>
<td id="zone" style="background-color:#FF7400;text-align:center;">Conteúdo inicial<p>
</td>
</tr>
</table>
<script type="text/python3">
from browser import doc
def fill_zone(ev):
doc["zone"] <= "bla "
doc['fill_zone'].bind('click', fill_zone)
</script>
`doc["zone"]` é o elemento na página web com id "zone" (a célula
colorida da tabela).
| 16.297872
| 85
| 0.60705
|
por_Latn
| 0.294703
|
58e3edc7ce5505f63c4325563b8ba0b0cf885865
| 3,204
|
md
|
Markdown
|
node_modules/gulp-coffee/README.md
|
ivan-programmer/simplify-math
|
e45d3dbb569cd73a86dc6fa37b111d931b34f3c5
|
[
"Apache-2.0"
] | 16
|
2020-12-16T09:35:23.000Z
|
2022-03-13T23:30:32.000Z
|
node_modules/gulp-coffee/README.md
|
ivan-programmer/simplify-math
|
e45d3dbb569cd73a86dc6fa37b111d931b34f3c5
|
[
"Apache-2.0"
] | 3
|
2021-05-21T14:08:01.000Z
|
2022-01-09T10:34:59.000Z
|
node_modules/gulp-coffee/README.md
|
ivan-programmer/simplify-math
|
e45d3dbb569cd73a86dc6fa37b111d931b34f3c5
|
[
"Apache-2.0"
] | 15
|
2021-02-21T12:46:02.000Z
|
2022-03-08T13:47:40.000Z
|
[](https://travis-ci.org/contra/gulp-coffee)
## Information
<table>
<tr>
<td>Package</td><td>gulp-coffee</td>
</tr>
<tr>
<td>Description</td>
<td>Compiles CoffeeScript</td>
</tr>
<tr>
<td>Node Version</td>
<td>>= 0.9</td>
</tr>
</table>
## Usage
```javascript
var coffee = require('gulp-coffee');
gulp.task('coffee', function() {
gulp.src('./src/*.coffee')
.pipe(coffee({bare: true}))
.pipe(gulp.dest('./public/'));
});
```
## Options
- `coffee` (optional): A reference to a custom CoffeeScript version/fork (eg. `coffee: require('my-name/coffeescript')`)
Additionally, the options object supports all options that are supported by the standard CoffeeScript compiler.
## Source maps
### gulp 3.x
gulp-coffee can be used in tandem with [gulp-sourcemaps](https://github.com/floridoo/gulp-sourcemaps) to generate source maps for the coffee to javascript transition. You will need to initialize [gulp-sourcemaps](https://github.com/floridoo/gulp-sourcemaps) prior to running the gulp-coffee compiler and write the source maps after.
```javascript
var sourcemaps = require('gulp-sourcemaps');
gulp.src('./src/*.coffee')
.pipe(sourcemaps.init())
.pipe(coffee())
.pipe(sourcemaps.write())
.pipe(gulp.dest('./dest/js'));
// will write the source maps inline in the compiled javascript files
```
By default, [gulp-sourcemaps](https://github.com/floridoo/gulp-sourcemaps) writes the source maps inline in the compiled javascript files. To write them to a separate file, specify a relative file path in the `sourcemaps.write()` function.
```javascript
var sourcemaps = require('gulp-sourcemaps');
gulp.src('./src/*.coffee')
.pipe(sourcemaps.init())
.pipe(coffee({ bare: true }))
.pipe(sourcemaps.write('./maps'))
.pipe(gulp.dest('./dest/js'));
// will write the source maps to ./dest/js/maps
```
### gulp 4.x
In gulp 4, sourcemaps are built-in by default.
```js
gulp.src('./src/*.coffee', { sourcemaps: true })
.pipe(coffee({ bare: true }))
.pipe(gulp.dest('./dest/js'));
```
## LICENSE
(MIT License)
Copyright (c) 2015 Fractal <contact@wearefractal.com>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| 31.106796
| 332
| 0.731273
|
eng_Latn
| 0.640864
|
58e45ccdb9d160858ee2a6b374d5e09d48f79dcb
| 1,029
|
md
|
Markdown
|
README.md
|
retrage/soramimi
|
4b5a964fa0f49e20d5fa9bf09f5d4acd56cb568c
|
[
"MIT"
] | 1
|
2019-11-24T16:50:30.000Z
|
2019-11-24T16:50:30.000Z
|
README.md
|
retrage/soramimi
|
4b5a964fa0f49e20d5fa9bf09f5d4acd56cb568c
|
[
"MIT"
] | null | null | null |
README.md
|
retrage/soramimi
|
4b5a964fa0f49e20d5fa9bf09f5d4acd56cb568c
|
[
"MIT"
] | null | null | null |
# Soramimi Word Cloud

"Soramimi Hour" is an well-know feature on the Japanese TV show,
[Tamori Club](https://www.tv-asahi.co.jp/tamoriclub/#/?category=variety).
This repository contains an scraping script for obtaining almost all
soramimi works introduced on the program and the visualization script.
The data source is
[A list of past soramimi featured on "Soramimi Hour"](http://www7a.biglobe.ne.jp/~soramimiupdate/past.htm).
## Visualizing soramimi with word cloud

On "Soramimi Hour", Tamori scores every soramimi by selecting a prize from
towel, earpick, T-shirt, and jacket. The visualization script can generate
a word cloud weighted by the evaluation.
The weight setting is like this:
| Prize | Weight |
| ------- | ------ |
| Towel | 1.0 |
| Earpick | 1.5 |
| T-shirt | 2.0 |
| Jacket | 2.5 |
| Else | 1.0 |

| 33.193548
| 107
| 0.724976
|
eng_Latn
| 0.938491
|
58e4d8cd3e84d9dca40c1b0d4d3cf7c3103a1d38
| 62
|
md
|
Markdown
|
README.md
|
jdmesalosada/interviews
|
2a324cc4f59ae1271e5e8c477c96f447b0d172f7
|
[
"Apache-2.0"
] | null | null | null |
README.md
|
jdmesalosada/interviews
|
2a324cc4f59ae1271e5e8c477c96f447b0d172f7
|
[
"Apache-2.0"
] | null | null | null |
README.md
|
jdmesalosada/interviews
|
2a324cc4f59ae1271e5e8c477c96f447b0d172f7
|
[
"Apache-2.0"
] | null | null | null |
https://gitpod.io/#https://github.com/jdmesalosada/interviews
| 31
| 61
| 0.790323
|
yue_Hant
| 0.725953
|
58e531c92c9ca6d9e17efbb1a6e89bdab342e502
| 328
|
md
|
Markdown
|
P09X Drawing/README.md
|
JulesMoorhouse/100DaysOfSwiftUI
|
f4c1a45996be501f9c7beaf6d32bc24050811ab6
|
[
"MIT"
] | null | null | null |
P09X Drawing/README.md
|
JulesMoorhouse/100DaysOfSwiftUI
|
f4c1a45996be501f9c7beaf6d32bc24050811ab6
|
[
"MIT"
] | null | null | null |
P09X Drawing/README.md
|
JulesMoorhouse/100DaysOfSwiftUI
|
f4c1a45996be501f9c7beaf6d32bc24050811ab6
|
[
"MIT"
] | null | null | null |
# Day 46 | [HWS 46](https://www.hackingwithswift.com/100/swiftui/46) | [Index](https://github.com/JulesMoorhouse/100DaysOfSwiftUI/blob/main/README.md)
- [P09X Drawing](https://github.com/JulesMoorhouse/100DaysOfSwiftUI/blob/main/P09X%20Drawing/P09X%20Drawing/ContentView.swift)
- Challenge.
<img src="../Images/day46x.gif">
| 41
| 150
| 0.759146
|
yue_Hant
| 0.648866
|
58e555a1269f6e77b44397d7382840a13c2428ff
| 38
|
md
|
Markdown
|
packages/popover/readme.md
|
Nelias/smashing-ui
|
b34c12bce636f70901e1aab314629bbb23bbdbbf
|
[
"MIT"
] | 14
|
2019-03-31T18:45:26.000Z
|
2020-10-30T06:45:24.000Z
|
packages/popover/readme.md
|
Nelias/smashing-ui
|
b34c12bce636f70901e1aab314629bbb23bbdbbf
|
[
"MIT"
] | 31
|
2019-04-03T19:01:45.000Z
|
2022-02-26T11:36:45.000Z
|
packages/popover/readme.md
|
Nelias/smashing-ui
|
b34c12bce636f70901e1aab314629bbb23bbdbbf
|
[
"MIT"
] | 2
|
2019-10-29T15:55:07.000Z
|
2019-11-21T12:31:18.000Z
|
```sh
yarn add @smashing/popover
```
| 7.6
| 26
| 0.631579
|
uzn_Latn
| 0.52362
|
58e595d3a98fb3579c116db1fbe3fa5dc0b11db4
| 4,822
|
md
|
Markdown
|
articles/cognitive-services/Translator/document-translation/reference/get-glossary-formats.md
|
fuatrihtim/azure-docs.tr-tr
|
6569c5eb54bdab7488b44498dc4dad397d32f1be
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
articles/cognitive-services/Translator/document-translation/reference/get-glossary-formats.md
|
fuatrihtim/azure-docs.tr-tr
|
6569c5eb54bdab7488b44498dc4dad397d32f1be
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
articles/cognitive-services/Translator/document-translation/reference/get-glossary-formats.md
|
fuatrihtim/azure-docs.tr-tr
|
6569c5eb54bdab7488b44498dc4dad397d32f1be
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
---
title: Belge çevirisi sözlük biçimlerini al yöntemi
titleSuffix: Azure Cognitive Services
description: Sözlük biçimlerini al yöntemi, desteklenen sözlük biçimlerinin listesini döndürür.
services: cognitive-services
author: jann-skotdal
manager: nitinme
ms.service: cognitive-services
ms.subservice: translator-text
ms.topic: reference
ms.date: 03/25/2021
ms.author: v-jansk
ms.openlocfilehash: fa4f89fb312e76d72447552b156d35bf3d0404bc
ms.sourcegitcommit: c94e282a08fcaa36c4e498771b6004f0bfe8fb70
ms.translationtype: MT
ms.contentlocale: tr-TR
ms.lasthandoff: 03/26/2021
ms.locfileid: "105613142"
---
# <a name="document-translation-get-glossary-formats"></a>Belge çevirisi: Sözlük biçimlerini al
Sözlük biçimlerini al yöntemi, belge çevirisi hizmeti tarafından desteklenen desteklenen sözlük biçimlerinin bir listesini döndürür. Liste, kullanılan ortak dosya uzantısını içerir.
## <a name="request-url"></a>İstek URL’si
Şu kişiye bir `GET` istek gönder:
```HTTP
GET https://<NAME-OF-YOUR-RESOURCE>.cognitiveservices.azure.com/translator/text/batch/v1.0-preview.1/glossaries/formats
```
[Özel etki alanı adınızı](../get-started-with-document-translation.md#find-your-custom-domain-name)bulmayı öğrenin.
> [!IMPORTANT]
>
> * **Belge çevirisi hizmetine yönelik tüm API istekleri özel bir etki alanı uç noktası gerektirir**.
> * Belge çevirisi için HTTP istekleri yapmak üzere Azure portal kaynak _anahtarlarınız ve uç_ nokta sayfanızda veya küresel çevirmen uç noktasında bulunan uç noktayı kullanamazsınız `api.cognitive.microsofttranslator.com` .
## <a name="request-headers"></a>İstek üst bilgileri
İstek üst bilgileri:
|Üst Bilgiler|Description|
|--- |--- |
|Ocp-Apim-Subscription-Key|Gerekli istek üst bilgisi|
## <a name="response-status-codes"></a>Yanıt durum kodları
Bir isteğin döndürdüğü olası HTTP durum kodları aşağıda verilmiştir.
|Durum Kodu|Description|
|--- |--- |
|200|Tamam ögesini seçin. Desteklenen sözlük dosyası biçimlerinin listesini döndürür.|
|500|İç sunucu hatası.|
|Diğer durum kodları|<ul><li>Çok fazla istek</li><li>Sunucu geçici olarak kullanılamıyor</li></ul>|
## <a name="get-glossary-formats-response"></a>Sözlük biçimlerini al yanıtı
Listenin temel türü, sözlük biçimlerini al API 'sinde döndürülür.
### <a name="successful-get-glossary-formats-response"></a>Başarılı sözlük biçimleri yanıtı al
Listenin temel türü, sözlük biçimlerini al API 'sinde döndürülür.
|Durum Kodu|Description|
|--- |--- |
|200|Tamam ögesini seçin. Desteklenen sözlük dosyası biçimlerinin listesini döndürür.|
|500|İç sunucu hatası.|
|Diğer durum kodları|Çok fazla requestsServer geçici olarak kullanılamıyor|
### <a name="error-response"></a>Hata yanıtı
|Ad|Tür|Description|
|--- |--- |--- |
|kod|string|Üst düzey hata kodlarını içeren Numaralandırmalar. Olası değerler:<br/><ul><li>InternalServerError</li><li>InvalidArgument</li><li>Invalidrequest</li><li>RequestRateTooHigh</li><li>ResourceNotFound</li><li>ServiceUnavailable</li><li>Yetkisiz</li></ul>|
|message|string|Üst düzey hata iletisini alır.|
|ınnererror|InnerErrorV2|Bilişsel hizmetler API yönergelerine uyan yeni bir Iç hata biçimi. Gerekli özellikler hata kodu, ileti ve isteğe bağlı özellikler hedefi, ayrıntılar (anahtar değeri çifti), iç hata (Bu iç içe olabilir) içeriyor.|
|ınnererror. Code|string|Kod hata dizesini alır.|
|ınnererror. Message|string|Üst düzey hata iletisini alır.|
## <a name="examples"></a>Örnekler
### <a name="example-successful-response"></a>Örnek başarılı yanıt
Başarılı bir yanıt örneği aşağıda verilmiştir.
```JSON
{
"value": [
{
"format": "XLIFF",
"fileExtensions": [
".xlf"
],
"contentTypes": [
"application/xliff+xml"
],
"versions": [
"1.0",
"1.1",
"1.2"
]
},
{
"format": "TSV",
"fileExtensions": [
".tsv",
".tab"
],
"contentTypes": [
"text/tab-separated-values"
],
"versions": []
}
]
}
```
### <a name="example-error-response"></a>Örnek hata yanıtı
Aşağıda bir hata yanıtı örneği verilmiştir. Diğer hata kodlarının şeması aynı.
Durum kodu: 500
```JSON
{
"error": {
"code": "InternalServerError",
"message": "Internal Server Error",
"innerError": {
"code": "InternalServerError",
"message": "Unexpected internal server error has occurred"
}
}
}
```
## <a name="next-steps"></a>Sonraki adımlar
Belge çevirisi ve istemci kitaplığı kullanma hakkında daha fazla bilgi edinmek için hızlı başlangıçlarımızı izleyin.
> [!div class="nextstepaction"]
> [Belge çevirisi ile çalışmaya başlama](../get-started-with-document-translation.md)
| 33.72028
| 264
| 0.703028
|
tur_Latn
| 0.994053
|
58e754660b29cf678708cd37a200a556f58ca0d6
| 1,787
|
md
|
Markdown
|
documentation/docs/api/event-system.md
|
jeffreylanters/react-unity
|
f47d288fa8c63ef3e4b88672d047e4bff477eed1
|
[
"Apache-2.0"
] | null | null | null |
documentation/docs/api/event-system.md
|
jeffreylanters/react-unity
|
f47d288fa8c63ef3e4b88672d047e4bff477eed1
|
[
"Apache-2.0"
] | null | null | null |
documentation/docs/api/event-system.md
|
jeffreylanters/react-unity
|
f47d288fa8c63ef3e4b88672d047e4bff477eed1
|
[
"Apache-2.0"
] | null | null | null |
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# Communication from Unity to React
The event system allows you to receive messages sent from the Unity game.
> Available since version 9.0.0
## Type Definition
```tsx title="Type Definition"
function addEventListener: (
eventName: string,
callback: (...parameters: ReactUnityEventParameterType[]) => void
) => void;
```
```tsx title="Type Definition"
function removeEventListener: (
eventName: string,
callback: (...parameters: ReactUnityEventParameterType[]) => void
) => void;
```
```tsx title="Type Definition"
function dispatchReactUnityEvent = (
eventName: string,
...parameters: ReactUnityEventParameterType[]
): void
```
## Implementation
Sending messages from Unity to React is done by registering an event listener to the Unity Context instance. Event listeners are distinguished by the name of the event. The event listener takes a callback function as its second parameter. The callback function will be invoked when the event is fired, the passed parameters will be passed to the callback function.
:::info
Keep in mind communication from Unity to React is handeld globally, this means event listeners with the same name will be invoked on all Unity Context instances.
:::
:::info
Simple numeric types can be passed to JavaScript in function parameters without requiring any conversion. Other data types will be passed as a pointer in the emscripten heap (which is really just a big array in JavaScript). For strings, you can use the Pointerstringify helper function to convert to a JavaScript string. You can read more about [parameters and JavaScript to Unityscript types here](http://localhost:3000/docs/main-concepts/javascript-to-unityscript-types).
:::
<!-- TODO finish -->
| 38.847826
| 473
| 0.769446
|
eng_Latn
| 0.983836
|
58e7ea78b268b8a073f67b3ee3ef420eb59d3918
| 268
|
md
|
Markdown
|
README.md
|
JasonHolm/typing-test
|
fb3286f9e324e2303f49cec4f1bca6b90c7529f8
|
[
"MIT"
] | 1
|
2019-08-20T01:14:51.000Z
|
2019-08-20T01:14:51.000Z
|
README.md
|
JasonHolm/typing-test
|
fb3286f9e324e2303f49cec4f1bca6b90c7529f8
|
[
"MIT"
] | null | null | null |
README.md
|
JasonHolm/typing-test
|
fb3286f9e324e2303f49cec4f1bca6b90c7529f8
|
[
"MIT"
] | null | null | null |
# Typing Test
This is a simple typing test game in Rust. You can use it to test your typing speed on a choice of 3 different prompts.
Run with `cargo run`.
## License
This program is licensed under the "MIT License". Please see the file `LICENSE` for license terms.
| 33.5
| 119
| 0.753731
|
eng_Latn
| 0.99968
|
58e82e09770637868320394c3b7d3290ebdd93de
| 4,291
|
md
|
Markdown
|
content/blog/watch-position-tips.md
|
chenesan/chenesan.github.io
|
14017aa9e687132d03c835dab60d6146a52a18a3
|
[
"MIT"
] | 2
|
2020-09-04T04:17:37.000Z
|
2020-09-04T04:17:39.000Z
|
content/blog/watch-position-tips.md
|
chenesan/chenesan.github.io
|
14017aa9e687132d03c835dab60d6146a52a18a3
|
[
"MIT"
] | null | null | null |
content/blog/watch-position-tips.md
|
chenesan/chenesan.github.io
|
14017aa9e687132d03c835dab60d6146a52a18a3
|
[
"MIT"
] | null | null | null |
---
title: 我錯了,取使用者定位沒這麼簡單。
date: '2021-07-10T17:30:00.000Z'
tags: ["frontend", "programming"]
description: '聊聊最近用 navigator.geolcation.watchPosition 監聽使用者定位踩到的雷;safari 加油啊。'
---
## 初見 [`navigator.geolocation.watchPosition`](https://developer.mozilla.org/zh-TW/docs/Web/API/Geolocation/watchPosition)
最近專案上遇到要在網頁上監聽使用者定位的需求,餵狗一下就找到這 api。
初看之下覺得很簡單。呼叫 `watchPosition()` 之後,瀏覽器會跳出詢問使用者是否要授權該網站取得定位資訊的 popup,如果使用者接受,瀏覽器就去抓定位,抓到了就會帶著位置資訊傳進 success 的 callback,後續有使用者位置變更時也會呼叫 success callback;反之如果使用者拒絕,或是使用者雖然接受了但瀏覽器卻抓不到位置,則呼叫 error callback。想像實作大概就像這樣:
```jsx
const options = {
timeout: 10000,
};
const watchId = navigator.geolocation.watchPosition(
// success callback
(position) => {
console.log('get position', position);
// take position info to do what you want
},
// error callback
(error) => {
console.log('error');
// handle error
},
options
);
// when cleanup
navigator.geolocation.clearWatch(watchId);
```
感覺不難。
## 事情永遠不是你想的那樣
功能做完進測之後,QE 回報在 ios(iphone / ipad,12 / 13 / 14 都會) 上,如果把系統定位關掉,畫面上顯示等待索取定位的 loading icon 就會一直不停的轉轉轉。
我進去看,發現 success 和 error callback 都沒有呼叫,所以程式完全無法在 callback 裡把 loading icon 拔掉。
登楞。
## 「不對啊,我有在 options 裡帶 timeout 餒!」
這個...此 timeout 非彼 timeout 啊。
[MDN](https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions/timeout) 沒詳細寫,在 StackOverflow 上爬了五六篇文才看到有人說,[options 的 timeout 是指系統取得使用者授權後,取得使用者定位的時間限制](https://stackoverflow.com/questions/3397585/navigator-geolocation-getcurrentposition-sometimes-works-sometimes-doesnt/3885172#comment40751568_3885172)。也就是說,如果使用者看到授權 popup 卻沒有動作,`watchPosition` 的 callback 永遠不會被呼叫,即使你有設這個 timeout。
而在使用者關閉系統定位、載入頁面後索取定位的情況下,android chrome 會自動呼叫 error callback、手邊的桌機(MacOS)也會,所以至少我們還可以在 error callback 隱藏 loading icon。但...就你 ios safari 和別人不一樣,連 error callback 也不呼叫......不愧是新一代 IE 的 safari 啊。
神祕的是,後續如果再重開頁面,或是在使用者點擊按鈕後才索取定位,這時 ios safari 就能正常呼叫 error callback 了,真是遲鈍(?)。我猜測,或許 safari 不鼓勵網頁在未發生使用者互動的狀況下觸發定位授權吧(確實有點擾民),但有時 application 又的確需要這麼做......
## 我們可以先用 [`navigator.permissions.query`](https://developer.mozilla.org/en-US/docs/Web/API/Permissions/query) 看使用者是否拒絕我們給定位,拒絕的話就不要定位了!
聽起來好像可以!我看看 api 怎麼用!
(After googling around 10 minutes)
不,CanIUse 說有個常見的瀏覽器不支援這個 api,猜猜是誰?你知道的,[safari](https://caniuse.com/permissions-api)。
## 最後的解法
只好自己做 timeout,當 success / error 時清掉 timeout,否則就把 loading 設為 false。
```jsx
let watchPositionTimeoutHandle = null;
const options = {
timeout: 10000,
};
const watchId = navigator.geolocation.watchPosition(
// success callback
(position) => {
console.log('get position:', position);
// clear timeout to prevent cleanup
if (watchPositionTimeoutHandle) {
window.clearTimeout(watchPositionTimeoutHandle);
watchPositionTimeoutHandle = null;
}
// do your thing
},
// error callback
(error) => {
console.log('error')
// clear timeout to prevent cleanup
if (watchPositionTimeoutHandle) {
window.clearTimeout(watchPositionTimeoutHandle);
watchPositionTimeoutHandle = null
}
// do your thing
},
options
);
watchPositionTimeoutHandle = window.setTimeout(
() => {
// if watchPositionTimeoutHandle exists, that means callback not fire.
// clearup here.
navigator.geolocation.clearWatch(watchId);
},
500
);
// cleanup
navigator.geolocation.clearWatch(watchId);
```
## 其它的疑難雜症
### 我在本機開發的時候可以拿得到定位啊,怎麼放到 production 上就不行?
悲劇啊,兄弟,去確認一下你的 production 有沒有 https 吧,出於安全因素[沒有 https 的話瀏覽器不支援 Geolocation api。](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/geolocation)
至於為什麼 localhost 就可以...你從瀏覽器連到本機上,還需要擔心位置會被中間人偷走嗎?
### 為什麼我的 callback 這麼慢才回來?
最有可能的是餵給 `navigator.geolocation.watchPosition` 的 `options` 裡多設了 `enableHighAccuracy: true`。顧名思義這會要求瀏覽器取得高精準度的定位,速度就有可能慢到好幾秒。
請設成 `false`,或是不要加這個 key 就好(預設為 `false`)。
也有可能就是 device 比較慢啦。
### 要怎麼讓位置的更新頻率快一點?
如果明明使用者的位置變了但 success callback 沒有立刻拿到新的位置,有可能是你從 StackOverflow 抄來的 code 對 `options` (是的又是它)多設了 `maximumAge`。
`maximumAge` 是用來告訴瀏覽器我們可以接受位置被暫存的時間,例如 `maximumAge` 設為 10000ms,代表我們接受拿到的位置最多會 cache 十秒,所以即使實際位置更新了,瀏覽器也可能在十秒後才傳回來。
如果要確保拿到最新位置,請將 `maximumAge` 設為 0,或是不要加這個 key 就好(預設為 0)。
---
感想:即使以為和 javascript 很熟了(或者沒有),沒用過的 html5 api 最好還是小心一點啊。
| 30.432624
| 390
| 0.731531
|
yue_Hant
| 0.780442
|
58e8a7786d9ada67451bff4dadaa441944c1ed62
| 76
|
md
|
Markdown
|
README.md
|
jmwright/cadquery-contrib
|
7f4e4075dde567616d54945b69f6c305d27fd953
|
[
"MIT"
] | null | null | null |
README.md
|
jmwright/cadquery-contrib
|
7f4e4075dde567616d54945b69f6c305d27fd953
|
[
"MIT"
] | null | null | null |
README.md
|
jmwright/cadquery-contrib
|
7f4e4075dde567616d54945b69f6c305d27fd953
|
[
"MIT"
] | null | null | null |
# cadquery-contrib
A place to share cadquery scripts, modules, and projects
| 25.333333
| 56
| 0.802632
|
eng_Latn
| 0.99014
|
58e93686f036210b3911f51365320c569b976dc6
| 20,145
|
md
|
Markdown
|
_posts/2018-09-12-kata-container-01.md
|
remimin/remimin.github.io
|
6c7afbc1be28c159ad72429a4ec2a5f784d448ca
|
[
"Apache-2.0"
] | 1
|
2022-02-03T14:13:03.000Z
|
2022-02-03T14:13:03.000Z
|
_posts/2018-09-12-kata-container-01.md
|
remimin/remimin.github.io
|
6c7afbc1be28c159ad72429a4ec2a5f784d448ca
|
[
"Apache-2.0"
] | null | null | null |
_posts/2018-09-12-kata-container-01.md
|
remimin/remimin.github.io
|
6c7afbc1be28c159ad72429a4ec2a5f784d448ca
|
[
"Apache-2.0"
] | null | null | null |
---
layout: post
title: "Kata-container初探"
subtitle: ""
date: 2018-09-12
author: "min"
header-img: "img/post-bg-2015.jpg"
tags:
- k8s
- kata-container
---
* [kata container架构](#kata-container-架构)
* [k8s 与kata container](#k8s-与kata-container)
* [kata container 安装](#安装kata-container-runtime)
* [kata container images](#准备kata-container-image)
* [k8s本地安装](#k8s本地安装)
* [CRI-O安装](#CRI-O安装)
* [kublet & kata-containers](#kubelet-与kata-container)
# kata container 初探
kata containers是由OpenStack基金会管理,但独立于OpenStack项目之外的容器项目。
它是一个可以使用容器镜像以超轻量级虚机的形式创建容器的运行时工具。 kata containers整合了Intel的 Clear Containers 和 Hyper.sh 的 runV,
能够支持不同平台的硬件 (x86-64,arm等),并符合OCI(Open Container Initiative)规范。
目前项目包含几个配套组件,即Runtime,Agent,Proxy,Shim,Kernel等。目前Kata Containers的运行时还没有整合,即Clear containers 和 runV还是独立的。

### kata container 架构
kata container实质上是在虚拟机内部使用container(基于runc的实现)。
kata-container使用虚拟化软件(qemu-lite优化过的qemu),
通过已经将kata-agent 安装的kernel & intrd image,启动过一个轻量级的虚拟机,
使用nvdimm将initrd image映射到guest vm中。然后由kata-agent为container创建对应的namespace和资源。
Guest VM作为实质上的sandbox可以完全与host kernel进行隔离。
kata container 原理,如图所示。

- kata-runtime:实现OCI接口,可以通过CRI-O 与kubelet对接作为k8s runtime server, containerd对接docker engine,创建运行container/pod的VM
- kata-proxy: 每一个container都会由一个kata-proxy进程,kata-proxy负责与kata-agent通讯,当guest vm启动后,kata-agent会随之启动并使用qemu virtio serial console 进行通讯
- kata-agent: 运行在guest vm中的进程, 主要依赖于libcontainer项目,重用了大部分的runc代码,为container创建namespace(NS, UTS, IPC and PID).
- kata-shim: 作为guest vm标准输入输出的接口,exec命令就是同kata-shim实现的
## k8s 与kata container
kata container是hypverisor container阵营的container runtime项目,支持OCI标准。k8s想要创建kata container类型
pods需要的是cri shim即能够提供CRI的服务。k8s孵化项目CRI-O就是可以提供CRI并能够与满足OCI container runtime通讯的项目
k8s与kata container的work flow 如下
``` +-----------+
+---------------+ +--->|container |
+---------------+ | cri-o | | +-----------+
| kubelet | | | +-------------+ |
| +-------------+ cri protobuf +-------------+ |<--->| container +<-+ +-----------+
| | grpc client |<------------->| grpc server | | | runtime +<----->|container |
| +-------------| +-------------+ | +-------------+ +-----------+
+---------------+ | |
+---------------+
```
- k8s调用kubelet在node上启动一个pod,kubelet通过gRPC调用cri-o启动pod。
- cri-o 使用`containers/image`从image registry获取image
- 调用`containers/stroage`将image解压成root filesystems
- cri-o根据kubelet api请求,创建OCI runtime spec文件
- cri-o调用container runtime(runc/kata container)创建container
- 每一个container都有一个`conmon`进程监控,用于处理container logs和exits code
- Pod网络CNI是直接调用了`CNI plugin`
### cri-o 架构图

### 安装kata container runtime
> 环境信息
>
> os: CentOS Linux release 7.4.1708 (Core)
>
> docker 1.12.6
>
> etcd: 3.2.11
>
> go: 1.9.4
>
> kubenetes: 1.10.5
#### step 1: 获取源码并执行编译安装
`kata-runtime kata-proxy kata-shim`
```commandline
go get -d -u github.com/kata-containers/runtime github.com/kata-containers/proxy github.com/kata-containers/shim
cd $GOPATH/src/github.com/kata-containers/runtime
make && make install
cd ${GOPATH}/src/github.com/kata-containers/proxy
make && make install
cd ${GOPATH}/src/github.com/kata-containers/shim
make && make install
```
#### step 2: 运行`kata-check`检查环境是否满足kata container的要求
kata container要求宿主机具有硬件虚拟化的能力
```commandline
# kata-runtime kata-check
INFO[0000] CPU property found description="Intel Architecture CPU" name=GenuineIntel pid=156730 source=runtime type=attribute
INFO[0000] CPU property found description="Virtualization support" name=vmx pid=156730 source=runtime type=flag
INFO[0000] CPU property found description="64Bit CPU" name=lm pid=156730 source=runtime type=flag
INFO[0000] CPU property found description=SSE4.1 name=sse4_1 pid=156730 source=runtime type=flag
INFO[0000] kernel property found description="Host kernel accelerator for virtio network" name=vhost_net pid=156730 source=runtime type=module
INFO[0000] kernel property found description="Kernel-based Virtual Machine" name=kvm pid=156730 source=runtime type=module
INFO[0000] kernel property found description="Intel KVM" name=kvm_intel pid=156730 source=runtime type=module
WARN[0000] kernel module parameter has unexpected value description="Intel KVM" expected=Y name=kvm_intel parameter=nested pid=156730 source=runtime type=module value=N
INFO[0000] Kernel property value correct description="Intel KVM" expected=Y name=kvm_intel parameter=unrestricted_guest pid=156730 source=runtime type=module value=Y
INFO[0000] kernel property found description="Host kernel accelerator for virtio" name=vhost pid=156730 source=runtime type=module
INFO[0000] System is capable of running Kata Containers name=kata-runtime pid=156730 source=runtime
INFO[0000] device available check-type=full device=/dev/kvm name=kata-runtime pid=156730 source=runtime
INFO[0000] feature available check-type=full feature=create-vm name=kata-runtime pid=156730 source=runtime
INFO[0000] System can currently create Kata Containers name=kata-runtime pid=156730 source=runtime
```
#### step 3: qemu-lite 安装
```commandline
$ source /etc/os-release
$ sudo yum -y install yum-utils
$ sudo -E VERSION_ID=$VERSION_ID yum-config-manager --add-repo "http://download.opensuse.org/repositories/home:/katacontainers:/release/CentOS_${VERSION_ID}/home:katacontainers:release.repo"
yum -y install qemu-lite
```
#### step 4: 准备kata container image
- initrd image
initrd(boot loader initialized RAM disk)就是由boot loader初始化时加载的ram disk。initrd是一个被压缩过的小型根目录,
这个目录中包含了启动阶段中必须的驱动模块,可执行文件和启动脚本。当系统启动的时候,booloader会把initrd文件读到内存中,
然后把initrd的起始地址告诉内核。内核在运行过程中会解压initrd,然后把 initrd挂载为根目录,然后执行根目录中的/initrc脚本,
您可以在这个脚本中运行initrd中的udevd,让它来自动加载设备驱动程序以及 在/dev目录下建立必要的设备节点。在udevd自动加载磁盘驱动程序之后,
就可以mount真正的根目录,并切换到这个根目录中。
```commandline
go get github.com/kata-containers/agent github.com/kata-containers/osbuilder
```
```commandline
# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
image-builder-osbuilder latest 092d50027bf2 40 minutes ago 456.3 MB
centos-rootfs-osbuilder latest 27375c3d3491 About an hour ago 798.9 MB
```
- rootfs image
1. 执行rootfs生成脚本,脚本执行完成后,能看到rootfs的文件夹 rootfs_Centos
```commandline
cd /root/.golang/src/github.com/kata-containers/osbuilder/rootfs-builder
export USE_DOCKER=true
./rootfs.sh centos
```
2. 执行rootfs image build 脚本
```commandline
cd /root/.golang/src/github.com/kata-containers/osbuilder/image-builder
image_builder.sh /root/.golang/src/github.com/kata-containers/osbuilder/rootfs-builder/rootfs-Centos
```
3. 执行initrd image build脚本
```commandline
```
##### image build细节
1. rootfs 生成
可以通过设置环境变量`exprot DEBUG=true`执行脚本,能看到更多的细节。rootfs.sh脚本目的就是生成distributor的根文件系统
在使用`USER_DOCKER=true`时,实际上是build一个centos-rootfs-osbuilder的docker image,然后从docker image创建一个
container,并在container内部执行rootfs.sh的脚本,把根文件系统导出来。
生成centos-root-osbuilder image如下
```
From centos:7
RUN yum -y update && yum install -y git make gcc coreutils
# This will install the proper golang to build Kata components
RUN cd /tmp ; curl -OL https://storage.googleapis.com/golang/go1.9.2.linux-amd64.tar.gz
RUN tar -C /usr/ -xzf /tmp/go1.9.2.linux-amd64.tar.gz
ENV GOROOT=/usr/go
ENV PATH=$PATH:$GOROOT/bin:$GOPATH/bin
```
创建image builder container 开始build rootfs
```commandline
docker run --rm --runtime runc --env https_proxy= --env http_proxy=
--env AGENT_VERSION=master --env ROOTFS_DIR=/rootfs --env GO_AGENT_PKG=github.com/kata-containers/agent
--env AGENT_BIN=kata-agent --env AGENT_INIT=no --env GOPATH=/root/.golang --env KERNEL_MODULES_DIR=
--env EXTRA_PKGS= --env OSBUILDER_VERSION=unknown
-v /root/.golang/src/github.com/kata-containers/osbuilder/rootfs-builder:/osbuilder
-v /root/.golang/src/github.com/kata-containers/osbuilder/rootfs-builder/rootfs-Centos:/rootfs
-v /root/.golang/src/github.com/kata-containers/osbuilder/rootfs-builder/../scripts:/scripts
-v /root/.golang/src/github.com/kata-containers/osbuilder/rootfs-builder/rootfs-Centos:/root/.golang/src/github.com/kata-containers/osbuilder/rootfs-builder/rootfs-Centos
-v /root/.golang:/root/.golang centos-rootfs-osbuilder bash /osbuilder/rootfs.sh centos
```
2. rootfs image build
创建rootfs image的过程,简单来讲就是创建了一个raw格式的image,分区,拷贝rootfs的目录到分区内,脚本里root分区的文件系统是ext4
```commandline
qemu-img create -q -f raw "${IMAGE}" "${IMG_SIZE}M"
parted "${IMAGE}" --script "mklabel gpt" \
"mkpart ${FS_TYPE} 1M -1M"
### ......
cp -a "${ROOTFS}"/* ${MOUNT_DIR}
```
````commandline
docker run --rm --runtime runc --privileged --env IMG_SIZE= --env AGENT_INIT=no
-v /dev:/dev -v /root/.golang/src/github.com/kata-containers/osbuilder/image-builder:/osbuilder
-v /root/.golang/src/github.com/kata-containers/osbuilder/image-builder/../scripts:/scripts
-v /root/.golang/src/github.com/kata-containers/osbuilder/rootfs-builder/rootfs-Centos:/rootfs
-v /root/.golang/src/github.com/kata-containers/osbuilder/image-builder:/image image-builder-osbuilder
bash /osbuilder/image_builder.sh -o /image/kata-containers.img /rootfs
````
3. 生成initrd image
生成initrd image的过程比较简单,主要是如下命令,其实就是把rootfs打包成initrd.img
````commandline
( cd "${ROOTFS}" && find . | cpio -H newc -o | gzip -9 ) > "${IMAGE_DIR}"/"${IMAGE_NAME}"
````
#### Guest Kernel image
TODO
## CRI-O安装
根据CRI-O官网,匹配k8s版本,选择1.10
step 1: 安装依赖包
```
yum install -y \
btrfs-progs-devel \
device-mapper-devel \
git \
glib2-devel \
glibc-devel \
glibc-static \
go \
golang-github-cpuguy83-go-md2man \
gpgme-devel \
libassuan-devel \
libgpg-error-devel \
libseccomp-devel \
libselinux-devel \
ostree-devel \
pkgconfig \
runc \
skopeo-containers
```
step 2: 现在源码切换到版本分支,并编译安装
```commandline
git clone https://github.com/kubernetes-incubator/cri-o
git checkout -b release-1.10 remotes/origin/release-1.10
make install.tools
make BUILDTAGS=""
make install
make install.config
```
step 3: cni 网络配置
```commandline
go get -u -d github.com/containernetworking/plugins
cd plugins
./build/sh
mkdir -p /opt/cni/bin
cp bin/* /opt/cni/bin
## 添加网络配置文件
mkdir /etc/cni/net.d
cp $GOPATH/src/github.com/kubernetes-incubator/cri-o/contrib/* /etc/cni/net.d
## 创建cni0 bridge
brctl addbr cni0
```
step 4: 修改`/etc/crio/crio.conf`
```commandline
[crio.runtime]
manage_network_ns_lifecycle = true
runtime = "/usr/bin/runc"
runtime_untrusted_workload = "/usr/bin/kata-runtime"
default_workload_trust = "untrusted"
```
step 5: 启动cri-o
```commandline
make install.systemd
systemctl start crio
```
step 6: 查看conmon进程
conmon是cri-o启动的进程,看下crio的日志,可以看到当crio接收到容器创建请求时,会启动运行conmon命令
```commandline
running conmon: /usr/local/libexec/crio/conmon args=[-c 783731ce2309dbfcb435a2ff47abf768d11916e886dc7a0c9b1f2f9d9fbeea9f -u
783731ce2309dbfcb435a2ff47abf768d11916e886dc7a0c9b1f2f9d9fbeea9f -r /usr/local/bin/kata-runtime -b /var/run/containers/storage/overlay-containers/783731ce2309dbfcb435a
2ff47abf768d11916e886dc7a0c9b1f2f9d9fbeea9f/userdata -p /var/run/containers/storage/overlay-containers/783731ce2309dbfcb435a2ff47abf768d11916e886dc7a0c9b1f2f9d9fbeea9f
/userdata/pidfile -l /var/log/pods/8b67a313-8a39-11e8-909c-246e96275bc0/783731ce2309dbfcb435a2ff47abf768d11916e886dc7a0c9b1f2f9d9fbeea9f.log --exit-dir /var/run/crio/e
xits --socket-dir-path /var/run/crio]
running conmon: /usr/local/libexec/crio/conmon args=[-c 56d5fdeac760e903757db90da588cae7bb7a764baf4c2b2d49110114ba6d2baa -u
56d5fdeac760e903757db90da588cae7bb7a764baf4c2b2d49110114ba6d2baa -r /usr/local/bin/kata-runtime -b /var/run/containers/storage/overlay-containers/56d5fdeac760e903757db90da588cae7bb7a764baf4c2b2d49110114ba6d2baa/userdata -p /var/run/containers/storage/overlay-containers/56d5fdeac760e903757db90da588cae7bb7a764baf4c2b2d49110114ba6d2baa
/userdata/pidfile -l /var/log/pods/8b67a313-8a39-11e8-909c-246e96275bc0/nginx/0.log --exit-dir /var/run/crio/exits --socket-dir-path /var/run/crio]
```
```commandline
conmon -c 2ba098d0682c9f1623f52f18ea5320087ab9b252ee22c83b3fdf9ea45d789322 -u 2ba098d0682c9f1623f52f18ea5320087ab9b252ee22c83b3fdf9ea45d789322
|-kata-proxy -listen-socket unix:///run/vc/sbs/2ba098d0682c9f1623f52f18ea5320087ab9b252ee22c83b3fdf9ea45d789322/proxy.sock -mux-socket/run
| `-7*[{kata-proxy}]
|-kata-shim -agent unix:///run/vc/sbs/2ba098d0682c9f1623f52f18ea5320087ab9b252ee22c83b3fdf9ea45d789322/proxy.sock -container2ba098d0682c9f1
| `-8*[{kata-shim}]
|-qemu-lite-syste -name sandbox-2ba098d0682c9f1623f52f18ea5320087ab9b252ee22c83b3fdf9ea45d789322 -uuid 83236965-4bac-4f32-a385-12c3c90c3d11 -machinepc,
| `-2*[{qemu-lite-syste}]
`-{conmon}
conmon -c 45c1ee0637fdc33324edeb63f3b8eeaffed1e683cc1cfe9d32a45d178fbb658e -u 45c1ee0637fdc33324edeb63f3b8eeaffed1e683cc1cfe9d32a45d178fbb658e
|-kata-shim -agent unix:///run/vc/sbs/2ba098d0682c9f1623f52f18ea5320087ab9b252ee22c83b3fdf9ea45d789322/proxy.sock -container45c1ee0637fdc33
| `-9*[{kata-shim}]
`-{conmon}
```
step 7: 修改k8s环境变量,并重启k8s cluster
```commandline
CGROUP_DRIVER=systemd \
CONTAINER_RUNTIME=remote \
CONTAINER_RUNTIME_ENDPOINT='unix:///var/run/crio/crio.sock --runtime-request-timeout=15m' \
./hack/local-up-cluster.sh
```
step 8: 查看k8s服务状态
```commandline
cluster/kubectl.sh get cs
NAME STATUS MESSAGE ERROR
scheduler Healthy ok
controller-manager Healthy ok
etcd-0 Healthy {"health": "true"}
```
step 9: 创建测试pods
```commandline
cat >ngnix_untrusted.yam <<EON
apiVersion: v1
kind: Pod
metadata:
name: nginx-untrusted
annotations:
io.kubernetes.cri.untrusted-workload: "true"
spec:
containers:
- name: nginx
image: nginx
EON
cluster/kubectl.sh apply -f nginx-untrusted.yaml
```
查看pod
```commandline
cluster/kubectl.sh describe pod nginx-untrusted
```
根据pod输出的ip地址,可以正确访问ngnix的服务
```commandline
curl -i -XGET http://192.168.223.97:80
```
````text
# kata-runtime list
ID PID STATUS BUNDLE CREATED OWNER
edff5f14efc36145ef29853064fafbb2d1e60c7127e5e62160457d7ebf362a6b 38346 running /run/containers/storage/overlay-containers/edff5f14efc36145ef29853064fafbb2d1e60c7127e5e62160457d7ebf362a6b/userdata 2018-07-24T08:32:40.246491549Z #0
0b530a50d5a353ef9f61e18b16c412fadf0fe98f82766f9f9678add7ede49d25 38543 running /run/containers/storage/overlay-containers/0b530a50d5a353ef9f61e18b16c412fadf0fe98f82766f9f9678add7ede49d25/userdata 2018-07-24T08:33:21.832878116Z #0
# df
overlay 241963588 33358740 208604848 14% /var/lib/containers/storage/overlay/1953579948b2a51cc93709ee96770496599e54f5f2cde525cc7138861a294495/merged
overlay 241963588 33358740 208604848 14% /var/lib/containers/storage/overlay/93e320ca6218832f69984481a9ae945a2508b73ed4e3a17a69d0ee2a1aa54564/merged
````
### runc
runc是docker贡献出来支持OCI的容器运行时项目,其实际上是在libcontainerd上封装了一层用于支持OCI,并提供CLI可以通过
[runtime spec](https://github.com/opencontainers/runtime-spec)运行容器。
## k8s本地安装
k8s安装除了使用官方提供的minikube, kubeadm工具外,kubernetes源码也提供了简单的脚本安装方法
```commandline
go get -d -u github.com/kubernetes/kubernetes
bash -x hack/local-up-cluster.sh
# 查看kubernetes相关信息
cluster/kubectl.sh get pods
cluster/kubectl.sh get services
cluster/kubectl.sh get pods
cluster/kubectl.sh get services
cluster/kubectl.sh run my-nginx --image=nginx --replicas=1 --port=80
```
####
| | Alpine | CentOS | ClearLinux | EulerOS | Fedora |
|--|--|--|--|--|--|
| **ARM64** | :heavy_check_mark: | :heavy_check_mark: | | :heavy_check_mark: | :heavy_check_mark: |
| **PPC64le** | :heavy_check_mark: | :heavy_check_mark: | | | :heavy_check_mark: |
| **x86_64** | :heavy_check_mark: |:heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
问题记录
```commandline
/usr/bin/docker-current: Error response from daemon: shim error: docker-runc not installed on system.
[root@bm48 ~]# locate docker-runc
/usr/libexec/docker/docker-runc-current
[root@bm48 ~]# ln -s /usr/libexec/docker/docker-runc-current /usr/libexec/docker/docker-runc
```
## 问题记录
如果系统上安装了oci-register-machine,需要设置oci-register-machine为disable,否则kata container 退出时,
systemd-machined导致docker服务shutdown
```text
Jul 19 03:40:54 bm48 oci-register-machine[184480]: 2018/07/19 03:40:54 Register machine: poststop fa9f842ed3407606d01b7bb490473455be6bda49f6d478699976c61e83f37028 184468
Jul 19 03:40:54 bm48 systemd-machined[131968]: Machine fa9f842ed3407606d01b7bb490473455 terminated.
Jul 19 03:40:54 bm48 dockerd-current[183954]: time="2018-07-19T03:40:54.397828183-04:00" level=info msg="Processing signal 'terminated'"
Jul 19 03:40:54 bm48 dockerd-current[183954]: time="2018-07-19T03:40:54.397987798-04:00" level=debug msg="starting clean shutdown of all containers..."
```
当oci-register-machine设置为enable时,使用docker创建kata container,会在/var/run/systemd/machine下注册一条machine记录,而这条记录
关联的unit时docker服务,原因有待分析
```text
# ls -al /var/run/systemd/machines/
total 24
drwxr-xr-x. 2 root root 280 Jul 19 04:25 .
drwxr-xr-x. 18 root root 440 Jul 19 03:39 ..
-rw-r--r--. 1 root root 229 Jul 19 04:25 e04f4fe715665c32998b13250dab4b4a
lrwxrwxrwx. 1 root root 32 Jul 19 04:25 unit:docker.service -> e04f4fe715665c32998b13250dab4b4a
```
```text
/etc/oci-register-machine.conf
# Disable oci-register-machine by setting the disabled field to true
disabled : true
```
详细见[redhat bug#1514511](https://bugzilla.redhat.com/show_bug.cgi?id=1514511)
## kata container guest
kata container guest vm
application挂载实现
```text
-chardev socket,id=charch0,path=/run/vc/sbs/2ed4a3afed3c3d3269ca230d87da940bcdb85a6f239fab015b2710b83253dc02/kata.sock,server,nowait
```
```text
-device virtio-9p-pci,fsdev=extra-9p-kataShared,mount_tag=kataShared -fsdev local,id=extra-9p-kataShared,path=/run/kata-containers/shared/sandboxes/2ed4a3afed3c3d3269ca230d87da940bcdb85a6f239fab015b2710b83253dc02,security_model=none
```
qemu nvdimm
```text
-machine pc,nvdimm
-m $RAM_SIZE,slots=$N,maxmem=$MAX_SIZE
-object memory-backend-file,id=mem1,share=on,mem-path=$PATH,size=$NVDIMM_SIZE
-device nvdimm,id=nvdimm1,memdev=mem1
```
```text
-machine pc,accel=kvm,kernel_irqchip,nvdimm
-m 2048M,slots=2,maxmem=129554M
-device nvdimm,id=nv0,memdev=mem0
-object memory-backend-file,id=mem0,mem-path=/usr/share/kata-containers/kata-containers.img,size=536870912
-append tsc=reliable no_timer_check rcupdate.rcu_expedited=1 i8042.direct=1 i8042.dumbkbd=1 i8042.nopnp=1 \
i8042.noaux=1 noreplace-smp reboot=k console=hvc0 console=hvc1 iommu=off cryptomgr.notests net.ifnames=0 \
pci=lastbus=0 root=/dev/pmem0p1 rootflags=dax,data=ordered,errors=remount-ro rw rootfstype=ext4 debug \
systemd.show_status=true systemd.log_level=debug panic=1 initcall_debug nr_cpus=48 \
ip=::::::70694528ccaafd1e6c0cc593ae05a44536497c7aa381974566b49937e41dae39::off:: init=/usr/lib/systemd/systemd \
systemd.unit=kata-containers.target systemd.mask=systemd-networkd.service systemd.mask=systemd-networkd.socket \
agent.log=debug agent.sandbox=70694528ccaafd1e6c0cc593ae05a44536497c7aa381974566b49937e41dae39
```

> 问题记录:
> 1. iptables invalid mask 64, 重新build cni plugins 修复
> 2. group_manager = cgroupfs ,修改k8s cgroup_driver为cgroupfs
| 37.444238
| 334
| 0.73373
|
yue_Hant
| 0.170462
|
58eab7a8e8afada1300de9c2fdf7bba547f6bdb8
| 62
|
md
|
Markdown
|
README.md
|
nil68657/SparkWordCount-Scala
|
6dd456068ccf28d8c013512073a7ec34c392cc8d
|
[
"Apache-2.0"
] | null | null | null |
README.md
|
nil68657/SparkWordCount-Scala
|
6dd456068ccf28d8c013512073a7ec34c392cc8d
|
[
"Apache-2.0"
] | null | null | null |
README.md
|
nil68657/SparkWordCount-Scala
|
6dd456068ccf28d8c013512073a7ec34c392cc8d
|
[
"Apache-2.0"
] | null | null | null |
# SparkWordCount-Scala
Basic word count in a file using Scala
| 20.666667
| 38
| 0.806452
|
eng_Latn
| 0.910767
|
58eac84d9c18645adf877a8226f3c0f4b3a98d31
| 1,050
|
md
|
Markdown
|
README.md
|
strah19/YAPL
|
dd22c090614f78a16aec7254c85de1d790dfcf5f
|
[
"MIT"
] | null | null | null |
README.md
|
strah19/YAPL
|
dd22c090614f78a16aec7254c85de1d790dfcf5f
|
[
"MIT"
] | null | null | null |
README.md
|
strah19/YAPL
|
dd22c090614f78a16aec7254c85de1d790dfcf5f
|
[
"MIT"
] | null | null | null |
# YAPL
Yet Another Programming Language
A fast and easy to use programming language created to learn more about language design.
# Development
The development process is being recorded on <a href = "https://trello.com/b/YdI3P4F4/yapl">Trello</a>. It's there
for your benefit and so you can see the steps that I take and my thought process while building YAPL.
If you are interested in contributing and further develop this language, contact me and look over the YAPL documentation guide
to help you on some basic rules and standards that will keep the code clean, and usable over time.
# Build
To build this project, use CMake. Go into the YAPL directory after it has been cloned, and I suggest creating a build directoyr using `mkdir build`.
After, go into that directory using `cd build`. Now run `cmake .. -G "MinGW Makefiles"`. This command will create the necessary build files for MinGW
Makefiles, if you want something else, run `cmake --help` to get a list of supported platforms. After this ha sbeen run, compile the code and run it!
| 61.764706
| 150
| 0.777143
|
eng_Latn
| 0.99964
|
58eb33a03fce739f94aee3e59d0f676f0b57b459
| 2,388
|
md
|
Markdown
|
Pods/Surfboard/README.md
|
taylorwen/Duobaodaka-master
|
36c551d2410338dd01ff79dc4fe3dbc9557eb1bd
|
[
"MIT"
] | null | null | null |
Pods/Surfboard/README.md
|
taylorwen/Duobaodaka-master
|
36c551d2410338dd01ff79dc4fe3dbc9557eb1bd
|
[
"MIT"
] | null | null | null |
Pods/Surfboard/README.md
|
taylorwen/Duobaodaka-master
|
36c551d2410338dd01ff79dc4fe3dbc9557eb1bd
|
[
"MIT"
] | null | null | null |
Sufboard
========
Surfboard is a delightful onboarding library for iOS.
Screenshots
---


Dependencies
---
Surfboard was developed with Xcode 5 and the iOS 7 SDK. It uses autolayout and `UICollectionViewController`, so although it hasn't been tested on iOS 6, you may entertain yourself by trying to run Surfboard on it.
Installing Surfboard
---
Add the contents of the SRFSurfboard project to your directory, or use Cocoapods:
`pod 'SRFSurfboard'`
Getting Started
---
When we talk about Surfboards, we talk about a set of panels. Each panel is a screenful of information, including some text, an image or screenshot, and optionally, a button.
Showing a Surfboard
---
You can show a surfboard by using a segeue, or by creating a an instance of `SRFSurfboardViewController` and passing it an array of some panels. You can also pass a path to a JSON file, which we'll discuss in just a second.
The two initializers for a surfboard:
// One surfboard, the initWithPanels: way.
SRFSurfboardViewController *surfboard = [[SRFSurfboardViewController alloc] initWithPanels:anArrayOfPanels];
// Another surfboard, the initWithPathToCofiguration way.
SRFSurfboardViewController *surfboard = [[SRFSurfboardViewController alloc] initWithPathToConfiguration:aPathToJSONFile];
Creating Panels
---
Panels can be created programatically, or using a JSON file. The JSON format is simple. There are four keys:
1. **text** The text that appears at the top of the panel.
2. **image** An image to show in the panel. The image is tinted to the `tintColor` of the surfboard.
3. **screen** A screenshot to show in the panel. The screenshot is not tinted.
4. **button** The title of a button to show at the bottom of the panel. This is optional.
Note that either the contents of the "image" or "screen" will be used, but not both. Supplying both results in undefined behavior.
Here's a sample panel:
{
"text" : "Welcome to Surfboard.",
"image" : "swipe"
}
You'd want to add an image to your bundle or asset catelog named "swipe.png" and Surfboard would display it.
License
---
SRFSurfboard is released under the MIT license. See [LICENSE](./LICENSE) for more.
More Open Source
---
If you like SRFSurfboard, you may like some of [my other projects](https://github.com/MosheBerman?tab=repositories) on GitHub.
| 33.166667
| 223
| 0.759631
|
eng_Latn
| 0.99505
|
58eb6944b25f190b216339003d580590c1af2d3c
| 7,777
|
md
|
Markdown
|
docs/relational-databases/system-stored-procedures/sp-migrate-user-to-contained-transact-sql.md
|
polocco/sql-docs.it-it
|
054013d9cd6f2c81f53fc91a7eafc8043f12c380
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
docs/relational-databases/system-stored-procedures/sp-migrate-user-to-contained-transact-sql.md
|
polocco/sql-docs.it-it
|
054013d9cd6f2c81f53fc91a7eafc8043f12c380
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
docs/relational-databases/system-stored-procedures/sp-migrate-user-to-contained-transact-sql.md
|
polocco/sql-docs.it-it
|
054013d9cd6f2c81f53fc91a7eafc8043f12c380
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
---
description: sp_migrate_user_to_contained (Transact-SQL)
title: sp_migrate_user_to_contained (Transact-SQL) | Microsoft Docs
ms.custom: ''
ms.date: 06/11/2019
ms.prod: sql
ms.prod_service: database-engine
ms.reviewer: ''
ms.technology: system-objects
ms.topic: language-reference
f1_keywords:
- sp_migrate_user_to_contained
- sp_migrate_user_to_contained_TSQL
dev_langs:
- TSQL
helpviewer_keywords:
- sp_migrate_user_to_contained
ms.assetid: b3a49ff6-46ad-4ee7-b6fe-7e54213dc33e
author: markingmyname
ms.author: maghan
ms.openlocfilehash: edabb8a59a672c3ebfe04a799df7901b402fb5b3
ms.sourcegitcommit: dd36d1cbe32cd5a65c6638e8f252b0bd8145e165
ms.translationtype: MT
ms.contentlocale: it-IT
ms.lasthandoff: 09/08/2020
ms.locfileid: "89543191"
---
# <a name="sp_migrate_user_to_contained-transact-sql"></a>sp_migrate_user_to_contained (Transact-SQL)
[!INCLUDE [SQL Server](../../includes/applies-to-version/sqlserver.md)]
Converte un utente del database di cui è stato eseguito il mapping a un account di accesso di [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] in un utente del database indipendente con password. In un database indipendente, utilizzare questa procedura per rimuovere le dipendenze nell'istanza di [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] in cui viene installato il database. **sp_migrate_user_to_contained** separa l'utente dall' [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] account di accesso originale, in modo che sia possibile amministrare separatamente impostazioni quali password e lingua predefinita per il database indipendente. **sp_migrate_user_to_contained** possibile utilizzare prima di trasferire il database indipendente in un'istanza diversa di [!INCLUDE[ssDEnoversion](../../includes/ssdenoversion-md.md)] per eliminare le dipendenze dagli [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] account di accesso dell'istanza corrente.
> [!NOTE]
> Prestare attenzione quando si usa **sp_migrate_user_to_contained**, perché non sarà possibile invertire l'effetto. Questa procedura viene utilizzata solo in un database indipendente. Per altre informazioni, vedere [Database indipendenti](../../relational-databases/databases/contained-databases.md).
## <a name="syntax"></a>Sintassi
```
sp_migrate_user_to_contained [ @username = ] N'user' ,
[ @rename = ] { N'copy_login_name' | N'keep_name' } ,
[ @disablelogin = ] { N'disable_login' | N'do_not_disable_login' }
```
## <a name="arguments"></a>Argomenti
[** @username =** ] **N'***User***'**
Nome di un utente nel database indipendente corrente di cui è stato eseguito il mapping a un account di accesso con autenticazione di [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. Il valore è di **tipo sysname**e il valore predefinito è **null**.
[** @rename =** ] **N'***copy_login_name***'** | **N'***keep_name***'**
Quando un utente del database basato su un account di accesso dispone di un nome utente diverso da quello del nome account di accesso, utilizzare *keep_name* per mantenere il nome utente del database durante la migrazione. Utilizzare *copy_login_name* per creare il nuovo utente del database indipendente con il nome dell'account di accesso, anziché l'utente. Quando il nome utente di un utente del database basato su un account di accesso è uguale al nome dell'account di accesso, entrambe le opzioni consentono di creare l'utente del database indipendente senza la modifica del nome.
[** @disablelogin =** ] **N'***disable_login***'** | **N'***do_not_disable_login***'**
*disable_login* Disabilita l'account di accesso nel database master. Per connettersi quando l'account di accesso è disabilitato, la connessione deve fornire il nome del database indipendente come **catalogo iniziale** come parte della stringa di connessione.
## <a name="return-code-values"></a>Valori del codice restituito
0 (operazione completata) o 1 (operazione non riuscita)
## <a name="remarks"></a>Osservazioni
**sp_migrate_user_to_contained** crea l'utente del database indipendente con password, indipendentemente dalle proprietà o dalle autorizzazioni dell'account di accesso. Ad esempio, la procedura può avere esito positivo se l'account di accesso è disabilitato o se all'utente viene negata l'autorizzazione **Connect** per il database.
**sp_migrate_user_to_contained** presenta le restrizioni seguenti.
- Il nome utente non può essere già esistente nel database.
- Impossibile convertire gli utenti predefiniti, ad esempio dbo e guest.
- Impossibile specificare l'utente nella clausola **Execute As** di un stored procedure firmato.
- L'utente non può essere proprietario di un stored procedure che include la clausola **Execute As Owner** .
- Impossibile utilizzare **sp_migrate_user_to_contained** in un database di sistema.
## <a name="security"></a>Sicurezza
Quando si esegue la migrazione di utenti, fare attenzione a non disabilitare o eliminare tutti gli account di accesso di amministratore dall'istanza di [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. Se tutti gli account di accesso vengono eliminati, vedere [connettersi a SQL Server quando gli amministratori di sistema sono bloccati](../../database-engine/configure-windows/connect-to-sql-server-when-system-administrators-are-locked-out.md).
Se è presente l'account di accesso **BUILTIN\Administrators** , gli amministratori possono connettersi avviando l'applicazione utilizzando l'opzione **Esegui come amministratore** .
### <a name="permissions"></a>Autorizzazioni
È richiesta l'autorizzazione **CONTROL SERVER** .
## <a name="examples"></a>Esempi
### <a name="a-migrating-a-single-user"></a>R. Migrazione di un solo utente
Nell'esempio seguente viene eseguita la migrazione di un account di accesso di [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] denominato `Barry` a un database indipendente con password. Nell'esempio non viene modificato il nome utente e l'account di accesso viene mantenuto come abilitato.
```sql
sp_migrate_user_to_contained
@username = N'Barry',
@rename = N'keep_name',
@disablelogin = N'do_not_disable_login' ;
```
### <a name="b-migrating-all-database-users-with-logins-to-contained-database-users-without-logins"></a>B. Migrazione di tutti gli utenti del database con account di accesso a utenti del database indipendente senza account di accesso
Nell'esempio seguente viene eseguita la migrazione di tutti gli utenti basati sugli account di accesso di [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] a utenti del database indipendente con password. Nell'esempio sono inclusi account di accesso non abilitati. L'esempio deve essere eseguito nel database indipendente.
```sql
DECLARE @username sysname ;
DECLARE user_cursor CURSOR
FOR
SELECT dp.name
FROM sys.database_principals AS dp
JOIN sys.server_principals AS sp
ON dp.sid = sp.sid
WHERE dp.authentication_type = 1 AND sp.is_disabled = 0;
OPEN user_cursor
FETCH NEXT FROM user_cursor INTO @username
WHILE @@FETCH_STATUS = 0
BEGIN
EXECUTE sp_migrate_user_to_contained
@username = @username,
@rename = N'keep_name',
@disablelogin = N'disable_login';
FETCH NEXT FROM user_cursor INTO @username
END
CLOSE user_cursor ;
DEALLOCATE user_cursor ;
```
## <a name="see-also"></a>Vedere anche
[Migrate to a Partially Contained Database](../../relational-databases/databases/migrate-to-a-partially-contained-database.md)
[Database indipendenti](../../relational-databases/databases/contained-databases.md)
| 62.216
| 999
| 0.749775
|
ita_Latn
| 0.978414
|
58eb890b883846329c609b4210dec645a8f87bea
| 11,865
|
md
|
Markdown
|
docs/source/Contribs/Arxcode-installing-help.md
|
FreeDelete-Software/ALPACAS-evennia
|
dd95de145ea31391238dc03d61b14b6b31a5b715
|
[
"BSD-3-Clause"
] | null | null | null |
docs/source/Contribs/Arxcode-installing-help.md
|
FreeDelete-Software/ALPACAS-evennia
|
dd95de145ea31391238dc03d61b14b6b31a5b715
|
[
"BSD-3-Clause"
] | null | null | null |
docs/source/Contribs/Arxcode-installing-help.md
|
FreeDelete-Software/ALPACAS-evennia
|
dd95de145ea31391238dc03d61b14b6b31a5b715
|
[
"BSD-3-Clause"
] | null | null | null |
# Arxcode installing help
## Introduction
[Arx - After the Reckoning](https://play.arxmush.org/) is a big and very popular
[Evennia](https://www.evennia.com)-based game. Arx is heavily roleplaying-centric, relying on game
masters to drive the story. Technically it's maybe best described as "a MUSH, but with more coded
systems". In August of 2018, the game's developer, Tehom, generously released the [source code of
Arx on github](https://github.com/Arx-Game/arxcode). This is a treasure-trove for developers wanting
to pick ideas or even get a starting game to build on. These instructions are based on the Arx-code
released as of *Aug 12, 2018*.
If you are not familiar with what Evennia is, you can read
[an introduction here](../Evennia-Introduction).
It's not too hard to run Arx from the sources (of course you'll start with an empty database) but
since part of Arx has grown organically, it doesn't follow standard Evennia paradigms everywhere.
This page covers one take on installing and setting things up while making your new Arx-based game
better match with the vanilla Evennia install.
## Installing Evennia
Firstly, set aside a folder/directory on your drive for everything to follow.
You need to start by installing [Evennia](https://www.evennia.com) by following most of the
[Getting Started Instructions](../Setup/Setup-Quickstart) for your OS. The difference is that you need to `git clone
https://github.com/TehomCD/evennia.git` instead of Evennia's repo because Arx uses TehomCD's older
Evennia 0.8 [fork](https://github.com/TehomCD/evennia), notably still using Python2. This detail is
important if referring to newer Evennia documentation.
If you are new to Evennia it's *highly* recommended that you run through the
instructions in full - including initializing and starting a new empty game and connecting to it.
That way you can be sure Evennia works correctly as a base line. If you have trouble, make sure to
read the [Troubleshooting instructions](./Getting-Started#troubleshooting) for your
operating system. You can also drop into our
[forums](https://groups.google.com/forum/#%21forum/evennia), join `#evennia` on `irc.freenode.net`
or chat from the linked [Discord Server](https://discord.gg/NecFePw).
After installing you should have a `virtualenv` running and you should have the following file
structure in your set-aside folder:
```
vienv/
evennia/
mygame/
```
Here `mygame` is the empty game you created during the Evennia install, with `evennia --init`. Go to
that and run `evennia stop` to make sure your empty game is not running. We'll instead let Evenna
run Arx, so in principle you could erase `mygame` - but it could also be good to have a clean game
to compare to.
## Installing Arxcode
### Clone the arxcode repo
Cd to the root of your directory and clone the released source code from github:
git clone https://github.com/Arx-Game/arxcode.git myarx
A new folder `myarx` should appear next to the ones you already had. You could rename this to
something else if you want.
Cd into `myarx`. If you wonder about the structure of the game dir, you can
[read more about it here](../Howto/Starting/Part1/Gamedir-Overview).
### Clean up settings
Arx has split evennia's normal settings into `base_settings.py` and `production_settings.py`. It
also has its own solution for managing 'secret' parts of the settings file. We'll keep most of Arx
way but remove the secret-handling and replace it with the normal Evennia method.
Cd into `myarx/server/conf/` and open the file `settings.py` in a text editor. The top part (within
`"""..."""`) is just help text. Wipe everything underneath that and make it look like this instead
(don't forget to save):
```
from base_settings import *
TELNET_PORTS = [4000]
SERVERNAME = "MyArx"
GAME_SLOGAN = "The cool game"
try:
from server.conf.secret_settings import *
except ImportError:
print("secret_settings.py file not found or failed to import.")
```
> Note: Indents and capitalization matter in Python. Make indents 4 spaces (not tabs) for your own
> sanity. If you want a starter on Python in Evennia, [you can look here](Python-basic-
introduction).
This will import Arx' base settings and override them with the Evennia-default telnet port and give
the game a name. The slogan changes the sub-text shown under the name of your game in the website
header. You can tweak these to your own liking later.
Next, create a new, empty file `secret_settings.py` in the same location as the `settings.py` file.
This can just contain the following:
```python
SECRET_KEY = "sefsefiwwj3 jnwidufhjw4545_oifej whewiu hwejfpoiwjrpw09&4er43233fwefwfw"
```
Replace the long random string with random ASCII characters of your own. The secret key should not
be shared.
Next, open `myarx/server/conf/base_settings.py` in your text editor. We want to remove/comment out
all mentions of the `decouple` package, which Evennia doesn't use (we use `private_settings.py` to
hide away settings that should not be shared).
Comment out `from decouple import config` by adding a `#` to the start of the line: `# from decouple
import config`. Then search for `config(` in the file and comment out all lines where this is used.
Many of these are specific to the server environment where the original Arx runs, so is not that
relevant to us.
### Install Arx dependencies
Arx has some further dependencies beyond vanilla Evennia. Start by `cd`:ing to the root of your
`myarx` folder.
> If you run *Linux* or *Mac*: Edit `myarx/requirements.txt` and comment out the line
> `pypiwin32==219` - it's only needed on Windows and will give an error on other platforms.
Make sure your `virtualenv` is active, then run
pip install -r requirements.txt
The needed Python packages will be installed for you.
### Adding logs/ folder
The Arx repo does not contain the `myarx/server/logs/` folder Evennia expects for storing server
logs. This is simple to add:
# linux/mac
mkdir server/logs
# windows
mkdir server\logs
### Setting up the database and starting
From the `myarx` folder, run
evennia migrate
This creates the database and will step through all database migrations needed.
evennia start
If all goes well Evennia will now start up, running Arx! You can connect to it on `localhost` (or
`127.0.0.1` if your platform doesn't alias `localhost`), port `4000` using a Telnet client.
Alternatively, you can use your web browser to browse to `http://localhost:4001` to see the game's
website and get to the web client.
When you log in you'll get the standard Evennia greeting (since the database is empty), but you can
try `help` to see that it's indeed Arx that is running.
### Additional Setup Steps
The first time you start Evennia after creating the database with the `evennia migrate` step above,
it should create a few starting objects for you - your superuser account, which it will prompt you
to enter, a starting room (Limbo), and a character object for you. If for some reason this does not
occur, you may have to follow the steps below. For the first time Superuser login you may have to
run steps 7-8 and 10 to create and connect to your in-came Character.
1. Login to the game website with your Superuser account.
2. Press the `Admin` button to get into the (Django-) Admin Interface.
3. Navigate to the `Accounts` section.
4. Add a new Account named for the new staffer. Use a place holder password and dummy e-mail
address.
5. Flag account as `Staff` and apply the `Admin` permission group (This assumes you have already set
up an Admin Group in Django).
6. Add Tags named `player` and `developer`.
7. Log into the game using the web client (or a third-party telnet client) using your superuser
account. Move to where you want the new staffer character to appear.
8. In the game client, run `@create/drop <staffername>:typeclasses.characters.Character`, where
`<staffername>` is usually the same name you used for the Staffer account you created in the
Admin earlier (if you are creating a Character for your superuser, use your superuser account
name).
This creates a new in-game Character and places it in your current location.
9. Have the new Admin player log into the game.
10. Have the new Admin puppet the character with `@ic StafferName`.
11. Have the new Admin change their password - `@password <old password> = <new password>`.
Now that you have a Character and an Account object, there's a few additional things you may need to
do in order for some commands to function properly. You can either execute these as in-game commands
while `@ic` (controlling your character object).
1. `@py from web.character.models import RosterEntry;RosterEntry.objects.create(player=self.player,
character=self)`
2. `@py from world.dominion.models import PlayerOrNpc, AssetOwner;dompc =
PlayerOrNpc.objects.create(player = self.player);AssetOwner.objects.create(player=dompc)`
Those steps will give you a 'RosterEntry', 'PlayerOrNpc', and 'AssetOwner' objects. RosterEntry
explicitly connects a character and account object together, even while offline, and contains
additional information about a character's current presence in game (such as which 'roster' they're
in, if you choose to use an active roster of characters). PlayerOrNpc are more character extensions,
as well as support for npcs with no in-game presence and just represented by a name which can be
offscreen members of a character's family. It also allows for membership in Organizations.
AssetOwner holds information about a character or organization's money and resources.
## Alternate guide by Pax for installing on Windows
If for some reason you cannot use the Windows Subsystem for Linux (which would use instructions
identical to the ones above), it's possible to get Evennia running under Anaconda for Windows. The
process is a little bit trickier.
Make sure you have:
* Git for Windows https://git-scm.com/download/win
* Anaconda for Windows https://www.anaconda.com/distribution/
* VC++ Compiler for Python 2.7 https://aka.ms/vcpython27
conda update conda
conda create -n arx python=2.7
source activate arx
Set up a convenient repository place for things.
cd ~
mkdir Source
cd Source
mkdir Arx
cd Arx
Replace the SSH git clone links below with your own github forks.
If you don't plan to change Evennia at all, you can use the
evennia/evennia.git repo instead of a forked one.
git clone git@github.com:<youruser>/evennia.git
git clone git@github.com:<youruser>/arxcode.git
Evennia is a package itself, so we want to install it and all of its
prerequisites, after switching to the appropriately-tagged branch for
Arxcode.
cd evennia
git checkout tags/v0.7 -b arx-master
pip install -e .
Arx has some dependencies of its own, so now we'll go install them
As it is not a package, we'll use the normal requirements file.
cd ../arxcode
pip install -r requirements.txt
The git repo doesn't include the empty log directory and Evennia is unhappy if you
don't have it, so while still in the arxcode directory...
mkdir server/logs
Now hit https://github.com/evennia/evennia/wiki/Arxcode-installing-help and
change the setup stuff as in the 'Clean up settings' section.
Then we will create our default database...
../evennia/bin/windows/evennia.bat migrate
...and do the first run. You need winpty because Windows does not have a TTY/PTY
by default, and so the Python console input commands (used for prompts on first
run) will fail and you will end up in an unhappy place. Future runs, you should
not need winpty.
winpty ../evennia/bin/windows/evennia.bat start
Once this is done, you should have your Evennia server running Arxcode up
on localhost at port 4000, and the webserver at http://localhost:4001/
And you are done! Huzzah!
| 43.621324
| 116
| 0.765023
|
eng_Latn
| 0.998353
|
58ec05c7752f4d3cbc857bcc5558ab47adcf8a0b
| 47
|
md
|
Markdown
|
README.md
|
tobymccann/tobymccann.github.io-ghp
|
5f9ff003a910e3e089551aa77b404e8e0f794f5e
|
[
"MIT"
] | null | null | null |
README.md
|
tobymccann/tobymccann.github.io-ghp
|
5f9ff003a910e3e089551aa77b404e8e0f794f5e
|
[
"MIT"
] | null | null | null |
README.md
|
tobymccann/tobymccann.github.io-ghp
|
5f9ff003a910e3e089551aa77b404e8e0f794f5e
|
[
"MIT"
] | null | null | null |
# tobymccann.github.io-ghp
github pages source
| 15.666667
| 26
| 0.808511
|
fra_Latn
| 0.200807
|
58ec57a01a87a81799f6889b2ee22a2796bb7f48
| 922
|
md
|
Markdown
|
docs/framework/wcf/diagnostics/tracing/system-servicemodel-messageclosedagain.md
|
marcustung/docs.zh-tw-1
|
7c224633316a0d983d25a8a9bb1f7626743d062a
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
docs/framework/wcf/diagnostics/tracing/system-servicemodel-messageclosedagain.md
|
marcustung/docs.zh-tw-1
|
7c224633316a0d983d25a8a9bb1f7626743d062a
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
docs/framework/wcf/diagnostics/tracing/system-servicemodel-messageclosedagain.md
|
marcustung/docs.zh-tw-1
|
7c224633316a0d983d25a8a9bb1f7626743d062a
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
---
title: System.ServiceModel.MessageClosedAgain
ms.date: 03/30/2017
ms.assetid: 24c274d4-65cd-4c91-9869-bc6eb34ef979
ms.openlocfilehash: a18355d55359df665d0e936ce95da34bf07aec6a
ms.sourcegitcommit: 0be8a279af6d8a43e03141e349d3efd5d35f8767
ms.translationtype: HT
ms.contentlocale: zh-TW
ms.lasthandoff: 04/18/2019
ms.locfileid: "59181326"
---
# <a name="systemservicemodelmessageclosedagain"></a>System.ServiceModel.MessageClosedAgain
System.ServiceModel.MessageClosedAgain
## <a name="description"></a>描述
已再次關閉訊息。
訊息應該只關閉一次。 如果在使用者延伸程式碼中發出這個追蹤,就表示使用者延伸程式碼正在關閉一個已經關閉的訊息。 如果是透過產品代碼發出這個追蹤,就表示使用者延伸程式碼可能太早關閉訊息。
## <a name="see-also"></a>另請參閱
- [追蹤](../../../../../docs/framework/wcf/diagnostics/tracing/index.md)
- [使用追蹤為應用程式進行疑難排解](../../../../../docs/framework/wcf/diagnostics/tracing/using-tracing-to-troubleshoot-your-application.md)
- [管理與診斷](../../../../../docs/framework/wcf/diagnostics/index.md)
| 36.88
| 124
| 0.763557
|
yue_Hant
| 0.574428
|
58eca006fb903263160fe6678cbe1602d9662294
| 90
|
md
|
Markdown
|
README.md
|
mews-sulsel/mews-sulsel.github.io
|
ef45b789b078ab28aa9c55e608e4c4baf82e7c40
|
[
"MIT"
] | null | null | null |
README.md
|
mews-sulsel/mews-sulsel.github.io
|
ef45b789b078ab28aa9c55e608e4c4baf82e7c40
|
[
"MIT"
] | null | null | null |
README.md
|
mews-sulsel/mews-sulsel.github.io
|
ef45b789b078ab28aa9c55e608e4c4baf82e7c40
|
[
"MIT"
] | null | null | null |
# mews-sulsel.github.io
Auto monitoring weather nowcasting over South Sulawesi, Indonesia
| 30
| 65
| 0.833333
|
eng_Latn
| 0.670981
|
58ed94df5ff18512550a8b66a7263b188220b5d0
| 557
|
md
|
Markdown
|
_posts/2020-12-10-业主操碎了心呀!中国大陆三四线城市也有很多店铺无人接手,很多房子都没有人入住,南宁万达茂房地产【九哥.md
|
NodeBE4/society
|
20d6bc69f2b0f25d6cc48a361483263ad27f2eb4
|
[
"MIT"
] | 1
|
2020-09-16T02:05:28.000Z
|
2020-09-16T02:05:28.000Z
|
_posts/2020-12-10-业主操碎了心呀!中国大陆三四线城市也有很多店铺无人接手,很多房子都没有人入住,南宁万达茂房地产【九哥.md
|
NodeBE4/society
|
20d6bc69f2b0f25d6cc48a361483263ad27f2eb4
|
[
"MIT"
] | null | null | null |
_posts/2020-12-10-业主操碎了心呀!中国大陆三四线城市也有很多店铺无人接手,很多房子都没有人入住,南宁万达茂房地产【九哥.md
|
NodeBE4/society
|
20d6bc69f2b0f25d6cc48a361483263ad27f2eb4
|
[
"MIT"
] | null | null | null |
---
layout: post
title: "业主操碎了心呀!中国大陆三四线城市也有很多店铺无人接手,很多房子都没有人入住,南宁万达茂房地产【九哥记】"
date: 2020-12-10T21:15:00.000Z
author: 九歌爱旅游
from: https://www.youtube.com/watch?v=I6jz8IMnvhw
tags: [ 九哥记 ]
categories: [ 九哥记 ]
---
<!--1607634900000-->
[业主操碎了心呀!中国大陆三四线城市也有很多店铺无人接手,很多房子都没有人入住,南宁万达茂房地产【九哥记】](https://www.youtube.com/watch?v=I6jz8IMnvhw)
------
<div>
♥关于九哥♥ 大家好鸭!我是九哥,一枚来自广东90的妹子, 已在广州生活了6年。 我爱广州,喜欢旅游,(会听粤语,但是让我讲粤语你听了绝对后悔的)在这里跟大家分享关于广州的一些新鲜事情,也会分享我的生活琐事。有钱的话,会到其他地方旅游,体验不同的人文风俗,分享一些当地的有趣事情!了解世界不同的角落,跟着我的脚步,我将带你看更真实的世界。感谢大家对我的支持和订阅!#广州#九哥记#穷游#广西#九哥記#窮遊
</div>
| 32.764706
| 202
| 0.768402
|
yue_Hant
| 0.443579
|
58ee24a531c6f16dcf35ae24aec47d4f9c473b35
| 1,219
|
md
|
Markdown
|
readme.md
|
graemefoster/AzureResourceMap
|
9fa7d1ff04f74cd52e7cec226df4079a60f6c32e
|
[
"MIT"
] | null | null | null |
readme.md
|
graemefoster/AzureResourceMap
|
9fa7d1ff04f74cd52e7cec226df4079a60f6c32e
|
[
"MIT"
] | null | null | null |
readme.md
|
graemefoster/AzureResourceMap
|
9fa7d1ff04f74cd52e7cec226df4079a60f6c32e
|
[
"MIT"
] | null | null | null |
# AzureDiagrams
## Generate a diagram from your Azure Resources
## Usage
```bash
az login
az account set --subscription "<subscription-name>"
dotnet AzureDiagrams.dll --subscription-id <subscription-id> --resource-group <resource-group> --resource-group <resource-group> --output c:/temp/
```
## Example outputs
### Azure App Service with App Insights / database / Key Vault

### More complex with VNets and private endpoints

## How does it work?
AzureDiagrams queries the Azure Resource Management APIs to introspect resource-groups. It then uses a set of strategies to enrich the raw data, building a model that can be projected into other formats.
It's not 100% guaranteed to be correct but it should give a good first pass at fairly complex architectures/
To layout the components I use the amazing [AutomaticGraphLayout](https://github.com/microsoft/automatic-graph-layout) library.
## Todo
There are many, many Azure services not yet covered. I'll try and put a table here of what is covered, and how comprehensive it is covered.
## Visulations
The initial version supports Draw.IO diagrams.
| 36.939394
| 203
| 0.769483
|
eng_Latn
| 0.953109
|
58ee2dfcb7968fa1bf45f1f9ce14e50bb6e369f8
| 89
|
md
|
Markdown
|
README.md
|
BebiSoft/main-used-data-structures
|
38c724f3bf14c421c0acb4cc395aa59d695d12ea
|
[
"MIT"
] | 1
|
2021-04-25T13:29:18.000Z
|
2021-04-25T13:29:18.000Z
|
README.md
|
CiganOliviu/main-used-data-structures
|
8becd414c9bde5b5cfc6d2ee1bc979975485ef38
|
[
"MIT"
] | null | null | null |
README.md
|
CiganOliviu/main-used-data-structures
|
8becd414c9bde5b5cfc6d2ee1bc979975485ef38
|
[
"MIT"
] | 2
|
2021-04-06T19:56:55.000Z
|
2021-04-13T05:25:07.000Z
|
# main-used-data-structures
Implementation of the main used data-structures for dummies.
| 29.666667
| 60
| 0.820225
|
eng_Latn
| 0.972309
|
58ee60a1db6c938b812d394f58badbad619fd6b2
| 5,525
|
md
|
Markdown
|
_texts/song_peter.md
|
karindalziel/medieval-source-book.github.io
|
83e870e447d77b002eb29143589796cc1025a177
|
[
"MIT"
] | null | null | null |
_texts/song_peter.md
|
karindalziel/medieval-source-book.github.io
|
83e870e447d77b002eb29143589796cc1025a177
|
[
"MIT"
] | 1
|
2021-10-03T01:40:09.000Z
|
2021-10-03T01:40:09.000Z
|
_texts/song_peter.md
|
karindalziel/medieval-source-book.github.io
|
83e870e447d77b002eb29143589796cc1025a177
|
[
"MIT"
] | 1
|
2021-12-01T19:53:19.000Z
|
2021-12-01T19:53:19.000Z
|
---
layout: text
sidebar: left
title: |
The Song of Peter | Petruslied
engtitle: |
The Song of Peter
origtitle: |
Petruslied
breadcrumb: true
permalink: "text/song_peter"
redirect_from: /text/song-peter
identifier: song_peter.md
tei: /assets/tei/song_peter.xml
pdf: /assets/pdf/song_peter.pdf
textauthor: Anonymous
languages: [german,western_europe]
periods: [9th_century]
textcollections: [hymns-and-histories, prayer-spirituality-life-after-death]
sdr: https://purl.stanford.edu/druid
image: /assets/img/text/song_peter.png
thumb: /assets/img/text/song_peter-thumb.png
imagesource: |
Detail from BSB MS Clm 6260, fol.158v
fulltext: |
Petruslied The Song of Peter Unsar trohtin hat farsalt sancte petre giuualt daz er mac ginerian Our Lord gave Saint Peter the power to save ze imo dingenten man. kyrie eleyson christe eleyson. those entrusted to him. Kyrie eleison. Christe eleison. Er hapet ouh mit vuortun himriches portun. dar in mach er skerian With words, he also guards the gates of heaven through which he admits den er uuili nerian. kirie eleison criste [eleyson] those whom he wishes to save. Kyrie eleison. Christe eleison. Pittemes den gotes trut alla samant uparlut. daz er uns firtanen giuuer Let us entreat God’s disciple, loudly and in unison, so that he grants do ginaden mercy to us sinners. Kyrie eleison. Christe eleison.
---
## Introduction to the Source
<p>The song survives in only one manuscript, Bayerische Staatsbibliothek Clm 6260, now held in Munich. The manuscript originally stems from the Freising Cathedral library and was written in the second half of the ninth century CE. It contains discussions, in Latin, of religious texts. The <em>Song of Peter</em> was written down later, on the very last page below the end of Hrabanus’s Maurus Commentary on Genesis (f.158v).</p>
## Introduction to the Text
<p>The <em>Song of Peter</em> is the oldest surviving hymn in the German language. Hymns are a form of religious poetry sung in praise of God, often during religious ceremonies such as the Mass celebrated by medieval Christians. The tradition of Christian hymns was popularised in the West by Ambrose of Milan (c.340 –397 CE), who wrote hymns in Latin (though some claim that Hilary of Poitiers was the first composer of Latin hymns). Hymns in the <span style="font-family:"Times New Roman",serif">“</span>Ambrosian<span style="font-family:"Times New Roman",serif">”</span> style remained a very popular part of Christian worship until the Council of Trent (1545-63 CE), when most hymns were abolished from Catholic liturgical practice. The <em>Song of Peter</em> is transmitted with neumes, an early medieval form of musical notation, which suggests that it was supposed to be sung, possibly during religious processions.</p> <p>Written down in the first third of the tenth century CE in a Bavarian dialect of the Old High German language, it is one of the earliest examples of end rhyme in a German text. This was a change from the Germanic alliterative verse which dominated earlier, where the same consonants were repeated within the same line. It is unknown whether the author of the <em>Song of Peter</em> was influenced by the end rhymes of Otfrid of Weißenburg's Gospel Harmony (composed c.870 CE) or whether the <em>Song of Peter</em> predates Otfrid’s work.</p> <p>The song calls upon St. Peter the Apostle in three strophes of three lines. Each strophe ends with the refrain, <span style="font-family:"Times New Roman",serif">“</span>Kyrie eleyson. Christe eleyson<span style="font-family:"Times New Roman",serif">”</span>, which is Greek for <span style="font-family:"Times New Roman",serif">“</span>God, have mercy. Christ, have mercy.<span style="font-family:"Times New Roman",serif">”</span> The refrain points to Peter's special role in the Christian faith as the overseer of admission into Heaven (see, for example, the Biblical passage Matthew 16:19: “I will give you the keys of the kingdom of heaven; whatever you bind on earth will be bound in heaven, and whatever you loose on earth will be loosed in heaven<span style="font-family:"Times New Roman",serif">”</span>).</p>
## Further Reading
<p><span data-sheets-formula-bar-text-style="font-size:15px;color:#000000;font-weight:normal;text-decoration:none;font-family:'docs-Calibri';font-style:normal;text-decoration-skip-ink:none;">Bostock, John Knight, Kenneth Charles King, and D. R. McLintock. <em>A Handbook on Old High German Literature</em>. Clarendon Press, 1976.</span></p> <p>Haug, Walter and Benedikt Konrad Vollmann<em>.</em> <em>Frühe Deutsche Literatur und Lateinische Literatur in Deutschland 800-1150</em>. Deutscher Klassiker Verlag, 1991.</p> <ul> <li>Old High German text and modern German translation: pp.130-131</li> <li>Commentary and extensive bibliography: pp.1117-1120</li> </ul> <p>Liberman, Anatoly. <span style="font-family:"Times New Roman",serif">“</span>Petruslied.<span style="font-family:"Times New Roman",serif">”</span> <em>German Writers and Works of the Early Middle Ages: 800 – 1170</em>, edited by Will Hasty and James Hardin. Gale Research, 1995, pp. 252-254.</p> <p>McLintock, David R. <span style="font-family:"Times New Roman",serif">“</span>Petruslied.<span style="font-family:"Times New Roman",serif">”</span> <em>Dictionary of the Middle Ages, v</em>ol. 9, edited by Joseph Reese Strayer. Charles Scribners Sons, 1987, p. 546.</p> <ul></ul>
## Credits
Transcription by Robert Forke, Translation by Robert Forke, Encoded in TEI P5 XML by Mae Velloso-Lyons
| 153.472222
| 2,293
| 0.770136
|
eng_Latn
| 0.958284
|
58ee9c02013f87d0185f8487a76361fddf9cec8b
| 2,405
|
md
|
Markdown
|
azps-7.5.0/Az.DiskPool/Get-AzDiskPoolZone.md
|
AlanFlorance/azure-docs-powershell
|
de1cb99c7e733eef45a3d295c0833c27ca74c17f
|
[
"CC-BY-4.0",
"MIT"
] | 38
|
2017-06-01T16:20:02.000Z
|
2019-01-16T14:00:25.000Z
|
azps-7.5.0/Az.DiskPool/Get-AzDiskPoolZone.md
|
AlanFlorance/azure-docs-powershell
|
de1cb99c7e733eef45a3d295c0833c27ca74c17f
|
[
"CC-BY-4.0",
"MIT"
] | 603
|
2017-04-18T07:22:51.000Z
|
2019-01-16T19:34:02.000Z
|
azps-7.5.0/Az.DiskPool/Get-AzDiskPoolZone.md
|
AlanFlorance/azure-docs-powershell
|
de1cb99c7e733eef45a3d295c0833c27ca74c17f
|
[
"CC-BY-4.0",
"MIT"
] | 198
|
2017-04-05T10:58:04.000Z
|
2021-11-02T03:37:57.000Z
|
---
external help file:
Module Name: Az.DiskPool
online version: https://docs.microsoft.com/powershell/module/az.diskpool/get-azdiskpoolzone
schema: 2.0.0
content_git_url: https://github.com/Azure/azure-powershell/blob/main/src/DiskPool/help/Get-AzDiskPoolZone.md
original_content_git_url: https://github.com/Azure/azure-powershell/blob/main/src/DiskPool/help/Get-AzDiskPoolZone.md
---
# Get-AzDiskPoolZone
## SYNOPSIS
Lists available Disk Pool Skus in an Azure location.
## SYNTAX
```
Get-AzDiskPoolZone -Location <String> [-SubscriptionId <String[]>] [-DefaultProfile <PSObject>]
[<CommonParameters>]
```
## DESCRIPTION
Lists available Disk Pool Skus in an Azure location.
## EXAMPLES
### Example 1: List availability zones for a location
```powershell
Get-AzDiskPoolZone -Location eastus
```
```output
SkuName SkuTier AvailabilityZone AdditionalCapability
------- ------- ---------------- --------------------
Basic Basic {3, 1, 2}
Standard Standard {3, 1, 2}
Premium Premium {3, 1, 2}
```
The command lists all availability zones for a location.
## PARAMETERS
### -DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
```yaml
Type: System.Management.Automation.PSObject
Parameter Sets: (All)
Aliases: AzureRMContext, AzureCredential
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Location
The location of the resource.
```yaml
Type: System.String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -SubscriptionId
The ID of the target subscription.
```yaml
Type: System.String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: (Get-AzContext).Subscription.Id
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
### Microsoft.Azure.PowerShell.Cmdlets.DiskPool.Models.Api20210801.IDiskPoolZoneInfo
## NOTES
ALIASES
## RELATED LINKS
| 23.125
| 315
| 0.751767
|
yue_Hant
| 0.631238
|
58efcdfbaffa995e7f6147e69b50abd73e64bac8
| 2,759
|
md
|
Markdown
|
wiki/translations/en/Mesh_MeshObject.md
|
dwhr-pi/FreeCAD-documentation
|
0c889672d80e7969dcabe83f5ddf503e72a4f5bb
|
[
"CC0-1.0"
] | null | null | null |
wiki/translations/en/Mesh_MeshObject.md
|
dwhr-pi/FreeCAD-documentation
|
0c889672d80e7969dcabe83f5ddf503e72a4f5bb
|
[
"CC0-1.0"
] | null | null | null |
wiki/translations/en/Mesh_MeshObject.md
|
dwhr-pi/FreeCAD-documentation
|
0c889672d80e7969dcabe83f5ddf503e72a4f5bb
|
[
"CC0-1.0"
] | null | null | null |
# Mesh MeshObject/en
## Description
A [Mesh MeshObject](Mesh_MeshObject.md), or formally a `Mesh::MeshObject`, is a class that defines a mesh data structure in the software. This is similar to the [Part TopoShape](Part_TopoShape.md) but for [meshes](Mesh.md).
Meshes are normally created with the [Mesh Workbench](Mesh_Workbench.md), or imported from STL, OBJ, and similar mesh file formats.
Please note that the **<img src="images/Workbench_FEM.svg" width=16px> [FEM Workbench](FEM_Workbench.md)** also uses meshes, but in this case, it uses a different data structure, called [FEM FemMesh](FEM_Mesh.md) (`Fem::FemMesh` class). This information does not apply to FEM meshes.
<img alt="" src=images/FreeCAD_core_objects.svg style="width:800px;">
*Simplified diagram of the relationships between the core objects in the program. The `Mesh::MeshObject* class is embedded in the {{incode|Mesh::Feature` object and from there it is propagated to all objects that are derived from it.}}
## Usage
The Mesh MeshObject is an object that is assigned to some [App DocumentObjects](App_DocumentObject.md).
In particular, the basic object that handles these types of attributes is the [Mesh Feature](Mesh_Feature.md) (`Mesh::Feature` class). All objects derived from this class will have access to a Mesh MeshObject.
The most notable objects that will have a Mesh MeshObject are the following:
- Any primitive mesh created with the [Mesh Workbench](Mesh_Workbench.md).
- Any object created by importing an STL, OBJ, and similar mesh format files.
## Scripting
**See also:**
[FreeCAD Scripting Basics](FreeCAD_Scripting_Basics.md), and [scripted objects](Scripted_objects.md). For a full list of attributes and methods, consult the [source documentation](Source_documentation.md), and the [Std PythonHelp](Std_PythonHelp.md) tool.
All objects derived from `Mesh::Feature` will have a [Mesh MeshObject](Mesh_MeshObject.md), which is normally accessible from its `Mesh` attribute.
```python
import FreeCAD as App
doc = App.newDocument()
obj = App.ActiveDocument.addObject("Mesh::Cube", "Cube")
App.ActiveDocument.recompute()
print(obj.Mesh)
```
A MeshObject has many attributes (variables) and methods that contain information about it, and which allow doing operations with it. These variables and methods can be tested in the [Python console](Python_console.md).
```python
print(obj.Mesh.Area)
print(obj.Mesh.BoundBox)
print(obj.Mesh.CountPoints)
print(obj.Mesh.Volume)
obj.Mesh.copy()
obj.Mesh.countComponents()
obj.Mesh.getEigenSystem()
obj.Mesh.write("my_file.stl")
```
{{Mesh Tools navi
}} {{Document objects navi}}
---
 [documentation index](../README.md) > [Mesh](Mesh_Workbench.md) > Mesh MeshObject/en
| 39.414286
| 283
| 0.76477
|
eng_Latn
| 0.972728
|
58efd0e4903aa491001ea97ee6387dee3440d179
| 7,170
|
md
|
Markdown
|
g3doc/how_tos/quantization/index.md
|
mingrammer/tensorflow-kr
|
d8f7748e58786021ea20e1888109c416f751d422
|
[
"Apache-2.0"
] | 1
|
2021-01-06T21:28:34.000Z
|
2021-01-06T21:28:34.000Z
|
g3doc/how_tos/quantization/index.md
|
mingrammer/tensorflow-kr
|
d8f7748e58786021ea20e1888109c416f751d422
|
[
"Apache-2.0"
] | null | null | null |
g3doc/how_tos/quantization/index.md
|
mingrammer/tensorflow-kr
|
d8f7748e58786021ea20e1888109c416f751d422
|
[
"Apache-2.0"
] | null | null | null |
# 텐서플로우를 이용하여 신경망 양자화(Quantize) 하는 방법
최신 신경망이 개발될 때, 가장 큰 도전은 어떻게든 일을 하게 하는 것이였다. 이것
은 학습에서 정확도와 속도가 가장 중요했다는 것을 의미한다. 부동소수점을 이용한
연산은 정확도를 유지하기 가장 쉬운 방법이었다, 그리고 GPU들은 이런 부동소수점 계
산 가속에 특화되어 있다, 따라서 다른 형태의 연산 타입에는 많은 관심이 없었다.
최근에, 많은 모델들이 적용된 상용 제품들을 다수 보유 하고 있다. The computation
demands of training grow with the number ofresearchers, but the cycles needed
for inference expand in proportion to users. 이는 많은 팀에서 순수한 추론 효율이
상당히 중요한 이슈라는 것을 의미합니다.
이런 이유로 quantization이 발생한 것입니다. Quantization은 숫자를 저장하고, 계산
을 위한 32bit 부동 소수점 형식보다 컴팩트하고, 많은 부분을 커버하는 포괄적 용어
입니다. 나는 앞으로 8bit 고정소수점에 초점을 맞추고 풀어갈 예정입니다.
[TOC]
## 양자화는 왜 동작할까?
신경망을 학습시키기 위해서는, 가중치들을 여러번 조금씩 조정해야 합니다. 그리고
조금씩 증가 혹은 감소를 통해 동작 시키기 위해서는 부동소수점이 필요하게 됩니다
(양자화된 표현을 사용하려는 노력이 있기는 하지만 말이죠).
미리 학습된 모델을 이용하여 추론하는 것은 매우 다릅니다. 깊은 신경망에서 대단한
성능을 보이는 것은 그 deep network가 입력의 노이즈를 잘 감추기 때문입니다. 만약
당신이 방금 찍은 사진에서 물체를 인식하기를 바란다면, 신경망은 모든 CCD 잡음,
빛 변화, 그리고 학습예제로 사용했던 것과 다른 불필요한 것들을 무시할 필요가 있
습니다, 그리고 중요하다고 생각되는 것에 집중하게 되죠. 이 능력은 낮은 정밀도의
연산은 위에서 언급한 것 처럼 단순히 잡음으로 취급될 수 있다는 것을 의미합니다.
그리고 적은 정보를 가지고 있는 숫자 표현으로도 정확한 결과를 생산해 냅니다.
## 왜 양자일까?
신경망 모델들은 디스크의 많은 공간을 차지합니다, 예를 들어 AlexNet의 경우 200MB
가 넘는 부동 소수점 변수들이 필요합니다. 그 크기의 대부분은 신경망 연결을 위한
가중치에 할애되고 있습니다. 그 이유는 신경망 연결이 수백만개가 하나의 모델에 존
재하기 때문입니다. 왜냐하면, 모든 변수들은 다 조금 씩 다른 부동 소수점이기 때문
입니다, zip과 같이 단순한 압축 형식은 이 변수들을 잘 압축시키지 못합니다. 많은
층에 위치해 있지고, 각각의 층의 가중치들은 대부분 특정 영역에 분산되어 있습니다.
예를 들어 -3.0 부터 +6.0까지.
Quantization의 가장 단순한 동기는 파일의 크기를 줄이는 것이었습니다. 크기를 줄
이기 위해서 각 층의 최대, 최소 값을 저장하고, 각각의 부동 소수점 값을 256개의
범위 내에서 가장 가까운 실수 값을 8bit 정수형으로 압축시키는 것입니다. 예를 들어
-3.0에서 6.0까지의 범위에서, 0x0은 -3.0을 의미합니다, 그리고 0xff는 6.0을 표현
하겠죠, 그리고 0xef는 1.5정도를 표현 하겠죠. 정확한 계산은 뒤에서 합시다, 왜냐
하면 좀 미묘한 문제가 있습니다, 하지만 이런 방식을 사용하면 75%정도의 디스크 크
기를 아낄 수 있습니다, 그리고 다시 부동 소수점으로 바꾸면 우리의 모델은 변경 없
이 부동 소수점을 사용할 수 있습니다.
Quantize의 다른 이유는 연산을 통한 추론 과정에서 하드웨어 연산기를 줄이기 위함
입니다, 전체를 8bit 입력과 8bit 출력으로 사용하여서 말이죠. 계산이 필요한 모든
곳에서 변화가 필요하기 때문에 상당히 어렵습니다. 하지만 매우 높은 보상이 있습니
다. 8bit의 값을 읽어 오는 것은 부동 소수점을 읽어오는 것의 25%에 해당하는 메모리
대역폭만을 요구합니다, 따라서 RAM에 접근에 따른 병목 현상이나, 캐싱을 함에 있어
훨씬 더 좋은 성능을 낼 수 있습니다. 또한 SIMD(Single Instruction Multiple Data)
명령어를 이용하여 한 클럭당 더욱 많은 명령어를 수행할 수도 있습니다. 몇몇 경우에
는 DSP(Digital Signal Processing)칩을 이용하여 8bit 연산을 가속할 수도 있습니다.
8bit를 이용한 연산으로 옮겨갈 경우, 모델들을 더욱 빠르고, 저전력(휴대기기에서 중
요한 조건)으로 동작시킬 수 있습니다. 또한 부동 소수점 연산이 불가능한 많은 embed
ded 시스템에 적용될 수 있습니다, 따라서 IoT 세상에 많은 애플리케이션에 적용 될
수 있습니다.
## 왜 낮은 정밀도로 바로 학습시키지 않는 것인가요?
적은 bit를 이용하여 학습시키는 실험들이 몇번 시도 되었었습니다, 하지만 결과는
역전파(backpropagation)과 기울기(gradient)를 위해서는 더욱 정밀한 bit 폭이 필
요한 것으로 파악되었습니다. 이런 문제는 학습을 더욱 복잡하게 만들고, 추론을 더욱
힘들게 합니다. 우리는 이미 부동 소수점으로 이루어진 잘알려진 모델들에 대해 실험
해보고, quantize로의 변환을 즉각적으로 매우 쉽게 할 수 있는 것을 확인 했습니다.
## 어떻게 당신의 모델을 Quantize하나요?
TensorFlow는 제품화 단계 등급의 8bit 연산기능을 지원하고 있습니다. 또한 부동 소수
점으로 학습된 많은 모델들을 양자화된 연산을 통해 동일한 추론이 가능하도록 변환할
수 있습니다. 예를들어 가장 최근의 GoogLeNet 모델을 8bit 연산으로 변경하는 방법을
소개하고 있습니다:
```sh
curl http://download.tensorflow.org/models/image/imagenet/inception-2015-12-05.tgz -o /tmp/inceptionv3.tgz
tar xzf /tmp/inceptionv3.tgz -C /tmp/
bazel build tensorflow/contrib/quantization/tools:quantize_graph
bazel-bin/tensorflow/contrib/quantization/tools/quantize_graph \
--input=/tmp/classify_image_graph_def.pb \
--output_node_names="softmax" --output=/tmp/quantized_graph.pb \
--mode=eightbit
```
이것은 내부적으로는 8bit 연산을 사용하고 가중치 또한 양자화 되었지만, 원본 모델
과 동일하게 동작합니다. 파일의 크기를 본다면, 원본과 비교하여 25%밖에 되지 않습니
다(원본은 91MB인 반면 새로 생성된 모델은 23MB이다). 같은 입력과 출력을 갖고, 같은
결과를 얻을 수 있습니다. 아래에 예제가 있습니다:
```sh
bazel build tensorflow/examples/label_image:label_image
bazel-bin/tensorflow/examples/label_image/label_image \
--input_graph=/tmp/quantized_graph.pb \
--input_width=299 \
--input_height=299 \
--mean_value=128 \
--std_value=128 \
--input_layer_name="Mul:0" \
--output_layer_name="softmax:0"
```
새롭게 양자화(quantized)된 그래프를 볼 수 있으며, 출력이 원본과 굉장히 비슷한
것을 볼 수 있습니다.
입력과 출력의 이름을 당신의 네트워크의 맞게 바꾸어 GraphDefs로 저장함으로서, 당
신의 모델도 같은 처리를 할 수 있습니다. 상수값들이 저장되어 있는 파일을 변환하기
위해 freeze_graph 스크립트를 수행하는 것을 추천합니다.
## 양자화 프로세스가 어떻게 동작하나요?
추론과정에 주로 사용되는 연산(operations)들을 8bit 버전의 동일한 동작을 할 수 있
는 코드를 구현하였습니다. Convolution, 행렬 곱셈기, 활성 함수, pooling 연산 그리
고 행렬 합산기를 포함하고 있습니다. 기존 연산과 양자화 연산이 동일하게 각각의 연산
(TensorFlow의 ops; 번역)들에 변환 스크립트를 적용하였습니다. 부동 소수점과 8bit간
의 이동을 위한 작은 부-그래프(sub-graph) 변환기를 위한 스크립트입니다. 아래 예제는
그것들이 어떻게 생겼는지에 대한 그림 입니다. 처음으로 소개할 것은 입력과 출력이
부동 소수점으로 이루어진 원본 ReLU 연산입니다:

그리고, 아래 그림은 동일하지만 변환된 subgraph입니다, 여전히 부동 소수점 입력과
출력을 갖고 있지만 내부 변환을 통해 연산은 8bit로 진행되는 것을 알 수 있습니다.

최대, 최소값 연산은 처음의 부동 소수점 tensor를 확인하고 역양자화(dequantize)연
산을 위해 공급됩니다. 양자화 표현 방법에 관한 설명은 나중에 언급하도록 하겠습
니다.
처음 각각의 연산(ReLU, convolution 등)이 변환 되었으면, 다음 단계는 부동 소수점
으로(부터, to/from)의 불필요한 변환을 없애는 것입니다. 만약 연속된 연산들이 부동
소수점과 동일(여기서는 8bit quantize를 의미)하다면, 양자화와 역 양자화는 필요가
없게 되고 서로 상쇄될 것입니다 아래와 같이요:

모든 연산(graph in tensorflow)들이 양자화 된 거대한 모델에 적용된다면 tensor들의
연산은 모두 부동 소수점으로의 변환 없이 8bit로 끝낼 수 있습니다.
## 양자화된 Tensor를 위해 사용된 표현방법은 무엇인가요?
우리는 부동소수점 숫자의 집합들을 8bit 표현으로 변경하는 방법을 압축 문제로 접근
했습니다. 우리는 학습되어 있는 신경망 모델들의 가중치와 활성 tensor들이 비교적
작은 범위로 분포되어 있다는 것을 알았습니다(예를 들어 영상 모델에서 -15부터 15까
지는 가중치, -500부터 1000까지는 활성 함수). 또한 우리는 신경망은 잡음에 상당히
강하고, 잡음과 같은 에러는 양자화 되어 결과에 영향을 미치기 힘들정도로 작아지는
것을 실험으로 확인하였습니다. 또한 거대한 행렬 곱과 같이 복잡한 연산에서 쉬운 방
법을 통한 변환을 선택하기를 원했습니다.
이런 아이디어는 두 개의 부동 소수점을 통해 최대, 최소값을 양자화 값으로 정하고
표현하는 방법을 선택하게 하였습니다. 각각의 입력에는 최대 최소값 사이에 일정한
분포를 가지고 있는 부동 소수점 집합이 존재합니다. 예를 들어 만약 우리가 -10을
최소 값으로 가지고 30을 최대값으로 가지면 8-bit 집합에서는 다음과 같이 양자화된
값이 표현될 수 있습니다:
```
Quantized | Float
--------- | -----
0 | -10.0
255 | 30.0
128 | 10.0
```
이런 형식의 장점은 범위를 통해 그 값을 표현할 수 있다는 점이고, 대칭일 필요가 없
습니다, 또한 signed 형식 혹은 unsigned 형식에 구애받지 않습니다, 선형 분포는 계산
을 바로 수행할 수 있습니다. 다음 [Song Han's code books](http://arxiv.org/pdf/1510.00149.pdf)
에서와 같이 다른 양자 표현 방식 또한 존재합니다. 비 선형적 분포를 이용하여
부동 소수점을 표현하는 방법이지만, 계산은 복잡해지는 경향이 있습니다.
이런 방식으로 양자화 하는 것의 장점은 언제든지 이리저리 부동 소수점에서 양자화 값
으로 변환이 가능하다는 점 입니다, 또는 디버깅을 위해 tensor를 분석할 때도 항상
변환이 가능합니다. One implementation detail in TensorFlow that we're hoping to
improve in the future is that the minimum and maximum float values need to be
passed as separate tensors to the one holding the quantized values, so graphs can
get a bit dense!
최대 최소값을 이용한 변환이 좋은 이유중 하나는 그 값들을 미리 알고 있을 수 있다는
점입니다. 가중치 파라미터들은 저장된 값을 읽을 때 알 수 있습니다, 따라서 그 값들
의 범위는 저장할 때 상수로 저장될 수 있습니다. 입력의 범위는 미리 알고 있는 경우가
대부분 이고(예를 들어 RGB는 0부터 255사이의 값만을 갖고 있습니다), 또한 많은 활
성 함수들의 범위도 알 고 있습니다. 이것은 행렬곱이나 convolution 같이 8bit 입력으
로부터 누적되어 생성되는 32-bit 출력 값의 결과도 미리 알 수 있어 분석해야 하는 경
우도 피할 수 있습니다.
## 다음으로는 무엇 인가요?
우리는 embedded 기기에서 8bit 수학적 연산을 통한 결과가 부동 소수점보다 훨씬
우수한 성능을 보인다는 사실을 알게 되었습니다(연산 속도인것 같습니다.;번역자).
우리가 사용하고 최적화한 행렬곱 framework를 [gemmlowp](https://github.com/google/gemmlowp)
에서 확인 할 수 있습니다. TensorFlow의 ops들의 최대 성능을 모바일
기기에서 얻기 위해 우리가 이번 실험등을 통해 얻은 결과들을 이용하여 활발히 연구
하고 있습니다. 8-bit 모델을 더욱 폭넓고 다양한 기기들을 지원하기를 희망하고 있습
니다. 그러기 위해 지금은 양자화 구현이 빠르고 정확한 reference 구현이 되어야 할
것입니다. 또한 우리는 이번 데모가 낮은 수준의 정확도를 가진 신경망을 연구하는
그룹에게 힘을 주기를 바라고 있습니다.
<번역 완료일: 2016. 06.30. 번역자: jjjhoon@gmail.com 의역 다수 존재>
<중간 중간 의미 전달이 어려운 부분은 영어로 대체 및 번역을 하지 않았습니다>
<피드백 및 오류 지적은 언제든 환영합니다>
| 34.805825
| 106
| 0.729847
|
kor_Hang
| 1.00001
|
58f001206d1493608e89a72cebdd296808763bd4
| 2,297
|
md
|
Markdown
|
topics/symfony-architecture.md
|
carlosmediaadgo/symfony-certification-preparation-list
|
b9b1bae366661cae2aa74a39f21e7886ed7aa2ab
|
[
"MIT"
] | null | null | null |
topics/symfony-architecture.md
|
carlosmediaadgo/symfony-certification-preparation-list
|
b9b1bae366661cae2aa74a39f21e7886ed7aa2ab
|
[
"MIT"
] | null | null | null |
topics/symfony-architecture.md
|
carlosmediaadgo/symfony-certification-preparation-list
|
b9b1bae366661cae2aa74a39f21e7886ed7aa2ab
|
[
"MIT"
] | 1
|
2018-03-02T08:52:56.000Z
|
2018-03-02T08:52:56.000Z
|
---
title: Symfony Architecture - Symfony Certification Preparation List
---
[Back to index](../readme.md#table-of-contents)
# Symfony Architecture
## Symfony Standard Edition
- [Symfony 3.0 Documentation - symfony.com](http://symfony.com/doc/3.0/index.html)
- [symfony/symfony-standard - github.com](https://github.com/symfony/symfony-standard)
## License
- [Symfony License - symfony.com](http://symfony.com/doc/3.0/contributing/code/license.html)
## Components
- [Symfony Components - symfony.com](http://symfony.com/components)
## Bundles
- [The Bundle System - symfony.com](http://symfony.com/doc/3.0/cookbook/bundles/index.html)
- [Best Practices for Reusable Bundles - symfony.com](https://symfony.com/doc/3.0/bundles/best_practices.html)
## Bridges
- [What are symfony bridges, bundles and vendor? - stackoverflow.com](https://stackoverflow.com/questions/11888522/what-are-symfony-bridges-bundles-and-vendor)
## Configuration
- [The Config Component - symfony.com](http://symfony.com/doc/3.0/components/config.html)
## Code organization
- [Organizing Your Business Logic - symfony.com](http://symfony.com/doc/3.0/best_practices/business-logic.html)
## Request handling
- [Symfony and HTTP Fundamentals - symfony.com](http://symfony.com/doc/3.0/introduction/http_fundamentals.html)
## Exception handling
- [How to Customize Error Pages - symfony.com](https://symfony.com/doc/3.0/controller/error_pages.html)
## Event dispatcher and kernel events
- [Symfony Framework Events - symfony.com](https://symfony.com/doc/3.0/reference/events.html)
- [The HttpKernel Component - symfony.com](http://symfony.com/doc/3.0/components/http_kernel.html)
- [The EventDispatcher Component - symfony.com](https://symfony.com/doc/3.0/components/event_dispatcher.html)
## Official best practices
- [Symfony Best Practices - symfony.com](http://symfony.com/doc/3.0/best_practices/index.html)
## Release management
- [The Release Process - symfony.com](http://symfony.com/doc/3.0/contributing/community/releases.html)
## Backward compatibility promise
- [Our Backwards Compatibility Promise - symfony.com](http://symfony.com/doc/3.0/contributing/code/bc.html)
## Deprecations best practices
- [Deprecations - symfony.com](http://symfony.com/doc/3.0/contributing/code/conventions.html#deprecations)
| 44.173077
| 159
| 0.761863
|
yue_Hant
| 0.623672
|
58f161a965913cd9576d05eb6fdd13b47b1d198e
| 2,455
|
md
|
Markdown
|
docs/vs-2015/debugger/debug-interface-access/idiaenumtables-item.md
|
adrianodaddiego/visualstudio-docs.it-it
|
b2651996706dc5cb353807f8448efba9f24df130
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
docs/vs-2015/debugger/debug-interface-access/idiaenumtables-item.md
|
adrianodaddiego/visualstudio-docs.it-it
|
b2651996706dc5cb353807f8448efba9f24df130
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
docs/vs-2015/debugger/debug-interface-access/idiaenumtables-item.md
|
adrianodaddiego/visualstudio-docs.it-it
|
b2651996706dc5cb353807f8448efba9f24df130
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
---
title: Idiaenumtables | Microsoft Docs
ms.date: 11/15/2016
ms.prod: visual-studio-dev14
ms.technology: vs-ide-debug
ms.topic: reference
dev_langs:
- C++
helpviewer_keywords:
- IDiaEnumTables::Item method
ms.assetid: d65ab262-10c6-48ce-95a3-b5e4cb2c85af
caps.latest.revision: 14
author: MikeJo5000
ms.author: mikejo
manager: jillfra
ms.openlocfilehash: 9eec94a5a02eda8fe9b1b3bf8f76f5050ab1e020
ms.sourcegitcommit: 94b3a052fb1229c7e7f8804b09c1d403385c7630
ms.translationtype: MT
ms.contentlocale: it-IT
ms.lasthandoff: 04/23/2019
ms.locfileid: "62423868"
---
# <a name="idiaenumtablesitem"></a>IDiaEnumTables::Item
[!INCLUDE[vs2017banner](../../includes/vs2017banner.md)]
Recupera una tabella tramite un indice o nome.
## <a name="syntax"></a>Sintassi
```cpp#
HRESULT Item (
VARIANT index,
IDiaTable** table
);
```
#### <a name="parameters"></a>Parametri
`index`
[in] Indice o nome del [IDiaTable](../../debugger/debug-interface-access/idiatable.md) da recuperare. Se si usa una variante dell'integer, deve essere compreso nell'intervallo da 0 a `count`-1, dove `count` viene restituito dalle [Idiaenumtables](../../debugger/debug-interface-access/idiaenumtables-get-count.md) (metodo).
`table`
[out] Restituisce un [IDiaTable](../../debugger/debug-interface-access/idiatable.md) oggetto che rappresenta la tabella desiderata.
## <a name="return-value"></a>Valore restituito
Se ha esito positivo, restituisce `S_OK`; in caso contrario, restituisce un codice di errore.
## <a name="remarks"></a>Note
Se viene specificata una variante di stringa, la stringa di nomi di una determinata tabella. Il nome deve essere uno dei nomi di tabella come definito in [costanti (Debug Interface Access SDK)](../../debugger/debug-interface-access/constants-debug-interface-access-sdk.md).
## <a name="example"></a>Esempio
```cpp#
VARIANT var;
var.vt = VT_BSTR;
var.bstrVal = SysAllocString(DiaTable_Symbols );
IDiaTable* pTable;
pEnumTables->Item( var, &pTable );
```
## <a name="see-also"></a>Vedere anche
[IDiaEnumTables](../../debugger/debug-interface-access/idiaenumtables.md)
[IDiaTable](../../debugger/debug-interface-access/idiatable.md)
[IDiaEnumTables::get_Count](../../debugger/debug-interface-access/idiaenumtables-get-count.md)
[Costanti (Debug Interface Access SDK)](../../debugger/debug-interface-access/constants-debug-interface-access-sdk.md)
| 37.769231
| 326
| 0.728717
|
ita_Latn
| 0.304831
|
58f1710987228cdf3fbccf94024a5ca60bf7eb37
| 796
|
md
|
Markdown
|
DEVELOPMENT.md
|
mprinc/parSentExtract
|
70ac0e6666966675c1fc07cdf27d1be07064e02b
|
[
"MIT"
] | null | null | null |
DEVELOPMENT.md
|
mprinc/parSentExtract
|
70ac0e6666966675c1fc07cdf27d1be07064e02b
|
[
"MIT"
] | null | null | null |
DEVELOPMENT.md
|
mprinc/parSentExtract
|
70ac0e6666966675c1fc07cdf27d1be07064e02b
|
[
"MIT"
] | null | null | null |
```sh
git clone https://github.com/mprinc/parSentExtract
```
requirements.txt
https://pypi.org/project/tensorflow/#history
https://pypi.org/project/numpy/#history
https://pypi.org/project/scikit-learn/#history
https://pypi.org/project/scipy/#history
```sh
pyenv install 3.7.2
pyenv virtualenv 3.7.2 python3.7.2_env
pyenv local python3.7.2_env
# https://github.com/tensorflow/tensor2tensor/issues/1754#issuecomment-565844926
python -m pip install tensorflow==1.14.0
python -m pip install numpy==1.15.2
python -m pip install scipy==1.1.0
python -m pip install scikit-learn==0.19.2
# import sklearn
python train.py --source_train_path ../data/train.en --target_train_path ../data/train.fr --source_valid_path ../data/valid.en --target_valid_path ../data/valid.fr --checkpoint_dir ../tflogs
```
| 30.615385
| 190
| 0.76005
|
kor_Hang
| 0.227553
|
58f1a691c2fed3863129d8f9846498b4a0eade0c
| 2,681
|
md
|
Markdown
|
docs/2014/master-data-services/lock-a-version-master-data-services.md
|
SteSinger/sql-docs.de-de
|
2259e4fbe807649f6ad0d49b425f1f3fe134025d
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
docs/2014/master-data-services/lock-a-version-master-data-services.md
|
SteSinger/sql-docs.de-de
|
2259e4fbe807649f6ad0d49b425f1f3fe134025d
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
docs/2014/master-data-services/lock-a-version-master-data-services.md
|
SteSinger/sql-docs.de-de
|
2259e4fbe807649f6ad0d49b425f1f3fe134025d
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
---
title: Sperren einer Version (Master Data Services) | Microsoft-Dokumentation
ms.custom: ''
ms.date: 06/14/2017
ms.prod: sql-server-2014
ms.reviewer: ''
ms.technology: master-data-services
ms.topic: conceptual
helpviewer_keywords:
- versions [Master Data Services], locking
- locking versions [Master Data Services]
ms.assetid: 7bb62a84-12d8-4b29-9b6e-6aa25410618e
author: lrtoyou1223
ms.author: lle
manager: craigg
ms.openlocfilehash: e38a4c75ad6cf8c65d7120e0eb98163f7ee0fccc
ms.sourcegitcommit: 3026c22b7fba19059a769ea5f367c4f51efaf286
ms.translationtype: MT
ms.contentlocale: de-DE
ms.lasthandoff: 06/15/2019
ms.locfileid: "65482875"
---
# <a name="lock-a-version-master-data-services"></a>Sperren einer Version (Master Data Services)
Sperren Sie in [!INCLUDE[ssMDSshort](../includes/ssmdsshort-md.md)]eine Version eines Modells, um Änderungen an den Elementen des Modells und den Attributen zu verhindern.
> [!NOTE]
> Wenn eine Version gesperrt ist, können Modelladministratoren weiterhin Elemente hinzuzufügen, bearbeiten und entfernen. Andere Benutzer mit Berechtigungen für das Modell können die Elemente jedoch nur anzeigen.
## <a name="prerequisites"></a>Erforderliche Komponenten
So führen Sie diese Prozedur aus
- Sie müssen über die Berechtigung verfügen, auf den Funktionsbereich **Versionsverwaltung** zuzugreifen.
- Sie müssen ein Modelladministrator sein. Weitere Informationen finden Sie unter [Administratoren (Master Data Services)](administrators-master-data-services.md)zuzugreifen.
- Der Status der Version muss **Öffnen**sein.
### <a name="to-lock-a-version"></a>So sperren Sie eine Version
1. Klicken Sie in [!INCLUDE[ssMDSmdm](../includes/ssmdsmdm-md.md)]auf **Versionsverwaltung**.
2. Wählen Sie auf der Seite **Versionen verwalten** die Zeile für die Version aus, die Sie sperren möchten.
3. Klicken Sie auf **Sperren**.
4. Klicken Sie im Bestätigungsdialogfeld auf **OK**.
## <a name="next-steps"></a>Nächste Schritte
- [Überprüfen einer Version anhand von Geschäftsregeln (Master Data Services)](../../2014/master-data-services/validate-a-version-against-business-rules-master-data-services.md)
- [Durchführen eines Commits für eine Version (Master Data Services)](../../2014/master-data-services/commit-a-version-master-data-services.md)
## <a name="see-also"></a>Siehe auch
[Versionen (Master Data Services)](../../2014/master-data-services/versions-master-data-services.md)
[Entsperren einer Version (Master Data Services)](../../2014/master-data-services/unlock-a-version-master-data-services.md)
| 45.440678
| 215
| 0.748974
|
deu_Latn
| 0.822461
|
58f20810b527b7824208086be99e72ff7593caf0
| 2,019
|
md
|
Markdown
|
doc/zh/object/general.md
|
ferhatelmas/JavaScript-Garden
|
26bf2c19339457976bed3c622c5b4dbcbacf02c4
|
[
"MIT"
] | 1
|
2015-11-08T23:33:38.000Z
|
2015-11-08T23:33:38.000Z
|
doc/zh/object/general.md
|
Ragnarokkr/JavaScript-Garden
|
a582d1499394901676e13087ea04546246a34bd3
|
[
"MIT"
] | null | null | null |
doc/zh/object/general.md
|
Ragnarokkr/JavaScript-Garden
|
a582d1499394901676e13087ea04546246a34bd3
|
[
"MIT"
] | 1
|
2018-09-08T04:36:07.000Z
|
2018-09-08T04:36:07.000Z
|
##对象使用和属性
JavaScript 中所有变量都是对象,除了两个例外 [`null`](#core.undefined) 和 [`undefined`](#core.undefined)。
false.toString(); // 'false'
[1, 2, 3].toString(); // '1,2,3'
function Foo(){}
Foo.bar = 1;
Foo.bar; // 1
一个常见的误解是数字的字面值(literal)不是对象。这是因为 JavaScript 解析器的一个错误,
它试图将*点操作符*解析为浮点数字面值的一部分。
2.toString(); // 出错:SyntaxError
有很多变通方法可以让数字的字面值看起来像对象。
2..toString(); // 第二个点号可以正常解析
2 .toString(); // 注意点号前面的空格
(2).toString(); // 2先被计算
###对象作为数据类型
JavaScript 的对象可以作为[*哈希表*][1]使用,主要用来保存命名的键与值的对应关系。
使用对象的字面语法 - `{}` - 可以创建一个简单对象。这个新创建的对象从 `Object.prototype`
[继承](#object.prototype)下面,没有任何[自定义属性](#object.hasownproperty)。
var foo = {}; // 一个空对象
// 一个新对象,拥有一个值为12的自定义属性'test'
var bar = {test: 12};
### 访问属性
有两种方式来访问对象的属性,点操作符或者中括号操作符。
var foo = {name: 'kitten'}
foo.name; // kitten
foo['name']; // kitten
var get = 'name';
foo[get]; // kitten
foo.1234; // SyntaxError
foo['1234']; // works
两种语法是等价的,但是中括号操作符在下面两种情况下依然有效
- 动态设置属性
- 属性名不是一个有效的变量名(**[译者注][30]:**比如属性名中包含空格,或者属性名是 JS 的关键词)
> **[译者注][30]:**在 [JSLint][2] 语法检测工具中,点操作符是推荐做法。
###删除属性
删除属性的唯一方法是使用 `delete` 操作符;设置属性为 `undefined` 或者 `null` 并不能真正的删除属性,
而**仅仅**是移除了属性和值的关联。
var obj = {
bar: 1,
foo: 2,
baz: 3
};
obj.bar = undefined;
obj.foo = null;
delete obj.baz;
for(var i in obj) {
if (obj.hasOwnProperty(i)) {
console.log(i, '' + obj[i]);
}
}
上面的输出结果有 `bar undefined` 和 `foo null` - 只有 `baz` 被真正的删除了,所以从输出结果中消失。
###属性名的语法
var test = {
'case': 'I am a keyword so I must be notated as a string',
delete: 'I am a keyword too so me' // 出错:SyntaxError
};
对象的属性名可以使用字符串或者普通字符声明。但是由于 JavaScript 解析器的另一个错误设计,
上面的第二种声明方式在 ECMAScript 5 之前会抛出 `SyntaxError` 的错误。
这个错误的原因是 `delete` 是 JavaScript 语言的一个*关键词*;因此为了在更低版本的 JavaScript 引擎下也能正常运行,
必须使用*字符串字面值*声明方式。
[1]: http://en.wikipedia.org/wiki/Hashmap
[2]: http://www.jslint.com/
[30]: http://cnblogs.com/sanshi/
| 21.478723
| 87
| 0.617632
|
yue_Hant
| 0.799583
|
58f30d6b6aa3be5c127fceb89aa40e7ded9c3190
| 2,394
|
md
|
Markdown
|
README.md
|
cyber-republic/supernode-voting
|
4c91052ec2b17f7b9b34cd4701261104ce59dd33
|
[
"MIT"
] | null | null | null |
README.md
|
cyber-republic/supernode-voting
|
4c91052ec2b17f7b9b34cd4701261104ce59dd33
|
[
"MIT"
] | null | null | null |
README.md
|
cyber-republic/supernode-voting
|
4c91052ec2b17f7b9b34cd4701261104ce59dd33
|
[
"MIT"
] | null | null | null |
# Voter Reward Payout Script for DPOS Nodes
## Public Supernode Overview
The public supernode overview is the public facing collection of statistics about the supernode, its voters and payout details anyone can see in their browser.
- Supernode unique short description & links (optional)
- Date of last payout
- Date of next payout
- Rank of supernode
- Productivity (uptime since eligibility to forge rewards)
- Approval (percentage of votes across entire network)
- Total payout until now
- Total pending payout (since last payout)
- Number of voters
- List of voters by address -> sorted in descending order by vote weight
- Language switcher (localization)
## Supernode Payout Options
The supernode payout options can be set by the supernode in the configuration. These settings are protected and are only available to the supernode.
- Calculate own costs ( monthly costs in USD -> convert USD to amount of Rewards)
- Total percentage of rewards to distribute from profit (income minus costs) OR total
- Distribution schedule: weekly, monthly, custom, manual
- Minimum payout amount
- Minimum voter weight to be eligible for payout
- Subtract transaction fee from voter payout (yes/no)
- Coins to release: ELA + (later from sidechains) checkbox
- Blacklist address from payout (for example if key is lost by voter)
**Required Voter Details:**
- Voter public address
- Voter DID
- Initial vote or Change of vote (initial vote, and for every change of votes: repeat + log)
- Start date of vote + vote weight for node
- End date of vote -> set vote weight to null
## Supernode Payout Process
The payout process is the distribution of funds based on the previously collected statistics about voters.
### Manual Payout Option (Most secure)
- Download list of voter statistics into a csv / xml / json format
- Open wallet
- Load list
- Double check list (full overview)
- Submit transactions -> payout
- Optional: Statistics Script running on server may recognize payouts or can be marked manually
- Requirements: Allow downloads of statistics from script, Web Wallet integration for uploads and starting bulk transactions OR custom desktop wallet for supernodes
### Automated Payout option
- Script gathers voter statistics automatically
- Payouts are initiated based on cron jobs (scheduled)
- Requirements: Wallet API integration -> very high security standards needed
| 47.88
| 166
| 0.779449
|
eng_Latn
| 0.987585
|
58f312f8ad968b884b341c5b5f7baa6a8252fed3
| 9,659
|
md
|
Markdown
|
docs/options.md
|
db-developer/grunt-nyc-mocha
|
1e6cd9ad4c8c0f70085a39fcfca33d077ecbd866
|
[
"MIT"
] | 5
|
2021-01-31T06:55:43.000Z
|
2021-01-31T07:38:10.000Z
|
docs/options.md
|
db-developer/grunt-nyc-mocha
|
1e6cd9ad4c8c0f70085a39fcfca33d077ecbd866
|
[
"MIT"
] | null | null | null |
docs/options.md
|
db-developer/grunt-nyc-mocha
|
1e6cd9ad4c8c0f70085a39fcfca33d077ecbd866
|
[
"MIT"
] | null | null | null |
[Back to README.md](../README.md)
## all plugin options in depth ##
Be aware of the set of configurable options provided by this plugin is only an
extract of the original options. So it's just normal, that you will be missing
options you personally require. If so, take a look at the
_node.opts_, _nyc.opts_ and _mocha.opts_ array, which enables you to pass through
any options and values to node, nyc and mocha, you desire.
The following options (options => optional!) _may_ be used with task "nyc_mocha":
* _cwd_ {string} [defaults to: <code>process.cwd()</code> ]
Defines the working directory of each node process, which will be spawned by
targets. If not set, it defaults to the "current working directory" of grunt.
* _dryrun_ {Boolean} [defaults to: <code>false</code> ]
Prints to stdout, what would have been sent to <code>grunt.util.spawn</code>.
* _node_ {Object} [defaults to:<code>{exec: process.execPath, opts: false}</code> ]
Node configuration section.
* _node.exec_ {string} [default: see _node_ {Object}]
May be used to define a custom node executable to spawn for each/any/some targets.
* _node.opts_ {Array<string>} [default: see _node_ {Object}]
See [node command-line options](https://nodejs.org/api/cli.html) for possible values.
* _nyc_ {Object} [defaults to:<code>{ /* find default properties below*/ }</code> ]
nyc configuration section.
* _nyc.all_ {Boolean} [default see nyc --all, -a]
Whether or not to instrument all files of the project (not just the ones touched
by your test suite)
* _nyc.clean_ {Boolean} [default see nyc --clean]
Clean .nyc_output folder before testing?
* _nyc.coverage_ {Object} [defaults to:<code>{ dir: "coverage", reporter: "text" }</code> ]
nyc coverage configuration section.
* _nyc.coverage.dir_ {string} [default see nyc --report-dir]
Directory to output coverage reports
* _nyc.coverage.reporter_ {Array<string>} [default see nyc --reporter, -r]
Coverage reportes to use
* _nyc.coverage.check_ {Boolean} [default see nyc --check-coverage]
Check whether coverage is within thresholds.
* _nyc.coverage.perfile_ {Boolean} [default see nyc --per-file]
Check thresholds per file (requires nyc.coverage.check === true)
* _nyc.coverage.branches_ {number} [default see nyc --branches]
What % of branches must be covered? (requires nyc.coverage.check === true)
* _nyc.coverage.functions_ {number} [default see nyc --functions]
What % of functions must be covered? (requires nyc.coverage.check === true)
* _nyc.coverage.lines_ {number} [default see nyc --lines]
What % of lines must be covered? (requires nyc.coverage.check === true)
* _nyc.coverage.statements_ {number} [default see nyc --statements]
What % of statements must be covered? (requires nyc.coverage.check === true)
* _nyc.exec_ {string} [defaults to:<code>require.resolve( "nyc/bin/nyc" )</code> ]
At the time of this writing, this option is not required, because the nyc main
script can be resolved by <code>require.resolve( "nyc/bin/nyc" )</code>.
In case of any future changes, the nyc main script may be set at this point.
* _nyc.excludes_ {Array<string>} [default see nyc --exclude, -x]
A list of specific files and directories that should be excluded from coverage.
* _nyc.extensions_ {Array<string>} [default see nyc --extension, -e]
A list of extensions that nyc should handle in addition to .js
* _nyc.includes_ {Array<string>} [default see nyc --include, -n]
A list of specific files and directories that should be covered.
* _nyc.opts_ {Array<string>} [default: false]
See [nyc command-line interface](https://github.com/istanbuljs/nyc). Beyond that,
calling "nyc --help" on your shell will reveal a far better reference...
* _nyc.requires_ {Array<string>} [default: false, see nyc --require, -i]
A list of additional modules that nyc should attempt to require in its subprocess.
Note: In case you prefer stacktraces with valid source references you might want
to check [sourcemap support](./docs/sourcemapsupport.md).
* _nyc.sourcemap_ {Object} [defaults to:<code>{ create: undefined, use: undefined }</code> ]
nyc sourcemap configuration
* _nyc.sourcemap.create_ {Boolean} [default see nyc --produce-source-map]
Should nyc produce source maps?
Note: In case you prefer stacktraces with valid source references you might want
to check [sourcemap support](./docs/sourcemapsupport.md).
* _nyc.sourcemap.use_ {Boolean} [default see nyc --source-map]
Should nyc detect and handle source maps?
Note: In case you prefer stacktraces with valid source references you might want
to check [sourcemap support](./docs/sourcemapsupport.md).
* _nyc.temp_ {Boolean} [default see nyc --temp-dir]
Directory to output raw coverage information to.
* _mocha_ {Object} [defaults to:<code>{ /* find default properties below*/ }</code> ]
mocha configuration section.
If you are missing any option, you may pass it via _mocha.opts_ array.
* _mocha.bail_ {Boolean} [default see mocha --bail, -b]
Abort ("bail") after first test failure.
* _mocha.color_ {Boolean} [default see mocha --color, -c, -colors]
Color TTY output from reporter?
* _mocha.exec_ {string} [defaults to:<code>require.resolve( "mocha/bin/_mocha" )</code> ]
At the time of this writing, this option is not required, because the mocha main
script can be resolved by <code>require.resolve( "mocha/bin/_mocha" )</code>.
In case of any future changes, the mocha main script may be set at this point.
* _mocha.exit_ {Boolean} [default see mocha --exit]
Force Mocha to quit after tests complete.
* _mocha.opts_ {Array<string>} [default: false]
See [mocha command-line interface](https://mochajs.org/api/mocha). Beyond that,
calling "mocha --help" on your shell will reveal a far better reference...
* _mocha.recursive_ {Boolean} [default see mocha --recursive]
Look for tests in subdirectories?
* _mocha.timeout_ {number} [default see mocha --timeout, -t, --timeouts]
Specify test timeout threshold (in milliseconds)
* _mocha.ui_ {string} [default see mocha --ui, -u]
Specify user interface
## nyc_mocha options example ##
Example configuration to be used with package <code>load-grunt-config</code>,
which makes it possible to focus on options of task "nyc_mocha".
```javascript
// nyc_mocha default options. false or undefined results in options not being set.
// Options not set means: nyc or mocha will use their default settings.
module.exports = function ( grunt, options ) {
return {
options: {
cwd: process.cwd(), // working directory for nyc + mocha run
dryrun: false, // dry run - do nothing just print cmd line
node: {
exec: false, // defaults to: process.execPath
opts: false // array of node options
},
nyc: {
all: false, // instrument all files?
clean: undefined, // clean .nyc_output folder before testing
coverage: {
branches: false, // what % of branches must be covered?
check: false, // check wether coverage is within thresholds
dir: false, // report nyc coverage results to folder
functions: false, // what % of functions must be covered?
lines: false, // what % of lines must be covered?
perfile: false, // check thresholds per file
reporter: false, // report coverage using reporter 'text'|'html'
statements: false // what % of statements must be covered?
},
exec: false, // path to node_modules/.../nyc script
excludes: false, // array of files and directories to exclude
extensions: false, // additional extensions that nyc should handle
includes: false, // array of files and directories to inclode
opts: false, // additional options not covered by plugin
requires: false, // array of scripts to additionally require
sourcemap: {
create: undefined, // should nyc produce sourcemaps
use: undefined // should nyc detect and handle sourcemaps
},
temp: false, // directory to output raw coverage information
}, // ... which defaults to .nyc_output
mocha: {
bail: undefined, // abort ("bail") after first test failure
color: false, // force colored output
exec: false, // path to node_modules/.../mocha script
exit: false, // force Mocha to quit after tests complete
opts: false, // additional options not covered by plugin
recursive: false, // look for tests in subdirectories
timeout: false, // test timeout threshold (millis)
ui: false // user interfaces
}
},
mytarget: {
// ... whatever ...
},
myothertarget: {
options: {
nyc: {
all: true, // overwrite tasklevel options.nyc.all
}
}
}
}
};
```
| 47.581281
| 96
| 0.642924
|
eng_Latn
| 0.962565
|
58f32c7fffa12827a317681aa1060031c0a3db10
| 1,663
|
md
|
Markdown
|
README.md
|
diogoff/eps2018
|
197534b276a60a1dcd9f63dfe0b64a17a89db14c
|
[
"MIT"
] | 1
|
2018-11-20T02:12:57.000Z
|
2018-11-20T02:12:57.000Z
|
README.md
|
diogoff/eps2018
|
197534b276a60a1dcd9f63dfe0b64a17a89db14c
|
[
"MIT"
] | null | null | null |
README.md
|
diogoff/eps2018
|
197534b276a60a1dcd9f63dfe0b64a17a89db14c
|
[
"MIT"
] | null | null | null |
# Source code for the EPS 2018 paper/poster
_Regularization extraction for real-time plasma tomography at JET_
[[paper](http://web.tecnico.ulisboa.pt/diogo.ferreira/papers/ferreira18regularization.pdf)]
[[poster](http://web.tecnico.ulisboa.pt/diogo.ferreira/papers/ferreira18regularization_poster.pdf)]
D. R. Ferreira, D. D. Carvalho, P. J. Carvalho, H. Fernandes, and JET Contributors
[45th EPS Conference on Plasma Physics](https://eps2018.eli-beams.eu/en/), Prague, Czech Republic, July 2-6, 2018
## Files
* `geom.txt` and `kb5_los.txt` contain the geometry for the vessel and the KB5 lines of sight, respectively.
* `geom.py` contains some simple routines to read those geometry files.
* `tomo_kb5_reliable.hdf` contais the reconstructions that were used for data fiting; `bolo_kb5_reliable.hdf` contains the full KB5 signals for those same pulses.
* `fit_M.py` fits the *M* matrix using the full dataset; `fit_validate_M.py` fits *M* using 90% for training and 10% for validation.
* `train.png` and `valid.png` contain the computation graphs generated by Theano for the train and validation functions, respectively.
* `train.log` contains the loss and validation loss recorded during training.
* `plot_train.py` plots the loss and validation loss during (or after) training.
* When training finishes, *M* will be saved to `M.npy`.
* `plot_M.py` plots the regularization patterns found in the columns of M.
* `metrics.py` calculates SSIM, PNSR and NRMSE on the validation set, after *M* has been trained.
* `create_movie.py` generates a full-pulse reconstruction video for shot 92213.
* `92213_47.00_54.50.mp4` contains the generated movie.
| 48.911765
| 162
| 0.765484
|
eng_Latn
| 0.94603
|
58f4136baf3e6bed0c626d319ba107c7d553efbf
| 82
|
md
|
Markdown
|
README.md
|
Gr1m3y/Peragenome
|
1d7dc39e31494a7fe757ac68de470681da60ce3e
|
[
"MIT"
] | null | null | null |
README.md
|
Gr1m3y/Peragenome
|
1d7dc39e31494a7fe757ac68de470681da60ce3e
|
[
"MIT"
] | null | null | null |
README.md
|
Gr1m3y/Peragenome
|
1d7dc39e31494a7fe757ac68de470681da60ce3e
|
[
"MIT"
] | null | null | null |
# Peragenome
A tool for organizing and retrieving metagenome-associated metadata.
| 27.333333
| 68
| 0.841463
|
eng_Latn
| 0.904936
|
58f4398eceb679c4aafb83b01657e793906e20c9
| 6,868
|
md
|
Markdown
|
desktop-src/DevNotes/iextender.md
|
npherson/win32
|
28da414b56bb3e56e128bf7e0db021bad5343d2d
|
[
"CC-BY-4.0",
"MIT"
] | 3
|
2020-04-24T13:02:42.000Z
|
2021-07-17T15:32:03.000Z
|
desktop-src/DevNotes/iextender.md
|
npherson/win32
|
28da414b56bb3e56e128bf7e0db021bad5343d2d
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
desktop-src/DevNotes/iextender.md
|
npherson/win32
|
28da414b56bb3e56e128bf7e0db021bad5343d2d
|
[
"CC-BY-4.0",
"MIT"
] | 1
|
2022-03-09T23:50:05.000Z
|
2022-03-09T23:50:05.000Z
|
---
Description: The IExtender interface provides a set of basic properties that are added to the interface of a control. Programmers can use these properties as if they were part of the control.
ms.assetid: 901873bd-af6a-415e-865f-21769367c99f
title: IExtender interface
ms.topic: interface
ms.date: 05/31/2018
topic_type:
- APIRef
- kbSyntax
api_name:
- IExtender
- IExtender.Align
- IExtender.get_Align
- IExtender.put_Align
- IExtender.Enabled
- IExtender.get_Enabled
- IExtender.put_Enabled
- IExtender.Height
- IExtender.get_Height
- IExtender.put_Height
- IExtender.Left
- IExtender.get_Left
- IExtender.put_Left
- IExtender.TabStop
- IExtender.get_TabStop
- IExtender.put_TabStop
- IExtender.Top
- IExtender.get_Top
- IExtender.put_Top
- IExtender.Visible
- IExtender.get_Visible
- IExtender.put_Visible
- IExtender.Width
- IExtender.get_Width
- IExtender.put_Width
- IExtender.Name
- IExtender.get_Name
- IExtender.Parent
- IExtender.get_Parent
- IExtender.Hwnd
- IExtender.get_Hwnd
- IExtender.Container
- IExtender.get_Container
api_type:
- COM
api_location:
- Ole2disp.dll
- Oleaut32.dll
---
# IExtender interface
The **IExtender** interface provides a set of basic properties that are added to the interface of a control. Programmers can use these properties as if they were part of the control.
## Members
The **IExtender** interface inherits from the [**IUnknown**](https://msdn.microsoft.com/en-us/library/ms680509(v=VS.85).aspx) interface. **IExtender** also has these types of members:
- [Methods](#methods)
- [Properties](#properties)
### Methods
The **IExtender** interface has these methods.
| Method | Description |
|:-------------------------------|:-----------------------------------------------|
| [**Move**](iextender-move.md) | Moves an MDIForm, form, or control.<br/> |
### Properties
The **IExtender** interface has these properties.
<table>
<colgroup>
<col style="width: 33%" />
<col style="width: 33%" />
<col style="width: 33%" />
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">Property</th>
<th style="text-align: left;">Access type</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Align<br/></td>
<td style="text-align: left;">Read/write<br/></td>
<td style="text-align: left;">Returns or sets a value that determines whether an object is displayed in any size anywhere on a form or whether it is displayed at the top, bottom, left, or right of the form and is automatically sized to fit the width of the form.<br/>
<table>
<thead>
<tr class="header">
<th>Constant</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>vbAlignNone 0</td>
<td>(Default in a non-MDI form) None—size and location can be set at design time or in code. The setting is ignored if the object is on an MDI form.</td>
</tr>
<tr class="even">
<td>vbAlignTop 1</td>
<td>(Default in an MDI form) Top—the object is at the top of the form, and its width is equal to the ScaleWidth property setting of the form.</td>
</tr>
<tr class="odd">
<td>vbAlignBottom 2</td>
<td>Bottom—the object is at the bottom of the form, and its width is equal to the ScaleWidth property setting of the form.</td>
</tr>
<tr class="even">
<td>vbAlignLeft 3</td>
<td>Left—the object is at the left of the form, and its width is equal to the ScaleWidth property setting of the form.</td>
</tr>
<tr class="odd">
<td>vbAlignRight 4</td>
<td>Right—the object is at the right of the form, and its width is equal to the ScaleWidth property setting of the form.</td>
</tr>
</tbody>
</table>
<p> </p></td>
</tr>
<tr class="even">
<td style="text-align: left;"><p>Container</p></td>
<td style="text-align: left;"><p>Read-only</p></td>
<td style="text-align: left;"><p>Returns the container of a control on a form.</p></td>
</tr>
<tr class="odd">
<td style="text-align: left;"><p>Enabled</p></td>
<td style="text-align: left;"><p>Read/write</p></td>
<td style="text-align: left;"><p>Returns or sets a value that determines whether a form or control can respond to user-generated events.</p></td>
</tr>
<tr class="even">
<td style="text-align: left;"><p>Height</p></td>
<td style="text-align: left;"><p>Read/write</p></td>
<td style="text-align: left;"><p>Returns or sets the height of an object.</p></td>
</tr>
<tr class="odd">
<td style="text-align: left;"><p>Hwnd</p></td>
<td style="text-align: left;"><p>Read-only</p></td>
<td style="text-align: left;"><p>Returns a handle to a form or control.</p></td>
</tr>
<tr class="even">
<td style="text-align: left;"><p>Left</p></td>
<td style="text-align: left;"><p>Read/write</p></td>
<td style="text-align: left;"><p>Returns or sets the distance between the internal left edge of an object and the left edge of its container.</p></td>
</tr>
<tr class="odd">
<td style="text-align: left;"><p>Name</p></td>
<td style="text-align: left;"><p>Read-only</p></td>
<td style="text-align: left;"><p>Returns the name used in code to identify a form, control, or data access object.</p></td>
</tr>
<tr class="even">
<td style="text-align: left;"><p>Parent</p></td>
<td style="text-align: left;"><p>Read-only</p></td>
<td style="text-align: left;"><p>Returns the form, object, or collection that contains a control or another object or collection.</p></td>
</tr>
<tr class="odd">
<td style="text-align: left;"><p>TabStop</p></td>
<td style="text-align: left;"><p>Read/write</p></td>
<td style="text-align: left;"><p>Returns or sets a value that indicates whether a user can use the <strong>Tab</strong> key to give the focus to an object.</p></td>
</tr>
<tr class="even">
<td style="text-align: left;"><p>Top</p></td>
<td style="text-align: left;"><p>Read/write</p></td>
<td style="text-align: left;"><p>Returns or sets the distance between the internal top edge of an object and the top edge of its container.</p></td>
</tr>
<tr class="odd">
<td style="text-align: left;"><p>Visible</p></td>
<td style="text-align: left;"><p>Read/write</p></td>
<td style="text-align: left;"><p>Returns or sets a value that indicates whether an object is visible or hidden.</p></td>
</tr>
<tr class="even">
<td style="text-align: left;"><p>Width</p></td>
<td style="text-align: left;"><p>Read/write</p></td>
<td style="text-align: left;"><p>Returns or sets the width of an object.</p></td>
</tr>
</tbody>
</table>
## Requirements
| | |
|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|
| DLL<br/> | <dl> <dt>Ole2disp.dll; </dt> <dt>Oleaut32.dll</dt> </dl> |
| 32.396226
| 268
| 0.644001
|
eng_Latn
| 0.843198
|
58f489c43300b52672d79c23872ea942c865199e
| 25
|
md
|
Markdown
|
_includes/01-name.md
|
rosemaryhall/markdown-portfolio
|
de7fe168a27286f14e680c999a156fe3d86124ce
|
[
"MIT"
] | null | null | null |
_includes/01-name.md
|
rosemaryhall/markdown-portfolio
|
de7fe168a27286f14e680c999a156fe3d86124ce
|
[
"MIT"
] | 5
|
2021-01-11T04:14:25.000Z
|
2021-01-11T04:47:12.000Z
|
_includes/01-name.md
|
rosemaryhall/markdown-portfolio
|
de7fe168a27286f14e680c999a156fe3d86124ce
|
[
"MIT"
] | null | null | null |
#Rosemary and Me
# Space
| 8.333333
| 16
| 0.72
|
eng_Latn
| 0.98186
|
58f4c95c3a02a8c6117aaa0c8498c8a131b0ed7d
| 14,200
|
md
|
Markdown
|
articles/container-registry/container-registry-delete.md
|
klmnden/azure-docs.tr-tr
|
8e1ac7aa3bb717cd24e1bc2612e745aa9d7aa6b6
|
[
"CC-BY-4.0",
"MIT"
] | 2
|
2019-08-10T02:23:39.000Z
|
2019-08-10T02:23:40.000Z
|
articles/container-registry/container-registry-delete.md
|
klmnden/azure-docs.tr-tr
|
8e1ac7aa3bb717cd24e1bc2612e745aa9d7aa6b6
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
articles/container-registry/container-registry-delete.md
|
klmnden/azure-docs.tr-tr
|
8e1ac7aa3bb717cd24e1bc2612e745aa9d7aa6b6
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
---
title: Azure Container Registry'de resim kaynakları Sil
description: Etkili bir şekilde kapsayıcı görüntüsünü verileri silerek kayıt defteri boyutunu yönetme hakkında ayrıntılar.
services: container-registry
author: dlepow
ms.service: container-registry
ms.topic: article
ms.date: 06/17/2019
ms.author: danlep
ms.openlocfilehash: c603afa61499a615a0882cef06f14fd3d080a9ef
ms.sourcegitcommit: 66237bcd9b08359a6cce8d671f846b0c93ee6a82
ms.translationtype: MT
ms.contentlocale: tr-TR
ms.lasthandoff: 07/11/2019
ms.locfileid: "67797763"
---
# <a name="delete-container-images-in-azure-container-registry"></a>Kapsayıcı görüntülerini Azure Container Registry'de Sil
Azure kapsayıcı kayıt defterinizin boyutunu korumak için düzenli aralıklarla eski görüntü verilerini silmeniz gerekir. Üretim ortamına dağıtmış bazı kapsayıcı görüntülerini daha uzun vadeli depolama gerektirirken, diğerleri genellikle daha hızlı bir şekilde silinebilir. Örneğin, bir otomatik yapı ve test senaryosu, kayıt defterinizin hızla hiçbir zaman dağıtılmış olabilir ve kısa süre içinde derleme ve test geçişi tamamladıktan sonra temizlenebilir görüntüleri ile doldurabilirsiniz.
Görüntü verilerini birkaç farklı yolla silebilirsiniz çünkü her silme işlemi depolama kullanımını nasıl etkilediğini anlamak önemlidir. Bu makalede, görüntü verilerini silmek için çeşitli yöntemler yer almaktadır:
* Silme bir [depo](#delete-repository): Tüm görüntüleri ve havuz içindeki tüm benzersiz katmanları siler.
* Silin [etiketi](#delete-by-tag): Görüntü, etiket, görüntü tarafından başvurulan tüm benzersiz katmanları ve resimle ilişkili tüm etiketleri siler.
* Silin [bildirim Özet](#delete-by-manifest-digest): Görüntü, görüntü tarafından başvurulan tüm benzersiz katmanları ve resimle ilişkili tüm etiketleri siler.
Örnek betikler, silme işlemleri otomatikleştirmek için sağlanır.
Bu kavramlarına giriş için bkz: [kayıt defterleri, depolar ve görüntüleri hakkında](container-registry-concepts.md).
## <a name="delete-repository"></a>Depoyu Sil
Bir depoyu silme görüntülerinin depodaki tüm etiketleri, benzersiz katmanlar ve bildirimler gibi tüm siler. Bir depo sildiğinizde, depodaki benzersiz katmanları başvuru görüntüleri tarafından kullanılan depolama alanı kurtarın.
"Acr-helloworld" depo ve tüm etiketleri ve depo içindeki bildirimlerini aşağıdaki Azure CLI komutu siler. Katmanlar silinen bildirimleri tarafından başvurulan kayıt defterinde herhangi bir görüntü tarafından başvurulmayan, katmanı verilerini de, Kurtarma depolama alanı silindi.
```azurecli
az acr repository delete --name myregistry --repository acr-helloworld
```
## <a name="delete-by-tag"></a>Etikete göre Sil
Depo adını ve etiketini silme işleminde belirterek bir depodan ayrı görüntüleri silebilirsiniz. Etikete göre sildiğinizde, herhangi bir benzersiz katman görüntüde (herhangi bir görüntü kayıt defteri tarafından paylaşılmayan katmanları) tarafından kullanılan depolama alanı kurtarın.
Etikete göre silmek için kullanın [az acr depo silme][az-acr-repository-delete] ve görüntü adını `--image` parametresi. Tüm Katmanlar görüntüye benzersiz ve resimle ilişkili etiketleri silinir.
Örneğin, silme "acr-helloworld:latest" Görüntü "myregistry" kayıt defterinden:
```azurecli
$ az acr repository delete --name myregistry --image acr-helloworld:latest
This operation will delete the manifest 'sha256:0a2e01852872580b2c2fea9380ff8d7b637d3928783c55beb3f21a6e58d5d108' and all the following images: 'acr-helloworld:latest', 'acr-helloworld:v3'.
Are you sure you want to continue? (y/n): y
```
> [!TIP]
> Silme *etikete göre* (etiketi kaldırma) bir etiketi silme işlemine kafanız olmamalıdır. Azure CLI komutuyla bir etiketi silebilirsiniz [az acr depo etiketini Kaldır][az-acr-repository-untag]. Görüntü çünkü'etiketini kaldırın, hiçbir alanı boşaltılana kendi [bildirim](container-registry-concepts.md#manifest) ve katman verileri kayıt defterinde kalır. Yalnızca etiket başvuru kendisini silinir.
## <a name="delete-by-manifest-digest"></a>Bildirim özeti tarafından Sil
A [bildirim Özet](container-registry-concepts.md#manifest-digest) birini, nBir veya birden çok etiketi ile ilişkili olabilir. Özet sildiğinizde, görüntüye benzersiz herhangi bir katman için veri katmanı olarak listesi tarafından başvurulan tüm etiketleri silinir. Veriler silinmez katman paylaşılan.
Özet silmek için silmek istediğiniz görüntü içeren depo için ilk listeden bildirim özetleyen. Örneğin:
```console
$ az acr repository show-manifests --name myregistry --repository acr-helloworld
[
{
"digest": "sha256:0a2e01852872580b2c2fea9380ff8d7b637d3928783c55beb3f21a6e58d5d108",
"tags": [
"latest",
"v3"
],
"timestamp": "2018-07-12T15:52:00.2075864Z"
},
{
"digest": "sha256:3168a21b98836dda7eb7a846b3d735286e09a32b0aa2401773da518e7eba3b57",
"tags": [
"v2"
],
"timestamp": "2018-07-12T15:50:53.5372468Z"
}
]
```
Ardından, silmek istediğiniz özet belirtin [az acr depo silme][az-acr-repository-delete] komutu. Komut biçimi şu şekildedir:
```azurecli
az acr repository delete --name <acrName> --image <repositoryName>@<digest>
```
Örneğin, yukarıdaki çıktıda ("v2" etiketiyle) son bildirimi silmek için listelenen:
```console
$ az acr repository delete --name myregistry --image acr-helloworld@sha256:3168a21b98836dda7eb7a846b3d735286e09a32b0aa2401773da518e7eba3b57
This operation will delete the manifest 'sha256:3168a21b98836dda7eb7a846b3d735286e09a32b0aa2401773da518e7eba3b57' and all the following images: 'acr-helloworld:v2'.
Are you sure you want to continue? (y/n): y
```
`acr-helloworld:v2` Görüntüsü herhangi bir katman veri görüntüsünü benzersiz olarak kayıt defterinden silindi. Bir bildirim birden çok etiketi ile ilişkili ise, ilişkili tüm etiketleri de silinir.
## <a name="delete-digests-by-timestamp"></a>Zaman damgası tarafından özetler Sil
Depo veya kayıt defteri boyutunu korumak için düzenli olarak belirli bir tarihten daha eski bildirim özetler silmeniz gerekebilir.
Aşağıdaki Azure CLI komutunu artan sırada belirtilen zaman damgası, daha eski bir depodaki tüm bildirim Özet listeler. Değiştirin `<acrName>` ve `<repositoryName>` ortamınız için uygun değerlerle. Tam tarih-saat ifade veya bu örnekte olduğu gibi bir tarih, zaman damgası olabilir.
```azurecli
az acr repository show-manifests --name <acrName> --repository <repositoryName> \
--orderby time_asc -o tsv --query "[?timestamp < '2019-04-05'].[digest, timestamp]"
```
Eski bildirim özetler belirledikten sonra belirtilen bir zaman damgası eski bildirim özetler silmek için aşağıdaki Bash betiğini çalıştırabilirsiniz. Azure CLI'yı gerektirir ve **xargs**. Varsayılan olarak, betik, hiçbir silme gerçekleştirir. Değişiklik `ENABLE_DELETE` değerini `true` görüntü silme işlemini etkinleştirmek için.
> [!WARNING]
> Aşağıdaki betiğe dikkatle--silinmiş bir görüntü veriler KURTARILAMAZ kullanılır. Bildirim özeti (aksine, görüntü adı) tarafından görüntüleri çekmek sistemleri varsa, bu betikleri çalıştırmamanız gerekir. Bildirim özetler silinmesi, bu sistemlerin görüntülerini kayıt defterinizden çekme öğesinden engeller. Bildirimi tarafından çekmek yerine benimsemeyi göz önünde bir *benzersiz etiketleme* düzeni, bir [önerilen en iyi][tagging-best-practices].
```bash
#!/bin/bash
# WARNING! This script deletes data!
# Run only if you do not have systems
# that pull images via manifest digest.
# Change to 'true' to enable image delete
ENABLE_DELETE=false
# Modify for your environment
# TIMESTAMP can be a date-time string such as 2019-03-15T17:55:00.
REGISTRY=myregistry
REPOSITORY=myrepository
TIMESTAMP=2019-04-05
# Delete all images older than specified timestamp.
if [ "$ENABLE_DELETE" = true ]
then
az acr repository show-manifests --name $REGISTRY --repository $REPOSITORY \
--orderby time_asc --query "[?timestamp < '$TIMESTAMP'].digest" -o tsv \
| xargs -I% az acr repository delete --name $REGISTRY --image $REPOSITORY@% --yes
else
echo "No data deleted."
echo "Set ENABLE_DELETE=true to enable deletion of these images in $REPOSITORY:"
az acr repository show-manifests --name $REGISTRY --repository $REPOSITORY \
--orderby time_asc --query "[?timestamp < '$TIMESTAMP'].[digest, timestamp]" -o tsv
fi
```
## <a name="delete-untagged-images"></a>Etiketlenmemiş görüntüleri Sil
Belirtildiği gibi [bildirim Özet](container-registry-concepts.md#manifest-digest) bölümünde, varolan bir etiketi kullanarak değiştirilmiş bir görüntüyü dağıtmaya **untags** yalnız bırakılmış (veya "Sallantıdaki") görüntüyü daha önce görüntü. Daha önce görüntünün bildirim--ve--katman verileri kayıt defterinde kalır. Aşağıdaki olaylar dizisi göz önünde bulundurun:
1. Görüntü gönderme *acr-helloworld* etiketiyle **son**: `docker push myregistry.azurecr.io/acr-helloworld:latest`
1. Depo için bildirimleri denetleyin *acr-helloworld*:
```console
$ az acr repository show-manifests --name myregistry --repository acr-helloworld
[
{
"digest": "sha256:d2bdc0c22d78cde155f53b4092111d7e13fe28ebf87a945f94b19c248000ceec",
"tags": [
"latest"
],
"timestamp": "2018-07-11T21:32:21.1400513Z"
}
]
```
1. Değiştirme *acr-helloworld* Dockerfile
1. Görüntü gönderme *acr-helloworld* etiketiyle **son**: `docker push myregistry.azurecr.io/acr-helloworld:latest`
1. Depo için bildirimleri denetleyin *acr-helloworld*:
```console
$ az acr repository show-manifests --name myregistry --repository acr-helloworld
[
{
"digest": "sha256:7ca0e0ae50c95155dbb0e380f37d7471e98d2232ed9e31eece9f9fb9078f2728",
"tags": [
"latest"
],
"timestamp": "2018-07-11T21:38:35.9170967Z"
},
{
"digest": "sha256:d2bdc0c22d78cde155f53b4092111d7e13fe28ebf87a945f94b19c248000ceec",
"tags": [],
"timestamp": "2018-07-11T21:32:21.1400513Z"
}
]
```
Dizisi son adımda Çıkışta gördüğünüz gibi yoktur yalnız bırakılmış bir bildirim şimdi ayarlanmış `"tags"` özelliği boş bir listedir. Bu bildirimi hala başvurduğu herhangi bir benzersiz katmanı verileriyle birlikte kayıt defteri içinde yok. **Örneğin silmek için görüntüler ve katman verilerine yalnız bırakılmış tarafından bildirim Özet silmelisiniz**.
## <a name="delete-all-untagged-images"></a>Etiketlenmemiş tüm görüntüleri silin
Deponuzda aşağıdaki Azure CLI komutunu kullanarak tüm etiketlenmemiş görüntüleri listeleyebilirsiniz. Değiştirin `<acrName>` ve `<repositoryName>` ortamınız için uygun değerlerle.
```azurecli
az acr repository show-manifests --name <acrName> --repository <repositoryName> --query "[?tags[0]==null].digest"
```
Bu komutu bir betikte kullanarak bir depodaki tüm etiketlenmemiş görüntülerini silebilirsiniz.
> [!WARNING]
> Aşağıdaki örnek betikler silinmiş--dikkatli görüntü verilerdir KURTARILAMAZ. Bildirim özeti (aksine, görüntü adı) tarafından görüntüleri çekmek sistemleri varsa, bu betikleri çalıştırmamanız gerekir. Etiketlenmemiş görüntüleri siliniyor, bu sistemlerin görüntülerini kayıt defterinizden çekme öğesinden engeller. Bildirimi tarafından çekmek yerine benimsemeyi göz önünde bir *benzersiz etiketleme* düzeni, bir [önerilen en iyi][tagging-best-practices].
**Bash Azure CLI**
Aşağıdaki Bash betiği, bir depodan tüm etiketlenmemiş görüntüleri siler. Azure CLI'yı gerektirir ve **xargs**. Varsayılan olarak, betik, hiçbir silme gerçekleştirir. Değişiklik `ENABLE_DELETE` değerini `true` görüntü silme işlemini etkinleştirmek için.
```bash
#!/bin/bash
# WARNING! This script deletes data!
# Run only if you do not have systems
# that pull images via manifest digest.
# Change to 'true' to enable image delete
ENABLE_DELETE=false
# Modify for your environment
REGISTRY=myregistry
REPOSITORY=myrepository
# Delete all untagged (orphaned) images
if [ "$ENABLE_DELETE" = true ]
then
az acr repository show-manifests --name $REGISTRY --repository $REPOSITORY --query "[?tags[0]==null].digest" -o tsv \
| xargs -I% az acr repository delete --name $REGISTRY --image $REPOSITORY@% --yes
else
else
echo "No data deleted."
echo "Set ENABLE_DELETE=true to enable image deletion of these images in $REPOSITORY:"
az acr repository show-manifests --name $REGISTRY --repository $REPOSITORY --query "[?tags[0]==null]" -o tsv
fi
```
**PowerShell'de Azure CLI**
Aşağıdaki PowerShell betiğini bir depodan tüm etiketlenmemiş görüntüleri siler. PowerShell ve Azure CLI'yı gerektirir. Varsayılan olarak, betik, hiçbir silme gerçekleştirir. Değişiklik `$enableDelete` değerini `$TRUE` görüntü silme işlemini etkinleştirmek için.
```powershell
# WARNING! This script deletes data!
# Run only if you do not have systems
# that pull images via manifest digest.
# Change to '$TRUE' to enable image delete
$enableDelete = $FALSE
# Modify for your environment
$registry = "myregistry"
$repository = "myrepository"
if ($enableDelete) {
az acr repository show-manifests --name $registry --repository $repository --query "[?tags[0]==null].digest" -o tsv `
| %{ az acr repository delete --name $registry --image $repository@$_ --yes }
} else {
Write-Host "No data deleted."
Write-Host "Set `$enableDelete = `$TRUE to enable image deletion."
az acr repository show-manifests --name $registry --repository $repository --query "[?tags[0]==null]" -o tsv
}
```
## <a name="next-steps"></a>Sonraki adımlar
Azure Container Registry'de resim depolama hakkında daha fazla bilgi için bkz. [kapsayıcı görüntüsü Azure Container Registry depolamada](container-registry-storage.md).
<!-- IMAGES -->
[manifest-digest]: ./media/container-registry-delete/01-manifest-digest.png
<!-- LINKS - External -->
[docker-manifest-inspect]: https://docs.docker.com/edge/engine/reference/commandline/manifest/#manifest-inspect
[portal]: https://portal.azure.com
[tagging-best-practices]: https://stevelasker.blog/2018/03/01/docker-tagging-best-practices-for-tagging-and-versioning-docker-images/
<!-- LINKS - Internal -->
[az-acr-repository-delete]: /cli/azure/acr/repository#az-acr-repository-delete
[az-acr-repository-show-manifests]: /cli/azure/acr/repository#az-acr-repository-show-manifests
[az-acr-repository-untag]: /cli/azure/acr/repository#az-acr-repository-untag
| 51.079137
| 487
| 0.778028
|
tur_Latn
| 0.994755
|
58f4dad02dce194d17cb1c6e0afb692b16a5fac3
| 3,509
|
md
|
Markdown
|
src/content/post_5.md
|
mal90/mal90.github.io
|
3c767318e8f3ebf5e479bd4f15caa7f5414e6d61
|
[
"MIT"
] | null | null | null |
src/content/post_5.md
|
mal90/mal90.github.io
|
3c767318e8f3ebf5e479bd4f15caa7f5414e6d61
|
[
"MIT"
] | null | null | null |
src/content/post_5.md
|
mal90/mal90.github.io
|
3c767318e8f3ebf5e479bd4f15caa7f5414e6d61
|
[
"MIT"
] | null | null | null |
---
title: How to merge your silly little commits into one
author: Malik
date: December 29, 2016
---
## Git : How to merge your silly little commits into one
There are three kinds of git users. People who commits every single change ; People who wait and compile all the changes into one gigantic commit. And the last kind is the best kind, who commits in a responsible way. I used to be the first kind, but realized later it is annoying to the people who reviews my PR’s. So here is the thing, git has 2 helpful ways of dealing with this problem.
1. git squash
2. git reset
Here is the scenario. Say if you made some commits with small changes like remove small space 1, change variable name, remove space 2. Later you realize the commits are kind of silly, you want all these commits to be merge into one called something like code cleanup.
Using squash for this problem a bit complex (not if you get used to it). But it sort of gives you an overall idea on what is happening. This is how you do it.
## Method 1: Using squash
First of all make sure your master branch is up-to date with the related upstream branch. And say you are in a feature branch called, well feature-branch.
in your git bash, run this command `git rebase -i master`

you will get the vim interactive console and you will see all of your 3 commits listed.

Here the process is simple. You can pick one commit which can be your parent commit using pick, and the rest of the commits can be linked under this parent commit using squash command. Also you can change the order of the commits as well. So according to our scenario, we can follow this way.
And that is it. Just save and exit. And you will get another interactive console like below.

And you have successfully merge 3 of your commits into one commit which is going to make a better commit history for you. Now you can just run `git push origin feature-branch –force` to push your single commit to the remote repository.
Note: we are using `–force` because this process has changed the commit hashes. In any case, when you use force push, you need to absolutely make sure you know what you are doing.
If you view the commit history, you can see the squashed commits like this visualized in a different way.

So that’s how you squash your commits in Git. It is a bit time consuming process, but if you get used to it, it is very useful
## Method 2: Using `git reset`
So unlike squashing your commits, you can easily merge your little commits into one using git reset command. It is really simple. Take the same scenario i have mentioned above. Now what you need is, Taking the HEAD position 3 commits back. By doing this you are resetting the last 3 commits.
```
git reset –soft HEAD~3
```
Now you have un-stage changes. All you need to do now is to put them into a single commit.
```
git commit -m “Code cleanup”
```
Or do these both together
```
git reset –soft HEAD~3 && git commit -m “Code cleanup”
```
Now push `–force` to push the new commit into the remote repository. The same warning regarding force push applies here as well.
more info on squashing can be found [here](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History)
| 50.128571
| 389
| 0.76261
|
eng_Latn
| 0.999533
|
58f4de0e2ea820509e4aa06138bc4c0584d86401
| 4,074
|
md
|
Markdown
|
articles/lab-services/image-factory-save-distribute-custom-images.md
|
riwaida/azure-docs.ja-jp
|
2beaedf3fc0202ca4db9e5caabb38d0d3a4f6f5b
|
[
"CC-BY-4.0",
"MIT"
] | 1
|
2020-05-27T07:43:21.000Z
|
2020-05-27T07:43:21.000Z
|
articles/lab-services/image-factory-save-distribute-custom-images.md
|
riwaida/azure-docs.ja-jp
|
2beaedf3fc0202ca4db9e5caabb38d0d3a4f6f5b
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
articles/lab-services/image-factory-save-distribute-custom-images.md
|
riwaida/azure-docs.ja-jp
|
2beaedf3fc0202ca4db9e5caabb38d0d3a4f6f5b
|
[
"CC-BY-4.0",
"MIT"
] | 1
|
2020-05-21T03:03:13.000Z
|
2020-05-21T03:03:13.000Z
|
---
title: Azure DevTest Labs でのイメージの保存と配布 | Microsoft Docs
description: この記事では、Azure DevTest Labs で、作成済みの仮想マシン (VM) からカスタム イメージを保存する手順について説明します。
services: devtest-lab, lab-services
documentationcenter: na
author: spelluru
manager: femila
ms.service: lab-services
ms.workload: na
ms.tgt_pltfrm: na
ms.devlang: na
ms.topic: article
ms.date: 01/24/2020
ms.author: spelluru
ms.openlocfilehash: e5bc8e5041bfe6d95e3ff1a93bb3338ccead5bb4
ms.sourcegitcommit: 2ec4b3d0bad7dc0071400c2a2264399e4fe34897
ms.translationtype: HT
ms.contentlocale: ja-JP
ms.lasthandoff: 03/27/2020
ms.locfileid: "76759433"
---
# <a name="save-custom-images-and-distribute-to-multiple-labs"></a>カスタム イメージを保存して複数のラボに配布する
この記事では、作成済みの仮想マシン (VM) からカスタム イメージを保存する手順について説明します。 また、これらのカスタム イメージを組織内の他の DevTest Labs に配布する方法についても説明します。
## <a name="prerequisites"></a>前提条件
次の項目が既に配置されている必要があります。
- Azure DevTest Labs のイメージ ファクトリ用のラボ。
- イメージ ファクトリを自動化するために使用される Azure DevOps プロジェクト。
- スクリプトと構成を含むソース コードの場所 (この例では、前の手順で説明した DevOps プロジェクト内)。
- Azure Powershell タスクを調整するビルド定義。
必要に応じて、「[Azure DevOps からイメージ ファクトリを実行する](image-factory-set-up-devops-lab.md)」の手順を実行し、これらの項目を作成または設定してください。
## <a name="save-vms-as-generalized-vhds"></a>一般化された VHD として VM を保存する
既存の VM を一般化された VHD として保存します。 既存の VM を一般化された VHD として保存するためのサンプル PowerShell スクリプトがあります。 それを使用するには、次の図に示すように、まず別の **Azure Powershell** タスクをビルド定義に追加します。

一覧に新しいタスクが追加されたら、その項目を選択し、次の図に示すようにすべての詳細を入力します。

## <a name="generalized-vs-specialized-custom-images"></a>一般化されたカスタム イメージと特殊化されたカスタム イメージ
[Azure portal](https://portal.azure.com) で仮想マシンからカスタム イメージを作成するときに、一般化されたカスタム イメージまたは特殊化されたカスタム イメージを選択できます。
- **特殊化されたカスタム イメージ:** sysprep/プロビジョニング解除がマシンで実行されていません。 これは、イメージが既存の仮想マシン (スナップショット) 上の OS ディスクの正確なコピーであることを意味します。 このカスタム イメージから新しいマシンを作成すると、同じファイル、アプリケーション、ユーザー アカウント、コンピューター名などがすべて存在します。
- **一般化されたカスタム イメージ:** Sysprep/プロビジョニング解除がマシンで実行されました。 イメージを一般化して、別の仮想マシンを作成するときにカスタマイズできるようにするために、このプロセスの実行時にユーザー アカウント、コンピューター名、ユーザー レジストリ ハイブなどが削除されます。 仮想マシンを (sysprep を実行することで) 一般化すると、現在の仮想マシンは破棄され、機能しなくなります。
イメージ ファクトリ内のカスタム イメージをスナップするスクリプトにより、前の手順で作成された仮想マシンの VHD が保存されます (Azure 内のリソース上のタグに基づいて識別されます)。
## <a name="update-configuration-for-distributing-images"></a>イメージを配布するための構成の更新
このプロセスの次の手順は、イメージ ファクトリのカスタム イメージを、そのイメージを必要とする別のラボにプッシュすることです。 このプロセスの中心となるのは、**labs.json** 構成ファイルです。 このファイルは、イメージ ファクトリに含まれている **Configuration** フォルダー内にあります。
labs.json 構成ファイルには、2 つの重要な事項があります。
- サブスクリプション ID とラボ名を使用した、特定の配布先ラボの一意的な識別。
- 構成ルートへの相対パスでラボにプッシュされる特定のイメージ セット。 フォルダー全体を指定することもできます (そのフォルダ内のすべてのイメージを取得します)。
2 つのラボがリストされた labs.json ファイルの例を次に示します。 この場合、2 つの異なるラボにイメージが配布されます。
```json
{
"Labs": [
{
"SubscriptionId": "<subscription ID that contains the lab>",
"LabName": "<Name of the DevTest Lab>",
"ImagePaths": [
"Win2012R2",
"Win2016/Datacenter.json"
]
},
{
"SubscriptionId": "<subscription ID that contains the lab>",
"LabName": "<Name of the DevTest Lab>",
"ImagePaths": [
"Win2016/Datacenter.json"
]
}
]
}
```
## <a name="create-a-build-task"></a>ビルド タスクを作成する
この記事の前半で説明した手順を使用して、追加の **Azure Powershell** ビルド タスクをビルド定義に追加します。 次の図に示されているように詳細を入力します。

パラメーターは次のとおりです。`-ConfigurationLocation $(System.DefaultWorkingDirectory)$(ConfigurationLocation) -SubscriptionId $(SubscriptionId) -DevTestLabName $(DevTestLabName) -maxConcurrentJobs 20`
このタスクは、イメージ ファクトリ内のカスタム イメージを取得し、Labs.json ファイルに定義されているすべてのラボにプッシュします。
## <a name="queue-the-build"></a>ビルドをキューに配置する
配布ビルド タスクが完了したら、すべてが確実に機能するように、新しいビルドをキューに配置します。 ビルドが正常に完了したら、Labs.json 構成ファイルに入力された配布先のラボに、新しいカスタム イメージが表示されます。
## <a name="next-steps"></a>次のステップ
このシリーズの次の記事では、保持ポリシーとクリーンアップ手順を使用してイメージ ファクトリを更新します。[アイテム保持ポリシーを設定してクリーンアップ スクリプトを実行する](image-factory-set-retention-policy-cleanup.md)
| 41.151515
| 214
| 0.777369
|
yue_Hant
| 0.654339
|
58f53345f0a6f73713e999bbb43860fb3d76426e
| 14,657
|
md
|
Markdown
|
src/pages/encore-un-confinement/index.md
|
arnaudambro/javevolution
|
84c2015e3a5648e5b202d28b0737ab73161b5f89
|
[
"MIT"
] | null | null | null |
src/pages/encore-un-confinement/index.md
|
arnaudambro/javevolution
|
84c2015e3a5648e5b202d28b0737ab73161b5f89
|
[
"MIT"
] | 2
|
2022-02-26T02:22:23.000Z
|
2022-02-27T22:28:30.000Z
|
src/pages/encore-un-confinement/index.md
|
arnaudambro/javolution
|
84c2015e3a5648e5b202d28b0737ab73161b5f89
|
[
"MIT"
] | null | null | null |
---
title: Encore un confinement généralisé... vraiment ?
date: '2021-01-24'
spoiler: Comment peut-on, un an après, en être encore là ? Éclaircissements...
cover: ./etre-un-mouton-appartenance.jpg
cta: 'Révolution'
tags: 'Révolution'
---
Je ne dirais pas que tout est clair dans mon esprit, mais plus on avance, plus ça s'éclaircit.
À l'aube d'un confinement probable, et pendant qu'on est, ici à Amsterdam, dans une situation de semi-confinement où tous les restos et établissements "non essentiels" sont fermés, toutes les écoles et crèches aussi, et où un couvre-feu est installé à 20h30, j'avance sur les réponses à trouver à mes __Pourquoi__ :
1. __Pourquoi__, alors qu'on sait désormais à quelle catégorie de personnes s'attaque ce coronavirus, à savoir les plus âgés d'entre nous, pourquoi doit-on contraindre la population entière qui, pour l'écrasante majorité, n'a rien à craindre ?
3. __Pourquoi__ nous, population, acceptons pour la plupart sans broncher, quoiqu'en rouspétant tout de même, ces mesures qui pourrissent la vie de tous ?
2. __Pourquoi__ les journalistes continuent de jouer le jeu de la peur, celui des gouvernements, sans y apporter de nuance, si peu ? De sorte que je suis partagé entre l'impression, avec mes analyses statistiques primaires, soit d'être quelqu'un qui n'a rien compris au problème, soit que les journalistes sont incompétents, ou paresseux ?
Mon amour-propre et mes heures d'écoute de France Inter me font pencher, pour la question 3, pour l'option journalistes paresseux, avec beaucoup d'exemples à la clé que je n'énumèrerai pas ici. Je me concentrerai sur les questions 1 et 2.
## Pourquoi les gouvernements contraignent la population entière
### Les hôpitaux sont submergés
Je sais qu'on me rabâche sans cesse les hôpitaux submergés, et je veux bien comprendre le désarroi et la fatigue du personnel hospitalier.
MAIS
Je veux bien le comprendre quand on est pris par surprise en mars 2020, mais pas un an plus tard, quand on va m'annoncer que la vie va être encore contrainte jusqu'à l'été. L'État n'est donc pas capable, en un an, de mettre en place des mesures d'urgence, de créer de la place, de former un maximum de gens (réquisitionnés, volontaires) rapidement pour aider le personnel hospitalier compétent ? Tristesse.
Les infos nous le répètent tous les matins, les hôpitaux ont donc l'air dans la même capacité qu'un an auparavant, il faut donc prendre des mesures pour les soulager. C'est décevant, mais... soit, il faut prendre des mesures contraignantes, alors prenons-en. Mais faut-il vraiment en prendre pour tout le monde, même contre ceux qui ne craignent rien ?
### Les plus jeunes ne craignent pas grand chose
Cette année passée nous a montré une chose : ce coronavirus est dangereux pour les personnes avec certaines comorbidités, d'autres personnes à risque et les personnes âgées en général. Mais il est presque anodin pour les personnes de moins de 60 ans, voire moins de 65 ans. Certes, on ne connait pas toutes les séquelles, s'il y en a, qu'on peut garder après avoir contracté la maladie, même chez les plus jeunes, mais en ce qui concerne la maladie en elle-même, pour l'écrasante majorité des moins de 65 ans, ce coronavirus ne tue pas ni ne renvoie en réanimation.
Permettez-moi d'insister pour enfoncer le clou : ce ne sont pas ceux qui sont malades pendant deux semaines, avec un peu de fièvre et sans plus, qui ont de la chance, non. Ce sont ceux qui ont des formes sévères qui n'ont vraiment pas de chance !
Je ne vais pas refaire tout un exposé de statistiques ici, j'en ai déjà fait [un exercice ailleurs](https://www.javolution.io/j-ai-le-coco/), mais tout de même : on était, en France et un peu partout dans les pays ou le COVID fait le plus de cas, à 1 mort sur 2000 habitants l'été dernier, et on est à plus ou moins 2 - 3 morts sur 2000 aujourd'hui, que ce soit en France, en Angleterre, aux États-Unis, en Italie ou en Suède. Sur presque 73 000 morts en France aujourd'hui, 70 000 morts ont plus de 60 ans, 65 000 plus de 70 ans, et 55 000 plus de 80 ans. Seulement 1500 ont entre 50 et 60 ans, et... moins de 700 ont moins de 50 ans. Donc : si on a moins de 60 ans, et qu'on meurt du COVID, c'est qu'on a vraiment, vraiment pas de chance, et non l'inverse. (Ou alors je n'ai rien compris, ce qui n'est pas impossible bien sûr. Mais pour la suite de l'article, considérons que ce n'est pas le cas).
Si je faisais mon journaliste, je pourrais dire : « SCOOP !! En France, 10% de morts de plus que d'habitude en 2020, donc faites tous très très attention, c'est grave ce virus, vous avez 10% de chances de plus de mourir qu'en temps normal ! ». Mais ces 10% de morts, c'est 10% parmi les plus de 80 ans, ceux qui ont déjà en moyenne 15% de chances de mourir dans l'année.
Donc si on enferme les gens chez eux, ce n'est pas pour les protéger eux puisqu'ils ne craignent rien ou si peu, mais pour protéger ceux qui ont besoin de l'être, à savoir certains profils à risque et les plus âgés. Mais alors, si vraiment on a besoin de les protéger pour protéger notre personnel hospitalier, pourquoi on ne leur imposerait pas, à eux seulement, de rester chez eux ? Pourquoi, au lieu d'interdire _seulement_ aux gens actifs de ne pas aller voir de personne à risque, on leur impose aussi de rester chez eux ? Quel est le sens de cette mesure ?
### Les jeunes ne sont pas ceux qui votent
C'est étrangement un des journalistes que j'apprécie le moins, c'est peu dire, qui m'en donne la réponse claire et limpide: [Patrick Cohen, dans un édito de 3 minutes du 22 janvier](https://www.facebook.com/cavousf5/videos/1097526534097200/).
> En France, peu de chance que cette idée [de reconfiner seulement les plus âgés et les plus fragiles] trouve des relais. C'est une idée peut-être scientifiquement pertinente, mais politiquement indéfendable et électoralement suicidaire.
C'est effectivement la seule explication que je trouve plausible. Effectivement, à partir du moment on on constate que les jeunes ne se déplacent plus trop pour voter, mais que les anciens oui, en nombre, alors en tant qu'élu il faut prendre leur parti.
Je ne vois que cela comme explication, parce que dans cette histoire de coronavirus, je ne crois à aucun complot. Je ne pense pas que ce virus a été introduit volontairement. Je pense que personne, surtout les politiques, n'a intérêt à ce que la situation perdure - modulo les labos pharmaceutiques qui se font pas mal d'argent, sur ce sujet ils convaincront peut-être nos décideurs de vacciner tous les ans, mais pas de laisser les gens enfermés. Je ne crois donc pas à un quelconque complot dans cette histoire.
En revanche, je crois que les politiciens font ce qu’ils font depuis toujours, à savoir des calculs pour savoir qui ils doivent flatter pour être élu, et je crois qu'une fois au pouvoir, il font tout pour y rester, le plus longtemps possible. Donc le raisonnement de Patrick Cohen me parait logique et compréhensible, quoique désolant.
En revanche, il rajoute
> L'un des malheurs de ce virus est qu'il est terriblement inégalitaire [en ciblant principalement les personnes âgées et vulnérables], alors que la France est un pays foncièrement égalitaire où les politiques et les citoyens n'endosseront jamais une mesure ouvertement inégalitaire
Là, je pense qu'il se trompe complètement, sur deux aspects. Le premier serait que ce virus serait inégalitaire parce qu'il s'attaque d'abord aux plus faibles, donc les plus âgés. Oh surprise ! Il ne s'attaque pas aux plus forts, à ceux qui ont une santé de fer ? Incroyable... Ce virus ne fait que son travail nauséabond comme bien d'autres virus. De façon plus virulente certes, mais son caractère inégalitaire n'est pas plus prononcé chez lui que chez les autres virus. D'autre part, il s'avance beaucoup en pensant que les citoyens refuseraient cette mesure qu'ils jugent inégalitaire : sachez que je milite pour, et je sais que je ne suis pas le seul ! Et surtout, je ne trouve pas cette mesure plus inégalitaire que ça, c'est plutôt le confinement général que je trouve injuste. Demandez aux étudiants ce qu'ils en pensent, à toutes les entrepreneurs fermés, à tous les parents qui galèrent à gérer leurs enfants en même temps que leur travail...
## Pourquoi nous acceptons sans broncher
En fait, j'y ai réfléchi longtemps, peut-être des années, et la réponse est plus simple qu'elle n'y parait. Elle m'est apparue pendant la longue lecture de [cette biographie de De Gaulle](https://www.seuil.com/ouvrage/de-gaulle-julian-jackson/9782021396317), lorsque je me posais alors ces questions : qu'aurais-je fait en 1940 ? Pourquoi tout le monde n'a-t-il pas suivi de Gaulle ?
Il y a ce concept dont on m'avait parlé qui disait qu'un produit, lorsqu'il est nouveau, est d'abord adopté par une minorité de personne avant d'être adopté par le monde entier. C'est progressif, ça suit une courbe en cloche (courbe de Gauss pour les intimes). Il se trouve que ce concept a un auteur : [Evrett Rogers](https://labokhi.ch/fond/loi-devrett-rogers/)

Appliquez ce concept à l'adoption d'une idée par une population, et on a notre solution. Faisons un parallèle avec la Seconde Guerre mondiale si vous le voulez bien.
En 1940, Pétain signe un armistice pour en finir le plus rapidement possible avec la bataille de France, courte, 22 ans après une guerre au combien meurtrière. On ne sait pas à quelle sauce on va être mangé par les nazis, on ne connait pas encore la déportation, la solution finale et l'extermination des juifs, homosexuels et gitans, on connait peut-être mal l'autorité abusive du régime nazi, etc. En plus de ça, Pétain est à ce moment-là hautement respecté pour ses faits d'armes lors de la Première Guerre, qui plus est il est chef du gouvernement.
En opposition, de Gaulle est inconnu, général depuis seulement quelques mois, sous-secrétaire d'État à la guerre, et il décide de s'échapper à Londres pour dire que la France à capitulé et que lui seul représente la France. Ni Churchill ni les autres chefs d'État, et pas grand monde d'ailleurs, ne le considère tellement au début. Il apparait surtout comme un fou, un obsédé par l'indépendance de la France.
C'est, grossièrement, l'affiche qui se présente en juin 1940. Rajoutez à ça qu'on ne demande à personne de choisir entre Pétain ou de Gaulle, qu'aurais-je fait, qu'auriez vous fait en 1940 : auriez-vous tout de suite choisi de suivre De Gaulle ? Il y a très, très peu de chance. Puis le temps passe, et lorsqu'on se rend compte au fur et à mesure que Pétain dépasse les bornes dans sa collaboration avec les plans abjectes de l'occupant, on commence à voir s'il n'y a pas mieux à suivre que lui : c'est là que la popularité de De Gaulle entame sa folle ascension.
Ce comportement du peuple est, je pense, comparable à ce qui se passe - en moins dramatique bien sûr - depuis presque un an.
Lorsqu'on nous annonce un confinement parce qu'un virus nouveau et inconnu arrive, on dit presque tous oui. Lorsqu'un an plus tard, on s'aperçoit que ce virus n'est pas dangereux pour tout le monde de la même façon, mais qu'on applique les mêmes contraintes à tous sans distinction, certaines voix s'élèvent pour s'insurger. C'est normal que ça ait lieu aujourd'hui, c'est tout aussi logique que ça n'ait pas eu lieu des mois auparavant.
La relative lenteur de la réaction s'explique encore plus par le sentiment de peur exprimé par les gouvernants et relayé sans nuance ou presque par la plupart des acteurs médiatiques. Alors même que justement, et nous l'avons déjà expliqué au-dessus, une nuance aurait pu et du se faire, pour permettre au citoyen qui s'informe d'avoir une information solide pour se faire une idée nuancée. Comparer par exemple le nombre de morts du COVID aux USA avec le nombre de morts pendant la Seconde Guerre mondiale, à quoi bon si ce n'est à faire peur ? La peur induit l'immobilisme, le suivisme, l'absence de reflexion objective. La peur est un outil très bien manié par n'importe quel gouvernement pour maintenir son autorité, le rôle du média doit justement être celui du tampon entre les gouvernants et les gouvernés, qui doit relativiser et nuancer les affirmations émanant des gouvernants, souvent exprimées avec autorité pour leur donner plus de poids qu'elles n'en ont en réalité.
Ainsi, même si [cette vidéo est très drôle](https://www.youtube.com/watch?v=MPUtm6jQmPE), le peuple n'est pas comparable à un troupeau de mouton sans cerveau ! C'est juste qu'on ne peut pas attendre d'une foule immense qu'elle suive rapidement une direction autre que celle qui lui est imposée. Il faut laisser le temps au temps.
## Que faire ? Que penser alors ?
Les gouvernements vont faire ce qu'ils pensent que la majorité des gens voudraient qu'ils fassent. Pour ce faire, ils communiquent beaucoup et, entre autre, utilisent la peur pour amener les gens à penser comme eux. Puisque les médias font faillite dans leur retranscription des évènements, en n'atténuant jamais cette peur voire en l'exacerbant, difficile pour le citoyen de s'insurger si besoin.
Pourtant, et ce n'est plus de l'analyse mais une conviction personnelle, c'est ce dont on a besoin : une insurrection des consciences, comme le font les étudiants en ce moment, afin de donner un autre son de cloche au reste de la foule, qui à son tour peut réfléchir différemment, en masse, et arriver à d'autres conclusions que celles prônées par les gouvernements. Ces derniers, en sentant le vent qui tourne, se mettront peut-être dans le sens de ce nouveau courant.
Cela étant dit, mon opinion sur la gravité du virus n'engage que moi et est peut-être fausse, auquel cas tout mon exposé s’effondre, j’en conviens. Mais j'ai suffisamment planché sur le sujet pour penser qu'on en fait trop. Cela m'amène à vouloir les choses suivantes : au lieu de tout fermer, tout confiner et verser des milliards d'euros d'aide à ceux qu'on empêche de mener leur vie à bien, vivons normalement, avec masques et gestes barrières là où il faut, en isolant temporairement les personnes à risque, et en versant ces milliards d'euros à la rescousse de l'hôpital, en créant des hôpitaux de campagne, en formant d'urgence un personnel de soutien (pas des médecins, pas d’infirmière, mais des petites mains utiles) au personnel hospitalier afin que leur capacité de prise en charge soit augmentée significativement, suffisamment pour éviter au maximum de sélectionner les patients à l'entrée des hôpitaux. Puisque c'est l'hôpital qui bloque tout, mobilisons-nous pour l'hôpital et débloquons tout le reste.
J'ai pris mon parti, prenez le vôtre !
| 152.677083
| 1,017
| 0.784267
|
fra_Latn
| 0.994053
|
58f725a34ff5d56cf0a25c98dc33d24888c6d6b5
| 12,844
|
md
|
Markdown
|
articles/active-directory/privileged-identity-management/pim-how-to-start-security-review.md
|
pmsousa/azure-docs.pt-pt
|
bc487beff48df00493484663c200e44d4b24cb18
|
[
"CC-BY-4.0",
"MIT"
] | 15
|
2017-08-28T07:46:17.000Z
|
2022-02-03T12:49:15.000Z
|
articles/active-directory/privileged-identity-management/pim-how-to-start-security-review.md
|
pmsousa/azure-docs.pt-pt
|
bc487beff48df00493484663c200e44d4b24cb18
|
[
"CC-BY-4.0",
"MIT"
] | 407
|
2018-06-14T16:12:48.000Z
|
2021-06-02T16:08:13.000Z
|
articles/active-directory/privileged-identity-management/pim-how-to-start-security-review.md
|
pmsousa/azure-docs.pt-pt
|
bc487beff48df00493484663c200e44d4b24cb18
|
[
"CC-BY-4.0",
"MIT"
] | 17
|
2017-10-04T22:53:31.000Z
|
2022-03-10T16:41:59.000Z
|
---
title: Crie uma revisão de acesso das funções AD Azure em PIM - Azure AD | Microsoft Docs
description: Saiba como criar uma revisão de acesso das funções Azure AD em Azure AD Privileged Identity Management (PIM).
services: active-directory
documentationcenter: ''
author: curtand
manager: daveba
editor: ''
ms.service: active-directory
ms.topic: how-to
ms.workload: identity
ms.subservice: pim
ms.date: 4/05/2021
ms.author: curtand
ms.custom: pim
ms.collection: M365-identity-device-management
ms.openlocfilehash: 2aba8d9de5e068cd98675f67cb26b0eac8d1ad6d
ms.sourcegitcommit: b0557848d0ad9b74bf293217862525d08fe0fc1d
ms.translationtype: MT
ms.contentlocale: pt-PT
ms.lasthandoff: 04/07/2021
ms.locfileid: "106552835"
---
# <a name="create-an-access-review-of-azure-ad-roles-in-privileged-identity-management"></a>Criar uma revisão de acesso das funções AZURE AD na Gestão de Identidade Privilegiada
Para reduzir o risco associado a atribuições de funções velhas, deve rever regularmente o acesso. Você pode usar Azure AD Gestão de Identidade Privilegiada (PIM) para criar avaliações de acesso para funções privilegiadas da Azure AD. Também pode configurar comentários de acesso recorrentes que ocorrem automaticamente.
Este artigo descreve como criar uma ou mais avaliações de acesso para funções privilegiadas de Azure AD.
## <a name="prerequisite-license"></a>Licença pré-requisito
[!INCLUDE [Azure AD Premium P2 license](../../../includes/active-directory-p2-license.md)]. Para obter mais informações sobre licenças para PIM, consulte os [requisitos da Licença para utilizar a Gestão de Identidade Privilegiada.](subscription-requirements.md)
> [!Note]
> Atualmente, você pode estender uma revisão de acesso aos diretores de serviços com acesso a funções de recursos Azure AD e Azure (Preview) com uma edição Azure Ative Directory Premium P2 ativa no seu inquilino. O modelo de licenciamento para os principais de serviço será finalizado para a disponibilidade geral desta funcionalidade e poderão ser necessárias licenças adicionais.
## <a name="prerequisites"></a>Pré-requisitos
[Administrador privilegiado](../roles/permissions-reference.md#privileged-role-administrator)
## <a name="open-access-reviews"></a>Comentários de acesso aberto
1. Inscreva-se no [portal Azure](https://portal.azure.com/) com um utilizador que é membro da função de administrador de função Privileged.
1. Selecione **Governação da Identidade**
1. Selecione **funções de AD AD** no **âmbito da Azure AD Privileged Identity Management**.
1. Selecione **as funções AD do Azure** novamente no **comando do Manage**.
1. Em Gestão, selecione **avaliações de Acesso** e, em seguida, selecione **New**.

Clique **em Novo** para criar uma nova revisão de acesso.
1. Diga o nome da revisão de acesso. Opcionalmente, dê à revisão uma descrição. O nome e a descrição são mostrados aos revisores.

1. Definir a **data de início**. Por padrão, uma revisão de acesso ocorre uma vez, começa na mesma hora que é criada, e termina em um mês. Pode alterar as datas de início e fim para ter um início de revisão de acesso no futuro e durar quantos dias quiser.

1. Para tornar a revisão de acesso recorrente, altere a definição de **Frequência** de **uma vez** para **semanalmente,** **mensal,** **trimestral,** **anualmente** ou **semi-anual.** Utilize o slider de **duração** ou caixa de texto para definir quantos dias cada revisão da série recorrente estará aberta para a entrada dos revisores. Por exemplo, a duração máxima que pode definir para uma revisão mensal é de 27 dias, para evitar comentários sobrepostos.
1. Utilize a definição **'Fim'** para especificar como terminar as séries de revisão de acesso recorrentes. A série pode terminar de três maneiras: funciona continuamente para iniciar revisões indefinidamente, até uma data específica, ou depois de um número definido de ocorrências ter sido concluída. Você, outro administrador do Utilizador ou outro administrador Global pode parar a série após a criação alterando a data em **Definições**, de modo que termine nessa data.
1. Na secção **Âmbito do Utilizadores,** selecione o âmbito da revisão. Para rever utilizadores e grupos com acesso à função AZure AD, selecione **Utilizadores e Grupos,** ou selecione **(Preview) Service Principals** para rever as contas de máquina com acesso à função AD Azure.

1. Sob **a subscrição de funções de Revisão,** selecione as funções privilegiadas Azure AD para rever.
> [!NOTE]
> - As funções selecionadas aqui incluem [papéis permanentes e elegíveis.](../privileged-identity-management/pim-how-to-add-role-to-user.md)
> - Selecionar mais de uma função criará várias avaliações de acesso. Por exemplo, selecionar cinco funções criará cinco avaliações de acesso separadas.
> - Para funções com grupos que lhes sejam atribuídos, o acesso de cada grupo ligado ao papel em análise será revisto como parte da revisão de acesso.
Se estiver a criar uma revisão de acesso das **funções AD do Azure,** o seguinte mostra um exemplo da lista de membros da Revisão.

Se estiver a criar uma revisão de acesso das funções de **recursos do Azure,** a imagem a seguir mostra um exemplo da lista de membros da Revisão.

1. Na secção **de Revisores,** selecione uma ou mais pessoas para rever todos os utilizadores. Ou pode selecionar para que os membros revejam o seu próprio acesso.

- **Utilizadores selecionados** - Utilize esta opção para designar um utilizador específico para completar o reexame. Esta opção está disponível independentemente do Âmbito da revisão, e os revisores selecionados podem rever utilizadores, grupos e diretores de serviço.
- **Membros (self)** - Utilize esta opção para que os utilizadores revejam as suas próprias atribuições de funções. Os grupos designados para o papel não farão parte da revisão quando esta opção for selecionada. Esta opção só está disponível se a revisão for analisada para **Utilizadores e Grupos.**
- **Gestor** – Utilize esta opção para que o gestor do utilizador reveja a sua atribuição de funções. Esta opção só está disponível se a revisão for analisada para **Utilizadores e Grupos.** Ao selecionar Manager, também terá a opção de especificar um revisor de recuo. Os revisores de recuo são convidados a rever um utilizador quando o utilizador não tem nenhum gestor especificado no diretório. Os grupos designados para o papel serão revistos pelo revisor Fallback se um for selecionado.
### <a name="upon-completion-settings"></a>Após definições de conclusão
1. Para especificar o que acontece após a conclusão de uma revisão, expanda a secção **de definições de conclusão após conclusão.**

1. Se pretender remover automaticamente o acesso aos utilizadores que foram negados, desaprote **de Resultados de Aplicação Automática para obter o recurso** para **ativar**. Se pretender aplicar manualmente os resultados quando a revisão estiver concluída, desave o interruptor para **Desativar**.
1. Utilize a lista **De revisores de casos não responda** para especificar o que acontece para os utilizadores que não são revistos pelo revisor dentro do período de revisão. Esta definição não afeta os utilizadores que tenham sido revistos manualmente pelos revisores. Se a decisão do revisor final for Deny, então o acesso do utilizador será removido.
- **Nenhuma alteração** - Deixe o acesso do utilizador inalterado
- **Remover acesso** - Remover o acesso do utilizador
- **Aprovar acesso** - Aprovar o acesso do utilizador
- **Tome recomendações** - Tome a recomendação do sistema sobre a negação ou aprovação do acesso continuado do utilizador
### <a name="advanced-settings"></a>Definições avançadas
1. Para especificar definições adicionais, expanda a secção **de definições Avançadas.**

1. Definir **recomendações** para **Permitir** mostrar aos revisores as recomendações do sistema baseadas nas informações de acesso do utilizador.
1. **Desemba a razão do requerer a aprovação** para **permitir** que o revisor forneça uma razão para aprovação.
1. Desconfiem **notificações de Correio** eletrónico para **permitir** que o Azure AD envie notificações de e-mail aos revisores quando uma revisão de acesso começar e aos administradores quando uma revisão estiver concluída.
1. Definir **Lembretes** para **Permitir** que a Azure AD envie lembretes de avaliações de acesso em curso a revisores que não tenham concluído a sua revisão.
1. O conteúdo do e-mail enviado aos revisores é autogerido com base nos detalhes da revisão, tais como nome de revisão, nome de recurso, data de vencimento, etc. Se precisar de uma forma de comunicar informações adicionais, tais como instruções adicionais ou informações de contacto, pode especificar esses dados no **conteúdo adicional para o e-mail do revisor** que será incluído nos e-mails de convite e lembrete enviados aos revisores designados. A secção realçada abaixo é onde esta informação será exibida.

## <a name="start-the-access-review"></a>Inicie a revisão de acesso
Depois de ter especificado as definições para uma revisão de acesso, selecione **Start**. A revisão de acesso aparecerá na sua lista com um indicador do seu estado.

Por padrão, a Azure AD envia um e-mail aos revisores logo após o início da revisão. Se optar por não ter a Azure AD a enviar o e-mail, certifique-se de informar os revisores de que uma revisão de acesso está à espera que eles estejam concluídos. Pode mostrar-lhes as instruções de como rever o [acesso às funções AD do Azure](pim-how-to-perform-security-review.md).
## <a name="manage-the-access-review"></a>Gerir a revisão de acesso
Pode acompanhar o progresso à medida que os revisores completam as suas avaliações na página **geral** da revisão de acesso. Não são alterados os direitos de acesso no diretório até que a [revisão esteja concluída.](pim-how-to-complete-review.md)

Se esta for uma revisão única, então após o fim do período de revisão de acesso ou o administrador parar a revisão de acesso, siga os passos em [Concluir uma revisão de acesso das funções AD do Azure](pim-how-to-complete-review.md) para ver e aplicar os resultados.
Para gerir uma série de avaliações de acesso, navegue para a revisão de acesso e encontrará as próximas ocorrências em avaliações agendadas e editará a data final ou adicione/remova os revisores em conformidade.
Com base nas suas seleções nas **definições de conclusão,** a inscrição automática será executada após a data de fim da revisão ou quando parar manualmente a revisão. O estado da revisão passará de **Concluído** através de estados intermédios como **a Aplicação** e, finalmente, para o Estado **Aplicado.** Deverá esperar ver utilizadores negados, caso existam, a serem removidos das funções em poucos minutos.
## <a name="next-steps"></a>Passos seguintes
- [Rever o acesso aos papéis de Ad Azure](pim-how-to-perform-security-review.md)
- [Complete uma revisão de acesso das funções AD da Azure](pim-how-to-complete-review.md)
- [Criar uma revisão de acesso das funções de recursos do Azure](pim-resource-roles-start-access-review.md)
| 84.5
| 512
| 0.780987
|
por_Latn
| 0.999955
|
58f7b3188669849590e58449fdc377d9365842f4
| 10,844
|
markdown
|
Markdown
|
_posts/2013-12-7-SQLSat-0266.markdown
|
sqlsaturday/testwebsite
|
9560ae56f3e9d3735002e129e7c7adcf0dd5beaf
|
[
"MIT"
] | null | null | null |
_posts/2013-12-7-SQLSat-0266.markdown
|
sqlsaturday/testwebsite
|
9560ae56f3e9d3735002e129e7c7adcf0dd5beaf
|
[
"MIT"
] | null | null | null |
_posts/2013-12-7-SQLSat-0266.markdown
|
sqlsaturday/testwebsite
|
9560ae56f3e9d3735002e129e7c7adcf0dd5beaf
|
[
"MIT"
] | null | null | null |
---
layout: "post"
title: "SQLSaturday #266 - Lima 2013"
prettydate: "7 December 2013"
---
# SQLSaturday #266 - Lima 2013
**Event Date**: 12/07/2013 00:00:00
**Event Location**:
- Microsoft Peru
- San Isidro
- Lima, Lima, Peru
<a href="/assets/pdf/0266.pdf">PDF of Schedule</a>
This event has completed. All data shown below is from the historical XML public data available.
<ul>
<li><a href="#sessions">Sessions</a></li>
<li><a href="#speakers">Speakers</a></li>
<li><a href="#sponsors">Sponsors</a></li>
</ul>
If there are any data quality issues or corrections needed, please contact the webmaster for this site or submit a pull request for the appropriate file(s).
-----------------------------------------------------------------------------------
# <a name="sessions"></a>Sessions
This is a list of sessions from the event, based on the schedule in the XML files.
-----------------------------------------------------------------------------------
## Title: Performance dreams wait for you at SQL Server 2014
**Abstract**:
it is just like this because you will that unbelievable performance reads and substantial improvement that you will not give up at all those new SQL Server 2014 features , come in here to my session and you will know more about many new features and rich powers of SQL Server 2014 regarding performance particularly like Microsoft project “Hekaton” for In-memory built for OLTP , In-Memory columnstore index ,Resource Governor for IO consumption , lock management and also Single partition online index rebuild technologies ,you will get much hands-on experience for all definitions , architecture design , values and benefits ,caveats and recommendations related to each one of them and in addition I will add a practical flavor for this session by conducting multiple stress tests on most of these technologies to be more close to these performance dreams and explorer concretely these outstanding performance improvements of SQL Server 2014 to be able t take a conscious decision for upgra
**Speaker(s):**
- Shehab El-Najjar
*Track and Room*: Track 1 - N/A
-----------------------------------------------------------------------------------
## Title: In-Memory OLTP Internals for SQL Server 2014 CTP2
**Abstract**:
New in SQL Server 2014, In-Memory OLTP is a memory-optimized OLTP database engine for SQL Server. Depending on the reason for poor performance with your disk-based tables, In-Memory OLTP can help you achieve significant performance and scalability gains by using algorithms that are optimized for accessing memory-resident data, optimistic concurrency control that eliminates logical locks, lock free objects are used to access all data and threads that perform transactional work don’t use locks or latches for concurrency control.
In-memory OLTP is essentially the latest evolution in database engine technology and provides full durability for memory-optimized tables.
WebSite: http://www.mssqlinternals.com | Twitter: @percyreyes
**Speaker(s):**
- Percy Reyes
*Track and Room*: Track 1 - N/A
-----------------------------------------------------------------------------------
## Title: Performance dreams of SQL Server 2014
**Abstract**:
Technical session DBA
**Speaker(s):**
- Shehab El-Najjar
*Track and Room*: Track 1 - N/A
-----------------------------------------------------------------------------------
## Title: Inteligencia de Negocio.. Convirtiendo Datos en informacion.
**Abstract**:
En los tiempos actuales se hace necesario convertir los datos en información vital para el negocio, pero ¿como podemos aplicar la Inteligencia de Negocio en los tiempos actuales?. Cual es la propuesta de Microsoft para aplicar estos conceptos.
**Speaker(s):**
- ENRIQUE ALBAN
*Track and Room*: Track 1 - N/A
-----------------------------------------------------------------------------------
## Title: Hadoop On Windows Azure
**Abstract**:
The HDInsight Service for Windows Azure makes Apache Hadoop available as a service in the cloud. It makes the HDFS/MapReduce software framework and related projects available in a simpler, more scalable, and cost efficient environment.
**Speaker(s):**
- German Cayo Morales
*Track and Room*: Track 1 - N/A
-----------------------------------------------------------------------------------
## Title: Big Data, Almacenes de datos empresariales (EDW) y Windows Azure (SQL Database) como Plataforma BI
**Abstract**:
Technical session Big Data
**Speaker(s):**
- Jose Redondo
*Track and Room*: Track 1 - N/A
-----------------------------------------------------------------------------------
## Title: "Data Explorer" is now Microsoft Power Query for Excel
**Abstract**:
Technical session Business Intelligence
**Speaker(s):**
- Team SQL PASS PERU
*Track and Room*: Track 1 - N/A
-----------------------------------------------------------------------------------
## Title: Implementando escenarios de reportes empresariales en Windows Azure con SQL Reporting
**Abstract**:
Technical session Business Intelligence
**Speaker(s):**
- Jose Redondo
*Track and Room*: Track 1 - N/A
-----------------------------------------------------------------------------------
## Title: KeyNote SQL PASS PERU
**Abstract**:
KeyNote SQL PASS PERU
**Speaker(s):**
- Team SQL PASS PERU
*Track and Room*: Track 1 - N/A
-----------------------------------------------------------------------------------
## <a name="#speakers"></a>Speakers
This is a list of speakers from the XML Guidebook records. The details and URLs were valid at the time of the event.
**Jose Redondo**
Information Technology System Business Consultant (Stand-Alone, Client/Server, Multi Levels, etc.), Designer and Developers of Database (Transactions Components Database, OLTP, etc.), Web (Internet, Intranet, Extranet, etc.) and Data Warehouse (OLAP, BI, etc.). Professional certificate MCTS in MS SQL Server 2005 MTA in Database Administrator Fundamentals.
Specialties: MS SQL Server, Oracle, DB2, Informix, SyBase, 4D, IBM Cognos, Siebel, Business Objects, MS Office PerformancePoint Server,
**Shehab El-Najjar**
Twitter: - [https://twitter.com/MSQLPerformance](https://www.twitter.com/https://twitter.com/MSQLPerformance)
LinkedIn: [Shehab El-Najjar](https://www.linkedin.com/profile/view?id=126446983amp;trk=hp-identity-name)
Contact: [http://sqlserver-performance-tuning.net/](http://sqlserver-performance-tuning.net/)
Shehab El-Najjar was the ONLY Microsoft SQL Server MVP in Gulf for the past 6 years and the 2nd one all over the Middle East , he is the founder of SQL Gulf events series (SQL Gulf #1 , #2 and #3 ) where he spent so much time and efforts to broadcast Microsoft SQL Server technologies all over the Gulf such as KSA and Emirates and other Gulf cities ahead ..)
He is now Professional Services Manager at Saudi Emircom
He was previously COO and business leader in KSA market through his startup WAJA IT for 3 years
He is an influencing Database community leader all over the region
A senior Database Consultant (SQL Server MVP for 6 years in row) -The 2nd MVP awardee SQL Server all over Middle East and Arabic region
**Percy Reyes**
Twitter: - [@percyreyes](https://www.twitter.com/@percyreyes)
LinkedIn: [Percy Reyes](https://www.linkedin.com/in/percyreyes)
Contact: [http://percyreyes.com/](http://percyreyes.com/)
Microsoft SQL Server MVP, Certified Sr. Database Administrator, Author at http://MSSQLTips.com | SQL PASS Peru Chapter Leader | MCITP DBA/Dev, MCTS, MCP.
Bachelor in Systems Engineering and Senior Database Administrator focused on Microsoft SQL Server Internals with over 12+ years of extensive experience managing database servers. I am a frequent Speaker about SQL Server technologies for over 10 years at Local User Group Meetings, Webcasts, and National Conferences.
**Shehab El-Najjar**
Twitter: - [https://twitter.com/MSQLPerformance](https://www.twitter.com/https://twitter.com/MSQLPerformance)
LinkedIn: [Shehab El-Najjar](https://www.linkedin.com/profile/view?id=126446983amp;trk=hp-identity-name)
Contact: [http://sqlserver-performance-tuning.net/](http://sqlserver-performance-tuning.net/)
Shehab El-Najjar was the ONLY Microsoft SQL Server MVP in Gulf for the past 6 years and the 2nd one all over the Middle East , he is the founder of SQL Gulf events series (SQL Gulf #1 , #2 and #3 ) where he spent so much time and efforts to broadcast Microsoft SQL Server technologies all over the Gulf such as KSA and Emirates and other Gulf cities ahead ..)
He is now Professional Services Manager at Saudi Emircom
He was previously COO and business leader in KSA market through his startup WAJA IT for 3 years
He is an influencing Database community leader all over the region
A senior Database Consultant (SQL Server MVP for 6 years in row) -The 2nd MVP awardee SQL Server all over Middle East and Arabic region
**ENRIQUE ALBAN**
Enrique Alban, profesional de reconocida trayectoria nacional e internacional con más de 20 años de experiencia, premiado por 9 años consecutivos con el prestigioso premio a nivel mundial dado por Microsoft como el Most Value Professional (MVP) en SQL SERVER. A realizado consultorías a las principales empresas nacionales e internacionales. Participa habitualmente en los eventos de Microsoft como expositor de Inteligencia de Negocio y Base de Datos.
**Team SQL PASS PERU**
Equipo SQL PASS PERU
**Jose Redondo**
Information Technology System Business Consultant (Stand-Alone, Client/Server, Multi Levels, etc.), Designer and Developers of Database (Transactions Components Database, OLTP, etc.), Web (Internet, Intranet, Extranet, etc.) and Data Warehouse (OLAP, BI, etc.). Professional certificate MCTS in MS SQL Server 2005 MTA in Database Administrator Fundamentals.
Specialties: MS SQL Server, Oracle, DB2, Informix, SyBase, 4D, IBM Cognos, Siebel, Business Objects, MS Office PerformancePoint Server,
**Team SQL PASS PERU**
Equipo SQL PASS PERU
**German Cayo Morales**
Contact: [http://germancayom.wordpress.com](http://germancayom.wordpress.com)
Consultor y especialista en SQL Server. Fundador de la Comunidad MT Developer Ica y colaborador como Speaker en diferentes Comunidades a nivel Nacional
## <a name="sponsors"></a>Sponsors
The following is a list of sponsors that helped fund the event:
- [O'Reilly Books](http://oreilly.com/)
- [Wrox](http://www.wrox.com/WileyCDA/)
- [PluralSight](http://www.pluralsight.com)
- [ApexSQL LLC](http://www.apexsql.com/?utm_source=SQLSaturdaysutm_medium=sponsorlinkutm_campaign=%5BSQLSaturdays-Homepage%5D)
[Back to the SQL Saturday Event List](/past)
[Back to the home page](/index)
| 43.203187
| 1,000
| 0.690151
|
eng_Latn
| 0.763269
|
58f803a85d7c2dde3d6e81872d60bd2e6f685b04
| 341
|
md
|
Markdown
|
docs/api/sip.js.useragent.contact.md
|
joshelson/SIP.js
|
f11dfd584bc9788ccfc94e03034020672b738975
|
[
"MIT"
] | 1,486
|
2015-01-02T08:50:13.000Z
|
2022-03-30T11:19:39.000Z
|
docs/api/sip.js.useragent.contact.md
|
joshelson/SIP.js
|
f11dfd584bc9788ccfc94e03034020672b738975
|
[
"MIT"
] | 770
|
2015-01-01T12:25:21.000Z
|
2022-03-30T18:13:18.000Z
|
docs/api/sip.js.useragent.contact.md
|
joshelson/SIP.js
|
f11dfd584bc9788ccfc94e03034020672b738975
|
[
"MIT"
] | 586
|
2015-02-05T08:32:33.000Z
|
2022-03-20T07:59:01.000Z
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [sip.js](./sip.js.md) > [UserAgent](./sip.js.useragent.md) > [contact](./sip.js.useragent.contact.md)
## UserAgent.contact property
User agent contact.
<b>Signature:</b>
```typescript
get contact(): Contact;
```
| 24.357143
| 132
| 0.645161
|
eng_Latn
| 0.434247
|
58f805474a65ceea591d77effd8036031693a5e9
| 2,437
|
md
|
Markdown
|
docs/index.md
|
c19k/website-data
|
cbaed8afff1e060fe2e339b25e801454bc7a9274
|
[
"MIT"
] | 5
|
2020-05-20T14:33:28.000Z
|
2020-07-17T08:07:15.000Z
|
docs/index.md
|
c19k/website-data
|
cbaed8afff1e060fe2e339b25e801454bc7a9274
|
[
"MIT"
] | 4
|
2020-07-15T19:33:16.000Z
|
2020-10-06T15:45:17.000Z
|
docs/index.md
|
c19k/website-data
|
cbaed8afff1e060fe2e339b25e801454bc7a9274
|
[
"MIT"
] | 4
|
2020-04-04T20:31:15.000Z
|
2020-10-07T18:43:38.000Z
|
# API for covid19kerala.info
## End Points
### /patient_data/latest.json
https://data.covid19kerala.info/patient_data/latest.json
Data is an array of patient data objects.
```
[
{ ... patient data },
{ ... patient data },
]
```
Example Patient Data:
```
{
"patientId": 1,
"dateAnnounced": "2020-01-31",
"ageBracket": 20,
"gender": "F",
"residence": "Thrissur",
"detectedCityTown": "Thrissur",
"detectedPrefecture": "Thrissur",
"patientStatus": "Discharged",
"notes": "Discharged on 13/03/2020",
"knownCluster": "Wuhan, China",
"releasedOn": "2020-03-13",
"confirmedPatient": true
},
```
| Fields | Values | Description |
| ------ | ------ | ----------- |
| patientId | Numeric | Unique identifier for patients |
| dateAnnounced | YYYY-MM-DD | Date patient was announced to have tested positive |
| ageBracket | Numeric | Age bracket (40 mean 40-49). -1 for unspecified |
| gender | M/F/Unspecified | |
| residence | String | City/Town, Prefecture (not consistent) |
| detectedCityTown | City/Town or Blank | City/Town patient was detected in |
| detectedPrefecture | Prefecture Name, or "Unspecified" | District patient was detected in. |
| patientStatus | Unspecified, Hospitalized, Deceased, Discharged, Recovered | Condition of patient (Discharged and Recovered are similar) |
| sourceURL | URL | Any news or press release where this data was sourced from |
| notes | String | Other text |
| knownCluster | String | Known cluster this patient is from (can be multiple, separated by commas) |
### /summary/latest.json
https://data.covid19kerala.info/summary/latest.json
Individal District data:
```
[
{
"confirmed": 175,
"deaths": 0,
"confirmedByCity": {
"Kasaragod": 174,
"Mangalore": 1
},
"dailyConfirmedCount": [...],
"dailyConfirmedStartDate": "2020-01-31",
"newlyConfirmed": 0,
"recovered": 159,
"name_ja": "കാസർഗോഡ്",
"name": "Kasaragod"
]
```
List is sorted by summary.count.
| Field | Values | Description |
| ----- | ------ | ----------- |
| count | Numeric | Total infected count |
| deaths | Numeric | Total number of deaths |
| recovered | Numeric | Total number of recovered patients |
| critical | Numeric | Total number of patients in critical condition (respirators) |
| confirmedByCity | Object | Keys are individual cites and their total infected counts |
| 29.361446
| 140
| 0.648338
|
eng_Latn
| 0.850753
|
58f9f872c6cefda8384acdb88f76b75805346b6b
| 155
|
md
|
Markdown
|
index.md
|
mloberg/mloberg.github.io
|
8e042da0578b8314e6f1aa6b31f9a5fbe05c1ff6
|
[
"MIT"
] | null | null | null |
index.md
|
mloberg/mloberg.github.io
|
8e042da0578b8314e6f1aa6b31f9a5fbe05c1ff6
|
[
"MIT"
] | null | null | null |
index.md
|
mloberg/mloberg.github.io
|
8e042da0578b8314e6f1aa6b31f9a5fbe05c1ff6
|
[
"MIT"
] | null | null | null |
---
layout: default
---
You are being redirected to my site at [http://mlo.io](http://mlo.io).
<script>window.location.replace("http://mlo.io");</script>
| 22.142857
| 70
| 0.670968
|
eng_Latn
| 0.725853
|
58fabe664054d685b3f25a45c4da06b79ed47c13
| 5,783
|
md
|
Markdown
|
vault/dendron.ref.vaults.md
|
LiminalCrab/dendron-site
|
defd27190d973a30021dcf9813cbeff93e68869f
|
[
"MIT"
] | null | null | null |
vault/dendron.ref.vaults.md
|
LiminalCrab/dendron-site
|
defd27190d973a30021dcf9813cbeff93e68869f
|
[
"MIT"
] | null | null | null |
vault/dendron.ref.vaults.md
|
LiminalCrab/dendron-site
|
defd27190d973a30021dcf9813cbeff93e68869f
|
[
"MIT"
] | null | null | null |
---
id: 6682fca0-65ed-402c-8634-94cd51463cc4
title: Vaults
desc: ''
updated: 1623095542364
created: 1622841137387
---
## Summary
Your workspace is made up of **vaults**. A dendron vault stores a collection of related notes. If you're familiar with git, it's just like a code repo. By default, Dendron creates a _vaults_ folder when you first initialize a **workspace**. All your notes are stored on a per vault basis.
```
.
└── workspace
├── vault.main
│ ├── foo.md
│ ├── foo.one.md
│ └── foo.two.md
└── vault.secret (hypothetical)
├── secret.one.md
└── secret.two.md
```
By default, when you look for notes in Dendron, it will search over all vaults.
## Commands
### Vault Add
- shortcuts: none
Add a new vault to your workspace.
When you add a vault, you can choose between adding a local vault or a remote vault.
#### Local Vault
A local vault is a folder in your file system.
#### Remote Vault
A remote vault is a git repository. If you choose a remote vault, you can choose from a vault from the registry or enter a custom git url.
We currently have four vaults in the registry: `dendron.so`, `aws.dendron.so`, `tldr.dendron.so and `xkcd.dendron.so`. These correspond to the notes backing https://dendron.so/ and https://aws.dendron.so/ respectively.
Note that when you add a remote vault, the url can also point to a remote workspace. In that case, dendron will inspect the `dendron.yml` to get a list of all vaults within the workspace and add all vaults from inside the workspace.
<div style="position: relative; padding-bottom: 62.5%; height: 0;"><iframe src="https://www.loom.com/embed/b4171372f9794dd7be609c043f343fa3" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe></div>
### Vault Remove
- shortcuts: none
Remove a vault
Remove a vault from your workspace. Note that the underlying files will **not** be deleted - the vault will lose its association with your workspace.
<div style="position: relative; padding-bottom: 62.5%; height: 0;"><iframe src="https://www.loom.com/embed/307effc22b8d4c59a32933529a8393e1" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe></div>
## Vault Sources
When adding new vaults, your vault can come from either of the following sources:
- local
- remote
### Local
A local vault is what you start off with. Its a vault that is local to your file system.
### Remote
A remote vault is what you get when you run the [[Vault Add|dendron.topic.commands#vault-add]] command and select a remote vault. This is a vault that is cloned from a git repo. It should be a similar format as what you see below
```yml
vaults:
-
fsPath: dendron
remote:
type: git
url: 'git@github.com:dendronhq/dendron.git'
```
When someone pulls down a workspace with a `dendron.yml` that contains a remote vault, Dendron will automatically initialize the vault at the given `fsPath`. If the vault is a [[Workspace Vault|dendron.ref.vaults#workspace-vault]], Dendron will pull downt the workspace to `{workspaceName}/fsPath`.
## Vault Types
### Regular Vault
A regular vault is what you get by default when you first initialize your workspace.
### Workspace Vault
A workspace vault is a vault that belongs to another [[workspace|dendron.ref.workspace]]. It is automatically created when you run [[Vault Add|dendron.ref.vaults#vault-add]] on a [[workspace|dendron.ref.workspace]]. Upon adding a workspace, Dendron will add all the vaults of the given workspace inside your `dendron.yml`
You can see an example of the configuration [[here|dendron.ref.vaults#remote-workspace-vault]].
## Configuration
### fsPath
- file path to vault
### name
- default: last component of `fsPath`
vault name
### visibility
- choices: "private|public"
If set to private, notes in this vault will not be published regardless of any other configuration. This takes precedences over everything.
### workspace
- required: false
If set, specifies the workspace that this vault belongs
### remote
- added property for [[remote vaults|dendron.ref.vaults#remote]]
- properties
- type: currently only `git` is supported (in the future, we might add additional types)
- url: url to github repo
### sync
- default: `sync`
See [[workspace sync configuration options|dendron.ref.workspace#configuration-options]] for valid options.
Sets the [[synchronization strategy|dendron.ref.workspace#Workspace: Sync]] for this vault. This overrides the [[workspace vault sync option|dendron.topic.config.dendron#workspaceVaultSync]] if it is set.
### Configuration Examples
#### Local Vault
```yml
vaults:
- fsPath: vault
```
This will have the following file layout
```
.
└── workspace
└── vault
```
#### Remote Vault
```yml
vaults:
-
fsPath: dendron-vault
remote:
type: git
url: 'git@github.com:kevinslin/dendron-vault.git'
name: dendron
sync: sync
-
fsPath: yc-vault
remote:
type: git
url: 'git@github.com:kevinslin/yc-vault.git'
name: yc
sync: noPush
```
This will have the following file layout
```
.
└── workspace
|── dendron-vault
└── yc-vault
```
#### Remote Workspace Vault
```yml
vaults:
-
fsPath: handbook
workspace: handbook
name: handbook
workspaces:
handbook:
remote:
type: git
url: 'git@github.com:dendronhq/handbook.git'
```
This will have the following file layout
```
.
└── workspace
└── handbook
└── handbook
```
| 29.060302
| 322
| 0.700847
|
eng_Latn
| 0.973296
|
58fadc470152b164d6519d0d3cf046c78aa844cd
| 824
|
md
|
Markdown
|
meta/8-3-1.md
|
Michel228/open-sdg-data-starter
|
9d6af69450d5da906ea0086e3013f26a3f45ba9b
|
[
"MIT"
] | 1
|
2022-02-04T03:59:43.000Z
|
2022-02-04T03:59:43.000Z
|
meta/8-3-1.md
|
charlessaid89/sdg-data-malta
|
cf7bd67b11d7dca7e85366b5b33b9b05091c006e
|
[
"MIT"
] | null | null | null |
meta/8-3-1.md
|
charlessaid89/sdg-data-malta
|
cf7bd67b11d7dca7e85366b5b33b9b05091c006e
|
[
"MIT"
] | 1
|
2020-04-13T12:19:45.000Z
|
2020-04-13T12:19:45.000Z
|
---
data_non_statistical: false
goal_meta_link: https://unstats.un.org/sdgs/files/metadata-compilation/Metadata-Goal-8.pdf
goal_meta_link_text: United Nations Sustainable Development Goals Metadata (PDF 231
KB)
graph_title: global_indicators.8-3-1-title
graph_type: line
indicator: 8.3.1
indicator_name: global_indicators.8-3-1-title
indicator_sort_order: 08-03-01
published: true
reporting_status: notstarted
sdg_goal: '8'
target: Promote development-oriented policies that support productive activities,
decent job creation, entrepreneurship, creativity and innovation, and encourage
the formalization and growth of micro-, small- and medium-sized enterprises, including
through access to financial services
target_id: '8.3'
un_custodian_agency: International Labour Organisation (ILO)
un_designated_tier: '2'
---
| 37.454545
| 90
| 0.819175
|
eng_Latn
| 0.721828
|
58faf01e395f1b5d237ca2afad7e113d9846a0d6
| 2,219
|
md
|
Markdown
|
_posts/13/2021-04-06-krystal-jung.md
|
chito365/ukdat
|
382c0628a4a8bed0f504f6414496281daf78f2d8
|
[
"MIT"
] | null | null | null |
_posts/13/2021-04-06-krystal-jung.md
|
chito365/ukdat
|
382c0628a4a8bed0f504f6414496281daf78f2d8
|
[
"MIT"
] | null | null | null |
_posts/13/2021-04-06-krystal-jung.md
|
chito365/ukdat
|
382c0628a4a8bed0f504f6414496281daf78f2d8
|
[
"MIT"
] | null | null | null |
---
id: 3576
title: Krystal Jung
date: 2021-04-06T08:48:39+00:00
author: Laima
layout: post
guid: https://ukdataservers.com/krystal-jung/
permalink: /04/06/krystal-jung
tags:
- claims
- lawyer
- doctor
- house
- multi family
- online
- poll
- business
- unspecified
- single
- relationship
- engaged
- married
- complicated
- open relationship
- widowed
- separated
- divorced
- Husband
- Wife
- Boyfriend
- Girlfriend
category: Guides
---
* some text
{: toc}
## Who is Krystal Jung
Star of the South Korean TV series High Kick 3 and More Charming by the Day who also performed in the girl group F(x).
## Prior to Popularity
She was scouted by S.M. Entertainment and began filming commercials and dancing in music videos in her teens.
## Random data
She and the rest of F(x) made their debut in September 2009, a day after the release of their first single and the first 40 seconds of the music video.
## Family & Everyday Life of Krystal Jung
Her older sister is singer Jessica Jung. She dated singer Kai until May 2017.
## People Related With Krystal Jung
She co-starred with Park Ha-sun on the series High Kick 3: Revenge of the Short Legged.
| 19.8125
| 151
| 0.388463
|
eng_Latn
| 0.997956
|
58fbf22ae3ba1ddad0bbe7e86f9092e55c0e294b
| 934
|
md
|
Markdown
|
node_modules/neat-csv/readme.md
|
aescorcia93/VUE3-TEST
|
480582d8b770a9bdba9973c9c1982ad60479c183
|
[
"MIT"
] | 1
|
2019-03-27T18:49:08.000Z
|
2019-03-27T18:49:08.000Z
|
node_modules/neat-csv/readme.md
|
aescorcia93/VUE3-TEST
|
480582d8b770a9bdba9973c9c1982ad60479c183
|
[
"MIT"
] | 4
|
2020-05-04T09:19:29.000Z
|
2022-02-18T13:32:41.000Z
|
node_modules/neat-csv/readme.md
|
aescorcia93/VUE3-TEST
|
480582d8b770a9bdba9973c9c1982ad60479c183
|
[
"MIT"
] | 1
|
2022-01-13T15:59:04.000Z
|
2022-01-13T15:59:04.000Z
|
# neat-csv [](https://travis-ci.org/sindresorhus/neat-csv)
> Fast CSV parser
Convenience wrapper around the super-fast streaming [`csv-parser`](https://github.com/mafintosh/csv-parser) module. Use that one if you want streamed parsing.
## Install
```
$ npm install --save neat-csv
```
## Usage
```js
const neatCsv = require('neat-csv');
const csv = 'type,part\nunicorn,horn\nrainbow,pink';
neatCsv(csv).then(data => {
console.log(data);
//=> [{type: 'unicorn', part: 'horn'}, {type: 'rainbow', part: 'pink'}]
});
```
## API
### neatCsv(input, [options])
Returns a promise for an array with the parsed CSV.
#### input
Type: `buffer`, `string`, `stream`
CSV to parse.
#### options
Type: `object`
See the `csv-parser` [options](https://github.com/mafintosh/csv-parser#usage).
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)
| 18.68
| 158
| 0.675589
|
kor_Hang
| 0.215952
|
58fcda414168d1fbc405400f41f038f9d4c74e87
| 3,631
|
md
|
Markdown
|
docs/rn/evm.md
|
fga-eps-mds/2021-1-PUMA
|
c2e5a363bf72bd952614da65dc5da4a68bf7d333
|
[
"MIT"
] | 3
|
2021-09-08T18:18:48.000Z
|
2021-11-08T15:58:20.000Z
|
docs/rn/evm.md
|
fga-eps-mds/2021-1-PUMA
|
c2e5a363bf72bd952614da65dc5da4a68bf7d333
|
[
"MIT"
] | 109
|
2021-08-16T17:12:36.000Z
|
2021-11-10T19:56:01.000Z
|
docs/rn/evm.md
|
fga-eps-mds/2021-1-PUMA
|
c2e5a363bf72bd952614da65dc5da4a68bf7d333
|
[
"MIT"
] | 1
|
2021-11-03T21:25:10.000Z
|
2021-11-03T21:25:10.000Z
|
| Data | Versão | Autores | Descrição |
|--|--|--|--|
| 07/11/2021 | 1.0 | Luís Taira | Criação do documento |
# Sprint 0
<p align="justify">       Chamamos de sprint 0 as semanas que foram dedicadas à realização das metodologias Lean Inception e Product Backlog Building.</p>
<p align="justify">       Para calcular o custo da sprint 0 utilizamos o EVM tradicional, pegando o somatório de esforço total nescessário e analisando o período no qual esse esforço é dividido.</p>
<p align="justify">       Durante a Sprint 0, o esforço se apresenta na forma de reuniões que precisavam ser realizadas para a execução da LI e PBB. O orçamento total alocado para este período então é o somatório do custo de cada uma das reuniões, que é calculado a partir da duração da cada reunião, em horas, multiplicada pelo número de participantes, multiplicado pelo custo por hora de cada participante.</p>


<p align="justify">       É utilizado o EVM tradicional para analisar a execução da sprint 0.</p>




<p align="justify">       A partir desses gráficos é possível perceber que o desenvolvimento da sprint 0 ocorreu como esperado. Com as reuniões e rituais sendo realizados, sem deixar pendências.</p>
# Sprints 1 a 9
<p align="justify">       O custo do projeto na etapa de desenvolvmento, durante as sprints de 1 a 9, é calculado usando o Agile EVM, no qual a quantidade de esforço é medida sprint a sprint de acordo com os pontos de história de cada sprint.</p>
<p align="justify">       O orçamento total alocado foi calculado a partir de uma estimativa de que cada membro dedicaria 12 horas por semana ao projeto</p>

<p align="justify">       A partir desse orçamento, é usado o Agile EVM para analisar o custo dessa etapa do projeto.</p>




<p align="justify">       A partir desses gráficos, é possível tirar várias conclusões.</p>
<p align="justify">       Até a sprinit 3, não havia sido agregado nenhum valor real ao produto, até que na sprint 4 foi mantido um rítmo até a sprint 5, quando o valor se estagnou até a sprint 8, na qual muito valor foi muito agregado. Importante lembrar que o evm não mede a quantidade de trabalho realizado pelo time. Isso pode ser conferido no <a href='#/rn/velocity.md'>velocity</a>.</p>
<p align="justify">       O comportamento desses gráficos pode ser explicado por vários fenômenos ocorridos durante o projeto.</p>
<p align="justify">       Até a sprint 3, o desenvolvimento das histórias de usuário estavam sob a responsabilidade do time de MDS. Valor começou a ser agregado quando EPS começou a desenvolver também.</p>
<p align="justify">       É possível perceber uma queda no valor agregado na sprint 5, seguido por uma grande alta na sprint 8. Isso pode ser explicado por várias histórias estarem sendo desenvolvidas ao mesmo tempo e aconteceu que grandes entregas foram feitas nas sprints 4 e 5, tendo a sprint 5 e 7 poucas entregas e histórias que acumularam e foram de novo entregues juntas na sprint 8.</p>
| 82.522727
| 437
| 0.752961
|
por_Latn
| 0.997808
|
58fcf37bec1fe6237a71631c5e282588048c8844
| 7,531
|
md
|
Markdown
|
_sunday-school-lessons/2020-06-28-Reason10.md
|
dantaylor688/dantaylor688.github.io
|
f430224693c94a7469826f88b88bd9b1460e1cc9
|
[
"MIT"
] | null | null | null |
_sunday-school-lessons/2020-06-28-Reason10.md
|
dantaylor688/dantaylor688.github.io
|
f430224693c94a7469826f88b88bd9b1460e1cc9
|
[
"MIT"
] | null | null | null |
_sunday-school-lessons/2020-06-28-Reason10.md
|
dantaylor688/dantaylor688.github.io
|
f430224693c94a7469826f88b88bd9b1460e1cc9
|
[
"MIT"
] | null | null | null |
---
layout: lesson
title: TRFG - Reason 3 - The problem of sin
comments: true
---
_In the next few chapters, Keller walks through the Christian gospel message in a way that appeals to the contemporary mind._
It is easy to see that something is fundamentally wrong with our world today. However, the idea of _sin_ is offensive to many. In this lesson, we will look at a Biblical way of defining sin that is different than the customary understanding shared by most people.
## Defining sin
Soren Kierkegaard said
> Sin is: in despair not wanting to be oneself before God.... Faith is: that the self in being itself and wanting to be itself is grounded transparently in God.
Many think of sin as breaking divine rules. However, it is worth noting that the first of the Ten Commandants states "have no other gods before me." So, sin is not primarily defined by doing bad things but by turning (even good) things into _ultimate_ things.
In the movie _Rocky_, Rocky's girlfriend asks him why it is so important for him to "go the distance" in the boxing match. "Then I'll know I'm not a bum," is his reply. For Rocky, his performance in the boxing match gave meaning to his life. When we attach our worth to something, we inevitably deify that thing. However, no _natural_ thing can bear such a heavy burden. When it fails or has a shortcoming, our worth is threatened and we lash out. We want to know that our existence has meaning and purpose. But again, no natural thing can provide this.
## Sin and consequences
Identity apart from God is inherently unstable. When we define our identity apart from God, our self-worth can never be stable. Thomas Oden writes:
> Suppose my god is sex or physical health or the Democratic Party. If I experience any of these under genuine threat, then I feel myself shaken to the depths. Guilt becomes neurotically intensified to the degree that I have idolized finite values.... Suppose I value my ability to teach and communicate clearly.... If clear communication has become an absolute value for me, a center of value that makes all my other values valuable... then if I [fail in teaching well] I am stricken with neurotic guilt. Bitterness becomes neurotically intensified when someone or something stands between me and something that is my ultimate value.
Keller summarizes, "If anything threatens your identity you will not just be anxious but paralyzed with fear." You cannot avoid this insecurity without God. Even if you consciously decide to not base your happiness on anything external, you will inevitably be basing your worth on your own freedom. If that is taken away, you will be devastated.
Sin also tears at our social fabric. This was especially evident and devastating to those who saw the atrocities of World War II. Why does sin have such an effect on society? Jonathan Edwards answered this in _The Nature of True Virtue_. If we get our self-worth from our political position, then politics is no longer about politics but about _us_. If someone threatens our position then we must demonize the opposition. If we put our worth in our family, nation, or race, we will tend to care less for other families, nations or races. If we define ourselves by our morality, then we will look down on those who are licentious. And so on. So the problem is not a lack of education, but it is a matter of the heart wrecked by a misplaced identity.
Finally, in a somewhat mysterious way, the Bible describes how the entire natural world is "subject to futility" because of sin. The Bible is unique among creation accounts in that it describes the original form of creation as being "good". Specifically, it tells how God wove everything together in complete harmony. Humans are so integral to the whole of creation that when they turned from God, the entire natural world suffered the consequences. Disease, natural disasters and death are the result of creation being "in bondage to decay" because of man's sin. This will not be made right until we are put right.
## Sin and hope
While it may seem pessimistic, the Christian doctrine of sin can actually bring _hope_. If each one can admit that he is a sinner, then he is not merely a victim of his environment. Barbara Brown Taylor stated this eloquently
> Neither the language of medicine nor of the law is adequate substitute for the language of [sin]. Contrary to the medical model, we are not entirely at the mercy of our maladies. The choice is to enter into the process of repentance. Contrary to the legal model, the essence of sin is not [primarily] the violation of laws but a wrecked relationship with God.... "All sins are attempts to fill voids," wrote Simone Weil. Because we cannot stand the God-shaped hole inside of us, we try stuffing it full of all sorts of things, but only God may fill [it].
In the next lesson, we will discuss more fully the Bible's answer to sin. But we cannot conclude this lesson without noting what C.S. Lewis said in his essay "Is Christianity Hard or Easy"
> The ordinary idea which we all have is that ... we have a natural self with various desires and interests... and we know something called "morality" or "decent behavior" has a claim on the self.... We are all hoping that when all the demands of morality and society have been met, the poor natural self will still have some chance, some time, to get on with its own life and do what it likes. In fact, we are very like an honest many paying his taxes. He pays them, but he does hope that there will be enough left over for him to live on.
>
> The Christian way is different - both harder and easier. Christ says, "Give me ALL. I don't want just this much of your time and this much of your money and this much of your work - so that your natural self can have the rest. I want you. Not your things. I have come not to torture your natural self... I will give you a new self instead. Hand over the whole natural self - ALL the desires, not just the ones you think wicked but the ones you think innocent - the whole outfit. I will give you a new self instead."
You cannot just change your behavior, you need to completely reorient your life. Lewis continues,
> The almost impossibly hard thing is to hand over your whole self to Christ. But it is far easier than what we are all trying to do instead. For what we are trying to do is remain what we call "ourselves" - out personal happiness centered on money or pleasure or ambition - and hoping, despite this, to behave honestly and chastely and humbly. And that is exactly what Christ warned us you cannot do. If I am a grass field - all the cutting will keep the grass less but won't produce wheat. If I want wheat... I must be plowed up and re-sown.
This may sound scary, but remember that you are going to orient your life around _something_ and no natural thing can bear that load.
## Questions
> **Question 1** Keller says, “It is hard to avoid the conclusion that there is something fundamentally wrong with the world”. Do you agree that it’s valid to define what is broken in the world as sin? Why or why not?
> **Question 2** Continuing the thought from number 1, given all the things that are broken in the world, does that raise any questions in your mind about God?
> **Question 3** How would it help society if people sought to find their self-worth and identity in God?
> **Question 4** As C.S. Lewis says, have you handed over your whole natural self to God or are there "innocent" things in your life that you hold on to that give you identity?
| 125.516667
| 748
| 0.779047
|
eng_Latn
| 0.999974
|
58fd132ce3baf0219a4da11687a8b989db015f89
| 775
|
md
|
Markdown
|
README.md
|
jwise-cesmii/selfserve-mfg
|
5e61b261f4d4a3b7ebd909fa7b4718fc07e9d9c2
|
[
"MIT"
] | null | null | null |
README.md
|
jwise-cesmii/selfserve-mfg
|
5e61b261f4d4a3b7ebd909fa7b4718fc07e9d9c2
|
[
"MIT"
] | null | null | null |
README.md
|
jwise-cesmii/selfserve-mfg
|
5e61b261f4d4a3b7ebd909fa7b4718fc07e9d9c2
|
[
"MIT"
] | null | null | null |
setup raspberry pi: expand fs, change keyboard layout, join network, apt-get update, etc...
enable I2C and SPI interfaces in raspi-config
sudo apt install python3-pip
sudo apt install nmap
sudo pip3 install nmap
sudo pip3 install python-nmap
sudo pip3 install psutil
sudo apt install python3-gpiozero
sudo pip3 install gpiozero
sudo pip3 install graphql_client
sudo pip3 install iotc
sudo apt-get install i2c-tools
Install BME2380 Sensor, check with i2cdetect -y 1
sudo pip3 install RPi.bme280
cp sample-iotc.config ~/iotc.config
edit ~/iotc.config to add Azure keys from IOTCentral Device config, change BME port or address as needed
One of the tests depends on https://github.com/graphql/swapi-graphql which I deployed to https://codepoet-sw.herokuapp.com/
| 22.794118
| 123
| 0.792258
|
eng_Latn
| 0.562929
|
58fd20afe7893b09b8bcad6d78475f5b536e1ed2
| 18
|
md
|
Markdown
|
README.md
|
domrally/Math
|
c9aebe69166d5ee0c2c3801aa1a3d66be80ff983
|
[
"MIT"
] | null | null | null |
README.md
|
domrally/Math
|
c9aebe69166d5ee0c2c3801aa1a3d66be80ff983
|
[
"MIT"
] | null | null | null |
README.md
|
domrally/Math
|
c9aebe69166d5ee0c2c3801aa1a3d66be80ff983
|
[
"MIT"
] | null | null | null |
# LinearAlgebra
| 6
| 15
| 0.722222
|
eng_Latn
| 0.79913
|
58fd6ad5b9deb99b38ac1d938e057888ebf8dd62
| 2,156
|
md
|
Markdown
|
README.md
|
mmauger/planter
|
8fe61eb2c1e3ed2cc6e57d8bb767c1d2bb648b05
|
[
"MIT"
] | 447
|
2017-09-24T06:16:16.000Z
|
2022-03-28T14:22:47.000Z
|
README.md
|
mmauger/planter
|
8fe61eb2c1e3ed2cc6e57d8bb767c1d2bb648b05
|
[
"MIT"
] | 19
|
2017-09-25T05:06:18.000Z
|
2021-09-02T01:59:02.000Z
|
README.md
|
mmauger/planter
|
8fe61eb2c1e3ed2cc6e57d8bb767c1d2bb648b05
|
[
"MIT"
] | 35
|
2017-09-25T04:14:11.000Z
|
2022-03-01T07:42:15.000Z
|
# planter
[](https://github.com/achiku/planter/actions/workflows/test.yml)
[](https://raw.githubusercontent.com/achiku/planter/master/LICENSE)
[](https://goreportcard.com/report/github.com/achiku/planter)
Generate PlantUML ER diagram textual description from PostgreSQL tables
## Why created
A team with only software engineers doesn't need ER diagram that much as long as they have decent experience in Relational Database modeling. However, it becomes very helpful to have always-up-to-date ER diagram when marketing/promotion/operation teams consisting of those who are fluent in writing/reading SQL, join to the game.
[PlantUML](http://plantuml.com/) supports ER diagram in the latest version with [this awesome pull request](https://github.com/plantuml/plantuml/pull/31). The tool, planter, generates textual description of PlantUML ER diagram from pre-existing PostgreSQL tables, and makes it easy to share visual structure of relations with other teams.
## Installation
```
go get -u github.com/achiku/planter
```
## Quick Start
```
$ planter postgres://planter@localhost/planter?sslmode=disable -o example.uml
$ java -jar plantuml.jar -verbose example.uml
```

## Specify table names
```
planter postgres://planter@localhost/planter?sslmode=disable \
-t order_detail \
-t sku \
-t product
```
## Help
```
$ planter --help
usage: planter [<flags>] <conn>
Flags:
--help Show context-sensitive help (also try --help-long and --help-man).
-s, --schema="public" PostgreSQL schema name
-o, --output=OUTPUT output file path
-t, --table=TABLE ... target tables
-x, --exclude=EXCLUDE ... target tables
-T, --title=TITLE Diagram title
Args:
<conn> PostgreSQL connection string in URL format
```
## Test
setup database.
```
create database planter;
create user planter;
```
run `go test ./... -v`
| 29.944444
| 338
| 0.721707
|
eng_Latn
| 0.778636
|
58fda8b4f673a94de0af03e034c48878433df0ae
| 3,493
|
md
|
Markdown
|
docs/odbc/reference/develop-app/allocating-and-freeing-buffers.md
|
jaredmoo/sql-docs
|
fae18f2837c5135d3482a26f999173ecf4f9f58e
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
docs/odbc/reference/develop-app/allocating-and-freeing-buffers.md
|
jaredmoo/sql-docs
|
fae18f2837c5135d3482a26f999173ecf4f9f58e
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
docs/odbc/reference/develop-app/allocating-and-freeing-buffers.md
|
jaredmoo/sql-docs
|
fae18f2837c5135d3482a26f999173ecf4f9f58e
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
---
title: "Allocating and Freeing Buffers | Microsoft Docs"
ms.custom: ""
ms.date: "01/19/2017"
ms.prod: "sql"
ms.prod_service: "drivers"
ms.service: ""
ms.component: "odbc"
ms.reviewer: ""
ms.suite: "sql"
ms.technology:
- "drivers"
ms.tgt_pltfrm: ""
ms.topic: conceptual
helpviewer_keywords:
- "buffers [ODBC], allocating and freeing"
- "allocating buffers [ODBC]"
- "freeing buffers [ODBC]"
ms.assetid: 886bc9ed-39d4-43d2-82ff-aebc35b14d39
caps.latest.revision: 5
author: "MightyPen"
ms.author: "genemi"
manager: craigg
---
# Allocating and Freeing Buffers
All buffers are allocated and freed by the application. If a buffer is not deferred, it need only exist for the duration of the call to a function. For example, **SQLGetInfo** returns the value associated with a particular option in the buffer pointed to by the *InfoValuePtr* argument. This buffer can be freed immediately after the call to **SQLGetInfo**, as shown in the following code example:
```
SQLSMALLINT InfoValueLen;
SQLCHAR * InfoValuePtr = malloc(50); // Allocate InfoValuePtr.
SQLGetInfo(hdbc, SQL_DBMS_NAME, (SQLPOINTER)InfoValuePtr, 50,
&InfoValueLen);
free(InfoValuePtr); // OK to free InfoValuePtr.
```
Because deferred buffers are specified in one function and used in another, it is an application programming error to free a deferred buffer while the driver still expects it to exist. For example, the address of the \**ValuePtr* buffer is passed to **SQLBindCol** for later use by **SQLFetch**. This buffer cannot be freed until the column is unbound, such as with a call to **SQLBindCol** or **SQLFreeStmt** as shown in the following code example:
```
SQLRETURN rc;
SQLINTEGER ValueLenOrInd;
SQLHSTMT hstmt;
// Allocate ValuePtr
SQLCHAR * ValuePtr = malloc(50);
// Bind ValuePtr to column 1. It is an error to free ValuePtr here.
SQLBindCol(hstmt, 1, SQL_C_CHAR, ValuePtr, 50, &ValueLenOrInd);
// Fetch each row of data and place the value for column 1 in *ValuePtr.
// Code to check if rc equals SQL_ERROR or SQL_SUCCESS_WITH_INFO
// not shown.
while ((rc = SQLFetch(hstmt)) != SQL_NO_DATA) {
// It is an error to free ValuePtr here.
}
// Unbind ValuePtr from column 1. It is now OK to free ValuePtr.
SQLFreeStmt(hstmt, SQL_UNBIND);
free(ValuePtr);
```
Such an error is easily made by declaring the buffer locally in a function; the buffer is freed when the application leaves the function. For example, the following code causes undefined and probably fatal behavior in the driver:
```
SQLRETURN rc;
SQLHSTMT hstmt;
BindAColumn(hstmt);
// Fetch each row of data and try to place the value for column 1 in
// *ValuePtr. Because ValuePtr has been freed, the behavior is undefined
// and probably fatal. Code to check if rc equals SQL_ERROR or
// SQL_SUCCESS_WITH_INFO not shown.
while ((rc = SQLFetch(hstmt)) != SQL_NO_DATA) {}
.
.
.
void BindAColumn(SQLHSTMT hstmt) // WARNING! This function won't work!
{
// Declare ValuePtr locally.
SQLCHAR ValuePtr[50];
SQLINTEGER ValueLenOrInd;
// Bind rgbValue to column.
SQLBindCol(hstmt, 1, SQL_C_CHAR, ValuePtr, sizeof(ValuePtr),
&ValueLenOrInd);
// ValuePtr is freed when BindAColumn exits.
}
```
| 37.159574
| 453
| 0.676782
|
eng_Latn
| 0.986816
|
58fdd269bb1befd1c13ca36e324ccf6c53d0205b
| 19
|
md
|
Markdown
|
README.md
|
appanp/reveal.js-textile
|
f2f7b9427fb641462598811117cde883d3350597
|
[
"Apache-2.0"
] | null | null | null |
README.md
|
appanp/reveal.js-textile
|
f2f7b9427fb641462598811117cde883d3350597
|
[
"Apache-2.0"
] | 1
|
2016-09-22T06:31:38.000Z
|
2016-09-22T06:31:38.000Z
|
README.md
|
appanp/reveal.js-textile
|
f2f7b9427fb641462598811117cde883d3350597
|
[
"Apache-2.0"
] | null | null | null |
# reveal.js-textile
| 19
| 19
| 0.789474
|
ron_Latn
| 0.490769
|
58ff138b1a9456f229bb8549bda9d206f9c10fa4
| 2,222
|
md
|
Markdown
|
zhuan_huan_json_dao_shu_ju_lei.md
|
LewisRhine/kotlin-for-android-developers-zh
|
fee08357293da3ed9a1fa12dc01b694ee5a943d4
|
[
"Apache-2.0"
] | 22
|
2018-06-05T03:50:03.000Z
|
2021-05-22T13:13:33.000Z
|
zhuan_huan_json_dao_shu_ju_lei.md
|
Tlioylc/kotlin-for-android-developers-zh
|
fee08357293da3ed9a1fa12dc01b694ee5a943d4
|
[
"Apache-2.0"
] | null | null | null |
zhuan_huan_json_dao_shu_ju_lei.md
|
Tlioylc/kotlin-for-android-developers-zh
|
fee08357293da3ed9a1fa12dc01b694ee5a943d4
|
[
"Apache-2.0"
] | 12
|
2018-04-28T03:39:15.000Z
|
2020-09-16T12:34:22.000Z
|
# 转换json到数据类
我们现在知道怎么去创建一个数据类,那我们开始准备去解析数据。在`date`包中,创建一个名为`ResponseClasses.kt`新的文件,如果你打开第8章中的url,你可以看到json文件整个结构。它的基本组成包括一个城市,一个系列的天气预报,这个城市有id,名字,所在的坐标。每一个天气预报有很多信息,比如日期,不同的温度,和一个由描述和图标的id。
在我们当前的UI中,我们不会去使用所有的这些数据。我们会解析所有到类里面,因为可能会在以后某些情况下会用到。以下就是我们需要使用到的类:
```kotlin
data class ForecastResult(val city: City, val list: List<Forecast>)
data class City(val id: Long, val name: String, val coord: Coordinates,
val country: String, val population: Int)
data class Coordinates(val lon: Float, val lat: Float)
data class Forecast(val dt: Long, val temp: Temperature, val pressure: Float,
val humidity: Int, val weather: List<Weather>,
val speed: Float, val deg: Int, val clouds: Int,
val rain: Float)
data class Temperature(val day: Float, val min: Float, val max: Float,
val night: Float, val eve: Float, val morn: Float)
data class Weather(val id: Long, val main: String, val description: String,
val icon: String)
```
当我们使用Gson来解析json到我们的类中,这些属性的名字必须要与json中的名字一样,或者可以指定一个`serialised name`(序列化名称)。一个好的实践是,大部分的软件结构中会根据我们app中布局来解耦成不同的模型。所以我喜欢使用声明简化这些类,因为我会在app其它部分使用它之前解析这些类。属性名称与json结果中的名字是完全一样的。
现在,为了返回被解析后的结果,我们的`Request`类需要进行一些修改。它将仍然只接收一个城市的`zipcode`作为参数而不是一个完整的url,因此这样变得更加具有可读性。现在,我会把这个静态的url放在一个`companion object`(伴随对象)中。如果我们之后还创建更多在url后面拼接的请求,也许我们需要之后提取它。I I> ### `Companion objects` I> I> Kotlin允许我们去定义一些行为与静态对象一样的对象。尽管这些对象可以用众所周知的模式来实现,比如容易实现的单例模式。I> I>如果我们需要一个类里面有一些静态的属性、常量或者函数,我们可以使用`companion objecvt`。这个对象被这个类的所有对象所共享,就像Java中的静态属性或者方法。
以下是最后的代码:
```kotlin
public class ForecastRequest(val zipCode: String) {
companion object {
private val APP_ID = "15646a06818f61f7b8d7823ca833e1ce"
private val URL = "http://api.openweathermap.org/data/2.5/" +
"forecast/daily?mode=json&units=metric&cnt=7"
private val COMPLETE_URL = "$URL&APPID=$APP_ID&q="
}
public fun execute(): ForecastResult {
val forecastJsonStr = URL(COMPLETE_URL + zipCode).readText()
return Gson().fromJson(forecastJsonStr, ForecastResult::class.java)
}
}
```
记得在`build.gradle`中增加你需要的Gson依赖:
```groovy
compile "com.google.code.gson:gson:<version>"
```
| 45.346939
| 354
| 0.731773
|
yue_Hant
| 0.437905
|
58ff5c05b34f3b23aafcfefe75aaa10dc2d3be36
| 959
|
md
|
Markdown
|
src/python/api/stations/id.md
|
twilightDD/dev
|
4cc269c10437b656c20cad6cd91b51ae2f586442
|
[
"MIT"
] | null | null | null |
src/python/api/stations/id.md
|
twilightDD/dev
|
4cc269c10437b656c20cad6cd91b51ae2f586442
|
[
"MIT"
] | null | null | null |
src/python/api/stations/id.md
|
twilightDD/dev
|
4cc269c10437b656c20cad6cd91b51ae2f586442
|
[
"MIT"
] | null | null | null |
---
title: meteostat.Stations.identifier | API | Python Library
---
# meteostat.Stations.identifier
Filter weather stations by one or multiple identifiers. The method supports Meteostat, WMO and ICAO identifiers.
## Parameters
Both parameters are required. The weather station `code` can be a single ID or a tuple/list of identifiers.
| **Parameter** | **Description** | **Type** | **Default** |
|:--------------|:-------------------------------------|:----------------------|:------------|
| organization | The organization which issued the ID | String | undefined |
| code | The identifier | String, Tuple or List | undefined |
## Returns
`Stations` class instance
## Example
Get weather station at Frankfurt Airport by ICAO ID.
```python{4}
from meteostat import Stations
stations = Stations()
station = stations.id('icao', 'EDDF').fetch()
print(station)
```
| 28.205882
| 112
| 0.590198
|
eng_Latn
| 0.948284
|
58ff953f1b5bf0fa03325e036f1081f292dfc5f2
| 75
|
md
|
Markdown
|
src/emu/plugins/transport/readme.md
|
rzrabi/trex-emu
|
6b38a07051e977ddf0c082ba1730f9b178f9dc12
|
[
"Apache-2.0"
] | 27
|
2020-03-16T08:04:47.000Z
|
2022-01-15T15:57:36.000Z
|
src/emu/plugins/transport/readme.md
|
rzrabi/trex-emu
|
6b38a07051e977ddf0c082ba1730f9b178f9dc12
|
[
"Apache-2.0"
] | 14
|
2020-07-22T05:29:31.000Z
|
2021-12-16T10:08:29.000Z
|
src/emu/plugins/transport/readme.md
|
rzrabi/trex-emu
|
6b38a07051e977ddf0c082ba1730f9b178f9dc12
|
[
"Apache-2.0"
] | 20
|
2020-04-13T11:51:07.000Z
|
2021-12-27T09:02:57.000Z
|
Converted from TRex code which was originally converted from TCP BSD code.
| 37.5
| 74
| 0.826667
|
eng_Latn
| 1.000008
|
58ffa49dfa061a65de4f9bb5205af29267a7c4cd
| 77
|
md
|
Markdown
|
README.md
|
chaniotakismg/quantum-experiments
|
5490ddd16b6f36d6b5a9f6773a029e4421f7d092
|
[
"MIT"
] | null | null | null |
README.md
|
chaniotakismg/quantum-experiments
|
5490ddd16b6f36d6b5a9f6773a029e4421f7d092
|
[
"MIT"
] | null | null | null |
README.md
|
chaniotakismg/quantum-experiments
|
5490ddd16b6f36d6b5a9f6773a029e4421f7d092
|
[
"MIT"
] | null | null | null |
# quantum-experiments
Just some quantum experiments with the Qiskit library.
| 25.666667
| 54
| 0.831169
|
eng_Latn
| 0.986438
|
45006512ab4e8a521e350dadb5f22f3e9801c110
| 665
|
md
|
Markdown
|
_posts/dev/data structure/2020-11-04-list.md
|
Yadon079/yadon079.github.io
|
3c2387ab60ed3964c8e1671f05b47fcc7981cb43
|
[
"MIT"
] | 2
|
2020-09-01T05:41:51.000Z
|
2021-07-30T04:37:42.000Z
|
_posts/dev/data structure/2020-11-04-list.md
|
Yadon079/yadon079.github.io
|
3c2387ab60ed3964c8e1671f05b47fcc7981cb43
|
[
"MIT"
] | null | null | null |
_posts/dev/data structure/2020-11-04-list.md
|
Yadon079/yadon079.github.io
|
3c2387ab60ed3964c8e1671f05b47fcc7981cb43
|
[
"MIT"
] | 6
|
2021-01-31T03:32:07.000Z
|
2021-08-13T14:01:19.000Z
|
---
layout: post
date: 2020-11-04 18:16:00
title: "리스트"
description: "자료구조"
subject: 자료구조
category: [ data structure ]
tags: [ data structure, abstract data type, array list ]
use_math: true
comments: true
---
# 리스트(List)
## 추상 자료형 : Abstract Data Type
ADT라고도 불리는 추상 자료형은 '구체적인 기능의 완성과정을 언급하지 않고, 순수하게 기능이 무엇인지를 나열한 것'이다. 자료구조는 추상 자료형이 정의한 연산들을 구현한 구현체를 가리킨다.
쉽게 구분하자면 클래스인지 인터페이스인지를 확인하면 되는 것이다. 스택이나 큐와 같이 구현 방법이 정의되어 있지 않으면 ADT이고, 배열이나 연결 리스트처럼 저장 방식이 정해져 있다면 자료구조이다.
## 배열을 이용한 리스트의 구현
### 리스트의 이해
리스트라는 자료구조는 구현방법에 따라서 크게 두 가지로 나눌 수 있다.
+ 순차 리스트 배열을 기반으로 구현된 리스트
+ 연결 리스트 메모리의 동적 할당을 기반으로 구현된 리스트
리스트 자료구조는 데이터를 나란히 저장한다. 그리고 중복된 데이터의 저장을 허용한다.
| 21.451613
| 110
| 0.700752
|
kor_Hang
| 1.00001
|
4500c13194b4fe60ce6767f8b8d21a13371f8923
| 61
|
md
|
Markdown
|
README.md
|
AbhishekTiwari72/Unique_Web
|
3bd187c91fa128ad3ad94088bd14a6316024f44c
|
[
"MIT"
] | null | null | null |
README.md
|
AbhishekTiwari72/Unique_Web
|
3bd187c91fa128ad3ad94088bd14a6316024f44c
|
[
"MIT"
] | null | null | null |
README.md
|
AbhishekTiwari72/Unique_Web
|
3bd187c91fa128ad3ad94088bd14a6316024f44c
|
[
"MIT"
] | null | null | null |
# Unique_Web
Here We will Learn Using React Js Frontend Web
| 20.333333
| 47
| 0.786885
|
eng_Latn
| 0.636824
|
4500d94335a15e40da952dd1c1990dedff4a1c72
| 15,547
|
md
|
Markdown
|
articles/governance/resource-graph/concepts/query-language.md
|
mtaheij/azure-docs.nl-nl
|
6447611648064a057aae926a62fe8b6d854e3ea6
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
articles/governance/resource-graph/concepts/query-language.md
|
mtaheij/azure-docs.nl-nl
|
6447611648064a057aae926a62fe8b6d854e3ea6
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
articles/governance/resource-graph/concepts/query-language.md
|
mtaheij/azure-docs.nl-nl
|
6447611648064a057aae926a62fe8b6d854e3ea6
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
---
title: Inzicht krijgen in de querytaal
description: Hierin worden resource grafiek tabellen en de beschik bare Kusto-gegevens typen,-Opera tors en-functies die bruikbaar zijn met Azure resource Graph beschreven.
ms.date: 09/30/2020
ms.topic: conceptual
ms.openlocfilehash: ef588bd3fd8afcf1f1139f97d5df2d48a14b4dd9
ms.sourcegitcommit: a422b86148cba668c7332e15480c5995ad72fa76
ms.translationtype: MT
ms.contentlocale: nl-NL
ms.lasthandoff: 09/30/2020
ms.locfileid: "91578526"
---
# <a name="understanding-the-azure-resource-graph-query-language"></a>Informatie over de query taal van Azure resource Graph
De query taal voor de Azure-resource grafiek ondersteunt een aantal opera tors en functies. Elk werk en werkt op basis van [Kusto query language (KQL)](/azure/kusto/query/index). Als u meer wilt weten over de query taal die wordt gebruikt door resource grafiek, begint u met de [zelf studie voor KQL](/azure/kusto/query/tutorial).
In dit artikel worden de taal onderdelen beschreven die worden ondersteund door resource grafiek:
- [Resource grafiek tabellen](#resource-graph-tables)
- [Aangepaste taal elementen van resource grafiek](#resource-graph-custom-language-elements)
- [Ondersteunde KQL-taal elementen](#supported-kql-language-elements)
- [Bereik van de query](#query-scope)
- [Escape tekens](#escape-characters)
## <a name="resource-graph-tables"></a>Resource grafiek tabellen
Resource grafiek biedt verschillende tabellen voor de gegevens die worden opgeslagen over Azure Resource Manager resource typen en hun eigenschappen. Deze tabellen kunnen met or- `join` `union` Opera tors worden gebruikt voor het ophalen van eigenschappen van gerelateerde resource typen. Hier volgt de lijst met tabellen die beschikbaar zijn in resource grafiek:
|Resource grafiek tabellen |Beschrijving |
|---|---|
|Resources |De standaard tabel als niets is gedefinieerd in de query. De resource typen en eigenschappen van Resource Manager zijn hier beschikbaar. |
|ResourceContainers |Bevat een abonnement (in Preview-- `Microsoft.Resources/subscriptions` ) en resource groep ( `Microsoft.Resources/subscriptions/resourcegroups` )-resource typen en-gegevens. |
|AdvisorResources |Bevat resources met _betrekking_ tot `Microsoft.Advisor` . |
|AlertsManagementResources |Bevat resources met _betrekking_ tot `Microsoft.AlertsManagement` . |
|GuestConfigurationResources |Bevat resources met _betrekking_ tot `Microsoft.GuestConfiguration` . |
|HealthResources |Bevat resources met _betrekking_ tot `Microsoft.ResourceHealth` . |
|MaintenanceResources |Bevat resources met _betrekking_ tot `Microsoft.Maintenance` . |
|SecurityResources |Bevat resources met _betrekking_ tot `Microsoft.Security` . |
Zie [verwijzing: ondersteunde tabellen en resource typen](../reference/supported-tables-resources.md)voor een volledige lijst met resource typen.
> [!NOTE]
> _Resources_ is de standaard tabel. Tijdens het uitvoeren van een query op de tabel _resources_ is het niet nodig om de tabel naam op te geven, tenzij `join` of wordt `union` gebruikt. De aanbevolen procedure is echter om altijd de eerste tabel in de query op te halen.
Gebruik resource Graph Explorer in de portal om te ontdekken welke resource typen beschikbaar zijn in elke tabel. Als alternatief kunt u een query gebruiken `<tableName> | distinct type` om een lijst met resource typen op te halen. de gegeven resource grafiek tabel ondersteunt in uw omgeving.
De volgende query bevat een eenvoudige `join` . In het query resultaat worden de kolommen samengebracht en dubbele kolom namen uit de gekoppelde tabel, _ResourceContainers_ in dit voor beeld, worden toegevoegd aan **1**. Als _ResourceContainers_ -tabel heeft typen voor beide abonnementen en resource groepen, kan een van beide typen worden gebruikt om lid te worden van de tabel Resource van _resources_ .
```kusto
Resources
| join ResourceContainers on subscriptionId
| limit 1
```
Met de volgende query wordt een complexere gebruik van weer gegeven `join` . Met de query wordt de gekoppelde tabel beperkt tot abonnementsresources, en met `project` wordt alleen het oorspronkelijke veld _subscriptionId_ opgenomen en het veld _name_ met de naam gewijzigd in _SubName_. De naam van het veld wordt voor komen dat `join` het wordt toegevoegd als _NAME1_ omdat het veld al in _resources_bestaat. De oorspronkelijke tabel wordt gefilterd met `where` en het volgende `project` bevat kolommen uit beide tabellen. Het query resultaat is een enkele sleutel kluis met het type, de naam van de sleutel kluis en de naam van het abonnement dat in wordt weer gegeven.
```kusto
Resources
| where type == 'microsoft.keyvault/vaults'
| join (ResourceContainers | where type=='microsoft.resources/subscriptions' | project SubName=name, subscriptionId) on subscriptionId
| project type, name, SubName
| limit 1
```
> [!NOTE]
> Als de `join` resultaten worden beperkt met `project` , moet de eigenschap die wordt gebruikt `join` om de twee tabellen te koppelen, _subscriptionId_ in het bovenstaande voor beeld zijn opgenomen in `project` .
## <a name="extended-properties-preview"></a><a name="extended-properties"></a>Uitgebreide eigenschappen (preview-versie)
Als _Preview_ -functie bevatten sommige resource typen in resource Graph aanvullende eigenschappen die betrekking hebben op het type dat kan worden opgevraagd naast de eigenschappen van Azure Resource Manager. Deze reeks waarden, ook wel _uitgebreide eigenschappen_genoemd, bestaat voor een ondersteund resource type in `properties.extended` . Gebruik de volgende query om te zien welke resource typen _uitgebreide eigenschappen_hebben:
```kusto
Resources
| where isnotnull(properties.extended)
| distinct type
| order by type asc
```
Voor beeld: het aantal virtuele machines ophalen op `instanceView.powerState.code` :
```kusto
Resources
| where type == 'microsoft.compute/virtualmachines'
| summarize count() by tostring(properties.extended.instanceView.powerState.code)
```
## <a name="resource-graph-custom-language-elements"></a>Aangepaste taal elementen van resource grafiek
### <a name="shared-query-syntax-preview"></a><a name="shared-query-syntax"></a>Gedeelde query syntaxis (preview-versie)
Een preview-functie is dat een [gedeelde query](../tutorials/create-share-query.md) rechtstreeks kan worden geopend in een resource Graph-query. Dit scenario maakt het mogelijk om standaard query's te maken als gedeelde query's en deze opnieuw te gebruiken. Gebruik de syntaxis om een gedeelde query binnen een resource Graph-query aan te roepen `{{shared-query-uri}}` . De URI van de gedeelde query is de _resource-id_ van de gedeelde query op de **instellingen** pagina voor die query. In dit voor beeld is onze gedeelde query-URI `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SharedQueries/providers/Microsoft.ResourceGraph/queries/Count VMs by OS` .
Deze URI verwijst naar het abonnement, de resource groep en de volledige naam van de gedeelde query waarnaar in een andere query moet worden verwezen. Deze query is hetzelfde als het bestand dat u hebt gemaakt in [zelf studie: een query maken en delen](../tutorials/create-share-query.md).
> [!NOTE]
> U kunt geen query opslaan die verwijst naar een gedeelde query als een gedeelde query.
Voor beeld 1: alleen de gedeelde query gebruiken
De resultaten van deze resource grafiek query zijn hetzelfde als de query die in de gedeelde query is opgeslagen.
```kusto
{{/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SharedQueries/providers/Microsoft.ResourceGraph/queries/Count VMs by OS}}
```
Voor beeld 2: de gedeelde query opnemen als onderdeel van een grotere query
Deze query gebruikt eerst de gedeelde query en gebruikt deze `limit` om de resultaten verder te beperken.
```kusto
{{/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SharedQueries/providers/Microsoft.ResourceGraph/queries/Count VMs by OS}}
| where properties_storageProfile_osDisk_osType =~ 'Windows'
```
## <a name="supported-kql-language-elements"></a>Ondersteunde KQL-taal elementen
Resource grafiek ondersteunt een subset van KQL- [gegevens typen](/azure/kusto/query/scalar-data-types/), [scalaire functies](/azure/kusto/query/scalarfunctions), [scalaire Opera tors](/azure/kusto/query/binoperators)en [aggregatie functies](/azure/kusto/query/any-aggfunction). Specifieke [tabellaire Opera tors](/azure/kusto/query/queries) worden ondersteund door resource grafiek, waarvan sommige verschillende gedragingen hebben.
### <a name="supported-tabulartop-level-operators"></a>Ondersteunde Opera tors voor tabellaire/hoogste niveau
Hier volgt een lijst met KQL-Opera tors die worden ondersteund door resource grafiek met specifieke voor beelden:
|KQL |Voorbeeld query resource grafiek |Notities |
|---|---|---|
|[aantal](/azure/kusto/query/countoperator) |[Sleutel kluizen tellen](../samples/starter.md#count-keyvaults) | |
|[distinct](/azure/kusto/query/distinctoperator) |[Afzonderlijke waarden voor een specifieke alias tonen](../samples/starter.md#distinct-alias-values) | |
|[uitbreidbaar](/azure/kusto/query/extendoperator) |[Virtuele machines tellen op type besturingssysteem](../samples/starter.md#count-os) | |
|[Jointypen](/azure/kusto/query/joinoperator) |[Sleutel kluis met de naam van het abonnement](../samples/advanced.md#join) |Ondersteunde jointypen: [innerunique](/azure/kusto/query/joinoperator#default-join-flavor), [inner](/azure/kusto/query/joinoperator#inner-join), [leftouter](/azure/kusto/query/joinoperator#left-outer-join). De limiet van 3 `join` in één query. Aangepaste deelname strategieën, zoals broadcast toevoegen, zijn niet toegestaan. Kan worden gebruikt binnen één tabel of tussen de tabellen _resources_ en _ResourceContainers_ . |
|[ondergrens](/azure/kusto/query/limitoperator) |[Een lijst van alle openbare IP-adressen weergeven](../samples/starter.md#list-publicip) |Synoniem van `take` . Werkt niet met [overs Laan](./work-with-data.md#skipping-records). |
|[mvexpand](/azure/kusto/query/mvexpandoperator) | | Verouderde operator `mv-expand` . gebruik in plaats daarvan. _RowLimit_ maximum van 400. De standaard waarde is 128. |
|[MV-uitvouwen](/azure/kusto/query/mvexpandoperator) |[Een lijst met Cosmos DB met specifieke schrijflocaties weergeven](../samples/advanced.md#mvexpand-cosmosdb) |_RowLimit_ maximum van 400. De standaard waarde is 128. |
|[ter](/azure/kusto/query/orderoperator) |[Een lijst van resources weergeven, gesorteerd op naam](../samples/starter.md#list-resources) |Synoniem van `sort` |
|[project](/azure/kusto/query/projectoperator) |[Een lijst van resources weergeven, gesorteerd op naam](../samples/starter.md#list-resources) | |
|[project-weg](/azure/kusto/query/projectawayoperator) |[Kolommen verwijderen uit resultaten](../samples/advanced.md#remove-column) | |
|[acties](/azure/kusto/query/sortoperator) |[Een lijst van resources weergeven, gesorteerd op naam](../samples/starter.md#list-resources) |Synoniem van `order` |
|[samenvatten](/azure/kusto/query/summarizeoperator) |[Azure-resources tellen](../samples/starter.md#count-resources) |Alleen de eerste vereenvoudigde pagina |
|[take](/azure/kusto/query/takeoperator) |[Een lijst van alle openbare IP-adressen weergeven](../samples/starter.md#list-publicip) |Synoniem van `limit` . Werkt niet met [overs Laan](./work-with-data.md#skipping-records). |
|[top](/azure/kusto/query/topoperator) |[De eerste vijf virtuele machines weergeven op naam en met hun type besturingssysteem](../samples/starter.md#show-sorted) | |
|[Réunion](/azure/kusto/query/unionoperator) |[Resultaten van twee query's combineren tot één resultaat](../samples/advanced.md#unionresults) |Eén tabel _toegestaan:_ `| union` \[ `kind=` `inner` \| `outer` \] \[ `withsource=` _ColumnName_ \] _tabel kolom naam_. Maxi maal drie `union` zijden in één query. Het is niet toegestaan om de tabel met fuzzy op te lossen `union` . Kan worden gebruikt binnen één tabel of tussen de tabellen _resources_ en _ResourceContainers_ . |
|[positie](/azure/kusto/query/whereoperator) |[Resources weergeven die opslag bevatten](../samples/starter.md#show-storage) | |
## <a name="query-scope"></a>Querybereik
Het bereik van de abonnementen waaruit resources worden geretourneerd door een query is afhankelijk van de methode voor toegang tot de resource grafiek. Azure CLI en Azure PowerShell vullen de lijst met abonnementen die in de aanvraag moeten worden meegenomen op basis van de context van de geautoriseerde gebruiker. De lijst met abonnementen kan hand matig worden gedefinieerd voor elk met de **abonnementen** en **abonnements** parameters.
In REST API en alle andere Sdk's moet de lijst met abonnementen waaruit resources moeten worden opgenomen, expliciet worden gedefinieerd als onderdeel van de aanvraag.
Als **Preview**voegt rest API versie `2020-04-01-preview` een eigenschap toe om de query aan een [beheer groep](../../management-groups/overview.md)toe te voegen. Met deze preview-API wordt de abonnements eigenschap ook optioneel gemaakt. Als er geen beheer groep of abonnements lijst is gedefinieerd, is het query bereik alle resources, waaronder [Azure Lighthouse](../../../lighthouse/concepts/azure-delegated-resource-management.md) gedelegeerde resources, waartoe de geverifieerde gebruiker toegang heeft. De nieuwe `managementGroupId` eigenschap neemt de beheer groep-ID in, die verschilt van de naam van de beheer groep. Wanneer `managementGroupId` is opgegeven, worden resources van de eerste 5000-abonnementen in of onder de opgegeven beheer groep-hiërarchie opgenomen. `managementGroupId` kan niet worden gebruikt op hetzelfde moment als `subscriptions` .
Voor beeld: een query uitvoeren op alle resources binnen de hiërarchie van de beheer groep met de naam ' My-beheer groep ' met ID ' myMG '.
- REST API-URI
```http
POST https://management.azure.com/providers/Microsoft.ResourceGraph/resources?api-version=2020-04-01-preview
```
- Aanvraagtekst
```json
{
"query": "Resources | summarize count()",
"managementGroupId": "myMG"
}
```
## <a name="escape-characters"></a>Escape tekens
Sommige eigenschapnamen van eigenschappen, zoals die `.` van een or `$` , moeten in de query worden verpakt of worden geescaped of de naam van de eigenschap wordt onjuist geïnterpreteerd en levert niet de verwachte resultaten op.
- `.` -Laat de naam van de eigenschap als volgt teruglopen: `['propertyname.withaperiod']`
Voorbeeld query waarmee de eigenschap _odata. type_wordt geterugloopd:
```kusto
where type=~'Microsoft.Insights/alertRules' | project name, properties.condition.['odata.type']
```
- `$` -Escape het teken in de naam van de eigenschap. Welk escape teken wordt gebruikt, is afhankelijk van de resource grafiek van de shell wordt uitgevoerd vanaf.
- **bash** - `\`
Voorbeeld query waarmee het eigenschaps _ \$ type_ wordt verescapet in bash:
```kusto
where type=~'Microsoft.Insights/alertRules' | project name, properties.condition.\$type
```
- **cmd** : laat het teken onescape `$` .
- **Zo** - ``` ` ```
Voorbeeld query waarmee het eigenschaps _ \$ type_ in Power shell wordt geescapet:
```kusto
where type=~'Microsoft.Insights/alertRules' | project name, properties.condition.`$type
```
## <a name="next-steps"></a>Volgende stappen
- Zie de taal die wordt gebruikt in [Starter-query's](../samples/starter.md).
- Zie [Geavanceerde query's](../samples/advanced.md) voor geavanceerde gebruikswijzen.
- Lees meer over het [verkennen van resources](explore-resources.md).
| 76.965347
| 864
| 0.782209
|
nld_Latn
| 0.995861
|
4501b5c7a5a26f65ba065b73a2a75493ca6a340d
| 25
|
md
|
Markdown
|
README.md
|
solomonxie/lambda-application-demo
|
35ac5e17985cdd5694eb154b527d3942ad52cad6
|
[
"MIT"
] | null | null | null |
README.md
|
solomonxie/lambda-application-demo
|
35ac5e17985cdd5694eb154b527d3942ad52cad6
|
[
"MIT"
] | null | null | null |
README.md
|
solomonxie/lambda-application-demo
|
35ac5e17985cdd5694eb154b527d3942ad52cad6
|
[
"MIT"
] | null | null | null |
# lambda-application-demo
| 25
| 25
| 0.84
|
eng_Latn
| 0.225686
|
4501edbfab786673deeafdb1ca56ee395de042c8
| 109
|
md
|
Markdown
|
_posts/0000-01-02-Reuben-Dev.md
|
Reuben-Dev/github-slideshow
|
756a5893a7a622701c8cebcc527539df3934d933
|
[
"MIT"
] | null | null | null |
_posts/0000-01-02-Reuben-Dev.md
|
Reuben-Dev/github-slideshow
|
756a5893a7a622701c8cebcc527539df3934d933
|
[
"MIT"
] | 3
|
2020-03-27T20:51:36.000Z
|
2020-03-28T12:21:41.000Z
|
_posts/0000-01-02-Reuben-Dev.md
|
Reuben-Dev/github-slideshow
|
756a5893a7a622701c8cebcc527539df3934d933
|
[
"MIT"
] | null | null | null |
---
layout: slide
title: "Welcome to Reuben's second slide!"
---
Reubens text
Use the left arrow to go back!
| 15.571429
| 42
| 0.706422
|
eng_Latn
| 0.972384
|
45023130b4612567b6a2987d861e1caaf3103447
| 261
|
md
|
Markdown
|
CHANGELOG.md
|
romicampi/wireframe
|
dc0055c2511ddb2fa2f6de732385f6f5c6be6003
|
[
"BSD-3-Clause"
] | 686
|
2015-01-01T04:43:47.000Z
|
2022-03-29T11:56:49.000Z
|
CHANGELOG.md
|
onursarikaya/wireframe
|
dc0055c2511ddb2fa2f6de732385f6f5c6be6003
|
[
"BSD-3-Clause"
] | 3
|
2017-08-02T12:15:05.000Z
|
2018-02-28T01:05:18.000Z
|
CHANGELOG.md
|
onursarikaya/wireframe
|
dc0055c2511ddb2fa2f6de732385f6f5c6be6003
|
[
"BSD-3-Clause"
] | 74
|
2015-01-20T04:29:48.000Z
|
2020-11-12T18:03:56.000Z
|
Change Log
==========
0.2.0 (2014-12-12)
------------------
- Only use 1 Helvetica Font in the file.
- Reorganize Symbols.
- Edit some inconsistent element.
- Fix some typos in Symbol name.
0.1.0 (2014-12-05)
------------------
The first milestone release
| 15.352941
| 40
| 0.586207
|
eng_Latn
| 0.853754
|
4502807a5b341b0835aca07638777d9759ef5d62
| 5,035
|
md
|
Markdown
|
tutorials/ko/foundation/8.0/digital-app-builder/installation/index.md
|
MobileFirst-Platform-Developer-Center/DevCenter
|
ac2351ef8878ff5101f0041323b68f3418b059e6
|
[
"Apache-2.0"
] | 17
|
2016-07-07T07:24:22.000Z
|
2022-01-21T07:19:10.000Z
|
tutorials/ko/foundation/8.0/digital-app-builder/installation/index.md
|
Acidburn0zzz/DevCenter-1
|
ac2351ef8878ff5101f0041323b68f3418b059e6
|
[
"Apache-2.0"
] | 49
|
2016-04-01T07:13:23.000Z
|
2022-03-08T11:28:04.000Z
|
tutorials/ko/foundation/8.0/digital-app-builder/installation/index.md
|
Acidburn0zzz/DevCenter-1
|
ac2351ef8878ff5101f0041323b68f3418b059e6
|
[
"Apache-2.0"
] | 36
|
2016-07-07T07:24:27.000Z
|
2022-01-05T13:40:34.000Z
|
---
layout: tutorial
title: 설치 및 구성
weight: 2
show_children: true
---
<!-- NLS_CHARSET=UTF-8 -->
## 개요
{: #installation-and-configuration }
Digital App Builder는 MacOS 및 Windows 플랫폼에 설치될 수 있습니다. 설치는 또한 첫 번째 설치 중에 설치되고 확인된 필수 소프트웨어를 포함합니다. 배치 중에 앱 미리보기 및 어댑터 생성을 위해 Java, Xcode 및 Android Studio를 설치하십시오.
### MacOS에 설치
{: #installing-on-macos }
1. [IBM Passport Advantage](https://www.ibm.com/software/passportadvantage/) 또는 [여기](https://github.com/MobileFirst-Platform-Developer-Center/Digital-App-Builder/releases)에서 .dmg(**IBM.Digital.App.Builder-n.n.n.dmg**, 여기서`n.n.n`은 버전 번호임)를 다운로드하십시오.
2. .dmg 파일을 두 번 클릭하여 설치 프로그램을 마운트하십시오.
3. 설치 프로그램이 열리는 창에서 IBM Digital App Builder를 **애플리케이션** 폴더에 끌어서 놓기하십시오.
4. IBM Digital App Builder 아이콘 또는 실행 파일을 두 번 클릭하여 Digital App Builder를 여십시오.
>**참고**: Digital App Builder가 처음으로 설치되면 Digital App Builder는 인터페이스를 열어 필수 소프트웨어를 설치합니다. Digital App Builder의 이전 버전이 존재하는 경우, 필수 소프트웨어 검사가 수행되며 필수 소프트웨어를 충족하기 위해 일부 소프트웨어를 업그레이드 또는 다운그레이드해야 할 수 있습니다.
>버전 8.0.6부터 설치 프로그램에 Mobile Foundation 개발 서버가 포함됩니다. 설치 중에 개발 서버가 다른 필수 소프트웨어와 함께 설치됩니다. 개발 서버의 라이프사이클(예: 서버 시작/중지)이 Digital App Builder 내에서 처리됩니다.

5. **설정 시작**을 클릭하십시오. 그러면 라이센스 계약 화면이 표시됩니다.

6. 라이센스 계약에 동의하고 **다음**을 클릭하십시오. 그러면 **필수 소프트웨어 설치** 화면이 표시됩니다.
>**참고**: 필수 소프트웨어가 이미 설치되어 있는지 여부를 확인하기 위해 검사가 수행되고 각각에 대해 상태가 표시됩니다.

7. 필수 소프트웨어가 **설치 예정** 상태에 있는 경우 **설치**를 클릭하여 필수 소프트웨어를 설치하십시오.

8. *선택사항* - 필수 소프트웨어를 설치한 이후, Digital App Builder에서 데이터 세트 관련 작업을 위해 JAVA가 필요하므로 설치 프로그램이 JAVA를 확인합니다.
>**참고**: 아직 설치되지 않았으면 Java의 수동 설치가 필요할 수 있습니다. Java 설치를 위해 [Java 설치](https://www.java.com/en/download/help/download_options.xml)를 참조하십시오.
9. 필수 소프트웨어를 설치한 후에는 Digital App Builder 스타트업 화면이 표시됩니다. **빌드 시작**을 클릭하십시오.

10. *선택사항* - 또한 설치 프로그램은 Xcode(MacOS에만 해당되며, 배치 중에 iOS 시뮬레이터에서 앱 미리보기를 위함) 및 Android Studio(MacOS 및 Windows의 경우, Android 앱 미리보기를 위함)의 선택적 설치도 확인합니다.
>**참고**: Xcode 및 Android Studio의 수동 설치가 필요할 수 있습니다. Cocoapods 설치의 경우 [CocoaPods 사용](https://guides.cocoapods.org/using/using-cocoapods)을 참조하십시오. Android Studio 설치의 경우 [Android Studio 설치](https://developer.android.com/studio/)를 참조하십시오.
>**참고**: 지정된 시점에 [필수 소프트웨어 확인](#prerequisites-check)을 수행하여 설치가 앱 개발에 적합한지 확인할 수 있습니다. 오류의 경우 앱을 작성하기 전에 오류를 수정하고 Digital App Builder를 다시 시작하십시오.
### Windows에 설치
{: #installing-on-windows }
1. [IBM Passport Advantage](https://www.ibm.com/software/passportadvantage/) 또는 [여기](https://github.com/MobileFirst-Platform-Developer-Center/Digital-App-Builder/releases)에서 .exe(**IBM.Digital.App.Builder.Setup.n.n.n.exe**, 여기서 `n.n.n`은 버전 번호임)를 다운로드하십시오.
2. 관리 모드에서 다운로드된 실행 파일(**IBM.Digital.App.Builder.Setup.n.n.n.exe**)을 실행하십시오.
>**참고**: Digital App Builder가 처음으로 설치되면 Digital App Builder는 인터페이스를 열어 필수 소프트웨어를 설치합니다. Digital App Builder의 이전 버전이 존재하는 경우, 필수 소프트웨어 검사가 수행되며 필수 소프트웨어를 충족하기 위해 일부 소프트웨어를 업그레이드 또는 다운그레이드해야 할 수 있습니다.
>버전 8.0.6부터 설치 프로그램에 Mobile Foundation 개발 서버가 포함됩니다. 설치 중에 개발 서버가 다른 필수 소프트웨어와 함께 설치됩니다. 개발 서버의 라이프사이클(예: 서버 시작/중지)이 Digital App Builder 내에서 처리됩니다.

3. **설정 시작**을 클릭하십시오. 그러면 라이센스 계약 화면이 표시됩니다.

4. 라이센스 계약에 동의하고 **다음**을 클릭하십시오. 그러면 **필수 소프트웨어 설치** 화면이 표시됩니다.
>**참고**: 필수 소프트웨어가 이미 설치되어 있는지 여부를 확인하기 위해 검사가 수행되고 각각에 대해 상태가 표시됩니다.

5. 필수 소프트웨어가 **설치 예정** 상태에 있는 경우 **설치**를 클릭하여 필수 소프트웨어를 설치하십시오.

6. *선택사항* - 필수 소프트웨어를 설치한 후 Digital App Builder에서는 데이터 세트 관련 작업을 위해 JAVA가 필요하므로 설치 프로그램이 JAVA를 확인합니다.
>**참고**: 아직 설치되지 않았으면 Java의 수동 설치가 필요할 수 있습니다. Java 설치를 위해 [Java 설치](https://www.java.com/en/download/help/download_options.xml)를 참조하십시오.
7. 필수 소프트웨어를 설치한 후 Digital App Builder 스타트업 화면이 표시됩니다. **빌드 시작**을 클릭하십시오.

>**참고**: 데스크탑의 **시작 > 프로그램**에도 바로가기가 작성됩니다. 기본 설치 폴더는 `<AppData>\Local\IBMDigitalAppBuilder\app-8.0.3`입니다.
8. *선택사항* - 설치 프로그램은 또한 Xcode(MacOS의 경우 배치 중에 iOS 시뮬레이터에서 앱 미리보기) 및 Android Studio(MacOS 및 Windows의 경우 Android 앱 미리보기)의 선택적 설치를 확인합니다.
>**참고**: Android Studio를 수동으로 설치하십시오. Android Studio 설치의 경우 [Android Studio 설치](https://developer.android.com/studio/)를 참조하십시오.
>**참고**: 지정된 시점에 [필수 소프트웨어 확인](#prerequisites-check)을 수행하여 설치가 앱 개발에 적합한지 확인할 수 있습니다. 오류의 경우 앱을 작성하기 전에 오류를 수정하고 Digital App Builder를 다시 시작하십시오.
### 필수 소프트웨어 확인
{: #prerequisites-check }
앱을 개발하기 전에 **도움말 > 필수 소프트웨어 확인**을 선택하여 필수 소프트웨어 확인을 수행하십시오.

오류의 경우 앱을 작성하기 전에 오류를 수정하고 Digital App Builder를 다시 시작하십시오.
>**참고**: [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods)는 MacOS에만 필요합니다.
| 50.858586
| 256
| 0.695929
|
kor_Hang
| 1.00001
|
450327f0aa47f305fd9adad1cf4984ec07d44b4a
| 10,381
|
md
|
Markdown
|
docs/standard/microservices-architecture/multi-container-microservice-net-applications/test-aspnet-core-services-web-apps.md
|
dhernandezb/docs.es-es
|
cf1637e989876a55eb3c57002818d3982591baf1
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
docs/standard/microservices-architecture/multi-container-microservice-net-applications/test-aspnet-core-services-web-apps.md
|
dhernandezb/docs.es-es
|
cf1637e989876a55eb3c57002818d3982591baf1
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
docs/standard/microservices-architecture/multi-container-microservice-net-applications/test-aspnet-core-services-web-apps.md
|
dhernandezb/docs.es-es
|
cf1637e989876a55eb3c57002818d3982591baf1
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
---
title: Probar aplicaciones web y servicios ASP.NET Core
description: Arquitectura de microservicios de .NET para aplicaciones .NET en contenedor | Probar aplicaciones web y servicios ASP.NET Core
author: CESARDELATORRE
ms.author: wiwagn
ms.date: 12/11/2017
ms.openlocfilehash: 2702a273ade0e58ba93d556cfd1ecc5531027f93
ms.sourcegitcommit: fb78d8abbdb87144a3872cf154930157090dd933
ms.translationtype: HT
ms.contentlocale: es-ES
ms.lasthandoff: 09/28/2018
ms.locfileid: "47232864"
---
# <a name="testing-aspnet-core-services-and-web-apps"></a>Probar aplicaciones web y servicios ASP.NET Core
Los controladores son una parte fundamental de cualquier servicio de la API de ASP.NET Core y de la aplicación web de ASP.NET MVC. Por lo tanto, debe tener la seguridad de que se comportan según lo previsto en la aplicación. Las pruebas automatizadas pueden darle esta seguridad, así como detectar errores antes de que lleguen a la fase producción.
Debe probar cómo se comporta el controlador según las entradas válidas o no válidas y probar las respuestas del controlador en función del resultado de la operación comercial que lleve a cabo. Pero debe realizar estos tipos de pruebas en los microservicios:
- Pruebas unitarias. Esto garantiza que los componentes individuales de la aplicación funcionan según lo previsto. Las aserciones prueban la API del componente.
- Pruebas de integración. Esto garantiza que las interacciones del componente funcionen según lo previsto con los artefactos externos como bases de datos. Las aserciones pueden poner a prueba la API del componente, la interfaz de usuario o los efectos secundarios de acciones como la E/S de la base de datos, el registro, etc.
- Pruebas funcionales para cada microservicio. Esto garantiza que la aplicación funcione según lo esperado desde la perspectiva del usuario.
- Pruebas de servicio. Esto garantiza que se pongan a prueba todos los casos de uso de servicio de un extremo a otro, incluidas pruebas de servicios múltiples al mismo tiempo. Para este tipo de prueba, primero debe preparar el entorno. En este caso, esto significa iniciar los servicios (por ejemplo, mediante el uso de Docker Compose).
### <a name="implementing-unit-tests-for-aspnet-core-web-apis"></a>Implementación de pruebas unitarias para las API web de ASP.NET Core
Las pruebas unitarias conllevan probar una parte de una aplicación de forma aislada con respecto a su infraestructura y dependencias. Cuando se realizan pruebas unitarias de la lógica de controlador, solo se comprueba el método o el contenido de una única acción, no el comportamiento de sus dependencias o del marco en sí. Con todo, las pruebas unitarias no detectan problemas de interacción entre componentes; este es el propósito de las pruebas de integración.
Cuando realice pruebas unitarias de sus acciones de controlador, asegúrese de centrarse solamente en su comportamiento. Una prueba unitaria de controlador evita tener que recurrir a elementos como los filtros, el enrutamiento o el enlace de modelos. Como se centran en comprobar solo una cosa, las pruebas unitarias suelen ser fáciles de escribir y rápidas de ejecutar. Un conjunto de pruebas unitarias bien escrito se puede ejecutar con frecuencia sin demasiada sobrecarga.
Las pruebas unitarias se implementan en función de los marcos de pruebas como xUnit.net, MSTest, Moq o NUnit. En la aplicación de ejemplo eShopOnContainers, se usa XUnit.
Al escribir una prueba unitaria para un controlador de API web, puede ejemplificar directamente la clase de controlador mediante la nueva palabra clave en C\#, para que la prueba se ejecute tan rápido como sea posible. En el ejemplo siguiente se muestra cómo hacerlo con [XUnit](https://xunit.github.io/) como marco de pruebas.
```csharp
[Fact]
public void Add_new_Order_raises_new_event()
{
// Arrange
var street = " FakeStreet ";
var city = "FakeCity";
// Other variables omitted for brevity ...
// Act
var fakeOrder = new Order(new Address(street, city, state, country, zipcode),
cardTypeId, cardNumber,
cardSecurityNumber, cardHolderName,
cardExpiration);
// Assert
Assert.Equal(fakeOrder.DomainEvents.Count, expectedResult);
}
```
### <a name="implementing-integration-and-functional-tests-for-each-microservice"></a>Implementación de pruebas funcionales y de integración para cada microservicio
Como se ha indicado, las pruebas funcionales y de integración tienen objetivos y propósitos diferentes. Pero la forma de implementarlas para probar los controladores de ASP.NET Core es similar, por lo que en esta sección nos centraremos en las pruebas de integración.
Las pruebas de integración garantizan que los componentes de una aplicación funcionen correctamente durante el ensamblaje. ASP.NET Core admite las pruebas de integración que usan marcos de pruebas unitarias y un host de web de prueba integrado que puede usarse para controlar las solicitudes sin sobrecargar la red.
A diferencia de las pruebas unitarias, las pruebas de integración suelen incluir problemas de infraestructura de la aplicación, como base de datos, sistema de archivos, recursos de red o solicitudes web, y sus respuestas. Para las pruebas unitarias se usan emulaciones u objetos ficticios en lugar de estos problemas. Pero el propósito de las pruebas de integración es confirmar que el sistema funciona según lo previsto con estos sistemas, por lo que para las pruebas de integración no se usan simulaciones ni objetos ficticios. En cambio, se incluye la infraestructura, como el acceso a la base de datos o la invocación del servicio desde otros servicios.
Como las pruebas de integración usan segmentos de código más grandes que las pruebas unitarias y dependen de los elementos de infraestructura, tienden a ser órdenes de envergadura, más lentas que las pruebas unitarias. Por lo tanto, es conveniente limitar el número de pruebas de integración que va a escribir y a ejecutar.
ASP.NET Core incluye un host de web de prueba integrado que puede usarse para controlar las solicitudes HTTP sin causar una sobrecarga en la red, lo que significa que puede ejecutar dichas pruebas más rápidamente si usa un host de web real. El host de web de prueba está disponible en un componente NuGet como Microsoft.AspNetCore.TestHost. Se puede agregar a proyectos de prueba de integración y utilizarlo para hospedar aplicaciones de ASP.NET Core.
Como puede ver en el código siguiente, al crear pruebas de integración para controladores de ASP.NET Core, los controladores se ejemplifican a través del host de prueba. Esto se puede comparar a una solicitud HTTP, pero se ejecuta con mayor rapidez.
```csharp
public class PrimeWebDefaultRequestShould
{
private readonly TestServer _server;
private readonly HttpClient _client;
public PrimeWebDefaultRequestShould()
{
// Arrange
_server = new TestServer(new WebHostBuilder()
.UseStartup<Startup>());
_client = _server.CreateClient();
}
[Fact]
public async Task ReturnHelloWorld()
{
// Act
var response = await _client.GetAsync("/");
response.EnsureSuccessStatusCode();
var responseString = await response.Content.ReadAsStringAsync();
// Assert
Assert.Equal("Hello World!", responseString);
}
}
```
#### <a name="additional-resources"></a>Recursos adicionales
- **Steve Smith. Testing controllers** (ASP.NET Core) (Probar controladores [ASP.NET Core])[*https://docs.microsoft.com/aspnet/core/mvc/controllers/testing*](/aspnet/core/mvc/controllers/testing)
- **Steve Smith. Integration testing** (ASP.NET Core) (Pruebas de integración [ASP.NET Core])[*https://docs.microsoft.com/aspnet/core/test/integration-tests*](/aspnet/core/test/integration-tests)
- **Unit testing in .NET Core using dotnet test (Pruebas unitarias de .NET Core con dotnet test)**
[*https://docs.microsoft.com/dotnet/core/testing/unit-testing-with-dotnet-test*](../../../core/testing/unit-testing-with-dotnet-test.md)
- **xUnit.net**. Sitio oficial.
[*https://xunit.github.io/*](https://xunit.github.io/)
- **Conceptos básicos de prueba unitaria**
[*https://msdn.microsoft.com/library/hh694602.aspx*](https://msdn.microsoft.com/library/hh694602.aspx)
- **Moq**. Repositorio de GitHub.
[*https://github.com/moq/moq*](https://github.com/moq/moq)
- **NUnit**. Sitio oficial.
[*https://www.nunit.org/*](https://www.nunit.org/)
### <a name="implementing-service-tests-on-a-multi-container-application"></a>Implementación de pruebas de servicio en una aplicación con varios contenedores
Como se indicó anteriormente, al probar aplicaciones con varios contenedores, todos los microservicios deben ejecutarse en el host de Docker o en un clúster de contenedor. Las pruebas de servicio de un extremo a otro que incluyen varias operaciones que implican varios microservicios requieren que implemente e inicie la aplicación en el host de Docker mediante la ejecución de Docker Compose (o un mecanismo comparable si usa un orquestador). Cuando la aplicación y todos sus servicios se estén ejecutando, podrá ejecutar pruebas funcionales y de integración de un extremo a otro.
Puede usar diferentes enfoques. En el archivo docker-compose.yml que va a usar para implementar la aplicación (o en archivos similares, como docker-compose.ci.build.yml), en el nivel de solución puede expandir el punto de entrada para usar la [prueba de dotnet](../../../core/tools/dotnet-test.md). También puede usar otro archivo de composición que ejecute las pruebas en la imagen de destino. Si utiliza otro archivo de composición para las pruebas de integración, que incluyan sus microservicios y bases de datos en contenedores, puede comprobar que los datos relacionados siempre se restablecen a su estado original antes de ejecutar las pruebas.
Si ejecuta Visual Studio, cuando la aplicación de redacción esté en funcionamiento, podrá aprovechar los puntos de interrupción y las excepciones. También podrá ejecutar las pruebas de integración automáticamente en la canalización de integración continua en Azure DevOps Services o en cualquier otro sistema de integración continua o de entrega continua que admita los contenedores de Docker.
>[!div class="step-by-step"]
[Anterior](subscribe-events.md)
[Siguiente](../microservice-ddd-cqrs-patterns/index.md)
| 80.472868
| 657
| 0.783354
|
spa_Latn
| 0.985947
|
450467280c4021cce4aa02458375be130bc23548
| 668
|
md
|
Markdown
|
.github/ISSUE_TEMPLATE.md
|
ajavadia/qiskit-ignis
|
c03d1bd22f49f461e7f3112cb8b854e92f6d961f
|
[
"Apache-2.0"
] | null | null | null |
.github/ISSUE_TEMPLATE.md
|
ajavadia/qiskit-ignis
|
c03d1bd22f49f461e7f3112cb8b854e92f6d961f
|
[
"Apache-2.0"
] | null | null | null |
.github/ISSUE_TEMPLATE.md
|
ajavadia/qiskit-ignis
|
c03d1bd22f49f461e7f3112cb8b854e92f6d961f
|
[
"Apache-2.0"
] | null | null | null |
<!-- ⚠️ If you do not respect this template, your issue will be closed -->
<!-- ⚠️ Make sure to browse the opened and closed issues -->
*BUG TEMPLATE* <!-- Delete this header from your issue -->
### Informations
- **Qiskit Ignis version**:
- **Python version**:
- **Operating system**:
### What is the current behavior?
### Steps to reproduce the problem
### What is the expected behavior?
### Suggested solutions
---
*FEATURE REQUEST TEMPLATE* <!-- Delete this header from your issue -->
### What is the expected behavior?
---
*ENHANCEMENT REQUEST TEMPLATE* <!-- Delete this header from your issue -->
### What is the expected enhancement?
| 15.534884
| 75
| 0.658683
|
eng_Latn
| 0.993476
|
4504913c7414bed6a6a79fed2891032a60d6b3d1
| 13,870
|
md
|
Markdown
|
CONTRIBUTING.md
|
XxPKBxX/guide
|
981202f7b0b9867aaa5f4dd0ef63e2289ae3d431
|
[
"MIT"
] | null | null | null |
CONTRIBUTING.md
|
XxPKBxX/guide
|
981202f7b0b9867aaa5f4dd0ef63e2289ae3d431
|
[
"MIT"
] | null | null | null |
CONTRIBUTING.md
|
XxPKBxX/guide
|
981202f7b0b9867aaa5f4dd0ef63e2289ae3d431
|
[
"MIT"
] | null | null | null |
# Contributing
## Local development
Clone the repo into your desired folder, `cd` into it, and install the dependencies.
```bash
git clone https://github.com/discordjs/guide.git
cd guide
npm install
```
You can use `npm run dev` to open up a local version of the site at http://localhost:8080. If you need to use a different port, run it as `npm run dev -- --port=1234`.
### Linting
Remember to always lint your edits/additions before making a commit to ensure everything's lined up and consistent with the rest of the guide. We use ESLint and have a package.json script for linting both JS files and JS codeblocks inside Markdown files.
```bash
npm run lint
```
#### Caveats
There might come a time where a snippet will contain a parsing error, and ESLint won't be able to lint it properly. For example:
<!-- eslint-skip -->
```js
const sent = await message.channel.send('Hi!');
console.log(sent.content)
```
ESLint would error with `Parsing error: Unexpected token message` instead of letting you know that you're missing a semicolon. In this case, it's because of the use of `await` outside of an async function. In situations like this, after you've fixed any obvious errors, you can add an `<!-- eslint-skip -->` comment above the codeblock to have it ignored entirely by ESLint when running the lint script.
## Adding pages
To add a new page to the guide, create a `file-name.md` file inside the folder of your choice. If you want to link to `/dir/some-tutorial.html`, you would create a `some-tutorial.md` file inside a `dir` folder. [VuePress](https://github.com/vuejs/vuepress) will pick up on it and set up the routing appropriately.
With that being said, you will still need to add the link to the sidebar manually. Go to the `/guide/.vuepress/sidebar.js` file and insert a new item with the path to your newly created page.
## General guidelines
Because we want to keep everything as consistent and clean as possible, here are some guidelines we strongly recommend you try to follow when making a contribution.
### Spelling, grammar, and wording
Improper grammar, strange wording, and incorrect spelling are all things that may lead to confusion when a user reads a guide page. It's important to attempt to keep the content clear and consistent. Re-read what you've written and place yourself in the shoes of someone else for a moment to see if you can fully understand everything without any confusion.
Don't worry if you aren't super confident with your grammar/spelling/wording skills; all pull requests get thoroughly reviewed, and comments are left in areas that need to be fixed or could be done better/differently.
#### "You"/"your" instead of "we"/"our"
When explaining parts of a guide, it's recommended to use "you" instead of "we" in most situations. For example:
```diff
- To check our Node version, we can run `node -v`.
+ To check your Node version, you can run `node -v`.
- To delete a message, we can do: `message.delete();`
+ To delete a message, you can do: `message.delete();`
- Our final code should look like this: ...
+ Your final code should look like this: ...
- Before we can actually do this, we need to update our configuration file.
+ Before you can actually do this, you need to update your configuration file.
```
#### "We" instead of "I"
When referring to yourself, use "we" (as in "the writers of this guide") instead of "I". For example:
```diff
- If you don't already have this package installed, I would highly recommend doing so.
+ If you don't already have this package installed, we would highly recommend doing so.
# Valid alternative:
+ If you don't already have this package installed, it's highly recommended that you do so.
- In this section, I'll be covering how to do that really cool thing everyone's asking about.
+ In this section, we'll be covering how to do that really cool thing everyone's asking about.
```
### Inclusive language
Try to avoid gendered and otherwise non-inclusive language. Examples are:
- Whitelist -> Allowlist
- Blacklist -> Denylist
- Master/Slave -> Leader/follower, primary/replica, primary/secondary, primary/standby
- Gendered pronouns (e.g. he/him/his) -> They, them, their
- Gendered terms (e.g. guys) -> Folks, people
- Sanity check -> Quick check, confidence check, coherence check
- Dummy value -> Placeholder, sample value
### Paragraph structure
Tied in with the section above, try to keep things as neatly formatted as possible. If a paragraph gets long, split it up into multiple paragraphs so that it adds some spacing and is easier on the eyes.
#### Tips, warnings, and danger messages
If you have a tip to share with the reader, you can format them in a specific way so that it looks appealing and noticeable. The same goes for warning and "danger" messages.
```md
In this section, we'll be doing some stuff!
::: tip
You can do this stuff even faster if you do this cool thing listed in this tip!
:::
::: warning
Make sure you're on version 2.0.0 or above before trying this.
:::
::: danger
Be careful; this action is irreversible!
:::
```

### General styling
#### Spacing between entities
Even though this generally does not affect the actual output, you should space out your entities with a single blank line between them; it keeps the source code clean and easier to read. For example:
```md
## Section title
Here's an example of how you'd do that really cool thing:
```js
const { data } = request;
console.log(data);
```
And here's a sentence that would explain how that works, maybe.
::: tip
Here's where we'd tell you something even cooler than the really cool thing you just learned.
:::
::: warning
This is where we'd warn you about the possible issues that arise when using this method.
:::
```
#### Headers and sidebar links
Section headers and sidebar links should generally be short and right to the point. In terms of casing, it should be cased as if it were a regular sentence.
```diff
# Assuming the page is titled "Embeds"
- ## How To Make Inline Fields In An Embed
+ ## Inline fields
# Assuming the page is titled "Webhooks"
- ## Setting An Avatar On Your Webhook Client
+ ## Setting an avatar
```
#### References to code
When making references to pieces of code (e.g. variables, properties, etc.), place those references inside backticks. For example:
```md
After accessing the `.icon` property off of the `data` object, you can send that as a file to Discord.
---
If you want to change your bot's username, you can use the `ClientUser#setUsername` method.
```
References to class names should be capitalized, but remain outside of backticks. For example:
```md
Since `guild.members` returns a Collection, you can iterate over it with `.forEach()` or a `for...of` loop.
---
Since the `.delete()` method returns a Promise, you need to `await` it when inside a `try`/`catch` block.
```
#### Codeblock line highlighting
When you want to highlight a piece of code to display either an addition or a difference, use the `js {1-5,6-10}` syntax. For example (ignoring the `\`s):
```md
Here's our base code:
```js {2,6}
client.once('ready', () => {
console.log('Ready.');
});
client.on('messageCreate', message => {
console.log(message.content);
});
\```
To add this feature, use this code:
```js {2,6-8}
client.once('ready', () => {
console.log(`${client.user.tag} ready.`);
});
client.on('messageCreate', message => {
if (message.content === '!ping') {
message.channel.send('Pong.');
}
});
\```
```

This is VuePress' [codeblock line highlighting](https://vuepress.vuejs.org/guide/markdown.html#line-highlighting-in-code-blocks) feature. It's encouraged to use and preferred over diff codeblocks.
Do note the space between `js` and `{}`. This is necessary to not interfere with `eslint-plugin-markdown`, which would ignore the codeblock.
### Images and links
If you want to include an image in a page, the image you add should be saved to the repo itself instead of using external services. If you want to link to other sections of the guide, be sure to use relative paths instead of full URLs to the live site. For example:
```diff
- Here's what the final result would look like:
-
- 
-
- If you want to read more about this, you can check out the page on [that other cool stuff](https://discordjs.guide/#/some-really-cool-stuff).
+ Here's what the final result would look like:
+
+ 
+
+ If you want to read more about this, you can check out the page on [that other cool stuff](/some-really-cool-stuff).
```
Do note the `./images/*` syntax used. The `./` part refers to the file's corresponding image directory, which holds all the images used for that directory. When it comes to images, this syntax should always be used.
### Code samples
If you're writing a page that teaches the reader how to build something step-by-step, make sure to include the final piece of code in a file inside the `/code-samples` directory. The folder destination inside the `/code-samples` folder should match the destination inside the `/guide` folder. For example: `guide/foo/bar.md` -> `code-samples/foo/bar/index.js`.
```md
<!-- Inside /guide/foo/bar.md -->
## Resulting code
<!-- Will link to /code-samples/foo/bar/ -->
<ResultingCode />
```
`<ResultingCode />` is a helper component to generate a sentence and link to the proper directory on GitHub for that specific page. Should you need to overwrite the path, you can do so:
```md
<!-- Inside /guide/baz/README.md -->
## Resulting code
<!-- Will result in `/code-samples/baz/` -->
<ResultingCode />
<!-- Will result in `/code-samples/baz/getting-started/` -->
<ResultingCode path="baz/getting-started" />
```
### Displaying Discord messages
We use [@discord-message-components/vue](https://github.com/Danktuary/discord-message-components/blob/main/packages/vue/README.md) to display "fake" Discord messages on pages. The reason for this is to make it easy for you to create, easy for anyone in the future to edit, and avoid having to take screenshots and using too many images on a page at once. Here's a preview of the components:

The syntax to make this display is quite simple as well:
```html
<DiscordMessages>
<DiscordMessage profile="user">
!ping
</DiscordMessage>
<DiscordMessage profile="bot">
<DiscordMention :highlight="true" profile="user" />, pong! Took 250ms
</DiscordMessage>
<DiscordMessage author="Another User" avatar="green">
Pung!
</DiscordMessage>
</DiscordMessages>
```
These components are made with [Vue](https://vuejs.org/), but if you aren't familiar with Vue, don't worry about it. Just understand that you'll usually only need the `profile="user"`/`profile="bot"` attribute for the `<DiscordMessage>` component. All `<DiscordMessage>` components must be children of a single `<DiscordMessages>` component for it to display properly.
Do note the casing in `<DiscordMessages>` syntax instead of `<discord-messages>`. This is due to how VuePress renders markdown and HTML inside markdown files. It doesn't recognize `<discord-messages>` as an HTML element, therefore rendering anything indented inside it as a regular codeblock.
These components feature messages, mentions, embeds, interactions, and more. You can read more about how to use them by checking out [@discord-message-components/vue](https://github.com/Danktuary/discord-message-components/blob/main/packages/vue/README.md).
### discord.js documentation links
On pages where links to the discord.js documentation are used, you can use the `<DocsLink>` component. Since the discord.js documentation is split into different categories and branches, the component allows you to supply the necessary info accordingly. The only required prop is `path`.
```md
Main docs, branch version inherited from branch selector, `class/Client`:
<DocsLink path="class/Client">Link text</DocsLink>
<!-- Becomes: https://discord.js.org/#/docs/main/v11/class/Client -->
Main docs, stable branch (becomes "v12" due to the aliases set in `.vuepress/mixins/branches.js`), `class/Client`:
<DocsLink branch="stable" path="class/Client">Link text</DocsLink>
<!-- Becomes: https://discord.js.org/#/docs/main/v12/class/Client -->
Main docs, reply-prefix branch, `class/Client`:
<DocsLink section="main" branch="reply-prefix" path="class/Client">Link text</DocsLink>
<!-- Becomes: https://discord.js.org/#/docs/main/reply-prefix/class/Client -->
Collection docs, main branch (no `branch` prop set), `class/Collection?scrollTo=partition`:
<DocsLink section="collection" path="class/Collection?scrollTo=partition">Link text</DocsLink>
<!-- Becomes: https://discord.js.org/#/docs/collection/main/class/Collection?scrollTo=partition -->
```
If the `section` prop is set to `main` (or omitted) and the `branch` prop is omitted, the `branch` prop will default to the version the user has set via the site's branch selector dropdown and update accordingly. If `section` is set to anything else and `branch` is omitted, the `branch` prop will default to `'main'`.
### VScode snippets
To make your life with these custom elements a little bit easier we created some [project scoped VSC snippets](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_project-snippet-scope). If you are using [Visual Studio Code](https://code.visualstudio.com/) as your editor of choice you can access these by typing the key word and pressing `CTRL` + `Space` on your keyboard in the entire guide project. Please note, that the elements can become quite complex and we can not write examples for every small use case. Check the explanations above whenever you are unsure.
| 42.676923
| 578
| 0.741096
|
eng_Latn
| 0.993907
|
4505aa21d03f1f68bf888e4dfeb0fad0b9d889aa
| 1,102
|
md
|
Markdown
|
_talks/2018-05-31-Building-Model-Foctories-with-the-DataRobot-API.md
|
john-hawkins/john-hawkins.github.io
|
19955ee6d33dcb441a2c44d97bb383c32e8e3058
|
[
"MIT"
] | null | null | null |
_talks/2018-05-31-Building-Model-Foctories-with-the-DataRobot-API.md
|
john-hawkins/john-hawkins.github.io
|
19955ee6d33dcb441a2c44d97bb383c32e8e3058
|
[
"MIT"
] | null | null | null |
_talks/2018-05-31-Building-Model-Foctories-with-the-DataRobot-API.md
|
john-hawkins/john-hawkins.github.io
|
19955ee6d33dcb441a2c44d97bb383c32e8e3058
|
[
"MIT"
] | null | null | null |
---
title: "Building Model Factories with the DataRobot API"
collection: talks
type: "Talk"
permalink: /talks/2018-05-31-Building-Model-Foctories-with-the-DataRobot-API
venue: "Sydney Data Science Meet-Up"
date: 2018-05-31
location: "Sydney Australia"
---
In this Sydney Data Science Sponsored Meet-Up talk I gave an
introduction of the idea of Model Factories, discussing the history of
the idea and how it has lead to AutoML systems like DataRobot.
Ultimately enabling us to build new forms of automated ML systems.
I discuss the difficulties in deploying a fully automated model deployment system.
Describing the kinds of difficult model selection decisions that need to be converted
into an algorithm. I delve into several examples of business problems, and
discuss some of the related issues. I then describe how you can bootstrap
your way into developing effective Model Factories by using an
AutoML system like DataRobot.
Finally I share some coe examples of how to approach this use the DataRobot API.
[Event Link](https://www.meetup.com/en-AU/Data-Science-Sydney/events/250647801/)
| 42.384615
| 85
| 0.795826
|
eng_Latn
| 0.98007
|
45062b3a80d0b5cb88c6c9027464c9214e871af5
| 8,719
|
md
|
Markdown
|
README.md
|
ezzabuzaid/angular-caching
|
c193d90bd7d1da7f23b783abd3737fe5d4464401
|
[
"MIT"
] | null | null | null |
README.md
|
ezzabuzaid/angular-caching
|
c193d90bd7d1da7f23b783abd3737fe5d4464401
|
[
"MIT"
] | 7
|
2021-05-26T20:29:39.000Z
|
2021-06-04T10:44:36.000Z
|
README.md
|
ezzabuzaid/angular-caching
|
c193d90bd7d1da7f23b783abd3737fe5d4464401
|
[
"MIT"
] | null | null | null |
# Angular Caching
This article will take you through the way to efficiently handle the HTTP client request and cache them inside different browser storage.
For clarity about what I’m going to talk about, the full project is available to browse through [Github](https://github.com/ezzabuzaid/angular-caching).
So, Caching is a way to store data (response in our case) in storage to quickly access it later on.
There're many advantages of caching in general so I'll just point out some of what the Front End interested in
* Reduce the number of requests
* Improved responsiveness by retrieving the response immediately
### When to use
* Response that doesn't frequently change
* Request that the application addressing frequently
* Show some data while there's no internet connection to provide an offline experience
and there's a lot of other use cases and it all depends on your business case.
### Implementation
first of all, you need to run `npm install @ezzabuzaid/document-storage` , we will use this library to facilitate and unify different storage access, of course, you can use whatever you see suitable
declare an entry class that will represent the entry in the cache
``` typescript
/**
* class Represent the entry within the cache
*/
export class HttpCacheEntry {
constructor(
/**
* Request URL
*
* will be used as a key to associate it with the response
*/
public url: string,
/**
* the incoming response
*
* the value will be saved as a string and before fetching the data we will map it out to HttpResponse again
*/
public value: HttpResponse<any>,
/**
* Maximum time for the entry to stay in the cache
*/
public ttl: number
) { }
}
```
create an injection token to deal with dependency injection.
for our case, we need to register it for application-wide so we provide it in the root.
I'm using IndexedDB here but it's your call to choose.
``` typescript
export const INDEXED_DATABASE = new InjectionToken<AsyncDatabase>(
'INDEXED_DB_CACHE_DATABASE',
{
providedIn: 'root',
factory: () => new AsyncDatabase(new IndexedDB('cache'))
}
);
```
here is a list of available storages
1. LocalStorage
2. SessionStorage
3. IndexedDB
4. InMemory
5. WebSql
6. Cache API
7. Cookie
after setup the storage we need to implement the save and retrieve functionality
``` typescript
@Injectable({
providedIn: 'root'
})
export class HttpCacheHelper {
private collection: AsyncCollection<HttpCacheEntry> = null;
constructor(
@Inject(INDEXED_DATABASE) indexedDatabase: AsyncDatabase,
) {
// collection is a method the came from `document-storage` library to originze /
// the data in different namespaces, so here we defined 'CACHE' namespace to
// save all cache related things to it
// collection provide different method to store are retrive data
this.collection = indexedDatabase.collection('CACHE');
}
/**
*
* @param url: request URL including the path params
* @param value: the request-response
* @param ttl: the maximum time for the entry to stay in the cache before invalidating it
*
* Save the response in the cache for a specified time
*
*/
public set(url: string, value: HttpResponse<any>, ttl: number) {
return this.collection.set(new HttpCacheEntry(url, value, ttl));
}
/**
*
* @param url: request URL including the path params
*
* Retrieve the response from the cache database and map it to HttpResponse again.
*
* if TTL end, the response will be deleted and null will return
*/
public get(url: string) {
return from(this.collection.get((entry) => entry.url === url))
.pipe(
switchMap((entry) => {
if (entry && this.dateElapsed(entry.ttl ?? 0)) {
return this.invalidateCache(entry);
}
return of(entry);
}),
map(response => response && new HttpResponse(response.value)),
);
}
/**
* Clear out the entire cache database
*/
public clear() {
return this.collection.clear();
}
private invalidateCache(entry: Entity<HttpCacheEntry>) {
return this.collection.delete(entry.id).then(_ => null);
}
private dateElapsed(date: number) {
return date < Date.now();
}
}
```
all that you need now is to inject the `HttpCacheHelper` and use the `set` and `get` functions
we will use set and get functions later on in the interceptor as another layer to make the code clear as possible.
### Cache Invalidation
Imagine that the data is saved in storage and everything works as expected, but the server database has been updated, and eventually, you want to update the data in the browser storage to match what you have in the server.
there are different approaches to achieve this, like open WebSocket/SSE connection to notify the browser for an update, set an expiry time for your data (TTL) or by versioning your cache so when you change the version the old data became invalid
* TTL
Time To Live is a way to set the limited lifetime for a record so we can know in further when it will become a stall
it's implemented in the above example where we check if the TTL is expired
* Version key
We can replace the TTL with version key so instead of checking if the date elapsed we can check if the version changed
I can see two approaches
1. Using the version that specified in package.json
2. Retrieve version from API
e.g: the current version will be stored with the cache entry and whenever you fetch the data again you check if the version of the cache entry equal to the application version then you can either return the entry or delete it
for more clarification about how to deal with package json version I would suggest to read this [article](https://medium.com/@tolvaly.zs/how-to-version-number-angular-6-applications-4436c03a3bd3#:~:text=Briefly%3A%20we%20will%20import%20the, should%20already%20have%20these%20prerequisites).
* WebSocket/SSE
* On-Demand
Make the user responsible for fetching the latest data from the server
* Meta-Request
you can use head request for example to
### Usage
``` typescript
import { Injectable } from '@angular/core';
import { HttpClient, HttpResponse } from '@angular/common/http';
import { HttpCacheHelper, HttpCacheEntry } from './cache/cache.helper';
import { switchMap, tap } from 'rxjs/operators';
import { of } from 'rxjs';
@Injectable()
export class ExampleService {
constructor(
private httpClient: HttpClient,
private httpCacheHelper: HttpCacheHelper
) { }
getData() {
const url = '/endpoint-url';
// Check if there's data in the cache
this.httpCacheHelper.get(url)
.pipe(switchMap(response => {
// return the cached data if available
if (response) {
return of(response);
}
// fetch data from the server
return this.httpClient.get<HttpResponse<any>>(url, { observe: 'response' })
.pipe(tap((response) => {
// save the response in order to use it in subsequent requests
this.httpCacheHelper.set(url, response, 60);
}))
}));
}
}
```
First, we check if the data is in the cache and return if available, if not, we do call the backend to fetch the data then we save it in the cache to make it available in the subsequent calls
### Caching Strategy
there's a different way to decide how and when to fetch the data from client cache or server, like the one we implemented is called **Cache First** strategy
1. cache first
Implies that the cache has a higher priority to fetch data from
2. network first
As opposite, fetch data from the network and if an error occurred or no internet connection use cache as a fallback
* Please note that the above strategies work with **read** request*
also, there are ways to cache the read requests
e.g: you have a dashboard that tracks user movements and you don't need to submit every move, therefore you can save all the movement in the cache and after a certain time you submit it
I'm not going to explain caching for a written request, just know that it's possible.
Summary
1. Each store has it's own characteristics.
2. Cache invalidation is a must and you should always guarantee that you have the latest data.
Database just fancy name.
| 34.737052
| 291
| 0.686776
|
eng_Latn
| 0.995285
|
4506421544d3b0402827acafceac127a36af9cc8
| 3,460
|
md
|
Markdown
|
components/grids/tree/$info/props/default-template.md
|
ilysaz/odajs
|
f1347699c0dab42640409c725ea0ecb8b522dbcb
|
[
"MIT"
] | 1
|
2022-03-09T10:23:06.000Z
|
2022-03-09T10:23:06.000Z
|
components/grids/tree/$info/props/default-template.md
|
odajs/oda
|
a7fcfa7ec6bf092e57ded785900fc56a1190fa84
|
[
"MIT"
] | null | null | null |
components/grids/tree/$info/props/default-template.md
|
odajs/oda
|
a7fcfa7ec6bf092e57ded785900fc56a1190fa84
|
[
"MIT"
] | 2
|
2021-04-05T12:04:28.000Z
|
2021-11-17T09:13:37.000Z
|
Свойство **defaultTemplate** задает имя компонента, с помощью которого отображаются все узлы дерева по умолчанию.
Это свойство изначально имеет значение **oda-table-cell**, т.е. именно этот компонент используется для отображения всех узлов дерева по умолчанию.
Однако вместо него в свойстве **defaultTemplate** можно указать любой другой пользовательский компонент, который будет использоваться в качестве шаблона отображения узлов дерева в дальнейшем.
Например:
```javascript line_edit_loadoda_[my-template.js]
ODA({
is: 'my-template',
template:`
<style>
:host{
@apply --horizontal;
align-items: center;
}
</style>
<oda-icon :icon="item.icon ? item.icon : 'icons:star'"></oda-icon>
<span>{{item[column.name]}}</span>`,
props: {
column:{},
item:{}
}
});
```
В простейшем случае у пользовательского компонента должны быть заданы два свойства:
1. **item** — узел дерева, который необходимо отобразить.
1. **column** — столбец, в котором отображается этот узел.
Столбец позволяет узнать, какое свойство объекта **item** необходимо использовать для отображение надписи у узла дерева. Имя этого свойства совпадает с названием самого столбца, которое хранится в его свойстве **name**.
Через объект **item** можно получить доступ ко всем свойствам текущего узла и использовать их для его отображения.
Например, в этом компоненте можно отобразить иконку с левой стороны от надписи, если у узла дерева будет задано свойство **icon**.
```javascript _run_line_edit_loadoda_[my-component.js]_{my-template.js}_h=200_
import '/components/grids/tree/tree.js';
ODA({
is: 'my-component',
template: `
<span>Компонент для отображения узлов</span>
<select ::value="defaultTemplate">
<option value="oda-table-cell" default>oda-table-cell</option>
<option value="my-template">my-template</option>
</select>
<oda-tree :data-set :default-template="defaultTemplate" ></oda-tree>
`,
props: {
dataSet: [
{name: "1 строка", icon: 'icons:face'},
{name:"2 строка", icon: 'icons:face', template: 'oda-table-cell',
items:[
{name:"2.1 строка", icon: 'icons:favorite'},
{name:"2.2 строка",
items:[
{name:"2.2.1 строка", icon: 'icons:android'},
{name:"2.2.2 строка"},
{name:"2.2.3 строка"},
]},
{name:"2.3 строка"}
]
},
{name:"3 строка", icon: 'icons:android'},
],
defaultTemplate: 'oda-table-cell'
}
});
```
Если у узла не будет свойства **icon**, то пользовательский компонент отобразит иконку по умолчанию. В данном примере это иконка с именем **icons:star**.
``` info_md
Обратите внимание, что если для отображения узла используется компонент **oda-table-cell**, то иконка отображаться не будет, даже если она была задана в свойстве **icon**, так как в этом компоненте такая возможность не предусмотрена.
```
Шаблон отображения можно задать отдельно для каждого узла дерева с помощью свойства **template**. Например, второй узел будет всегда отображаться с помощью компонента **oda-table-cell**, так как это явно указано в нем в свойстве **template**. Поэтому иконка у него отображаться никогда не будет.
| 43.25
| 295
| 0.644509
|
rus_Cyrl
| 0.904571
|
45069287720c7803ef978288142e448a992cf72e
| 1,785
|
md
|
Markdown
|
src/table/docs/fixed-header-column.md
|
Lohoyo/santd
|
1098a4af2552961ecf9de4ca38e69037f44ef43f
|
[
"MIT"
] | 63
|
2019-06-05T08:55:38.000Z
|
2022-03-10T07:57:56.000Z
|
src/table/docs/fixed-header-column.md
|
hchhtc123/santd
|
90c701f3ffd77763beb31c62b57f0c5a4898c19c
|
[
"MIT"
] | 13
|
2020-05-22T09:09:29.000Z
|
2021-07-21T11:19:33.000Z
|
src/table/docs/fixed-header-column.md
|
hchhtc123/santd
|
90c701f3ffd77763beb31c62b57f0c5a4898c19c
|
[
"MIT"
] | 27
|
2019-06-05T07:02:34.000Z
|
2022-03-09T07:24:24.000Z
|
<text lang="cn">
#### 固定头和列
适合同时展示有大量数据和数据列。
> 固定列使用了 sticky 属性,浏览器支持情况可以参考[这里](https://caniuse.com/#feat=css-sticky)。
> 若列头与内容不对齐或出现列重复,请指定每一列的 th 的宽度 width。
> 建议指定 scroll.x 为大于表格宽度的固定值或百分比。注意,且非固定列宽度之和不要超过 scroll.x。
</text>
```html
<template>
<div>
<s-table
columns="{{columns}}"
data="{{data}}"
scroll="{{ {x: '1150px', y: '300px'} }}"
>
<a href="javascript:;" slot="action">Action</a>
</s-table>
</div>
</template>
<script>
import san from 'san';
import {Table} from 'santd';
const columns = [
{title: 'Name', width: '150px', dataIndex: 'name', key: 'name', left: '0px'},
{title: 'Age', width: '100px', dataIndex: 'age', key: 'age', left: '150px'},
{title: 'Column 1', dataIndex: 'address', key: '1', width: '100px'},
{title: 'Column 2', dataIndex: 'address', key: '2', width: '100px'},
{title: 'Column 3', dataIndex: 'address', key: '3', width: '100px'},
{title: 'Column 4', dataIndex: 'address', key: '4', width: '100px'},
{title: 'Column 5', dataIndex: 'address', key: '5', width: '100px'},
{title: 'Column 6', dataIndex: 'address', key: '6', width: '100px'},
{title: 'Column 7', dataIndex: 'address', key: '7', width: '100px'},
{title: 'Column 8', dataIndex: 'address', key: '8', width: '100px'},
{
title: 'Action',
key: 'operation',
width: '100px',
right: '0px',
scopedSlots: {render: 'action'}
}];
const data = [];
for (let i = 0; i < 50; i++) {
data.push({
key: i,
name: `Edrward king ${i}`,
age: 32,
address: `London Park no. ${i}`,
});
}
export default {
components: {
's-table': Table
},
initData() {
return {
columns: columns,
data: data
}
},
}
</script>
```
| 25.5
| 77
| 0.546218
|
eng_Latn
| 0.186217
|
4506e94abd00757ac8f62bd6c4b59a0f9931523d
| 1,721
|
md
|
Markdown
|
concepts/http-status-code/426.md
|
jsbezerra/webconcepts
|
ea026eb50a83c5ecfdb20f1275e124389cd1e704
|
[
"Unlicense"
] | 104
|
2016-07-23T06:11:39.000Z
|
2022-03-13T02:24:44.000Z
|
concepts/http-status-code/426.md
|
jsbezerra/webconcepts
|
ea026eb50a83c5ecfdb20f1275e124389cd1e704
|
[
"Unlicense"
] | 46
|
2016-07-24T06:54:59.000Z
|
2021-10-03T09:09:04.000Z
|
concepts/http-status-code/426.md
|
jsbezerra/webconcepts
|
ea026eb50a83c5ecfdb20f1275e124389cd1e704
|
[
"Unlicense"
] | 25
|
2016-07-23T06:12:53.000Z
|
2022-01-15T18:52:03.000Z
|
---
layout: concept
permalink: "/concepts/http-status-code/426"
title: "HTTP Status Code: 426 Upgrade Required"
concept-name: HTTP Status Code
concept-value: 426 Upgrade Required
description: "The 426 (Upgrade Required) status code indicates that the server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol. The server MUST send an Upgrade header field in a 426 response to indicate the required protocol(s)."
---
[The 426 (Upgrade Required) status code indicates that the server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol. The server MUST send an Upgrade header field in a 426 response to indicate the required protocol(s).](http://tools.ietf.org/html/rfc7231#section-6.5.15 "Read documentation for HTTP Status Code "426"") (**[RFC 7231: Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content](/specs/IETF/RFC/7231 "The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypertext information systems. This document defines the semantics of HTTP/1.1 messages as expressed by request methods, request header fields, response status codes, and response header fields, along with the payload of messages (metadata and body content) and mechanisms for content negotiation.")**)
<br/>
<hr/>
<p style="float : left"><a href="./426.json" title="JSON representing this particular Web Concept value">JSON</a></p>
<p style="text-align: right">Return to list of all ( <a href="../http-status-code/">HTTP Status Codes</a> | <a href="../">Web Concepts</a> )</p>
| 101.235294
| 919
| 0.760604
|
eng_Latn
| 0.942328
|
45074da11b234d1c8dbf2ffc668674011f1db026
| 88,663
|
md
|
Markdown
|
_posts/2017-10-11-jni_functions_note.md
|
caoxudong/caoxudong.github.com
|
55da0bc6289f42ab71ae54681f43cd2928a7f975
|
[
"MIT"
] | 2
|
2018-01-29T03:15:00.000Z
|
2019-02-12T13:28:08.000Z
|
_posts/2017-10-11-jni_functions_note.md
|
caoxudong/caoxudong.github.com
|
55da0bc6289f42ab71ae54681f43cd2928a7f975
|
[
"MIT"
] | null | null | null |
_posts/2017-10-11-jni_functions_note.md
|
caoxudong/caoxudong.github.com
|
55da0bc6289f42ab71ae54681f43cd2928a7f975
|
[
"MIT"
] | null | null | null |
---
title: JNI规范
layout: post
category: blog
tags: [java, jni, jvm]
---
# 目录
* [1 简介][2]
* [2 设计概览][3]
* [2.1 JNI函数和指针][4]
* [2.2 编译、载入、链接本地方法][5]
* [2.2.1 解析本地方法名][6]
* [2.2.2 本地方法参数][7]
* [2.3 引用Java对象][8]
* [2.3.1 全局引用和局部引用][9]
* [2.3.2 实现局部引用][10]
* [2.4 访问Java对象][11]
* [2.4.1 访问原生类型的数组][12]
* [2.4.2 访问属性和方法][13]
* [2.4.3 报告程序错误][14]
* [2.5 Java异常][15]
* [2.5.1 异常和错误码][16]
* [2.5.2 异步异常][17]
* [2.5.3 异常处理][18]
* [3 JNI的类型和数据结构][19]
* [3.1 原生类型][20]
* [3.2 引用类型][21]
* [3.3 属性和方法ID][22]
* [3.4 值类型][23]
* [3.5 类型签名][24]
* [3.6 自定义UTF-8编码][25]
* [4 JNI函数][26]
* [4.1 接口函数表][27]
* [4.2 版本信息][28]
* [4.2.1 GetVersion][29]
* [4.2.2 Constant][30]
* [4.3 类操作][31]
* [4.3.1 DefineClass][32]
* [4.3.2 FindClass][33]
* [4.3.3 GetSuperclass][34]
* [4.3.4 IsAssignableFrom][35]
* [4.4 异常][36]
* [4.4.1 Throw][37]
* [4.4.2 ThrowNew][38]
* [4.4.3 ExceptionOccurred][39]
* [4.4.4 ExceptionDescribe][40]
* [4.4.5 ExceptionClear][41]
* [4.4.6 FatalError][42]
* [4.4.7 ExceptionCheck][43]
* [4.5 全局引用和局部引用][44]
* [4.5.1 全局引用][45]
* [4.5.1.1 NewGlobalRef][46]
* [4.5.1.2 DeleteGlobalRef][47]
* [4.5.2 局部引用][48]
* [4.5.2.1 DeleteLocalRef][49]
* [4.5.2.2 EnsureLocalCapacity][50]
* [4.5.2.3 PushLocalFrame][51]
* [4.5.2.4 PopLocalFrame][52]
* [4.5.2.5 NewLocalRef][53]
* [4.5.3 弱全局引用][54]
* [4.5.3.1 NewWeakGlobalRef][55]
* [4.5.3.2 DeleteWeakGlobalRef][56]
* [4.5.4 对象操作][57]
* [4.5.4.1 AllocObject][58]
* [4.5.4.2 NewObject, NewObjectA, NewObjectV][59]
* [4.5.4.3 GetObjectClass][60]
* [4.5.4.4 GetObjectRefType][61]
* [4.5.4.5 IsInstanceOf][62]
* [4.5.4.6 IsSameObject][63]
* [4.5.5 访问对象的属性][64]
* [4.5.5.1 GetFieldID][65]
* [4.5.5.2 `Get<type>Field`系列函数][66]
* [4.5.5.3 `Set<type>Field`系列函数][67]
* [4.5.6 调用实例方法][68]
* [4.5.6.1 GetMethodID][69]
* [4.5.6.2 `Call<type>Method` `Call<type>MethodA`和`Call<type>MethodV`系列函数][70]
* [4.5.6.3 `CallNonvirtual<type>Method` `CallNonvirtual<type>MethodA` `CallNonvirtual<type>MethodV`系列函数][71]
* [4.5.7 访问静态属性][72]
* [4.5.7.1 GetStaticFieldID][73]
* [4.5.7.2 `GetStatic<type>Field`系列函数][74]
* [4.5.7.3 `SetStatic<type>Field`系列函数][75]
* [4.5.8 调用静态方法][76]
* [4.5.8.1 GetStaticMethodID][77]
* [4.5.8.2 `CallStatic<type>Method` `CallStatic<type>MethodA` `CallStatic<type>MethodV`系列函数][78]
* [4.5.9 字符串操作][79]
* [4.5.9.1 NewString][80]
* [4.5.9.2 GetStringChars][81]
* [4.5.9.3 ReleaseStringChars][82]
* [4.5.9.4 NewStringUTF][83]
* [4.5.9.5 GetStringUTFLength][84]
* [4.5.9.6 GetStringUTFChars][85]
* [4.5.9.7 ReleaseStringUTFChars][86]
* [4.5.9.8 GetStringRegion][87]
* [4.5.9.9 GetStringUTFRegion][88]
* [4.5.9.10 GetStringCritical, ReleaseStringCritical][89]
* [4.5.10 数组操作][90]
* [4.5.10.1 GetArrayLength][91]
* [4.5.10.2 NewObjectArray][92]
* [4.5.10.3 GetObjectArrayElement][93]
* [4.5.10.4 SetObjectArrayElement][94]
* [4.5.10.5 `New<PrimitiveType>Array`系列函数][95]
* [4.5.10.6 `Get<PrimitiveType>ArrayElements`系列函数][96]
* [4.5.10.7 `Release<PrimitiveType>ArrayElements`系列函数][97]
* [4.5.10.8 `Get<PrimitiveType>ArrayRegion`系列函数][98]
* [4.5.10.9 `Set<PrimitiveType>ArrayRegion`系列函数][99]
* [4.5.10.10 GetPrimitiveArrayCritical, ReleasePrimitiveArrayCritical][100]
* [4.5.11 注册本地方法][101]
* [4.5.11.1 RegisterNatives][102]
* [4.5.11.2 UnregisterNatives][103]
* [4.5.12 监视器操作][104]
* [4.5.12.1 MonitorEnter][105]
* [4.5.12.2 MonitorExit][106]
* [4.5.13 NIO支持][107]
* [4.5.13.1 NewDirectByteBuffer][110]
* [4.5.13.2 GetDirectBufferAddress][111]
* [4.5.13.3 GetDirectBufferCapacity][112]
* [4.5.14 反射支持][113]
* [4.5.14.1 FromReflectedMethod][114]
* [4.5.14.2 FromReflectedField][115]
* [4.5.14.3 ToReflectedMethod][116]
* [4.5.14.4 ToReflectedField][117]
* [4.5.15 JVM接口][118]
* [4.5.15.1 GetJavaVM][119]
* [5 Invocation API][120]
* [5.1 Overview][121]
* [5.1.1 创建JVM][122]
* [5.1.2 连接到JVM][123]
* [5.1.3 断开与JVM的连接][124]
* [5.1.4 卸载JVM][125]
* [5.2 库与版本管理][126]
* [5.2.1 JNI_OnLoad][127]
* [5.2.2 JNI_UnOnLoad][128]
* [5.3 Invocation API][129]
* [5.3.1 JNI_GetDefaultJavaVMInitArgs][130]
* [5.3.2 JNI_GetCreatedJavaVMs][131]
* [5.3.3 JNI_CreateJavaVM][132]
* [5.3.4 DestroyJavaVM][133]
* [5.3.5 AttachCurrentThread][134]
* [5.3.6 AttachCurrentThreadAsDaemon][135]
* [5.3.7 DetachCurrentThread][136]
* [5.3.8 GetEnv][137]
* [Resources][138]
<a name="1"></a>
# 1 简介
没啥可说的
<a name="2"></a>
# 2 设计概览
<a name="2.1"></a>
## 2.1 JNI函数和指针
本地代码通过可以通过一系列JNI函数来访问JVM的内部数据,而想要访问这一系列JNI函数,又需要通过一个JNI接口指针(JNI Interface Pointer)才行,如下图所示
Array of pointers +---------------------+
to JNI functions +-> |an interface function|
+-------------+ +---------------+ +-----------------+ | +---------------------+
|JNI interface+---> |Pointer +--+-> |Pointer +--+
|pointer | +---------------+ | +-----------------+ +---------------------+
| | |per-thread JNI | +-> |Pointer +----> |an interface function|
+-------------+ |data structure | | +-----------------+ +---------------------+
+---------------+ +-> |Pointer +--+
+-----------------+ | +---------------------+
|... | +-> |an interface function|
+-----------------+ +---------------------+
JNI接口指针的设计有些类似于C++的虚函数表,这样做的好处是,可以通过JNI命名空间来隔离本地代码,JVM可以借此提供多个版本的JNI函数表,例如一个版本用来做调试,效率不高,但会做更多的参数检查,另一个版本用于做正式使用,参数检查较少,但效率更高。
JNI函数接口只能在当前线程使用,**禁止**将接口指针传给其他线程,当在同一个线程中多次调用本地方法时,JVM保证传递的是相同的接口指针。由于本地方法可能被不同的Java线程调用,因此可能传入不同的接口指针。
<a name="2.2"></a>
## 2.2 编译、载入、链接本地方法
JVM本身是支持多线程的,因此在编译、链接本地代码库的时候,也要添加多线程的支持。例如,在使用Sun Studio编译器编译代码时,应该添加`-mt`标记,使用GCC编译代码时,应该使用`-D_REENTRANT`或`-D_POSIX_C_SOURCE`标记。编译本地代码库之后,可以通过`System.loadLibrary`方法来载入本地库,如下所示:
```java
package pkg;
class Cls {
native double f(int i, String s);
static {
System.loadLibrary("pkg_Cls");
}
}
```
编译后的本地代码库要符合目标操作系统的命名约定,例如在Solaris系统上,`pkg_Cls`代码库的名字应该是`libpkg_Cls.so`,在Windows系统上,`pkg_Cls`代码库的名字应该是`pkg_Cls.dll`。
上面说的动态库,JVM也可以使用静态库,但这需要与JVM的实现绑定在一起,`System.loadLibrary`或其他等价的方法在加载静态库的时候,必须成功。
当且仅当静态库对外导出了名为`JNI_OnLoad_L`的函数时,并且与JVM绑定在一起时,才是真正的静态链接。如果静态库中既包含函数`JNI_OnLoad_L`,又包含函数`JNI_OnLoad`,则函数`JNI_OnLoad`会被忽略。如果某个代码库`L`是静态链接的,则当首次调用`System.loadLibrary`或其他等价方法时,会执行`JNI_OnLoad_L`方法,其参数和返回值与`JNI_OnLoad`方法相同。
若某个静态库的名字是`L`,则无法在加载具有相同名字的动态库。
当包含了某个静态库的类加载器被GC掉,并且该静态库中导出了名为`JNI_OnUnload_L`函数时,会调用`JNI_OnUnload_L`完成清理工作。类似的,若静态库中同时导出了名为`JNI_OnUnLoad_L`和`JNI_OnUnLoad`的函数,则函数`JNI_OnUnLoad`会被忽略掉。
开发者可以调用JNI函数`RegisterNatives`来注册某个类的本地方法,这对静态链接的函数非常有用。
<a name="2.2.1"></a>
### 2.2.1 解析本地方法名
动态链接器会根据本地方法的方法名来解析函数入口,方法名遵循如下规则:
* 函数名带有`Java_`前缀
* 后跟以下划线完整类名,类的包名分隔符`.`以`_`来代替
* 后跟函数名
* 对于重载的本地方法,会使用双下划线(`__`)来分隔参数签名
JVM根据本地方法名查找方法的规则如下:
* 先查找不带参数签名的方法
* 再查找带参数签名的方法
这里值得注意的是,如果本地方法和非本地方法同名,其实并不需要使用带参数签名的方法名,因为非本地方法不会存在于本地代码库中。
由于Java代码中支持Unicode字符,因此为了与C语言兼容,需要对本地方法中的非ASCII字符进行转义,规则如下:
* 使用`_0XXXX`表示非ASCII的Unicode字符,注意这里使用的小写字符,例如`_0abcd`
* 使用`_1`表示下划线`_`
* 使用`_2`表示分号`;`
* 使用`_3`表示中括号`[`
代码示例:
```java
public class Hello {
private native int sum(int a, int b);
private native String concat(String a, String b);
private native String 试试(String a, String b);
public static void main(String[] args) {
System.out.println(new Hello().sum(1,2));
System.out.println(new Hello().concat("caoxudong is ", "testging"));
}
static {
System.loadLibrary("Hello");
}
}
```
使用`javah`编译后的头文件
```c
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class Hello */
#ifndef _Included_Hello
#define _Included_Hello
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: Hello
* Method: sum
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_Hello_sum
(JNIEnv *, jobject, jint, jint);
/*
* Class: Hello
* Method: concat
* Signature: (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_Hello_concat
(JNIEnv *, jobject, jstring, jstring);
/*
* Class: Hello
* Method: _08bd5_08bd5
* Signature: (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_Hello__08bd5_08bd5
(JNIEnv *, jobject, jstring, jstring);
#ifdef __cplusplus
}
#endif
#endif
```
<a name="2.2.2"></a>
### 2.2.2 本地方法参数
* 第一个参数是JNI接口指针,`JNIEnv *`
* 第二个参数是Java对象,具体值取决于当前方法是静态方法还是实例方法,若是静态方法,则表示类对象,若是实例方法,则表示实例对象
* 其余参数与定义本地方法时的参数一一对应
**需要注意的是,一定要使用JNI接口指针来操作Java对象,不要耍小聪明绕过JNI接口指针。**
<a name="2.3"></a>
## 2.3 引用Java对象
像整型(`int`)和字符(`char`)原生类型的数据会在Java代码和本地代码之间互相拷贝数据,而其他引用类型的对象则可以在Java代码和本地代码之间传递引用。JVM需要跟踪所有传递给本地代码的对象,防止其被垃圾回收;另一方面,本地代码需要有一种途径来告知JVM哪些对象可以被回收掉;此外,垃圾回收器需要能够移动本地代码所引用的对象。
<a name="2.3.1"></a>
### 2.3.1 全局引用和局部引用
JNI将本地代码所使用的对象分为全局引用(`global reference`)和本地引用(`local reference`)。本地引用只在本地方法调用中有效,当本地方法退出时,会自动释放掉;而全局引用在显式调用释放方法前,会一直有效。
一些操作原则:
* 对象是作为局部引用传递给本地方法的
* JNI函数返回的Java对象也都是局部引用的
* 开发者可以使用局部引用来创建全局引用
* 意图接收Java对象的JNI函数,即可以接收局部引用,也可以接收全局引用
* 本地方法返回给JVM的结果,即可以是局部引用,也可以是全局引用
大部分情况下,开发者可以不必关心局部引用的释放,JVM会做好这件事;在某些特殊场景下,才需要有开发者显式释放掉局部引用,例如:
* 本地方法访问了一个很大的Java对象,因此创建了一个指向该对象的局部引用,在返回到调用函数之前,该本地方法需要执行很多额外的工作,由于有局部引用指向该Java对象,即便该Java对象已经不再使用,它也不会被垃圾回收器回收掉
* JVM需要一块额外的内存空间来跟踪本地方法创建的局部引用,因此若本地方法创建了大量局部引用,则可能导致内存不足而引发错误,例如本地方法遍历某个很大的数据,访问其中的Java对象,每次迭代都会创建局部引用,而这个新创建的局部引用在本地迭代之后就不再使用,造成大量内存浪费
JNI允许开发者在本地方法中手动删除局部引用,而且除了将局部引用作为结果返回之外,JNI函数不可以创建额外的局部引用。
局部引用不是线程安全的,只可用在当前线程中。
<a name="2.3.2"></a>
### 2.3.2 实现局部引用
当从Java代码转换到本地代码时,JVM会创建注册表来记录不可移动的局部引用到Java对象的映射,同时避免该Java对象被垃圾回收器回收掉。调用本地方法时,传入传出的Java对象都会被添加到这个注册表中,当从本地方法返回时,该注册表会被删除,注册表中引用的对象也得以被垃圾回收器回收掉。
实现注册表有多种方法,例如哈希表、链表等。尽管使用引用计数可以避免在注册表中创建重复内容,但就JNI的具体实现来说,这并不是必要的。
需要注意的是,不能通过保守的遍历本地调用栈来实现局部引用,因为本地方法可能会将局部引用存储在全局或堆中的某个数据结构中。
<a name="2.4"></a>
## 2.4 访问Java对象
JNI通过局部引用和全局引用提供了一整套访问函数,使开发者可以不比关心JVM内部的具体实现,提升了JNI的适用性。
当然,通过访问函数来访问数据的开销肯定会比直接访问实际数据结构的开销大,但在大部分场景下,能逼得Java开发者通过本地方法来实现的功能,其执行开销本身就比调用访问函数的开销大得多,所以说,不必太过在意。
<a name="2.4.1"></a>
### 2.4.1 访问原生类型的数组
当然,在访问包含了大量原生数据类型数组时,若每次迭代都要调用JNI访问函数来访问数组元素,就太没有效率了。
一种解决方案是引入**pinning**机制,JVM锁定原始数组,并提供类似于游标的直接指针,以便本地代码可以访问数组元素,但这种方案有两个前提条件:
* 垃圾回收器能够支持**pinning**
* JVM必须将原生类型的数组放置在一个连续的内存空间上,大部分情况下也确实是这么实现的,不过在实现布尔类型的数组时可以将数组元素压缩存储,因此使用这种方式的代码不具备可移植性
这里,可以采用一种折衷的方法:
* 通过一系列函数来实现原生类型的数组在本地代码和Java代码之间的拷贝,当本地代码只需要访问数组中的少量数据时,使用这些拷贝函数即可;
* 若开发者确实需要访问大量的数组元素,还是通过另一系列类似直接指针的函数来访问数组元素,这时请一定牢记,这些函数可能需要JVM做一些内存分配或和数据拷贝的工作,实际执行时是否需要分配内存和拷贝数据取决于JVM的具体实现,例如:
* 如果垃圾回收器支持**pinning**,而且数组对象的内存布局与本地代码的期望形式相同,则无需内存拷贝
* 否则需要将数组拷贝到一块不可移动的内存区域(例如在C堆中分配内存),执行一些必要的格式转换,再返回指向该内存块的指针
* 最后通过接口函数通知JVM,"本地代码无需再访问数组元素",然后系统会释放对原始数组的锁定,接触原始数组和拷贝数组的关联关系,释放拷贝数组
这个方案有一些灵活性,垃圾回收器可以区别对待拷贝数组和原始数组,例如只拷贝小对象,而大对象则使用**pinning**机制来访问。
JNI的实现者必须保证,在多线程场景下运行的本地方法可以同时访问相同的数组对象,例如,JNI可能会使用引用技术来记录每个通过**pinning**机制来访问的数组对象,以便当所有访问该数组的线程退出本地方法时,可以退出**pinning**操作,但是JNI不能通过加锁来限制其他线程同时对数组进行访问。当然,同时访问数组元素,且没有进行同步控制时,访问结果是不确定的。
<a name="2.4.2"></a>
### 2.4.2 访问属性和方法
开发者可以通过JNI来访问Java对象的属性和方法。JNI可以通过属性和方法的符号名(symbolic names)和类型签名(type signatures)来定位具体的属性和方法。例如,要访问类`cls`中的方法`f`,可以使用如下方法:
```c++
methodID mid = env->GetMethodID(cls, "f", "(ILjava/lang/String;)D");
```
在获取到方法之后,就可以重复使用了,无需每次都重新获取:
```c++
jdouble result = env->CallDoubleMethod(obj, mid, 10, str);
```
这里需要注意的是,即便是获取到了方法或属性的ID,JVM也可能会卸载目标类,而卸载了目标类之后,ID也就无效了,因此,如果本地方法需要在一段时间内持续持有属性或方法ID,需要做一些额外的工作才能确保执行正确:
* 持有一个对目标类的引用
* 重新计算属性或方法的ID
JNI并不强制要求属性或方法ID该如如何实现。
<a name="2.4.3"></a>
### 2.4.3 报告程序错误
JNI并不检查像空指针或错误参数类型这样的程序错误,原因如下:
* 会降低本地方法的性能
* 很多时候,运行时类型信息不足,无法检查
大多数C语言程序库并不对程序错误加以预防,例如像`printf`这样的函数在遇到无效地址时,并不会报告错误代码,而是会引发一个运行时错误。因此,强制C语言程序库对所有可能错误进行检查没什么意义,用户代码本身就需要做检查,C语言运行库就无需再做一遍了。
开发者禁止将错误指针或参数传递给本地方法,否则可能会引发无法预知的结果,包括异常的系统状态或JVM崩溃。
<a name="2.5"></a>
## 2.5 Java异常
JNI允许本地代码抛出任何类型的异常,也可以处理被抛出的Java异常,若不处理,则会被返还给JVM继续处理。
<a name="2.5.1"></a>
### 2.5.1 异常和错误码
特定的JNI函数会使用Java的异常机制来报告异常,大部分情况下,JNI会通过返回错误码并抛出Java异常来报告错误。错误码通常是特定的返回值,例如`NULL`,因此开发者可以:
* 检查最后一次调用JNI函数的返回值来判断是否有错误发生
* 调用函数`ExceptionOccurred()`,获取包含了详细错误信息的异常对象
有两种情况,开发者需要检查异常对象,而不必检查JNI函数的返回值:
* JNI函数的返回值是通过调用Java方法而得到的。开发者必须调用`ExceptionOccurred()`方法来检查是否在Java方法中跑出了异常
* 某些JNI的数组访问函数没有返回值,但可能会抛出`ArrayIndexOutOfBoundsException`异常或`ArrayStoreException`异常
其他场景下,非错误的返回值保证了没有异常被抛出。
<a name="2.5.2"></a>
### 2.5.2 异步异常
在多线程场景下,非当前线程可能会抛出异步异常(asynchronous exception),异步异常并不会立刻影响当前线程中本地代码的执行,直到满足以下条件之一:
* 本地代码调用了可能会抛出同步异常的JNI函数
* 本地代码调用`ExceptionOccurred()`方法来显式的检查是否有异常(同步或异步的)被抛出
注意,只有那些可能会抛出同步异常的JNI函数需要检查异步异常。
本地方法应该在适当的时机调用`ExceptionOccurred()`方法来确保当前线程可以在可控的时间范围内对异步异常进行相应。
<a name="2.5.3"></a>
### 2.5.3 异常处理
在本地代码中,有两种处理异常的方法:
* 本地代码可以立即返回,由本地方法的调用者来处理异常
* 本地方法可以调用`ExceptionClear()`方法清除异常信息,自己来处理异常
当有异常被抛出后,本地方法在调用其他JNI函数前,**必须**先清除异常信息。当有异常未被处理时,可以安全调用的JNI方法有:
* `ExceptionOccurred()`
* `ExceptionDescribe()`
* `ExceptionClear()`
* `ExceptionCheck()`
* `ReleaseStringChars()`
* `ReleaseStringUTFChars()`
* `ReleaseStringCritical()`
* `Release<Type>ArrayElements()`
* `ReleasePrimitiveArrayCritical()`
* `DeleteLocalRef()`
* `DeleteGlobalRef()`
* `DeleteWeakGlobalRef()`
* `MonitorExit()`
* `PushLocalFrame()`
* `PopLocalFrame()`
<a name="3"></a>
# 3 JNI的类型和数据结构
<a name="3.1"></a>
## 3.1 原生类型
原生类型和Java对象类型的对应关系如下:
Java类型 原生类型 描述
boolean jboolean unsigned 8 bits
byte jbyte signed 8 bits
char jchar unsigned 16 bits
short jshort signed 16 bits
int jint signed 32 bits
long jlong signed 64 bits
float jfloat 32 bits
double jdouble 64 bits
void void not applicable
为了使用方便,在JNI中做了如下定义:
```c++
#define JNI_FALSE 0
#define JNI_TRUE 1
```
定义类型`jsize`来表示基本索引和大小:
```c++
typedef jint jsize;
```
<a name="3.2"></a>
## 3.2 引用类型
JNI引入了一系列引用类型来对应Java中不同种类的对象,JNI中的引用类型有如下继承关系:
* `jobject`
* `jclass`(`java.lang.Class`对象)
* `jstring`(`java.lang.String`对象)
* `jarray`(数组对象)
* `jobjectArray`(对象数组)
* `jbooleanArray`(布尔数组)
* `jbyteArray`(字节数组)
* `jcharArray`(字符数组)
* `jshortArray`(短整型数组)
* `jintArray`(整型数组)
* `jlongArray`(长整型数组)
* `jfloatArray`(浮点数数组)
* `jdoubleArray`(双精度浮点数数组)
* `jthrowable`(`java.lang.Throwable`对象)
在C语言中,所有其他的JNI引用类型都被定义为`jobject`,例如:
```c
typedef jobject jclass;
```
而在C++语言中,JNI引入了一系列冗余类来维持继承体系,例如:
```c++
class _jobject {};
class _jclass : public _jobject {};
// ...
typedef _jobject *jobject;
typedef _jclass *jclass;
```
<a name="3.3"></a>
## 3.3 属性和方法ID
在JNI中,属性和方法的ID被定义普通的指针:
```c
struct _jfieldID; /* opaque structure */
typedef struct _jfieldID *jfieldID; /* field IDs */
struct _jmethodID; /* opaque structure */
typedef struct _jmethodID *jmethodID; /* method IDs */
```
<a name="3.4"></a>
## 3.4 值类型
值类型`jvalue`是一个联合体(`union type`),用于表示参数数组,其定义如下:
```c
typedef union jvalue {
jboolean z;
jbyte b;
jchar c;
jshort s;
jint i;
jlong j;
jfloat f;
jdouble d;
jobject l;
} jvalue;
```
<a name="3.5"></a>
## 3.5 类型签名
JNI沿用了JVM内部类型签名表示方法,如下所示:
类型签名 Java类型
Z boolean
B byte
C char
S short
I int
J long
F float
D double
L full class name full class name
[ type type[]
(arg-types)ret-type method type
例如,有如下Java方法:
```java
long f (int n, String s, int[] arr);
```
其类型签名为:
(ILjava/lang/String;[I)J
<a name="3.6"></a>
## 3.6 自定义UTF-8编码
JNI使用自定义UTF-8编码来表示各种字符串类型,这与JVM所使用的编码相同。使用自定义UTF-8编码,确保只包含非空的ASCII字符的字符串可以只用一个字节来存储一个字符,而且所有的Unicode字符都可以正确表示。
在` \u0001`到`\u007F`范围内的字符,可以只用一个字节表示,其中的低7位用来表示字符的编码值,例如:
* 0xxxxxxx
空白符和`\u0080`到`\u07FF`范围内的字符使用两个字节(x和y)来表示,字符的编码值使用公式`((x & 0x1f) << 6) + (y & 0x3f)`来计算,例如:
* x: 110xxxxx
* y: 10yyyyyy
范围在`'\u0800`到`\uFFFF'`的字符使用3个字节(x、y和z)来表示,字符的编码值使用公式`((x & 0xf) << 12) + ((y & 0x3f) << 6) + (z & 0x3f)`来计算,例如:
* x: 1110xxxx
* y: 10yyyyyy
* z: 10zzzzzz
范围在`U+FFFF`之上的字符(称之为**补充字符**)使用6个字节(u、v、w、x、y和z)来表示,字符的编码值使用公式` 0x10000+((v&0x0f)<<16)+((w&0x3f)<<10)+(y&0x0f)<<6)+(z&0x3f)`来计算。
对于那些需要使用多个字节来存储的字符来说,他们在class文件中是以大端序(big-endian)来存储的。
这种表示方式与标准UTF-8格式有些区别:
* 空白符`0`使用两个字节来存储,因此JNI中的自定义UTF-8编码永远不会内嵌空白符
* JNI只使用了标准UTF-8格式中的1字节、2字节和3字节这3种格式,JVM无法识别4字节格式的标准UTF-8编码,而是使用2倍的3字节编码格式( two-times-three-byte format)
<a name="4"></a>
# 4 JNI函数
<a name="4.1"></a>
## 4.1 接口函数表
开发者可以通过本地方法的参数`JNIEnv`来访问JNI函数,参数`JNIEnv`是一个指针,其指向的数据结构包含了所有的JNI函数,参数的定义如下:
```c++
typedef const struct JNINativeInterface *JNIEnv;
```
JVM会以下面的代码初始化接口函数表,其中需要注意的是,前几个为`NULL`的参数值是为了能够与**COM**兼容所预留的,之所以将这些参数值放在初始化列表的最前面,这样以后再添加与类操作相关的JNI函数时,可以放到`FindClass`后面,而不必放到函数表的末尾。
```c++
const struct JNINativeInterface ... = {
NULL,
NULL,
NULL,
NULL,
GetVersion,
DefineClass,
FindClass,
FromReflectedMethod,
FromReflectedField,
ToReflectedMethod,
GetSuperclass,
IsAssignableFrom,
ToReflectedField,
Throw,
ThrowNew,
ExceptionOccurred,
ExceptionDescribe,
ExceptionClear,
FatalError,
PushLocalFrame,
PopLocalFrame,
NewGlobalRef,
DeleteGlobalRef,
DeleteLocalRef,
IsSameObject,
NewLocalRef,
EnsureLocalCapacity,
AllocObject,
NewObject,
NewObjectV,
NewObjectA,
GetObjectClass,
IsInstanceOf,
GetMethodID,
CallObjectMethod,
CallObjectMethodV,
CallObjectMethodA,
CallBooleanMethod,
CallBooleanMethodV,
CallBooleanMethodA,
CallByteMethod,
CallByteMethodV,
CallByteMethodA,
CallCharMethod,
CallCharMethodV,
CallCharMethodA,
CallShortMethod,
CallShortMethodV,
CallShortMethodA,
CallIntMethod,
CallIntMethodV,
CallIntMethodA,
CallLongMethod,
CallLongMethodV,
CallLongMethodA,
CallFloatMethod,
CallFloatMethodV,
CallFloatMethodA,
CallDoubleMethod,
CallDoubleMethodV,
CallDoubleMethodA,
CallVoidMethod,
CallVoidMethodV,
CallVoidMethodA,
CallNonvirtualObjectMethod,
CallNonvirtualObjectMethodV,
CallNonvirtualObjectMethodA,
CallNonvirtualBooleanMethod,
CallNonvirtualBooleanMethodV,
CallNonvirtualBooleanMethodA,
CallNonvirtualByteMethod,
CallNonvirtualByteMethodV,
CallNonvirtualByteMethodA,
CallNonvirtualCharMethod,
CallNonvirtualCharMethodV,
CallNonvirtualCharMethodA,
CallNonvirtualShortMethod,
CallNonvirtualShortMethodV,
CallNonvirtualShortMethodA,
CallNonvirtualIntMethod,
CallNonvirtualIntMethodV,
CallNonvirtualIntMethodA,
CallNonvirtualLongMethod,
CallNonvirtualLongMethodV,
CallNonvirtualLongMethodA,
CallNonvirtualFloatMethod,
CallNonvirtualFloatMethodV,
CallNonvirtualFloatMethodA,
CallNonvirtualDoubleMethod,
CallNonvirtualDoubleMethodV,
CallNonvirtualDoubleMethodA,
CallNonvirtualVoidMethod,
CallNonvirtualVoidMethodV,
CallNonvirtualVoidMethodA,
GetFieldID,
GetObjectField,
GetBooleanField,
GetByteField,
GetCharField,
GetShortField,
GetIntField,
GetLongField,
GetFloatField,
GetDoubleField,
SetObjectField,
SetBooleanField,
SetByteField,
SetCharField,
SetShortField,
SetIntField,
SetLongField,
SetFloatField,
SetDoubleField,
GetStaticMethodID,
CallStaticObjectMethod,
CallStaticObjectMethodV,
CallStaticObjectMethodA,
CallStaticBooleanMethod,
CallStaticBooleanMethodV,
CallStaticBooleanMethodA,
CallStaticByteMethod,
CallStaticByteMethodV,
CallStaticByteMethodA,
CallStaticCharMethod,
CallStaticCharMethodV,
CallStaticCharMethodA,
CallStaticShortMethod,
CallStaticShortMethodV,
CallStaticShortMethodA,
CallStaticIntMethod,
CallStaticIntMethodV,
CallStaticIntMethodA,
CallStaticLongMethod,
CallStaticLongMethodV,
CallStaticLongMethodA,
CallStaticFloatMethod,
CallStaticFloatMethodV,
CallStaticFloatMethodA,
CallStaticDoubleMethod,
CallStaticDoubleMethodV,
CallStaticDoubleMethodA,
CallStaticVoidMethod,
CallStaticVoidMethodV,
CallStaticVoidMethodA,
GetStaticFieldID,
GetStaticObjectField,
GetStaticBooleanField,
GetStaticByteField,
GetStaticCharField,
GetStaticShortField,
GetStaticIntField,
GetStaticLongField,
GetStaticFloatField,
GetStaticDoubleField,
SetStaticObjectField,
SetStaticBooleanField,
SetStaticByteField,
SetStaticCharField,
SetStaticShortField,
SetStaticIntField,
SetStaticLongField,
SetStaticFloatField,
SetStaticDoubleField,
NewString,
GetStringLength,
GetStringChars,
ReleaseStringChars,
NewStringUTF,
GetStringUTFLength,
GetStringUTFChars,
ReleaseStringUTFChars,
GetArrayLength,
NewObjectArray,
GetObjectArrayElement,
SetObjectArrayElement,
NewBooleanArray,
NewByteArray,
NewCharArray,
NewShortArray,
NewIntArray,
NewLongArray,
NewFloatArray,
NewDoubleArray,
GetBooleanArrayElements,
GetByteArrayElements,
GetCharArrayElements,
GetShortArrayElements,
GetIntArrayElements,
GetLongArrayElements,
GetFloatArrayElements,
GetDoubleArrayElements,
ReleaseBooleanArrayElements,
ReleaseByteArrayElements,
ReleaseCharArrayElements,
ReleaseShortArrayElements,
ReleaseIntArrayElements,
ReleaseLongArrayElements,
ReleaseFloatArrayElements,
ReleaseDoubleArrayElements,
GetBooleanArrayRegion,
GetByteArrayRegion,
GetCharArrayRegion,
GetShortArrayRegion,
GetIntArrayRegion,
GetLongArrayRegion,
GetFloatArrayRegion,
GetDoubleArrayRegion,
SetBooleanArrayRegion,
SetByteArrayRegion,
SetCharArrayRegion,
SetShortArrayRegion,
SetIntArrayRegion,
SetLongArrayRegion,
SetFloatArrayRegion,
SetDoubleArrayRegion,
RegisterNatives,
UnregisterNatives,
MonitorEnter,
MonitorExit,
GetJavaVM,
GetStringRegion,
GetStringUTFRegion,
GetPrimitiveArrayCritical,
ReleasePrimitiveArrayCritical,
GetStringCritical,
ReleaseStringCritical,
NewWeakGlobalRef,
DeleteWeakGlobalRef,
ExceptionCheck,
NewDirectByteBuffer,
GetDirectBufferAddress,
GetDirectBufferCapacity,
GetObjectRefType
};
```
<a name="4.2"></a>
## 4.2 版本信息
<a name="4.2.1"></a>
### 4.2.1 GetVersion
```c++
jint GetVersion(JNIEnv *env);
```
函数返回当前本地方法接口的版本号。
该函数在`JNIEnv`接口函数表的索引位置为`4`。
参数:
env JNI接口指针
返回值:
函数返回值的高16位是主版本号,低16位是次版本号
In JDK/JRE 1.1, GetVersion() returns 0x00010001
In JDK/JRE 1.2, GetVersion() returns 0x00010002
In JDK/JRE 1.4, GetVersion() returns 0x00010004
In JDK/JRE 1.6, GetVersion() returns 0x00010006
<a name="4.2.2"></a>
## 4.2.2 Constants
自JDK/JRE 1.2其,版本信息定义如下
```c++
#define JNI_VERSION_1_1 0x00010001
#define JNI_VERSION_1_2 0x00010002
#define JNI_EDETACHED (-2) /* thread detached from the VM */
#define JNI_EVERSION (-3) /* JNI version error
```
自JDK/JRE 1.4之后,增加版本信息如下:
```c++
#define JNI_VERSION_1_4 0x00010004
```
自JDK/JRE 1.4之后,增加版本信息如下:
```c++
#define JNI_VERSION_1_6 0x00010006
```
<a name="4.3"></a>
## 4.3 类操作
<a name="4.3.1"></a>
### 4.3.1 DefineClass
```c++
jclass DefineClass(JNIEnv *env, const char *name, jobject loader, const jbyte *buf, jsize bufLen);
```
从字节数组中载入一个类。在调用函数`DefineClass`之后,参数`buf`所指向的字节数组可能会释放掉。
该函数在`JNIEnv`接口函数表的索引位置为`5`。
参数:
env JNI接口指针
name 待载入的类或接口的名字,字符串使用自定义UTF-8编码存储
loader 指定用来载入类的加载器对象
buf 包含了待载入的类信息的字节数组
bufLen 包含了待载入的类信息的字节数组的长度
返回值:
返回载入的Java类对象;如果发生错误,则返回NULL
异常:
ClassFormatError 参数buf中存储的不是有效的类数据,抛出此异常
ClassCircularityError 若类或接口被定义为自己的父类或父接口时,抛出此异常
OutOfMemoryError 内存不足时,抛出此异常
SecurityException 若待载入的异常位于"java"包下时,抛出此异常
<a name="4.3.2"></a>
### 4.3.2 FindClass
```c++
jclass FindClass(JNIEnv *env, const char *name);
```
在JDK 1.1中,该方法用于载入一个局部定义的类(locally-defined class),它会在环境变量`CLASSPATH`所指定的目录和压缩包中搜索待载入的类。
从JDK 1.2起,Java的安全模型运行非系统类(non-system classes)载入和调用本地方法。`FindClass`方法会使用声明了当前本地方法的类的类加载器来加载目标类。如果当前的本地方法属于一个系统类,则无需使用用户自定义的类加载器;否则会调用对应的类加载来加载目标类。
从JDK 1.2起,当通过调用接口(Invocation Interface)来调用`FindClass`时,是没有当前本地方法及其关联的类加载器的。这种情况下,会调用`ClassLoader.getSystemClassLoader`方法获取类加载器,可以加载`java.class.path`属性中指定的类。
参数`name`指定了待加载类的完整名字,或是数组的类型签名。
若需要载入`java.lang.String`类,则参数`name`的值为:
java/lang/String
若需要载入`java.lang.Object[]`类,则参数`name`的值为
[Ljava/lang/Object;
该函数在`JNIEnv`接口函数表的索引位置为`6`。
参数:
env JNI接口指针
name 指定了待加载类的完整名字,或是数组的类型签名。包名的分隔符使用"/"表示,若name以"["开头,则表示要载入的是一个数组类型。name的值使用自定义UTF-8编码。
返回值:
返回载入了的Java类对象;若发生错误,则返回NULL
异常:
ClassFormatError 类数据格式错误,抛出此异常
ClassCircularityError 若类或接口被定义为自己的父类或父接口时,抛出此异常
OutOfMemoryError 内存不足时,抛出此异常
NoClassDefFoundError 找不到指定的类型数据时,抛出此异常
<a name="4.3.3"></a>
### 4.3.3 GetSuperclass
```c++
jclass GetSuperclass(JNIEnv *env, jclass clazz);
```
若参数`clazz`表示的是非`Object`的其他类对象,则该函数返回目标类的父类。
若参数`clazz`表示的`Object`类或是接口类,则该函数返回`NULL`。
该函数在`JNIEnv`接口函数表的索引位置为`10`。
参数:
env JNI接口指针
clazz Java类对象
返回值:
返回目标类的父类或"NULL"
<a name="4.3.4"></a>
### 4.3.4 IsAssignableFrom
```c++
jboolean IsAssignableFrom(JNIEnv *env, jclass clazz1, jclass clazz2);
```
判断参数`clazz1`所指定的类型是否可以安全的扩展为`clazz2`参数所指定的类型。
该函数在`JNIEnv`接口函数表的索引位置为`11`。
参数:
env JNI接口指针
clazz1 源Java类型对象
clazz2 目标Java类型对象
返回值:
当满足以下任意条件时,返回"JNI_TRUE",否则返回"JNI_FALSE"
* clazz1和clazz2指向相同的Java类
* clazz1是clazz2的父类
* clazz1是clazz2的接口之一
<a name="4.4"></a>
### 4.4 异常
<a name="4.4.1"></a>
### 4.4.1 Throw
```c++
jint Throw(JNIEnv *env, jthrowable obj);
```
抛出一个`java.lang.Throwable`类型的异常对象。
该函数在`JNIEnv`接口函数表的索引位置为`13`。
参数:
env JNI接口指针
obj 类型为"java.lang.Throwable"的对象
返回值:
函数调用成功返回0,否则返回负数。
异常:
抛出一个`java.lang.Throwable`类型的异常对象。
<a name="4.4.2"></a>
### 4.4.2 ThrowNew
```c++
jint ThrowNew(JNIEnv *env, jclass clazz, const char *message);
```
从已有的信息中构造一个新的异常对象并抛出,异常对象的类型由参数`clazz`指定,异常的错误信息由参数`message`指定。
该函数在`JNIEnv`接口函数表的索引位置为`14`。
参数:
env JNI接口指针
clazz 待创建异常对象的类型,必须为"java.lang.Throwable"的自雷
message 异常信息,使用自定义UTF-8进行编码
返回值:
函数调用成功返回0,否则返回负数。
异常:
抛出新创建的异常对象
<a name="4.4.3"></a>
### 4.4.3 ExceptionOccurred
```c++
jthrowable ExceptionOccurred(JNIEnv *env);
```
该函数用于判断当前是否有被抛出的异常。除非是通过本地方法调用`ExceptionClear()`函数,或是在Java代码中捕获了异常对象,否则异常对象会一直处于被抛出的状态。
该函数在`JNIEnv`接口函数表的索引位置为`15`。
参数:
env JNI接口指针
返回值:
返回当前正处于被抛出状态的异常;果没有异常被抛出,返回"NULL"
<a name="4.4.4"></a>
### 4.4.4 ExceptionDescribe
```c++
void ExceptionDescribe(JNIEnv *env);
```
在系统错误报告通道(system error-reporting channel,例如标准错误`stderr`)打印异常和调用栈信息。该方法可用于调试目标代码。
该函数在`JNIEnv`接口函数表的索引位置为`16`。
参数:
env JNI接口指针
<a name="4.4.5"></a>
### 4.4.5 ExceptionClear
```c++
void ExceptionClear(JNIEnv *env);
```
清除当前正处于被抛出状态的异常。若当前没有异常被抛出,则啥也不做。
该函数在`JNIEnv`接口函数表的索引位置为`17`。
参数:
env JNI接口指针
<a name="4.4.6"></a>
### 4.4.6 FatalError
```c++
void FatalError(JNIEnv *env, const char *msg);
```
抛出一个致命错误(fatal error),且并不期望JVM能够同错误中恢复。该函数不会返回。
该函数在`JNIEnv`接口函数表的索引位置为`18`。
参数:
env JNI接口指针
msg 错误信息,使用自定义UTF-8编码
<a name="4.4.7"></a>
### 4.4.7 ExceptionCheck
该函数用于检查是否有被抛出的异常,且无需为异常对象创建新的局部引用。
若当前有被抛出的异常,函数返回`JNI_TRUE`,否则返回`JNI_FALSE`。
该函数在`JNIEnv`接口函数表的索引位置为`228`。
参数:
env JNI接口指针
返回值:
若当前有被抛出的异常,函数返回`JNI_TRUE`,否则返回`JNI_FALSE`。
该方法自JDK/JRE 1.2之后引入。
<a name="4.5"></a>
## 4.5 全局引用和局部引用
<a name="4.5.1"></a>
### 4.5.1 全局引用
<a name="4.5.1.1"></a>
#### 4.5.1.1 NewGlobalRef
```c++
jobject NewGlobalRef(JNIEnv *env, jobject obj);
```
创建一个新的全局引用来指向参数`obj`所指定的对象。参数`obj`可能是全局引用或局部引用。全局引用必须显式调用`DeleteGlobalRef()`来释放内存。
该函数在`JNIEnv`接口函数表的索引位置为`21`。
参数:
env JNI接口指针
obj 全局引用或局部引用
返回值:
返回新创建的全局引用;若系统内存不足,则返回"NULL"
<a name="4.5.1.2"></a>
#### 4.5.1.2 DeleteGlobalRef
```c++
void DeleteGlobalRef(JNIEnv *env, jobject globalRef);
```
删除全局引用。
该函数在`JNIEnv`接口函数表的索引位置为`22`。
参数:
env JNI接口指针
globalRef 待删除的全局引用
<a name="4.5.2"></a>
### 4.5.2 局部引用
局部引用只在本地方法的作用域内有效,在退出本地方法后,会自动释放掉局部引用。每个局部引用都会消耗一定量的JVM资源,因此开发者不能创建太多的局部引用,否则可能会导致系统内存不足。
<a name="4.5.2.1"></a>
#### 4.5.2.1 DeleteLocalRef
```c++
void DeleteLocalRef(JNIEnv *env, jobject localRef);
```
删除局部引用。
该函数在`JNIEnv`接口函数表的索引位置为`23`。
参数:
env JNI接口指针
localRef 待删除的局部引用
注意: 自JDK/JRE 1.1起,就提供了函数`DeleteLocalRef`供开发者手动删除局部引用。如果本地代码需要遍历很大的数组,那么及时删除无用的本地引用是非常必要的,否则可能会造成系统内存不足。
从JDK/JRE 1.2起,JNI提供另外4个函数来管理局部引用的生命周期。
<a name="4.5.2.2"></a>
#### 4.5.2.2 EnsureLocalCapacity
```c++
jint EnsureLocalCapacity(JNIEnv *env, jint capacity);
```
该函数用于确认在当前线程中是否还能创建足够数量的本地引用。若可以,则函数返回0,否则返回负数,并抛出异常。
在进入本地方法前,JVM默认会确保本地方法可以创建16个局部引用。
为了支持向后兼容,JVM会额外多创建一些局部引用,超过参数`capacity`所指定的范围。(为了支持调试,JVM可能提示开发者,创建了过多的局部引用。在JDK中,开发者可以添加参数`-verbose:jni`来打开这种信息提示)。如果JVM无法创建由参数`capacity`所指定的那么多的局部引用,则JVM会调用`FatalError`函数强制退出。
该函数在`JNIEnv`接口函数表的索引位置为`26`。
参数:
env JNI接口指针
capacity 局部引用的个数
该函数自JDK/JRE 1.2起可以使用。
<a name="4.5.2.3"></a>
#### 4.5.2.3 PushLocalFrame
```c++
jint PushLocalFrame(JNIEnv *env, jint capacity);
```
创建一个局部引用帧,在其中可以创建指定数量的局部引用,具体数量由参数`capacity`指定。若函数调用成功,则返回0;否则返回负数,并抛出`OutOfMemoryError`异常。
注意,已经在前一个局部引用帧中创建的局部引用在当前栈帧中仍然有效。
该函数在`JNIEnv`接口函数表的索引位置为`19`。
参数:
env JNI接口指针
capacity 局部引用的个数
该函数自JDK/JRE 1.2起可以使用。
<a name="4.5.2.4"></a>
#### 4.5.2.4 PopLocalFrame
```c++
jobject PopLocalFrame(JNIEnv *env, jobject result);
```
弹出当前的局部引用帧,释放所有局部引用,返回在前一个局部引用帧需要使用的目标对象的局部引用。
若不希望给前一个局部引用帧返回引用,则参数`result`传入`NULL`即可。
该函数在`JNIEnv`接口函数表的索引位置为`20`。
参数:
env JNI接口指针
result 需要返回给上层局部引用帧的局部引用
该函数自JDK/JRE 1.2起可以使用。
<a name="4.5.2.5"></a>
#### 4.5.2.5 NewLocalRef
```c++
jobject NewLocalRef(JNIEnv *env, jobject ref);
```
为参数`ref`所指向的对象引用创建一个新的局部引用,目标对象引用可能是局部引用或全局引用。如果参数`ref`的值为`NULL`,则函数返回`NULL`。
该函数在`JNIEnv`接口函数表的索引位置为`25`。
参数:
env JNI接口指针
ref 指向目标对象的引用
该函数自JDK/JRE 1.2起可以使用。
<a name="4.5.3"></a>
### 4.5.3 弱全局引用
弱全局引用是一种特殊的全局引用,区别在于被弱全局引用所指向的对象是可以被垃圾回收器回收掉的。当实际对象被回收掉时,弱全局引用实际上就指向了`NULL`。开发者需要调用`IsSameObject`函数来比较弱全局引用和`NULL`,以此判断弱全局引用所指向的对象是否已经被回收掉了。弱全局引用与Java中的弱引用作用相似。
2001.06新增声明
由于垃圾回收可能会在运行本地方法的时候发生,因此弱全局引用所指向的对象可能会在任意时刻被回收掉,开发者在使用的时候,需要注意此点。
尽管函数`IsSameObject`可用来判断弱全局引用是否指向了一个被回收掉的对象,但不能防止该对象在调用`IsSameObject`之后被释放掉。因此,函数`IsSameObject`的检查结果并不能确保以后再调用其他JNI函数的时候,目标对象没有被回收掉。
为了克服这个缺陷,推荐通过函数`NewLocalRef`或`NewGlobalRef`来访问目标对象,防止该对象被回收掉。在调用这些函数时,若目标对象已经被回收掉,则函数返回`NULL`,否则会返回一个强引用。在完成对目标对象的访问后,应立即显式删除新创建的引用对象。
弱全局引用比其他类型的弱引用(Java中的软引用或弱引用)更"弱"。若弱全局引用和软引用(或弱引用)指向了同一个对象,则在软引用(或引用)清除对目标对象的引用之前,弱全局引用都不会等同于`NULL`。
弱全局引用比Java内部需要执行`finalize`方法的对象的引用更"弱"。在目标对象执行完`finalize`方法之前,弱全局引用都不会等同于`NULL`。
交叉使用弱全局引用和虚引用(`PhantomReferences`)的结果是未定义的。就JVM的实现来说,既可以在处理虚引用之后再处理弱全局引用,也可以在处理虚引用之前先处理弱全局引用;弱全局引用和虚引用有可能会指向同一个对象,也可能不会。因此,不要交叉使用弱全局引用和虚引用。
<a name="4.5.3.1"></a>
#### 4.5.3.1 NewWeakGlobalRef
```c++
jweak NewWeakGlobalRef(JNIEnv *env, jobject obj);
```
该函数用于创建一个弱全局引用。若参数`obj`指向的对象为`NULL`,则该函数返回`NULL`;若系统内存不足,该函数返回`NULL`,并抛出`OutOfMemoryError`错误。
该函数在`JNIEnv`接口函数表的索引位置为`226`。
参数:
env JNI接口指针
obj 目标对象
该函数自JDK/JRE 1.2起可以使用。
<a name="4.5.3.2"></a>
#### 4.5.3.2 DeleteWeakGlobalRef
```c++
void DeleteWeakGlobalRef(JNIEnv *env, jweak obj);
```
该函数删除一个弱全局引用。
该函数在`JNIEnv`接口函数表的索引位置为`227`。
参数:
env JNI接口指针
obj 待删除的弱全局引用
该函数自JDK/JRE 1.2起可以使用。
<a name="4.5.4"></a>
### 4.5.4 对象操作
<a name="4.5.4.1"></a>
#### 4.5.4.1 AllocObject
```c++
jobject AllocObject(JNIEnv *env, jclass clazz);
```
为新创建的Java对象分配内存,但不会调用构造函数。返回对该对象的引用。
参数`clazz`不可以指向数组类型。
该函数在`JNIEnv`接口函数表的索引位置为`27`。
参数:
env JNI接口指针
clazz Java的类型对象
返回:
返回指向Java对象的引用;若如法构造该对象,则返回"NULL"
异常:
InstantiationException 若clazz指向接口或其他抽象类型,则抛出该异常
OutOfMemoryError 若系统内存不足,则抛出该异常
<a name="4.5.4.2"></a>
#### 4.5.4.2 NewObject, NewObjectA, NewObjectV
```c++
jobject NewObject(JNIEnv *env, jclass clazz, jmethodID methodID, ...);
jobject NewObjectA(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
jobject NewObjectV(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
```
这三个函数均可用来构造新的Java对象。其中,参数`methodID`用于指定调用哪个构造函数来初始化对象,其参数值必须是以`<init>`为方法名,以`void(V)`作为返回值调用函数`GetMethodID`所得。
参数`clazz`不可以是数组类型。
* `NewObject`: 使用函数`NewObject`时,开发者将传递给构造函数的参数直接放到参数`methodID`后面即可,`NewObject`函数会将这些参数传递给目标类型的构造函数。该函数在`JNIEnv`接口函数表的索引位置为`28`。
* `NewObjectA`: 使用函数`NewObjectA`时,开发者需要将传递给构造函数的参数包装为一个`jvalues`类型的数组,放置在参数`methodID`后面,`NewObjectA`从数组中获取参数,再传给目标类型的构造函数。该函数在`JNIEnv`接口函数表的索引位置为`30`。
* `NewObjectV`: 使用函数`NewObjectV`时,开发者需要将传递给构造函数的参数包装为类型为`va_list`的参数,放置在参数`methodID`后面,`NewObjectV`从数组中获取参数,再传给目标类型的构造函数。该函数在`JNIEnv`接口函数表的索引位置为`29`。
参数:
env JNI接口指针
clazz Java的类型对象
methodID 目标构造函数的ID值
args 要传递给构造函数的参数
返回:
返回指向Java对象的引用;若无法构造该对象,返回NULL
异常:
InstantiationException 若clazz指向接口或其他抽象类型,则抛出该异常
OutOfMemoryError 若系统内存不足,则抛出该异常
构造函数本身可能抛出的异常。
<a name="4.5.4.3"></a>
#### 4.5.4.3 GetObjectClass
```c++
jclass GetObjectClass(JNIEnv *env, jobject obj);
```
返回某个对象的类型对象。
该函数在`JNIEnv`接口函数表的索引位置为`31`。
参数:
env JNI接口指针
obj 目标对象,不可以为"NULL"
返回:
返回某个对象的类型对象。
异常:
InstantiationException 若clazz指向接口或其他抽象类型,则抛出该异常
OutOfMemoryError 若系统内存不足,则抛出该异常
<a name="4.5.4.4"></a>
#### 4.5.4.4 GetObjectRefType
```c++
jobjectRefType GetObjectRefType(JNIEnv* env, jobject obj);
```
返回目标对象的引用类型,其结果可能是局部引用、全局引用或弱全局引用。
该函数在`JNIEnv`接口函数表的索引位置为`232`。
参数:
env JNI接口指针
obj 目标对象
返回:
返回某个对象的类型对象。
JNIInvalidRefType = 0,
JNILocalRefType = 1,
JNIGlobalRefType = 2,
JNIWeakGlobalRefType = 3
其中,无效的引用类型是指,参数`obj`所指向的地址并不是由创建引用类型的函数或JNI函数所分配。例如`NULL`并不是有效的引用,因此`GetObjectRefType(env,NULL)`会返回`JNIInvalidRefType`。
另一方面,对于空引用,函数会返回创建该空引用时所用的引用类型。
函数`GetObjectRefType`不能用于已经被删除的引用。引用通常实现为指向内存中数据结构的指针,而目标数据结构可能会被JVM中其他引用分配服务所复用,因此一旦删除某个引用所指向的数据结构后,函数`GetObjectRefType`就无法指定返回值了。
该函数自JDK/JRE 1.6起可以使用。
<a name="4.5.4.5"></a>
#### 4.5.4.5 IsInstanceOf
```c++
jboolean IsInstanceOf(JNIEnv *env, jobject obj, jclass clazz);
```
该函数用于判断目标对象是否是某个类型的实例。
该函数在`JNIEnv`接口函数表的索引位置为`32`。
参数:
env JNI接口指针
obj 目标对象
clazz 目标类型
返回:
如果目标对象可以被扩展类目标类型,则返回"JNI_TRUE";否则返回"JNI_FALSE"。
<a name="4.5.4.5"></a>
#### 4.5.4.5 IsSameObject
```c++
jboolean IsSameObject(JNIEnv *env, jobject ref1, jobject ref2);
```
判断参数中两个引用是否指向同一个Java对象。
该函数在`JNIEnv`接口函数表的索引位置为`24`。
参数:
env JNI接口指针
ref1 对象引用1
ref2 对象引用2
返回:
若是,则返回"JNI_TRUE";否则返回"JNI_FALSE"。
<a name="4.5.5"></a>
### 4.5.5 访问对象的属性
<a name="4.5.5.1"></a>
#### 4.5.5.1 GetFieldID
```c++
jfieldID GetFieldID(JNIEnv *env, jclass clazz, const char *name, const char *sig);
```
该函数返回某个类型的实例属性的ID,目标属性由属性名和签名来指定。`Get<type>Field`和`Set<type>Field`系列函数使用该ID值来获取属性的值。
对未初始化的类调用该函数时,会先初始化目标类。
该函数无法获取数组的长度;应该使用`GetArrayLength()`。
该函数在`JNIEnv`接口函数表的索引位置为`94`。
参数:
env JNI接口指针
clazz 目标类型
name 属性名,以自定义UTF-8编码,以0结尾
sig 签名,以自定义UTF-8编码,以0结尾
返回:
返回属性ID;若操作失败,返回"NULL"
异常:
NoSuchFieldError 若没有目标属性,则抛出该错误
ExceptionInInitializerError 若类初始化事变,则抛出该错误
OutOfMemoryError 若内存不足,则抛出该错误
<a name="4.5.5.2"></a>
#### 4.5.5.2 `Get<type>Field`系列函数
```c++
NativeType Get<type>Field(JNIEnv *env, jobject obj, jfieldID fieldID);
```
该系列函数用于获取目标实例的目标属性的值,其中目标属性`fieldID`是通过`GetFieldID()`函数所得。
下面的内容描述了不同类型的函数和返回类型的对应关系。
function native type
GetObjectField() jobject
GetBooleanField() jboolean
GetByteField() jbyte
GetCharField() jchar
GetShortField() jshort
GetIntField() jint
GetLongField() jlong
GetFloatField() jfloat
GetDoubleField() jdouble
该系列函数在`JNIEnv`接口函数表的索引位置如下所示:
function index
GetObjectField() 95
GetBooleanField() 96
GetByteField() 97
GetCharField() 98
GetShortField() 99
GetIntField() 100
GetLongField() 101
GetFloatField() 102
GetDoubleField() 103
参数:
env JNI接口指针
obj 指向Java对象的引用,不可以为"NULL"
fieldID 有效的属性ID
返回:
返回目标属性的值。
<a name="4.5.5.3"></a>
#### 4.5.5.3 `Set<type>Field`系列函数
```c++
void Set<type>Field(JNIEnv *env, jobject obj, jfieldID fieldID, NativeType value);
```
该系列函数用于对目标对象的目标属性进行赋值,其中目标属性`fieldID`是通过`GetFieldID()`函数所得。
下面的内容描述了不同类型的函数和属性类型的对应关系。
function type
SetObjectField() jobject
SetBooleanField() jboolean
SetByteField() jbyte
SetCharField() jchar
SetShortField() jshort
SetIntField() jint
SetLongField() jlong
SetFloatField() jfloat
SetDoubleField() jdouble
该系列函数在`JNIEnv`接口函数表的索引位置如下所示:
function index
SetObjectField() 104
SetBooleanField() 105
SetByteField() 106
SetCharField() 107
SetShortField() 108
SetIntField() 109
SetLongField() 110
SetFloatField() 111
SetDoubleField() 112
参数:
env JNI接口指针
obj 指向Java对象的引用,不可以为"NULL"
fieldID 有效的属性ID
value 待赋值的内容
<a name="4.5.6"></a>
### 4.5.6 调用实例方法
<a name="4.5.6.1"></a>
#### 4.5.6.1 GetMethodID
```c++
jmethodID GetMethodID(JNIEnv *env, jclass clazz, const char *name, const char *sig);
```
返回某个类或接口的实例方法ID。目标方法可能被定义于类的某个父类,并通过名字和参数来唯一定位。
对未初始化的类调用该函数时,会先初始化目标类。
若要获取构造函数的方法ID,需要以`<init>`作为方法名,以`void(V)`作为返回类型。
该函数在`JNIEnv`接口函数表的索引位置是`33`。
参数:
env JNI接口指针
clazz 目标类型
name 目标方法的名字,以自定义UTF-8编码,以0结尾
sig 目标方法签名,以自定义UTF-8编码,以0结尾
返回:
返回目标方法的ID;若找不到目标方法,返回"NULL"。
异常:
NoSuchMethodError 若找不到目标方法,抛出该错误
ExceptionInInitializerError 若类初始化错误,抛出该错误
OutOfMemoryError 若系统内存不足,抛出该错误
<a name="4.5.6.2"></a>
#### 4.5.6.2 `Call<type>Method` `Call<type>MethodA`和`Call<type>MethodV`系列函数
```c++
NativeType Call<type>Method(JNIEnv *env, jobject obj, jmethodID methodID, ...);
NativeType Call<type>MethodA(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
NativeType Call<type>MethodV(JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
```
这3个系列的函数用于在本地方法中调用Java对象的实例方法,其区别在于如何处理被调用函数的参数。
调用目标对象的实例方法时,方法的ID值必须通过调用函数`GetMethodID()`来获取。
需要注意的是,如果被调用的函数是私有方法或构造函数,则必须通过其本身的类来获取方法ID,而不能通过其父类获取。
* `Call<type>Method`: 使用函数`Call<type>MethodwObject`时,开发者将传递给目标函数的参数直接放到参数`methodID`后面即可,函数`Call<type>Method`会将这些参数传递给目标函数。
* `Call<type>MethodA`: 使用函数`Call<type>MethodA`时,开发者需要将传递给目标函数的参数包装为一个`jvalues`类型的数组,放置在参数`methodID`后面,`Call<type>MethodA`从数组中获取参数,再传给目标函数。
* `Call<type>MethodV`: 使用函数`Call<type>MethodV`时,开发者需要将传递给目标函数的参数包装为类型为`va_list`的参数,放置在参数`methodID`后面,`Call<type>MethodV`从数组中获取参数,再传给目标函数。
下表描述不同类型所对应的具体函数:
function native type
CallVoidMethod() void
CallVoidMethodA() void
CallVoidMethodV() void
CallObjectMethod() jobject
CallObjectMethodA() jobject
CallObjectMethodV() jobject
CallBooleanMethod() jboolena
CallBooleanMethodA() jboolean
CallBooleanMethodV() jboolean
CallByteMethod() jbyte
CallByteMethodA() jbyte
CallByteMethodV() jbyte
CallCharMethod() jchar
CallCharMethodA() jchar
CallCharMethodV() jchar
CallShortMethod() jshort
CallShortMethodA() jshort
CallShortMethodV() jshort
CallIntMethod() jint
CallIntMethodA() jint
CallIntMethodV() jint
CallLongMethod() jlong
CallLongMethodA() jlong
CallLongMethodV() jlong
CallFloatMethod() jfloat
CallFloatMethodA() jfloat
CallFloatMethodV() jfloat
CallDoubleMethod() jdouble
CallDoubleMethodA() jdouble
CallDoubleMethodV() jdouble
下表展示了各个函数在`JNIEnv`接口函数表的索引:
function index
CallVoidMethod() 61
CallVoidMethodA() 63
CallVoidMethodV() 62
CallObjectMethod() 34
CallObjectMethodA() 36
CallObjectMethodV() 35
CallBooleanMethod() 37
CallBooleanMethodA() 39
CallBooleanMethodV() 38
CallByteMethod() 40
CallByteMethodA() 42
CallByteMethodV() 41
CallCharMethod() 43
CallCharMethodA() 45
CallCharMethodV() 44
CallShortMethod() 46
CallShortMethodA() 48
CallShortMethodV() 47
CallIntMethod() 49
CallIntMethodA() 51
CallIntMethodV() 50
CallLongMethod() 52
CallLongMethodA() 54
CallLongMethodV() 53
CallFloatMethod() 55
CallFloatMethodA() 57
CallFloatMethodV() 56
CallDoubleMethod() 58
CallDoubleMethodA() 60
CallDoubleMethodV() 59
参数:
env JNI接口指针
obj 指向Java对象的引用
methodID 目标方法的ID值
返回:
返回调用目标方法的返回值
异常:
抛出在执行目标方法时抛出的异常
<a name="4.5.6.3"></a>
#### 4.5.6.3 `CallNonvirtual<type>Method` `CallNonvirtual<type>MethodA` `CallNonvirtual<type>MethodV`系列函数
```c++
NativeType CallNonvirtual<type>Method(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
NativeType CallNonvirtual<type>MethodA(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue *args);
NativeType CallNonvirtual<type>MethodV(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args);
```
这3个系列的函数用于调用某个Java对象的实例方法,方法的ID值通过调用`GetMethodID()`方法获得。
`CallNonvirtual<type>Method`系列函数和`Call<type>Method`系列函数的区别在于,`Call<type>Method`系列函数是基于实例的类来调用目标方法的,`CallNonvirtual<type>Method`系列函数是基于参数`clazz`指定的类来调用目标方法的,而且参数`methodID`也应该是在该类上获得的。获取参数`methodID`是,必须是从对象的真实类型或其父类中获得的。
* `CallNonvirtual<type>Method`: 使用函数`CallNonvirtual<type>Method`时,开发者将传递给目标函数的参数直接放到参数`methodID`后面即可,函数`CallNonvirtual<type>Method`会将这些参数传递给目标函数。
* `CallNonvirtual<type>MethodA`: 使用函数`CallNonvirtual<type>MethodA`时,开发者需要将传递给目标函数的参数包装为一个`jvalues`类型的数组,放置在参数`methodID`后面,`CallNonvirtual<type>MethodA`从数组中获取参数,再传给目标函数。
* `CallNonvirtual<type>MethodV`: 使用函数`CallNonvirtual<type>MethodV`时,开发者需要将传递给目标函数的参数包装为类型为`va_list`的参数,放置在参数`methodID`后面,`CallNonvirtual<type>MethodV`从数组中获取参数,再传给目标函数。
下表描述不同类型所对应的具体函数:
function native type
CallNonvirtualVoidMethod() void
CallNonvirtualVoidMethodA() void
CallNonvirtualVoidMethodV() void
CallNonvirtualObjectMethod() jobject
CallNonvirtualObjectMethodA() jobject
CallNonvirtualObjectMethodV() jobject
CallNonvirtualBooleanMethod() jboolean
CallNonvirtualBooleanMethodA() jboolean
CallNonvirtualBooleanMethodV() jboolean
CallNonvirtualByteMethod() jbyte
CallNonvirtualByteMethodA() jbyte
CallNonvirtualByteMethodV() jbyte
CallNonvirtualCharMethod() jchar
CallNonvirtualCharMethodA() jchar
CallNonvirtualCharMethodV() jchar
CallNonvirtualShortMethod() jshort
CallNonvirtualShortMethodA() jshort
CallNonvirtualShortMethodV() jshort
CallNonvirtualIntMethod() jint
CallNonvirtualIntMethodA() jint
CallNonvirtualIntMethodV() jint
CallNonvirtualLongMethod() jlong
CallNonvirtualLongMethodA() jlong
CallNonvirtualLongMethodV() jlong
CallNonvirtualFloatMethod() jfloat
CallNonvirtualFloatMethodA() jfloat
CallNonvirtualFloatMethodV() jfloat
CallNonvirtualDoubleMethod() jdouble
CallNonvirtualDoubleMethodA() jdouble
CallNonvirtualDoubleMethodV() jdouble
下表展示了各个函数在`JNIEnv`接口函数表的索引:
function index
CallNonvirtualVoidMethod() 91
CallNonvirtualVoidMethodA() 93
CallNonvirtualVoidMethodV() 92
CallNonvirtualObjectMethod() 64
CallNonvirtualObjectMethodA() 66
CallNonvirtualObjectMethodV() 65
CallNonvirtualBooleanMethod() 67
CallNonvirtualBooleanMethodA() 69
CallNonvirtualBooleanMethodV() 68
CallNonvirtualByteMethod() 70
CallNonvirtualByteMethodA() 72
CallNonvirtualByteMethodV() 71
CallNonvirtualCharMethod() 73
CallNonvirtualCharMethodA() 75
CallNonvirtualCharMethodV() 74
CallNonvirtualShortMethod() 76
CallNonvirtualShortMethodA() 78
CallNonvirtualShortMethodV() 77
CallNonvirtualIntMethod() 79
CallNonvirtualIntMethodA() 81
CallNonvirtualIntMethodV() 80
CallNonvirtualLongMethod() 82
CallNonvirtualLongMethodA() 84
CallNonvirtualLongMethodV() 83
CallNonvirtualFloatMethod() 85
CallNonvirtualFloatMethodA() 87
CallNonvirtualFloatMethodV() 86
CallNonvirtualDoubleMethod() 88
CallNonvirtualDoubleMethodA() 90
CallNonvirtualDoubleMethodV() 89
参数:
env JNI接口指针
clazz 目标类对象
obj 指向Java对象的引用
methodID 目标方法的ID值
返回:
返回调用目标方法的返回值
异常:
抛出调用目标方法时抛出的异常
<a name="4.5.7"></a>
### 4.5.7 访问静态属性
<a name="4.5.7.1"></a>
#### 4.5.7.1 GetStaticFieldID
```c++
jfieldID GetStaticFieldID(JNIEnv *env, jclass clazz, const char *name, const char *sig);
```
返回某个类的静态属性的ID值,目标属性通过名字和签名来定位。`GetStatic<type>Field`和`SetStatic<type>Field`系列函数会通过该ID值来访问静态属性的值。
对于未初始化的类,调用该函数时,会先完成类的初始化。
该函数在`JNIEnv`接口函数表的索引位置是`144`。
参数:
env JNI接口指针
clazz 目标类对象
name 目标方法的名字,以自定义UTF-8编码,以0结尾
sig 目标方法签名,以自定义UTF-8编码,以0结尾
返回:
返回目标属性的ID值;若目标属性不存在,返回"NULL"
异常:
NoSuchFieldError 若目标属性不存在,抛出该错误
ExceptionInInitializerError 若初始化类时发生错误,抛出该错误
OutOfMemoryError 若系统内存不足,抛出该错误
<a name="4.5.7.2"></a>
#### 4.5.7.2 `GetStatic<type>Field`系列函数
```c++
NativeType GetStatic<type>Field(JNIEnv *env, jclass clazz, jfieldID fieldID);
```
该系列函数用于访问目标对象的静态属性值,属性ID必须通过调用函数`GetStaticFieldID()`来获取。
下表描述不同类型所对应的具体函数:
function native type
GetStaticObjectField() jobject
GetStaticBooleanField() jboolean
GetStaticByteField() jbyte
GetStaticCharField() jchar
GetStaticShortField() jshort
GetStaticIntField() jint
GetStaticLongField() jlong
GetStaticFloatField() jfloat
GetStaticDoubleField() jdouble
下表描述了不同函数在`JNIEnv`中的索引位置:
function index
GetStaticObjectField() 145
GetStaticBooleanField() 146
GetStaticByteField() 147
GetStaticCharField() 148
GetStaticShortField() 149
GetStaticIntField() 150
GetStaticLongField() 151
GetStaticFloatField() 152
GetStaticDoubleField() 153
参数:
env JNI接口指针
clazz 目标类对象
fieldID 静态属性域的ID值
返回:
返回静态属性的值
<a name="4.5.7.3"></a>
#### 4.5.7.3 `SetStatic<type>Field`系列函数
```c++
void SetStatic<type>Field(JNIEnv *env, jclass clazz, jfieldID fieldID, NativeType value);
```
该函数用于设置某个对象的目标属性值。目标属性的ID值需要通过调用函数`GetStaticFieldID()`来获取。
下表描述不同类型所对应的具体函数:
function native type
SetStaticObjectField() jobject
SetStaticBooleanField() jboolean
SetStaticByteField() jbyte
SetStaticCharField() jchar
SetStaticShortField() jshort
SetStaticIntField() jint
SetStaticLongField() jlong
SetStaticFloatField() jfloat
SetStaticDoubleField() jdouble
下表描述了不同函数在`JNIEnv`中的索引位置:
function index
SetStaticObjectField() 154
SetStaticBooleanField() 155
SetStaticByteField() 156
SetStaticCharField() 157
SetStaticShortField() 158
SetStaticIntField() 159
SetStaticLongField() 160
SetStaticFloatField() 161
SetStaticDoubleField() 162
参数:
env JNI接口指针
clazz 目标类对象
fieldID 目标属性域的ID
value 待设置的属性值。
<a name="4.5.8"></a>
### 4.5.8 调用静态方法
<a name="4.5.8.1"></a>
#### 4.5.8.1 GetStaticMethodID
```c++
jmethodID GetStaticMethodID(JNIEnv *env, jclass clazz, const char *name, const char *sig);
```
返回某个静态方法的ID值,目标方法由方法名和签名来定位。
对于未初始化的类,调用该方法时,会先进行类的初始化。
该函数在`JNIEnv`接口函数表的索引位置是`113`。
参数:
env JNI接口指针
clazz 目标类对象
name 目标方法的名字,以自定义UTF-8编码,以0结尾
sig 目标方法签名,以自定义UTF-8编码,以0结尾
返回:
返回目标方法的ID值;若操作失败,返回"NULL"
异常:
NoSuchMethodError 若目标方法不存在,抛出该错误
ExceptionInInitializerError 若初始化类时发生错误,抛出该错误
OutOfMemoryError 若系统内存不足,抛出该错误
<a name="4.5.8.2"></a>
#### 4.5.8.2 `CallStatic<type>Method` `CallStatic<type>MethodA` `CallStatic<type>MethodV`系列函数
```c++
NativeType CallStatic<type>Method(JNIEnv *env, jclass clazz, jmethodID methodID, ...);
NativeType CallStatic<type>MethodA(JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args);
NativeType CallStatic<type>MethodV(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
```
这3个系列函数用于调用由参数`methodID`指定的静态方法。
* `CallStatic<type>Method`: 开发者将传递给目标函数的参数直接放到参数`methodID`后面即可,函数`CallStatic<type>Method`会将这些参数传递给目标函数。
* `CallStatic<type>MethodA`: 开发者需要将传递给目标函数的参数包装为一个`jvalues`类型的数组,放置在参数`methodID`后面,`CallStatic<type>MethodA`从数组中获取参数,再传给目标函数。
* `CallStatic<type>MethodV`: 开发者需要将传递给目标函数的参数包装为类型为`va_list`的参数,放置在参数`methodID`后面,`CallStatic<type>MethodV`从数组中获取参数,再传给目标函数。
下表描述不同类型所对应的具体函数:
function native type
CallStaticVoidMethod() void
CallStaticVoidMethodA() void
CallStaticVoidMethodV() void
CallStaticObjectMethod() jobject
CallStaticObjectMethodA() jobejct
CallStaticObjectMethodV() jobject
CallStaticBooleanMethod() jboolean
CallStaticBooleanMethodA() jboolean
CallStaticBooleanMethodV() jboolean
CallStaticByteMethod() jbyte
CallStaticByteMethodA() jbyte
CallStaticByteMethodV() jbyte
CallStaticCharMethod() jchar
CallStaticCharMethodA() jchar
CallStaticCharMethodV() jchar
CallStaticShortMethod() jshort
CallStaticShortMethodA() jshort
CallStaticShortMethodV() jshort
CallStaticIntMethod() jint
CallStaticIntMethodA() jint
CallStaticIntMethodV() jint
CallStaticLongMethod() jlong
CallStaticLongMethodA() jlong
CallStaticLongMethodV() jlong
CallStaticFloatMethod() jfloat
CallStaticFloatMethodA() jfloat
CallStaticFloatMethodV() jfloat
CallStaticDoubleMethod() jdouble
CallStaticDoubleMethodA() jdouble
CallStaticDoubleMethodV() jdouble
下表描述了不同函数在`JNIEnv`中的索引位置:
function index
CallStaticVoidMethod() 141
CallStaticVoidMethodA() 143
CallStaticVoidMethodV() 142
CallStaticObjectMethod() 114
CallStaticObjectMethodA() 116
CallStaticObjectMethodV() 115
CallStaticBooleanMethod() 117
CallStaticBooleanMethodA() 119
CallStaticBooleanMethodV() 118
CallStaticByteMethod() 120
CallStaticByteMethodA() 122
CallStaticByteMethodV() 121
CallStaticCharMethod() 123
CallStaticCharMethodA() 125
CallStaticCharMethodV() 124
CallStaticShortMethod() 126
CallStaticShortMethodA() 128
CallStaticShortMethodV() 127
CallStaticIntMethod() 129
CallStaticIntMethodA() 131
CallStaticIntMethodV() 130
CallStaticLongMethod() 132
CallStaticLongMethodA() 134
CallStaticLongMethodV() 133
CallStaticFloatMethod() 135
CallStaticFloatMethodA() 137
CallStaticFloatMethodV() 136
CallStaticDoubleMethod() 138
CallStaticDoubleMethodA() 140
CallStaticDoubleMethodV() 139
参数:
env JNI接口指针
clazz 目标类对象
methodID 目标方法的ID值
返回:
返回调用目标方法的返回值
异常:
抛出调用目标方法时抛出的异常
<a name="4.5.9"></a>
### 4.5.9 字符串操作
<a name="4.5.9.1"></a>
#### 4.5.9.1 NewString
```c++
jstring NewString(JNIEnv *env, const jchar *unicodeChars, jsize len);
```
该用法用于以根据Unicode字符数组创建新的`java.lang.String`对象。
该函数在`JNIEnv`接口函数表的索引位置是`163`。
参数:
env JNI接口指针
unicodeChars 指向Unicode字符串的指针
len Unicode字符串的长度
返回:
返回新创建的"java.lang.Object"对象;如果无法创建新对象,则返回"NULL"
异常:
OutOfMemoryError 若系统内存不足,则抛出该错误
<a name="4.5.9.2"></a>
#### 4.5.9.2 GetStringLength
```c++
jsize GetStringLength(JNIEnv *env, jstring string);
```
返回Java字符串的长度,即Unicode字符的个数。
该函数在`JNIEnv`接口函数表的索引位置是`164`。
参数:
env JNI接口指针
string Java的字符串对象
返回:
返回字符串的长度
<a name="4.5.9.3"></a>
#### 4.5.9.3 GetStringChars
```c++
const jchar * GetStringChars(JNIEnv *env, jstring string, jboolean *isCopy);
```
返回指向字符串对象中Unicode字符数组的指针。在调用函数`ReleaseStringChars()`之后,该指针的值变为无效。
调用该函数时,若参数`isCopy`不为`NULL`,则:
* 若执行了拷贝,则`isCopy`被设置为`JNI_TRUE`
* 若未执行拷贝,则`isCopy`被设置为`JNI_FALSE`
该函数在`JNIEnv`接口函数表的索引位置是`165`。
参数:
env JNI接口指针
string Java的字符串对象
isCopy 指向布尔值的指针
返回:
返回指向Unicode字符串的指针;如果操作失败,返回"NULL"
<a name="4.5.9.3"></a>
#### 4.5.9.3 ReleaseStringChars
```c++
void ReleaseStringChars(JNIEnv *env, jstring string, const jchar *chars);
```
该函数用于通知JVM"本地代码不会再访问某个字符串的字符数组了",参数`chars`的值是通过调用函数`GetStringChars()`所得。
该函数在`JNIEnv`接口函数表的索引位置是`166`。
参数:
env JNI接口指针
string Java的字符串对象
chars 指向Unicode字符串的指针
<a name="4.5.9.4"></a>
#### 4.5.9.4 NewStringUTF
```c++
jstring NewStringUTF(JNIEnv *env, const char *bytes);
```
该函数用于构造一个`java.lang.String`对象,字符串的内容由参数`bytes`指定,以自定义UTF-8编码。
该函数在`JNIEnv`接口函数表的索引位置是`167`。
参数:
env JNI接口指针
bytes 指向以自定义UTF-8编码的字符串内容
返回:
返回一个字符串对象;若无法创建,则返回"NULL"
异常:
OutOfMemoryError 若系统内存不足,则抛出此错误
<a name="4.5.9.5"></a>
#### 4.5.9.5 GetStringUTFLength
```c++
jsize GetStringUTFLength(JNIEnv *env, jstring string);
```
返回以自定义UTF-8编码的字符串所使用字节的个数。
该函数在`JNIEnv`接口函数表的索引位置是`168`。
参数:
env JNI接口指针
string 字符串对象
返回:
返回字符串所使用的字节的个数。
<a name="4.5.9.6"></a>
#### 4.5.9.6 GetStringUTFChars
```c++
const char * GetStringUTFChars(JNIEnv *env, jstring string, jboolean *isCopy);
```
返回指向以自定义UTF-8编码的字符串的字节数组的指针,当调用函数`ReleaseStringUTFChars()`后,该指针的值变为无效。
调用该函数时,若参数`isCopy`不为`NULL`,则:
* 若执行了拷贝,则`isCopy`被设置为`JNI_TRUE`
* 若未执行拷贝,则`isCopy`被设置为`JNI_FALSE`
该函数在`JNIEnv`接口函数表的索引位置是`169`。
参数:
env JNI接口指针
string 字符串对象
isCopy 指向布尔值的指针
返回:
返回指向以自定义UTF-8编码的字符串的字节数组的指针;若操作失败,则返回"NULL"
<a name="4.5.9.7"></a>
#### 4.5.9.7 ReleaseStringUTFChars
```c++
void ReleaseStringUTFChars(JNIEnv *env, jstring string, const char *utf);
```
该函数用于通知JVM,"本地代码不会再访问参数utf指向的数组",参数`utf`的值由函数`GetStringUTFChars()`所得。
该函数在`JNIEnv`接口函数表的索引位置是`170`。
参数:
env JNI接口指针
string 字符串对象
utf 指向字符串内容的指针
注意:在JDK/JRE 1.1中,开发者可以得到原生类型的数组;到了JDK/JRE 1.2时,添加了一系列函数,以便在本地代码中可以获取以UTF-8或自定义UTF-8编码的字符。参见下面的函数介绍。
<a name="4.5.9.8"></a>
#### 4.5.9.8 GetStringRegion
```c++
void GetStringRegion(JNIEnv *env, jstring str, jsize start, jsize len, jchar *buf);
```
该函数用于拷贝指定长度的Unicode字符到指定的字符数组中。
若索引超过限制,则抛出`StringIndexOutOfBoundsException`异常。
该函数在`JNIEnv`接口函数表的索引位置是`220`。
该函数自JDK/JRE 1.2之后可用。
<a name="4.5.9.9"></a>
#### 4.5.9.9 GetStringUTFRegion
```c++
void GetStringUTFRegion(JNIEnv *env, jstring str, jsize start, jsize len, char *buf);
```
从目标字符串中,拷贝指定数量的Unicode字符,转换为自定义UTF-8编码,再放置到指定的数组中。
若索引超过限制,则抛出`StringIndexOutOfBoundsException`异常。
该函数在`JNIEnv`接口函数表的索引位置是`221`。
该函数自JDK/JRE 1.2之后可用。
<a name="4.5.9.10"></a>
#### 4.5.9.10 GetStringCritical, ReleaseStringCritical
```c++
const jchar * GetStringCritical(JNIEnv *env, jstring string, jboolean *isCopy);
void ReleaseStringCritical(JNIEnv *env, jstring string, const jchar *carray);
```
这两个函数的语义与前面提到的函数`GetStringChars`和`ReleaseStringChars`类似。在获取字符数组时,JVM会尽量返回指向字符串元素的指针;否则,会拷贝一份数组内容并返回。`Get/ReleaseStringCritical`函数和`Get/ReleaseStringChars`函数的关键区别在于如何调用他们:如果代码段中调用了`GetStringCritical`函数,则在调用`ReleaseStringChars`之前,本地代码**禁止**再调用其他JNI函数,否则会阻塞当前线程的运行。
函数`GetPrimitiveArrayCritical`和`ReleasePrimitiveArrayCritical`的调用方式于此类似。
函数在`JNIEnv`接口函数表的索引位置如下所示:
GetStringCritical 224
ReleaseStingCritical 225
该函数自JDK/JRE 1.2之后可用。
<a name="4.5.10"></a>
### 4.5.10 数组操作
<a name="4.5.10.1"></a>
#### 4.5.10.1 GetArrayLength
```c++
jsize GetArrayLength(JNIEnv *env, jarray array);
```
返回数组的长度。
函数在`JNIEnv`接口函数表的索引位置为`171`。
参数:
env JNI接口指针
array 数组对象
返回:
返回数组的长度
<a name="4.5.10.2"></a>
#### 4.5.10.2 NewObjectArray
```c++
jobjectArray NewObjectArray(JNIEnv *env, jsize length, jclass elementClass, jobject initialElement);
```
构造一个指定类型的数组对象,并以指定值来初始化数组内容。
函数在`JNIEnv`接口函数表的索引位置为`172`。
参数:
env JNI接口指针
length 数组长度
elementClass 数组类型
initialElement 数组内容的初始值
返回:
返回数组对象;若无法创建数组对象,返回"NULL"
异常:
OutOfMemoryError 系统内存不足时,抛出该错误
<a name="4.5.10.3"></a>
#### 4.5.10.3 GetObjectArrayElement
```c++
jobject GetObjectArrayElement(JNIEnv *env, jobjectArray array, jsize index);
```
返回`Object`类型数组中的某个元素。
函数在`JNIEnv`接口函数表的索引位置为`173`。
参数:
env JNI接口指针
array 目标数组
index 目标索引位置
返回:
返回目标索引位置的元素
异常:
ArrayIndexOutOfBoundsException 若指定的索引并不在目标数组的有效范围内,抛出该异常
<a name="4.5.10.4"></a>
#### 4.5.10.4 SetObjectArrayElement
```c++
void SetObjectArrayElement(JNIEnv *env, jobjectArray array, jsize index, jobject value);
```
对目标数组的指定索引位置赋值。
函数在`JNIEnv`接口函数表的索引位置为`173`。
参数:
env JNI接口指针
array 目标数组
index 目标索引位置
value 待设置的值
异常:
ArrayIndexOutOfBoundsException 若指定的索引并不在目标数组的有效范围内,抛出该异常
ArrayStoreException 若待设置的值不是数组类型的子类,则抛出该异常
<a name="4.5.10.5"></a>
#### 4.5.10.5 `New<PrimitiveType>Array`系列函数
```c++
ArrayType New<PrimitiveType>Array(JNIEnv *env, jsize length);
```
该系列函数用于创建原生类型的数组对象。
下表描述了原生类型与具体函数的对应关系
function array type
NewBooleanArray() jbooleanArray
NewByteArray() jbyteArray
NewCharArray() jcharArray
NewShortArray() jshortArray
NewIntArray() jintArray
NewLongArray() jlongArray
NewFloatArray() jfloatArray
NewDoubleArray() jdoubleArray
下表描述了具体函数在`JNIEnv`接口函数中的索引位置
function index
NewBooleanArray() 175
NewByteArray() 176
NewCharArray() 177
NewShortArray() 178
NewIntArray() 179
NewLongArray() 180
NewFloatArray() 181
NewDoubleArray() 182
参数:
env JNI接口指针
length 数组的长度
返回:
返回新创建的对象;若无法创建,则返回"NULL"
<a name="4.5.10.6"></a>
#### 4.5.10.6 `Get<PrimitiveType>ArrayElements`系列函数
```c++
NativeType *Get<PrimitiveType>ArrayElements(JNIEnv *env, ArrayType array, jboolean *isCopy);
```
该系列函数用于获取数组内容,返回指向内容的指针,当调用函数`Release<PrimitiveType>ArrayElements()`后,该指针的值变为无效。由于该函数返回的值可能是原始数组内容的拷贝,因此修改其数组元素时并不能反映到原始数组中。这时需要调用函数`Release<PrimitiveType>ArrayElements()`函数,使修改生效。
调用该函数时,若参数`isCopy`不为`NULL`,则:
* 若执行了拷贝,则`isCopy`被设置为`JNI_TRUE`
* 若未执行拷贝,则`isCopy`被设置为`JNI_FALSE`
无论布尔值在JVM中是如何表示的,函数`GetBooleanArrayElements()`都会返回`jboolean`类型的指针,其中每个字节表示一个数组元素。其他类型的数组在内存中都是连续存放的。
下表描述了原生类型和具体函数的对应关系:
function array type native type
GetBooleanArrayElements() jbooleanArray jboolean
GetByteArrayElements() jbyteArray jbyte
GetCharArrayElements() jcharArray jchar
GetShortArrayElements() jshortArray jshort
GetIntArrayElements() jintArray jint
GetLongArrayElements() jlongArray jlong
GetFloatArrayElements() jfloatArray jfloat
GetDoubleArrayElements() jdoubleArray jdouble
下表描述了函数在`JNIEnv`接口函数中的索引位置:
function index
GetBooleanArrayElements() 183
GetByteArrayElements() 184
GetCharArrayElements() 185
GetShortArrayElements() 186
GetIntArrayElements() 187
GetLongArrayElements() 188
GetFloatArrayElements() 189
GetDoubleArrayElements() 190
参数:
env JNI接口指针
array 数组的长度
isCopy 指向布尔值的指针
返回:
返回指向数组元素的指针;若操作失败,则返回"NULL"
<a name="4.5.10.7"></a>
#### 4.5.10.7 `Release<PrimitiveType>ArrayElements`系列函数
```c++
void Release<PrimitiveType>ArrayElements(JNIEnv *env, ArrayType array, NativeType *elems, jint mode);
```
该系列函数用于通知JVM,"本地代码不会再访问数组元素了"。参数`elems`是指向数组元素的指针,通过调用函数`Get<PrimitiveType>ArrayElements()`获得。如果必要的话,该函数会将所有对数组元素的更新拷贝回原始数组。
参数`mode`指定应该如何释放数组缓冲。如果参数`elems`所指向的内容并非是原始数组的拷贝,则参数`mode`不起作用;否则按照如下参数值来执行:
mode actions
0 将数组内容拷贝回原始数组,并释放参数elems指向的缓冲区
JNI_COMMIT 将数组内容拷贝回原始数组,但不释放参数elems指向的缓冲区
JNI_ABORT 释放参数elems指向的缓冲区,但不会将数组内容拷贝回原始数组
大部分情况下,开发者都会将参数`mode`设置为0,以便同步数组内容到原始数组。其他参数值给了开发者更灵活的操作,使用时请小心。
下表描述了原生类型和具体函数的对应关系:
function array type native type
ReleaseBooleanArrayElements() jbooleanArray jboolean
ReleaseByteArrayElements() jbyteArray jbyte
ReleaseCharArrayElements() jcharArray jchar
ReleaseShortArrayElements() jshortArray jshort
ReleaseIntArrayElements() jintArray jint
ReleaseLongArrayElements() jlongArray jlong
ReleaseFloatArrayElements() jfloatArray jfloat
ReleaseDoubleArrayElements() jdoubleArray jdouble
下表描述了函数在`JNIEnv`接口函数中的索引位置:
function index
ReleaseBooleanArrayElements() 191
ReleaseByteArrayElements() 192
ReleaseCharArrayElements() 193
ReleaseShortArrayElements() 194
ReleaseIntArrayElements() 195
ReleaseLongArrayElements() 196
ReleaseFloatArrayElements() 197
ReleaseDoubleArrayElements() 198
参数:
env JNI接口指针
array 数组对象
elems 指向数组元素数组的指针
mode 释放方式
<a name="4.5.10.8"></a>
#### 4.5.10.8 `Get<PrimitiveType>ArrayRegion`系列函数
```c++
void Get<PrimitiveType>ArrayRegion(JNIEnv *env, ArrayType array, jsize start, jsize len, NativeType *buf);
```
该系列函数用于将数组中某个范围的元素拷贝到指定的缓冲区中。
下表描述了原生类型和具体函数的对应关系:
function array type native type
GetBooleanArrayRegion() jbooleanArray jboolean
GetByteArrayRegion() jbyteArray jbyte
GetCharArrayRegion() jcharArray jchar
GetShortArrayRegion() jshortArray jhort
GetIntArrayRegion() jintArray jint
GetLongArrayRegion() jlongArray jlong
GetFloatArrayRegion() jfloatArray jloat
GetDoubleArrayRegion() jdoubleArray jdouble
下表描述了函数在`JNIEnv`接口函数中的索引位置:
function index
GetBooleanArrayRegion() 199
GetByteArrayRegion() 200
GetCharArrayRegion() 201
GetShortArrayRegion() 202
GetIntArrayRegion() 203
GetLongArrayRegion() 204
GetFloatArrayRegion() 205
GetDoubleArrayRegion() 206
参数:
env JNI接口指针
array 数组对象
start 起始位置
len 拷贝的长度
buf 指定的缓冲区
异常:
ArrayIndexOutOfBoundsException 若指定的索引不在指定数组的有效范围内,抛出该异常
<a name="4.5.10.9"></a>
#### 4.5.10.9 `Set<PrimitiveType>ArrayRegion`系列函数
```c++
void Set<PrimitiveType>ArrayRegion(JNIEnv *env, ArrayType array, jsize start, jsize len, const NativeType *buf);
```
该系列函数用于将指定缓冲区中的内容拷贝到数组的指定的范围内。
下表描述了原生类型和具体函数的对应关系:
function array type native type
SetBooleanArrayRegion() jbooleanArray jboolean
SetByteArrayRegion() jbyteArray jbyte
SetCharArrayRegion() jcharArray jchar
SetShortArrayRegion() jshortArray jshort
SetIntArrayRegion() jintArray jint
SetLongArrayRegion() jlongArray jlong
SetFloatArrayRegion() jfloatArray jfloat
SetDoubleArrayRegion() jdoubleArray jdouble
下表描述了函数在`JNIEnv`接口函数中的索引位置:
function index
SetBooleanArrayRegion() 207
SetByteArrayRegion() 208
SetCharArrayRegion() 209
SetShortArrayRegion() 210
SetIntArrayRegion() 211
SetLongArrayRegion() 212
SetFloatArrayRegion() 213
SetDoubleArrayRegion() 214
参数:
env JNI接口指针
array 数组对象
start 起始位置
len 拷贝的长度
buf 指定的缓冲区
异常:
ArrayIndexOutOfBoundsException 若指定的索引不在指定数组的有效范围内,抛出该异常
>注意,在JDK/JRE 1.1中,开发者可以通过函数`Get/Release<primitivetype>ArrayElements`来获取指向原生数组元素的指针。若JVM支持**pinning**机制,则该函数会返回指向原始数据的指针;否则会返回指向拷贝数据的指针。
>
>在JDK/JRE 1.3中,引入了新的函数,即便JVM不支持**pinning**机制,也可以返回原始数据的指针。
<a name="4.5.10.10"></a>
#### 4.5.10.10 GetPrimitiveArrayCritical, ReleasePrimitiveArrayCritical
```c++
void * GetPrimitiveArrayCritical(JNIEnv *env, jarray array, jboolean *isCopy);
void ReleasePrimitiveArrayCritical(JNIEnv *env, jarray array, void *carray, jint mode);
```
这两个函数的语义与前面提到的函数`Get/Release<primitivetype>ArrayElements`类似。JVM会尽量返回指向原始数组的指针;实在不行的话,会返回拷贝数组的指针。他们关键区别在于调用方式。
在调用函数`GetPrimitiveArrayCritical`之后,本地代码应该尽快调用函数`ReleasePrimitiveArrayCritical`。正如函数名所表达的,这两个函数中间的代码,是"**关键代码**"。在关键代码中,本地代码**禁止**再调用其他JNI函数或系统调用,否则可能会造成当前线程阻塞。
因为存在这种限制条件,即便JVM不支持**pinning**机制,本地代码调用该函数时很有可能会得到指向原始数组的指针。例如,当通过该函数获取到指向原始数组的指针时,JVM可能会临时禁用垃圾回收器。
多次调用`Get/Release<primitivetype>ArrayElements`时,可以嵌套进行,例如:
```c++
jint len = (*env)->GetArrayLength(env, arr1);
jbyte *a1 = (*env)->GetPrimitiveArrayCritical(env, arr1, 0);
jbyte *a2 = (*env)->GetPrimitiveArrayCritical(env, arr2, 0);
/* We need to check in case the VM tried to make a copy. */
if (a1 == NULL || a2 == NULL) {
... /* out of memory exception thrown */
}
memcpy(a1, a2, len);
(*env)->ReleasePrimitiveArrayCritical(env, arr2, a2, 0);
(*env)->ReleasePrimitiveArrayCritical(env, arr1, a1, 0);
```
注意,如果JVM的内部实现将数组表示为其他格式的话,函数`GetPrimitiveArrayCritical`可能会返回一个数组的拷贝。因此,开发者需要检查函数的返回值是否为`NULL`,此时表示系统内存不足。
下表描述了函数在`JNIEnv`接口函数中的索引位置:
GetPrimitiveArrayCritical 222
ReleasePrimitiveArrayCritical 223
该函数自JDK/JRE 1.2之后可用。
<a name="4.5.11"></a>
### 4.5.11 注册本地方法
<a name="4.5.11.1"></a>
#### 4.5.11.1 RegisterNatives
```c++
jint RegisterNatives(JNIEnv *env, jclass clazz, const JNINativeMethod *methods, jint nMethods);
```
该函数用于为指定类型注册本地方法。类型由参数`clazz`指定。参数`methods`指定了要注册的本地方法的数组,每个元素都包含有名字、签名和函数指针,其中名字和签名都是以自定义UTF-8编码的。参数`nMethods`指定了要注册的本地方法的个数。数据结构`JNINativeMethod`的定义如下:
```c++
typedef struct {
char *name;
char *signature;
void *fnPtr;
} JNINativeMethod;
```
函数指针必须具有如下类型的签名:
```c++
ReturnType (*fnPtr)(JNIEnv *env, jobject objectOrClass, ...);
```
函数在`JNIEnv`接口函数中的索引位置为`215`。
参数:
env JNI接口指针
clazz Java的类型对象
methods 待注册的本地方法数组
nMethods 待注册的本地方法数量
返回:
若成功,返回"0";否则返回负数
异常:
NoSuchMethodError 若在类中找不到指定的方法,或指定方法不是本地方法,则抛出该错误
<a name="4.5.11.2"></a>
#### 4.5.11.2 UnregisterNatives
```c++
jint UnregisterNatives(JNIEnv *env, jclass clazz);
```
取消注册某个类中所有的本地方法。取消注册后,目标类会回到链接、注册本地方法之前的状态。
一般情况下,这个方法不应该使用。它只是提供了一种重新载入和链接本地库的特殊方式。
函数在`JNIEnv`接口函数中的索引位置为`216`。
参数:
env JNI接口指针
clazz 目标类型对象
返回:
若成功,返回"0";否则返回负数
<a name="4.5.12"></a>
### 4.5.12 监视器操作
<a name="4.5.12.1"></a>
#### 4.5.12.1 MonitorEnter
```c++
jint MonitorEnter(JNIEnv *env, jobject obj);
```
该函数用于进入目标对象所持有的监视器。
参数`obj`的值**禁止**为`NULL`。
每个Java对象都有一个监视器与之相关联。若当前线程已经持有了目标对象的监视器,则调用该方法时会增加监视器中计数器的值,这个值表示当前线程进入监视器的次数;若目标对象的监视器还没有被任何线程持有,则将当前线程设置为监视器的持有者,并将计数器设置为1;若目标对象的监视器已经被其他线程持有,则当前线程会等待,知道监视器被释放,然后尝试重新进入监视器。
通过函数`MonitorEnter`进入的监视器,不能通过JVM指令`monitorexit`或退出`synchronized`方法来释放。函数`MonitorEnter`和`monitorenter`指令可能竞争同一个对象的监视器。
为了避免死锁,通过函数`MonitorEnter`进入的监视器,必须通过函数`MonitorExit`来释放,除非调用函数`DetachCurrentThread`来隐式的释放监视器。
函数在`JNIEnv`接口函数中的索引位置为`217`。
参数:
env JNI接口指针
obj 目标对象
返回:
若成功,返回"0";否则返回负数
<a name="4.5.12.2"></a>
#### 4.5.12.2 MonitorExit
```c++
jint MonitorExit(JNIEnv *env, jobject obj);
```
在调用该函数时,当前线程必须持有目标对象的监视器。成功调用该函数后,会将监视器中的计数器的值减1。若计数器的值变为0,则当前线程释放目标监视器。
**禁止**本地方法调用该函数来释放通过`synchronized`方法或`monitorenter`指令进入的监视器。
函数在`JNIEnv`接口函数中的索引位置为`218`。
参数:
env JNI接口指针
obj 目标对象
返回:
若成功,返回"0";否则返回负数
异常:
IllegalMonitorStateException 若当前线程没持有目标监视器时,抛出该异常。
<a name="4.5.13"></a>
### 4.5.13 NIO支持
NIO相关的函数使本地代码可以访问`java.nio`的直接缓冲。直接缓冲的内容可能会驻留在本地内存中,而非放到可执行垃圾回收的堆中。有关直接缓冲相关的信息,参见[New I/O][108]和[java.nio.ByteBuffer][109]的说明。
在JDK/JRE 1.4中,JNI引入了3个新的函数,可以创建、校验和操作直接缓冲。
* [NewDirectByteBuffer][110]
* [GetDirectBufferAddress][111]
* [GetDirectBufferCapacity][112]
所有的JVM实现都必须支持这些函数,但并不要求支持通过JNI访问直接缓冲。如果JVM不支持通过JNI访问直接缓冲,则函数`NewDirectByteBuffer`和`GetDirectBufferAddress`只能返回`NULL`,而函数`GetDirectBufferCapacity`只能返回`-1`。如果JVM支持通过JNI访问直接缓冲,则必须返回正确的值。
<a name="4.5.13.1"></a>
#### 4.5.13.1 NewDirectByteBuffer
```c++
jobject NewDirectByteBuffer(JNIEnv* env, void* address, jlong capacity);
```
创建`java.nio.ByteBuffer`对象,并为其分配一块指定起始位置和长度的内存。
调用该函数的本地代码,必须确保缓冲区指向了一块有效的内存区域,至少是可读的,某些场景下,还需要是可写的。在Java代码中访问无效内存区域的话,可能会返回任意值,可能会无效,或是抛出未指定的异常。
函数在`JNIEnv`接口函数中的索引位置为`229`。
参数:
env JNI接口指针
address 内存区域的开始位置,不可为NULL
capacity 要开辟的内存区域的大小,单位是字节
返回:
返回一个指向新创建的"java.nio.ByteBuffer"的局部引用。如果函数调用发生异常,或是JVM不支持通过JNI访问直接缓冲,返回NULL
异常:
OutOfMemoryError 若分配ByteBuffer对象失败,抛出该错误
该函数自JDK/JRE 1.4之后可用。
<a name="4.5.13.2"></a>
#### 4.5.13.2 GetDirectBufferAddress
```c++
void* GetDirectBufferAddress(JNIEnv* env, jobject buf);
```
返回`java.nio.Buffer`对象所引用的内存区域的起始位置。
该函数使本地代码与Java代码可以访问同一块直接缓冲。
函数在`JNIEnv`接口函数中的索引位置为`230`。
参数:
env JNI接口指针
buf "java.nio.Buffer"对象的引用,不可以为NULL
返回:
返回直接缓冲的起始位置。
以下情况返回"NULL":
* 内存区域未定义
* 参数"buf"不是"java.nio.Buffer"对象
* JVM不支持通过JNI访问直接缓冲
该函数自JDK/JRE 1.4之后可用。
<a name="4.5.13.3"></a>
#### 4.5.13.3 GetDirectBufferCapacity
GetDirectBufferCapacity
```c++
jlong GetDirectBufferCapacity(JNIEnv* env, jobject buf);
```
返回直接缓冲的大小,
Fetches and returns the capacity of the memory region referenced by the given direct java.nio.Buffer. The capacity is the number of elements that the memory region contains.
函数在`JNIEnv`接口函数中的索引位置为`231`。
参数:
env JNI接口指针
buf "java.nio.Buffer"对象的引用,不可以为NULL
返回:
返回直接缓冲去的大小。
以下情况返回"NULL":
* 参数"buf"所指向的不是"java.nio.Buffer"对象
* JVM不支持通过JNI访问直接缓冲
* 参数"buf"所指向的未对齐的视图缓冲,而且处理器架构不支持访问未对齐的内存区域
该函数自JDK/JRE 1.4之后可用。
<a name="4.5.14"></a>
### 4.5.14 反射支持
开发者可以通过JNI函数来访问Java的方法和属性。Java的反射API使开发者可以在运行时获取Java类的内部信息。JNI提供了一系列转换方法使开发者可以方便的将JNI中的方法/属性ID值转换为反射调用所需的方法和属性对象。
<a name="4.5.14.1"></a>
#### 4.5.14.1 FromReflectedMethod
```c++
jmethodID FromReflectedMethod(JNIEnv *env, jobject method);
```
将`java.lang.reflect.Method`对象或`java.lang.reflect.Constructor`转换为JNI的方法ID。
函数在`JNIEnv`接口函数中的索引位置为`7`。
该函数自JDK/JRE 1.2之后可用。
<a name="4.5.14.2"></a>
#### 4.5.14.2 FromReflectedField
```c++
jfieldID FromReflectedField(JNIEnv *env, jobject field);
```
将`java.lang.reflect.Field`对象转换为JNI的属性ID。
函数在`JNIEnv`接口函数中的索引位置为`8`。
该函数自JDK/JRE 1.2之后可用。
<a name="4.5.14.3"></a>
#### 4.5.14.3 ToReflectedMethod
```c++
jobject ToReflectedMethod(JNIEnv *env, jclass cls, jmethodID methodID, jboolean isStatic);
```
将方法ID转换为`java.lang.reflect.Method`或`java.lang.reflect.Constructor`对象。参数`isStatic`用于表示目标方法是否是静态方法。
如果方法执行失败,返回`0`,并抛出`OutOfMemoryError`错误。
函数在`JNIEnv`接口函数中的索引位置为`9`。
该函数自JDK/JRE 1.2之后可用。
<a name="4.5.14.4"></a>
#### 4.5.14.4 ToReflectedField
```c++
jobject ToReflectedField(JNIEnv *env, jclass cls, jfieldID fieldID, jboolean isStatic);
```
将属性ID转换为`java.lang.reflect.Field`对象,参数`isStatic`用于表示目标属性是否是静态属性。
如果方法执行失败,返回`0`,并抛出`OutOfMemoryError`错误。
函数在`JNIEnv`接口函数中的索引位置为`12`。
该函数自JDK/JRE 1.2之后可用。
<a name="4.5.15"></a>
### 4.5.15 JVM接口
<a name="4.5.15.1"></a>
#### 4.5.15.1 GetJavaVM
```c++
jint GetJavaVM(JNIEnv *env, JavaVM **vm);
```
返回与当前线程关联的JVM接口。执行结果存放于参数`vm`中。
函数在`JNIEnv`接口函数中的索引位置为`219`。
参数:
env JNI接口指针
vm 用于返回结果的指针
返回:
若执行成功,返回"0",否则返回负数。
<a name="5"></a>
# 5 Invocation API
Invocation API使软件供应商可以将Java嵌入到任意本地应用中。供应商在发布包含Java的应用程序时,可以不必包含JVM的源代码。
<a name="5.1"></a>
## 5.1 Overview
下面的代码展示了如何在Invocation API中调用函数。在这个示例中,C++代码创建了一个JVM,并调用了名为`Main.test`的静态方法。为便于理解,这里省略了错误检查。
```c++
#include <jni.h> /* where everything is defined */
...
JavaVM *jvm; /* denotes a Java VM */
JNIEnv *env; /* pointer to native method interface */
JavaVMInitArgs vm_args; /* JDK/JRE 6 VM initialization arguments */
JavaVMOption* options = new JavaVMOption[1];
options[0].optionString = "-Djava.class.path=/usr/lib/java";
vm_args.version = JNI_VERSION_1_6;
vm_args.nOptions = 1;
vm_args.options = options;
vm_args.ignoreUnrecognized = false;
/* load and initialize a Java VM, return a JNI interface
* pointer in env */
JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
delete options;
/* invoke the Main.test method using the JNI */
jclass cls = env->FindClass("Main");
jmethodID mid = env->GetStaticMethodID(cls, "test", "(I)V");
env->CallStaticVoidMethod(cls, mid, 100);
/* We are done. */
jvm->DestroyJavaVM();
```
在这个示例中,使用了3个函数。Invocation API允许本地应用程序通过JNI接口指针访问JVM的特性。
<a name="5.1.1"></a>
### 5.1.1 创建JVM
函数`JNI_CreateJavaVM()`可以载入并初始化一个JVM,然后返回JNI接口指针,调用了该函数的线程可被认为是主线程。
<a name="5.1.2"></a>
### 5.1.2 连接到JVM
JNI接口指针(即`JNIEnv`)仅在当前线程内有效。其他的线程若需要访问JVM实例,**必须**先调用函数`AttachCurrentThread`将自己连接到JVM,以便能获取到JNI接口指针。连接到JVM后,本地线程就可以像运行在本地方法中的Java线程一样正常工作了。在调用函数`DetachCurrentThread()`后,本地线程会断开与JVM的连接。
连接到JVM的线程应该具有足够大的栈空间来完成预定的任务。每个线程栈的大小取决于不同操作系统的设置。例如,对于`pthread`来说,线程栈的大小可以在创建线程时通过参数`pthread_attr_t`传入。
<a name="5.1.3"></a>
### 5.1.3 断开与JVM的连接
本地线程在退出之前,必须调用函数`DetachCurrentThread()`来断开与JVM的连接。需要注意的是,如果有Java方法在调用栈的话,线程无法断开与JVM的连接。
<a name="5.1.4"></a>
### 5.1.4 卸载JVM
函数`JNI_DestroyJavaVM()`可用于卸载一个JVM实例。
调用该函数后,JVM会等到除当前线程外所有非守护的用户线程都退出时才会真正退出。用户线程包括Java线程和连接到JVM的本地线程。之所以有这种限制,是因为Java线程和连接到JVM的本地线程可能会持有系统资源,例如锁、窗口等,JVM无法自动释放这些资源。若当前线程成为最后一个非守护的用户线程时,释放系统资源的工作则可以由开发者自行控制。
<a name="5.2"></a>
## 5.2 库与版本管理
本地库在加载之后,对所有的类加载器都是可见的。不同类加载器中的不同类可能会连接到同一个本地线程。这会导致两个问题:
* 本地库被类加载器loader1中的类Class1载入后,可能会被错误的连接到类加载器loader2中的类Class1
* 本地线程可能会混淆不同类加载器中的类,这会打破类加载器所构建的命名空间,导致类型安全问题
每个类加载器管理自己的本地库集合,同一个JNI本地库不能被多个类加载器载入,否则会抛出`UnsatisfiedLinkError`错误。例如,当某个本地库被不同类加载器载入时,`System.loadLibrary`方法会抛出`UnsatisfiedLinkError`错误。这么做有以下优点:
* 基于类加载器的命名空间隔离机制得以保留。本地库不会混淆不同类加载器中的类。
* 本地库可以在对应的类加载器被垃圾回收器回收时卸载掉。
为了更好的进行版本控制和资源管理,JNI库可以导出函数`JNI_OnLoad`和`JNI_OnUnload`来处理。
<a name="5.2.1"></a>
### 5.2.1 JNI_OnLoad
```c++
jint JNI_OnLoad(JavaVM *vm, void *reserved);
```
在载入本地库时(例如调用函数`System.loadLibrary`),JVM会调用函数`JNI_OnLoad`。函数`JNI_OnLoad`必须返回本地库所所需的JNI版本号。
为了能够使用新增的JNI函数,本地库需要导出函数`JNI_OnLoad`,且该函数必须返回`JNI_VERSION_1_2`。如果本地库没有导出函数`JNI_OnLoad`,则JVM会假设本地库仅仅需要版本号为`JNI_VERSION_1_1`的支持。如果JVM无法识别函数`JNI_OnLoad`返回值,则JVM会卸载掉该本地库,就像没再载入过一样。
```c++
JNI_Onload_L(JavaVM *vm, void *reserved);
```
如果库`L`是静态链接的,则在调用函数`System.loadLibrary("L")`或其他等效API时,JVM会调用函数`JNI_OnLoad_L`,参数和返回值与调用函数`JNI_OnLoad`相同。函数`JNI_OnLoad_L`必须返回本地库所需要的JNI版本号,必须大于等于`JNI_VERSION_1_8`。如果JVM无法识别函数`JNI_OnLoad`返回值,则JVM会卸载掉该本地库,就像没再载入过一样。
<a name="5.2.2"></a>
### 5.2.2 JNI_OnUnload
```c++
void JNI_OnUnload(JavaVM *vm, void *reserved);
```
当载入过本地库的类加载器被回收掉时,会JVM会调用本地库的函数`JNI_OnUnload`来执行清理工作。由于该函数的执行上下文无法预知,因此开发者在该函数中应尽可能保守的使用JVM服务。
注意,函数`JNI_OnLoad`和`JNI_OnUnload`是可选的,并非是JVM导出的。
```c++
JNI_OnUnload_L(JavaVM *vm, void *reserved);
```
若库是静态链接的,则载入了该库的类加载器被回收掉时,JVM会调用函数`JNI_OnUnload_L`来执行清理函数。由于该函数的执行上下文无法预知,因此开发者在该函数中应尽可能保守的使用JVM服务。
注意:载入本地库是一个整体过程,使本地库和个函数入口得以在JVM中完成注册;而通过操作系统级别的调用来载入本地库(例如`dlopen`)并不能完成目标。从类加载器中调用本地函数,会将本地库载入到内存中,返回指向本地库的句柄,以便后续搜索本地库的入口点。在返回句柄并注册本地库后,Java的本地类加载器完成整个载入过程。
<a name="5.3"></a>
## 5.3 Invocation API
`JavaVM`是指向Invocation API函数表的指针,下面的代码展示了该函数表的定义:
```c++
typedef const struct JNIInvokeInterface *JavaVM;
const struct JNIInvokeInterface ... = {
NULL,
NULL,
NULL,
DestroyJavaVM,
AttachCurrentThread,
DetachCurrentThread,
GetEnv,
AttachCurrentThreadAsDaemon
};
```
注意,`JNI_GetDefaultJavaVMInitArgs()` `JNI_GetCreatedJavaVMs()`和`JNI_CreateJavaVM()`这三个函数并不是`JavaVM`函数表的一部分,调用着三个函数时,并不需要有`JavaVM`数据结构。
<a name="5.3.1"></a>
### 5.3.1 JNI_GetDefaultJavaVMInitArgs
```c++
jint JNI_GetDefaultJavaVMInitArgs(void *vm_args);
```
返回JVM的默认参数配置。在调用该函数前,本地代码必须先设置属性`vm_args->version`为本地代码期望JVM能支持的JNI版本号。调用该函数后,属性`vm_args->version`会被设置为当前JVM所能支持的实际JNI版本号。
参数:
vm_args 指向数据结构"JavaVMInitArgs"的指针,函数返回后,会在其中填入默认参数
返回:
如果当前JVM能支持期望的JNI版本号,则返回"JNI_OK";否则返回相应的错误码,值为负数。
<a name="5.3.2"></a>
### 5.3.2 JNI_GetCreatedJavaVMs
```c++
jint JNI_GetCreatedJavaVMs(JavaVM **vmBuf, jsize bufLen, jsize *nVMs);
```
返回所有已创建的JVM实例。指向JVM实例的指针会被放入到参数`vmBuf`中,并按照JVM实例的创建顺序排放,返回的JVM实例的个数由参数`bufLen`指定,所有已创建的JVM实例的个数由参数`nVMs`返回。
需要注意的是,不支持在单一线程中创建多个JVM实例。
参数:
vmBuf 存放JVM实例的数组指针
bufLen 要返回的JVM实例的个数
nVMs 所有已创建的JVM实例的个数
返回:
若函数调用成功,返回"JNI_OK";否则返回相应的错误码,值为负数。
<a name="5.3.3"></a>
### 5.3.3 JNI_CreateJavaVM
```c++
jint JNI_CreateJavaVM(JavaVM **p_vm, void **p_env, void *vm_args);
```
载入并初始化一个JVM实例,当前线程变为主线程,并为当前线程设置JNI接口函数参数。
不支持在单一线程中创建多个JVM实例。
传给函数`JNI_CreateJavaVM`的第二个参数永远都是指向`JNIEnv*`的指针,而第三个参数是指向数据结构`JavaVMInitArgs`的指针,其中`options`属性指明启动JVM的选项。
```c++
typedef struct JavaVMInitArgs {
jint version;
jint nOptions;
JavaVMOption *options;
jboolean ignoreUnrecognized;
} JavaVMInitArgs;
```
其中`JavaVMOption`的定义如下:
```c++
typedef struct JavaVMOption {
char *optionString; /* the option as a string in the default platform encoding */
void *extraInfo;
} JavaVMOption;
```
数组的大小由参数`nOptions`指定。若参数`ignoreUnrecognized`设置为`JNI_TRUE`,则函数`JNI_CreateJavaVM`会忽略所有以`-X`或`_`开头的、无法识别的JVM选项;若参数`ignoreUnrecognized`设置为`JNI_FALSE`,则遇到无法识别的JVM选项时,函数`JNI_CreateJavaVM`会返回`JNI_ERR`。所有的JVM实现都必须能识别以下标准参数:
options desc
-D<name>=<value> 定义系统属性
-verbose[:class|gc|jni] 设置详细输出。可以以英文逗号分隔多个选项,例如"-verbose:gc,class"。
vfprintf 此时,属性"extraInfo"是指向vfprintf钩子的指针
exit 此时,属性"extraInfo"是指向退出钩子的指针
abort 此时,属性"extraInfo"是指向终止钩子的指针
此外,每个JVM实现都可以支持自己特有的非标准选项。非标准选项必须以`-X`或`_`开头,例如JDK/JRE支持`-Xms`和`-Xmx`来指定堆的初始大小和最大值。以`-X`开头的选项可以被`java`命令工具所使用。
下面的代码展示了如何创建一个JVM:
```c++
JavaVMInitArgs vm_args;
JavaVMOption options[4];
options[0].optionString = "-Djava.compiler=NONE"; /* disable JIT */
options[1].optionString = "-Djava.class.path=c:\myclasses"; /* user classes */
options[2].optionString = "-Djava.library.path=c:\mylibs"; /* set native library path */
options[3].optionString = "-verbose:jni"; /* print JNI-related messages */
vm_args.version = JNI_VERSION_1_2;
vm_args.options = options;
vm_args.nOptions = 4;
vm_args.ignoreUnrecognized = TRUE;
/* Note that in the JDK/JRE, there is no longer any need to call
* JNI_GetDefaultJavaVMInitArgs.
*/
res = JNI_CreateJavaVM(&vm, (void **)&env, &vm_args);
if (res < 0) ...
```
参数:
p_vm 指向返回JVM数据结构的指针,新创建的JVM会放到这里
p_env 指向主线程所使用的JNI接口指针的指针
vm_args JVM的初始化参数
返回:
若函数调用成功,返回"JNI_OK";否则返回相应的错误码,值为负数。
<a name="5.3.4"></a>
### 5.3.4 DestroyJavaVM
```c++
jint DestroyJavaVM(JavaVM *vm);
```
销毁JVM实例,释放其持有的资源。
任何线程都可以调用该方法。如果当前线程是连接到JVM的线程,则JVM会等到除当前线程外所有非守护的用户线程退出后,才会真正退出。如果当前线程不是连接到JVM的线程,则JVM会连接到当前线程,并等到除当前线程外所有非守护的用户线程退出后,才会真正退出。
该函数在JVM接口函数表中的索引位置为`3`。
参数:
vm 待销毁的JVM实例
返回:
若函数调用成功,返回"JNI_OK";否则返回相应的错误码,值为负数。
销毁中的JVM不可再使用,结果未定义。
<a name="5.3.5"></a>
### 5.3.5 AttachCurrentThread
```c++
jint AttachCurrentThread(JavaVM *vm, void **p_env, void *thr_args);
```
将当前线程连接到JVM,在参数`p_env`中返回JNI接口指针。
已经连接到JVM的线程重复调用该方法时,是空操作。
本地线程不能同时连接到两个不同的JVM实例。
当本地线程连接到JVM后,其上下文类载入去被设置为启动类载入器(bootstrap loader)。
该函数在JVM接口函数表中的索引位置为`4`。
参数:
vm 待连接的JVM实例
p_env 操作成功后,JNI接口指针通过该参数返回
thr_args 可以为NULL;或是指向数据结构"JavaVMAttachArgs"的指针,用来指定额外信息on:
第二个参数永远是指向`JNIEnv`的指针。
第三个参数是保留参数,可以设置为`NULL`;也可以设置为以下数据结构的指针,以此来传递额外信息:
```c++
typedef struct JavaVMAttachArgs {
jint version;
char *name; /* the name of the thread as a modified UTF-8 string, or NULL */
jobject group; /* global ref of a ThreadGroup object, or NULL */
} JavaVMAttachArgs
```
返回:
若函数调用成功,返回"JNI_OK";否则返回相应的错误码,值为负数。
<a name="5.3.6"></a>
### 5.3.6 AttachCurrentThreadAsDaemon
```c++
jint AttachCurrentThreadAsDaemon(JavaVM* vm, void** penv, void* args);
```
该方法的语义与函数`AttachCurrentThread`类似,但新创建的`java.lang.Thread`实例会被设置为守护线程。
如果当前线程已经通过函数`AttachCurrentThread`或`AttachCurrentThreadAsDaemon`连接到JVM,则调用当前方法只会将参数`penv`设置为当前线程的`JNIEnv*`的值,不会变更当前线程的守护线程状态。
该函数在JVM接口函数表中的索引位置为`7`。
参数:
vm 待连接的JVM实例
penv 操作成功后,JNI接口指针通过该参数返回
args 指向数据结构"JavaVMAttachArgs"的指针
返回:
若函数调用成功,返回"JNI_OK";否则返回相应的错误码,值为负数。
异常:
无
<a name="5.3.7"></a>
### 5.3.7 DetachCurrentThread
```c++
jint DetachCurrentThread(JavaVM *vm);
```
断开当前线程与目标JVM的连接,同时释放当前线程所持有的监视器,所有等待该监视器的线程都会收到通知。
可以在主线程调用该函数。
该函数在JVM接口函数表中的索引位置为`7`。
参数:
vm 待断开的JVM实例
返回:
若函数调用成功,返回"JNI_OK";否则返回相应的错误码,值为负数。
<a name="5.3.8"></a>
### 5.3.8 GetEnv
```c++
jint GetEnv(JavaVM *vm, void **env, jint version);
```
该函数在JVM接口函数表中的索引位置为`6`。
参数:
vm 目标JVM实例
env 做返回结果使用
version 期望支持的JNI版本号
返回:
* 如果当前线程尚未连接到JVM,则参数"*env"被置为"NULL",函数返回"JNI_EDETACHED"
* 如果当前JVM不支持期望的JNI版本号,则参数"*env"被置为"NULL",函数返回"JNI_EVERSION"
* 其他情况下,参数"*env"指向JNI接口指针,函数返回"JNI_OK"
<a name="resources"></a>
# Resources
* [Java Native Interface Specification Contents][1]
[1]: https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/jniTOC.html
[2]: #1
[3]: #2
[4]: #2.1
[5]: #2.2
[6]: #2.2.1
[7]: #2.2.2
[8]: #2.3
[9]: #2.3.1
[10]: #2.3.2
[11]: #2.4
[12]: #2.4.1
[13]: #2.4.2
[14]: #2.4.3
[15]: #2.5
[16]: #2.5.1
[17]: #2.5.2
[18]: #2.5.3
[19]: #3
[20]: #3.1
[21]: #3.2
[22]: #3.3
[23]: #3.4
[24]: #3.5
[25]: #3.6
[26]: #4
[27]: #4.1
[28]: #4.2
[29]: #4.2.1
[30]: #4.2.2
[31]: #4.3
[32]: #4.3.1
[33]: #4.3.2
[34]: #4.3.3
[35]: #4.3.4
[36]: #4.4
[37]: #4.4.1
[38]: #4.4.2
[39]: #4.4.3
[40]: #4.4.4
[41]: #4.4.5
[42]: #4.4.6
[43]: #4.4.7
[44]: #4.5
[45]: #4.5.1
[46]: #4.5.1.1
[47]: #4.5.1.2
[48]: #4.5.2
[49]: #4.5.2.1
[50]: #4.5.2.2
[51]: #4.5.2.3
[52]: #4.5.2.4
[53]: #4.5.2.5
[54]: #4.5.3
[55]: #4.5.3.1
[56]: #4.5.3.2
[57]: #4.5.4
[58]: #4.5.4.1
[59]: #4.5.4.2
[60]: #4.5.4.3
[61]: #4.5.4.4
[62]: #4.5.4.5
[63]: #4.5.4.6
[64]: #4.5.5
[65]: #4.5.5.1
[66]: #4.5.5.2
[67]: #4.5.5.3
[68]: #4.5.6
[69]: #4.5.6.1
[70]: #4.5.6.2
[71]: #4.5.6.3
[72]: #4.5.7
[73]: #4.5.7.1
[74]: #4.5.7.2
[75]: #4.5.7.3
[76]: #4.5.8
[77]: #4.5.8.1
[78]: #4.5.8.2
[79]: #4.5.9
[80]: #4.5.9.1
[81]: #4.5.9.2
[82]: #4.5.9.3
[83]: #4.5.9.4
[84]: #4.5.9.5
[85]: #4.5.9.6
[86]: #4.5.9.7
[87]: #4.5.9.8
[88]: #4.5.9.9
[89]: #4.5.9.10
[90]: #4.5.10
[91]: #4.5.10.1
[92]: #4.5.10.2
[93]: #4.5.10.3
[94]: #4.5.10.4
[95]: #4.5.10.5
[96]: #4.5.10.6
[97]: #4.5.10.7
[98]: #4.5.10.8
[99]: #4.5.10.9
[100]: #4.5.10.10
[101]: #4.5.11
[102]: #4.5.11.1
[103]: #4.5.11.2
[104]: #4.5.12
[105]: #4.5.12.1
[106]: #4.5.12.2
[107]: #4.5.13
[108]: https://docs.oracle.com/javase/8/docs/technotes/guides/io/index.html
[109]: https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html
[110]: #4.5.13.1
[111]: #4.5.13.2
[112]: #4.5.13.3
[113]: #4.5.14
[114]: #4.5.14.1
[115]: #4.5.14.2
[116]: #4.5.14.3
[117]: #4.5.14.4
[118]: #4.5.15
[119]: #4.5.15.1
[120]: #5
[121]: #5.1
[122]: #5.1.1
[123]: #5.1.2
[124]: #5.1.3
[125]: #5.1.4
[126]: #5.2
[127]: #5.2.1
[128]: #5.2.2
[129]: #5.3
[130]: #5.3.1
[131]: #5.3.2
[132]: #5.3.3
[133]: #5.3.4
[134]: #5.3.5
[135]: #5.3.6
[136]: #5.3.7
[137]: #5.3.8
[138]: #resources
| 24.485777
| 262
| 0.647937
|
yue_Hant
| 0.778777
|
450750dff3bd417486cf3697d8ea5d59a99e401c
| 2,766
|
md
|
Markdown
|
docs/build/reference/headerunit.md
|
taketakeyyy/cpp-docs.ja-jp
|
4cc268ee390a7f6a2a8afd848f65876acc4450a9
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
docs/build/reference/headerunit.md
|
taketakeyyy/cpp-docs.ja-jp
|
4cc268ee390a7f6a2a8afd848f65876acc4450a9
|
[
"CC-BY-4.0",
"MIT"
] | 1
|
2021-04-01T04:17:07.000Z
|
2021-04-01T04:17:07.000Z
|
docs/build/reference/headerunit.md
|
taketakeyyy/cpp-docs.ja-jp
|
4cc268ee390a7f6a2a8afd848f65876acc4450a9
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
---
title: /headerunit (Use header unit IFC)
description: /Headerunit コンパイラオプションを使用して、現在のコンパイルでインポートする既存の IFC header ユニットを指定します。
ms.date: 09/13/2020
f1_keywords:
- /headerUnit
helpviewer_keywords:
- /headerUnit
- Use header unit IFC
ms.openlocfilehash: 2734df728b188dcfbbe5f475cfc67715a070975d
ms.sourcegitcommit: b492516cc65120250b9ea23f96f7f63f37f99fae
ms.translationtype: MT
ms.contentlocale: ja-JP
ms.lasthandoff: 09/14/2020
ms.locfileid: "90079158"
---
# <a name="headerunit-use-header-unit-ifc"></a>`/headerUnit` (Use header unit IFC)
`#include` `import header-name;` 文字列インクルードを使用するのではなく、インポート可能なヘッダー名のディレクティブをディレクティブに変換するようコンパイラに指示します。
## <a name="syntax"></a>構文
> **`/headerUnit`** *`header-filename`*=*`ifc-filename`*
### <a name="arguments"></a>引数
*`header-filename`*\
コンパイラがを解決するファイルの名前 `header-name` 。 `import header-name ;`コンパイラでは、 `header-name` ディスク上のいくつかのファイルに解決されます。 を使用し *`header-filename`* てそのファイルを指定します。 一致すると、コンパイラはによってという名前の対応する IFC を *`ifc-filename`* インポート用に開きます。
*`ifc-filename`*\
*IFC data*、事前に構築されたモジュール情報を含むファイルの名前。 複数のヘッダー単位をインポートするには、 **`/headerUnit`** ファイルごとに個別のオプションを指定します。
## <a name="remarks"></a>解説
コンパイラオプションを使用するには、 **`/headerUnit`** [`/experimental:module`](experimental-module.md) コンパイラオプションを使用して、 [/std: c + + latest](std-specify-language-standard-version.md) オプションと共に試験的なモジュールのサポートを有効にする必要があります。 このオプションは、Visual Studio 2019 バージョン16.8 以降で使用できます。
コンパイラは、1つのを *`header-name`* 複数の IFC ファイルにマップすることはできません。 複数の *`header-name`* 引数を1つの IFC にマップすることは可能ですが、推奨されません。 IFC の内容は、によって指定されたヘッダーの場合と同じようにインポートされ *`header-name`* ます。
### <a name="examples"></a>例
次の表に示すように、2つのヘッダーファイルとそのヘッダー単位を参照するプロジェクトを指定します。
| ヘッダー ファイル | IFC ファイル |
|--|--|
| *`C:\utils\util.h`* | *`C:\util.h.ifc`* |
| *`C:\app\app.h`* | *`C:\app.h.ifc`* |
これらの特定のヘッダーファイルのヘッダー単位を参照するコンパイラオプションは、次の例のようになります。
```CMD
cl ... /experimental:module /translateInclude /headerUnit C:\utils\util.h=C:\util.h.ifc /headerUnit C:\app\app.h=C:\app.h.ifc
```
### <a name="to-set-this-compiler-option-in-the-visual-studio-development-environment"></a>Visual Studio 開発環境でこのコンパイラ オプションを設定するには
1. プロジェクトの **[プロパティ ページ]** ダイアログ ボックスを開きます。 詳細については、[Visual Studio での C++ コンパイラとビルド プロパティの設定](../working-with-project-properties.md)に関するページを参照してください。
1. [ **構成** ] ドロップダウンを [ **すべての構成**] に設定します。
1. [**構成プロパティ**] [ > **C/c + +** > **コマンドライン**] プロパティページを選択します。
1. [ **追加オプション]** プロパティを変更して、 *`/headerUnit`* オプションと引数を追加します。 次に、[ **OK]** または [ **適用** ] を選択して、変更を保存します。
## <a name="see-also"></a>関連項目
[`/experimental:module` (モジュールのサポートを有効にする)](experimental-module.md)\
[`/module:exportHeader` (ヘッダーユニットの作成)](module-exportheader.md)\
[`/module:reference` (名前付きモジュール IFC を使用)](module-reference.md)\
[`/translateInclude` (インクルードディレクティブをインポートディレクティブに変換します)](translateinclude.md)\
| 39.514286
| 251
| 0.737166
|
yue_Hant
| 0.667939
|
45078f842181c6beca359e432f4d6c5d75d8abef
| 3,483
|
md
|
Markdown
|
README.md
|
Ameer004/e-shop-bot
|
a7f6e89510e277441bda2eedcf8a39471d039645
|
[
"MIT"
] | 10
|
2020-03-02T07:20:36.000Z
|
2022-03-28T13:16:05.000Z
|
README.md
|
Ameer004/e-shop-bot
|
a7f6e89510e277441bda2eedcf8a39471d039645
|
[
"MIT"
] | null | null | null |
README.md
|
Ameer004/e-shop-bot
|
a7f6e89510e277441bda2eedcf8a39471d039645
|
[
"MIT"
] | 4
|
2020-03-17T15:12:06.000Z
|
2021-09-30T10:34:07.000Z
|
## E-shop whatsapp bot template
- A some-what bare template for whatsapp chatbot..originally made using twilio sandbox
- original proposal was tailored towards an electronic startup that sells electronic components
- can be extended or changed to suit any business type with minor or major tweaks
### Demos
- this is not an AI-ML bot, an example of an AI bot with ML can be found [here, ZIMSEC bot](https://github.com/DonnC/zimsec-results-bot)
- This example bot `On development app`, has many sides, here i show 2, how it works for both a **client** and the **moderator**
- ..seperately with no problem 😎
- Click this link to [whatsapp bot](https://wa.me/14155238886?text=join%20had-firm). After that you can type **hie** or **hello** or **start**.
- Consumer / client side

- Moderator side

### Note
- Well, as much as i try to give out my thoughts to the public, `EXCEPTION HANDLING` is to be done by the interested personnel in this project
### Technologies
- This whatsapp bot makes use of twilio sandbox for prototyping
- Needs twilio credentials, login to your twilio console and replace yr keys in [credentials.py](src/credentials.py)
- Can host on heroku free tier and choose automatic deployment from your github master branch
- bulksms service can be used depending on use case, one such service is bulksmszw and ther is a library for that at [bulksms zw api library](https://github.com/DonnC/BulkSmsZW-Api)
- or if its hot-recharge services like `TechZim airtime bot`, can integrate it using the [hot-recharge zw api library](https://github.com/DonnC/Hot-Recharge-ZW) *still testing, raise issues and star for updates.
### Structure
- `whether this is a good design structure | not, this worked for me` - you can change depending on your project or business model
- in [src](src/) folder, it handles all the bot functionalities subdivided into different modules to aid in upgrading the bot later
- most bot utilities are implemented inside [utils.py](src/utils.py)
- statistics are in a seperate folder e.g [stats](stats/development/devlog.log)
- commands and help texts are in their seperate e.g [folder](files/help.txt)
### How to run
- clone or fork this repo!
- for cloud serving, you can use heroku free account and choose automatic deploy from your bot github repository
- needs a twilio account and twilio tokens and sandbox ready, check the twilio website
- for local testing, fire up your flask server and run ngrok (needs Ngrok installed)
- you can google on the internet how to do so, there is a tutorial about that
- run some tests, and show off to friends, family and clients 😉
#### tip
- after successful deployment to heroku, use your free heroku url to add to twilio console on callback webhook
- as `https://your-heroku-url/whatsapp` and let magic rain, your bot is automatically now linked between the 2 and is now online 24/7
- for local testing with ngrok, use `https://your-temporary-ngrok-https-url/whatsapp` on the twilio console. Dont use the `http` url
- Make bots like what the banks have, like what that whatsapp bot you admired works, be creative 👨🎨
### Appericiation
- If you like this sort of bot template helpful give it a STAR 🌟 or FORK 😃 | FOLLOW. It motivates..I might bring an extra open source free project as a head-start next that you might find helpful too 😉
| 68.294118
| 212
| 0.753086
|
eng_Latn
| 0.997491
|
4507d9262f75a12dd78e3ee382565420b391081d
| 4,243
|
md
|
Markdown
|
src/pages/about/index.md
|
alexpichel/gatsby-netlify-cms
|
f5055f8d792cf9ae0e9a96f61f17397eb9e0c96f
|
[
"MIT"
] | null | null | null |
src/pages/about/index.md
|
alexpichel/gatsby-netlify-cms
|
f5055f8d792cf9ae0e9a96f61f17397eb9e0c96f
|
[
"MIT"
] | null | null | null |
src/pages/about/index.md
|
alexpichel/gatsby-netlify-cms
|
f5055f8d792cf9ae0e9a96f61f17397eb9e0c96f
|
[
"MIT"
] | null | null | null |
---
templateKey: about-page
title: National Association of Sentencing Commissions
mainImage:
image: /img/teemu-paananen-376238-unsplash.jpg
imageAlt: Wakanda JavaScript developer presenting at a meetup.
gallery:
- image: /img/neonbrand-509131-unsplash.jpg
imageAlt: Wakanda JavaScript developer presenting at a meetup.
- image: /img/jakob-dalbjorn-730178-unsplash.jpg
imageAlt: Wakanda JavaScript developer presenting at a meetup.
- image: /img/annie-spratt-608001-unsplash.jpg
imageAlt: Wakanda developers working together at a table.
developerGroups: >-
## Sentencing Commission/Council Websites
[Alabama Sentencing Commission](http://sentencingcommission.alacourt.gov/)
[Alaska Judicial Council ](http://www.ajc.state.ak.us/)
[Arkansas Sentencing Commission](http://www.arkansas.gov/asc)
[Connecticut Sentencing Commission](http://www.ct.gov/ctsc)
[Delaware Sentencing Accountability
Commission](http://cjc.delaware.gov/sentac/sentac.shtml)
[DC Sentencing & Criminal Code Revision Commission](http://scdc.dc.gov/)
[Illinois Sentencing Policy Advisory
Council](http://www.icjia.state.il.us/spac/)
[Kansas Sentencing Commission](http://www.accesskansas.org/ksc)
[Louisiana Sentencing
Commission](http://www.lcle.la.gov/programs/sentencing_commission.asp)
[Maryland State Commission on Criminal Sentencing
Policy](http://www.msccsp.org/)
[Massachusetts Sentencing
Commission](http://www.mass.gov/courts/court-info/trial-court/sent-commission/)
[Minnesota Sentencing Guidelines Commission](http://www.msgc.state.mn.us/)
[Missouri Sentencing Advisory Commission](http://www.mosac.mo.gov/)
[New Mexico Sentencing Commission](http://nmsc.unm.edu/)
[New York State Permanent Commission on
Sentencing](http://www.courts.state.ny.us/ip/sentencing/)
[North Carolina Sentencing & Policy Advisory
Commission](http://www.nccourts.org/Courts/CRS/Councils/spac/default.asp)
[Ohio Criminal Sentencing
Commission](http://www.supremecourt.ohio.gov/Boards/Sentencing/default.asp)
[Oregon Criminal Justice Commission](https://www.oregon.gov/cjc)
[Pennsylvania Commission on Sentencing](http://pcs.la.psu.edu/)
[Utah Sentencing Commission](http://www.sentencing.utah.gov/)
[Virginia Criminal Sentencing Commission](http://www.vcsc.virginia.gov/)
[Washington State Sentencing Guidelines Commission](http://www.sgc.wa.gov/)
[United States Sentencing Commission](http://www.ussc.gov/)
organizers:
title: Executive Committee
gallery:
- image: /img/77_bennett_wright.jpg
imageAlt: Bennet Wright
name: 'Bennet Wright, President'
- image: /img/69_dipietro_img_0341.jpg
imageAlt: Susanne DiPietro
name: 'Susanne DiPietro, Vice President'
- image: /img/77_linden.jpg
imageAlt: Linden Fry
name: 'Linden Fry, Treasurer'
- image: /img/65_home.jpg
imageAlt: Diane Shoop
name: 'Diane Shoop, Secretary'
- image: /img/77_nasc_2017_andrews.jpg
imageAlt: Sara Andrews
name: Sara Andrews
- image: /img/73_bio_picture_for_nasc.jpg
imageAlt: Rebecca Murdock
name: Rebecca Murdock
- image: /img/69_nasc_alexweb200.jpg
imageAlt: Alex Tsarkov
name: Alex Tsarkov
seo:
browserTitle: About | NASC
description: >-
The National Association of Sentencing Commissions (NASC) is a non-profit
organization that was created to facilitate the exchange and sharing of
information, ideas, data, expertise, and experiences and to educate on
issues related to sentencing policies, guidelines and commissions.
title: About | NASC
---
## About the NASC
The National Association of Sentencing Commissions (NASC) is a non-profit organization that was created to facilitate the exchange and sharing of information, ideas, data, expertise, and experiences and to educate on issues related to sentencing policies, guidelines and commissions.
Every year, the NASC conference brings together judges, legislators, correctional officials, policy makers, academics, researchers, and practitioners from around the country to examine our nation's experiences with sentencing laws and practices and to discuss emerging issues and innovations.
| 32.389313
| 292
| 0.749705
|
eng_Latn
| 0.503141
|
45082e7c981f8fd0413a12d3eaaa59885cfddfe1
| 11,051
|
md
|
Markdown
|
articles/hdinsight/hbase/apache-hbase-provision-vnet.md
|
sonquer/azure-docs.pl-pl
|
d8159cf8e870e807bd64e58188d281461b291ea8
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
articles/hdinsight/hbase/apache-hbase-provision-vnet.md
|
sonquer/azure-docs.pl-pl
|
d8159cf8e870e807bd64e58188d281461b291ea8
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
articles/hdinsight/hbase/apache-hbase-provision-vnet.md
|
sonquer/azure-docs.pl-pl
|
d8159cf8e870e807bd64e58188d281461b291ea8
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
---
title: Tworzenie klastrów HBase Virtual Network na platformie Azure
description: Rozpocznij korzystanie z usługi HBase w usłudze Azure HDInsight. Dowiedz się, jak tworzyć klastry HBase usługi HDInsight w usłudze Azure Virtual Network.
author: hrasheed-msft
ms.author: hrasheed
ms.reviewer: jasonh
ms.service: hdinsight
ms.topic: conceptual
ms.custom: hdinsightactive
ms.date: 12/23/2019
ms.openlocfilehash: e4e15d1c6554fc567f668b2033bff5b5664db918
ms.sourcegitcommit: 3dc1a23a7570552f0d1cc2ffdfb915ea871e257c
ms.translationtype: MT
ms.contentlocale: pl-PL
ms.lasthandoff: 01/15/2020
ms.locfileid: "75972794"
---
# <a name="create-apache-hbase-clusters-on-hdinsight-in-azure-virtual-network"></a>Tworzenie klastrów Apache HBase w usłudze HDInsight na platformie Azure Virtual Network
Dowiedz się, jak tworzyć klastry Apache HBase usługi Azure HDInsight w usłudze [azure Virtual Network](https://azure.microsoft.com/services/virtual-network/).
Integracja z siecią wirtualną umożliwia wdrażanie klastrów Apache HBase w tej samej sieci wirtualnej co aplikacje, dzięki czemu aplikacje mogą komunikować się bezpośrednio z HBase. Korzyści:
* Bezpośrednie połączenie aplikacji sieci Web z węzłami klastra HBase, co umożliwia komunikację za pośrednictwem interfejsów API zdalnego wywoływania procedur (RPC) języka Java.
* Zwiększona wydajność dzięki braku ruchu w wielu bramach i modułach równoważenia obciążenia.
* Możliwość przetwarzania poufnych informacji w bezpieczniejszy sposób bez ujawniania publicznego punktu końcowego.
Jeśli nie masz subskrypcji platformy Azure, przed rozpoczęciem utwórz [bezpłatne konto](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
## <a name="create-apache-hbase-cluster-into-virtual-network"></a>Tworzenie klastra Apache HBase w sieci wirtualnej
W tej sekcji utworzysz oparty na systemie Linux Klaster Apache HBase z zależnym kontem usługi Azure Storage w sieci wirtualnej platformy Azure przy użyciu [szablonu Azure Resource Manager](../../azure-resource-manager/templates/deploy-powershell.md). Aby poznać inne metody tworzenia klastra i zrozumieć ustawienia, zobacz [Tworzenie klastrów usługi HDInsight](../hdinsight-hadoop-provision-linux-clusters.md). Aby uzyskać więcej informacji o używaniu szablonu do tworzenia klastrów Apache Hadoop w usłudze HDInsight, zobacz [Tworzenie klastrów Apache Hadoop w usłudze HDInsight przy użyciu szablonów Azure Resource Manager](../hdinsight-hadoop-create-linux-clusters-arm-templates.md)
> [!NOTE]
> Niektóre właściwości są trwale kodowane w szablonie. Przykład:
>
> * **Lokalizacja**: Wschodnie stany USA 2
> * **Wersja klastra**: 3.6
> * **Liczba węzłów procesu roboczego klastra**: 2
> * **Domyślne konto magazynu**: unikatowy ciąg
> * **Nazwa sieci wirtualnej**: ClusterName-VNET
> * **Przestrzeń adresowa sieci wirtualnej**: 10.0.0.0/16
> * **Nazwa podsieci**: subnet1
> * **Zakres adresów podsieci**: 10.0.0.0/24
>
> `CLUSTERNAME` jest zastępowana przez podaną nazwę klastra podczas korzystania z szablonu.
1. Wybierz Poniższy obraz, aby otworzyć szablon w Azure Portal. Szablon znajduje się w szablonach [szybkiego startu platformy Azure](https://azure.microsoft.com/resources/templates/101-hdinsight-hbase-linux-vnet/).
<a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2F101-hdinsight-hbase-linux-vnet%2Fazuredeploy.json" target="_blank"><img src="./media/apache-hbase-provision-vnet/hdi-deploy-to-azure1.png" alt="Deploy to Azure button for new cluster"></a>
1. W oknie dialogowym **wdrożenie niestandardowe** wybierz pozycję **Edytuj szablon**.
1. W wierszu 165 Zmień wartość `Standard_A3` na `Standard_A4_V2`. Następnie wybierz pozycję **Zapisz**.
1. Ukończ pozostałe szablony z następującymi informacjami:
|Właściwość |Wartość |
|---|---|
|Subskrypcja|Wybierz subskrypcję platformy Azure używaną do tworzenia klastra usługi HDInsight, zależnego konta magazynu i sieci wirtualnej platformy Azure.|
Grupa zasobów|Wybierz pozycję **Utwórz nową**, a następnie określ nową nazwę grupy zasobów.|
|Lokalizacja|Wybierz lokalizację dla grupy zasobów.|
|Nazwa klastra|Wprowadź nazwę klastra Hadoop, który ma zostać utworzony.|
|Nazwa użytkownika i hasło logowania klastra|Domyślna nazwa użytkownika to **admin**. Podaj hasło.|
|Nazwa użytkownika i hasło ssh|Domyślna nazwa użytkownika to **sshuser**. Podaj hasło.|
Wybierz pozycję **Zgadzam się na warunki i warunki podane powyżej**.
1. Wybierz pozycję **Kup**. Utworzenie klastra trwa około 20 minut. Po utworzeniu klastra możesz wybrać klaster w portalu, aby go otworzyć.
Po zakończeniu tego artykułu możesz chcieć usunąć klaster. Dzięki usłudze HDInsight dane są przechowywane w usłudze Azure Storage, więc można bezpiecznie usunąć klaster, gdy nie jest używany. Opłaty za klaster usługi HDInsight są naliczane nawet wtedy, gdy nie jest używany. Ponieważ opłaty za klaster są wielokrotnie większe niż opłaty za magazyn, ze względów ekonomicznych warto usuwać klastry, gdy nie są używane. Instrukcje usuwania klastra znajdują się [w temacie Zarządzanie klastrami Apache Hadoop w usłudze HDInsight przy użyciu Azure Portal](../hdinsight-administer-use-portal-linux.md#delete-clusters).
Aby rozpocząć pracę z nowym klastrem HBase, możesz użyć procedur znajdujących się w temacie Wprowadzenie do korzystania z platformy [Apache HBase z Apache Hadoop w usłudze HDInsight](./apache-hbase-tutorial-get-started-linux.md).
## <a name="connect-to-the-apache-hbase-cluster-using-apache-hbase-java-rpc-apis"></a>Nawiązywanie połączenia z klastrem Apache HBase przy użyciu interfejsów API protokołu Java platformy Apache HBase
### <a name="create-a-virtual-machine"></a>Tworzenie maszyny wirtualnej
Utwórz maszynę wirtualną "infrastruktura jako usługa" (IaaS) w tej samej sieci wirtualnej platformy Azure i tej samej podsieci. Instrukcje dotyczące tworzenia nowej maszyny wirtualnej IaaS można znaleźć w sekcji [Tworzenie maszyny wirtualnej z systemem Windows Server](../../virtual-machines/windows/quick-create-portal.md). Wykonując kroki opisane w tym dokumencie, należy użyć następujących wartości konfiguracji sieci:
* **Sieć wirtualna**: ClusterName-VNET
* **Podsieć**: subnet1
> [!IMPORTANT]
> Zastąp `CLUSTERNAME` nazwą użytą podczas tworzenia klastra usługi HDInsight w poprzednich krokach.
Korzystając z tych wartości, maszyna wirtualna jest umieszczana w tej samej sieci wirtualnej i podsieci co klaster usługi HDInsight. Ta konfiguracja pozwala im bezpośrednio komunikować się ze sobą. Istnieje możliwość utworzenia klastra usługi HDInsight z pustym węzłem krawędzi. Węzeł brzegowy może służyć do zarządzania klastrem. Aby uzyskać więcej informacji, zobacz [używanie pustych węzłów brzegowych w usłudze HDInsight](../hdinsight-apps-use-edge-node.md).
### <a name="obtain-fully-qualified-domain-name"></a>Uzyskaj w pełni kwalifikowaną nazwę domeny
W przypadku korzystania z aplikacji Java do zdalnego łączenia się z usługą HBase należy użyć w pełni kwalifikowanej nazwy domeny (FQDN). Aby to ustalić, należy uzyskać sufiks DNS konkretnego połączenia klastra HBase. W tym celu można użyć jednej z następujących metod:
* Użyj przeglądarki sieci Web, aby nawiązać połączenie [Apache Ambari](https://ambari.apache.org/) :
Przejdź do `https://CLUSTERNAME.azurehdinsight.net/api/v1/clusters/CLUSTERNAME/hosts?minimal_response=true`. Zwraca plik JSON z sufiksami DNS.
* Użyj witryny sieci Web Ambari:
1. Przejdź do `https://CLUSTERNAME.azurehdinsight.net`.
2. Wybierz pozycję **hosty** z górnego menu.
* Użyj Zwinięciea, aby nawiązywać wywołania REST:
```bash
curl -u <username>:<password> -k https://CLUSTERNAME.azurehdinsight.net/ambari/api/v1/clusters/CLUSTERNAME.azurehdinsight.net/services/hbase/components/hbrest
```
W zwróconych danych JavaScript Object Notation (JSON) Znajdź wpis "host_name". Zawiera nazwę FQDN dla węzłów w klastrze. Przykład:
```
"host_name" : "hn0-hbaseg.hjfrnszlumfuhfk4pi1guh410c.bx.internal.cloudapp.net"
```
Częścią nazwy domeny rozpoczynającą się nazwą klastra jest sufiks DNS. Na przykład `hjfrnszlumfuhfk4pi1guh410c.bx.internal.cloudapp.net`.
<!--
3. Change the primary DNS suffix configuration of the virtual machine. This enables the virtual machine to automatically resolve the host name of the HBase cluster without explicit specification of the suffix. For example, the *workernode0* host name will be correctly resolved to workernode0 of the HBase cluster.
To make the configuration change:
1. RDP into the virtual machine.
2. Open **Local Group Policy Editor**. The executable is gpedit.msc.
3. Expand **Computer Configuration**, expand **Administrative Templates**, expand **Network**, and then click **DNS Client**.
- Set **Primary DNS Suffix** to the value obtained in step 2:

4. Click **OK**.
5. Reboot the virtual machine.
-->
### <a name="verify-communication-inside-virtual-network"></a>Weryfikowanie komunikacji wewnątrz sieci wirtualnej
Aby sprawdzić, czy maszyna wirtualna może komunikować się z klastrem HBase, użyj polecenia `ping headnode0.<dns suffix>` z maszyny wirtualnej. Na przykład `ping hn0-hbaseg.hjfrnszlumfuhfk4pi1guh410c.bx.internal.cloudapp.net`.
Aby użyć tych informacji w aplikacji Java, można wykonać kroki opisane w temacie Korzystanie z platformy [Apache Maven do kompilowania aplikacji Java, które korzystają z platformy Apache HBase z usługą HDInsight (Hadoop)](./apache-hbase-build-java-maven-linux.md) w celu utworzenia. Aby aplikacja łączyła się ze zdalnym serwerem HBase, należy zmodyfikować plik **HBase-site. XML** w tym przykładzie, aby użyć nazwy FQDN dla dozorcy. Przykład:
<property>
<name>hbase.zookeeper.quorum</name>
<value>zookeeper0.<dns suffix>,zookeeper1.<dns suffix>,zookeeper2.<dns suffix></value>
</property>
> [!NOTE]
> Aby uzyskać więcej informacji na temat rozpoznawania nazw w sieciach wirtualnych platformy Azure, w tym sposobu korzystania z własnego serwera DNS, zobacz [rozpoznawanie nazw (DNS)](../../virtual-network/virtual-networks-name-resolution-for-vms-and-role-instances.md).
## <a name="next-steps"></a>Następne kroki
W tym artykule przedstawiono sposób tworzenia klastra Apache HBase. Aby dowiedzieć się więcej, zobacz:
* [Wprowadzenie do usługi HDInsight](../hadoop/apache-hadoop-linux-tutorial-get-started.md)
* [Używanie pustych węzłów brzegowych w usłudze HDInsight](../hdinsight-apps-use-edge-node.md)
* [Konfigurowanie replikacji Apache HBase w usłudze HDInsight](apache-hbase-replication.md)
* [Tworzenie klastrów Apache Hadoop w usłudze HDInsight](../hdinsight-hadoop-provision-linux-clusters.md)
* [Rozpoczynanie pracy z usługą Apache HBase z usługą Apache Hadoop w usłudze HDInsight](./apache-hbase-tutorial-get-started-linux.md)
* [Omówienie usługi Virtual Network](../../virtual-network/virtual-networks-overview.md)
| 71.296774
| 684
| 0.788978
|
pol_Latn
| 0.999358
|
4508cc593f8b806fd952faa4cea4b0ff94ff01f4
| 10,744
|
md
|
Markdown
|
_posts/2016-4-4-fjtm-two-post.md
|
taisenjay/taisenjay.github.io
|
aad91954721fe109868f81e7cd371e0689f55eae
|
[
"MIT"
] | 1
|
2020-07-26T22:58:44.000Z
|
2020-07-26T22:58:44.000Z
|
_posts/2016-4-4-fjtm-two-post.md
|
taisenjay/taisenjay.github.io
|
aad91954721fe109868f81e7cd371e0689f55eae
|
[
"MIT"
] | null | null | null |
_posts/2016-4-4-fjtm-two-post.md
|
taisenjay/taisenjay.github.io
|
aad91954721fe109868f81e7cd371e0689f55eae
|
[
"MIT"
] | null | null | null |
---
layout: post
title: "创造丰富多彩的UI-View与动画"
excerpt: "《Android开发进阶:从小工到专家》第2章读书笔记"
tags: [读书笔记,从小工到专家]
comments: true
---
# 1、重要的View控件 #
用户界面通常由Activity组成,Activity中关联了一个PhoneWindow创建,在这个窗口下则管理了一棵视图树,其顶级视图为DecorView(ViewGroup),DecorView下就是各个视图控件。
如图:
<figure>
<img src="/images/ui_view_tree.png">
</figure>
## 1.1、ListView和GridView ##
ListView:以列表形式展示具体内容,能够根据数据的长度自适应显示。
列表数据的显示需要4个元素,分别为:
- 用来展示列表的ListView
- 用来把数据映射到ListView上的Adapter
- 需要展示的数据集
- 数据展示需要的模板
具体数据如何展示,是通过Adapter模式来实现,用户只需要复写几个特定的方法就可以将每项数据构建出来,这些方法为:
- getCount():获取数据的个数
- getItem(int):获取position位置的数据
- getItemId(int):获取position位置的数据id,一般直接返回posiiton
- getView(int,View,ViewGroup):获取position位置上的item view视图
ListView加载时会根据数据的个数来创建itemView,每个Item View通过getView()方法实现,在这个函数中用户必须构建Item View,然后将该position位置上数据绑定到Item View上。
Android采用视图复用原则来创建Item View,比如某个ListView中只需8个Item View就能铺满屏幕,那么即使有100个数据项需要展示,那么也只会创建8个Item View。当屏幕向下滑动时,第一项不可见后,就会进入ListView的Recycler中,Recycler会将该视图缓存。
当数据源发生变化后,通过Adapter的notifyDataSetChanged()方法来更新。GridView和ListView相似,同一个Adapter可以设置给ListView和GridView。
## 1.2、RecyclerView ##
ListView和GridView基本上只有布局方式不一样,其他机制基本一样。RecyclerView就是作为ListView和GridView的替代者实现的。
RecyclerView也使用Adapter,不过该Adapter是RecyclerView的静态内部类,该Adapter还有一个泛型参数VH,代表ViewHolder(该类中有一个item view字段,代表每一项数据的根视图,需要在构造函数中传递给ViewHolder对象)。用户需要实现的函数有:
- onCreateViewHolder()(告诉RecyclerView每项数据是怎样的)
- onBindViewHolder()(将数据绑定)
- getItemCount()(告诉RecyclerView有多少项数据)。
RecyclerView亮点->将布局抽象为LayoutManager:
- LinearLayoutManager,线性布局
- GridLayoutManager,网格布局
- StaggeredGridLayoutManager,交错网格布局
- 定制布局管理器实现自定义布局
除此之外,RecyclerView还可以通过ItemDecotation为Item View添加装饰;也可以通过ItemAnimator为Item View添加动画。
## 1.3、ViewPager ##
主要应用场景:与Fragment配合使用,实现滑动页面进行页面导航
常用FragmentPagerAdapter来实现。
[<font color="red">网易新闻客户端Tab</font>](http://blog.csdn.net/xiaanming/article/details/10766053)
# 2、自定义控件 #
自定义View类型:
- 继承自View完全自定义
- 继承现有控件(如ImageView)实现特定效果
- 继承自ViewGroup实现布局
自定义View的重点有View的测量与布局、View的绘制、处理触摸事件、动画等。
## 2.1、自定义View ##
继承自View完全实现自定义控件是最自由的一种实现,但是也相对复杂。你需要正确地测量View的尺寸,并且手动绘制各种视觉效果。
对于继承自View类的自定义控件来说,核心的步骤分别为尺寸测量与绘制,对应的函数式onMeasure、onDraw。因为View类型的子类也是视图树的叶子结点,因此其只需负责绘制好自身内容即可。
实现过程:
- 继承自View创建自定义控件
- 如有需要自定义View属性,也就是在values/attrs.xml中定义属性集
- 在xml中引入命名空间,设置属性
- 在代码中读取xml中的属性,初始化视图
- 测量视图大小
- 绘制视图内容
## 2.2、View的尺寸测量 ##
在Android中,视图树在创建时会调用根视图的measure(测量)、layout(布局)、draw(绘制)三个函数。其中对于非ViewGroup的View而言,不需要layout。
视图树渲染时,系统的绘制流程会从ViewRoot的PerformTraversals()中开始,在其内部调用measure(widthMeasureSpec,heightMeasureSpec)方法,这两个参数分别用于确定视图的宽度、高度的规格和大小。MeasureSpec的值由specSize(规格)和specMode(大小)共同组成。
SpecMode(模式)类型:
- EXACTLY,表示父视图希望子视图的大小由specSize的值确定(<font color="green">系统默认会按照此规则来设置子视图大小</font>)。<font color="red">match_parent和具体数值(如20dp)</font>对应这个模式。
- AT_MOST,表示子视图最大只能是specSize中指定的大小(<font color="green">系统默认会按照此规则来设置子视图大小</font>)。一般情况,<font color="red">wrap_content对应这种模式</font>。
- UNSPECIFIED,表示开发人员完全自由设置视图的大小,没有任何限制。这种情况很少见,基本不常用。
MeasureSpec的来源:ViewRootImpl(视图树控制类)的measureHierarchy函数会通过getRootMeasureSpec()方法来获取widthMeasureSpec和heightMeasureSpec。构建完根视图的MeasureSpec后会执行performMeasure函数从根视图开始一层一层测量视图的大小,最终调用setDimension函数设置该视图的大小。
## 2.3、Canvas与Paint ##
对于Android来说,整个View就是一张画布(Canvas),开发者可以通过Paint(画笔)在这张画布上绘制各种各样的图形、元素,例如矩形、圆形、椭圆、文字、圆弧、图片等。需要注意Canvas类的save(保存画布状态)和restore(恢复到上一个保存的画布状态)函数,应用在画布进行了平移,缩放,旋转,倾斜、裁剪等操作后。
## 2.4、自定义ViewGroup ##
自定义ViewGroup是另一种重要的自定义View形式,不同在于,开发者还需要实现onLayout方法(将ViewGroup下中包含的View进行合理布局)。
## 3、Scroller的使用 ##
Scroller是一个帮助View滚动的辅助类。Scroller 封装了滚动时间、要滚动的目标x轴和y轴,以及在每个时间内View应该滚动到的(x,y)轴的坐标点。
示例:
{% highlight Java %}
public void ScrollLayout extends FrameLayout{
private String TAG = ScrollLayout.class.getSimpleName();
Scroller mScroller;
public ScrollLayout(Context context ){
super(context);
mScroller = new Scroller(context);
}
//该函数会在View重绘时被调用
@Override
public void computeScroll(){
if(mScroller.computeScrollOffset()){
//滚动到此,View应该滚动到的x,y坐标上
this.scrollTo(mScroller.getCurX(),mScroller.getCurrY());
//请求重绘该View,从而又会导致computeScroll被调用,然后继续滚动,直到
//computeScrollOffset返回false
this.postInvalidate();
}
}
//调用这个方法进行滚动,这里我们只滚动竖直方向
public void scrollTo(int y){
//参数1和2分别为滚动的起始点的水平、竖直方向的滚动偏移量
//3和4为水平和竖直方向上滚动的距离
mScroller.startScroll(getScrollX(),getScrollY(),0,y);
this.invalidate();
}
}
//调用代码
ScrollLayout scrollView = new ScrollLayout(getContext());
scrollView.scrollTo(100);
{% endhighlight %}
示例代码分析:首先调用scrollTo(int y),然后在该方法中通过mScroller.startScroll()方法来设置滚动的参数,再调用invalidate()方法使得该View重绘。重绘时会调用computeScroll(),在该方法中通过mScroller.computeScrollOffset()判断滚动是否完成,如果返回true,代表没有滚动完成,此时把该View滚动到此刻应该滚动的x,y位置,这个位置通过mScroller的getCurrX和getCurrY获得。然后继续调用重绘方法,继续执行滚动过程,直至滚动完成。
[<font color="blue">下拉刷新组件实现</font>](https://github.com/hehonghui/android_my_pull_refresh_view)
# 4、让应用更精彩——动画 ##
动画分类:帧动画、补间动画(最早),属性动画(Android3.0之后),Vector Drawable(Android5.0)
动画实质:在指定的时间内持续的修改某个属性的值,使该值在指定取值范围内平滑的过渡。
## 4.1、帧动画 ##
Frame动画(帧)是一系列图片按照一定的顺序展示的过程(类似于放电影)。
实现方式:1、在xml中定义;2、在Java代码中实现。
在xml中实现:放置在/res目录下的anim目录或drawable目录下,必须由<animation-list>元素作为根元素,其可以包含一个或多个<item>元素。andorid:onshot如果定义为true的话表示此动画只会执行一次,false则循环。<item>元素代表一帧动画,android:drawable指定此帧对应的图片,android:duration代表此帧持续的时间,单位为毫秒。
示例(hear_anim.xml):
{% highlight xml %}
<animation-list xlmns:andrid="http://…………………………"
android:oneshot="true">
<item
android:duration="500"
android:drawable="@drawable/ic_heart_0">
<item
android:duration="500"
android:drawable="@drawable/ic_heart_1">
<item
android:duration="500"
android:drawable="@drawable/ic_heart_2">
<item
android:duration="500"
android:drawable="@drawable/ic_heart_3">
<item
android:duration="500"
android:drawable="@drawable/ic_heart_4">
</animation-list>
{% endhighlight %}
再将该动画xml设置给某个View,比如:
{% highlight xml %}
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/heart_anim"/>
{% endhighlight %}
但是动画并不会在View显示时自动播放,还需要通过代码启动
{% highlight Java %}
((AnimationDrawable)mImageView.getBackground()).start();
{% endhighlight %}
当然,也可以完全用代码实现帧动画:
{% highlight Java %}
AnimationDrawable anim = new AnimationDrawable();
for (int i=0;i<=4;i++){
//获取图片的资源id
int id = getResources().getIdentifier("ic_heart_"+ i,"drawble",getPackageName());
Drawable drawable = getResources().getDrawable(id);
//将Drawable添加到帧动画中
anim.addFrame(drawable,300);
}
anim.setOneShot(false);
//将动画设置为ImageView的背景
mImageView.setBackgroundDrawable(anim);
anim.start();
{% endhighlight %}
## 4.2、补间动画 ##
tween(补间)动画是操作某个控件让其展现出旋转、渐变、移动、缩放的一种转换过程。
xml实现:
<set>为根节点(对应Java类-AnimationSet),<set>的属性有android:interpolator(代表一个插值器资源),android:shareInterpolator代表<set>里面的多个动画(有<alpha><scale><translate><rotate>)是否共享插值器,默认为true。
- <alpha>(Java对应类:AlphaAnimation)渐变动画
- android:fromAlpha:起始alpha值(浮点值,范围在0.0——1.0)
- adnroid:toAlpha:结尾alpha值
- <scale>(Java对应类:ScaleAnimation)缩放动画
- android:fromXScale:起始X方向上相对自身的缩放比例(浮点值,1.0代表无变化,0.5代表缩小一倍,2.0代表放大一倍)
- android:toXScale:结尾X方向上相对自身的缩放比例
- android:fromYScale:起始y方向上相对自身的缩放比例(浮点值,1.0代表无变化,0.5代表缩小一倍,2.0代表放大一倍)
- android:toYScale:结尾y方向上相对自身的缩放比例
- android:pivotX:缩放的中轴点的X坐标
- android:pivotY:缩放的中轴点的Y坐标
- <translate>(Java对应类:TranslateAnimation)位移动画
- android:fromXDelta:起始X方向的位置(支持3种单位:浮点,num%,num%p)
- android:toXDelta:结尾X方向的位置
- android:fromYDelta:起始Y方向的位置
- android:toYDelta:结尾Y方向的位置
- <rotate>(Java对应类:RotateAnimation)旋转动画
- android:fromDegrees:起始角度(浮点值,度)
- android:toDegrees:结尾角度(浮点值,度)
- android:pivotX:旋转的中轴点的X坐标(支持3种单位:浮点,num%,num%p)
- android:pivotY:旋转的中轴点的Y坐标
## 4.3、属性动画 ##
属性动画(不仅限于移动,缩放,旋转,淡入淡出)不是针对View来设计的,不再只是一种视觉上的效果。 其实际上是真正的在一定时间段内不断修改某个对象的某个属性值的机制。我们需要告诉系统动画操作的属性,动画时长,哪种动画,以及动画的初始结束值。
## 4.3.1、属性动画的核心类——ValueAnimator ##
ValueAnimator:
- 作用:在一定时间内不断修改对象的某个属性值
- 原来:内部使用一种时间循环的机制来计算值与值之间的动画过渡
- 使用:将属性的取值范围、运行时长提供给ValueAnimator
- 此外:其还负责管理动画的播放次数、播放模式,以及对动画设置监听
通常我们通过ofFloat,ofInt等静态工厂函数构建ValueAnimator,示例:
{% highlight Java %}
private void startValueAnimation(){
ValueAnimator animator = ValueAnimator.ofFloat(0.0f,1.0f);
animator.setDuration(1000);
animator.addUpdateListener(mAnimationListener);
}
ValueAnimator.AnimatorUpdateListener mAnimationListener = new
ValueAnimator.AnimatorUpdateListener(){
@Override
public void onAnimationUpdate(ValueAnimator animation){
float newValue = animation.getAnimatedValue();
//将不断变化的属性数值设置给具体的View
//这里设置的是alpha(透明度)这个属性(此动画完成了透明度从0.0过渡到1.0的效果)
myView.setAlpha(newValue);
Log.e("","### 新的属性值: "+ newValue);
}
};
{% endhighlight %}
也可以在res/anim目录下的xml文件中定义该动画,然后在代码中获取:
{% highlight xml %}
//R.anim.value_animator
<animator xmlns: ……
android:valueFrom="0.0"
android:valueTo="1.0"
android:valueType="floatType"/>
ValueAnimator animator = AnimatorInflater.loadAnimator (getApplicationContext(),R.anim.value_animator);
{% endhighlight %}
## 4.3.2、对任意属性进行动画操作——ObjectAnimator ##
ValueAnimator功能强大,自由度高,但是使用起来效率较低,。实际开发中用的更多的应该是ObjectAnimator。
ObjectAnimator是ValueAnimator的子类,其功能强大,能够操作任意对象的任意属性。
{% highlight java %}
ObjectAnimator animator = ObjectAnimator.ofFloat(myView,"alpha",1.0f,0.3f,0.7f);
animator.setDuration(2000);
animator.start();
{% endhighlight %}
## 4.3.3、实现丰富多彩的动画效果——AnimatorSet ##
AnimatorSet将多个动画组合起来。AnimatorSet提供一个play(Animator)方法,然后返回一个AnimatorSet.Builder的实例,AnimatorSet.Builder有以下5个核心方法:
- after(Animator anim):前一个动画执行完后再执行这个动画
- after(long delay):前一个动画执行完后延迟指定毫秒数
- before(Animator anim):在anim动画执行完之前再执行调用after函数的动画
- with(Animator anim):将现有动画和传入的动画同时执行
- playTogether(Animator…… anims):将多个动画一起执行
示例:
{% highlight java %}
AnimatorSet animSet = new AnimatorSet();
animSet.play(anim1).with(anim2).after(anim3);
animSet.setDuration(2000);
animSet.start();
{% endhighlight %}
## 4.3.4、动画执行时间——TypeEvaluator与TimeInterpolator ##
TypeEvalutor:根据当前动画已执行时间占总时间的百分比来计算新的属性值。
核心方法:public abstract T evaluate(float fraction,T startValue,T endValue)
参数1:已执行时间占总时间的百分比(0.0——1.0),参数2:属性的起始值,参数3:属性的最终值
示例:
{% highlight java %}
//实现
public class TranslateXEvalutor implements TypeEvaluator<Integer>{
@Override
public Integer evaluate(float fraction,Integer startValue,Integer endValue){
//计算新的属性值
int newValue = startValue + (int)(fraction + (endvalue - startValue));
return newValue;
}
}
//使用
private void useCustomEvaluator(){
ObjectAnimator animator = ObjectAnimator.ofObject(mView,"x",new TranslateXEvaluator(),0,200);
animator.setDuration(500);
animator.start();
}
{% endhighlight %}
TimeInterpolator:修改动画已执行时间与总时间的百分比,也就是fraction参数值。
- LinearInterpolator:匀速线性插值
- AccelerateInterpolator:加速插值器
- DecelerateInterpolator:减速插值器
- AccelerateDecelerateInterpolator:加减速插值器
过程:在获得已执行时间百分比之后,通过调用TimeInterpolator的getInterpolation函数来对该百分比做出修改,并且返回。
| 28.199475
| 271
| 0.788533
|
yue_Hant
| 0.44125
|
45092b2bb48154e070777435e995055250458a38
| 2,814
|
md
|
Markdown
|
docs/2014/reporting-services/reports/clickthrough-reports-ssrs.md
|
keunyop/sql-docs.ko-kr
|
ebbdcd44eebf4861c9ea9a8c13de6c2098b9f539
|
[
"CC-BY-4.0",
"MIT"
] | 1
|
2019-12-04T01:36:20.000Z
|
2019-12-04T01:36:20.000Z
|
docs/2014/reporting-services/reports/clickthrough-reports-ssrs.md
|
keunyop/sql-docs.ko-kr
|
ebbdcd44eebf4861c9ea9a8c13de6c2098b9f539
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
docs/2014/reporting-services/reports/clickthrough-reports-ssrs.md
|
keunyop/sql-docs.ko-kr
|
ebbdcd44eebf4861c9ea9a8c13de6c2098b9f539
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
---
title: 클릭 방문 보고서(SSRS) | Microsoft Docs
ms.custom: ''
ms.date: 05/24/2017
ms.prod: sql-server-2014
ms.reviewer: ''
ms.technology:
- reporting-services-native
ms.topic: conceptual
helpviewer_keywords:
- clickthrough reports
- customizing clickthrough reports
- clickthrough reports, customizing
ms.assetid: cf2c396e-b0c6-41f9-8c45-ddc8406f7e85
author: markingmyname
ms.author: maghan
manager: kfile
ms.openlocfilehash: caf23eb7e7d0e06a9e79dbaa6b9a0120725a4b10
ms.sourcegitcommit: dfb1e6deaa4919a0f4e654af57252cfb09613dd5
ms.translationtype: MT
ms.contentlocale: ko-KR
ms.lasthandoff: 02/11/2019
ms.locfileid: "56031054"
---
# <a name="clickthrough-reports-ssrs"></a>클릭 광고 보고서(SSRS)
클릭 광고 보고서는 주 보고서 내에 포함되어 있는 데이터에 대한 세부 정보를 제공하는 보고서입니다. 클릭 광고 보고서는 사용자가 주 보고서에 나타나는 대화형 데이터를 클릭할 때 표시됩니다. 이러한 보고서는 보고서 서버에 의해 자동으로 생성됩니다. 모델 디자이너는 보고서 모델의 엔터티에 할당하는 `DefaultDetailAttribute` 및 `DefaultAggregateAttribute` 속성을 설정하여 클릭 광고 보고서에 표시될 내용을 결정합니다.
> [!NOTE]
> 클릭 방문 보고서는 [!INCLUDE[msCoName](../../includes/msconame-md.md)][!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)]의 일부 버전에서만 사용할 수 있습니다. 버전에서 지원 되는 기능 목록은 [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)]를 참조 하세요 [SQL Server 2014 버전에서 지 원하는 기능](../../getting-started/features-supported-by-the-editions-of-sql-server-2014.md)합니다. 조직에서 실행 중인 [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] 버전을 잘 모를 경우 데이터베이스 관리자에게 문의하십시오.
## <a name="using-default-templates"></a>기본 템플릿 사용
기본적으로 보고서 서버는 엔터티별로 단일 인스턴스 템플릿과 여러 인스턴스 템플릿이라는 두 개의 클릭 광고 템플릿 유형을 생성합니다. 클릭하는 항목에 따라 사용되는 템플릿이 결정됩니다. 보고서를 읽는 사람이 스칼라 특성을 클릭하면 단일 인스턴스 템플릿이 사용되고 집계 특성을 클릭하면 여러 인스턴스 템플릿이 사용됩니다.
#### <a name="single-instance-templates"></a>단일 인스턴스 템플릿
단일 인스턴스 템플릿은 대상 엔터티의 모든 특성 및 대상 엔터티를 기준으로 일 대 다 관계에 있는 관련 엔터티에 대해 지정되는 모든 기본 집계 특성을 표시합니다. 단일 인스턴스 템플릿은 다음 이미지와 비슷합니다.

#### <a name="multiple-instance-templates"></a>여러 인스턴스 템플릿
여러 인스턴스 템플릿은 대상 엔터티의 기본 세부 특성 및 대상 엔터티를 기준으로 일 대 다 관계에 있는 관련 엔터티에 대해 지정되는 모든 기본 집계 특성만 표시합니다. 여러 인스턴스 템플릿은 다음 이미지와 비슷합니다.

## <a name="customizing-clickthrough-reports"></a>클릭 광고 보고서 사용자 지정
보고서 서버가 생성하는 기본 템플릿을 사용하는 대신 보고서 작성기에서 보고서를 만들어 사용자 지정된 클릭 광고 보고서로 사용할 수 있습니다. 그런 다음 보고서 관리자에서 이 보고서를 드릴스루 보고서로 모델에 연결할 수 있습니다.
보고서 작성기 보고서를 클릭 광고 보고서로 바꾸려면 보고서 작성기 **속성** 대화 상자에서 **이 보고서에 드릴스루 사용** 옵션을 선택해야 합니다. 이 옵션을 선택하면 드릴스루 매개 변수가 보고서에 추가되고 보고서는 더 이상 보고서 작성기에서 직접 실행될 수 없습니다. 보고서를 보는 사람이 보고서 작성기 보고서의 항목을 클릭하면 보고서 서버에서 자동으로 드릴스루 매개 변수를 계산합니다.
> [!IMPORTANT]
> 보고서에서 사용되는 기본 엔터티는 보고서를 연결하는 엔터티와 동일한 엔터티여야 합니다.
## <a name="see-also"></a>관련 항목
[보고서를 클릭 광고 보고서로 모델에 연결](../link-a-report-to-a-model-as-a-clickthrough-report.md)
| 50.25
| 457
| 0.715352
|
kor_Hang
| 1.00001
|
450a753cf17f4c9d4ba07162211fd46f8606f7af
| 266
|
md
|
Markdown
|
README.md
|
xiebic/script
|
fddce9714b81dc35377d3b47ba7dab8094cf2ada
|
[
"MIT"
] | null | null | null |
README.md
|
xiebic/script
|
fddce9714b81dc35377d3b47ba7dab8094cf2ada
|
[
"MIT"
] | null | null | null |
README.md
|
xiebic/script
|
fddce9714b81dc35377d3b47ba7dab8094cf2ada
|
[
"MIT"
] | null | null | null |
# 懒人专用一键脚本
Filebrowser.sh
======
- 脚本说明: Filebrowser 一键安装脚本
- 系统支持: CentOS6+ / Debian7+ / Ubuntu14+
- 使用方法: https://github.com/filebrowser/filebrowser
### 下载安装:
``` bash
bash <(curl -L -s https://raw.githubusercontent.com/xiebic/script/master/Filebrowser.sh)
```
| 19
| 88
| 0.695489
|
yue_Hant
| 0.525815
|
450a7b5c33057e7052ddf6f34900b52472e01c5d
| 14,809
|
md
|
Markdown
|
git_command.md
|
zhangzhuang15/git-command
|
ffbc9c80f1941fad624c1f817d96a50ba80a808e
|
[
"MIT"
] | 1
|
2022-02-02T05:46:41.000Z
|
2022-02-02T05:46:41.000Z
|
git_command.md
|
zhangzhuang15/git-command
|
ffbc9c80f1941fad624c1f817d96a50ba80a808e
|
[
"MIT"
] | null | null | null |
git_command.md
|
zhangzhuang15/git-command
|
ffbc9c80f1941fad624c1f817d96a50ba80a808e
|
[
"MIT"
] | null | null | null |
# git 命令
## 前言
git分为本地仓库和远程仓库。
git本地仓库的核心分为三部分,工作区、缓存区(或暂存区)、仓库本身,依次对应
Working Directory、index、HEAD,详情[戳这里](https://git-scm.com/book/zh/v2/Git-工具-重置揭密#_git_reset)👈。
在文档中总会使用`<url>`这样的标记,<>中表示某种对象,整体表示的是对象值。
比如url表示的是网址,`<url>`表示的就是具体的那个网址,也就是那一长条的字符串。
如果英文可以直接体现含义,将不再单独解释。
推荐一个[git可视化网页游戏](https://learngitbranching.js.org)
<a id="0"></a>
## 目录
<a id="01"></a>
#### [本地项目推到github](#1)
<a id="02"></a>
#### [拷取远程项目到本地](#2)
<a id="03"></a>
#### [设置 git用户名、邮箱、密码](#3)
<a id="04"></a>
#### [初始化本地仓库](#4)
<a id="05"></a>
#### [添加远程仓库地址别名](#5)
<a id="06"></a>
#### [修改远程仓库地址别名](#6)
<a id="07"></a>
#### [修改别名对应的远程仓库地址](#7)
<a id="08"></a>
#### [查看别名对应的远程仓库地址](#8)
<a id="09"></a>
#### [查看远程仓库别名及其地址的列表](#9)
<a id="010"></a>
#### [拷贝远程仓库](#10)
<a id="011"></a>
#### [新建本地分支](#11)
<a id="012"></a>
#### [切换本地分支](#12)
<a id="013"></a>
#### [新建本地分支并切换到这个分支](#13)
<a id="014"></a>
#### [新建关联远程分支的本地分支](#14)
<a id="015"></a>
#### [删除本地分支](#15)
<a id="016"></a>
#### [删除远程分支](#16)
<a id="017"></a>
#### [重命名本地分支](#17)
<a id="018"></a>
#### [查看本地分支名单](#18)
<a id="019"></a>
#### [查看远程分支名单](#19)
<a id="020"></a>
#### [查看所有分支名单](#20)
<a id="021"></a>
#### [查看本地分支详细信息](#21)
<a id="022"></a>
#### [将本地分支和远程分支关联](#22)
<a id="023"></a>
#### [取消本地分支和远程分支的关联](#23)
<a id="024"></a>
#### [拉取远程分支的分支信息到本地](#24)
<a id="025"></a>
#### [添加文件到本地仓库的缓存区](#25)
<a id="026"></a>
#### [撤销git add](#26)
<a id="027"></a>
#### [把缓存区的信息提交到本地仓库](#27)
<a id="028"></a>
#### [文件恢复到上次commit时的样子](#28)
<a id="029"></a>
#### [取消git对文件的版本追踪](#29)
<a id="030"></a>
#### [重命名文件并更新到缓存区](#30)
<a id="031"></a>
#### [比较缓存区和工作区的差异](#31)
<a id="032"></a>
#### [比较缓存区和本地仓库中文件的差异](#32)
<a id="033"></a>
#### [比较本地两个分支本地仓库的差异](#33)
<a id="034"></a>
#### [比较本地两个分支本地仓库某文件的差异](#34)
<a id="035"></a>
#### [查看本地两个分支有哪些文件存在差异](#35)
<a id="036"></a>
#### [本地分支推送到远程仓库](#36)
<a id="037"></a>
#### [远程分支和本地分支合并](#37)
<a id="038"></a>
#### [设置本地分支默认推送到哪个远程分支](#38)
<a id="039"></a>
#### [打标签](#39)
<a id="040"></a>
#### [查看本地仓库都创建了哪些标签](#40)
<a id="041"></a>
#### [查看远程仓库都有哪些标签](#41)
<a id="042"></a>
#### [删除本地分支的标签](#42)
<a id="043"></a>
#### [删除远程仓库的标签](#43)
<a id="044"></a>
#### [基于标签创建一个本地分支](#44)
<a id="045"></a>
#### [查看本地分支提交历史](#45)
<a id="046"></a>
#### [本地分支回滚到某一个版本](#46)
<a id="047"></a>
#### [状态暂存并切换分支](#47)
<a id="048"></a>
#### [终端无法正常显示中文字符](#48)
<a id="1"></a>
## 本地项目推到github
1. 在github上创建远程仓库,自动生成`main`分支,拷贝仓库地址 `url`, 拷贝`authenticate token`;
2. 进入本地项目目录下执行`git init`, 自动生成`master`分支;
3. 新建分支`git branch dev`;
4. 切换到新分支`git checkout dev`;
5. 提交项目所有文件到本地缓存`git add --all`;
6. 把本地缓存提交到本地仓库`git commit -m <message>`;
7. 添加远程仓库名称 `git remote add origin <url>`;
8. 执行`git push --set-upstream origin`;
9. 输入github账户名和`<authenticate token>`;
10. 推送到远程仓库`git push origin dev`;
11. 远程仓库将出现dev分支,包含项目中的所有代码;
[返回目录](#0)
[返回条目](#01)
<a id="2"></a>
## 拷取远程项目到本地
1. 在github上拷贝仓库地址`url`;
2. 进入本地存储该项目的文件夹下,执行`git clone <url>`;
3. 拉取远程仓库分支的信息`git fetch origin`;
4. 在本地新建一个远程仓库的同名分支develop,并和该分支关联
`git checkout develop`
> 也可以执行
`git checkout --track origin/develop`
> 还可以给本地分支换个名字
`git checkout -b mydevelop origin/develop`
[返回目录](#0)
[返回条目](#02)
<a id="3"></a>
## 设置 git用户名、邮箱、密码
`git config --global user.name <your_name>`
`git config --global user.email <your_email>`
`git config --global credential.helper store` 执行后,第一次调用git pull 或者 git push,输入密码,之后就不需要输入密码了
> 对于github,已经改为`authenticate_token`验证方式,不再使用密码。
[返回目录](#0)
[返回条目](#03)
<a id="4"></a>
## 初始化本地仓库
假设你位于project文件夹下,且该文件夹就是你的项目根目录
此时project仅仅是文件系统的文件夹而已,并不是git本地仓库
执行 `git init`
结果:
* 将project初始化为本地仓库
* 建立一个默认分支master
[返回目录](#0)
[返回条目](#04)
<a id="5"></a>
## 添加远程仓库地址别名
> 假设你知道远程仓库地址 `url`
在后续 push 或者 pull 操作中,总会使用这个`url`
因为`url`本身是很长的字符串,非常不方便记忆和命令行输入
所以,类似`ip地址`和`域名`的做法,给远程仓库地址取个别名使用
执行
`git remote add origin <url>`
`origin`就是别名,你可以取一个你喜欢的名字
后续使用远程仓库地址的地方,就可以使用 `origin` 代替
> 对于支持用户名和密码方式访问的git服务端,可以在url中加入用户名和
> 密码信息,可避免git push 或者 git pull 时再输入用户名、密码。
>
> 假设url是"https://bbhub.com/bbb.git",用户名为xiao,密码为ak47,
> 则加入用户名和密码的url为"https://xiao:ak47@bbub.com/bbb.git".
>
> 最后执行`git remote add origin <url>`即可
> 后续执行和origin相关的push和pull操作,就不会再用输入用户名、密码
[返回目录](#0)
[返回条目](#05)
<a id="6"></a>
## 修改远程仓库地址别名
假设当前远程仓库地址别名是 origin,但出于某种原因,必须要改为 own
执行
`git remote rename origin own`
> 很好理解,把某个名字重命名为另一个名字,旧名字当然在前,新名字在后啦
[返回目录](#0)
[返回条目](#06)
<a id="7"></a>
## 修改别名对应的远程仓库地址
假设当前仓库地址别名是 origin, 但是远程仓库地址由`<url>` 改成了 `<new_url>`
考虑到兼容性,你想继续使用 origin作为远程仓库新地址的别名
执行
`git remote set-url origin <new_url>`
[返回目录](#0)
[返回条目](#07)
<a id="8"></a>
## 查看别名对应的远程仓库地址
假设当前仓库地址别名是 origin,但你想不起来origin对应的远程仓库地址是什么了
执行
`git remote get-url origin`
[返回目录](#0)
[返回条目](#08)
<a id="9"></a>
## 查看远程仓库别名及其地址的列表
`git remote -v`
[返回目录](#0)
[返回条目](#09)
<a id="10"></a>
## 拷贝远程仓库
`git clone <url>`
url是远程仓库地址.
假设远程仓库的默认分支是main,在上述指令执行完毕后
* 你将拥有一个本地仓库
* 本地仓库会有一个main本地分支, 该分支会与远程main分支关联
* 你将得到一个自动创建的远程仓库的别名origin
* 你将获取远程仓库所有分支的分支信息,用`git branch -r`可查看
如果你想更进一步,在拷贝完远程仓库后,不留在main分支,而是新建
一个和远程分支同名且关联的本地分支,然后留在这个新的本地分支
可执行
`git clone -b <branch-name> <url>`
> 分支名一定要和远程仓库众多分支中的一个保持一致!
[返回目录](#0)
[返回条目](#010)
<a id="11"></a>
## 新建本地分支
`git branch <branch-name>`
将从当前分支拉出一个新分支,名字为`<branch-name>`
[返回目录](#0)
[返回条目](#011)
<a id="12"></a>
## 切换本地分支
假设你处于分支master,想切换到分支dev
执行 `git checkout dev`
[返回目录](#0)
[返回条目](#012)
<a id="13"></a>
## 新建本地分支并切换到这个分支
假设你处于分支master,想创建一个新分支dev,并切换到dev分支
执行 `git checkout -b dev`
[返回目录](#0)
[返回条目](#013)
<a id="14"></a>
## 新建关联远程分支的本地分支
假设你处于分支dev, 并知道远程仓库的一个分支名dev_remote_1
你发现本地没有一个分支关联这个远程分支
你想创建一个新的本地分支关联这个远程分支
* 执行
`git checkout --track origin/dev_remote_1`
> 在本地创建一个dev_remote_1分支,并切换到该分支,且
> 该分支和远程的dev_remote_1分支关联
* 执行
`git checkout dev_remote_1`
> 效果同上, 但本地不能有叫做 dev_remote_1的分支,否则
> 会直接切换到该分支,不会创建新分支
* 执行
`git checkout -b dev_1 origin/dev_remote_1`
> 本地创建一个叫 dev_1的分支,该分支与远程分支dev_remote_1
> 关联,并切换到dev_1分支
> 如果上述执行失败,请执行 `git fetch origin -a`, 再重试
[返回目录](#0)
[返回条目](#014)
<a id="15"></a>
## 删除本地分支
`git branch -d <branch-name>`
> 分支`<branch-name>`必须和远程分支完成充分的合并,或者根本
> 没有关联到远程分支。
或者
`git branch -D <branch-name>`
> 强制删除。
[返回目录](#0)
[返回条目](#015)
<a id="16"></a>
## 删除远程分支
假设你位于 dev 分支,要删除的是远程 dev33分支。
方法一:
`git push origin : <remote-branch-name>`
> 即 `git push origin :dev33`;
> 这一步还会删除 origin/dev33 分支;
方法二:
`git push origin -d <remote-branch-name>`
> 即 `git push origin -d dev33`;
> 这一步同样后删除 origin/dev33 分支;
***注意***
`git branch -d -r origin/dev33`
> 只会删除 origin/dev33 分支,不会影响到远程分支;
> 如果省略 `-r` ,只能删除本地分支,无法删除 origin/dev33分支。
[返回目录](#0)
[返回条目](#016)
<a id="17"></a>
## 重命名本地分支
`git branch -m <old-branch-name> <new-branch-name>`
> 很好理解,把某个分支移动为另一个分支,因此旧的分支名在前,
> 新的分支名在后
[返回目录](#0)
[返回条目](#017)
<a id="18"></a>
## 查看本地分支名单
`git branch`
[返回目录](#0)
[返回条目](#018)
<a id="19"></a>
## 查看远程分支名单
`git branch -r`
> r 就是 remote
[返回目录](#0)
[返回条目](#019)
<a id="20"></a>
## 查看所有分支名单
`git branch -a`
> a 就是 all
[返回目录](#0)
[返回条目](#020)
<a id="21"></a>
## 查看本地分支详细信息
`git branch -vv`
> 可获取 本地分支名、本地分支关联的远程分支名、本地分支版本是否领先远程分支;
`For example:`
```
iss53 7e424c3 [origin/iss53: ahead 2] forgot the brackets
master 1ae2a45 [origin/master] deploying index fix
*serverfix f8674d9 [teamone/server-fix-good: ahead 3,
behind 1] this should do it
testing 5ea463a trying something new
```
> `head 2` 表示本地分支有2个提交没有同步到远程分支
> `behind 1` 表示远程分支有1个提交还没有合并到本地分支
> `*`号表示当前分支
[返回目录](#0)
[返回条目](#021)
<a id="22"></a>
## 将本地分支和远程分支关联
假设:
* 你处于分支dev
* 远程仓库名你已经设定为origin
* 你想将分支dev和远程分支develop关联
执行 `git branch -u origin/develop`
> -u 是 --set-upstream-to 的缩写
设置关联的好处:
当你想push或者pull的时候,只需执行`git push origin` 或 `git pull origin`,
关于远程分支的信息可省略
[返回目录](#0)
[返回条目](#022)
<a id="23"></a>
## 取消本地分支和远程分支的关联
假设你处于分支dev,该分支已经和远程分支develop关联,你想取消关联
执行 `git branch --unset-upstream`
[返回目录](#0)
[返回条目](#023)
<a id="24"></a>
## 拉取远程分支的分支信息到本地
* 执行
`git fetch origin dev`
> 拉取远程分支dev的分支信息到本地,执行 `git branch -a`
> 将会看见`remotes/origin/dev`
* 执行
`git fetch origin -a`
> 拉取远程仓库origin所有分支的分支信息到本地
[返回目录](#0)
[返回条目](#024)
<a id="25"></a>
## 添加文件到本地仓库的缓存区
项目中的文件在最开始只是停留在文件系统中,git没有对它进行版本跟踪
需要将文件添加到本地仓库缓存区后,git才会对它进行版本跟踪
执行
`git add <文件存储路径>`
> 第一次执行时,文件会被git跟踪
> 之后执行时,文件的改动信息会被存储到本地仓库缓存区
对于所有已被追踪的文件,可以一步到位
`git add --all`
[返回目录](#0)
[返回条目](#025)
<a id="26"></a>
## 撤销git add
你执行完 git add指令,将一些文件的修改加入到本地仓库的缓存区后,觉得
不妥,想撤销刚才的 git add操作,
执行
`git reset HEAD <filename>`
> 指定的文件就会被取消已发生的 git add操作
[返回目录](#0)
[返回条目](#026)
<a id="27"></a>
## 把缓存区的信息提交到本地仓库
`git commit -m <message>`
message 是本次提交的一些说明,方便以后查看提交记录排查问题、锁定重要版本代码
还有另一种情况极为常见
* 你执行了一次git commit操作
* 之后,你发现提交的message有问题,或者代码修改仍存在问题
你很可能按照 git add、git commit的流程再来一遍,这样你会提交了
两次,但是你也可以只提交一次
你要做的就是
* 继续修改文件,改完后 git add
* 提交的时候执行 `git commit --amend`
这样,你不会重新提交一次,而是将上一次和本次的提交合并为一个来处理
[返回目录](#0)
[返回条目](#027)
<a id="28"></a>
## 文件恢复到上次commit时的样子
在开发过程中,固然可以借助编辑器的撤销指令回退,但你无法确定回退到哪一步
刚好是上次提交后的情形。如果你想将文件的内容恢复到上次提交后的样子,执行
`git checkout -- <filename>`
> 注意,这将改变本地文件系统中的文件,而文件在本地仓库缓存区中的记录不会受到
> 影响
[返回目录](#0)
[返回条目](#028)
<a id="29"></a>
## 取消git对文件的版本追踪
`git rm --cached <filename>`
> 文件将会从本地仓库的缓存区中移除,不再接收git的版本追踪,但不会从文件系统中删除
如果想更进一步,把文件也删除掉,执行 `git rm <filename>`
[返回目录](#0)
[返回条目](#029)
<a id="30"></a>
## 重命名文件并更新到缓存区
当你修改文件名称后,缓存区的信息将和文件不一致,此时你还要重新git add,
当然,有一种更简单的方法,执行
`git mv <filename> <file_newname>`
[返回目录](#0)
[返回条目](#030)
<a id="31"></a>
## 比较缓存区和工作区的差异
`git diff`
返回本分支文件在缓存区和工作区的差异
你修改一个文件,执行git add,之后你继续修改这个文件,你在某个
时间点想知道手头上的文件,和上次git add时有什么差异,就可以用此命令
[返回目录](#0)
[返回条目](#031)
<a id="32"></a>
## 比较缓存区和本地仓库中文件的差异
`git diff --cached`
你使用git commit 完成了一次提交,此时所有文件的状态记作A,
你又开始工作,修改了一些文件,之后执行git add将改动加入缓存
区,此时缓存区中所有文件的状态记作B,这时你想看看A和B之间有什么
差异,就可以用该命令
[返回目录](#0)
[返回条目](#032)
<a id="33"></a>
## 比较本地两个分支本地仓库中的差异
`git diff <branchname1> <branchname2>`
[返回目录](#0)
[返回条目](#033)
<a id="34"></a>
## 比较本地两个分支本地仓库某文件的差异
`git diff <branchname1> <branchname2> <filename>`
[返回目录](#0)
[返回条目](#034)
<a id="35"></a>
## 查看本地两个分支有哪些文件存在差异
`git diff <branchname1> <branchname2> --stat`
[返回目录](#0)
[返回条目](#035)
<a id="36"></a>
## 本地分支推送到远程仓库
在完成了 git commit后,就可以将本地分支推送到远程仓库
假设你位于本地分支main, 并准备推送到远程分支develop
`git push origin main:develop`
> * `git push` 默认会选择推送给`origin`;
> * 把某个分支推送到另一个分支,本地分支名当然在前,远程分支名当然在后啦
> * 如果省略`:develop`,会将main分支推送到它所关联的远程分支,
> 没有关联的远程分支的话,就会在远程仓库创建一个新的同名分支,并推给这个分支。本地会生成 `origin/main`虚拟分支。
> * 如果省略`main`,相当于删除远程分支develop
> * 如果本地分支已经关联到远程分支develop且二者同名,
> 可简写为`git push origin`
> * 尽管本地分支和远程分支关联, 但他们的分支名字不同,git会考虑安全问题选择拒绝执行push。
[返回目录](#0)
[返回条目](#036)
<a id="37"></a>
## 远程分支和本地分支合并
当远程分支有更新,你需要让本地分支与远程分支同步一下
假设你位于本地分支main,要去同步的远程分支为develop
`git pull origin develop:main`
> * 把某个分支拉到另一个分支上合并,远程分支名当然在前,本地分支名当然在后啦
> * 如果省略`:main`,会将远程分支develop拉取到当前本地分支
> * 如果当前本地分支已经关联远程分支develop且二者同名,可简写为
> `git pull origin`
[返回目录](#0)
[返回条目](#037)
<a id="38"></a>
## 设置本地分支默认推送到哪个远程分支
假设你位于本地分支main,想让该分支每次git push操作推送给远程分支develop
`git push --set-upstream origin develop`
对于git pull的情形,同理有
`git pull --set-upstream origin develop`
*设置本地分支和远程分支相关联,其实就是同时完成了上边的两个设置*
[返回目录](#0)
[返回条目](#038)
<a id="39"></a>
## 打标签
* 执行`git tag <tagname>`, 会根据当前本地分支上一次的git commit结果创建一个标签
或者,更进一步,你可以为标签添加一些解释信息
`git tag -a <tagname> -m <message>`
你也可以根据某一次的commitID创建标签
`git tag <tagname> <commitID>`
实际上`git tag <tagname>`是`git tag <tagname> HEAD`的缩写
* 推送到远程仓库
`git push origin <tagname>`
在github上的tags列表就能看到你新创建的标签
[返回目录](#0)
[返回条目](#039)
<a id="40"></a>
## 查看本地仓库都创建了哪些标签
`git tag -l` or `git tag`
[返回目录](#0)
[返回条目](#040)
<a id="41"></a>
## 查看远程仓库都有哪些标签
`git ls-remote --tags origin`
[返回目录](#0)
[返回条目](#041)
<a id="42"></a>
## 删除本地分支的标签
`git tag -d <tagname>`
[返回目录](#0)
[返回条目](#042)
<a id="43"></a>
## 删除远程仓库的标签
`git push origin --delete <tagname>`
[返回目录](#0)
[返回条目](#043)
<a id="44"></a>
## 基于标签创建一个本地分支
`git checkout -b <branchname> <tagname>`
你开发完v1.0.0的代码,打好一个标签v1.0.0
你要接着v1.0.0的代码开发v2.0.0的代码
你就可以使用上述指令创建一个新的分支,在该分支上继续你的开发
[返回目录](#0)
[返回条目](#044)
<a id="45"></a>
## 查看本地分支提交历史
`git log`
你可以从输出看到每一次提交信息,最重要的是`commitID`;
该指令还有一些拓展用法
* `git log -2` 只显示最近两次的提交记录
* `git log --since=2.weeks` 只显示最近两周内的提交记录
* `git log --util=2.weeks` 只显示两周之前的提交记录
* `git log --author=jack` 只显示提交记录中作者是jack的所有记录
* `git log --committer=jack` 只显示提交记录中提交者是jack的所有记录
* `git log --grep=mm` 只显示提交记录message中包含 mm的所有记录
* `git log -S straw` 只显示添加或者删除内容匹配straw的提交记录
* `git log --stat` 额外列出修改的文件名
* `git log --shortstat` 额外显示--stat中修改的行数信息
* `git log -p` 额外列出被修改的文件,改前和改后的差异
* `git log --pretty=oneline` 每一个提交的记录单行输出,除了oneline还可以有 `full` `short` `fuller` `format`
* `git log --pretty=format:"%h %an %ar %s"`
采用format,自定义输出信息格式
%h 提交的简写hash码
%H 提交的完整hash码
%an 作者名字
%ae 作者邮箱
%ad 作者修订的日期
%ar 作者多久前修订的
%cn 提交者名字
%ce 提交者邮箱
%cd 提交者修订的日期
%cr 提交者多久前修订的
%s 提交的信息
[返回目录](#0)
[返回条目](#045)
<a id="46"></a>
## 本地分支回滚到某一个版本
使用`git log`找到某一版本的`commitID`
* 执行
`git reset <commitID>`
> 缓存区和本地仓库数据会回滚到该版本,工作区不受影响
* 执行
`git reset --sort <commitID>`
> 本地仓库数据会回滚到该版本,工作区和缓存区不受影响
* 执行
`git reset --hard <commitID>`
> 本地仓库、缓存区、工作区数据回滚到该版本
在此基础上,执行一步git push操作即可完成远程分支版本回滚
[返回目录](#0)
[返回条目](#046)
<a id="47"></a>
## 状态暂存并切换分支
假设你在dev_1分支上编写代码,出于某种原因,你要切换到dev_2分支
修改一些代码,可是,你没有git add和git commit,无法完成分支切换,
这种情况下,你可以
1. `git stash`
2. `git checkout dev_2`
3. 解决dev_2的代码问题,在commit后,切换回dev_1分支
4. `git stash apply` or `git stash pop`
5. 继续修改dev_1分支上未完成的编码工作
[返回目录](#0)
[返回条目](#047)
<a id="48"></a>
## 终端无法正常显示中文字符
当你执行 `git status` 后,如果发现终端无法显示正常的中文字符,你可以
这样解决:
执行 `git config --global core.quotepath false`
[返回目录](#0)
[返回条目](#047)
| 12.766379
| 93
| 0.628807
|
yue_Hant
| 0.41644
|
450a90503bb3bd52ea209dfde7b590a755ec8fbe
| 3,182
|
md
|
Markdown
|
docs/2014/analysis-services/impersonation-information.md
|
brunom/sql-docs
|
d80aaa52562d828f9bfb932662ad779432301860
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
docs/2014/analysis-services/impersonation-information.md
|
brunom/sql-docs
|
d80aaa52562d828f9bfb932662ad779432301860
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
docs/2014/analysis-services/impersonation-information.md
|
brunom/sql-docs
|
d80aaa52562d828f9bfb932662ad779432301860
|
[
"CC-BY-4.0",
"MIT"
] | 1
|
2021-04-05T00:11:33.000Z
|
2021-04-05T00:11:33.000Z
|
---
title: "Impersonation Information | Microsoft Docs"
ms.custom: ""
ms.date: "03/06/2017"
ms.prod: "sql-server-2014"
ms.reviewer: ""
ms.suite: ""
ms.technology:
- "analysis-services"
ms.tgt_pltfrm: ""
ms.topic: conceptual
ms.assetid: 42319d60-ccd0-46b8-af0b-f0968c390d8a
caps.latest.revision: 9
author: minewiskan
ms.author: owend
manager: craigg
---
# Impersonation Information
Use the **Impersonation Information** page to specify the credentials that Analysis Services will use to connect to the data source.
## Options
**Use a specific Windows user name and password**
Select this option to have the [!INCLUDE[ssASnoversion](../includes/ssasnoversion-md.md)] object use the security credentials of a specified Windows user account. The specified credentials will be used for processing, ROLAP queries, out-of-line bindings, local cubes, mining models, remote partitions, linked objects, and synchronization from target to source. However, for Data Mining Extensions (DMX) OPENQUERY statements, this option is ignored and the credentials of the current user will be used.
**User name**
Type the domain and name of the user account to be used by the selected [!INCLUDE[ssASnoversion](../includes/ssasnoversion-md.md)] object. Use the following format:
*\<Domain name>* **\\** *\<User account name>*
This option is enabled only if **Use a specific name and password** is selected.
**Password**
Type the password of the user account to be used by the selected [!INCLUDE[ssASnoversion](../includes/ssasnoversion-md.md)] object.
This option is enabled only if **Use a specific name and password** is selected.
**Use the service account**
Select this option to have the [!INCLUDE[ssASnoversion](../includes/ssasnoversion-md.md)] object use the security credentials associated with the [!INCLUDE[ssASnoversion](../includes/ssasnoversion-md.md)] service that manages the object. The service account credentials will be used for processing, ROLAP queries, remote partitions, linked objects, and synchronization from target to source. However, for Data Mining Extensions (DMX) OPENQUERY statements, local cubes, and mining models, the credentials of the current user will be used. This option is not supported for out-of-line bindings.
**Use the credentials of the current user**
Select this option to have the [!INCLUDE[ssASnoversion](../includes/ssasnoversion-md.md)] object use the security credentials of the current user for out-of-line bindings, DMX OPENQUERY, local cubes, and mining models. This option is not supported for processing, ROLAP queries, remote partitions, linked objects, and synchronization from target to source.
**Inherit**
Select this option to use the impersonation behavior, defined at the database level, which has been set by the server administrator using the `DataSourceImpersonation` database property.
## See Also
[Data Sources in Multidimensional Models](multidimensional-models/data-sources-in-multidimensional-models.md)
[Data Sources Supported (SSAS Multidimensional)](multidimensional-models/supported-data-sources-ssas-multidimensional.md)
| 62.392157
| 595
| 0.764299
|
eng_Latn
| 0.987819
|
450b4f162e62ea5b811c3e5b7d9be8ca3e943cdc
| 140,997
|
md
|
Markdown
|
src/smarty3/CHANGELOG.md
|
lokik/Atk14
|
a95cc8c3fbc820d61f682260847f87f6b3a4fe69
|
[
"MIT"
] | null | null | null |
src/smarty3/CHANGELOG.md
|
lokik/Atk14
|
a95cc8c3fbc820d61f682260847f87f6b3a4fe69
|
[
"MIT"
] | null | null | null |
src/smarty3/CHANGELOG.md
|
lokik/Atk14
|
a95cc8c3fbc820d61f682260847f87f6b3a4fe69
|
[
"MIT"
] | null | null | null |
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [3.1.44] - 2022-01-18
### Fixed
- Fixed illegal characters bug in math function security check [#702](https://github.com/smarty-php/smarty/issues/702)
## [3.1.43] - 2022-01-10
### Security
- Prevent evasion of the `static_classes` security policy. This addresses CVE-2021-21408
## [3.1.42] - 2022-01-10
### Security
- Prevent arbitrary PHP code execution through maliciously crafted expression for the math function. This addresses CVE-2021-29454
## [3.1.41] - 2022-01-09
### Security
- Rewrote the mailto function to not use `eval` when encoding with javascript
## [3.1.40] - 2021-10-13
### Changed
- modifier escape now triggers a E_USER_NOTICE when an unsupported escape type is used https://github.com/smarty-php/smarty/pull/649
### Security
- More advanced javascript escaping to handle https://html.spec.whatwg.org/multipage/scripting.html#restrictions-for-contents-of-script-elements thanks to m-haritonov
## [3.1.39] - 2021-02-17
### Security
- Prevent access to `$smarty.template_object` in sandbox mode. This addresses CVE-2021-26119.
- Fixed code injection vulnerability by using illegal function names in `{function name='blah'}{/function}`. This addresses CVE-2021-26120.
## [3.1.38] - 2021-01-08
### Fixed
- Smarty::SMARTY_VERSION wasn't updated https://github.com/smarty-php/smarty/issues/628
## [3.1.37] - 2021-01-07
### Changed
- Changed error handlers and handling of undefined constants for php8-compatibility (set $errcontext argument optional) https://github.com/smarty-php/smarty/issues/605
- Changed expected error levels in unit tests for php8-compatibility
- Travis unit tests now run for all php versions >= 5.3, including php8
- Travis runs on Xenial where possible
### Fixed
- PHP5.3 compatibility fixes
- Brought lexer source functionally up-to-date with compiled version
## [3.1.36] - 2020-04-14
### Fixed
- Smarty::SMARTY_VERSION wasn't updated in v3.1.35 https://github.com/smarty-php/smarty/issues/584
## [3.1.35] - 2020-04-14
- remove whitespaces after comments https://github.com/smarty-php/smarty/issues/447
- fix foreachelse on arrayiterators https://github.com/smarty-php/smarty/issues/506
- fix files contained in git export archive for package maintainers https://github.com/smarty-php/smarty/issues/325
- throw SmartyException when setting caching attributes for cacheable plugin https://github.com/smarty-php/smarty/issues/457
- fix errors that occured where isset was replaced with null check such as https://github.com/smarty-php/smarty/issues/453
- unit tests are now in the repository
## 3.1.34 release - 05.11.2019
13.01.2020
- fix typo in exception message (JercSi)
- fix typehint warning with callable (bets4breakfast)
- add travis badge and compatability info to readme (matks)
- fix stdClass cast when compiling foreach (carpii)
- fix wrong set/get methods for memcached (IT-Experte)
- fix pborm assigning value to object variables in smarty_internal_compile_assign (Hunman)
- exclude error_reporting.ini from git export (glensc)
## 3.1.34-dev-6 -
30.10.2018
- bugfix a nested subblock in an inheritance child template was not replace by
outer level block with same name in same child template https://github.com/smarty-php/smarty/issues/500
29.10.2018
- bugfix Smarty::$php_handling == PHP_PASSTHRU (default) did eat the "\n" (newline) character if it did directly followed
a PHP tag like "?>" or other https://github.com/smarty-php/smarty/issues/501
14.10.2018
- bugfix autoloader exit shortcut https://github.com/smarty-php/smarty/issues/467
11.10.2018
- bugfix {insert} not works when caching is enabled and included template is present
https://github.com/smarty-php/smarty/issues/496
- bugfix in date-format modifier; NULL at date string or default_date did not produce correct output
https://github.com/smarty-php/smarty/pull/458
09.10.2018
- bugfix fix of 26.8.2017 https://github.com/smarty-php/smarty/issues/327
modifier is applied to sum expression https://github.com/smarty-php/smarty/issues/491
- bugfix indexed arrays could not be defined "array(...)""
18.09.2018
- bugfix large plain text template sections without a Smarty tag > 700kB could
could fail in version 3.1.32 and 3.1.33 because PHP preg_match() restrictions
https://github.com/smarty-php/smarty/issues/488
## 3.1.33 release - 12.09.2018
## 3.1.33-dev-12 -
03.09.2018
- bugfix {foreach} using new style property access like {$item@property} on
Smarty 2 style named foreach loop could produce errors https://github.com/smarty-php/smarty/issues/484
31.08.2018
- bugfix some custom left and right delimiters like '{^' '^}' did not work
https://github.com/smarty-php/smarty/issues/450 https://github.com/smarty-php/smarty/pull/482
- reformating for PSR-2 coding standards https://github.com/smarty-php/smarty/pull/483
- bugfix on Windows absolute filepathes did fail if the drive letter was followed by a linux DIRECTORY_SEPARATOR
like C:/ at Smarty > 3.1.33-dev-5 https://github.com/smarty-php/smarty/issues/451
- PSR-2 code style fixes for config and template file Lexer/Parser generated with
the Smarty Lexer/Parser generator from https://github.com/smarty-php/smarty-lexer
https://github.com/smarty-php/smarty/pull/483
26.08.2018
- bugfix/enhancement {capture} allow variable as capture block name in Smarty special variable
like $smarty.capture.$foo https://github.com/smarty-php/smarty/issues/478 https://github.com/smarty-php/smarty/pull/481
## 3.1.33-dev-6 -
19.08.2018
- fix PSR-2 coding standards and PHPDoc blocks https://github.com/smarty-php/smarty/pull/452
https://github.com/smarty-php/smarty/pull/475
https://github.com/smarty-php/smarty/pull/473
- bugfix PHP5.2 compatibility https://github.com/smarty-php/smarty/pull/472
## 3.1.33-dev-4 -
17.05.2018
- bugfix strip-block produces different output in Smarty v3.1.32 https://github.com/smarty-php/smarty/issues/436
- bugfix Smarty::compileAllTemplates ignores `$extension` parameter https://github.com/smarty-php/smarty/issues/437
https://github.com/smarty-php/smarty/pull/438
- improvement do not compute total property in {foreach} if not needed https://github.com/smarty-php/smarty/issues/443
- bugfix plugins may not be loaded when setMergeCompiledIncludes is true https://github.com/smarty-php/smarty/issues/435
26.04.2018
- bugfix regarding Security Vulnerability did not solve the problem under Linux.
Security issue CVE-2018-16831
## 3.1.32 - (24.04.2018)
24.04.2018
- bugfix possible Security Vulnerability in Smarty_Security class.
26.03.2018
- bugfix plugins may not be loaded if {function} or {block} tags are executed in nocache mode
https://github.com/smarty-php/smarty/issues/371
26.03.2018
- new feature {parent} = {$smarty.block.parent} {child} = {$smarty.block.child}
23.03.2018
- bugfix preg_replace could fail on large content resulting in a blank page https://github.com/smarty-php/smarty/issues/417
21.03.2018
- bugfix {$smarty.section...} used outside {section}{/section} showed incorrect values if {section}{/section} was called inside
another loop https://github.com/smarty-php/smarty/issues/422
- bugfix short form of {section} attributes did not work https://github.com/smarty-php/smarty/issues/428
17.03.2018
- improvement Smarty::compileAllTemplates() exit with a non-zero status code if max errors is reached https://github.com/smarty-php/smarty/pull/402
16.03.2018
- bugfix extends resource did not work with user defined left/right delimiter https://github.com/smarty-php/smarty/issues/419
22.11.2017
- bugfix {break} and {continue} could fail if {foreach}{/foreach} did contain other
looping tags like {for}, {section} and {while} https://github.com/smarty-php/smarty/issues/323
20.11.2017
- bugfix rework of newline spacing between tag code and template text.
now again identical with Smarty2 (forum topic 26878)
- replacement of " by '
05.11.2017
- lexer/parser optimization
- code cleanup and optimizations
- bugfix {$smarty.section.name.loop} used together with {$smarty.section.name.total} could produce
wrong results (forum topic 27041)
26.10.2017
- bugfix Smarty version was not filled in header comment of compiled and cached files
- optimization replace internal Smarty::$ds property by DIRECTORY_SEPARATOR
- deprecate functions Smarty::muteExpectedErrors() and Smarty::unmuteExpectedErrors()
as Smarty does no longer use error suppression like @filemtime().
for backward compatibility code is moved from Smarty class to an external class and still can be
called.
- correction of PHPDoc blocks
- minor code cleanup
21.10.2017
- bugfix custom delimiters could fail since modification of version 3.1.32-dev-23
https://github.com/smarty-php/smarty/issues/394
18.10.2017
- bugfix fix implementation of unclosed block tag in double quoted string of 12.10.2017
https://github.com/smarty-php/smarty/issues/396 https://github.com/smarty-php/smarty/issues/397
https://github.com/smarty-php/smarty/issues/391 https://github.com/smarty-php/smarty/issues/392
12.10.2017
- bugfix $smarty.block.child and $smarty.block.parent could not be used like any
$smarty special variable https://github.com/smarty-php/smarty/issues/393
- unclosed block tag in double quoted string must throw compiler exception.
https://github.com/smarty-php/smarty/issues/391 https://github.com/smarty-php/smarty/issues/392
07.10.2017
- bugfix modification of 9.8.2017 did fail on some recursive
tag nesting. https://github.com/smarty-php/smarty/issues/389
26.8.2017
- bugfix chained modifier failed when last modifier parameter is a signed value
https://github.com/smarty-php/smarty/issues/327
- bugfix templates filepath with multibyte characters did not work
https://github.com/smarty-php/smarty/issues/385
- bugfix {make_nocache} did display code if the template did not contain other nocache code
https://github.com/smarty-php/smarty/issues/369
09.8.2017
- improvement repeated delimiter like {{ and }} will be treated as literal
https://groups.google.com/forum/#!topic/smarty-developers/h9r82Bx4KZw
05.8.2017
- bugfix wordwrap modifier could fail if used in nocache code.
converted plugin file shared.mb_wordwrap.php into modifier.mb_wordwrap.php
- cleanup of _getSmartyObj()
31.7.2017
- Call clearstatcache() after mkdir() failure https://github.com/smarty-php/smarty/pull/379
30.7.2017
- rewrite mkdir() bugfix to retry automatically see https://github.com/smarty-php/smarty/pull/377
https://github.com/smarty-php/smarty/pull/379
21.7.2017
- security possible PHP code injection on custom resources at display() or fetch()
calls if the resource does not sanitize the template name
- bugfix fix 'mkdir(): File exists' error on create directory from parallel
processes https://github.com/smarty-php/smarty/pull/377
- bugfix solve preg_match() hhvm parameter problem https://github.com/smarty-php/smarty/pull/372
27.5.2017
- bugfix change compiled code for registered function and modifiers to called as callable to allow closures
https://github.com/smarty-php/smarty/pull/368, https://github.com/smarty-php/smarty/issues/273
- bugfix https://github.com/smarty-php/smarty/pull/368 did break the default plugin handler
- improvement replace phpversion() by PHP_VERSION constant.
https://github.com/smarty-php/smarty/pull/363
21.5.2017
- performance store flag for already required shared plugin functions in static variable or
Smarty's $_cache to improve performance when plugins are often called
https://github.com/smarty-php/smarty/commit/51e0d5cd405d764a4ea257d1bac1fb1205f74528#commitcomment-22280086
- bugfix remove special treatment of classes implementing ArrayAccess in {foreach}
https://github.com/smarty-php/smarty/issues/332
- bugfix remove deleted files by clear_cache() and clear_compiled_template() from
ACP cache if present, add some is_file() checks to avoid possible warnings on filemtime()
caused by above functions.
https://github.com/smarty-php/smarty/issues/341
- bugfix version 3.1.31 did fail under PHP 5.2
https://github.com/smarty-php/smarty/issues/365
19.5.2017
- change properties $accessMap and $obsoleteProperties from private to protected
https://github.com/smarty-php/smarty/issues/351
- new feature The named capture buffers can now be accessed also as array
See NEWS_FEATURES.txt https://github.com/smarty-php/smarty/issues/366
- improvement check if ini_get() and ini_set() not disabled
https://github.com/smarty-php/smarty/pull/362
24.4.2017
- fix spelling https://github.com/smarty-php/smarty/commit/e3eda8a5f5653d8abb960eb1bc47e3eca679b1b4#commitcomment-21803095
17.4.2017
- correct generated code on empty() and isset() call, observe change PHP behaviour since PHP 5.5
https://github.com/smarty-php/smarty/issues/347
14.4.2017
- merge pull requests https://github.com/smarty-php/smarty/pull/349, https://github.com/smarty-php/smarty/pull/322 and https://github.com/smarty-php/smarty/pull/337 to fix spelling and annotation
13.4.2017
- bugfix array_merge() parameter should be checked https://github.com/smarty-php/smarty/issues/350
## 3.1.31 - (14.12.2016)
23.11.2016
- move template object cache into static variables
19.11.2016
- bugfix inheritance root child templates containing nested {block}{/block} could call sub-bock content from parent
template https://github.com/smarty-php/smarty/issues/317
- change version checking
11.11.2016
- bugfix when Smarty is using a cached template object on Smarty::fetch() or Smarty::isCached() the inheritance data
must be removed https://github.com/smarty-php/smarty/issues/312
- smaller speed optimization
08.11.2016
- add bootstrap file to load and register Smarty_Autoloader. Change composer.json to make it known to composer
07.11.2016
- optimization of lexer speed https://github.com/smarty-php/smarty/issues/311
27.10.2016
- bugfix template function definitions array has not been cached between Smarty::fetch() and Smarty::display() calls
https://github.com/smarty-php/smarty/issues/301
23.10.2016
- improvement/bugfix when Smarty::fetch() is called on a template object the inheritance and tplFunctions property
should be copied to the called template object
21.10.2016
- bugfix for compile locking touched timestamp of old compiled file was not restored on compilation error https://github.com/smarty-php/smarty/issues/308
20.10.2016
- bugfix nocache code was not removed in cache file when subtemplate did contain PHP short tags in text but no other
nocache code https://github.com/smarty-php/smarty/issues/300
19.10.2016
- bugfix {make_nocache $var} did fail when variable value did contain '\' https://github.com/smarty-php/smarty/issues/305
- bugfix {make_nocache $var} remove spaces from variable value https://github.com/smarty-php/smarty/issues/304
12.10.2016
- bugfix {include} with template names including variable or constants could fail after bugfix from
28.09.2016 https://github.com/smarty-php/smarty/issues/302
08.10.2016
- optimization move runtime extension for template functions into Smarty objects
29.09.2016
- improvement new Smarty::$extends_recursion property to disable execution of {extends} in templates called by extends resource
https://github.com/smarty-php/smarty/issues/296
28.09.2016
- bugfix the generated code for calling a subtemplate must pass the template resource name in single quotes https://github.com/smarty-php/smarty/issues/299
- bugfix nocache hash was not removed for <?xml ?> tags in subtemplates https://github.com/smarty-php/smarty/issues/300
27.09.2016
- bugfix when Smarty does use an internally cached template object on Smarty::fetch() calls
the template and config variables must be cleared https://github.com/smarty-php/smarty/issues/297
20.09.2016
- bugfix some $smarty special template variables are no longer accessed as real variable.
using them on calls like {if isset($smarty.foo)} or {if empty($smarty.foo)} will fail
http://www.smarty.net/forums/viewtopic.php?t=26222
- temporary fix for https://github.com/smarty-php/smarty/issues/293 main reason still under investigation
- improvement new tags {block_parent} {block_child} in template inheritance
19.09.2016
- optimization clear compiled and cached folder completely on detected version change
- cleanup convert cache resource file method clear into runtime extension
15.09.2016
- bugfix assigning a variable in if condition by function like {if $value = array_shift($array)} the function got called twice https://github.com/smarty-php/smarty/issues/291
- bugfix function plugins called with assign attribute like {foo assign='bar'} did not output returned content because
because assumption was made that it was assigned to a variable https://github.com/smarty-php/smarty/issues/292
- bugfix calling $smarty->isCached() on a not existing cache file with $smarty->cache_locking = true; could cause a 10 second delay http://www.smarty.net/forums/viewtopic.php?t=26282
- improvement make Smarty::clearCompiledTemplate() on custom resource independent from changes of templateId computation
11.09.2016
- improvement {math} misleading E_USER_WARNING messages when parameter value = null https://github.com/smarty-php/smarty/issues/288
- improvement move often used code snippets into methods
- performance Smarty::configLoad() did load unneeded template source object
09.09.2016
- bugfix/optimization {foreach} did not execute the {foreachelse} when iterating empty objects https://github.com/smarty-php/smarty/pull/287
- bugfix {foreach} must keep the @properties when restoring a saved $item variable as the properties might be used outside {foreach} https://github.com/smarty-php/smarty/issues/267
- improvement {foreach} observe {break n} and {continue n} nesting levels when restoring saved $item and $key variables
08.09.2016
- bugfix implement wrapper for removed method getConfigVariable() https://github.com/smarty-php/smarty/issues/286
07.09.2016
- bugfix using nocache like attribute with value true like {plugin nocache=true} did not work https://github.com/smarty-php/smarty/issues/285
- bugfix uppercase TRUE, FALSE and NULL did not work when security was enabled https://github.com/smarty-php/smarty/issues/282
- bugfix when {foreach} was looping over an object the total property like {$item@total} did always return 1 https://github.com/smarty-php/smarty/issues/281
- bugfix {capture}{/capture} did add in 3.1.30 unintended additional blank lines https://github.com/smarty-php/smarty/issues/268
01.09.2016
- performance require_once should be called only once for shared plugins https://github.com/smarty-php/smarty/issues/280
26.08.2016
- bugfix change of 23.08.2016 failed on linux when use_include_path = true
23.08.2016
- bugfix remove constant DS as shortcut for DIRECTORY_SEPARATOR as the user may have defined it to something else https://github.com/smarty-php/smarty/issues/277
20.08-2016
- bugfix {config_load ... scope="global"} shall not throw an arror but fallback to scope="smarty" https://github.com/smarty-php/smarty/issues/274
- bugfix {make_nocache} failed when using composer autoloader https://github.com/smarty-php/smarty/issues/275
14.08.2016
- bugfix $smarty_>debugging = true; did E_NOTICE messages when {eval} tag was used https://github.com/smarty-php/smarty/issues/266
- bugfix Class 'Smarty_Internal_Runtime_ValidateCompiled' not found when upgrading from some older Smarty versions with existing
compiled or cached template files https://github.com/smarty-php/smarty/issues/269
- optimization remove unneeded call to update acopes when {assign} scope and template scope was local (default)
## 3.1.30 - (07.08.2016)
07.08.2016
- bugfix update of 04.08.2016 was incomplete
05.08.2016
- bugfix compiling of templates failed when the Smarty delimiter did contain '/' https://github.com/smarty-php/smarty/issues/264
- updated error checking at template and config default handler
04.08.2016
- improvement move template function source parameter into extension
26.07.2016
- optimization unneeded loading of compiled resource
24.07.2016
- regression this->addPluginsDir('/abs/path/to/dir') adding absolute path without trailing '/' did fail https://github.com/smarty-php/smarty/issues/260
23.07.2016
- bugfix setTemplateDir('/') and setTemplateDir('') did create wrong absolute filepath https://github.com/smarty-php/smarty/issues/245
- optimization of filepath normalization
- improvement remove double function declaration in plugin shared.escape_special_cars.php https://github.com/smarty-php/smarty/issues/229
19.07.2016
- bugfix multiple {include} with relative filepath within {block}{/block} could fail https://github.com/smarty-php/smarty/issues/246
- bugfix {math} shell injection vulnerability patch provided by Tim Weber
18.07.2016
- bugfix {foreach} if key variable and item@key attribute have been used both the key variable was not updated https://github.com/smarty-php/smarty/issues/254
- bugfix modifier on plugins like {plugin|modifier ... } did fail when the plugin does return an array https://github.com/smarty-php/smarty/issues/228
- bugfix avoid opcache_invalidate to result in ErrorException when opcache.restrict_api is not empty https://github.com/smarty-php/smarty/pull/244
- bugfix multiple {include} with relative filepath within {block}{/block} could fail https://github.com/smarty-php/smarty/issues/246
14.07.2016
- bugfix wrong parameter on compileAllTemplates() and compileAllConfig() https://github.com/smarty-php/smarty/issues/231
13.07.2016
- bugfix PHP 7 compatibility on registered compiler plugins https://github.com/smarty-php/smarty/issues/241
- update testInstall() https://github.com/smarty-php/smarty/issues/248https://github.com/smarty-php/smarty/issues/248
- bugfix enable debugging could fail when template objects did already exists https://github.com/smarty-php/smarty/issues/237
- bugfix template function data should be merged when loading subtemplate https://github.com/smarty-php/smarty/issues/240
- bugfix wrong parameter on compileAllTemplates() https://github.com/smarty-php/smarty/issues/231
12.07.2016
- bugfix {foreach} item variable must be created also on empty from array https://github.com/smarty-php/smarty/issues/238 and https://github.com/smarty-php/smarty/issues/239
- bugfix enableSecurity() must init cache flags https://github.com/smarty-php/smarty/issues/247
27.05.2016
- bugfix/improvement of compileAlltemplates() follow symlinks in template folder (PHP >= 5.3.1) https://github.com/smarty-php/smarty/issues/224
clear internal cache and expension handler for each template to avoid possible conflicts https://github.com/smarty-php/smarty/issues/231
16.05.2016
- optimization {foreach} compiler and processing
- broken PHP 5.3 and 5.4 compatibility
15.05.2016
- optimization and cleanup of resource code
10.05.2016
- optimization of inheritance processing
07.05.2016
-bugfix Only variables should be assigned by reference https://github.com/smarty-php/smarty/issues/227
02.05.2016
- enhancement {block} tag names can now be variable https://github.com/smarty-php/smarty/issues/221
01.05.2016
- bugfix same relative filepath at {include} called from template in different folders could display wrong sub-template
29.04.2016
- bugfix {strip} remove space on linebreak between html tags https://github.com/smarty-php/smarty/issues/213
24.04.2016
- bugfix nested {include} with relative file path could fail when called in {block} ... {/block} https://github.com/smarty-php/smarty/issues/218
14.04.2016
- bugfix special variable {$smarty.capture.name} was not case sensitive on name https://github.com/smarty-php/smarty/issues/210
- bugfix the default template handler must calculate the source uid https://github.com/smarty-php/smarty/issues/205
13.04.2016
- bugfix template inheritance status must be saved when calling sub-templates https://github.com/smarty-php/smarty/issues/215
27.03.2016
- bugfix change of 11.03.2016 cause again {capture} data could not been seen in other templates with {$smarty.capture.name} https://github.com/smarty-php/smarty/issues/153
11.03.2016
- optimization of capture and security handling
- improvement $smarty->clearCompiledTemplate() should return on recompiled or uncompiled resources
10.03.2016
- optimization of resource processing
09.03.2016
- improvement rework of 'scope' attribute handling see see NEW_FEATURES.txt https://github.com/smarty-php/smarty/issues/194
https://github.com/smarty-php/smarty/issues/186 https://github.com/smarty-php/smarty/issues/179
- bugfix correct Autoloader update of 2.3.2014 https://github.com/smarty-php/smarty/issues/199
04.03.2016
- bugfix change from 01.03.2016 will cause $smarty->isCached(..) failure if called multiple time for same template
(forum topic 25935)
02.03.2016
- revert autoloader optimizations because of unexplainable warning when using plugins https://github.com/smarty-php/smarty/issues/199
01.03.2016
- bugfix template objects must be cached on $smarty->fetch('foo.tpl) calls incase the template is fetched
multiple times (forum topic 25909)
25.02.2016
- bugfix wrong _realpath with 4 or more parent-directories https://github.com/smarty-php/smarty/issues/190
- optimization of _realpath
- bugfix instanceof expression in template code must be treated as value https://github.com/smarty-php/smarty/issues/191
20.02.2016
- bugfix {strip} must keep space between hmtl tags. Broken by changes of 10.2.2016 https://github.com/smarty-php/smarty/issues/184
- new feature/bugfix {foreach}{section} add 'properties' attribute to force compilation of loop properties
see NEW_FEATURES.txt https://github.com/smarty-php/smarty/issues/189
19.02.2016
- revert output buffer flushing on display, echo content again because possible problems when PHP files had
characters (newline} after ?> at file end https://github.com/smarty-php/smarty/issues/187
14.02.2016
- new tag {make_nocache} read NEW_FEATURES.txt https://github.com/smarty-php/smarty/issues/110
- optimization of sub-template processing
- bugfix using extendsall as default resource and {include} inside {block} tags could produce unexpected results https://github.com/smarty-php/smarty/issues/183
- optimization of tag attribute compiling
- optimization make compiler tag object cache static for higher compilation speed
11.02.2016
- improvement added KnockoutJS comments to trimwhitespace outputfilter https://github.com/smarty-php/smarty/issues/82
https://github.com/smarty-php/smarty/pull/181
10.02.2016
- bugfix {strip} must keep space on output creating smarty tags within html tags https://github.com/smarty-php/smarty/issues/177
- bugfix wrong precedence on special if conditions like '$foo is ... by $bar' could cause wrong code https://github.com/smarty-php/smarty/issues/178
- improvement because of ambiguities the inline constant support has been removed from the $foo.bar syntax https://github.com/smarty-php/smarty/issues/149
- bugfix other {strip} error with output tags between hmtl https://github.com/smarty-php/smarty/issues/180
09.02.2016
- move some code from parser into compiler
- reformat all code for unique style
- update/bugfix scope attribute handling reworked. Read the newfeatures.txt file
05.02.2016
- improvement internal compiler changes
01.02.2016
- bugfix {foreach} compilation failed when $smarty->merge_compiled_includes = true and pre-filters are used.
29.01.2016
- bugfix implement replacement code for _tag_stack property https://github.com/smarty-php/smarty/issues/151
28.01.2016
- bugfix allow windows network filepath or wrapper (forum topic 25876) https://github.com/smarty-php/smarty/issues/170
- bugfix if fetch('foo.tpl') is called on a template object the $parent parameter should default to the calling template object https://github.com/smarty-php/smarty/issues/152
27.01.2016
- revert bugfix compiling {section} did create warning
- bugfix {$smarty.section.customer.loop} did throw compiler error https://github.com/smarty-php/smarty/issues/161
update of yesterdays fix
- bugfix string resource could inject code at {block} or inline subtemplates through PHP comments https://github.com/smarty-php/smarty/issues/157
- bugfix output filters did not observe nocache code flhttps://github.com/smarty-php/smarty/issues/154g https://github.com/smarty-php/smarty/issues/160
- bugfix {extends} with relative file path did not work https://github.com/smarty-php/smarty/issues/154
https://github.com/smarty-php/smarty/issues/158
- bugfix {capture} data could not been seen in other templates with {$smarty.capture.name} https://github.com/smarty-php/smarty/issues/153
26.01.2016
- improvement observe Smarty::$_CHARSET in debugging console https://github.com/smarty-php/smarty/issues/169
- bugfix compiling {section} did create warning
- bugfix {$smarty.section.customer.loop} did throw compiler error https://github.com/smarty-php/smarty/issues/161
02.01.2016
- update scope handling
- optimize block plugin compiler
- improvement runtime checks if registered block plugins are callable
01.01.2016
- remove Smarty::$resource_cache_mode property
31.12.2015
- optimization of {assign}, {if} and {while} compiled code
30.12.2015
- bugfix plugin names starting with "php" did not compile https://github.com/smarty-php/smarty/issues/147
29.12.2015
- bugfix Smarty::error_reporting was not observed when display() or fetch() was called on template objects https://github.com/smarty-php/smarty/issues/145
28.12.2015
- optimization of {foreach} code size and processing
27.12.2015
- improve inheritance code
- update external methods
- code fixes
- PHPdoc updates
25.12.2015
- compile {block} tag code and its processing into classes
- optimization replace hhvm extension by inline code
- new feature If ACP is enabled force an apc_compile_file() when compiled or cached template was updated
24.12.2015
- new feature Compiler does now observe the template_dir setting and will create separate compiled files if required
- bugfix post filter did fail on template inheritance https://github.com/smarty-php/smarty/issues/144
23.12.2015
- optimization move internal method decodeProperties back into template object
- optimization move subtemplate processing back into template object
- new feature Caching does now observe the template_dir setting and will create separate cache files if required
22.12.2015
- change $xxx_dir properties from private to protected in case Smarty class gets extended
- code optimizations
21.12.2015
- bugfix a filepath starting with '/' or '\' on windows should normalize to the root dir
of current working drive https://github.com/smarty-php/smarty/issues/134
- optimization of filepath normalization
- bugfix {strip} must remove all blanks between html tags https://github.com/smarty-php/smarty/issues/136
- 3.1.29 - (21.12.2015)
21.12.2015
- optimization improve speed of filetime checks on extends and extendsall resource
20.12.2015
- bugfix failure when the default resource type was set to 'extendsall' https://github.com/smarty-php/smarty/issues/123
- update compilation of Smarty special variables
- bugfix add addition check for OS type on normalization of file path https://github.com/smarty-php/smarty/issues/134
- bugfix the source uid of the extendsall resource must contain $template_dir settings https://github.com/smarty-php/smarty/issues/123
19.12.2015
- bugfix using $smarty.capture.foo in expressions could fail https://github.com/smarty-php/smarty/pull/138
- bugfix broken PHP 5.2 compatibility https://github.com/smarty-php/smarty/issues/139
- remove no longer used code
- improvement make sure that compiled and cache templates never can contain a trailing '?>?
18.12.2015
- bugfix regression when modifier parameter was followed by math https://github.com/smarty-php/smarty/issues/132
17.12.2015
- bugfix {$smarty.capture.nameFail} did lowercase capture name https://github.com/smarty-php/smarty/issues/135
- bugfix using {block append/prepend} on same block in multiple levels of inheritance templates could fail (forum topic 25827)
- bugfix text content consisting of just a single '0' like in {if true}0{/if} was suppressed (forum topic 25834)
16.12.2015
- bugfix {foreach} did fail if from atrribute is a Generator class https://github.com/smarty-php/smarty/issues/128
- bugfix direct access $smarty->template_dir = 'foo'; should call Smarty::setTemplateDir() https://github.com/smarty-php/smarty/issues/121
15.12.2015
- bugfix {$smarty.cookies.foo} did return the $_COOKIE array not the 'foo' value https://github.com/smarty-php/smarty/issues/122
- bugfix a call to clearAllCache() and other should clear all internal template object caches (forum topic 25828)
14.12.2015
- bugfix {$smarty.config.foo} broken in 3.1.28 https://github.com/smarty-php/smarty/issues/120
- bugfix multiple calls of {section} with same name droped E_NOTICE error https://github.com/smarty-php/smarty/issues/118
- 3.1.28 - (13.12.2015)
13.12.2015
- bugfix {foreach} and {section} with uppercase characters in name attribute did not work (forum topic 25819)
- bugfix $smarty->debugging_ctrl = 'URL' did not work (forum topic 25811)
- bugfix Debug Console could display incorrect data when using subtemplates
09.12.2015
- bugfix Smarty did fail under PHP 7.0.0 with use_include_path = true;
09.12.2015
- bugfix {strip} should exclude some html tags from stripping, related to fix for https://github.com/smarty-php/smarty/issues/111
08.12.2015
- bugfix internal template function data got stored in wrong compiled file https://github.com/smarty-php/smarty/issues/114
05.12.2015
-bugfix {strip} should insert a single space https://github.com/smarty-php/smarty/issues/111
25.11.2015
-bugfix a left delimter like '[%' did fail on [%$var_[%$variable%]%] (forum topic 25798)
02.11.2015
- bugfix {include} with variable file name like {include file="foo_`$bar`.tpl"} did fail in 3.1.28-dev https://github.com/smarty-php/smarty/issues/102
01.11.2015
- update config file processing
31.10.2015
- bugfix add missing $trusted_dir property to SmartyBC class (forum topic 25751)
29.10.2015
- improve template scope handling
24.10.2015
- more optimizations of template processing
- bugfix Error when using {include} within {capture} https://github.com/smarty-php/smarty/issues/100
21.10.2015
- move some code into runtime extensions
18.10.2015
- optimize filepath normalization
- rework of template inheritance
- speed and size optimizations
- bugfix under HHVM temporary cache file must only be created when caches template was updated
- fix compiled code for new {block} assign attribute
- update code generated by template function call handler
18.09.2015
- bugfix {if $foo instanceof $bar} failed to compile if 2nd value is a variable https://github.com/smarty-php/smarty/issues/92
17.09.2015
- bugfix {foreach} first attribute was not correctly reset since commit 05a8fa2 of 02.08.2015 https://github.com/smarty-php/smarty/issues/90
16.09.2015
- update compiler by moving no longer needed properties, code optimizations and other
14.09.2015
- optimize autoloader
- optimize subtemplate handling
- update template inheritance processing
- move code of {call} processing back into Smarty_Internal_Template class
- improvement invalidate OPCACHE for cleared compiled and cached template files (forum topic 25557)
- bugfix unintended multiple debug windows (forum topic 25699)
30.08.2015
- size optimization move some runtime functions into extension
- optimize inline template processing
- optimization merge inheritance child and parent templates into one compiled template file
29.08.2015
- improvement convert template inheritance into runtime processing
- bugfix {$smarty.block.parent} did always reference the root parent block https://github.com/smarty-php/smarty/issues/68
23.08.2015
- introduce Smarty::$resource_cache_mode and cache template object of {include} inside loop
- load seldom used Smarty API methods dynamically to reduce memory footprint
- cache template object of {include} if same template is included several times
- convert debug console processing to object
- use output buffers for better performance and less memory usage
- optimize nocache hash processing
- remove not really needed properties
- optimize rendering
- move caching to Smarty::_cache
- remove properties with redundant content
- optimize Smarty::templateExists()
- optimize use_include_path processing
- relocate properties for size optimization
- remove redundant code
- bugfix compiling super globals like {$smarty.get.foo} did fail in the master branch https://github.com/smarty-php/smarty/issues/77
06.08.2015
- avoid possible circular object references caused by parser/lexer objects
- rewrite compileAll... utility methods
- commit several internal improvements
- bugfix Smarty failed when compile_id did contain "|"
03.08.2015
- rework clear cache methods
- bugfix compileAllConfig() was broken since 3.1.22 because of the changes in config file processing
- improve getIncludePath() to return directory if no file was given
02.08.2015
- optimization and code cleanup of {foreach} and {section} compiler
- rework {capture} compiler
01.08.2015
- update DateTime object can be instance of DateTimeImmutable since PHP5.5 https://github.com/smarty-php/smarty/pull/75
- improvement show resource type and start of template source instead of uid on eval: and string: resource (forum topic 25630)
31.07.2015
- optimize {foreach} and {section} compiler
29.07.2015
- optimize {section} compiler for speed and size of compiled code
28.07.2015
- update for PHP 7 compatibility
26.07.2015
- improvement impement workaround for HHVM PHP incompatibillity https://github.com/facebook/hhvm/issues/4797
25.07.2015
- bugfix parser did hang on text starting <?something https://github.com/smarty-php/smarty/issues/74
20.07.2015
- bugfix config files got recompiled on each request
- improvement invalidate PHP 5.5 opcache for recompiled and cached templates https://github.com/smarty-php/smarty/issues/72
12.07.2015
- optimize {extends} compilation
10.07.2015
- bugfix force file: resource in demo resource.extendsall.php
08.07.2015
- bugfix convert each word of class names to ucfirst in in compiler. (forum topic 25588)
07.07.2015
- improvement allow fetch() or display() called on a template object to get output from other template
like $template->fetch('foo.tpl') https://github.com/smarty-php/smarty/issues/70
- improvement Added $limit parameter to regex_replace modifier #71
- new feature multiple indices on file: resource
06.07.2015
- optimize {block} compilation
- optimization get rid of __get and __set in source object
01.07.2015
- optimize compile check handling
- update {foreach} compiler
- bugfix debugging console did not display string values containing \n, \r or \t correctly https://github.com/smarty-php/smarty/issues/66
- optimize source resources
28.06.2015
- move $smarty->enableSecurity() into Smarty_Security class
- optimize security isTrustedResourceDir()
- move auto load filter methods into extension
- move $smarty->getTemplateVars() into extension
- move getStreamVariable() into extension
- move $smarty->append() and $smarty->appendByRef() into extension
- optimize autoloader
- optimize file path normalization
- bugfix PATH_SEPARATOR was replaced by mistake in autoloader
- remove redundant code
27.06.2015
- bugfix resolve naming conflict between custom Smarty delimiter '<%' and PHP ASP tags https://github.com/smarty-php/smarty/issues/64
- update $smarty->_realpath for relative path not starting with './'
- update Smarty security with new realpath handling
- update {include_php} with new realpath handling
- move $smarty->loadPlugin() into extension
- minor compiler optimizations
- bugfix allow function plugins with name ending with 'close' https://github.com/smarty-php/smarty/issues/52
- rework of $smarty->clearCompiledTemplate() and move it to its own extension
19.06.2015
- improvement allow closures as callback at $smarty->registerFilter() https://github.com/smarty-php/smarty/issues/59
- 3.1.27- (18.06.2015)
18.06.2015
- bugfix another update on file path normalization failed on path containing something like "/.foo/" https://github.com/smarty-php/smarty/issues/56
- 3.1.26- (18.06.2015)
18.06.2015
- bugfix file path normalization failed on path containing something like "/.foo/" https://github.com/smarty-php/smarty/issues/56
17.06.2015
- bugfix calling a plugin with nocache option but no other attributes like {foo nocache} caused call to undefined function https://github.com/smarty-php/smarty/issues/55
- 3.1.25- (15.06.2015)
15.06.2015
- optimization of smarty_cachereource_keyvaluestore.php code
14.06.2015
- bugfix a relative sub template path could fail if template_dir path did contain /../ https://github.com/smarty-php/smarty/issues/50
- optimization rework of path normalization
- bugfix an output tag with variable, modifier followed by an operator like {$foo|modifier+1} did fail https://github.com/smarty-php/smarty/issues/53
13.06.2015
- bugfix a custom cache resource using smarty_cachereource_keyvaluestore.php did fail if php.ini mbstring.func_overload = 2 (forum topic 25568)
11.06.2015
- bugfix the lexer could hang on very large quoted strings (forum topic 25570)
08.06.2015
- bugfix using {$foo} as array index like $bar.{$foo} or in double quoted string like "some {$foo} thing" failed https://github.com/smarty-php/smarty/issues/49
04.06.2015
- bugfix possible error message on unset() while compiling {block} tags https://github.com/smarty-php/smarty/issues/46
01.06.2015
- bugfix <?xml ... ?> including template variables broken since 3.1.22 https://github.com/smarty-php/smarty/issues/47
27.05.2015
- bugfix {include} with variable file name must not create by default individual cache file (since 3.1.22) https://github.com/smarty-php/smarty/issues/43
24.05.2015
- bugfix if condition string 'neq' broken due to a typo https://github.com/smarty-php/smarty/issues/42
- 3.1.24- (23.05.2015)
23.05.2015
- improvement on php_handling to allow very large PHP sections, better error handling
- improvement allow extreme large comment sections (forum 25538)
21.05.2015
- bugfix broken PHP 5.2 compatibility when compiling <?php tags https://github.com/smarty-php/smarty/issues/40
- bugfix named {foreach} comparison like $smarty.foreach.foobar.index > 1 did compile into wrong code https://github.com/smarty-php/smarty/issues/41
19.05.2015
- bugfix compiler did overwrite existing variable value when setting the nocache attribute https://github.com/smarty-php/smarty/issues/39
- bugfix output filter trimwhitespace could run into the pcre.backtrack_limit on large output (code.google issue 220)
- bugfix compiler could run into the pcre.backtrack_limit on larger comment or {php} tag sections (forum 25538)
18.05.2015
- improvement introduce shortcuts in lexer/parser rules for most frequent terms for higher
compilation speed
16.05.2015
- bugfix {php}{/php} did work just for single lines https://github.com/smarty-php/smarty/issues/33
- improvement remove not needed ?><?php transitions from compiled code
- improvement reduce number of lexer tokens on operators and if conditions
- improvement higher compilation speed by modified lexer/parser generator at "smarty/smarty-lexer"
13.05.2015
- improvement remove not needed ?><?php transitions from compiled code
- improvement of debugging:
- use fresh Smarty object to display the debug console because of possible problems when the Smarty
was extended or Smarty properties had been modified in the class source
- display Smarty version number
- Truncate lenght of Origin display and extend strin value display to 80 character
- bugfix in Smarty_Security 'nl2br' should be a trusted modifier, not PHP function (code.google issue 223)
12.05.2015
- bugfix {$smarty.constant.TEST} did fail on undefined constant https://github.com/smarty-php/smarty/issues/28
- bugfix access to undefined config variable like {#undef#} did fail https://github.com/smarty-php/smarty/issues/29
- bugfix in nested {foreach} saved item attributes got overwritten https://github.com/smarty-php/smarty/issues/33
- 3.1.23 - (12.05.2015)
12.05.2015
- bugfix of smaller performance issue introduce in 3.1.22 when caching is enabled
- bugfix missig entry for smarty-temmplate-config in autoloader
- 3.1.22 - tag was deleted because 3.1.22 did fail caused by the missing entry for smarty-temmplate-config in autoloader
10.05.2015
- bugfix custom cache resource did not observe compile_id and cache_id when $cache_locking == true
- bugfix cache lock was not handled correctly after timeout when $cache_locking == true
- improvement added constants for $debugging
07.05.2015
- improvement of the debugging console. Read NEW_FEATURES.txt
- optimization of resource class loading
06.05.2015
- bugfix in 3.1.22-dev cache resource must not be loaded for subtemplates
- bugfix/improvement in 3.1.22-dev cache locking did not work as expected
05.05.2015
- optimization on cache update when main template is modified
- optimization move <?php ?> handling from parser to new compiler module
05.05.2015
- bugfix code could be messed up when {tags} are used in multiple attributes https://github.com/smarty-php/smarty/issues/23
04.05.2015
- bugfix Smarty_Resource::parseResourceName incompatible with Google AppEngine (https://github.com/smarty-php/smarty/issues/22)
- improvement use is_file() checks to avoid errors suppressed by @ which could still cause problems (https://github.com/smarty-php/smarty/issues/24)
28.04.2015
- bugfix plugins of merged subtemplates not loaded in 3.1.22-dev (forum topic 25508) 2nd fix
28.04.2015
- bugfix plugins of merged subtemplates not loaded in 3.1.22-dev (forum topic 25508)
23.04.2015
- bugfix a nocache template variable used as parameter at {insert} was by mistake cached
20.04.2015
- bugfix at a template function containing nocache code a parmeter could overwrite a template variable of same name
27.03.2015
- bugfix Smarty_Security->allow_constants=false; did also disable true, false and null (change of 16.03.2015)
- improvement added a whitelist for trusted constants to security Smarty_Security::$trusted_constants (forum topic 25471)
20.03.2015
- bugfix make sure that function properties get saved only in compiled files containing the fuction definition {forum topic 25452}
- bugfix correct update of global variable values on exit of template functions. (reported under Smarty Developers)
16.03.2015
- bugfix problems with {function}{/function} and {call} tags in different subtemplate cache files {forum topic 25452}
- bugfix Smarty_Security->allow_constants=false; did not disallow direct usage of defined constants like {SMARTY_DIR} {forum topic 25457}
- bugfix {block}{/block} tags did not work inside double quoted strings https://github.com/smarty-php/smarty/issues/18
15.03.2015
- bugfix $smarty->compile_check must be restored before rendering of a just updated cache file {forum 25452}
14.03.2015
- bugfix {nocache} {/nocache} tags corrupted code when used within a nocache section caused by a nocache template variable.
- bugfix template functions defined with {function} in an included subtemplate could not be called in nocache
mode with {call... nocache} if the subtemplate had it's own cache file {forum 25452}
10.03.2015
- bugfix {include ... nocache} whith variable file or compile_id attribute was not executed in nocache mode.
12.02.2015
- bugfix multiple Smarty::fetch() of same template when $smarty->merge_compiled_includes = true; could cause function already defined error
11.02.2015
- bugfix recursive {includes} did create E_NOTICE message when $smarty->merge_compiled_includes = true; (github issue #16)
22.01.2015
- new feature security can now control access to static methods and properties
see also NEW_FEATURES.txt
21.01.2015
- bugfix clearCompiledTemplates(), clearAll() and clear() could try to delete whole drive at wrong path permissions because realpath() fail (forum 25397)
- bugfix 'self::' and 'parent::' was interpreted in template syntax as static class
04.01.2015
- push last weeks changes to github
- different optimizations
- improvement automatically create different versions of compiled templates and config files depending
on property settings.
- optimization restructure template processing by moving code into classes it better belongs to
- optimization restructure config file processing
31.12.2014
- bugfix use function_exists('mb_get_info') for setting Smarty::$_MBSTRING.
Function mb_split could be overloaded depending on php.ini mbstring.func_overload
29.12.2014
- new feature security can now limit the template nesting level by property $max_template_nesting
see also NEW_FEATURES.txt (forum 25370)
29.12.2014
- new feature security can now disable special $smarty variables listed in property $disabled_special_smarty_vars
see also NEW_FEATURES.txt (forum 25370)
27.12.2014
- bugfix clear internal _is_file_cache when plugins_dir was modified
13.12.2014
- improvement optimization of lexer and parser resulting in a up to 30% higher compiling speed
11.12.2014
- bugfix resolve parser ambiguity between constant print tag {CONST} and other smarty tags after change of 09.12.2014
09.12.2014
- bugfix variables $null, $true and $false did not work after the change of 12.11.2014 (forum 25342)
- bugfix call of template function by a variable name did not work after latest changes (forum 25342)
23.11.2014
- bugfix a plugin with attached modifier could fail if the tag was immediately followed by another Smarty tag (since 3.1.21) (forum 25326)
13.11.2014
- improvement move autoload code into Autoloader.php. Use Composer autoloader when possible
12.11.2014
- new feature added support of namespaces to template code
08.11.2014 - 10.11.2014
- bugfix subtemplate called in nocache mode could be called with wrong compile_id when it did change on one of the calling templates
- improvement add code of template functions called in nocache mode dynamically to cache file (related to bugfix of 01.11.2014)
- bugfix Debug Console did not include all data from merged compiled subtemplates
04.11.2014
- new feature $smarty->debugging = true; => overwrite existing Debug Console window (old behaviour)
$smarty->debugging = 2; => individual Debug Console window by template name
03.11.2014
- bugfix Debug Console did not show included subtemplates since 3.1.17 (forum 25301)
- bugfix Modifier debug_print_var did not limit recursion or prevent recursive object display at Debug Console
(ATTENTION: parameter order has changed to be able to specify maximum recursion)
- bugfix Debug consol did not include subtemplate information with $smarty->merge_compiled_includes = true
- improvement The template variables are no longer displayed as objects on the Debug Console
- improvement $smarty->createData($parent = null, $name = null) new optional name parameter for display at Debug Console
- addition of some hooks for future extension of Debug Console
01.11.2014
- bugfix and enhancement on subtemplate {include} and template {function} tags.
* Calling a template which has a nocache section could fail if it was called from a cached and a not cached subtemplate.
* Calling the same subtemplate cached and not cached with the $smarty->merge_compiled_includes enabled could cause problems
* Many smaller related changes
30.10.2014
- bugfix access to class constant by object like {$object::CONST} or variable class name {$class::CONST} did not work (forum 25301)
26.10.2014
- bugfix E_NOTICE message was created during compilation when ASP tags '<%' or '%>' are in template source text
- bugfix merge_compiled_includes option failed when caching enables and same subtemplate was included cached and not cached
- 3.1.21 - (18.10.2014)
18.10.2014
- composer moved to github
17.10.2014
- bugfix on $php_handling security and optimization of smarty_internal_parsetree (Thue Kristensen)
16.10.2014
- bugfix composer.json update
15.10.2014
- bugfix calling a new created cache file with fetch() and Smarty::CACHING_LIFETIME_SAVED multiple times did fail (forum 22350)
14.10.2014
- bugfix any tag placed within "<script language=php>" will throw a security exception to close all thinkable holes
- bugfix classmap in root composer.json should start at "libs/..."
- improvement cache is_file(file_exists) results of loadPlugin() to avoid unnecessary calls during compilation (Issue 201}
12.10.2014
- bugfix a comment like "<script{*foo*} language=php>" bypassed $php_handling checking (Thue Kristensen)
- bugfix change of 08.10.2014 could create E_NOTICE meassage when using "<?php" tags
- bugfix "<script language=php>" with $php_handling PHP_PASSTHRU was executed in {nocache} sections
- 3.1.20 - (09.10.2014)
08.10.2014
- bugfix security mode of "<script language=php>" must be controlled by $php_handling property (Thue Kristensen)
01.10.2014
- bugfix template resource of inheritance blocks could get invalid if the default resource type is not 'file'(Issue 202)
- bugfix existing child {block} tag must override parent {block} tag append / prepend setting (topic 25259)
02.08.2014
- bugfix modifier wordwrap did output break string wrong if first word was exceeding length with cut = true (topic 25193)
24.07.2014
- bugfix cache clear when cache folder does not exist
16.07.2014
- enhancement remove BOM automatically from template source (topic 25161)
04.07.2014
- bugfix the bufix of 02.06.2014 broke correct handling of child templates with same name but different template folders in extends resource (issue 194 and topic 25099)
- 3.1.19 - (30.06.2014)
20.06.2014
- bugfix template variables could not be passed as parameter in {include} when the include was in a {nocache} section (topic 25131)
17.06.2014
- bugfix large template text of some charsets could cause parsing errors (topic 24630)
08.06.2014
- bugfix registered objects did not work after spelling fixes of 06.06.2014
- bugfix {block} tags within {literal} .. {/literal} got not displayed correctly (topic 25024)
- bugfix UNC WINDOWS PATH like "\\psf\path\to\dir" did not work as template directory (Issue 192)
- bugfix {html_image} security check did fail on files relative to basedir (Issue 191)
06.06.2014
- fixed PHPUnit outputFilterTrimWhitespaceTests.php assertion of test result
- fixed spelling, PHPDoc , minor errors, code cleanup
02.06.2014
- using multiple cwd with relative template dirs could result in identical compiled file names. (issue 194 and topic 25099)
19.04.2014
- bugfix calling createTemplate(template, data) with empty data array caused notice of array to string conversion (Issue 189)
- bugfix clearCompiledTemplate() did not delete files on WINDOWS when a compile_id was specified
18.04.2014
- revert bugfix of 5.4.2014 because %-e date format is not supported on all operating systems
- 3.1.18 - (07.04.2014)
06.04.2014
- bugfix template inheritance fail when using custom resource after patch of 8.3.2014 (Issue 187)
- bugfix update of composer file (Issue 168 and 184)
05.04.2014
- bugfix default date format leads to extra spaces when displaying dates with single digit days (Issue 165)
26.03.2014
- bugfix Smart_Resource_Custom should not lowercase the resource name (Issue 183)
24.03.2014
- bugfix using a {foreach} property like @iteration could fail when used in inheritance parent templates (Issue 182)
20.03.2014
- bugfix $smarty->auto_literal and mbsting.func_overload 2, 6 or 7 did fail (forum topic 24899)
18.03.2014
- revert change of 17.03.2014
17.03.2014
- bugfix $smarty->auto_literal and mbsting.func_overload 2, 6 or 7 did fail (forum topic 24899)
15.03.2014
- bugfix Smarty_CacheResource_Keyvaluestore did use different keys on read/writes and clearCache() calls (Issue 169)
13.03.2014
- bugfix clearXxx() change of 27.1.2014 did not work when specifing cache_id or compile_id (forum topic 24868 and 24867)
- 3.1.17 -
08.03.2014
- bugfix relative file path {include} within {block} of child templates did throw exception on first call (Issue 177)
17.02.2014
- bugfix Smarty failed when executing PHP on HHVM (Hip Hop 2.4) because uniqid('',true) does return string with ',' (forum topic 20343)
16.02.2014
- bugfix a '//' or '\\' in template_dir path could produce wrong path on relative filepath in {include} (Issue 175)
05.02.2014
- bugfix shared.literal_compiler_param.php did throw an exception when literal did contain a '-' (smarty-developers group)
27.01.2014
- bugfix $smarty->debugging = true; did show the variable of the $smarty object not the variables used in display() call (forum topic 24764)
- bugfix clearCompiledTemplate(), clearAll() and clear() should use realpath to avoid possible exception from RecursiveDirectoryIterator (Issue 171)
26.01.2014
- bugfix undo block nesting checks for {nocache} for reasons like forum topic 23280 (forum topic 24762)
18.01.2014
- bugfix the compiler did fail when using template inheritance and recursive {include} (smarty-developers group)
11.01.2014
- bugfix "* }" (spaces before right delimiter) was interpreted by mistake as comment end tag (Issue 170)
- internals content cache should be clear when updating cache file
08.01.2014
- bugfix Smarty_CacheResource_Custom did not handle template resource type specifications on clearCache() calls (Issue 169)
- bugfix SmartyBC.class.php should use require_once to load Smarty.class.php (forum topic 24683)
- 3.1.16 -
15.12.2013
- bugfix {include} with {block} tag handling (forum topic 24599, 24594, 24682) (Issue 161)
Read 3.1.16_RELEASE_NOTES for more details
- enhancement additional debug output at $smarty->_parserdebug = true;
07.11.2013
- bugfix too restrictive handling of {include} within {block} tags. 3.1.15 did throw errors where 3.1.14 did not (forum topic 24599)
- bugfix compiler could fail if PHP mbstring.func_overload is enabled (Issue 164)
28.10.2013
- bugfix variable resource name at custom resource plugin did not work within {block} tags (Issue 163)
- bugfix notice "Trying to get property of non-object" removed (Issue 163)
- bugfix correction of modifier capitalize fix from 3.10.2013 (issue 159)
- bugfix multiple {block}s with same name in parent did not work (forum topic 24631)
20.10.2013
- bugfix a variable file name at {extends} tag did fail (forum topic 24618)
14.10.2013
- bugfix yesterdays fix could result in an undefined variable
13.10.2013
- bugfix variable names on {include} in template inheritance did unextepted error message (forum topic 24594) (Issue 161)
.- bugfix relative includes with same name like {include './foo.tpl'} from different folder failed (forum topic 24590)(Issue 161)
04.10.2013
- bugfix variable file names at {extends} had been disbabled by mistake with the rewrite of
template inheritance of 24.08.2013 (forum topic 24585)
03.10.2013
- bugfix loops using modifier capitalize did eat up memory (issue 159)
- Smarty 3.1.15 -
01.10.2013
- use current delimiters in compiler error messages (issue 157)
- improvement on performance when using error handler and multiple template folders (issue 152)
17.09.2013
- improvement added patch for additional SmartyCompilerException properties for better access to source information (forum topic 24559)
16.09.2013
- bugfix recompiled templates did not show on first request with zend opcache cache (forum topic 24320)
13.09.2013
- bugfix html_select_time defaulting error for the Meridian dropdown (forum topic 24549)
09.09.2012
- bugfix incorrect compiled code with array(object,method) callback at registered Variable Filter (forum topic 24542)
27.08.2013
- bugfix delimiter followed by linebreak did not work as auto literal after update from 24.08.2013 (forum topic 24518)
24.08.2013
- bugfix and enhancement
Because several recent problems with template inheritance the {block} tag compiler has been rewriten
- Error messages shown now the correct child template file and line number
- The compiler could fail on some larger UTF-8 text block (forum topic 24455)
- The {strip} tag can now be placed outside {block} tags in child templates (forum topic 24289)
- change SmartyException::$escape is now false by default
- change PHP traceback has been remove for SmartyException and SmartyCompilerException
14.08.2013
- bugfix compiled filepath of config file did not observe different config_dir (forum topic 24493)
13.08.2013
- bugfix the internal resource cache did not observe config_dir changes (forum topic 24493)
12.08.2013
- bugfix internal $tmpx variables must be unique over all inheritance templates (Issue 149)
10.08.2013
- bugfix a newline was eaten when a <?xml ... ?> was passed by a Smarty variable and caching was enabled (forum topic 24482)
29.07.2013
- bugfix headers already send warning thrown when using 'SMARTY_DEBUG=on' from URL (Issue 148)
27.07.2013
- enhancement allow access to properties of registered opjects for Smarty2 BC (forum topic 24344)
26.07.2013
- bugfix template inheritance nesting problem (forum topic 24387)
15.7.2013
- update code generated by PSR-2 standards fixer which introduced PHP 5.4 incompatibilities of 14.7.2013
14.7.2013
- bugfix increase of internal maximum parser stacksize to allow more complex tag code {forum topic 24426}
- update for PHP 5.4 compatibility
- reformat source to PSR-2 standard
12.7.2013
- bugfix Do not remove '//' from file path at normalization (Issue 142)
2.7.2013
- bugfix trimwhitespace would replace captured items in wrong order (forum topic 24387)
## Smarty-3.1.14 -
27.06.2013
- bugfix removed PHP 5.5 deprecated preg_replace /e option in modifier capitalize (forum topic 24389)
17.06.2013
- fixed spelling in sources and documentation (from smarty-developers forum Veres Lajos)
- enhancement added constant SMARTY::CLEAR_EXPIRED for the change of 26.05.2013 (forum topic 24310)
- bugfix added smarty_security.php to composer.json (Issue 135)
26.05.2013
- enhancement an expire_time of -1 in clearCache() and clearAllCache() will delete outdated cache files
by their individual cache_lifetime used at creation (forum topic 24310)
21.05.2013
- bugfix modifier strip_tags:true was compiled into wrong code (Forum Topic 24287)
- bugfix /n after ?> in Smarty.class.php did start output buffering (Issue 138)
25.04.2013
- bugfix escape and wordrap modifier could be compiled into wrong code when used in {nocache}{/nocache}
section but caching is disabled (Forum Topic 24260)
05.04.2013
- bugfix post filter must not run when compiling inheritance child blocks (Forum Topic 24094)
- bugfix after the fix for Issue #130 compiler exceptions got double escaped (Forum Topic 24199)
28.02.2013
- bugfix nocache blocks could be lost when using CACHING_LIFETIME_SAVED (Issue #133)
- bugfix Compile ID gets nulled when compiling child blocks (Issue #134)
24.01.2013
- bugfix wrong tag type in smarty_internal_templatecompilerbase.php could cause wrong plugin search order (Forum Topic 24028)
## Smarty-3.1.13 -
13.01.2013
- enhancement allow to disable exception message escaping by SmartyException::$escape = false; (Issue #130)
09.01.2013
- bugfix compilation did fail when a prefilter did modify an {extends} tag c
- bugfix template inheritance could fail if nested {block} tags in childs did contain {$smarty.block.child} (Issue #127)
- bugfix template inheritance could fail if {block} tags in childs did have similar name as used plugins (Issue #128)
- added abstract method declaration doCompile() in Smarty_Internal_TemplateCompilerBase (Forum Topic 23969)
06.01.2013
- Allow '://' URL syntax in template names of stream resources (Issue #129)
27.11.2012
- bugfix wrong variable usage in smarty_internal_utility.php (Issue #125)
26.11.2012
- bugfix global variable assigned within template function are not seen after template function exit (Forum Topic 23800)
24.11.2012
- made SmartyBC loadable via composer (Issue #124)
20.11.2012
- bugfix assignGlobal() called from plugins did not work (Forum Topic 23771)
13.11.2012
- adding attribute "strict" to html_options, html_checkboxes, html_radios to only print disabled/readonly attributes if their values are true or "disabled"/"readonly" (Issue #120)
01.11.2012
- bugfix muteExcpetedErrors() would screw up for non-readable paths (Issue #118)
## Smarty-3.1.12 -
14.09.2012
- bugfix template inheritance failed to compile with delimiters {/ and /} (Forum Topic 23008)
11.09.2012
- bugfix escape Smarty exception messages to avoid possible script execution
10.09.2012
- bugfix tag option flags and shorttag attributes did not work when rdel started with '=' (Forum Topic 22979)
31.08.2012
- bugfix resolving relative paths broke in some circumstances (Issue #114)
22.08.2012
- bugfix test MBString availability through mb_split, as it could've been compiled without regex support (--enable-mbregex).
Either we get MBstring's full package, or we pretend it's not there at all.
21.08.2012
- bugfix $auto_literal = false did not work with { block} tags in child templates
(problem was reintroduced after fix in 3.1.7)(Forum Topic 20581)
17.08.2012
- bugfix compiled code of nocache sections could contain wrong escaping (Forum Topic 22810)
15.08.2012
- bugfix template inheritance did produce wrong code if subtemplates with {block} was
included several times (from smarty-developers forum)
14.08.2012
- bugfix PHP5.2 compatibility compromised by SplFileInfo::getBasename() (Issue 110)
01.08.2012
- bugfix avoid PHP error on $smarty->configLoad(...) with invalid section specification (Forum Topic 22608)
30.07.2012
-bugfix {assign} in a nocache section should not overwrite existing variable values
during compilation (issue 109)
28.07.2012
- bugfix array access of config variables did not work (Forum Topic 22527)
19.07.2012
- bugfix the default plugin handler did create wrong compiled code for static class methods
from external script files (issue 108)
## Smarty-3.1.11 -
30.06.2012
- bugfix {block.. hide} did not work as nested child (Forum Topic 22216)
25.06.2012
- bugfix the default plugin handler did not allow static class methods for modifier (issue 85)
24.06.2012
- bugfix escape modifier support for PHP < 5.2.3 (Forum Topic 21176)
11.06.2012
- bugfix the patch for Topic 21856 did break tabs between tag attributes (Forum Topic 22124)
## Smarty-3.1.10 -
09.06.2012
- bugfix the compiler did ignore registered compiler plugins for closing tags (Forum Topic 22094)
- bugfix the patch for Topic 21856 did break multiline tags (Forum Topic 22124)
## Smarty-3.1.9 -
07.06.2012
- bugfix fetch() and display() with relative paths (Issue 104)
- bugfix treat "0000-00-00" as 0 in modifier.date_format (Issue 103)
24.05.2012
- bugfix Smarty_Internal_Write_File::writeFile() could cause race-conditions on linux systems (Issue 101)
- bugfix attribute parameter names of plugins may now contain also "-" and ":" (Forum Topic 21856)
- bugfix add compile_id to cache key of of source (Issue 97)
22.05.2012
- bugfix recursive {include} within {section} did fail (Smarty developer group)
12.05.2012
- bugfix {html_options} did not properly escape values (Issue 98)
03.05.2012
- bugfix make HTTP protocall version variable (issue 96)
02.05.2012
- bugfix {nocache}{block}{plugin}... did produce wrong compiled code when caching is disabled (Forum Topic 21572, issue 95)
12.04.2012
- bugfix Smarty did eat the linebreak after the <?xml...?> closing tag (Issue 93)
- bugfix concurrent cache updates could create a warning (Forum Topic 21403)
08.04.2012
- bugfix "\\" was not escaped correctly when generating nocache code (Forum Topic 21364)
30.03.2012
- bugfix template inheritance did not throw exception when a parent template was deleted (issue 90)
27.03.2012
- bugfix prefilter did run multiple times on inline subtemplates compiled into several main templates (Forum Topic 21325)
- bugfix implement Smarty2's behaviour of variables assigned by reference in SmartyBC. {assign} will affect all references.
(issue 88)
21.03.2012
- bugfix compileAllTemplates() and compileAllConfig() did not return the number of compiled files (Forum Topic 21286)
13.03.2012
- correction of yesterdays bugfix (Forum Topic 21175 and 21182)
12.03.2012
- bugfix a double quoted string of "$foo" did not compile into PHP "$foo" (Forum Topic 21175)
- bugfix template inheritance did set $merge_compiled_includes globally true
03.03.2012
- optimization of compiling speed when same modifier was used several times
02.03.2012
- enhancement the default plugin handler can now also resolve undefined modifier (Smarty::PLUGIN_MODIFIER)
(Issue 85)
## Smarty-3.1.8 -
19.02.2012
- bugfix {include} could result in a fatal error if used in appended or prepended nested {block} tags
(reported by mh and Issue 83)
- enhancement added Smarty special variable $smarty.template_object to return the current template object (Forum Topic 20289)
07.02.2012
- bugfix increase entropy of internal function names in compiled and cached template files (Forum Topic 20996)
- enhancement cacheable parameter added to default plugin handler, same functionality as in registerPlugin (request by calguy1000)
06.02.2012
- improvement stream_resolve_include_path() added to Smarty_Internal_Get_Include_Path (Forum Topic 20980)
- bugfix fetch('extends:foo.tpl') always yielded $source->exists == true (Forum Topic 20980)
- added modifier unescape:"url", fix (Forum Topic 20980)
- improvement replaced some calls of preg_replace with str_replace (Issue 73)
30.01.2012
- bugfix Smarty_Security internal $_resource_dir cache wasn't properly propagated
27.01.2012
- bugfix Smarty did not a template name of "0" (Forum Topic 20895)
20.01.2012
- bugfix typo in Smarty_Internal_Get_IncludePath did cause runtime overhead (Issue 74)
- improvment remove unneeded assigments (Issue 75 and 76)
- fixed typo in template parser
- bugfix output filter must not run before writing cache when template does contain nocache code (Issue 71)
02.01.2012
- bugfix {block foo nocache} did not load plugins within child {block} in nocache mode (Forum Topic 20753)
29.12.2011
- bugfix enable more entropy in Smarty_Internal_Write_File for "more uniqueness" and Cygwin compatibility (Forum Topic 20724)
- bugfix embedded quotes in single quoted strings did not compile correctly in {nocache} sections (Forum Topic 20730)
28.12.2011
- bugfix Smarty's internal header code must be excluded from postfilters (issue 71)
22.12.2011
- bugfix the new lexer of 17.12.2011 did fail if mbstring.func_overload != 0 (issue 70) (Forum Topic 20680)
- bugfix template inheritace did fail if mbstring.func_overload != 0 (issue 70) (Forum Topic 20680)
20.12.2011
- bugfix template inheritance: {$smarty.block.child} in nested child {block} tags did not return
content after {$smarty.block.child} (Forum Topic 20564)
## Smarty-3.1.7 -
18.12.2011
- bugfix strings ending with " in multiline strings of config files failed to compile (issue #67)
- added chaining to Smarty_Internal_Templatebase
- changed unloadFilter() to not return a boolean in favor of chaining and API conformity
- bugfix unregisterObject() raised notice when object to unregister did not exist
- changed internals to use Smarty::$_MBSTRING ($_CHARSET, $_DATE_FORMAT) for better unit testing
- added Smarty::$_UTF8_MODIFIER for proper PCRE charset handling (Forum Topic 20452)
- added Smarty_Security::isTrustedUri() and Smarty_Security::$trusted_uri to validate
remote resource calls through {fetch} and {html_image} (Forum Topic 20627)
17.12.2011
- improvement of compiling speed by new handling of plain text blocks in the lexer/parser (issue #68)
16.12.2011
- bugfix the source exits flag and timestamp was not setup when template was in php include path (issue #69)
9.12.2011
- bugfix {capture} tags around recursive {include} calls did throw exception (Forum Topic 20549)
- bugfix $auto_literal = false did not work with { block} tags in child templates (Forum Topic 20581)
- bugfix template inheritance: do not include code of {include} in overloaded {block} into compiled
parent template (Issue #66}
- bugfix template inheritance: {$smarty.block.child} in nested child {block} tags did not return expected
result (Forum Topic 20564)
## Smarty-3.1.6 -
30.11.2011
- bugfix is_cache() for individual cached subtemplates with $smarty->caching = CACHING_OFF did produce
an exception (Forum Topic 20531)
29.11.2011
- bugfix added exception if the default plugin handler did return a not static callback (Forum Topic 20512)
25.11.2011
- bugfix {html_select_date} and {html_slecet_time} did not default to current time if "time" was not specified
since r4432 (issue 60)
24.11.2011
- bugfix a subtemplate later used as main template did use old variable values
21.11.2011
- bugfix cache file could include unneeded modifier plugins under certain condition
18.11.2011
- bugfix declare all directory properties private to map direct access to getter/setter also on extended Smarty class
16.11.2011
- bugfix Smarty_Resource::load() did not always return a proper resource handler (Forum Topic 20414)
- added escape argument to html_checkboxes and html_radios (Forum Topic 20425)
## Smarty-3.1.5 -
14.11.2011
- bugfix allow space between function name and open bracket (forum topic 20375)
09.11.2011
- bugfix different behaviour of uniqid() on cygwin. See https://bugs.php.net/bug.php?id=34908
(forum topic 20343)
01.11.2011
- bugfix {if} and {while} tags without condition did not throw a SmartyCompilerException (Issue #57)
- bugfix multiline strings in config files could fail on longer strings (reopened Issue #55)
22.10.2011
- bugfix smarty_mb_from_unicode() would not decode unicode-points properly
- bugfix use catch Exception instead UnexpectedValueException in
clearCompiledTemplate to be PHP 5.2 compatible
21.10.2011
- bugfix apostrophe in plugins_dir path name failed (forum topic 20199)
- improvement sha1() for array keys longer than 150 characters
- add Smarty::$allow_ambiguous_resources to activate unique resource handling (Forum Topic 20128)
20.10.2011
- @silenced unlink() in Smarty_Internal_Write_File since debuggers go haywire without it.
- bugfix Smarty::clearCompiledTemplate() threw an Exception if $cache_id was not present in $compile_dir when $use_sub_dirs = true.
- bugfix {html_select_date} and {html_select_time} did not properly handle empty time arguments (Forum Topic 20190)
- improvement removed unnecessary sha1()
19.10.2011
- revert PHP4 constructor message
- fixed PHP4 constructor message
## Smarty-3.1.4 -
19.10.2011
- added exception when using PHP4 style constructor
16.10.2011
- bugfix testInstall() did not propery check cache_dir and compile_dir
15.10.2011
- bugfix Smarty_Resource and Smarty_CacheResource runtime caching (Forum Post 75264)
14.10.2011
- bugfix unique_resource did not properly apply to compiled resources (Forum Topic 20128)
- add locking to custom resources (Forum Post 75252)
- add Smarty_Internal_Template::clearCache() to accompany isCached() fetch() etc.
13.10.2011
- add caching for config files in Smarty_Resource
- bugfix disable of caching after isCached() call did not work (Forum Topic 20131)
- add concept unique_resource to combat potentially ambiguous template_resource values when custom resource handlers are used (Forum Topic 20128)
- bugfix multiline strings in config files could fail on longer strings (Issue #55)
11.10.2011
- add runtime checks for not matching {capture}/{/capture} calls (Forum Topic 20120)
10.10.2011
- bugfix variable name typo in {html_options} and {html_checkboxes} (Issue #54)
- bugfix <?xml> tag did create wrong output when caching enabled and the tag was in included subtemplate
- bugfix Smarty_CacheResource_mysql example was missing strtotime() calls
## Smarty-3.1.3 -
07.10.2011
- improvement removed html comments from {mailto} (Forum Topic 20092)
- bugfix testInstall() would not show path to internal plugins_dir (Forum Post 74627)
- improvement testInstall() now showing resolved paths and checking the include_path if necessary
- bugfix html_options plugin did not handle object values properly (Issue #49, Forum Topic 20049)
- improvement html_checkboxes and html_radios to accept null- and object values, and label_ids attribute
- improvement removed some unnecessary count()s
- bugfix parent pointer was not set when fetch() for other template was called on template object
06.10.2011
- bugfix switch lexer internals depending on mbstring.func_overload
- bugfix start_year and end_year of {html_select_date} did not use current year as offset base (Issue #53)
05.10.2011
- bugfix of problem introduced with r4342 by replacing strlen() with isset()
- add environment configuration issue with mbstring.func_overload Smarty cannot compensate for (Issue #45)
- bugfix nofilter tag option did not disable default modifier
- bugfix html_options plugin did not handle null- and object values properly (Issue #49, Forum Topic 20049)
04.10.2011
- bugfix assign() in plugins called in subtemplates did change value also in parent template
- bugfix of problem introduced with r4342 on math plugin
- bugfix output filter should not run on individually cached subtemplates
- add unloadFilter() method
- bugfix has_nocache_code flag was not reset before compilation
## Smarty-3.1.2 -
03.10.2011
- improvement add internal $joined_template_dir property instead computing it on the fly several times
01.10.2011
- improvement replaced most in_array() calls by more efficient isset() on array_flip()ed haystacks
- improvement replaced some strlen($foo) > 3 calls by isset($foo[3])
- improvement Smarty_Internal_Utility::clearCompiledTemplate() removed redundant strlen()s
29.09.2011
- improvement of Smarty_Internal_Config::loadConfigVars() dropped the in_array for index look up
28.09.2011
- bugfix on template functions called nocache calling other template functions
27.09.2011
- bugfix possible warning "attempt to modify property of non-object" in {section} (issue #34)
- added chaining to Smarty_Internal_Data so $smarty->assign('a',1)->assign('b',2); is possible now
- bugfix remove race condition when a custom resource did change timestamp during compilation
- bugfix variable property did not work on objects variable in template
- bugfix smarty_make_timestamp() failed to process DateTime objects properly
- bugfix wrong resource could be used on compile check of custom resource
26.09.2011
- bugfix repeated calls to same subtemplate did not make use of cached template object
24.09.2011
- removed internal muteExpectedErrors() calls in favor of having the implementor call this once from his application
- optimized muteExpectedErrors() to pass errors to the latest registered error handler, if appliccable
- added compile_dir and cache_dir to list of muted directories
- improvment better error message for undefined templates at {include}
23.09.2011
- remove unused properties
- optimization use real function instead anonymous function for preg_replace_callback
- bugfix a relative {include} in child template blocks failed
- bugfix direct setting of $template_dir, $config_dir, $plugins_dir in __construct() of an
extended Smarty class created problems
- bugfix error muting was not implemented for cache locking
## Smarty 3.1.1 -
22.09.2011
- bugfix {foreachelse} does fail if {section} was nested inside {foreach}
- bugfix debug.tpl did not display correctly when it was compiled with escape_html = true
21.09.2011
- bugfix look for mixed case plugin file names as in 3.0 if not found try all lowercase
- added $error_muting to suppress error messages even for badly implemented error_handlers
- optimized autoloader
- reverted ./ and ../ handling in fetch() and display() - they're allowed again
20.09.2011
- bugfix removed debug echo output while compiling template inheritance
- bugfix relative paths in $template_dir broke relative path resolving in {include "../foo.tpl"}
- bugfix {include} did not work inside nested {block} tags
- bugfix {assign} with scope root and global did not work in all cases
19.09.2011
- bugfix regression in Smarty_CacheReource_KeyValueStore introduced by r4261
- bugfix output filter shall not run on included subtemplates
18.09.2011
- bugfix template caching did not care about file.tpl in different template_dir
- bugfix {include $file} was broken when merge_compiled_incluges = true
- bugfix {include} was broken when merge_compiled_incluges = true and same indluded template
was used in different main templates in one compilation run
- bugfix for Smarty2 style compiler plugins on unnamed attribute passing like {tag $foo $bar}
- bugfix debug.tpl did not display correctly when it was compiled with escape_html = true
17.09.2011
- bugfix lock_id for file resource would create invalid filepath
- bugfix resource caching did not care about file.tpl in different template_dir
## Smarty 3.1.0 -
15/09/2011
- optimization of {foreach}; call internal _count() method only when "total" or "last" {foreach} properties are used
11/09/2011
- added unregisterObject() method
06/09/2011
- bugfix isset() did not work in templates on config variables
03/09/2011
- bugfix createTemplate() must default to cache_id and compile_id of Smarty object
- bugfix Smarty_CacheResource_KeyValueStore must include $source->uid in cache filepath to keep templates with same
name but different folders separated
- added cacheresource.apc.php example in demo folder
02/09/2011
- bugfix cache lock file must use absolute filepath
01/09/2011
- update of cache locking
30/08/2011
- added locking mechanism to CacheResource API (implemented with File and KeyValueStores)
28/08/2011
- bugfix clearCompileTemplate() did not work for specific template subfolder or resource
27/08/2011
- bugfix {$foo|bar+1} did create syntax error
26/08/2011
- bugfix when generating nocache code which contains double \
- bugfix handle race condition if cache file was deleted between filemtime and include
17/08/2011
- bugfix CacheResource_Custom bad internal fetch() call
15/08/2011
- bugfix CacheResource would load content twice for KeyValueStore and Custom handlers
06/08/2011
- bugfix {include} with scope attribute could execute in wrong scope
- optimization of compile_check processing
03/08/2011
- allow comment tags to comment {block} tags out in child templates
26/07/2011
- bugfix experimental getTags() method did not work
24/07/2011
- sure opened output buffers are closed on exception
- bugfix {foreach} did not work on IteratorAggregate
22/07/2011
- clear internal caches on clearAllCache(), clearCache(), clearCompiledTemplate()
21/07/2011
- bugfix value changes of variable values assigned to Smarty object could not be seen on repeated $smarty->fetch() calls
17/07/2011
- bugfix {$smarty.block.child} did drop a notice at undefined child
15/07/2011
- bugfix individual cache_lifetime of {include} did not work correctly inside {block} tags
- added caches for Smarty_Internal_TemplateSource and Smarty_Internal_TemplateCompiled to reduce I/O for multiple cache_id rendering
14/07/2011
- made Smarty::loadPlugin() respect the include_path if required
13/07/2011
- optimized internal file write functionality
- bugfix PHP did eat line break on nocache sections
- fixed typo of Smarty_Security properties $allowed_modifiers and $disabled_modifiers
06/07/2011
- bugfix variable modifier must run befor gereral filtering/escaping
04/07/2011
- bugfix use (?P<name>) syntax at preg_match as some pcre libraries failed on (?<name>)
- some performance improvement when using generic getter/setter on template objects
30/06/2011
- bugfix generic getter/setter of Smarty properties used on template objects did throw exception
- removed is_dir and is_readable checks from directory setters for better performance
28/06/2011
- added back support of php template resource as undocumented feature
- bugfix automatic recompilation on version change could drop undefined index notice on old 3.0 cache and compiled files
- update of README_3_1_DEV.txt and moved into the distribution folder
- improvement show first characters of eval and string templates instead sha1 Uid in debug window
## Smarty 3.1-RC1 -
25/06/2011
- revert change of 17/06/2011. $_smarty varibale removed. call loadPlugin() from inside plugin code if required
- code cleanup, remove no longer used properties and methods
- update of PHPdoc comments
23/06/2011
- bugfix {html_select_date} would not respect current time zone
19/06/2011
- added $errors argument to testInstall() functions to suppress output.
- added plugin-file checks to testInstall()
18/06/2011
- bugfix mixed use of same subtemplate inline and not inline in same script could cause a warning during compilation
17/06/2011
- bugfix/change use $_smarty->loadPlugin() when loading nested depending plugins via loadPlugin
- bugfix {include ... inline} within {block}...{/block} did fail
16/06/2011
- bugfix do not overwrite '$smarty' template variable when {include ... scope=parent} is called
- bugfix complete empty inline subtemplates did fail
15/06/2011
- bugfix template variables where not accessable within inline subtemplates
12/06/2011
- bugfix removed unneeded merging of template variable when fetching includled subtemplates
10/06/2011
- made protected properties $template_dir, $plugins_dir, $cache_dir, $compile_dir, $config_dir accessible via magic methods
09/06/2011
- fix smarty security_policy issue in plugins {html_image} and {fetch}
05/06/2011
- update of SMARTY_VERSION
- bugfix made getTags() working again
04/06/2011
- allow extends resource in file attribute of {extends} tag
03/06/2011
- added {setfilter} tag to set filters for variable output
- added escape_html property to control autoescaping of variable output
27/05/2011
- added allowed/disabled tags and modifiers in security for sandboxing
23/05/2011
- added base64: and urlencode: arguments to eval and string resource types
22/05/2011
- made time-attribute of {html_select_date} and {html_select_time} accept arrays as defined by attributes prefix and field_array
13/05/2011
- remove setOption / getOption calls from SamrtyBC class
02/05/2011
- removed experimental setOption() getOption() methods
- output returned content also on opening tag calls of block plugins
- rewrite of default plugin handler
- compile code of variable filters for better performance
20/04/2011
- allow {php} {include_php} tags and PHP_ALLOW handling only with the SmartyBC class
- removed support of php template resource
20/04/2011
- added extendsall resource example
- optimization of template variable access
- optimization of subtemplate handling {include}
- optimization of template class
01/04/2011
- bugfix quote handling in capitalize modifier
28/03/2011
- bugfix stripslashes() requried when using PCRE e-modifier
04/03/2011
- upgrade to new PHP_LexerGenerator version 0.4.0 for better performance
27/02/2011
- ignore .svn folders when clearing cache and compiled files
- string resources do not need a modify check
26/02/2011
- replaced smarty_internal_wrapper by SmartyBC class
- load utility functions as static methods instead through __call()
- bugfix in extends resource when subresources are used
- optimization of modify checks
25/02/2011
- use $smarty->error_unassigned to control NOTICE handling on unassigned variables
21/02/2011
- added new new compile_check mode COMPILECHECK_CACHEMISS
- corrected new cloning behaviour of createTemplate()
- do no longer store the compiler object as property in the compile_tag classes to avoid possible memory leaks
during compilation
19/02/2011
- optimizations on merge_compiled_includes handling
- a couple of optimizations and bugfixes related to new resource structure
17/02/2011
- changed ./ and ../ behaviour
14/02/2011
- added {block ... hide} option to suppress block if no child is defined
13/02/2011
- update handling of recursive subtemplate calls
- bugfix replace $smarty->triggerError() by exception in smarty_internal_resource_extends.php
12/02/2011
- new class Smarty_Internal_TemplateBase with shared methods of Smarty and Template objects
- optimizations of template processing
- made register... methods permanet
- code for default_plugin_handler
- add automatic recompilation at version change
04/02/2011
- change in Smarty_CacheResource_Custom
- bugfix cache_lifetime did not compile correctly at {include} after last update
- moved isCached processing into CacheResource class
- bugfix new CacheResource API did not work with disabled compile_check
03/02/2011
- handle template content as function to improve speed on multiple calls of same subtemplate and isCached()/display() calls
- bugfixes and improvents in the new resource API
- optimizations of template class code
25/01/2011
- optimized function html_select_time
22/01/2011
- added Smarty::$use_include_path configuration directive for Resource API
21/01/2011
- optimized function html_select_date
19/01/2011
- optimized outputfilter trimwhitespace
18/01/2011
- bugfix Config to use Smarty_Resource to fetch sources
- optimized Smarty_Security's isTrustedDir() and isTrustedPHPDir()
17/01/2011
- bugfix HTTP headers for CGI SAPIs
16/01/2011
- optimized internals of Smarty_Resource and Smarty_CacheResource
14/01/2011
- added modifiercompiler escape to improve performance of escaping html, htmlall, url, urlpathinfo, quotes, javascript
- added support to choose template_dir to load from: [index]filename.tpl
12/01/2011
- added unencode modifier to revert results of encode modifier
- added to_charset and from_charset modifier for character encoding
11/01/2011
- added SMARTY_MBSTRING to generalize MBString detection
- added argument $lc_rest to modifier.capitalize to lower-case anything but the first character of a word
- changed strip modifier to consider unicode white-space, too
- changed wordwrap modifier to accept UTF-8 strings
- changed count_sentences modifier to consider unicode characters and treat sequences delimited by ? and ! as sentences, too
- added argument $double_encode to modifier.escape (applies to html and htmlall only)
- changed escape modifier to be UTF-8 compliant
- changed textformat block to be UTF-8 compliant
- optimized performance of mailto function
- fixed spacify modifier so characters are not prepended and appended, made it unicode compatible
- fixed truncate modifier to properly use mb_string if possible
- removed UTF-8 frenzy from count_characters modifier
- fixed count_words modifier to treat "hello-world" as a single word like str_count_words() does
- removed UTF-8 frenzy from upper modifier
- removed UTF-8 frenzy from lower modifier
01/01/2011
- optimize smarty_modified_escape for hex, hexentity, decentity.
28/12/2010
- changed $tpl_vars, $config_vars and $parent to belong to Smarty_Internal_Data
- added Smarty::registerCacheResource() for dynamic cache resource object registration
27/12/2010
- added Smarty_CacheResource API and refactored existing cache resources accordingly
- added Smarty_CacheResource_Custom and Smarty_CacheResource_Mysql
26/12/2010
- added Smarty_Resource API and refactored existing resources accordingly
- added Smarty_Resource_Custom and Smarty_Resource_Mysql
- bugfix Smarty::createTemplate() to return properly cloned template instances
24/12/2010
- optimize smarty_function_escape_special_chars() for PHP >= 5.2.3
## SVN 3.0 trunk -
14/05/2011
- bugfix error handling at stream resources
13/05/2011
- bugfix condition starting with "-" did fail at {if} and {while} tags
22/04/2011
- bugfix allow only fixed string as file attribute at {extends} tag
01/04/2011
- bugfix do not run filters and default modifier when displaying the debug template
- bugfix of embedded double quotes within multi line strings (""")
29/03/2011
- bugfix on error message in smarty_internal_compile_block.php
- bugfix mb handling in strip modifier
- bugfix for Smarty2 style registered compiler function on unnamed attribute passing like {tag $foo $bar}
17/03/2011
- bugfix on default {function} parameters when {function} was used in nocache sections
- bugfix on compiler object destruction. compiler_object property was by mistake unset.
09/03/2011
-bugfix a variable filter should run before modifiers on an output tag (see change of 23/07/2010)
08/03/2011
- bugfix loading config file without section should load only defaults
03/03/2011
- bugfix "smarty" template variable was not recreated when cached templated had expired
- bugfix internal rendered_content must be cleared after subtemplate was included
01/03/2011
- bugfix replace modifier did not work in 3.0.7 on systems without multibyte support
- bugfix {$smarty.template} could return in 3.0.7 parent template name instead of
child name when it needed to compile
25/02/2011
- bugfix for Smarty2 style compiler plugins on unnamed attribute passing like {tag $foo $bar}
24/02/2011
- bugfix $smarty->clearCache('some.tpl') did by mistake cache the template object
18/02/2011
- bugfix removed possible race condition when isCached() was called for an individually cached subtemplate
- bugfix force default debug.tpl to be loaded by the file resource
17/02/2011
-improvement not to delete files starting with '.' from cache and template_c folders on clearCompiledTemplate() and clearCache()
16/02/2011
-fixed typo in exception message of Smarty_Internal_Template
-improvement allow leading spaces on } tag closing if auto_literal is enabled
13/02/2011
- bufix replace $smarty->triggerError() by exception
- removed obsolete {popup_init..} plugin from demo templates
- bugfix replace $smarty->triggerError() by exception in smarty_internal_resource_extends.php
## Smarty 3.0.7 -
09/02/2011
- patched vulnerability when using {$smarty.template}
01/02/2011
- removed assert() from config and template parser
31/01/2011
- bugfix the lexer/parser did fail on special characters like VT
16/01/2011
-bugfix of ArrayAccess object handling in internal _count() method
-bugfix of Iterator object handling in internal _count() method
14/01/2011
-bugfix removed memory leak while processing compileAllTemplates
12/01/2011
- bugfix in {if} and {while} tag compiler when using assignments as condition and nocache mode
10/01/2011
- bugfix when using {$smarty.block.child} and name of {block} was in double quoted string
- bugfix updateParentVariables() was called twice when leaving {include} processing
- bugfix mb_str_replace in replace and escape modifiers work with utf8
31/12/2010
- bugfix dynamic configuration of $debugging_crtl did not work
- bugfix default value of $config_read_hidden changed to false
- bugfix format of attribute array on compiler plugins
- bugfix getTemplateVars() could return value from wrong scope
28/12/2010
- bugfix multiple {append} tags failed to compile.
22/12/2010
- update do not clone the Smarty object an internal createTemplate() calls to increase performance
21/12/2010
- update html_options to support class and id attrs
17/12/2010
- bugfix added missing support of $cache_attrs for registered plugins
15/12/2010
- bugfix assignment as condition in {while} did drop an E_NOTICE
14/12/2010
- bugfix when passing an array as default parameter at {function} tag
13/12/2010
- bugfix {$smarty.template} in child template did not return right content
- bugfix Smarty3 did not search the PHP include_path for template files
## Smarty 3.0.6 -
12/12/2010
- bugfix fixed typo regarding yesterdays change to allow streamWrapper
11/12/2010
- bugfix nested block tags in template inheritance child templates did not work correctly
- bugfix {$smarty.current_dir} in child template did not point to dir of child template
- bugfix changed code when writing temporary compiled files to allow stream_wrapper
06/12/2010
- bugfix getTemplateVars() should return 'null' instead dropping E_NOTICE on an unassigned variable
05/12/2010
- bugfix missing declaration of $smarty in Smarty class
- bugfix empty($foo) in {if} did drop a notice when $foo was not assigned
01/12/2010
- improvement of {debug} tag output
27/11/2010
-change run output filter before cache file is written. (same as in Smarty2)
24/11/2011
-bugfix on parser at !$foo|modifier
-change parser logic when assignments used as condition in {if] and {while} to allow assign to array element
23/11/2011
-bugfix allow integer as attribute name in plugin calls
-change trimm whitespace from error message, removed long list of expected tokens
22/11/2010
- bugfix on template inheritance when an {extends} tag was inserted by a prefilter
- added error message for illegal variable file attributes at {extends...} tags
## Smarty 3.0.5 -
19/11/2010
- bugfix on block plugins with modifiers
18/11/2010
- change on handling of unassigned template variable -- default will drop E_NOTICE
- bugfix on Smarty2 wrapper load_filter() did not work
17/11/2010
- bugfix on {call} with variable function name
- bugfix on {block} if name did contain '-'
- bugfix in function.fetch.php , referece to undefined $smarty
16/11/2010
- bugfix whitespace in front of "<?php" in smarty_internal_compile_private_block_plugin.php
- bugfix {$smarty.now} did compile incorrectly
- bugfix on reset(),end(),next(),prev(),current() within templates
- bugfix on default parameter for {function}
15/11/2010
- bugfix when using {$smarty.session} as object
- bugfix scoping problem on $smarty object passed to filters
- bugfix captured content could not be accessed globally
- bugfix Smarty2 wrapper functions could not be call from within plugins
## Smarty 3.0.4 -
14/11/2010
- bugfix isset() did not allow multiple parameter
- improvment of some error messages
- bugfix html_image did use removed property $request_use_auto_globals
- small performace patch in Smarty class
13/11/2010
- bugfix overloading problem when $smarty->fetch()/display() have been used in plugins
(introduced with 3.0.2)
- code cleanup
## Smarty 3.0.3 -
13/11/2010
- bugfix on {debug}
- reverted location of loadPlugin() to Smarty class
- fixed comments in plugins
- fixed internal_config (removed unwanted code line)
- improvement remove last linebreak from {function} definition
## Smarty 3.0.2 -
12/11/2010
- reactivated $error_reporting property handling
- fixed typo in compile_continue
- fixed security in {fetch} plugin
- changed back plugin parameters to two. second is template object
with transparent access to Smarty object
- fixed {config_load} scoping form compile time to run time
## Smarty 3.0.0 -
11/11/2010
- major update including some API changes
10/11/2010
- observe compile_id also for config files
09/11/2010
-bugfix on complex expressions as start value for {for} tag
request_use_auto_globals
04/11/2010
- bugfix do not allow access of dynamic and private object members of assigned objects when
security is enabled.
01/11/2010
- bugfix related to E_NOTICE change. {if empty($foo)} did fail when $foo contained a string
28/10/2010
- bugfix on compiling modifiers within $smarty special vars like {$smarty.post.{$foo|lower}}
27/10/2010
- bugfix default parameter values did not work for template functions included with {include}
25/10/2010
- bugfix for E_NOTICE change, array elements did not work as modifier parameter
20/10/2010
- bugfix for the E_NOTICE change
19/10/2010
- change Smarty does no longer mask out E_NOTICE by default during template processing
13/10/2010
- bugfix removed ambiguity between ternary and stream variable in template syntax
- bugfix use caching properties of template instead of smarty object when compiling child {block}
- bugfix {*block}...{/block*} did throw an exception in template inheritance
- bugfix on template inheritance using nested eval or string resource in {extends} tags
- bugfix on output buffer handling in isCached() method
## RC4 -
01/10/2010
- added {break} and {continue} tags for flow control of {foreach},{section},{for} and {while} loops
- change of 'string' resource. It's no longer evaluated and compiled files are now stored
- new 'eval' resource which evaluates a template without saving the compiled file
- change in isCached() method to allow multiple calls for the same template
25/09/2010
- bugfix on some compiling modifiers
24/09/2010
- bugfix merge_compiled_includes flag was not restored correctly in {block} tag
22/09/2010
- bugfix on default modifier
18/09/2010
- bugfix untility compileAllConfig() did not create sha1 code for compiled template file names if template_dir was defined with no trailing DS
- bugfix on templateExists() for extends resource
17/09/2010
- bugfix {$smarty.template} and {$smarty.current_dir} did not compile correctly within {block} tags
- bugfix corrected error message on missing template files in extends resource
- bugfix untility compileAllTemplates() did not create sha1 code for compiled template file names if template_dir was defined with no trailing DS
16/09/2010
- bugfix when a doublequoted modifier parameter did contain Smarty tags and ':'
15/09/2010
- bugfix resolving conflict between '<%'/'%>' as custom Smarty delimiter and ASP tags
- use ucfirst for resource name on internal resource class names
12/09/2010
- bugfix for change of 08/09/2010 (final {block} tags in subtemplates did not produce correct results)
10/09/2010
- bugfix for change of 08/09/2010 (final {block} tags in subtemplates did not produce correct results)
08/09/2010
- allow multiple template inheritance branches starting in subtemplates
07/09/2010
- bugfix {counter} and {cycle} plugin assigned result to smarty variable not in local(template) scope
- bugfix templates containing just {strip} {/strip} tags did produce an error
23/08/2010
- fixed E_STRICT errors for uninitialized variables
22/08/2010
- added attribute cache_id to {include} tag
13/08/2010
- remove exception_handler property from Smarty class
- added Smarty's own exceptions SmartyException and SmartyCompilerException
09/08/2010
- bugfix on modifier with doublequoted strings as parameter containing embedded tags
06/08/2010
- bugfix when cascading some modifier like |strip|strip_tags modifier
05/08/2010
- added plugin type modifiercompiler to produce compiled modifier code
- changed standard modifier plugins to the compiling versions whenever possible
- bugfix in nocache sections {include} must not cache the subtemplate
02/08/2010
- bugfix strip did not work correctly in conjunction with comment lines
31/07/2010
- bugfix on nocache attribute at {assign} and {append}
30/07/2010
- bugfix passing scope attributes in doublequoted strings did not work at {include} {assign} and {append}
25/07/2010
- another bugfix of change from 23/07/2010 when compiling modifier
24/07/2010
- bugfix of change from 23/07/2010 when compiling modifier
23/07/2010
- changed execution order. A variable filter does now run before modifiers on output of variables
- bugfix use always { and } as delimiter for debug.tpl
22/07/2010
- bugfix in templateExists() method
20/07/2010
- fixed handling of { strip } tag with whitespaces
15/07/2010
- bufix {$smarty.template} does include now the relative path, not just filename
## RC3 -
15/07/2010
- make the date_format modifier work also on objects of the DateTime class
- implementation of parsetrees in the parser to close security holes and remove unwanted empty line in HTML output
08/07/2010
- bugfix on assigning multidimensional arrays within templates
- corrected bugfix for truncate modifier
07/07/2010
- bugfix the truncate modifier needs to check if the string is utf-8 encoded or not
- bugfix support of script files relative to trusted_dir
06/07/2010
- create exception on recursive {extends} calls
- fixed reported line number at "unexpected closing tag " exception
- bugfix on escape:'mail' modifier
- drop exception if 'item' variable is equal 'from' variable in {foreach} tag
01/07/2010
- removed call_user_func_array calls for optimization of compiled code when using registered modifiers and plugins
25/06/2010
- bugfix escaping " when block tags are used within doublequoted strings
24/06/2010
- replace internal get_time() calls with standard PHP5 microtime(true) calls in Smarty_Internal_Utility
- added $smarty->register->templateClass() and $smarty->unregister->templateClass() methods for supporting static classes with namespace
22/06/2010
- allow spaces between typecast and value in template syntax
- bugfix get correct count of traversables in {foreach} tag
21/06/2010
- removed use of PHP shortags SMARTY_PHP_PASSTHRU mode
- improved speed of cache->clear() when a compile_id was specified and use_sub_dirs is true
20/06/2010
- replace internal get_time() calls with standard PHP5 microtime(true) calls
- closed security hole when php.ini asp_tags = on
18/06/2010
- added __toString method to the Smarty_Variable class
14/06/2010
- make handling of Smarty comments followed by newline BC to Smarty2
## RC2 -
13/06/2010
- bugfix Smarty3 did not handle hexadecimals like 0x0F as numerical value
- bugifx Smarty3 did not accept numerical constants like .1 or 2. (without a leading or trailing digit)
11/06/2010
- bugfix the lexer did fail on larger {literal} ... {/literal} sections
03/06/2010
- bugfix on calling template functions like Smarty tags
01/06/2010
- bugfix on template functions used with template inheritance
- removed /* vim: set expandtab: */ comments
- bugfix of auto literal problem introduce with fix of 31/05/2010
31/05/2010
- bugfix the parser did not allow some smarty variables with special name like $for, $if, $else and others.
27/05/2010
- bugfix on object chaining using variable properties
- make scope of {counter} and {cycle} tags again global as in Smarty2
26/05/2010
- bugfix removed decrepated register_resource call in smarty_internal_template.php
25/05/2010
- rewrite of template function handling to improve speed
- bugfix on file dependency when merge_compiled_includes = true
16/05/2010
- bugfix when passing parameter with numeric name like {foo 1='bar' 2='blar'}
14/05/2010
- bugfix compile new config files if compile_check and force_compile = false
- added variable static classes names to template syntax
11/05/2010
- bugfix make sure that the cache resource is loaded in all conditions when template methods getCached... are called externally
- reverted the change 0f 30/04/2010. With the exception of forward references template functions can be again called by a standard tag.
10/05/2010
- bugfix on {foreach} and {for} optimizations of 27/04/2010
09/05/2010
- update of template and config file parser because of minor parser generator bugs
07/05/2010
- bugfix on {insert}
06/05/2010
- bugfix when merging compiled templates and objects are passed as parameter of the {include} tag
05/05/2010
- bugfix on {insert} to cache parameter
- implementation of $smarty->default_modifiers as in Smarty2
- bugfix on getTemplateVars method
01/05/2010
- bugfix on handling of variable method names at object chaning
30/04/2010
- bugfix when comparing timestamps in sysplugins/smarty_internal_config.php
- work around of a substr_compare bug in older PHP5 versions
- bugfix on template inheritance for tag names starting with "block"
- bugfix on {function} tag with name attribute in doublequoted strings
- fix to make calling of template functions unambiguously by madatory usage of the {call} tag
## RC1 -
27/04/2010
- change default of $debugging_ctrl to 'NONE'
- optimization of compiled code of {foreach} and {for} loops
- change of compiler for config variables
27/04/2010
- bugfix in $smarty->cache->clear() method. (do not cache template object)
17/04/2010
- security fix in {math} plugin
12/04/2010
- bugfix in smarty_internal_templatecompilerbase (overloaded property)
- removed parser restrictions in using true,false and null as ID
07/04/2010
- bugfix typo in smarty_internal_templatecompilerbase
31/03/2010
- compile locking by touching old compiled files to avoid concurrent compilations
29/03/2010
- bugfix allow array definitions as modifier parameter
- bugfix observe compile_check property when loading config files
- added the template object as third filter parameter
25/03/2010
- change of utility->compileAllTemplates() log messages
- bugfix on nocache code in {function} tags
- new method utility->compileAllConfig() to compile all config files
24/03/2010
- bugfix on register->modifier() error messages
23/03/2010
- bugfix on template inheritance when calling multiple child/parent relations
- bugfix on caching mode SMARTY_CACHING_LIFETIME_SAVED and cache_lifetime = 0
22/03/2010
- bugfix make directory separator operating system independend in compileAllTemplates()
21/03/2010
- removed unused code in compileAllTemplates()
19/03/2010
- bugfix for multiple {/block} tags on same line
17/03/2010
- bugfix make $smarty->cache->clear() function independent from caching status
16/03/2010
- bugfix on assign attribute at registered template objects
- make handling of modifiers on expression BC to Smarty2
15/03/2010
- bugfix on block plugin calls
11/03/2010
- changed parsing of <?php and ?> back to Smarty2 behaviour
08/03/2010
- bugfix on uninitialized properties in smarty_internal_template
- bugfix on $smarty->disableSecurity()
04/03/2010
- bugfix allow uppercase chars in registered resource names
- bugfix on accessing chained objects of static classes
01/03/2010
- bugfix on nocache code in {block} tags if child template was included by {include}
27/02/2010
- allow block tags inside double quoted string
26/02/2010
- cache modified check implemented
- support of access to a class constant from an object (since PHP 5.3)
24/02/2010
- bugfix on expressions in doublequoted string enclosed in backticks
- added security property $static_classes for static class security
18/02/2010
- bugfix on parsing Smarty tags inside <?xml ... ?>
- bugfix on truncate modifier
17/02/2010
- removed restriction that modifiers did require surrounding parenthesis in some cases
- added {$smarty.block.child} special variable for template inheritance
16/02/2010
- bugfix on <?xml ... ?> tags for all php_handling modes
- bugfix on parameter of variablefilter.htmlspecialchars.php plugin
14/02/2010
- added missing _plugins property in smarty.class.php
- bugfix $smarty.const... inside doublequoted strings and backticks was compiled into wrong PHP code
12/02/2010
- bugfix on nested {block} tags
- changed Smarty special variable $smarty.parent to $smarty.block.parent
- added support of nested {bock} tags
10/02/2010
- avoid possible notice on $smarty->cache->clear(...), $smarty->clear_cache(....)
- allow Smarty tags inside <? ... ?> tags in SMARTY_PHP_QUOTE and SMARTY_PHP_PASSTHRU mode
- bugfix at new "for" syntax like {for $x=1 to 10 step 2}
09/02/2010
- added $smarty->_tag_stack for tracing block tag hierarchy
08/02/2010
- bugfix use template fullpath at §smarty->cache->clear(...), $smarty->clear_cache(....)
- bugfix of cache filename on extended templates when force_compile=true
07/02/2010
- bugfix on changes of 05/02/2010
- preserve line endings type form template source
- API changes (see README file)
05/02/2010
- bugfix on modifier and block plugins with same name
02/02/2010
- retaining newlines at registered functions and function plugins
01/25/2010
- bugfix cache resource was not loaded when caching was globally off but enabled at a template object
- added test that $_SERVER['SCRIPT_NAME'] does exist in Smarty.class.php
01/22/2010
- new method $smarty->createData([$parent]) for creating a data object (required for bugfixes below)
- bugfix config_load() method now works also on a data object
- bugfix get_config_vars() method now works also on a data and template objects
- bugfix clear_config() method now works also on a data and template objects
01/19/2010
- bugfix on plugins if same plugin was called from a nocache section first and later from a cached section
###beta 7###
01/17/2010
- bugfix on $smarty.const... in double quoted strings
01/16/2010
- internal change of config file lexer/parser on handling of section names
- bugfix on registered objects (format parameter of register_object was not handled correctly)
01/14/2010
- bugfix on backslash within single quoted strings
- bugfix allow absolute filepath for config files
- bugfix on special Smarty variable $smarty.cookies
- revert handling of newline on no output tags like {if...}
- allow special characters in config file section names for Smarty2 BC
01/13/2010
- bugfix on {if} tags
01/12/2010
- changed back modifier handling in parser. Some restrictions still apply:
if modifiers are used in side {if...} expression or in mathematical expressions
parentheses must be used.
- bugfix the {function..} tag did not accept the name attribute in double quotes
- closed possible security hole at <?php ... ?> tags
- bugfix of config file parser on large config files
###beta 6####
01/11/2010
- added \n to the compiled code of the {if},{else},{elseif},{/if} tags to get output of newlines as expected by the template source
- added missing support of insert plugins
- added optional nocache attribute to {block} tags in parent template
- updated <?php...?> handling supporting now heredocs and newdocs. (thanks to Thue Jnaus Kristensen)
01/09/2010
- bugfix on nocache {block} tags in parent templates
01/08/2010
- bugfix on variable filters. filter/nofilter attributes did not work on output statements
01/07/2010
- bugfix on file dependency at template inheritance
- bugfix on nocache code at template inheritance
01/06/2010
- fixed typo in smarty_internal_resource_registered
- bugfix for custom delimiter at extends resource and {extends} tag
01/05/2010
- bugfix sha1() calculations at extends resource and some general improvments on sha1() handling
01/03/2010
- internal change on building cache files
01/02/2010
- update cached_timestamp at the template object after cache file is written to avoid possible side effects
- use internally always SMARTY_CACHING_LIFETIME_* constants
01/01/2010
- bugfix for obtaining plugins which must be included (related to change of 12/30/2009)
- bugfix for {php} tag (trow an exception if allow_php_tag = false)
12/31/2009
- optimization of generated code for doublequoted strings containing variables
- rewrite of {function} tag handling
- can now be declared in an external subtemplate
- can contain nocache sections (nocache_hash handling)
- can be called in noccache sections (nocache_hash handling)
- new {call..} tag to call template functions with a variable name {call name=$foo}
- fixed nocache_hash handling in merged compiled templates
12/30/2009
- bugfix for plugins defined in the script as smarty_function_foo
12/29/2009
- use sha1() for filepath encoding
- updates on nocache_hash handling
- internal change on merging some data
- fixed cache filename for custom resources
12/28/2009
- update for security fixes
- make modifier plugins always trusted
- fixed bug loading modifiers in child template at template inheritance
12/27/2009
--- this is a major update with a couple of internal changes ---
- new config file lexer/parser (thanks to Thue Jnaus Kristensen)
- template lexer/parser fixes for PHP and {literal} handing (thanks to Thue Jnaus Kristensen)
- fix on registered plugins with different type but same name
- rewrite of plugin handling (optimized execution speed)
- closed a security hole regarding PHP code injection into cache files
- fixed bug in clear cache handling
- Renamed a couple of internal classes
- code cleanup for merging compiled templates
- couple of runtime optimizations (still not all done)
- update of getCachedTimestamp()
- fixed bug on modifier plugins at nocache output
12/19/2009
- bugfix on comment lines in config files
12/17/2009
- bugfix of parent/global variable update at included/merged subtemplates
- encode final template filepath into filename of compiled and cached files
- fixed {strip} handling in auto literals
12/16/2009
- update of changelog
- added {include file='foo.tpl' inline} inline option to merge compiled code of subtemplate into the calling template
12/14/2009
- fixed sideefect of last modification (objects in array index did not work anymore)
12/13/2009
- allow boolean negation ("!") as operator on variables outside {if} tag
12/12/2009
- bugfix on single quotes inside {function} tag
- fix short append/prepend attributes in {block} tags
12/11/2009
- bugfix on clear_compiled_tpl (avoid possible warning)
12/10/2009
- bugfix on {function} tags and template inheritance
12/05/2009
- fixed problem when a cached file was fetched several times
- removed unneeded lexer code
12/04/2009
- added max attribute to for loop
- added security mode allow_super_globals
12/03/2009
- template inheritance: child templates can now call functions defined by the {function} tag in the parent template
- added {for $foo = 1 to 5 step 2} syntax
- bugfix for {$foo.$x.$y.$z}
12/01/2009
- fixed parsing of names of special formated tags like if,elseif,while,for,foreach
- removed direct access to constants in templates because of some syntax problems
- removed cache resource plugin for mysql from the distribution
- replaced most hard errors (exceptions) by softerrors(trigger_error) in plugins
- use $template_class property for template class name when compiling {include},{eval} and {extends} tags
11/30/2009
- map 'true' to SMARTY_CACHING_LIFETIME_CURRENT for the $smarty->caching parameter
- allow {function} tags within {block} tags
11/28/2009
- ignore compile_id at debug template
- added direct access to constants in templates
- some lexer/parser optimizations
11/27/2009
- added cache resource MYSQL plugin
11/26/2009
- bugfix on nested doublequoted strings
- correct line number on unknown tag error message
- changed {include} compiled code
- fix on checking dynamic varibales with error_unassigned = true
11/25/2009
- allow the following writing for boolean: true, TRUE, True, false, FALSE, False
- {strip} tag functionality rewritten
11/24/2009
- bugfix for $smarty->config_overwrite = false
11/23/2009
- suppress warnings on unlink caused by race conditions
- correct line number on unknown tag error message
------- beta 5
11/23/2009
- fixed configfile parser for text starting with a numeric char
- the default_template_handler_func may now return a filepath to a template source
11/20/2009
- bugfix for empty config files
- convert timestamps of registered resources to integer
11/19/2009
- compiled templates are no longer touched with the filemtime of template source
11/18/2009
- allow integer as attribute name in plugin calls
------- beta 4
11/18/2009
- observe umask settings when setting file permissions
- avoide unneeded cache file creation for subtemplates which did occur in some situations
- make $smarty->_current_file available during compilation for Smarty2 BC
11/17/2009
- sanitize compile_id and cache_id (replace illegal chars with _)
- use _dir_perms and _file_perms properties at file creation
- new constant SMARTY_RESOURCE_DATE_FORMAT (default '%b %e, %Y') which is used as default format in modifier date_format
- added {foreach $array as $key=>$value} syntax
- renamed extend tag and resource to extends: {extends file='foo.tol'} , $smarty->display('extends:foo.tpl|bar.tpl);
- bugfix cycle plugin
11/15/2009
- lexer/parser optimizations on quoted strings
11/14/2009
- bugfix on merging compiled templates when source files got removed or renamed.
- bugfix modifiers on registered object tags
- fixed locaion where outputfilters are running
- fixed config file definitions at EOF
- fix on merging compiled templates with nocache sections in nocache includes
- parser could run into a PHP error on wrong file attribute
11/12/2009
- fixed variable filenames in {include_php} and {insert}
- added scope to Smarty variables in the {block} tag compiler
- fix on nocache code in child {block} tags
11/11/2009
- fixed {foreachelse}, {forelse}, {sectionelse} compiled code at nocache variables
- removed checking for reserved variables
- changed debugging handling
11/10/2009
- fixed preg_qoute on delimiters
11/09/2009
- lexer/parser bugfix
- new SMARTY_SPL_AUTOLOAD constant to control the autoloader option
- bugfix for {function} block tags in included templates
11/08/2009
- fixed alphanumeric array index
- bugfix on complex double quoted strings
11/05/2009
- config_load method can now be called on data and template objects
11/04/2009
- added typecasting support for template variables
- bugfix on complex indexed special Smarty variables
11/03/2009
- fixed parser error on objects with special smarty vars
- fixed file dependency for {incude} inside {block} tag
- fixed not compiling on non existing compiled templates when compile_check = false
- renamed function names of autoloaded Smarty methods to Smarty_Method_....
- new security_class property (default is Smarty_Security)
11/02/2009
- added neq,lte,gte,mod as aliases to if conditions
- throw exception on illegal Smarty() constructor calls
10/31/2009
- change of filenames in sysplugins folder for internal spl_autoload function
- lexer/parser changed for increased compilation speed
10/27/2009
- fixed missing quotes in include_php.php
10/27/2009
- fixed typo in method.register_resource
- pass {} through as literal
10/26/2009
- merge only compiled subtemplates into the compiled code of the main template
10/24/2009
- fixed nocache vars at internal block tags
- fixed merging of recursive includes
10/23/2009
- fixed nocache var problem
10/22/2009
- fix trimwhitespace outputfilter parameter
10/21/2009
- added {$foo++}{$foo--} syntax
- buxfix changed PHP "if (..):" to "if (..){" because of possible bad code when concenating PHP tags
- autoload Smarty internal classes
- fixed file dependency for config files
- some code optimizations
- fixed function definitions on some autoloaded methods
- fixed nocache variable inside if condition of {if} tag
10/20/2009
- check at compile time for variable filter to improve rendering speed if no filter is used
- fixed bug at combination of {elseif} tag and {...} in double quoted strings of static class parameter
10/19/2009
- fixed compiled template merging on variable double quoted strings as name
- fixed bug in caching mode 2 and cache_lifetime -1
- fixed modifier support on block tags
10/17/2009
- remove ?>\n<?php and ?><?php sequences from compiled template
10/15/2009
- buxfix on assigning array elements inside templates
- parser bugfix on array access
10/15/2009
- allow bit operator '&' inside {if} tag
- implementation of ternary operator
10/13/2009
- do not recompile evaluated templates if reused just with other data
- recompile config files when config properties did change
- some lexer/parser otimizations
10/11/2009
- allow {block} tags inside included templates
- bugfix for resource plugins in Smarty2 format
- some optimizations of internal.template.php
10/11/2009
- fixed bug when template with same name is used with different data objects
- fixed bug with double quoted name attribute at {insert} tag
- reenabled assign_by_ref and append_by_ref methods
10/07/2009
- removed block nesting checks for {capture}
10/05/2009
- added support of "isinstance" to {if} tag
10/03/2009
- internal changes to improve performance
- fix registering of filters for classes
10/01/2009
- removed default timezone setting
- reactivated PHP resource for simple PHP templates. Must set allow_php_templates = true to enable
- {PHP} tag can be enabled by allow_php_tag = true
09/30/2009
- fixed handling template_exits method for all resource types
- bugfix for other cache resources than file
- the methods assign_by_ref is now wrapped to assign, append_by_ref to append
- allow arrays of variables pass in display, fetch and createTemplate calls
$data = array('foo'=>'bar','foo2'=>'blar');
$smarty->display('my.tpl',$data);
09/29/2009
- changed {php} tag handling
- removed support of Smarty::instance()
- removed support of PHP resource type
- improved execution speed of {foreach} tags
- fixed bug in {section} tag
09/23/2009
- improvements and bugfix on {include} tag handling
NOTICE: existing compiled template and cache files must be deleted
09/19/2009
- replace internal "eval()" calls by "include" during rendering process
- speed improvment for templates which have included subtemplates
the compiled code of included templates is merged into the compiled code of the parent template
- added logical operator "xor" for {if} tag
- changed parameter ordering for Smarty2 BC
fetch($template, $cache_id = null, $compile_id = null, $parent = null)
display($template, $cache_id = null, $compile_id = null, $parent = null)
createTemplate($template, $cache_id = null, $compile_id = null, $parent = null)
- property resource_char_set is now replaced by constant SMARTY_RESOURCE_CHAR_SET
- fixed handling of classes in registered blocks
- speed improvement of lexer on text sections
09/01/2009
- dropped nl2br as plugin
- added '<>' as comparission operator in {if} tags
- cached caching_lifetime property to cache_liftime for backward compatibility with Smarty2.
{include} optional attribute is also now cache_lifetime
- fixed trigger_error method (moved into Smarty class)
- version is now Beta!!!
08/30/2009
- some speed optimizations on loading internal plugins
08/29/2009
- implemented caching of registered Resources
- new property 'auto_literal'. if true(default) '{ ' and ' }' interpreted as literal, not as Smarty delimiter
08/28/2009
- Fix on line breaks inside {if} tags
08/26/2009
- implemented registered resources as in Smarty2. NOTE: caching does not work yet
- new property 'force_cache'. if true it forces the creation of a new cache file
- fixed modifiers on arrays
- some speed optimization on loading internal classes
08/24/2009
- fixed typo in lexer definition for '!==' operator
- bugfix - the ouput of plugins was not cached
- added global variable SCRIPT_NAME
08/21/2009
- fixed problems whitespace in conjuction with custom delimiters
- Smarty tags can now be used as value anywhere
08/18/2009
- definition of template class name moded in internal.templatebase.php
- whitespace parser changes
08/12/2009
- fixed parser problems
08/11/2009
- fixed parser problems with custom delimiter
08/10/2009
- update of mb support in plugins
08/09/2009
- fixed problems with doublequoted strings at name attribute of {block} tag
- bugfix at scope attribute of {append} tag
08/08/2009
- removed all internal calls of Smarty::instance()
- fixed code in double quoted strings
08/05/2009
- bugfix mb_string support
- bugfix of \n.\t etc in double quoted strings
07/29/2009
- added syntax for variable config vars like #$foo#
07/28/2009
- fixed parsing of $smarty.session vars containing objects
07/22/2009
- fix of "$" handling in double quoted strings
07/21/2009
- fix that {$smarty.current_dir} return correct value within {block} tags.
07/20/2009
- drop error message on unmatched {block} {/block} pairs
07/01/2009
- fixed smarty_function_html_options call in plugin function.html_select_date.php (missing ,)
06/24/2009
- fixed smarty_function_html_options call in plugin function.html_select_date.php
06/22/2009
- fix on \n and spaces inside smarty tags
- removed request_use_auto_globals propert as it is no longer needed because Smarty 3 will always run under PHP 5
06/18/2009
- fixed compilation of block plugins when caching enabled
- added $smarty.current_dir which returns the current working directory
06/14/2009
- fixed array access on super globals
- allow smarty tags within xml tags
06/13/2009
- bugfix at extend resource: create unique files for compiled template and cache for each combination of template files
- update extend resource to handle appen and prepend block attributes
- instantiate classes of plugins instead of calling them static
06/03/2009
- fixed repeat at block plugins
05/25/2009
- fixed problem with caching of compiler plugins
05/14/2009
- fixed directory separator handling
05/09/2009
- syntax change for stream variables
- fixed bug when using absolute template filepath and caching
05/08/2009
- fixed bug of {nocache} tag in included templates
05/06/2009
- allow that plugins_dir folder names can end without directory separator
05/05/2009
- fixed E_STRICT incompabilities
- {function} tag bug fix
- security policy definitions have been moved from plugins folder to file Security.class.php in libs folder
- added allow_super_global configuration to security
04/30/2009
- functions defined with the {function} tag now always have global scope
04/29/2009
- fixed problem with directory setter methods
- allow that cache_dir can end without directory separator
04/28/2009
- the {function} tag can no longer overwrite standard smarty tags
- inherit functions defined by the {fuction} tag into subtemplates
- added {while <statement>} sytax to while tag
04/26/2009
- added trusted stream checking to security
- internal changes at file dependency check for caching
04/24/2009
- changed name of {template} tag to {function}
- added new {template} tag
04/23/2009
- fixed access of special smarty variables from included template
04/22/2009
- unified template stream syntax with standard Smarty resource syntax $smarty->display('mystream:mytemplate')
04/21/2009
- change of new style syntax for forach. Now: {foreach $array as $var} like in PHP
04/20/2009
- fixed "$foo.bar ..." variable replacement in double quoted strings
- fixed error in {include} tag with variable file attribute
04/18/2009
- added stream resources ($smarty->display('mystream://mytemplate'))
- added stream variables {$mystream:myvar}
04/14/2009
- fixed compile_id handling on {include} tags
- fixed append/prepend attributes in {block} tag
- added {if 'expression' is in 'array'} syntax
- use crc32 as hash for compiled config files.
04/13/2009
- fixed scope problem with parent variables when appending variables within templates.
- fixed code for {block} without childs (possible sources for notice errors removed)
04/12/2009
- added append and prepend attribute to {block} tag
04/11/2009
- fixed variables in 'file' attribute of {extend} tag
- fixed problems in modifiers (if mb string functions not present)
04/10/2009
- check if mb string functions available otherwise fallback to normal string functions
- added global variable scope SMARTY_GLOBAL_SCOPE
- enable 'variable' filter by default
- fixed {$smarty.block.parent.foo}
- implementation of a 'variable' filter as replacement for default modifier
04/09/2009
- fixed execution of filters defined by classes
- compile the always the content of {block} tags to make shure that the filters are running over it
- syntax corrections on variable object property
- syntax corrections on array access in dot syntax
04/08/2009
- allow variable object property
04/07/2009
- changed variable scopes to SMARTY_LOCAL_SCOPE, SMARTY_PARENT_SCOPE, SMARTY_ROOT_SCOPE to avoid possible conflicts with user constants
- Smarty variable global attribute replaced with scope attribute
04/06/2009
- variable scopes LOCAL_SCOPE, PARENT_SCOPE, ROOT_SCOPE
- more getter/setter methods
04/05/2009
- replaced new array looping syntax {for $foo in $array} with {foreach $foo in $array} to avoid confusion
- added append array for short form of assign {$foo[]='bar'} and allow assignments to nested arrays {$foo['bla']['blue']='bar'}
04/04/2009
- make output of template default handlers cachable and save compiled source
- some fixes on yesterdays update
04/03/2006
- added registerDefaultTemplateHandler method and functionallity
- added registerDefaultPluginHandler method and functionallity
- added {append} tag to extend Smarty array variabled
04/02/2009
- added setter/getter methods
- added $foo@first and $foo@last properties at {for} tag
- added $set_timezone (true/false) property to setup optionally the default time zone
03/31/2009
- bugfix smarty.class and internal.security_handler
- added compile_check configuration
- added setter/getter methods
03/30/2009
- added all major setter/getter methods
03/28/2009
- {block} tags can be nested now
- md5 hash function replace with crc32 for speed optimization
- file order for exted resource inverted
- clear_compiled_tpl and clear_cache_all will not touch .svn folder any longer
03/27/2009
- added extend resource
03/26/2009
- fixed parser not to create error on `word` in double quoted strings
- allow PHP array(...)
- implemented $smarty.block.name.parent to access parent block content
- fixed smarty.class
03/23/2009
- fixed {foreachelse} and {forelse} tags
03/22/2009
- fixed possible sources for notice errors
- rearrange SVN into distribution and development folders
03/21/2009
- fixed exceptions in function plugins
- fixed notice error in Smarty.class.php
- allow chained objects to span multiple lines
- fixed error in modifiers
03/20/2009
- moved /plugins folder into /libs folder
- added noprint modifier
- autoappend a directory separator if the xxxxx_dir definition have no trailing one
03/19/2009
- allow array definition as modifier parameter
- changed modifier to use multi byte string funktions.
03/17/2009
- bugfix
03/15/2009
- added {include_php} tag for BC
- removed @ error suppression
- bugfix fetch did always repeat output of first call when calling same template several times
- PHPunit tests extended
03/13/2009
- changed block syntax to be Smarty like {block:titel} -> {block name=titel}
- compiling of {block} and {extend} tags rewriten for better performance
- added special Smarty variable block ($smarty.block.foo} returns the parent definition of block foo
- optimization of {block} tag compiled code.
- fixed problem with escaped double quotes in double quoted strings
03/12/2009
- added support of template inheritance by {extend } and {block } tags.
- bugfix comments within literals
- added scope attribuie to {include} tag
03/10/2009
- couple of bugfixes and improvements
- PHPunit tests extended
03/09/2009
- added support for global template vars. {assign_global...} $smarty->assign_global(...)
- added direct_access_security
- PHPunit tests extended
- added missing {if} tag conditions like "is div by" etc.
03/08/2009
- splitted up the Compiler class to make it easier to use a coustom compiler
- made default plugins_dir relative to Smarty root and not current working directory
- some changes to make the lexer parser better configurable
- implemented {section} tag for Smarty2 BC
03/07/2009
- fixed problem with comment tags
- fixed problem with #xxxx in double quoted string
- new {while} tag implemented
- made lexer and paser class configurable as $smarty property
- Smarty method get_template_vars implemented
- Smarty method get_registered_object implemented
- Smarty method trigger_error implemented
- PHPunit tests extended
03/06/2009
- final changes on config variable handling
- parser change - unquoted strings will by be converted into single quoted strings
- PHPunit tests extended
- some code cleanup
- fixed problem on catenate strings with expression
- update of count_words modifier
- bugfix on comment tags
03/05/2009
- bugfix on <?xml...> tag with caching enabled
- changes on exception handling (by Monte)
03/04/2009
- added support for config variables
- bugfix on <?xml...> tag
03/02/2009
- fixed unqouted strings within modifier parameter
- bugfix parsing of mofifier parameter
03/01/2009
- modifier chaining works now as in Smarty2
02/28/2009
- changed handling of unqouted strings
02/26/2009
- bugfix
- changed $smarty.capture.foo to be global for Smarty2 BC.
02/24/2009
- bugfix {php} {/php} tags for backward compatibility
- bugfix for expressions on arrays
- fixed usage of "null" value
- added $smarty.foreach.foo.first and $smarty.foreach.foo.last
02/06/2009
- bugfix for request variables without index for example $smarty.get
- experimental solution for variable functions in static class
02/05/2009
- update of popup plugin
- added config variables to template parser (load config functions still missing)
- parser bugfix for empty quoted strings
02/03/2009
- allow array of objects as static class variabales.
- use htmlentities at source output at template errors.
02/02/2009
- changed search order on modifiers to look at plugins folder first
- parser bug fix for modifier on array elements $foo.bar|modifier
- parser bug fix on single quoted srings
- internal: splitted up compiler plugin files
02/01/2009
- allow method chaining on static classes
- special Smarty variables $smarty.... implemented
- added {PHP} {/PHP} tags for backward compatibility
01/31/2009
- added {math} plugin for Smarty2 BC
- added template_exists method
- changed Smarty3 method enable_security() to enableSecurity() to follow camelCase standards
01/30/2009
- bugfix in single quoted strings
- changed syntax for variable property access from $foo:property to $foo@property because of ambiguous syntax at modifiers
01/29/2009
- syntax for array definition changed from (1,2,3) to [1,2,3] to remove ambiguous syntax
- allow {for $foo in [1,2,3]} syntax
- bugfix in double quoted strings
- allow <?xml...?> tags in template even if short_tags are enabled
01/28/2009
- fixed '!==' if condition.
01/28/2009
- added support of {strip} {/strip} tag.
01/27/2009
- bug fix on backticks in double quoted strings at objects
01/25/2009
- Smarty2 modfiers added to SVN
01/25/2009
- bugfix allow arrays at object properties in Smarty syntax
- the template object is now passed as additional parameter at plugin calls
- clear_compiled_tpl method completed
01/20/2009
- access to class constants implemented ( class::CONSTANT )
- access to static class variables implemented ( class::$variable )
- call of static class methods implemented ( class::method() )
01/16/2009
- reallow leading _ in variable names {$_var}
- allow array of objects {$array.index->method()} syntax
- finished work on clear_cache and clear_cache_all methods
01/11/2009
- added support of {literal} tag
- added support of {ldelim} and {rdelim} tags
- make code compatible to run with E_STRICT error setting
01/08/2009
- moved clear_assign and clear_all_assign to internal.templatebase.php
- added assign_by_ref, append and append_by_ref methods
01/02/2009
- added load_filter method
- fished work on filter handling
- optimization of plugin loading
12/30/2008
- added compiler support of registered object
- added backtick support in doubled quoted strings for backward compatibility
- some minor bug fixes and improvments
12/23/2008
- fixed problem of not working "not" operator in if-expressions
- added handling of compiler function plugins
- finished work on (un)register_compiler_function method
- finished work on (un)register_modifier method
- plugin handling from plugins folder changed for modifier plugins
deleted - internal.modifier.php
- added modifier chaining to parser
12/17/2008
- finished (un)register_function method
- finished (un)register_block method
- added security checking for PHP functions in PHP templates
- plugin handling from plugins folder rewritten
new - internal.plugin_handler.php
deleted - internal.block.php
deleted - internal.function.php
- removed plugin checking from security handler
12/16/2008
- new start of this change_log file
| 40.342489
| 200
| 0.775938
|
eng_Latn
| 0.967111
|
450b5af6925eb87d16a7cb933b4156bd99db1a33
| 6,083
|
md
|
Markdown
|
_posts/2016-08-12-Is_HR_Analytics_worth_the_investment.md
|
SeanPreusse/seanpreusse.github.io
|
570d1741c4506ad7483d55dc731285cbf620bf96
|
[
"BSD-3-Clause",
"MIT"
] | 1
|
2016-06-14T00:15:06.000Z
|
2016-06-14T00:15:06.000Z
|
_posts/2016-08-12-Is_HR_Analytics_worth_the_investment.md
|
SeanPreusse/seanpreusse.github.io
|
570d1741c4506ad7483d55dc731285cbf620bf96
|
[
"BSD-3-Clause",
"MIT"
] | null | null | null |
_posts/2016-08-12-Is_HR_Analytics_worth_the_investment.md
|
SeanPreusse/seanpreusse.github.io
|
570d1741c4506ad7483d55dc731285cbf620bf96
|
[
"BSD-3-Clause",
"MIT"
] | null | null | null |
---
title: "Is HR Analytics worth the investment?
"
header:
excerpt: "Is HR Analytics worth the investment? Many find it difficult to find the necessary resourcing or funding start tackling big HR problems with data, is there a stepping stone that you can leverage to start the journey?"
categories:
- Business-Case
tags:
- Data-Science-Tools
last_modified_at: 2016-08-12T15:11:19-04:00
---

## Is HR Analytics worth the investment?
Is HR Analytics worth the investment? I have talked to a few HR professionals from varying organisations, and many find it difficult to find the necessary resourcing or funding start tackling significant HR problems with data. This article focuses on retention as a possible business case and hopefully provides you with some ideas to address this problem in a cost-effective way, immediately.
We all know that retention of emerging leadership, high performing employees and critical roles is a no-brainer but we often do not have enough information on this group and we tend to rely on gut feeling when creating strategies to retain or throw everything at the wall to convert them from an external offer only to have lower productivity or eventual loss further down.
The cost of doing nothing can be significant, and in the millions and for many organisations people analytics is usually staffed by a part-time resource, and it can be difficult to justify the additional $100k investment to your director to increase resourcing and start answer business problems to give it a shot.
Here is a quick business case to consider, that may help get the investment needed. You are an averaged sized organisation with five thousand employees, and attrition is reasonable at 12%. Not all roles are replaced, let’s say 80% and given the below model the total cost of replacement is ~$80m. Factors for replacement cost will vary by organisation and may consider advertising, productivity, knowledge loss and time spent with key individuals involved with the process.

What if we could use people analytics to understand the key drivers of employee turnover or perhaps develop a predictive model to understand high-risk employees to allow for early intervention? This analysis and early intervention may form a part of a sprint program at the cost of 20-60k, and if we were able to prevent just 1% of unwanted/regretted turnover, the total benefit could be around $1m. Not a bad ROI, justifying the cost of the sprint program and implementation.
There are additional benefits to this, as you start to intervene on validated drivers there may be improvements in productivity, engagement, and collaboration to name a few. Not all predictor variables will apply to the attrition model and if you would like to validate these side benefits why not use this process and data model to compare these outputs directly to confirm, score and improve.
**Data and Variables to consider**
Below are some examples of the types of variables that may shed light on drivers of attrition. You will likely have this data available in some format and remember that you can beg, borrow and steal to start building your analytical data model if you need data outside of HR, i.e. business performance, workload, collaboration or work flexibility data.
What is an analytical data model? This can be as simple as a range of crucial employee metrics by employee with an outcome column (yes they left, or no they stayed). Key metrics can be built in excel with monthly snapshot data to construct key employee events.

**Analysis**
In my <a href="https://www.linkedin.com/pulse/generating-hr-insights-sean-preusse?lipi=urn%3Ali%3Apage%3Ad_flagship3_pulse_read%3Bg62HFiFERECKUKRFCzk4Kg%3D%3D" target="_blank">last article</a> I mentioned a range of free tools that you can use to generate insights. Once you have created your analytical dataset, you can use R to complete a decision tree of key variables to produce the below chart. This will highlight natural segments where employee attrition may be very high, and it will start to shed light on important drivers or where further investigation may be required.
* In the below example, we can see that Gen Y employees who have been recently on-boarded and who travel frequently are at high risk of leaving. This may indicate poor role fit for business-related travel for recent hires.
* The second highest attrition probability are employees who have been working with the organisation for over a year but have worked for more than 6 companies in their 10-year working life. The changing attitudes of work for this generation may be a vital issue for most, but if we look at the number of employees impacted, the majority '419' have a much lower probability - further investigate what makes this group different and apply learnings.
R makes decision trees easy to complete but you do need sensible variables (you should not throw 50+ variables and hope that it makes sense). Here is the code that you will need, simple right?
*library(party)
plot(ctree(Attrition ~ ., data = data), main="Employee Attrition - Decision Tree")*

As you start to get comfortable with the results of the modelling, i.e. the variables make sense, and you are beginning to identify natural segments with high probability, why not compare these results to a predictive logistic regression model - A tutorial on this can be <a href="https://seanpreusse.com/machine-learning/Predict_Employee_Turnover/">found here</a>.
With this type of model you will need to decide your level of appetite, if this is a new model you will want to start small and identify employees with a high probability of attrition and then begin to understand the highest drivers via the coefficient and then segment to understand what role and line of business they exist in to start creating interventions to improve.
| 110.6
| 580
| 0.803222
|
eng_Latn
| 0.999699
|
450b61f1bb39261c2d140f59fce99da34092e872
| 1,020
|
md
|
Markdown
|
catalog/miracle-mimika/en-US_miracle-mimika.md
|
htron-dev/baka-db
|
cb6e907a5c53113275da271631698cd3b35c9589
|
[
"MIT"
] | 3
|
2021-08-12T20:02:29.000Z
|
2021-09-05T05:03:32.000Z
|
catalog/miracle-mimika/en-US_miracle-mimika.md
|
zzhenryquezz/baka-db
|
da8f54a87191a53a7fca54b0775b3c00f99d2531
|
[
"MIT"
] | 8
|
2021-07-20T00:44:48.000Z
|
2021-09-22T18:44:04.000Z
|
catalog/miracle-mimika/en-US_miracle-mimika.md
|
zzhenryquezz/baka-db
|
da8f54a87191a53a7fca54b0775b3c00f99d2531
|
[
"MIT"
] | 2
|
2021-07-19T01:38:25.000Z
|
2021-07-29T08:10:29.000Z
|
# Miracle! Mimika

- **type**: tv-serie
- **episodes**: 225
- **original-name**: 味楽る!ミミカ
- **start-date**: 2006-04-03
- **end-date**: 2006-04-03
- **opening-song**: "Miracle! Mimika Number One (味楽る! ミミカ ナンバーワン)" by Mayuko Omimura
- **ending-song**: "Koi no chewing (恋のチューイング)" by Watarirouka Hashiritai 7 (AKB48 sub-unit)
- **rating**: G - All Ages
## Tags
- slice-of-life
## Sinopse
Himeno Mimika is a daughter of historical cook family. She goes to a cooking school, Miracle Academy which train cooks all over the world. Vying with rivals, she brings out her gift, and she grows up as a cook.
(Source: AnimeNfo)
## Links
- [My Anime list](https://myanimelist.net/anime/5374/Miracle_Mimika)
- [Official Site](http://www.nhk.or.jp/kids/program/mimika.html)
- [AnimeDB](http://anidb.info/perl-bin/animedb.pl?show=anime&aid=4380)
- [AnimeNewsNetwork](http://www.animenewsnetwork.com/encyclopedia/anime.php?id=11132)
| 34
| 210
| 0.694118
|
eng_Latn
| 0.297061
|
450c1173da310ecc3c951d18dc9f1132c53c426c
| 67
|
md
|
Markdown
|
node/file-system/2-fs-callbacks/exercises-refactor/README.md
|
bermarte/asynchronous-programming
|
decce2b44943e684ff36d43c756435f051b55e87
|
[
"MIT"
] | 6
|
2020-09-19T16:23:45.000Z
|
2022-03-26T14:00:33.000Z
|
node/file-system/2-fs-callbacks/exercises-refactor/README.md
|
bermarte/asynchronous-programming
|
decce2b44943e684ff36d43c756435f051b55e87
|
[
"MIT"
] | 16
|
2020-04-20T14:48:42.000Z
|
2022-03-06T15:06:38.000Z
|
node/file-system/2-fs-callbacks/exercises-refactor/README.md
|
bermarte/asynchronous-programming
|
decce2b44943e684ff36d43c756435f051b55e87
|
[
"MIT"
] | 90
|
2020-04-10T13:56:12.000Z
|
2022-03-30T19:12:25.000Z
|
the files with synchronous fs work. refactor them to use callbacks
| 33.5
| 66
| 0.820896
|
eng_Latn
| 0.999723
|