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
e5df9ead9c9698021df688b50714a6dfea54a056
52
md
Markdown
README.md
bwire98/Web-Dev-Project
6a46a9aac935a8606cb1e48673c07daa0bf579f8
[ "MIT" ]
null
null
null
README.md
bwire98/Web-Dev-Project
6a46a9aac935a8606cb1e48673c07daa0bf579f8
[ "MIT" ]
null
null
null
README.md
bwire98/Web-Dev-Project
6a46a9aac935a8606cb1e48673c07daa0bf579f8
[ "MIT" ]
null
null
null
# Web-Dev-Project Revamping a terribly made website
17.333333
33
0.807692
eng_Latn
0.974295
e5e0541fb88645fc62caf2fac204615865825872
3,131
markdown
Markdown
_posts/cg/2016-02-29-cubetexture.markdown
zspark/JekyllBlog
85b361e9b1046949c2c057f21c941a97ef3743b3
[ "MIT" ]
1
2015-12-16T08:24:50.000Z
2015-12-16T08:24:50.000Z
_posts/cg/2016-02-29-cubetexture.markdown
zspark/JekyllBlog
85b361e9b1046949c2c057f21c941a97ef3743b3
[ "MIT" ]
null
null
null
_posts/cg/2016-02-29-cubetexture.markdown
zspark/JekyllBlog
85b361e9b1046949c2c057f21c941a97ef3743b3
[ "MIT" ]
null
null
null
--- layout: post_with_wisdom title: "OpenGL立方体纹理备忘" date: 2016-02-29 category: CG published: true excerpt: "" wisdom: “倘若代码和注释不一致,那么很可能两者都是错的。” —— Norm Schryer meta: subImgPath: cg\ author: tags: [texture, cubeTexture] --- 尝试给立方体贴纹理,这里小做笔记: {% highlight c++ linenos%} //激活指定纹理单元;不写的话默认激活0号纹理单元; glActiveTexture(GL_TEXTURE1); //申请显卡缓存id; GLuint id; glGenTextures(1,&id); //指定该id所指向的显存保存立方体纹理; glBindTexture(GL_TEXTURE_CUBE_MAP,id); //设置该纹理的相关参数; glTexParameteri(GL_TEXTURE_CUBE_MAP,GL_TEXTURE_WRAP_S,GL_REPEAT); glTexParameteri(GL_TEXTURE_CUBE_MAP,GL_TEXTURE_WRAP_T,GL_REPEAT); glTexParameteri(GL_TEXTURE_CUBE_MAP,GL_TEXTURE_WRAP_R,GL_REPEAT); glTexParameteri(GL_TEXTURE_CUBE_MAP,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_CUBE_MAP,GL_TEXTURE_MAG_FILTER,GL_LINEAR); //设置纹理数据; int w, h, c; unsigned char* image = stbi_load("data/textures/skybox/px.jpg", &w, &h, &c, 0); std::cout << "image size:" << w << "," << h << endl; glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL_RGB, w, h, 0, GL_RGB, GL_UNSIGNED_BYTE, image); stbi_image_free(image); image = stbi_load("data/textures/skybox/nx.jpg", &w, &h, &c, 0); std::cout << "image size:" << w << "," << h << endl; glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 0, GL_RGB, w, h, 0, GL_RGB, GL_UNSIGNED_BYTE, image); stbi_image_free(image); image = stbi_load("data/textures/skybox/py.jpg", &w, &h, &c, 0); std::cout << "image size:" << w << "," << h << endl; glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 0, GL_RGB, w, h, 0, GL_RGB, GL_UNSIGNED_BYTE, image); stbi_image_free(image); image = stbi_load("data/textures/skybox/ny.jpg", &w, &h, &c, 0); std::cout << "image size:" << w << "," << h << endl; glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, GL_RGB, w, h, 0, GL_RGB, GL_UNSIGNED_BYTE, image); stbi_image_free(image); image = stbi_load("data/textures/skybox/pz.jpg", &w, &h, &c, 0); std::cout << "image size:" << w << "," << h << endl; glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 0, GL_RGB, w, h, 0, GL_RGB, GL_UNSIGNED_BYTE, image); stbi_image_free(image); image = stbi_load("data/textures/skybox/nz.jpg", &w, &h, &c, 0); std::cout << "image size:" << w << "," << h << endl; glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, GL_RGB, w, h, 0, GL_RGB, GL_UNSIGNED_BYTE, image); stbi_image_free(image); //获取片元着色器中的立方体采样器地址; GLuint samperLocation=glGetUniformeLocation(program,"fSamperCube"); //指定该采样器从具体纹理单元采样; glUniform1i(samperLocation,1); //其他.. {%endhighlight %} 需要注意的是: 1. 立方体纹理不必设置立方体8个顶点的纹理坐标,只需要将指定的8个顶点在空间中的正常坐标(三维的),通过顶点着色器传递给片元着色器后,使用texture函数采样即可; 2. 给纹理类型填充纹理数据时不要混乱,可以熟记那个横放的十字架图(见下图),交点位置自己确定后,其他5个面顺序也就固定了; {% include image_click.html href="https://en.wikipedia.org/wiki/Cube_mapping" caption="图片来自维基百科" src="cg/image_cube_texture.jpg" align="center" width="640" %} {% highlight glsl linenos%} //顶点着色器: #version 430 in vec4 vPosition; out vec3 fTexCoord void main(){ //将立方体正常的顶点坐标传奇给片元着色器; fTexCoord=vPosition.rgb; } //片元着色器: #version 430 in vec3 fTexCoord; uniform samplerCube fSamperCube; void main(){ //立方体采样器通过texture函数正常采样; vec4 texColor = texture(fSamperCube,fTexCoord); gl_FragColor=texColor; } {% endhighlight %} ==EOF==
31.94898
158
0.736506
yue_Hant
0.43909
e5e081a8aaf2657995e87bb2308db3292c930ac8
16,528
md
Markdown
billingservice/New API definition.md
justinchen00/pagetest
ab39cec90e8595d45488fa184474ef540e88cdc0
[ "MIT" ]
null
null
null
billingservice/New API definition.md
justinchen00/pagetest
ab39cec90e8595d45488fa184474ef540e88cdc0
[ "MIT" ]
null
null
null
billingservice/New API definition.md
justinchen00/pagetest
ab39cec90e8595d45488fa184474ef540e88cdc0
[ "MIT" ]
null
null
null
# new API and its internal logic JustinChen@TVU ## Change logs: 1. 20210915 the first version 2. 20210922 add a new API `mutation updateSubscription`; modify `query permission` and add the recommended redirect URL 3. 20211018 rename `mutation checkoutNewSubscription` to `mutation checkoutSubscription`; merge `mutation updateSubscription` into `mutation checkoutSubscription`; `mutation checkoutSubscription` supports prorating credits and charges during upgrade subscription; enrich `query permission`; add `group` in `mutation checkoutSubscription` to support creating subscription for `group`; add `mutation cancelSubscription`; 4. 20211019 for the requirement: no Chargebee's checkout portal in our workflow add `query customerPaymentPortal`; delete `query customerPortalStatus`; update `mutation checkoutSubscription` 5. 20211020 change the return value of `query permission` ## Guideline [Concept](https://docs.google.com/document/d/1kbozAs6vIr7dGajmTbhbqR4O2u3WCQUzsZfP4NBSUnE/edit) [Data Structure](https://docs.google.com/document/d/108J1mX22vblwRx7OgXGxaNQHYypfyKKP7kBFjGzusg0/edit) [Slack](https://join.slack.com/share/zt-w9dqrpc4-BvDkRy4pzXumeIiDmWf_4A) [Miro](https://miro.com/app/board/o9J_lbF7xGI=/?moveToWidget=3074457363982308077&cot=14) [Engineering Document](https://docs.google.com/document/d/1LJjxVGk3X9yfuTIjHIq8q6FSnxWk298Fo4CQmwLiFRQ/edit#) ## Requirement The new Billing Service should implement those features: 1. just rely on Chargebee to do two things: (1) maintain payment information (2) do transaction 2. give up using the tools(plan/sub/addon) provided by Chargebee. Those logic should be implemented by ourselves. 3. Chargebee customer account should be saved in UserService's Group object. User has no its own CB customer account. ## Notes: - router: `api/billing/v1/` ## Billing Service API ### query permission > used by APP & HouseKeeper For Partyline, its `partyline-hour` saves the static maximum credit. This user's real usage is obtained from Usage Service, which calculates from the moment that subscription was activated or updated to the moment when API is invoked. If all `permission.allow`=`true` , APP is allowed to proceed. If the API returns the user has an unpaid invoice, App should guide user to open customer portal to maintain their payment information. `query customerPortal` can get the `customer portal`. ``` query{ permission ( customerId: "justinchen@tvunetworks.com", product: "Partyline", // Partyline user just has one plan at a time. So no plan argument here. chargeItems: "string in JSON", // sample listed below {} TVUChannel has no chargeItems. so it is empty here. OR: { "version":1, "partyline-participant":8, "partyline-output":4 } OR: { "version":2, "chargeItems": [ { "id": "partyline-participant", "quantity": 8, }, { "id": "partyline-output", "quantity": 4, //absolute quantity of this addon } ] } OR: { "version":2, "chargeItems": [ { "id": "tvuchannel-channel", "increase": 1, //want to increase the number of this addon } ] } ) { encryptedStr code // error code or 0x0(represents allow) description // readable description, such as "need to upgrade plan, or there is an unpaid invoice" subscriptionId // related subscription remainHours // The quantity of chargeItems - usage permission { // [] id // partyline-participant ceiling // 8 quantity // current subscribed quantity of addon, e.g. 6 allow // true/false, e.g. true (6<8) }, redirect { iframeSrc // plan list / subscription maintaining page / addon(-/+) page / self-service portal iframeWidth iframeHeight } } } ``` `iframeSrc`: is `plan list` when the user has no active subscription; is `subscription maintaining page` when multiple addons are scarce; is `addon(-/+) page` when just one addon is scarce; is `CB payment maintaining page` when user doesn't file payment method. Usage Service API: https://showdoc.tvunetworks.com/web/#/111?page_id=3313 https://usageservice.tvunetworks.com/usageservice-backend/graphql ``` query{ partylineJoinTimeSummary( startTime: "0", endTime: "1631571056", email: "justinchen@tvunetworks.com" ) } ``` The backend DB of Usage Service: https://usageservice.tvunetworks.com/#/infoView ### query customer > used by embedded web Retrieve a customer's information of payment method and those exceptional invoices. All exceptional invoices and its content can be assembled by this API. ``` query{ customer(customerId:"justinchen@tvunetworks.com", product: "TVUSearch" ) { cardStatus # valid / expiring / expired / no card unbilledCharges # Total unbilled charges for this customer. in cents, min=0 exceptionalInvoices # TODO: [], status == payment_due / not_paid { id customer_id status # https://apidocs.chargebee.com/docs/api/invoices?prod_cat_ver=1#invoice_status total due_date ... } } } ``` `card_status` == `valid` means the customer filed payment way. ref: [https://apidocs.chargebee.com/docs/api/customers#retrieve_a_customer](https://apidocs.chargebee.com/docs/api/customers#retrieve_a_customer) ### query customerPaymentPortal The end-user can use the self-service portal to manage their payment method. ``` query{ customerPortal ( customerId: "justinchen@tvunetworks.com", product: "TVUSearch", redirectUrl: "https://search.tvunetworks.com" # optional. URL to redirect when the user logs out from the portal. ) { id # "portal_AzZlxDSWcJOT1FvC", token # aRNcIRmnenKuV67D07JlT8tC07caVpPw", access_url # https://tvunetworks-test.chargebee.com/pages/v3/6gAvxPV9cMFNcZVk8gehmThfW1mvJflX/ } } ``` ### query customerPortal The end-user can use the self-service portal to maintain their billing information / invoice / subscription. ``` query{ customerPortal ( customerId: "justinchen@tvunetworks.com", product: "TVUSearch", redirectUrl: "https://search.tvunetworks.com" # optional. URL to redirect when the user logs out from the portal. ) { id # "portal_AzZlxDSWcJOT1FvC", token # aRNcIRmnenKuV67D07JlT8tC07caVpPw", access_url # https://tvunetworks-test.chargebee.com/portal/v2/authenticate?token=KzU6TF4tcd8laBs1RCzz2z8FTeamcubBu6 } } ``` ### query plans > used by embedded web fetch the existing plans and their details for a given product. ``` query{ plans( product: "TVUSearch" planType: "all" // "all"/"common"/"custom", default is "all"; ) { "number": 2, "planIds":[ "mm_fednet5_subppu_199", "mm_fednet_special_knbc_0" ] } } ``` ### query subscription > used by embedded web return the information of customer's subscription. `paywalld` ensures that a user just has one active `subscription` for one `plan` in TVUSearch; a user just has one active `subscription` in `Partyline`. ``` query { subscription ( customerId: "justinchen@tvunetworks.com", product: "Partyline", planId: "partyline-common-custom", # In `Partyline`, this option will be optional status: 1 ) { subscriptionId // subscription ID status // active / future/in_trial/non_renewing/paused/cancelled deleted // true / false, ... } } ``` ref: https://apidocs.chargebee.com/docs/api/subscriptions?prod_cat_ver=1#list_subscriptions The explanation of `status`: https://apidocs.chargebee.com/docs/api/subscriptions#subscription_status ### query previewCustomSubscription calculate the price of the custom subscription. ``` query { previewCustomSubscription ( customerId: "justinchen@tvunetworks.com", # reserved product: "Partyline", # case insensitive planId: "partyline-common-custom", chargeItems: "string in JSON", # sample listed below { "version":1, "partyline-hour":10, "partyline-participant":8, "partyline-output":4 } OR: { "version":2, "chargeItems": [ { "id": "partyline-hour", "quantity": 10, }, { "id": "partyline-participant", "quantity": 8, }, { "id": "partyline-output", "quantity": 4, } ] } ) { price # $100 } } ``` `formula` presents in JSON and is saved in Billing Service. ```json {"formula": "$partyline-hour*0.25*(2*$partyline-participant*(1+225/100)+$partyline-output*(1+225/100))"} ``` ### mutation checkoutSubscription > used by embedded web providing a hosted page for customers to finish checkout/create/update subscriptions for given valid plan ID. Return `success` when the customer has an active subscription of the plan already. ``` mutation { checkoutSubscription ( groupId: "In new UserService, this `group` will be a new concept and is not the same as `root group` or `sub group`" customerId: "justinchen@tvunetworks.com", product: "Partyline", planId: "partyline-common-advance", chargeItems: "same JSON as query previewCustomSubscription", # optional. It's meaningful while `plan` is `custom` ) { invoice{ id: "xxxx", status: "NOT_PAID", //PAID/POSTED/PAYMENT_DUE/NOT_PAID/VOIDED/PENDING statusDescription: "the payment is not made and all attempts to collect is failed", amountPaid: 0 total: 84 } redirect { iframeSrc // self-service portal iframeWidth iframeHeight } } } ``` Internal logic: 1. need to create a Chargebee customer account if no account of this user's group exists. And pass its customer account ID to User Service; 2. checkout one time invoice(https://apidocs.chargebee.com/docs/api/invoices?prod_cat_ver=1#create_an_invoice); 3. save the string of chargeItems to the database table `billing_record` to log the event 4. Chargebee will pass the invoice status to `mutation eventNotify` via web hook. The relationship between `subscriptionID` and `invalid_invoice_id` will be created there and saved in table `billing_record`. 5. Based on the record saved in table `billing_record` , insert a new record to `subscription` table and set the status of subscription to `valid` , and table `subaddon` should be updated too. 6. Since this introduces a change in the price of the subscription, **prorated credits and charges** can be raised to ensure proper billing. The accountable duration is a **day**. 7. no refund for downgrade yet. ref: Invoice status: https://apidocs.chargebee.com/docs/api/invoices?prod_cat_ver=1&lang=java#invoice_status ~~Internal logic:~~ 1. ~~need to create a Chargebee customer account if no account of this user's group exists. And pass its customer account ID to User Service;~~ 2. ~~checkout OneTime Invoice(https://apidocs.chargebee.com/docs/api/hosted_pages?prod_cat_ver=1#checkoutOneTime-usecases), return a hosted page;~~ 3. ~~save hostedPageID & the string of chargeItems to the database table `billing_record` to log the event~~ 4. ~~our embedded web uses `query customerPortalStatus` to get the payment status. The embedded web should inform App of the status.~~ 5. ~~At the same time, the backend should wait for the callback from Chargebee. We can check the payment status in its handler.~~ 6. ~~Chargebee will pass the invoice status to `mutation eventNotify` via web hook.~~ 7. ~~The payment status and invoiceID can be obtained from the previous three steps. They have the same logic. The relationship between `subscriptionID` and `invalid_invoice_id` will be created there and saved in table `billing_record`.~~ 8. ~~Based on the record saved in table `billing_record` , insert a new record to `subscription` table and set the status of subscription to `valid` , and table `subaddon` should be updated too.~~ 9. ~~Since this introduces a change in the price of the subscription, **prorated credits and charges** can be raised to ensure proper billing. The accountable duration is a **day**.~~ 10. ~~no refund and downgrading yet.~~ #### `cron` task cron tasks are created to scan the valid subscription and abnormal invoices each day and generate the financial statement. ### mutation cancelSubscription > used by embedded web Normally, one `plan` just has one `subscription` for one user. Return the same structure as `query subscription`'s. ``` query { cancelSubscription ( customerId: "justinchen@tvunetworks.com", product: "TVUSearch", planId: "MM_Fednet_Sub_98" ) { subscriptionId // subscription ID status // active / future/in_trial/non_renewing/paused/cancelled deleted // true / false, ... } } ``` ref: [https://apidocs.chargebee.com/docs/api/subscriptions?prod_cat_ver=1#cancel_a_subscription]( ### mutation eventNotify > used by CB's webhook use it to get the status of the invoice. The format is defined by Chargebee. ## HouseKeeper API 1. an internal Timer. It is created when an event is created in APP; It is destroyed when an event is stopped in APP. And notify App when credit runs out or is about to run out via `callback_URL` listed below. 2. API: `startEvent` { session, user, `a new encrypted string got from query permission` , `callback_URL`} `callback_URL`: hosted by APP. 3. API: `stopEvent` { session, user, `a new encrypted string got from query permission` }
41.527638
240
0.58053
eng_Latn
0.912063
e5e0de011c65355e030b3e81a5ca5bb84ffe349b
35
md
Markdown
README.md
maxpsq/ora-log
3b4b1ba61862e3e4d69123b64359027cd903176d
[ "Apache-2.0" ]
null
null
null
README.md
maxpsq/ora-log
3b4b1ba61862e3e4d69123b64359027cd903176d
[ "Apache-2.0" ]
null
null
null
README.md
maxpsq/ora-log
3b4b1ba61862e3e4d69123b64359027cd903176d
[ "Apache-2.0" ]
null
null
null
# ora-log Logger for Oracle PL/SQL
11.666667
24
0.742857
kor_Hang
0.43997
e5e145465d677c70464a9bc1ff2708aada39975a
736
md
Markdown
README.md
pbrejdak/electron-typescript-quick-start-hot-reload
ebfc81fbf303163e148577e90caeb5503eead65a
[ "MIT" ]
null
null
null
README.md
pbrejdak/electron-typescript-quick-start-hot-reload
ebfc81fbf303163e148577e90caeb5503eead65a
[ "MIT" ]
null
null
null
README.md
pbrejdak/electron-typescript-quick-start-hot-reload
ebfc81fbf303163e148577e90caeb5503eead65a
[ "MIT" ]
null
null
null
# electron-typescript-quick-start-hot-reload I've created this repository mostly for my needs, it is handy for me to host dev server with hot reload and set electron to load localhost:8080. Code is splitted to electron side in `./src/`, and client side `./client`. >`// frist console`\ >`// basicly run tsc -w for files in ./src`\ >`npm run serve:electron` >`// second console`\ >`// starts webpack-dev-server for client side which listning on localhost:8080`\ >`npm run serve:client` If you are using `vscode` then you run hit `F5` for run electron with attached debugger, if not use third console below. >`// third console (optional) if you are not using vscode`\ >`// this command start electron`\ >`// npm run startElectron`
35.047619
144
0.724185
eng_Latn
0.997398
e5e1ffbf561180f0866110f809d8e69ee3d1779f
434
md
Markdown
README.md
al02783832/RESTfulWS
8c27fe1538fb9754746aa15202209e8f88ea519a
[ "MIT" ]
null
null
null
README.md
al02783832/RESTfulWS
8c27fe1538fb9754746aa15202209e8f88ea519a
[ "MIT" ]
null
null
null
README.md
al02783832/RESTfulWS
8c27fe1538fb9754746aa15202209e8f88ea519a
[ "MIT" ]
null
null
null
# RESTfulWS # Instalación El participante creará cuatro recursos REST utilizando Spring Framework, el patrón de diseño Model-View-Controller y Controller-Service-Repository. Los recursos se encargarán de enumerar los archivos en un directorio en específico, descargar, subir y borrar archivos, enviar notificaciones por medio de eventos asíncronos, siguiendo los principios del Richardson Maturity Model. # Uso # Créditos #Licencia
36.166667
96
0.827189
spa_Latn
0.914543
e5e22b32159c75c81392a3e4ecacd4d4c62e44b8
1,394
md
Markdown
windows-driver-docs-pr/storage/synchronized-access-within-unsynchronized-miniport-driver-routines.md
k-takai/windows-driver-docs.ja-jp
f28c3b8e411a2502e6378eaeef88cbae054cd745
[ "CC-BY-4.0", "MIT" ]
null
null
null
windows-driver-docs-pr/storage/synchronized-access-within-unsynchronized-miniport-driver-routines.md
k-takai/windows-driver-docs.ja-jp
f28c3b8e411a2502e6378eaeef88cbae054cd745
[ "CC-BY-4.0", "MIT" ]
null
null
null
windows-driver-docs-pr/storage/synchronized-access-within-unsynchronized-miniport-driver-routines.md
k-takai/windows-driver-docs.ja-jp
f28c3b8e411a2502e6378eaeef88cbae054cd745
[ "CC-BY-4.0", "MIT" ]
null
null
null
--- title: ミニポート ドライバー ルーチン内の同期アクセス description: ミニポート ドライバーでは、全二重モードで実行またはされる Srb の処理が同期されていない、ときにも同期アクセスが必要ですがあります。 ms.assetid: a1bc3bff-b109-4a52-8466-48a0be7611b7 ms.date: 04/20/2017 ms.localizationpriority: medium ms.openlocfilehash: 36356b9dc397d6bdff826a76e4d6e483f3c6a348 ms.sourcegitcommit: fb7d95c7a5d47860918cd3602efdd33b69dcf2da ms.translationtype: MT ms.contentlocale: ja-JP ms.lasthandoff: 06/25/2019 ms.locfileid: "67368164" --- # <a name="synchronized-access-within-miniport-driver-routines"></a>ミニポート ドライバー ルーチン内の同期アクセス ## <span id="ddk_synchronized_access_within_unsynchronized_miniport_driver_routines"></span><span id="DDK_SYNCHRONIZED_ACCESS_WITHIN_UNSYNCHRONIZED_MINIPORT_DRIVER_ROUTINES"></span> でもミニポート ドライバー全二重モードで実行またはとでされる Srb の非同期処理を行って、 [ **HwStorBuildIo** ](https://docs.microsoft.com/windows-hardware/drivers/ddi/content/storport/nc-storport-hw_buildio) 、日常的な必要がありますが、デバイスの拡張機能への同期アクセスします。 Storport ドライバーによって提供されるサポート ルーチンのライブラリに含まれる[ **StorPortSynchronizeAccess**](https://docs.microsoft.com/windows-hardware/drivers/ddi/content/storport/nf-storport-storportsynchronizeaccess)、ミニポート ドライバーの重要なデータへのアクセスを同期するを許可するルーチンがこのような構造体として、デバイスの拡張機能。 ミニポート ドライバーを呼び出すと**StorPortSynchronizeAccess**、コールバック ルーチンへのポインターとルーチンを指定する必要があります。 コールバック ルーチンには、ホスト バス アダプターの割り込みハンドラーと同期する必要があります SRB の処理の一部が含まれています。 パフォーマンスの向上のためには、コールバック ルーチンを実行することにかかる時間は、ドライバーを記述します。
44.967742
451
0.848637
yue_Hant
0.559101
e5e24cbcff6d00f89842250945cfba3b6e187701
9,193
md
Markdown
README.md
Naereen/My-Munin-plugins
0b9c9eb98d8939307032269ac6ee59004a7d8986
[ "MIT" ]
2
2017-02-20T06:13:19.000Z
2021-02-17T15:13:49.000Z
README.md
Naereen/My-Munin-plugins
0b9c9eb98d8939307032269ac6ee59004a7d8986
[ "MIT" ]
null
null
null
README.md
Naereen/My-Munin-plugins
0b9c9eb98d8939307032269ac6ee59004a7d8986
[ "MIT" ]
1
2018-08-14T22:52:20.000Z
2018-08-14T22:52:20.000Z
# My own plugins for [Munin](http://www.munin-monitoring.org/) This small repository contains some tiny plugins (written in [Bash](https://www.gnu.org/software/bash/) or [Python](https://www.python.org/)), for the [Munin](http://www.munin-monitoring.org/) monitoring tool. Despite a [very rich plugin collection](http://gallery.munin-monitoring.org/), I found some that could be missing to someone (well, at least to me), so I decided to write them. See below for a list of the plugins I wrote (tiny, and probably bugged), and how to install them. ---- ## How to install them? ### 1. First clone the repo In a classic Ubuntu or Debian Linux environment, with [Munin](http://www.munin-monitoring.org/) correctly installed with the default folder configuration, the following commands will [git clone](https://help.github.com/articles/cloning-a-repository/) my repository: ```bash cd ~/.local/etc/munin/ # A certain directory, you can use some place else git clone https://github.com/Naereen/My-Munin-plugins ./My-Munin-plugins.git/ # Clone my repo cd ./My-Munin-plugins.git/ # Go to this directory ``` ### 2. Then [install or activate the plugins](http://munin-monitoring.org/wiki/faq#Q:Howdoyouinstallaplugin) you want Then, pick the plugins you like in [this folder](https://github.com/Naereen/My-Munin-plugins/tree/master/), and [install them or activate them](http://guide.munin-monitoring.org/en/latest/plugin/writing.html#activating-the-plugin). For instance, if you want to intall the plugin [`number_of_plugins.sh`](https://github.com/Naereen/My-Munin-plugins/tree/master/number_of_plugins.sh), then in the good folder (see step 1) do: ```bash # Be sure it is executable chmod 755 number_of_plugins.sh # By default they should all be executable # Then symlink it to /etc/munin/plugins/ sudo ln -s ${PWD}/number_of_plugins.sh /etc/munin/plugins/nb_of_plugins ``` You can (and should) then check that the plugin works: ```bash $ munin-run nb_of_plugins # Gives the number of plugin currently activated plugins.value 34 myplugins.value 5 ``` You can repeat these two steps for every plugins you want to install. *Note:* you can also use the provided [`Makefile`](https://github.com/Naereen/My-Munin-plugins/tree/master/Makefile) to install one or all plugins: ```bash make install__tmux # Ask for sudo password and install tmux.sh to /etc/munin/plugins/tmux make install_all # Ask for sudo password and install all my plugins to /etc/munin/plugins/ ``` ---- ## List of plugins - [x] Number of open tabs, windows and panes in [tmux](https://tmux.github.io/) ? **Done**, see [`tmux.sh`](https://github.com/Naereen/My-Munin-plugins/tree/master/tmux.sh), it works but works even better if `user` is well configured (see below). - [x] Number of open graphical programs and open windows in your window manager ? **Done**, see [`gui_windows.sh`](https://github.com/Naereen/My-Munin-plugins/tree/master/gui_windows.sh), it works *only* if `user` is well configured (see below). - [x] Number of open tabs, windows and panes in [Sublime Text 3](https://www.sublimetext.com/3dev) ? It was harder... I created this tiny ST3 plugin ([`number_tabs.py`](https://github.com/Naereen/My-Munin-plugins/tree/master/number_tabs.py), to install in your [`Packages/User` directory](http://docs.sublimetext.info/en/latest/basic_concepts.html#the-user-package)), in order to have a ST3 command `number_tabs`. Then the script [`number_st3_tabs.sh`](https://github.com/Naereen/My-Munin-plugins/tree/master/number_st3_tabs.sh) calls it with `subl --background --command number_tabs` from the command line... FIXME do it better? - [x] Number of documents and number of pages printed by my laptop ? **In progress**, see [`nb_printed_documents.sh`](https://github.com/Naereen/My-Munin-plugins/tree/master/nb_printed_documents.sh). FIXME Should already be available from [this list](http://gallery.munin-monitoring.org/printing-index.html)! - [ ] Number of channels, users, groups and active users for a [Slack team](https://slack.com/) ? **Done** with [this Python file that accesses the Slack API](get-nb-of-connected-slack-users.py) and [this Bash file that prints the config or values](get-nb-of-connected-slack-users.sh). ### Required configuration Edit your `munin-node` configuration file to specify the configuration. Currently, [`tmux.sh`](https://github.com/Naereen/My-Munin-plugins/tree/master/tmux.sh) and [`gui_windows.sh`](https://github.com/Naereen/My-Munin-plugins/tree/master/gui_windows.sh) need to be ran from the user `$USER` (ie, you) and not `munin`: ```bash [tmux] user lilian # adapt to your own username [gui_windows] user lilian # adapt to your own username ``` ---- ## Some screenshots ### [Tmux](tmux.sh) - On the main page: ![tmux](screenshots/tmux.png) - On the page for this plugin (with the legend and information on the plots): ![tmux_2](screenshots/tmux_2.png) ## [GUI Windows](gui_windows.sh) - On the main page: ![gui_windows](screenshots/gui_windows.png) ### [Munin plugins](number_of_plugins.sh) - On the main page: ![number_of_plugins](screenshots/number_of_plugins.png) - On the page for this plugin (with the legend and information on the plots): ![number_of_plugins_2](screenshots/number_of_plugins_2.png) ### [Slack stats](get-nb-of-connected-slack-users.sh) - On the main page: ![get-nb-of-connected-slack-users](screenshots/get-nb-of-connected-slack-users.png) ---- ## Wishlist for future plugins ? I would like to be able to use [Munin](http://www.munin-monitoring.org/) to monitor: - [ ] ~~Number of songs played from morning and number of songs currently in the waiting list, for my music player [GMusicBrowser](http://gmusicbrowser.org) ? ([by @squentin](https://github.com/squentin/gmusicbrowser/))~~ It seems impossible... (I explored the cli API of GMusicBrowser and it seems unachievable) - [ ] ~~Number of open tabs and windows in [Firefox](https://www.mozilla.org/en-US/firefox/central/) ?~~ It seems impossible... - [ ] Volume of the main sound card? Seems possible. But useless? - [ ] Number of USB peripherics connected? Completely useless. - [ ] Local [weather](https://github.com/munin-monitoring/contrib/tree/master/plugins/weather/), or temperature of my home? - [ ] ... And you, do you have any other idea? ---- ## :notebook: References ? - For more details on [Munin](http://www.munin-monitoring.org/), see the official website, [www.munin-monitoring.org](http://www.munin-monitoring.org/), and the documentation, [guide.munin-monitoring.org](http://guide.munin-monitoring.org/). - A good introductory page is [plugin/writing.html](http://guide.munin-monitoring.org/en/latest/plugin/writing.html) on [the new Munin guide](http://guide.munin-monitoring.org/en/latest/). - Fore more details on Munin plugins, see first [this page (wiki/plugins)](http://munin-monitoring.org/wiki/plugins), then [the reference](http://guide.munin-monitoring.org/en/latest/reference/plugin.html), and if needed the older pages [PluginShell](http://munin-monitoring.org/wiki/PluginShell), or [PluginConcise](http://munin-monitoring.org/wiki/PluginConcise) or [HowToWritePlugins](http://munin-monitoring.org/wiki/HowToWritePlugins) on [the Munin wiki](http://munin-monitoring.org/wiki/). ---- ## Other [self-quantified projects](http://perso.crans.org/besson/self-quantified.en.html) ? - [uLogMe](https://GitHub.com/Naereen/uLogMe/): keep track of your computer activity throughout the day: visualize your active window titles and the number and frequency of keystrokes, in beautiful and responsive HTML timelines. - [`selfspy`](https://github.com/gurgeh/selfspy): log everything you do on the computer, for statistics, future reference and all-around fun. I also worked a little bit on [selfspy-vis](https://github.com/Naereen/selfspy-vis), some tools to visualize the data collected by [`selfspy`](https://github.com/gurgeh/selfspy). - My minimalist dashboard, generated every hour (with [a `crontab` file](https://help.ubuntu.com/community/CronHowto)), with this bash script [`GenerateStatsMarkdown.sh`](https://bitbucket.org/lbesson/bin/src/master/GenerateStatsMarkdown.sh). ---- ## :scroll: License ? [![GitHub license](https://img.shields.io/github/license/Naereen/My-Munin-plugins.svg)](https://github.com/Naereen/My-Munin-plugins/blob/master/LICENSE) [MIT Licensed](https://lbesson.mit-license.org/) (file [LICENSE](LICENSE)). © [Lilian Besson](https://GitHub.com/Naereen), 2016. [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/Naereen/My-Munin-plugins/graphs/commit-activity) [![Ask Me Anything !](https://img.shields.io/badge/Ask%20me-anything-1abc9c.svg)](https://GitHub.com/Naereen/ama) [![Analytics](https://ga-beacon.appspot.com/UA-38514290-17/github.com/Naereen/My-Munin-plugins/README.md?pixel)](https://GitHub.com/Naereen/My-Munin-plugins/) [![ForTheBadge built-with-swag](http://ForTheBadge.com/images/badges/built-with-swag.svg)](https://GitHub.com/Naereen/) [![ForTheBadge uses-badges](http://ForTheBadge.com/images/badges/uses-badges.svg)](http://ForTheBadge.com) [![ForTheBadge uses-git](http://ForTheBadge.com/images/badges/uses-git.svg)](https://GitHub.com/)
68.604478
629
0.748396
eng_Latn
0.589872
e5e25332d4f4309e21ed0facbbae6b3fb7ad0637
1,329
md
Markdown
README.md
Symmetric/django-ember-modeler
7c7ce940e169d7bfec6b0a8dca5950b0f243aca4
[ "MIT" ]
1
2015-11-05T07:34:19.000Z
2015-11-05T07:34:19.000Z
README.md
Symmetric/django-ember-modeler
7c7ce940e169d7bfec6b0a8dca5950b0f243aca4
[ "MIT" ]
null
null
null
README.md
Symmetric/django-ember-modeler
7c7ce940e169d7bfec6b0a8dca5950b0f243aca4
[ "MIT" ]
null
null
null
django-ember-modeler ============== **django-ember-modeler** attempts to make it easier to use Django models in your Ember applications. It's currently only useful for prototyping, as it's missing a lot of function that would be required for use in complex applications. It's cloned from [django-knockout-modeller](https://github.com/Miserlou/django-knockout-modeler). **django-ember-modeler** turns this: ```python class MyObject(models.Model): myNumber = models.IntegerField() myName = models.CharField() ``` into this: ```javascript App.MyObject = DS.Model.extend({ "myNumber": 666, "myName": "Bob McChobb" }); ``` with just this! ```django {{ MyObject|ember }} ``` Quick start ------------ 0. Install django-ember-modeler ```python pip install git+git://git@github.com/Symmetric/django-ember-modeler ``` 1. Add 'ember_modeler' to your INSTALLED_APPS setting like this: ```python INSTALLED_APPS = ( ... 'ember_modeler', ) ``` 2. Include Ember.js in your HTML: 4. Emberify your model: ```html {% load ember %} <script> {{ MyObject|ember }} </script> ``` Issues ------- This is currently a very basic implementation, but feel free to file an issue if you find bugs or have suggestions for features (pull requests welcome).
19.835821
100
0.662152
eng_Latn
0.812533
e5e2c1f8fdb79e486a9b0b49894f6269a517dcae
4,809
md
Markdown
README.md
reymundo95/Week7-Wordpress-vs-Kali
05e9182276bee585cdb45a158a76a17bcf10f0a4
[ "Apache-2.0" ]
null
null
null
README.md
reymundo95/Week7-Wordpress-vs-Kali
05e9182276bee585cdb45a158a76a17bcf10f0a4
[ "Apache-2.0" ]
null
null
null
README.md
reymundo95/Week7-Wordpress-vs-Kali
05e9182276bee585cdb45a158a76a17bcf10f0a4
[ "Apache-2.0" ]
null
null
null
# Week7-Wordpress-vs-Kali Time spent: 5 hours spent in total > Objective: Find, analyze, recreate, and document **five vulnerabilities** affecting an old version of WordPress ## Pentesting Report 1. Cross Site Scripting (XSS) - [x] Summary: A XSS vulnerability revealed that the webpage was able to be injected with malicious java code and can create an instance where a user can simply hover their mouse over the infected site. This causing the victim of who ever is on the webpage to simply hover their mouse over the intended target and cause damage. - Vulnerability types: subject to XSS - Tested in version: 4.2 - [x] GIF Walkthrough: <a href="https://imgur.com/OfITuEL"><img src="https://i.imgur.com/OfITuEL.gif" title="source: imgur.com" /></a> - [x] Steps to recreate: 1. Initialized a place to put injected XSS code into header of page 2. Chose a xss code that involved being initiated once you hover mouse over the title 3. Place XSS code into the heading of the page. 4. Update the page with the XSS in the in the heading. 5. View the permalink of the page 6. Simply hover the mouse over the heading of the page. 7. XSS alert message appears 2. Privelage Escalation - [x] Summary: the comment section had a privelage escalation where a user, that is not admin, can simply submit a comment. since every comment has to be approved by the admin. But as soon as that comment is approved then the user is able to submit as many comments without having their comments approved. - Vulnerability types: - Tested in version: 4.2 - [x] GIF Walkthrough: <a href="https://imgur.com/KiIIFg5"><img src="https://i.imgur.com/KiIIFg5.gif" title="source: imgur.com" /></a> Longer gif link click here: <a href="https://imgur.com/n5QegtJ"><img src="https://i.imgur.com/n5QegtJ.gif" title="source: imgur.com" /></a> - [x] Steps to recreate: 1. Create a new user 2. Give New user a role (subscriber) 3. Create a page (IST590) 4. Login into the new user through a incongnito window 5. As the new user simply head over to the page (IST590) 6. Place a commment and press submit. 7. Comment should say "comment waiting for moderation" meaning it needs approval to post into site. 8. Switch windows back into the admin page, refresh page. 9. Approve last comment posted 10. switch back to subscriber in incognito mode windows 11. Post another comment 12. Will not need to wait for approval 3. IDOR - [x] Summary: The vulnerability of this is where the site can expose information if there is a modification of the url by providing the statement"readme.html towards the end of the URL. Thus redirecting the page to a page where the site should not have led to. - Vulnerability types: Readme.html vulnerability - Tested in version: 4.2 - [x] GIF Walkthrough: <a href="https://imgur.com/HKrEgBd"><img src="https://i.imgur.com/HKrEgBd.gif" title="source: imgur.com" /></a> - [x] Steps to recreate: 1. Identified that there was a vulnerability by changing the URL 2. erase everything after wpdistillery.vm/"xxxxxxx" 3.replace the text that you erased with "readme.html" 4. Press enter 5. Web page reveals information regarding system requirement, final notes ## Resources - [WordPress Source Browser](https://core.trac.wordpress.org/browser/) - [WordPress Developer Reference](https://developer.wordpress.org/reference/) GIFs created with [LiceCap](http://www.cockos.com/licecap/). ## Notes Challenges that was encountered through my work was mainly due to setting up the lab environment. Everytime the lab environment was getting prepared for, it will give an error message relating to the vagrant setup in my host machine. Later once envireonment was finally set up, it would work fine. But once the host computer was shut off and turned on the environment would not work upon turning on. Would have to keep unistalling and reinstalling vagrant and starting from scratch. ## License Copyright [2018] [Reymundo Reza] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
53.433333
482
0.708671
eng_Latn
0.992834
e5e2d0d02488ac6e1ab0924502f6f6636478421c
6,211
md
Markdown
README.md
harold-waste/pg-amqp-bridge
3df807dae516b242d594162c5d429e957c6300db
[ "MIT" ]
null
null
null
README.md
harold-waste/pg-amqp-bridge
3df807dae516b242d594162c5d429e957c6300db
[ "MIT" ]
null
null
null
README.md
harold-waste/pg-amqp-bridge
3df807dae516b242d594162c5d429e957c6300db
[ "MIT" ]
null
null
null
# PostgreSQL to AMQP bridge #### Send messages to RabbitMQ from PostgreSQL ![pg-amqp-bridge](/media/pg-amqp-bridge.gif?raw=true "pg-amqp-bridge") ## But Why? ![why](/media/but-why.gif?raw=true "why?") This tool enables a decoupled architecture, think sending emails when a user signs up. Instead of having explicit code in your `signup` function that does the work (and slows down your response), you just have to worry about inserting the row into the database. After this, a database trigger (see below) will generate an event which gets sent to RabbitMQ. From there, you can have multiple consumers reacting to that event (send signup email, send sms notification). Those consumers tend to be very short, self contained scripts. If you pair **pg-amqp-bridge** and the [Web STOMP](https://www.rabbitmq.com/web-stomp.html) plugin for RabbitMQ , you can enable real time updates with almost zero code. The larger goal is to enable the development of backends around [PostgREST](https://postgrest.com)/[subZero](https://subzero.cloud/) philosophy. Check out the [PostgREST Starter Kit](https://github.com/subzerocloud/postgrest-starter-kit) to see how `pg-amqp-bridge` fits in a larger project. ## Configuration Configuration is done through environment variables: - **POSTGRESQL_URI**: e.g. `postgresql://username:password@domain.tld:port/database` - **AMQP_URI**: e.g. `amqp://rabbitmq//` - **BRIDGE_CHANNELS**: e.g. `pgchannel1:task_queue,pgchannel2:direct_exchange,pgchannel3:topic_exchange` - **DELIVERY_MODE**: can be `PERSISTENT` or `NON-PERSISTENT`, default is `NON-PERSISTENT` **Note:** It's recommended to always use the same name for postgresql channel and exchange/queue in `BRIDGE_CHANNELS`, for example `app_events:app_events,table_changes:tables_changes` ## Running in console #### Install ```shell VERSION=0.0.1 \ PLATFORM=x86_64-unknown-linux-gnu \ curl -SLO https://github.com/subzerocloud/pg-amqp-bridge/releases/download/${VERSION}/pg-amqp-bridge-${VERSION}-${PLATFORM}.tar.gz && \ tar zxf pg-amqp-bridge-${VERSION}-${PLATFORM}.tar.gz && \ mv pg-amqp-bridge /usr/local/bin ``` #### Run ```shell POSTGRESQL_URI="postgres://postgres@localhost" \ AMQP_URI="amqp://localhost//" \ BRIDGE_CHANNELS="pgchannel1:task_queue,pgchannel2:direct_exchange,pgchannel3:topic_exchange" \ pg-amqp-bridge ``` ## Running as docker container ```shell docker run --rm -it --net=host \ -e POSTGRESQL_URI="postgres://postgres@localhost" \ -e AMQP_URI="amqp://localhost//" \ -e BRIDGE_CHANNELS="pgchannel1:task_queue,pgchannel2:direct_exchange,pgchannel3:topic_exchange" \ subzerocloud/pg-amqp-bridge ``` You can enable logging of the forwarded messages with the ```RUST_LOG=info``` environment variable. ## Sending messages **Note**: the bridge doesn't declare exchanges or queues, if they aren't previoulsy declared it will exit with an error. #### Sending messages to a queue ```sql NOTIFY pgchannel1, 'Task message'; ``` Since ```pgchannel1``` is bound to ```task_queue``` in BRIDGE_CHANNELS ```'Task message'``` will be sent to ```task_queue```. #### Sending messages to a direct exchange You can specify a routing key with the format ```routing_key|message```: ```sql NOTIFY pgchannel2, 'direct_key|Direct message'; ``` Since there is a ```pgchannel2:direct_exchange``` declared in BRIDGE_CHANNELS ```'Direct message'``` will be sent to ```direct_exchange``` with a routing key of ```direct_key```. #### Sending messages to a topic exchange You can specify the routing key with the usual syntax used for topic exchanges. ```sql NOTIFY pgchannel3, '*.orange|Topic message'; NOTIFY pgchannel3, 'quick.brown.fox|Topic message'; NOTIFY pgchannel3, 'lazy.#|Topic message'; ``` ## Helper Functions To make sending messages a bit easier you can setup the following functions in your database ```sql create schema rabbitmq; create or replace function rabbitmq.send_message(channel text, routing_key text, message text) returns void as $$ select pg_notify(channel, routing_key || '|' || message); $$ stable language sql; create or replace function rabbitmq.on_row_change() returns trigger as $$ declare routing_key text; row record; begin routing_key := 'row_change' '.table-'::text || TG_TABLE_NAME::text || '.event-'::text || TG_OP::text; if (TG_OP = 'DELETE') then row := old; elsif (TG_OP = 'UPDATE') then row := new; elsif (TG_OP = 'INSERT') then row := new; end if; -- change 'events' to the desired channel/exchange name perform rabbitmq.send_message('events', routing_key, row_to_json(row)::text); return null; end; $$ stable language plpgsql; ``` After this, you can send events from your stored procedures like this ```sql rabbitmq.send_message('exchange-name', 'routing-key', 'Hi!'); ``` You can stream row changes by attaching a trigger to tables ```sql create trigger send_change_event after insert or update or delete on tablename for each row execute procedure rabbitmq.on_row_change(); ``` ## Running from source #### Install Rust ```shell curl https://sh.rustup.rs -sSf | sh ``` #### Run ```shell POSTGRESQL_URI="postgres://postgres@localhost" \ AMQP_URI="amqp://localhost//" \ BRIDGE_CHANNELS="pgchannel1:task_queue,pgchannel2:direct_exchange,pgchannel3:topic_exchange" \ cargo run ``` #### Test **Note**: RabbitMQ and PostgreSQL need to be running on your localhost ```shell cargo test ``` ## Contributing Anyone and everyone is welcome to contribute. ## Support * [Slack](https://slack.subzero.cloud/) — Watch announcements, share ideas and feedback * [GitHub Issues](https://github.com/subzerocloud/pg-amqp-bridge/issues) — Check open issues, send feature requests ## Author [@steve-chavez](https://github.com/steve-chavez) ## Credits Inspired by [@FGRibreau](https://github.com/FGRibreau/postgresql-to-amqp)'s work ## License Copyright © 2017-present subZero Cloud, LLC.<br /> This source code is licensed under [MIT](https://github.com/subzerocloud/pg-amqp-bridge/blob/master/LICENSE.txt) license<br /> The documentation to the project is licensed under the [CC BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/) license.
33.939891
530
0.731283
eng_Latn
0.863703
e5e35407554b951cdf9098b5bbfeea148cbf28ff
14,030
md
Markdown
website/_posts/Networks/2013-06-14-Part-4-Twisted-Plugin.md
dlim2010test/newcoder
5cc46cdc05fa461e532b9975be4faf7781d7ba2d
[ "Zlib" ]
1
2022-03-25T21:33:27.000Z
2022-03-25T21:33:27.000Z
website/_posts/Networks/2013-06-14-Part-4-Twisted-Plugin.md
dlim2010test/newcoder
5cc46cdc05fa461e532b9975be4faf7781d7ba2d
[ "Zlib" ]
null
null
null
website/_posts/Networks/2013-06-14-Part-4-Twisted-Plugin.md
dlim2010test/newcoder
5cc46cdc05fa461e532b9975be4faf7781d7ba2d
[ "Zlib" ]
1
2019-10-14T11:37:23.000Z
2019-10-14T11:37:23.000Z
--- title: "Part 4: Twisted Plugin" layout: post.html tags: [irc, network, networks] url: "/~drafts/networks/part-4/" --- Creating our `twistd` command line plugin for easy deployment. ### Module Setup To setup our plugin, we need a way to parse our settings configuration. For this, we use `ConfigParser` from Python’s standard library: ```python from ConfigParser import ConfigParser # <--snip--> ``` Next, we have a bunch of Twisted import statements to create our plugin (don’t get scared!): ```python # <--snip--> from twisted.application.service import IServiceMaker, Service from twisted.internet.endpoints import clientFromString from twisted.plugin import IPlugin from twisted.python import usage, log from zope.interface import implementer # <--snip--> ``` And last, we’ll import our talkback bot and quote picker function: ```python # <--snip--> from talkback.bot import TalkBackBotFactory from talkback.quote_picker import QuotePicker # <--snip--> ``` Again, notice the order of imports per [Python’s style guide](http://www.python.org/dev/peps/pep-0008/) grouped by standard library, third-party libraries/modules, and our own written modules, each group of import statements in alphabetical order. ### Scaffolding for talkbackbot_plugin.py We’ll first want to leverage Twisted’s `usage` module to parse our configuration: ```python # <--snip--> class Options(usage.Options): # <--snip--> ``` Next, the actual class that constructs our application using Twisted’s `Service` class to start and stop our application: ```python # <--snip--> class TalkBackBotService(Service): def __init__(self, endpoint, channel, nickname, realname, quotesFilename, triggers): def startService(self): """Construct a client & connect to server.""" def stopService(self): """Disconnect.""" # <--snip--> ``` To go along with our `TalkBackBotService`, we create a Maker class (similar to having our bot Factory class to create our bot) that constructs our service. ```python # <--snip--> class BotServiceMaker(object): tapname = "twsrs" description = "IRC bot that provides quotations from notable women" options = Options def makeService(self, options): """Construct the talkbackbot service.""" # <--snip--> ``` Lastly, we construct an object which calls our `BotServiceMaker`: ```python # <--snip--> serviceMaker = BotServiceMaker() ``` Let’s first approach our `BotServiceMaker`. ### BotServiceMaker class First, a few settings for our class: ```python # <--snip--> tapname = "twsrs" description = "IRC bot that provides quotations from notable women" options = Options # <--snip--> ``` The `tapname` is the short string name for our plugin; this is the subcommand of `twistd`. The `description` is the short summary of what the plugin does. And the `options` variable refers to our `Options` class that we will code out in a bit. Next, our `makeService` function: ```python # <--snip--> def makeService(self, options): """Construct the talkbackbot service.""" config = ConfigParser() config.read([options['config']]) triggers = [ trigger.strip() for trigger in config.get('talkback', 'triggers').split('\n') if trigger.strip() ] return TalkBackBotService( endpoint=config.get('irc', 'endpoint'), channel=config.get('irc', 'channel'), nickname=config.get('irc', 'nickname'), realname=config.get('irc', 'realname'), quotesFilename=config.get('talkback', 'quotesFilename'), triggers=triggers, ) # <--snip--> ``` First, we instantiate `ConfigParser()`, and read from our `options` parameter that we pass in to grab `'config'` in our options. This is essentially grabbing and reading our `settings.ini` file. Next, we create a list comprehension for `triggers`. We strip the null characters for every trigger we find in our settings.ini file. Looking at the file, we are able to pull out only the triggers with the `config.get('talkback', 'triggers')` function: ``` # <--snip--> [talkback] # <--snip--> triggers = that's what she said ``` The `.split('\n')` means that each quote is separated by a new line. After we setup our triggers, we then return our instantiated `TalkBackBotService` class with the parameters grabbed from our `config` variable: ```python # <--snip--> return TalkBackBotService( endpoint=config.get('irc', 'endpoint'), channel=config.get('irc', 'channel'), nickname=config.get('irc', 'nickname'), realname=config.get('irc', 'realname'), quotesFilename=config.get('talkback', 'quotesFilename'), triggers=triggers, ) ``` One final bit that I didn’t detail in the scaffolding: Twisted makes use of [Zope’s interfaces](http://docs.zope.org/zope.interface/). Earlier, we imported `implementer` from `zope.interface`. The way we will use `implementer` is a Python [decorator](http://simeonfranklin.com/blog/2012/jul/1/python-decorators-in-12-steps/), and with Twisted, it is considered an interface: ```python # <--snip--> @implementer(IServiceMaker, IPlugin) class BotServiceMaker(object): # <--snip--> ``` Rather than having `BotServiceMaker` inherit from both `IServiceMaker` and `IPlugin`, we use `@implementer` as a marker saying “this class implements these interfaces”. You can read more about Twisted’s interfaces [here](http://twistedmatrix.com/documents/current/core/howto/components.html). ### Options class This is pretty simple: we need to tell our Twisted application about the options it can handle: ```python # <--snip--> class Options(usage.Options): optParameters = [ ['config', 'c', 'settings.ini', 'Configuration file.'], ] # <--snip--> ``` This gives us two flags: `--config` and `-c` that we could include when we run `twistd twsrs` (remember that `twsrs` is the `tapname` for our service): ```bash $ twistd twsrs --config=/path/to/settings.ini $ twistd twsrs -c /path/to/settings.ini ``` We also feed it a default value, in this case, `settings.ini`. If you were not to include a config flag, the application would look for `settings.ini` in the current directory (same directory that the `README.md`, `settings.ini.EXAMPLE`, `quotes.txt` files live). ### TalkBackBotService class Our `BotServiceMaker.makeService` method returns an instance of `TalkBackBotService` with parameters grabbed from our configuration, definied in `settings.ini`. Now let’s implement our `TalkBackBotService` class. We’ll first create a private variable `_bot` with value `None` (private is denoted with a leading `_`, and while it’s not meant to be publically accessible, it isn’t enforced). We also initialize the class: ```python # <--snip--> def __init__(self, endpoint, channel, nickname, realname, quotesFilename, triggers): self._endpoint = endpoint self._channel = channel self._nickname = nickname self._realname = realname self._quotesFilename = quotesFilename self._triggers = triggers # <--snip--> ``` This `__init__` function gets called when we return `TalkBackBotService` from `BotServiceMaker.makeService` method with our settings from our parsed configuration. Next, we’ll define `startService` method, which is a part of the `Service` base class we inherit from: ```python # <--snip--> def startService(self): """Construct a client & connect to server.""" from twisted.internet import reactor def connected(bot): self._bot = bot def failure(err): log.err(err, _why='Could not connect to specified server.') reactor.stop() quotes = QuotePicker(self._quotesFilename) client = clientFromString(reactor, self._endpoint) factory = TalkBackBotFactory( self._channel, self._nickname, self._realname, quotes, self._triggers, ) return client.connect(factory).addCallbacks(connected, failure) # <--snip--> ``` Our `startService` method has a few interesting things going on. We first have an import statement nested in it: `from twisted.internet import reactor`. [Ashwini Oruganti](http://twitter.com/_ashfall_), a contributor to Twisted, wrote up a [great blog post](http://ashfall.github.io/blog/2013/06/15/the-twisted-reactor-part-1/) detailing why we nest this import statement within `startService` method: > If you import `twisted.internet.reactor` without first installing a specific reactor implementation, then Twisted will install the default reactor for you. The particular one you get will depend on the operating system and Twisted version you are using. For that reason, it is general practice not to import the reactor at the top level of modules to avoid accidentally installing the default reactor. Instead, import the reactor in the same scope in which you use it. Within `startService` method, we define `connected(bot)`, which assigns our private variable we defined earlier, `_bot`, to the passed-in parameter, `bot`. We also define `failure(err)` within `startService` to log that we could not connect to a specific service, along with the error message the failure gave us. We then stop our reactor upon calling `failure`. Next, we instantiate the `QuotePicker` class with our quote file with defining `quotes`. This pulls in all our quotes within `quotes.txt` file. Now we need to define a `client` that basically constructs an endpoint based on a string with `clientFromString` function. The `clientFromString` takes in the `reactor` that we imported, and the endpoint, which is grabbed from the endpoint string defined in our `settings.ini` file. The `reactor` Twisted’s event loop driving your Twisted applications. More about Twisted’s `reactor` object is detailed in its [howto documentation](http://twistedmatrix.com/documents/current/core/howto/reactor-basics.html). We then create a `factory` variable that instantiates `TalkBackBotFactory` defined in `bot.py` which passes in the appropriate parameters. Last, we return `client`, defined by our endpoint, and connect to our endpoint with the `factory` variable. We also add `addCallbacks` which take a pair of functions of what happens on success and on failure (our `connected` and `failure` functions). The last function we define in our `TalkBackBotService` class is `stopService`: ```python # <--snip--> def stopService(self): """Disconnect.""" if self._bot and self._bot.transport.connected: self._bot.transport.loseConnection() # <--snip--> ``` It is a [deferred](http://twistedmatrix.com/documents/current/core/howto/defer.html) (a callback which we put off until later) that is triggered when the service closes our connection between the client and server (if `_bot` is not `None`, and if the bot is connected). Near the home stretch! ### Constructing BotServiceMaker At the very end of our plugin module, we have to include: `serviceMaker = BotServiceMaker()` to construct an object which provides the relevant interfaces to bind to `IPlugin` and `IServiceMaker`. ### Completed talkbackbot_plugin.py ```python from ConfigParser import ConfigParser from twisted.application.service import IServiceMaker, Service from twisted.internet.endpoints import clientFromString from twisted.plugin import IPlugin from twisted.python import usage, log from zope.interface import implementer from talkback.bot import TalkBackBotFactory from talkback.quote_picker import QuotePicker class Options(usage.Options): optParameters = [ ['config', 'c', 'settings.ini', 'Configuration file.'], ] class TalkBackBotService(Service): _bot = None def __init__(self, endpoint, channel, nickname, realname, quotesFilename, triggers): self._endpoint = endpoint self._channel = channel self._nickname = nickname self._realname = realname self._quotesFilename = quotesFilename self._triggers = triggers def startService(self): """Construct a client & connect to server.""" from twisted.internet import reactor def connected(bot): self._bot = bot def failure(err): log.err(err, _why='Could not connect to specified server.') reactor.stop() quotes = QuotePicker(self._quotesFilename) client = clientFromString(reactor, self._endpoint) factory = TalkBackBotFactory( self._channel, self._nickname, self._realname, quotes, self._triggers, ) return client.connect(factory).addCallbacks(connected, failure) def stopService(self): """Disconnect.""" if self._bot and self._bot.transport.connected: self._bot.transport.loseConnection() @implementer(IServiceMaker, IPlugin) class BotServiceMaker(object): tapname = "twsrs" description = "IRC bot that provides quotations from notable women" options = Options def makeService(self, options): """Construct the talkbackbot service.""" config = ConfigParser() config.read([options['config']]) triggers = [ trigger.strip() for trigger in config.get('talkback', 'triggers').split('\n') if trigger.strip() ] return TalkBackBotService( endpoint=config.get('irc', 'endpoint'), channel=config.get('irc', 'channel'), nickname=config.get('irc', 'nickname'), realname=config.get('irc', 'realname'), quotesFilename=config.get('talkback', 'quotesFilename'), triggers=triggers, ) # Now construct an object which *provides* the relevant interfaces # The name of this variable is irrelevant, as long as there is *some* # name bound to a provider of IPlugin and IServiceMaker. serviceMaker = BotServiceMaker() ``` Now on to writing tests for our [bot &rarr;]( {{ get_url("/~drafts/networks/part-5/")}})
34.727723
510
0.704989
eng_Latn
0.953676
e5e406cdf9ec0f170f282d6c361b0cb4b2273796
102
md
Markdown
content/sections/section0.md
thesimplekid/website-hugo
56ee6d43c48271d597a9c5d28f17bfbe8c4e4311
[ "MIT" ]
null
null
null
content/sections/section0.md
thesimplekid/website-hugo
56ee6d43c48271d597a9c5d28f17bfbe8c4e4311
[ "MIT" ]
null
null
null
content/sections/section0.md
thesimplekid/website-hugo
56ee6d43c48271d597a9c5d28f17bfbe8c4e4311
[ "MIT" ]
null
null
null
--- title: "Header" weight: 1 improvecontrast: true section_id: "heading" name: Brendan T. Murphy ---
12.75
23
0.705882
eng_Latn
0.816055
e5e42f60daf96cb085944b84de16a9b6e2396a0e
51
md
Markdown
README.md
RAMESHDUMALA/TI-Tiva-C-Librarry
30a905f2420607e8c90d13d54ab022ef2a9dfa5f
[ "BSD-3-Clause" ]
null
null
null
README.md
RAMESHDUMALA/TI-Tiva-C-Librarry
30a905f2420607e8c90d13d54ab022ef2a9dfa5f
[ "BSD-3-Clause" ]
null
null
null
README.md
RAMESHDUMALA/TI-Tiva-C-Librarry
30a905f2420607e8c90d13d54ab022ef2a9dfa5f
[ "BSD-3-Clause" ]
1
2019-05-13T16:25:10.000Z
2019-05-13T16:25:10.000Z
# TI-Tiva-C-Librarry energia and ccs ide compatabe
17
29
0.784314
por_Latn
0.368725
e5e46dbd25b2478fecc4d50e43a5ebca7bd20afc
16,844
md
Markdown
docs/api.md
stevenshave/PyBindingCurve
c9b28ffb854da98fbb9fe60a5d674529425dd25e
[ "MIT" ]
7
2019-12-20T13:06:05.000Z
2022-01-28T20:23:21.000Z
docs/api.md
stevenshave/PyBindingCurve
c9b28ffb854da98fbb9fe60a5d674529425dd25e
[ "MIT" ]
9
2018-10-19T10:08:17.000Z
2018-11-30T22:12:37.000Z
docs/api.md
stevenshave/PyBindingCurve
c9b28ffb854da98fbb9fe60a5d674529425dd25e
[ "MIT" ]
1
2020-04-20T15:52:08.000Z
2020-04-20T15:52:08.000Z
# PyBindingCurve API reference Documentation and API Full PyBindingCurve source code can be found here: https://github.com/stevenshave/pybindingcurve - [Overview](#Overview) - [pbc.BindingCurve](#pbc.BindingCurve) - [Initialisation](###Initialisation) - [add_curve](###add_curve) - [query](###query) - [fit](###fit) - [add_scatter](###add_scatter) - [show_plot](###show_plot) - [pbc.systems and shortcut strings](##pbc.systems) - [pbc.BindingSystem](##pbc.BindingSystem) - [pbc.Readout](##pbc.Readout) ## Overview Conventionally, the standard import utilised in a run of PyBindingCurve (PBC) are defined as follows: import pybindingcurve as pbc import numpy as np PyBindingCurve is imported with the short name ‘pbc’, and then NumPy as ‘np’ to enable easy specification of ranged system parameters, evenly spaced across intervals mimicking titrations. Next, we initialise a PBC BindingCurve object. Upon initialisation, either a string or BindingSystem object is used to define the system to be simulated. Simple strings such as “1:1”, “competition”, “homodimer breaking” can be used as an easy way to define the type of binding system that should be mathematically modelled. See the list of available system shortcut strings bellow in the ‘pbc.systems and shortcut strings’ section bellow. Custom objects may also be created of type pybindingcurve.BindingSystem, of which there exist a large choice within pybindingcurve.systems, or the user may create a custom BindingSystem to initialise PBC objects: my_system=pbc.BindingCurve(“1:1”) There are three main modes of operation within PyBindingCurve; 1) Visualisation of protein-ligand behaviour within a titration, simulating a range of conditions. 2) Simulation of a single system state with discrete parameters. 3) Fitting of experimental data. A description of these follows: 1. Simulation with visualisation: pass a dictionary containing system parameters to the add_curve function of the BindingCurve object (my_system). Required system parameters depend on the system being modelled. In the case of 1:1 binding, we require p (protein concentration), l (ligand concentration), kdpl (dissociation constant between p and l), and optionally, a ymax and/or ymin variable if dealing with simulation of a signal. add_curve expects one changing parameter, which will be the x-axis. By default, complex concentration will be the readout of a system, but that can be changed by passing different readout options to add_curve. See the ‘pbc.Readout’ section bellow for further information. With one curve added, we can add more curves, or simply display the plot by calling the show_plot function. ```python system_parameters={‘p’:np.linspace(0,20), ‘l’:20, ‘kdpl’:10) my_system.add_curve(system_parameters) my_system.show_plot() ``` 2. Single point simulation: if you require not a simulation with a curve, but a single point with set concentrations and KDs, then query may be called with a dictionary of system parameters and data returned. Additionally, if the dictionary contains a NumPy array, representing a titration (for example, the system parameters above), then a NumPy array of the readout is returned instead of a single value: ```python complex_conc = my_system.query({‘p’:10, ‘l’:20, ‘kdpl’:10}) ``` 3. Fit experimental data to a system to obtain experimental parameters, such as KD. A common situation is determining KD from measurements obtained from experimental data. We can perform this as follows, with x- and y-coordinates, we add the experimental points to the plot, define system parameters that we do know (protein concentrations, and the amount of ligand), and then call fit on the system passing in parameters to fit and an initial guess (1), along with the known parameters. We then iterate and print the fitted parameters. ```python xcoords = np.array([0.0, 20.0, 40.0, 60.0, 80.0, 100.0, 120.0, 140.0, 160.0, 180.0, 200.0]) ycoords = np.array([0.544, 4.832, 6.367, 7.093, 7.987, 9.005, 9.079, 8.906, 9.010, 10.046, 9.225]) my_system.add_scatter(xcoords, ycoords) system_parameters = {"p": xcoords, "l": 10} fitted_system, fit_accuracy = my_system.fit(system_parameters, {"kdpl": 1}, ycoords) for k, v in fit_accuracy.items(): print(f"Fit: {k}={fitted_system[k]} +/- {v}") ``` ## pbc.BindingCurve The BindingCurve object allows the user to work with a specific system, supplying tools for simulation and visualisation (plotting), querying of single point values, and fitting of experimental parameters to observation data. ### Initialisation When initialising this main class of PBC, we may supply either a pbc.BindingSystem, a human readable shortcut string such as “1:1”, “competition”, “homodimer formation”, etc, or a system definition string. For a full list of systems, shortcuts, and custom systems definition strings, please refer to the ‘pbc.systems and shortcut strings’ section. Initialisation of a BindingCurve object takes the following arguments: """ BindingCurve class, used to simulate systems BindingCurve objects are governed by their underlying system, defining the (usually) protein-ligand binding system being represented. It also provides the main interface for simulation, visualisation, querying and the fitting of system parameters. Parameters ---------- binding_system : BindingSystem or str Define the binding system which will govern this BindingCurve object. Can either be a BindingSystem object, a shortcut string describing a system (such as '1:1' or 'competition', etc), or a custom binding system definition string. """ Once intitialised with a pbc.BindingSystem, we may perform the following utilising its member functions. ### add_curve The add curve function is the main way of simulating a binding curve with PBC. Once a BindingCurve object is initialised, """ Add a curve to the plot Add a curve as specified by the system parameters to the pbc.BindingSystem's internal plot using the underlying binding system specified on intitialisation. Parameters ---------- parameters : dict Parameters defining the system to be simulated name : str or None, optional Name of curve to appear in plot legends readout : Readout.function, optional Change the system readout to one described by a custom readout function. Predefined standard readouts can be found in the static pbc.Readout class. """ ### query When simulation with visualisation (plotting) is not required, we can use the query function to interrogate a system, returning either singular values, or arrays of values if one of the input parameters is an array or list. """ Query a binding system Get the readout from from a set of system parameters Parameters ---------- parameters : dict System parameters defining the system being queried. Will usually contain protein, ligand etc concentrations, and KDs readout : func or None Change the readout of the system, can be None for unmodified (usually complex concentration), a static member function from the pbc.Readout class, or a custom written function following the the same defininition as those in pbc.Readout. Returns ------- Single floating point, or array-like Response/signal of the system """ ### fit With a system defined, we may fit experimental data to the system. """ Fit the parameters of a system to a set of data points Fit the system to a set of (usually) experimental datapoints. The fitted parameters are stored in the system_parameters dict which may be accessed after running this function. It is possible to fit multiple parameters at once and define bounds for the parameters. The function returns a dictionary of the accuracy of fitted parameters, which may be captured, or not. Parameters: system_parameters : dict Dictionary containing system parameters, will be used as arguments to the systems equations. to_fit : dict Dictionary containing system parameters to fit. xcoords : np.array X coordinates of data the system parameters should be fit to ycoords : np.array Y coordinates of data the system parameters should be fit to bounds : dict Dictionary of tuples, indexed by system parameters denoting the lower and upper bounds of a system parameter being fit, optional, default = None Returns ------- tuple (dict, dict) Tuple containing a dictionary of best fit systems parameters, then a dictionary containing the accuracy for fitted variables. """ ### add_scatter Experimental data can be added plots with the add_scatter command, taking a simple list of x and y coordinates """ Add scatterpoints to a plot, useful to represent real measurement data X and Y coordinates may be added to the internal plot, useful when fitting to experimental data, and wanting to plot the true experimental values alongside a curve generated with fitted parameters. Parameters ---------- xcoords : list or array-like x-coordinates ycoords : list or array-like y-coordinates """ ### show_plot With curves, scatterpoints and fits applied, we may display the plot. """ Show the PyBindingCurve plot Function to display the internal state of the pbc BindingCurve objects plot. Parameters ---------- title : str The title of the plot (default = "System simulation") xlabel: str X-axis label (default = None) ylabel : str Y-axis label (default = None, causing label to be "[Complex]") min_x : float X-axis minimum (default = None) max_x : float X-axis maximum (default = None) min_y : float Y-axis minimum (default = None) max_y : float Y-axis maximum (default = None) log_x_axis : bool Log scale on X-axis (default = False) log_y_axis : bool Log scale on Y-axis (default = False) ma_style : bool Apply MA styling, making plots appear like GraFit plots png_filename : str File name/location where png will be written svg_filename : str File name/location where svg will be written """ ## pbc.systems pbc.systems contains all default systems supplied with PBC, and exports them to the PBC namespace. Systems may be passed as arguments to pbc.BindingCurve objects upon initialization to define the underlying system governing simulation, queries, and fitting. Additionally, the following shortcut strings may be used as shortcuts, all spaces are removed from the input string, and so are represented without whitespace bellow: |Shortcut string list|pbc.systems equivalent| |---|---| |simple, 1:1, 1:1analytical|System_analytical_one_to_one__pl| |1:1min, 1:1minimizer, 1:1minimiser|System_minimizer_one_to_one__pl| |simplelagrange, 1:1lagrange|System_lagrange_one_to_one__pl| |simplekinetic, 1:1kinetic| System_kinetic_one_to_one__pl| |homodimerformation| System_analytical_homodimerformation__pp| |homodimerformationmin, homodimerformationminimiser, homodimerformationminimizer, homodimermin, homodimerminimiser, homodimerminimizer| System_minimizer_homodimerformation__pp| |homodimerformationlagrange|System_lagrange_homodimerformation__pp| |homodimerformationkinetic|System_kinetic_homodimerformation__pp| |competition, 1:1:1|System_analytical_competition__pl| |competitionmin, competitionminimiser, competitionminimizer, 1:1:1min, 1:1:1minimiser, 1:1:1minimizer|System_minimizer_competition__pl| |competitionlagrange|System_lagrange_competition__pl| |homodimerbreaking, homodimerbreakingmin, homodimerbreakingminimiser, homodimerbreakingminimizer|System_minimizer_homodimerbreaking__pp| |homodimerbreakinglagrange|System_lagrange_homodimerbreaking__pp| |homodimerbreakingkinetic|System_kinetic_homodimerbreaking__pp| |homodimerbreakinganalytical|System_analytical_homodimerbreaking__pp| |1:2, 1:2min, 1:2minimizer, 1:2minimiser| System_minimizer_1_to_2__pl12| |1:2lagrange| System_lagrange_1_to_2__pl12| |1:3, 1:3min, 1:3minimizer, 1:3minimiser|System_minimizer_1_to_3__pl123| |1:3lagrange| System_lagrange_1_to_3__pl123| |1:4, 1:4lagrange| System_lagrange_1_to_4__pl1234| |1:5, 1:5lagrange| System_lagrange_1_to_5__pl12345| Custom systems can be passed allowing the use of custom binding systems derived from a simple syntax. This is in the form of a string with reactions separated either on newlines, commas, or a combination of the two. Reactions take the form: - r1+r2<->p Denoting reactant1 + reactant2 form the product. PBC will generate and solve custom defined constrained systems. Readouts are signified by inclusion of a star (*) on a species. If no star is found, then the first seen product is used. Some system examples follow: - "P+L<->PL" - standard protein-ligand binding - "P+L<->PL, P+I<->PI" - competition binding - "P+P<->PP" - dimer formation - "monomer+monomer<->dimer" - dimer formation - "P+L<->PL1, P+L<->PL2, PL1+L<->PL1L2, PL2+L<->PL1L2" - 1:2 site binding KDs passed to custom systems use underscores to separate species and products. P+L<->PL would require the KD passed as kd_p_l_pl. Running with incomplete system parameters will prompt for the correct ones. ## pbc.BindingSystem Custom binding systems may be defined through inheritance from the base class pbc.BindingSystem. This provides basic functionality through a standard interface to PBC, allowing simulation, querying and fitting. It expects the child class to provide a constructor which passes a function for querying the system and a query method. An example pbc.BindingSystem for 1:1 binding solved analytically is defined as follows: ``` class System_analytical_one_to_one_pl(BindingSystem): def __init__(self): super().__init__( analyticalsystems.system01_one_to_one__p_l_kd__pl, analytical=True ) self.default_readout = "pl" def query(self, parameters: dict): if self._are_ymin_ymax_present(parameters): parameters_no_min_max = self._remove_ymin_ymax_keys_from_dict_return_new( parameters ) value = super().query(parameters_no_min_max) with np.errstate(divide="ignore", invalid="ignore"): return ( parameters["ymin"] + ((parameters["ymax"] - parameters["ymin"]) * value) / parameters["l"] ) else: return super().query(parameters) ``` Here, we see the parent class constructor called upon initialisation of the object with two arguments, the first is a python function which calculates the complex concentration present in a 1:1 binding system, which itself takes the appropriate parameters to calculate this. In addition, a flag is set to define when the solution is solved analytically. The query method examines the content of the system and deals with the presence of ymin and ymax to denote a signal is being simulated. Query should ultimately end up calling query on the parent class, which has been set to return the result of the previously assigned function in the constructor. ## pbc.Readout The pbc.Readout class contains three static methods, not requiring object initialisation for use. These methods all take in a system parameters dictionary describing the system, and the y_values resulting from system query calls (either through simulation of querying for singular values). These readout functions offer a convenient way to transform results. For example, the readout function to transform complex concentration into fraction ligand bound is defined as follows: ``` def fraction_l(system_parameters: dict, y): """ Readout as fraction ligand bound """ return "Fraction l bound", y / system_parameters["l"] ``` This returns a tuple, with the first value being used in labelling of the plot y-axis, and the second the y-values to be plotted; in this case, the original y values divided by the overall starting ligand concentration. Similar functions can be defined and used interchangeably with those found in pbc.Readout.
56.905405
815
0.725778
eng_Latn
0.992689
e5e4e98d0e50cff695ddc67016d9682944737564
125
md
Markdown
README.md
serralvo/xcode-templates-examples
157a527f7ff7c6b5469fb41b05af3af815333a6e
[ "MIT" ]
null
null
null
README.md
serralvo/xcode-templates-examples
157a527f7ff7c6b5469fb41b05af3af815333a6e
[ "MIT" ]
null
null
null
README.md
serralvo/xcode-templates-examples
157a527f7ff7c6b5469fb41b05af3af815333a6e
[ "MIT" ]
null
null
null
# Xcode Templates - Examples Examples that I've presented on _Productivity with Xcode Templates_ @ 32º CocoaTalks Campinas.
31.25
94
0.808
eng_Latn
0.766639
e5e545309da4b2994e6dcfd6d66c7e5133b237c4
174
md
Markdown
README.md
gacemabderaouf/DanyaProject
0309d74ac30c205101eb9561298ed9564135be9f
[ "Apache-2.0" ]
1
2019-09-29T10:41:04.000Z
2019-09-29T10:41:04.000Z
README.md
gacemabderaouf/DanyaProject
0309d74ac30c205101eb9561298ed9564135be9f
[ "Apache-2.0" ]
null
null
null
README.md
gacemabderaouf/DanyaProject
0309d74ac30c205101eb9561298ed9564135be9f
[ "Apache-2.0" ]
null
null
null
# DanyaProject this is an implementation of Mister's Dahak idea, which consist on a site creating platform with intuitive langage and several default and customizable object
58
158
0.833333
eng_Latn
0.99984
e5e6577f94bc12418c70fdef8cede118a6508ca3
1,523
md
Markdown
README.md
kristoferk/queryToObj
e7724ea576306e6ce34d4c4fef0508827ea72ff4
[ "MIT" ]
null
null
null
README.md
kristoferk/queryToObj
e7724ea576306e6ce34d4c4fef0508827ea72ff4
[ "MIT" ]
1
2016-12-26T08:08:55.000Z
2019-03-21T14:59:09.000Z
README.md
kristoferk/queryToObj
e7724ea576306e6ce34d4c4fef0508827ea72ff4
[ "MIT" ]
null
null
null
# query-to-obj ![](https://api.travis-ci.org/kristoferk/query-to-obj.svg?branch=master) Converts a javascript object to a url query string. Supports lists and nested objects. ## Installation ```shell npm install query-to-obj --save ``` ## Usage ```js import queryToObj from 'query-to-obj'; const obj = queryToObj("Id=3&Name=Example&List=a&List=b&Sub.Prop=S"); //Result: // { // Id: 3, // Name: 'Example', // List: ['a', 'b'], // Sub: { Prop: 'S' } // } ``` ## Optional settings ```js import queryToObj from 'query-to-obj'; const obj = queryToObj("Id=3&Name=Example&EmptyKey=", { skipEmptyValues: false, //If empty string values should be included in object, Default: false keyCase: 'camelCase', //Convert keys to camelCase, also support for 'PascalCase', 'snake_case' and 'None'. Default: 'None' valueCase: 'lowercase', //Convert values to lowercase, also support for 'UPPERCASE' and 'None'. Default: 'None' skipCast: true, //If values should be casted to other types then strings, Default: false decode: true //If values should be url decoded, Default: false }); //Result: // { // id: '3', // name: 'example' // } ``` ## Tests ```shell npm test ``` ## Release History * 1.0.0 Initial release * 1.0.1 Add some optional settings for manipulating case on keys and values * 1.0.2 Fixed issue with decoding keys [#1](https://github.com/kristoferk/query-to-obj/issues/1) (Thanks to Eli Doran for reporting issue)
24.174603
139
0.64478
eng_Latn
0.694319
e5e74e27012c1b591617b695bc62ab99860d1d53
606
md
Markdown
ru/update.md
dannytrue/docs
96f877ecb807441e2daa1c503917ec0418b8e7b3
[ "MIT" ]
18
2016-11-23T14:35:24.000Z
2021-11-28T07:47:02.000Z
ru/update.md
dannytrue/docs
96f877ecb807441e2daa1c503917ec0418b8e7b3
[ "MIT" ]
14
2016-11-23T13:59:30.000Z
2019-10-13T00:45:04.000Z
ru/update.md
dannytrue/docs
96f877ecb807441e2daa1c503917ec0418b8e7b3
[ "MIT" ]
43
2016-11-18T07:23:54.000Z
2022-01-19T21:33:51.000Z
# Руководство по обновлению Обновление пакета осуществляется с помощью `composer` ```bash $ composer update ``` После обновления, желательно выполнять команду ```bash $ php artisan sleepingowl:update ``` или ```bash $ php artisan vendor:publish --tag=assets --force ``` для обновления компонентов. Также стоит сбросить кеш view ```bash $ php artisan view:clear ``` При желании можно добавить команду в `composer.json` для автоматического запуска команды ```json { "scripts": { "post-update-cmd": [ ... "php artisan sleepingowl:update" ] }, } ```
14.780488
88
0.661716
rus_Cyrl
0.771527
e5e752580040c51f695d3c8f20bc945030c977c2
2,805
md
Markdown
wdk-ddi-src/content/ntddk/ns-ntddk-_whea_timestamp.md
hsebs/windows-driver-docs-ddi
d655ca4b723edeff140ca2d9cc1bfafd72fcda97
[ "CC-BY-4.0", "MIT" ]
null
null
null
wdk-ddi-src/content/ntddk/ns-ntddk-_whea_timestamp.md
hsebs/windows-driver-docs-ddi
d655ca4b723edeff140ca2d9cc1bfafd72fcda97
[ "CC-BY-4.0", "MIT" ]
null
null
null
wdk-ddi-src/content/ntddk/ns-ntddk-_whea_timestamp.md
hsebs/windows-driver-docs-ddi
d655ca4b723edeff140ca2d9cc1bfafd72fcda97
[ "CC-BY-4.0", "MIT" ]
1
2021-04-22T21:40:43.000Z
2021-04-22T21:40:43.000Z
--- UID: NS:ntddk._WHEA_TIMESTAMP title: _WHEA_TIMESTAMP (ntddk.h) description: The WHEA_TIMESTAMP union describes the time that an error was reported to the operating system. old-location: whea\whea_timestamp.htm tech.root: whea ms.assetid: 70a6555d-1da9-4013-911a-4a9d011b0205 ms.date: 02/20/2018 ms.keywords: "*PWHEA_TIMESTAMP, PWHEA_TIMESTAMP, PWHEA_TIMESTAMP union pointer [WHEA Drivers and Applications], WHEA_TIMESTAMP, WHEA_TIMESTAMP union [WHEA Drivers and Applications], _WHEA_TIMESTAMP, ntddk/PWHEA_TIMESTAMP, ntddk/WHEA_TIMESTAMP, whea.whea_timestamp, whearef_d0fafe3b-0cea-4adf-a68a-b565e04ae258.xml" f1_keywords: - "ntddk/WHEA_TIMESTAMP" req.header: ntddk.h req.include-header: Ntddk.h req.target-type: Windows req.target-min-winverclnt: Supported in Windows Server 2008, Windows Vista SP1, and later versions of Windows. req.target-min-winversvr: req.kmdf-ver: req.umdf-ver: req.ddi-compliance: req.unicode-ansi: req.idl: req.max-support: req.namespace: req.assembly: req.type-library: req.lib: req.dll: req.irql: topic_type: - APIRef - kbSyntax api_type: - HeaderDef api_location: - ntddk.h api_name: - WHEA_TIMESTAMP product: - Windows targetos: Windows req.typenames: WHEA_TIMESTAMP, *PWHEA_TIMESTAMP --- # _WHEA_TIMESTAMP structure ## -description The WHEA_TIMESTAMP union describes the time that an error was reported to the operating system. ## -struct-fields ### -field DUMMYSTRUCTNAME ### -field DUMMYSTRUCTNAME.Seconds The number of seconds past the minute. ### -field DUMMYSTRUCTNAME.Minutes The number of minutes past the hour. ### -field DUMMYSTRUCTNAME.Hours The hour in the day. ### -field DUMMYSTRUCTNAME.Precise If this member is set to 1, the timestamp correlates precisely to the time of the error event. <div class="alert"><b>Note</b>  This member is supported in Windows 7 and later versions of Windows.</div> <div> </div> ### -field DUMMYSTRUCTNAME.Reserved Reserved for system use. ### -field DUMMYSTRUCTNAME.Day The day of the month. ### -field DUMMYSTRUCTNAME.Month The month of the year. ### -field DUMMYSTRUCTNAME.Year The year within the century. ### -field DUMMYSTRUCTNAME.Century The century. ### -field AsLARGE_INTEGER A LARGE_INTEGER representation of the contents of the WHEA_TIMESTAMP union. ## -remarks A WHEA_TIMESTAMP union is contained within the <a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/ntddk/ns-ntddk-_whea_error_record_header">WHEA_ERROR_RECORD_HEADER</a> structure. ## -see-also <a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/ntddk/ns-ntddk-_whea_error_record_header">WHEA_ERROR_RECORD_HEADER</a>    
20.932836
315
0.732977
eng_Latn
0.539067
e5e75bef6c0665e72b06b9d897c85751053ebf16
13,078
md
Markdown
docs/framework/winforms/controls/rendering-a-windows-forms-control.md
badbadc0ffee/docs.de-de
50a4fab72bc27249ce47d4bf52dcea9e3e279613
[ "CC-BY-4.0", "MIT" ]
null
null
null
docs/framework/winforms/controls/rendering-a-windows-forms-control.md
badbadc0ffee/docs.de-de
50a4fab72bc27249ce47d4bf52dcea9e3e279613
[ "CC-BY-4.0", "MIT" ]
null
null
null
docs/framework/winforms/controls/rendering-a-windows-forms-control.md
badbadc0ffee/docs.de-de
50a4fab72bc27249ce47d4bf52dcea9e3e279613
[ "CC-BY-4.0", "MIT" ]
null
null
null
--- title: Rendering eines Steuer Elements ms.date: 03/30/2017 dev_langs: - csharp - vb helpviewer_keywords: - custom controls [Windows Forms], rendering - OnPaintBackground method [Windows Forms], invoking in Windows Forms custom controls - custom controls [Windows Forms], graphics resources - custom controls [Windows Forms], invalidation and painting ms.assetid: aae8e1e6-4786-432b-a15e-f4c44760d302 ms.openlocfilehash: 0e1a7ca5dc0414d518c081b1db2dca5477d4f743 ms.sourcegitcommit: de17a7a0a37042f0d4406f5ae5393531caeb25ba ms.translationtype: MT ms.contentlocale: de-DE ms.lasthandoff: 01/24/2020 ms.locfileid: "76742386" --- # <a name="rendering-a-windows-forms-control"></a>Wiedergeben eines Windows Forms-Steuerelements Rendering bezieht sich auf den Prozess der Erstellung einer visuellen Darstellung auf dem Bildschirm eines Benutzers. Windows Forms verwendet GDI (die neue Windows-Grafikbibliothek) zum Rendern. Die verwalteten Klassen, die Zugriff auf GDI bereitstellen, befinden sich im <xref:System.Drawing?displayProperty=nameWithType>-Namespace und seinen Subnamespaces. Die folgenden Elemente sind am Steuerelement Rendering beteiligt: - Die Zeichnungsfunktionen, die von der Basisklasse <xref:System.Windows.Forms.Control?displayProperty=nameWithType>bereitgestellt werden. - Die wesentlichen Elemente der GDI-Grafikbibliothek. - Die Geometrie des Zeichnungs Bereichs. - Die Vorgehensweise zum Freigeben von Grafik Ressourcen. ## <a name="drawing-functionality-provided-by-control"></a>Von Steuerelement bereitgestellte Zeichnungsfunktionen Die <xref:System.Windows.Forms.Control> der Basisklasse stellt Zeichnungsfunktionen über das <xref:System.Windows.Forms.Control.Paint>-Ereignis bereit. Ein-Steuerelement löst das <xref:System.Windows.Forms.Control.Paint>-Ereignis aus, wenn es seine Anzeige aktualisieren muss. Weitere Informationen zu Ereignissen in der .NET Framework finden Sie unter [behandeln und Auswerfen von Ereignissen](../../../standard/events/index.md). Die Ereignisdaten Klasse für das <xref:System.Windows.Forms.Control.Paint> Ereignis, <xref:System.Windows.Forms.PaintEventArgs>, enthält die Daten, die zum Zeichnen eines Steuer Elements benötigt werden – ein Handle für ein Grafik Objekt und ein Rechteck Objekt, das den Bereich darstellt, in dem gezeichnet werden soll. Diese Objekte werden im folgenden Code Fragment in Fett Schrift angezeigt. ```vb Public Class PaintEventArgs Inherits EventArgs Implements IDisposable Public ReadOnly Property ClipRectangle() As System.Drawing.Rectangle ... End Property Public ReadOnly Property Graphics() As System.Drawing.Graphics ... End Property ' Other properties and methods. ... End Class ``` ```csharp public class PaintEventArgs : EventArgs, IDisposable { public System.Drawing.Rectangle ClipRectangle {get;} public System.Drawing.Graphics Graphics {get;} // Other properties and methods. ... } ``` <xref:System.Drawing.Graphics> ist eine verwaltete Klasse, die Zeichnungsfunktionen kapselt, wie in der Erörterung von GDI weiter unten in diesem Thema beschrieben. Der <xref:System.Windows.Forms.PaintEventArgs.ClipRectangle%2A> ist eine Instanz der <xref:System.Drawing.Rectangle> Struktur und definiert den verfügbaren Bereich, in dem ein Steuerelement gezeichnet werden kann. Ein Steuerelement Entwickler kann die <xref:System.Windows.Forms.PaintEventArgs.ClipRectangle%2A> mithilfe der <xref:System.Windows.Forms.PaintEventArgs.ClipRectangle%2A>-Eigenschaft eines Steuer Elements berechnen, wie in der Erörterung von Geometry weiter unten in diesem Thema beschrieben. Ein Steuerelement muss Renderinglogik bereitstellen, indem die <xref:System.Windows.Forms.Control.OnPaint%2A> Methode überschrieben wird, die von <xref:System.Windows.Forms.Control>geerbt wird. <xref:System.Windows.Forms.Control.OnPaint%2A> erhält Zugriff auf ein Grafik Objekt und ein Rechteck, das durch die <xref:System.Drawing.Design.PaintValueEventArgs.Graphics%2A> und die <xref:System.Windows.Forms.PaintEventArgs.ClipRectangle%2A> Eigenschaften der <xref:System.Windows.Forms.PaintEventArgs> Instanz, die an das Objekt übertragen wird, gezeichnet werden soll. ```vb Protected Overridable Sub OnPaint(pe As PaintEventArgs) ``` ```csharp protected virtual void OnPaint(PaintEventArgs pe); ``` Die <xref:System.Windows.Forms.Control.OnPaint%2A>-Methode der Basis <xref:System.Windows.Forms.Control> Klasse implementiert keine Zeichnungsfunktionen, sondern ruft lediglich die Ereignis Delegaten auf, die beim <xref:System.Windows.Forms.Control.Paint>-Ereignis registriert sind. Wenn Sie <xref:System.Windows.Forms.Control.OnPaint%2A>überschreiben, sollten Sie in der Regel die <xref:System.Windows.Forms.Control.OnPaint%2A>-Methode der Basisklasse aufrufen, damit registrierte Delegaten das <xref:System.Windows.Forms.Control.Paint>-Ereignis empfangen. Allerdings sollten Steuerelemente, die ihre gesamte Oberfläche zeichnen, den <xref:System.Windows.Forms.Control.OnPaint%2A>der Basisklasse nicht aufrufen, da dadurch Flicker eingeführt wird. Ein Beispiel für das Überschreiben des <xref:System.Windows.Forms.Control.OnPaint%2A> Ereignisses finden Sie unter Gewusst [wie: Erstellen eines Windows Forms Steuer Elements, das den Fortschritt anzeigt](how-to-create-a-windows-forms-control-that-shows-progress.md). > [!NOTE] > Rufen Sie <xref:System.Windows.Forms.Control.OnPaint%2A> nicht direkt über das Steuerelement auf. Rufen Sie stattdessen die <xref:System.Windows.Forms.Control.Invalidate%2A> Methode (geerbt von <xref:System.Windows.Forms.Control>) oder eine andere Methode auf, die <xref:System.Windows.Forms.Control.Invalidate%2A>aufruft. Die <xref:System.Windows.Forms.Control.Invalidate%2A>-Methode ruft wiederum <xref:System.Windows.Forms.Control.OnPaint%2A>auf. Die <xref:System.Windows.Forms.Control.Invalidate%2A>-Methode ist überladen, und abhängig von den Argumenten, die für <xref:System.Windows.Forms.Control.Invalidate%2A> `e`bereitgestellt werden, zeichnet ein Steuerelement entweder einen Teil oder den gesamten Bildschirmbereich neu. Die Basis <xref:System.Windows.Forms.Control> Klasse definiert eine andere Methode, die zum Zeichnen von – der <xref:System.Windows.Forms.Control.OnPaintBackground%2A>-Methode nützlich ist. ```vb Protected Overridable Sub OnPaintBackground(pevent As PaintEventArgs) ``` ```csharp protected virtual void OnPaintBackground(PaintEventArgs pevent); ``` <xref:System.Windows.Forms.Control.OnPaintBackground%2A> zeichnet den Hintergrund (und damit die Form) des Fensters und ist garantiert schnell, während <xref:System.Windows.Forms.Control.OnPaint%2A> die Details zeichnet und langsamer sein kann, da einzelne Zeichnungs Anforderungen in einem <xref:System.Windows.Forms.Control.Paint> Ereignis kombiniert werden, das alle Bereiche abdeckt, die neu gezeichnet werden müssen. Möglicherweise möchten Sie den <xref:System.Windows.Forms.Control.OnPaintBackground%2A> aufrufen, wenn Sie beispielsweise einen Hintergrund Hintergrund für das Steuerelement zeichnen möchten. Obwohl <xref:System.Windows.Forms.Control.OnPaintBackground%2A> eine Ereignis ähnliche Nomenklatur hat und dasselbe Argument wie die `OnPaint`-Methode annimmt, ist <xref:System.Windows.Forms.Control.OnPaintBackground%2A> keine echte Ereignismethode. Es gibt kein `PaintBackground` Ereignis, und <xref:System.Windows.Forms.Control.OnPaintBackground%2A> ruft keine Ereignis Delegaten auf. Wenn Sie die <xref:System.Windows.Forms.Control.OnPaintBackground%2A>-Methode überschreiben, ist es nicht erforderlich, dass eine abgeleitete Klasse die <xref:System.Windows.Forms.Control.OnPaintBackground%2A>-Methode ihrer Basisklasse aufruft. ## <a name="gdi-basics"></a>GDI+-Grundlagen Die <xref:System.Drawing.Graphics>-Klasse stellt Methoden zum Zeichnen verschiedener Formen (z. b. Kreise, Dreiecke, Arcs und Ellipsen) sowie Methoden zum Anzeigen von Text bereit. Der <xref:System.Drawing?displayProperty=nameWithType>-Namespace und seine Subnamespaces enthalten Klassen, die Grafikelemente wie Formen (Kreise, Rechtecke, Arcs usw.), Farben, Schriftarten, Pinsel usw. Kapseln. Weitere Informationen zu GDI finden Sie unter [Verwenden von verwalteten Grafik Klassen](../advanced/using-managed-graphics-classes.md). Die Grundlagen von GDI werden auch im Abschnitt Gewusst [wie: Erstellen eines Windows Forms Steuer Elements beschrieben, das den Fortschritt anzeigt](how-to-create-a-windows-forms-control-that-shows-progress.md). ## <a name="geometry-of-the-drawing-region"></a>Geometrie des Zeichnungs Bereichs Die <xref:System.Windows.Forms.Control.ClientRectangle%2A>-Eigenschaft eines Steuer Elements gibt den rechteckigen Bereich an, der für das Steuerelement auf dem Bildschirm des Benutzers verfügbar ist, während die <xref:System.Windows.Forms.PaintEventArgs.ClipRectangle%2A>-Eigenschaft von <xref:System.Windows.Forms.PaintEventArgs> den tatsächlich gezeichneten Bereich angibt. (Beachten Sie, dass das Zeichnen in der <xref:System.Windows.Forms.Control.Paint> Ereignismethode erfolgt, die eine <xref:System.Windows.Forms.PaintEventArgs>-Instanz als Argument annimmt). Ein Steuerelement muss möglicherweise nur einen Teil des verfügbaren Bereichs zeichnen, wie es auch der Fall ist, wenn sich ein kleiner Abschnitt der Anzeige des Steuer Elements ändert. In diesen Fällen muss ein Steuerelement Entwickler das eigentliche Rechteck berechnen, um es zu zeichnen und an <xref:System.Windows.Forms.Control.Invalidate%2A>zu übergeben. Die überladenen Versionen von <xref:System.Windows.Forms.Control.Invalidate%2A>, die eine <xref:System.Drawing.Rectangle> oder <xref:System.Drawing.Region> als Argument akzeptieren, verwenden dieses Argument zum Generieren der <xref:System.Windows.Forms.PaintEventArgs.ClipRectangle%2A>-Eigenschaft von <xref:System.Windows.Forms.PaintEventArgs>. Das folgende Code Fragment zeigt, wie das benutzerdefinierte-Steuerelement `FlashTrackBar` den rechteckigen Bereich berechnet, in dem gezeichnet werden soll. Die `client` Variable bezeichnet die <xref:System.Windows.Forms.PaintEventArgs.ClipRectangle%2A>-Eigenschaft. Ein umfassendes Beispiel finden Sie unter Gewusst [wie: Erstellen eines Windows Forms Steuer Elements, das den Fortschritt anzeigt](how-to-create-a-windows-forms-control-that-shows-progress.md). [!code-csharp[System.Windows.Forms.FlashTrackBar#6](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.FlashTrackBar/CS/FlashTrackBar.cs#6)] [!code-vb[System.Windows.Forms.FlashTrackBar#6](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FlashTrackBar/VB/FlashTrackBar.vb#6)] ## <a name="freeing-graphics-resources"></a>Freigeben von Grafik Ressourcen Grafik Objekte sind aufwendig, da Sie Systemressourcen verwenden. Zu diesen Objekten zählen Instanzen der <xref:System.Drawing.Graphics?displayProperty=nameWithType>-Klasse sowie Instanzen von <xref:System.Drawing.Brush?displayProperty=nameWithType>, <xref:System.Drawing.Pen?displayProperty=nameWithType>und anderen Grafik Klassen. Es ist wichtig, dass Sie nur dann eine Grafik Ressource erstellen, wenn Sie Sie benötigen, und Sie nach der Verwendung sofort freigeben. Wenn Sie einen Typ erstellen, der die <xref:System.IDisposable>-Schnittstelle implementiert, rufen Sie dessen <xref:System.IDisposable.Dispose%2A> Methode auf, wenn Sie damit fertig sind, um Ressourcen freizugeben. Das folgende Code Fragment zeigt, wie das `FlashTrackBar` benutzerdefinierte Steuerelement eine <xref:System.Drawing.Brush> Ressource erstellt und freigibt. Den gesamten Quellcode finden Sie unter Gewusst [wie: Erstellen eines Windows Forms Steuer Elements, das den Fortschritt anzeigt](how-to-create-a-windows-forms-control-that-shows-progress.md). [!code-csharp[System.Windows.Forms.FlashTrackBar#5](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.FlashTrackBar/CS/FlashTrackBar.cs#5)] [!code-vb[System.Windows.Forms.FlashTrackBar#5](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FlashTrackBar/VB/FlashTrackBar.vb#5)] [!code-csharp[System.Windows.Forms.FlashTrackBar#4](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.FlashTrackBar/CS/FlashTrackBar.cs#4)] [!code-vb[System.Windows.Forms.FlashTrackBar#4](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FlashTrackBar/VB/FlashTrackBar.vb#4)] [!code-csharp[System.Windows.Forms.FlashTrackBar#3](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.FlashTrackBar/CS/FlashTrackBar.cs#3)] [!code-vb[System.Windows.Forms.FlashTrackBar#3](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FlashTrackBar/VB/FlashTrackBar.vb#3)] ## <a name="see-also"></a>Weitere Informationen - [Gewusst wie: Erstellen eines Windows Forms-Steuerelements, das den Fortschritt anzeigt](how-to-create-a-windows-forms-control-that-shows-progress.md)
106.325203
1,277
0.806851
deu_Latn
0.925355
e5e7c6714cb286ed11308c27bf0e6ae1039cf24d
243
md
Markdown
_drafts/pips/delhi_taj.md
soujanyachan/soujanyachan.github.io
5ff512c82a8028ea0cd15e9b4fc852e22316594a
[ "MIT" ]
null
null
null
_drafts/pips/delhi_taj.md
soujanyachan/soujanyachan.github.io
5ff512c82a8028ea0cd15e9b4fc852e22316594a
[ "MIT" ]
null
null
null
_drafts/pips/delhi_taj.md
soujanyachan/soujanyachan.github.io
5ff512c82a8028ea0cd15e9b4fc852e22316594a
[ "MIT" ]
null
null
null
--- created: 2021-04-01T18:06:24+05:30 modified: 2021-04-01T18:07:11+05:30 tags: [travel] --- [[travel]] If you can, go to the taj really early in the morning. Then you also cover the fort and fatehpur Sikri which is an hour away from Agra
30.375
137
0.716049
eng_Latn
0.99761
e5e8049354098568323e5adaa79d0a171007b282
1,666
md
Markdown
README.md
TeamGrid/optimistic-increment
f6c793eb84eb4416199d8cfc3eca5e6a5656c291
[ "MIT" ]
null
null
null
README.md
TeamGrid/optimistic-increment
f6c793eb84eb4416199d8cfc3eca5e6a5656c291
[ "MIT" ]
null
null
null
README.md
TeamGrid/optimistic-increment
f6c793eb84eb4416199d8cfc3eca5e6a5656c291
[ "MIT" ]
null
null
null
# Optimistic increments for Meteor Reactively increment values with a better user experience. ## Install Install [`teamgrid:optimistic-increment`](http://atmospherejs.com/teamgrid/optimistic-increment) from Atmosphere: ```bash meteor add teamgrid:optimistic-increment ``` ## Usage This package export a function called `optimisticIncrement`, which takes three parameters. ````javascript optimisticIncrement( // the first parameter must by a unique id, // to identify the value which should be incremented. 'uniqueID', // the second parameter is an object which indicates // the current value and the increment per second. { current: 0, increment: 10 }, // the third parameter is the precision and defaults to 1. // The precision sets how often the function should rerun. // basically it is the value, which will be added to current // everytime the function rerun. 0.01 ) ```` ## Example Automatically increment the revenue by 10 per second. ````javascript import { optimisticIncrement } from 'meteor/teamgrid:optimistic-increment'; import { ReactiveVar } from 'meteor/reactive-var' const revenue = new ReactiveVar({ current: 0, increment: 0}) // runs only once and log "0" Tracker.autorun(() => { current = optimisticIncrement('uniqueID', revenue.get()) console.log(current); }) // after this line, the revenue will be incremented by 10 per second. // The autorun above will rerun every 100ms to add 1 to current. revenue.set({ current: 0, increment: 10}) ```` ## Contributions Contributions are welcome. Please open issues and/or file Pull Requests. *** Made by [TeamGrid](http://www.teamgridapp.com).
28.724138
113
0.729892
eng_Latn
0.989246
e5e80fd363f82daeb7c7093489ba7474da0097d2
105,300
md
Markdown
docs/mfc/reference/clistctrl-class.md
epson12332/cpp-docs.zh-tw
1f0556b72928f1d70954557e939ccb439df2759f
[ "CC-BY-4.0", "MIT" ]
null
null
null
docs/mfc/reference/clistctrl-class.md
epson12332/cpp-docs.zh-tw
1f0556b72928f1d70954557e939ccb439df2759f
[ "CC-BY-4.0", "MIT" ]
null
null
null
docs/mfc/reference/clistctrl-class.md
epson12332/cpp-docs.zh-tw
1f0556b72928f1d70954557e939ccb439df2759f
[ "CC-BY-4.0", "MIT" ]
null
null
null
--- title: CListCtrl 類別 ms.date: 06/13/2019 f1_keywords: - CListCtrl - AFXCMN/CListCtrl - AFXCMN/CListCtrl::CListCtrl - AFXCMN/CListCtrl::ApproximateViewRect - AFXCMN/CListCtrl::Arrange - AFXCMN/CListCtrl::CancelEditLabel - AFXCMN/CListCtrl::Create - AFXCMN/CListCtrl::CreateDragImage - AFXCMN/CListCtrl::CreateEx - AFXCMN/CListCtrl::DeleteAllItems - AFXCMN/CListCtrl::DeleteColumn - AFXCMN/CListCtrl::DeleteItem - AFXCMN/CListCtrl::DrawItem - AFXCMN/CListCtrl::EditLabel - AFXCMN/CListCtrl::EnableGroupView - AFXCMN/CListCtrl::EnsureVisible - AFXCMN/CListCtrl::FindItem - AFXCMN/CListCtrl::GetBkColor - AFXCMN/CListCtrl::GetBkImage - AFXCMN/CListCtrl::GetCallbackMask - AFXCMN/CListCtrl::GetCheck - AFXCMN/CListCtrl::GetColumn - AFXCMN/CListCtrl::GetColumnOrderArray - AFXCMN/CListCtrl::GetColumnWidth - AFXCMN/CListCtrl::GetCountPerPage - AFXCMN/CListCtrl::GetEditControl - AFXCMN/CListCtrl::GetEmptyText - AFXCMN/CListCtrl::GetExtendedStyle - AFXCMN/CListCtrl::GetFirstSelectedItemPosition - AFXCMN/CListCtrl::GetFocusedGroup - AFXCMN/CListCtrl::GetGroupCount - AFXCMN/CListCtrl::GetGroupInfo - AFXCMN/CListCtrl::GetGroupInfoByIndex - AFXCMN/CListCtrl::GetGroupMetrics - AFXCMN/CListCtrl::GetGroupRect - AFXCMN/CListCtrl::GetGroupState - AFXCMN/CListCtrl::GetHeaderCtrl - AFXCMN/CListCtrl::GetHotCursor - AFXCMN/CListCtrl::GetHotItem - AFXCMN/CListCtrl::GetHoverTime - AFXCMN/CListCtrl::GetImageList - AFXCMN/CListCtrl::GetInsertMark - AFXCMN/CListCtrl::GetInsertMarkColor - AFXCMN/CListCtrl::GetInsertMarkRect - AFXCMN/CListCtrl::GetItem - AFXCMN/CListCtrl::GetItemCount - AFXCMN/CListCtrl::GetItemData - AFXCMN/CListCtrl::GetItemIndexRect - AFXCMN/CListCtrl::GetItemPosition - AFXCMN/CListCtrl::GetItemRect - AFXCMN/CListCtrl::GetItemSpacing - AFXCMN/CListCtrl::GetItemState - AFXCMN/CListCtrl::GetItemText - AFXCMN/CListCtrl::GetNextItem - AFXCMN/CListCtrl::GetNextItemIndex - AFXCMN/CListCtrl::GetNextSelectedItem - AFXCMN/CListCtrl::GetNumberOfWorkAreas - AFXCMN/CListCtrl::GetOrigin - AFXCMN/CListCtrl::GetOutlineColor - AFXCMN/CListCtrl::GetSelectedColumn - AFXCMN/CListCtrl::GetSelectedCount - AFXCMN/CListCtrl::GetSelectionMark - AFXCMN/CListCtrl::GetStringWidth - AFXCMN/CListCtrl::GetSubItemRect - AFXCMN/CListCtrl::GetTextBkColor - AFXCMN/CListCtrl::GetTextColor - AFXCMN/CListCtrl::GetTileInfo - AFXCMN/CListCtrl::GetTileViewInfo - AFXCMN/CListCtrl::GetToolTips - AFXCMN/CListCtrl::GetTopIndex - AFXCMN/CListCtrl::GetView - AFXCMN/CListCtrl::GetViewRect - AFXCMN/CListCtrl::GetWorkAreas - AFXCMN/CListCtrl::HasGroup - AFXCMN/CListCtrl::HitTest - AFXCMN/CListCtrl::InsertColumn - AFXCMN/CListCtrl::InsertGroup - AFXCMN/CListCtrl::InsertGroupSorted - AFXCMN/CListCtrl::InsertItem - AFXCMN/CListCtrl::InsertMarkHitTest - AFXCMN/CListCtrl::IsGroupViewEnabled - AFXCMN/CListCtrl::IsItemVisible - AFXCMN/CListCtrl::MapIDToIndex - AFXCMN/CListCtrl::MapIndexToID - AFXCMN/CListCtrl::MoveGroup - AFXCMN/CListCtrl::MoveItemToGroup - AFXCMN/CListCtrl::RedrawItems - AFXCMN/CListCtrl::RemoveAllGroups - AFXCMN/CListCtrl::RemoveGroup - AFXCMN/CListCtrl::Scroll - AFXCMN/CListCtrl::SetBkColor - AFXCMN/CListCtrl::SetBkImage - AFXCMN/CListCtrl::SetCallbackMask - AFXCMN/CListCtrl::SetCheck - AFXCMN/CListCtrl::SetColumn - AFXCMN/CListCtrl::SetColumnOrderArray - AFXCMN/CListCtrl::SetColumnWidth - AFXCMN/CListCtrl::SetExtendedStyle - AFXCMN/CListCtrl::SetGroupInfo - AFXCMN/CListCtrl::SetGroupMetrics - AFXCMN/CListCtrl::SetHotCursor - AFXCMN/CListCtrl::SetHotItem - AFXCMN/CListCtrl::SetHoverTime - AFXCMN/CListCtrl::SetIconSpacing - AFXCMN/CListCtrl::SetImageList - AFXCMN/CListCtrl::SetInfoTip - AFXCMN/CListCtrl::SetInsertMark - AFXCMN/CListCtrl::SetInsertMarkColor - AFXCMN/CListCtrl::SetItem - AFXCMN/CListCtrl::SetItemCount - AFXCMN/CListCtrl::SetItemCountEx - AFXCMN/CListCtrl::SetItemData - AFXCMN/CListCtrl::SetItemIndexState - AFXCMN/CListCtrl::SetItemPosition - AFXCMN/CListCtrl::SetItemState - AFXCMN/CListCtrl::SetItemText - AFXCMN/CListCtrl::SetOutlineColor - AFXCMN/CListCtrl::SetSelectedColumn - AFXCMN/CListCtrl::SetSelectionMark - AFXCMN/CListCtrl::SetTextBkColor - AFXCMN/CListCtrl::SetTextColor - AFXCMN/CListCtrl::SetTileInfo - AFXCMN/CListCtrl::SetTileViewInfo - AFXCMN/CListCtrl::SetToolTips - AFXCMN/CListCtrl::SetView - AFXCMN/CListCtrl::SetWorkAreas - AFXCMN/CListCtrl::SortGroups - AFXCMN/CListCtrl::SortItems - AFXCMN/CListCtrl::SortItemsEx - AFXCMN/CListCtrl::SubItemHitTest - AFXCMN/CListCtrl::Update helpviewer_keywords: - CListCtrl [MFC], CListCtrl - CListCtrl [MFC], ApproximateViewRect - CListCtrl [MFC], Arrange - CListCtrl [MFC], CancelEditLabel - CListCtrl [MFC], Create - CListCtrl [MFC], CreateDragImage - CListCtrl [MFC], CreateEx - CListCtrl [MFC], DeleteAllItems - CListCtrl [MFC], DeleteColumn - CListCtrl [MFC], DeleteItem - CListCtrl [MFC], DrawItem - CListCtrl [MFC], EditLabel - CListCtrl [MFC], EnableGroupView - CListCtrl [MFC], EnsureVisible - CListCtrl [MFC], FindItem - CListCtrl [MFC], GetBkColor - CListCtrl [MFC], GetBkImage - CListCtrl [MFC], GetCallbackMask - CListCtrl [MFC], GetCheck - CListCtrl [MFC], GetColumn - CListCtrl [MFC], GetColumnOrderArray - CListCtrl [MFC], GetColumnWidth - CListCtrl [MFC], GetCountPerPage - CListCtrl [MFC], GetEditControl - CListCtrl [MFC], GetEmptyText - CListCtrl [MFC], GetExtendedStyle - CListCtrl [MFC], GetFirstSelectedItemPosition - CListCtrl [MFC], GetFocusedGroup - CListCtrl [MFC], GetGroupCount - CListCtrl [MFC], GetGroupInfo - CListCtrl [MFC], GetGroupInfoByIndex - CListCtrl [MFC], GetGroupMetrics - CListCtrl [MFC], GetGroupRect - CListCtrl [MFC], GetGroupState - CListCtrl [MFC], GetHeaderCtrl - CListCtrl [MFC], GetHotCursor - CListCtrl [MFC], GetHotItem - CListCtrl [MFC], GetHoverTime - CListCtrl [MFC], GetImageList - CListCtrl [MFC], GetInsertMark - CListCtrl [MFC], GetInsertMarkColor - CListCtrl [MFC], GetInsertMarkRect - CListCtrl [MFC], GetItem - CListCtrl [MFC], GetItemCount - CListCtrl [MFC], GetItemData - CListCtrl [MFC], GetItemIndexRect - CListCtrl [MFC], GetItemPosition - CListCtrl [MFC], GetItemRect - CListCtrl [MFC], GetItemSpacing - CListCtrl [MFC], GetItemState - CListCtrl [MFC], GetItemText - CListCtrl [MFC], GetNextItem - CListCtrl [MFC], GetNextItemIndex - CListCtrl [MFC], GetNextSelectedItem - CListCtrl [MFC], GetNumberOfWorkAreas - CListCtrl [MFC], GetOrigin - CListCtrl [MFC], GetOutlineColor - CListCtrl [MFC], GetSelectedColumn - CListCtrl [MFC], GetSelectedCount - CListCtrl [MFC], GetSelectionMark - CListCtrl [MFC], GetStringWidth - CListCtrl [MFC], GetSubItemRect - CListCtrl [MFC], GetTextBkColor - CListCtrl [MFC], GetTextColor - CListCtrl [MFC], GetTileInfo - CListCtrl [MFC], GetTileViewInfo - CListCtrl [MFC], GetToolTips - CListCtrl [MFC], GetTopIndex - CListCtrl [MFC], GetView - CListCtrl [MFC], GetViewRect - CListCtrl [MFC], GetWorkAreas - CListCtrl [MFC], HasGroup - CListCtrl [MFC], HitTest - CListCtrl [MFC], InsertColumn - CListCtrl [MFC], InsertGroup - CListCtrl [MFC], InsertGroupSorted - CListCtrl [MFC], InsertItem - CListCtrl [MFC], InsertMarkHitTest - CListCtrl [MFC], IsGroupViewEnabled - CListCtrl [MFC], IsItemVisible - CListCtrl [MFC], MapIDToIndex - CListCtrl [MFC], MapIndexToID - CListCtrl [MFC], MoveGroup - CListCtrl [MFC], MoveItemToGroup - CListCtrl [MFC], RedrawItems - CListCtrl [MFC], RemoveAllGroups - CListCtrl [MFC], RemoveGroup - CListCtrl [MFC], Scroll - CListCtrl [MFC], SetBkColor - CListCtrl [MFC], SetBkImage - CListCtrl [MFC], SetCallbackMask - CListCtrl [MFC], SetCheck - CListCtrl [MFC], SetColumn - CListCtrl [MFC], SetColumnOrderArray - CListCtrl [MFC], SetColumnWidth - CListCtrl [MFC], SetExtendedStyle - CListCtrl [MFC], SetGroupInfo - CListCtrl [MFC], SetGroupMetrics - CListCtrl [MFC], SetHotCursor - CListCtrl [MFC], SetHotItem - CListCtrl [MFC], SetHoverTime - CListCtrl [MFC], SetIconSpacing - CListCtrl [MFC], SetImageList - CListCtrl [MFC], SetInfoTip - CListCtrl [MFC], SetInsertMark - CListCtrl [MFC], SetInsertMarkColor - CListCtrl [MFC], SetItem - CListCtrl [MFC], SetItemCount - CListCtrl [MFC], SetItemCountEx - CListCtrl [MFC], SetItemData - CListCtrl [MFC], SetItemIndexState - CListCtrl [MFC], SetItemPosition - CListCtrl [MFC], SetItemState - CListCtrl [MFC], SetItemText - CListCtrl [MFC], SetOutlineColor - CListCtrl [MFC], SetSelectedColumn - CListCtrl [MFC], SetSelectionMark - CListCtrl [MFC], SetTextBkColor - CListCtrl [MFC], SetTextColor - CListCtrl [MFC], SetTileInfo - CListCtrl [MFC], SetTileViewInfo - CListCtrl [MFC], SetToolTips - CListCtrl [MFC], SetView - CListCtrl [MFC], SetWorkAreas - CListCtrl [MFC], SortGroups - CListCtrl [MFC], SortItems - CListCtrl [MFC], SortItemsEx - CListCtrl [MFC], SubItemHitTest - CListCtrl [MFC], Update ms.assetid: fe08a1ca-4b05-4ff7-a12a-ee4c765a2197 ms.openlocfilehash: 63668de8134267880b48a3406c552d06376ea4f7 ms.sourcegitcommit: e79188287189b76b34eb7e8fb1bfe646bdb586bc ms.translationtype: MT ms.contentlocale: zh-TW ms.lasthandoff: 06/14/2019 ms.locfileid: "67141684" --- # <a name="clistctrl-class"></a>CListCtrl 類別 封裝「清單檢視控制項」的功能,顯示項目集合,其中每個項目是由圖示 (來自影像清單) 和標籤所組成的。 ## <a name="syntax"></a>語法 ``` class CListCtrl : public CWnd ``` ## <a name="members"></a>成員 ### <a name="public-constructors"></a>公用建構函式 |名稱|描述| |----------|-----------------| |[CListCtrl::CListCtrl](#clistctrl)|建構 `CListCtrl` 物件。| ### <a name="public-methods"></a>公用方法 |名稱|描述| |----------|-----------------| |[CListCtrl::ApproximateViewRect](#approximateviewrect)|決定顯示清單檢視控制項的項目所需的高度與寬度。| |[CListCtrl::Arrange](#arrange)|對齊格線中的項目。| |[CListCtrl::CancelEditLabel](#canceleditlabel)|取消編輯作業的項目文字。| |[CListCtrl::Create](#create)|建立清單控制項,並將它附加至`CListCtrl`物件。| |[CListCtrl::CreateDragImage](#createdragimage)|建立指定的項目拖曳影像清單。| |[CListCtrl::CreateEx](#createex)|使用指定的 Windows 延伸樣式中建立清單控制項,並將它附加至`CListCtrl`物件。| |[CListCtrl::DeleteAllItems](#deleteallitems)|從控制項中刪除所有項目。| |[CListCtrl::DeleteColumn](#deletecolumn)|從清單檢視控制項中刪除資料行。| |[CListCtrl::DeleteItem](#deleteitem)|從控制項中刪除的項目。| |[CListCtrl::DrawItem](#drawitem)|當主控描繪控制項變更的視覺外觀時呼叫。| |[CListCtrl::EditLabel](#editlabel)|開始進行就地編輯的項目文字。| |[CListCtrl::EnableGroupView](#enablegroupview)|啟用或停用是否顯示為群組的清單檢視控制項中的項目。| |[CListCtrl::EnsureVisible](#ensurevisible)|可確保項目為可見。| |[CListCtrl::FindItem](#finditem)|搜尋具有指定特性的清單檢視項目。| |[CListCtrl::GetBkColor](#getbkcolor)|擷取清單檢視控制項的背景色彩。| |[CListCtrl::GetBkImage](#getbkimage)|擷取目前的背景影像的清單檢視控制項。| |[CListCtrl::GetCallbackMask](#getcallbackmask)|擷取清單檢視控制項的回呼遮罩。| |[CListCtrl::GetCheck](#getcheck)|擷取目前的項目相關聯之狀態影像的顯示狀態。| |[CListCtrl::GetColumn](#getcolumn)|擷取控制項的資料行的屬性。| |[CListCtrl::GetColumnOrderArray](#getcolumnorderarray)|擷取清單檢視控制項的資料行順序 (由左到右)。| |[CListCtrl::GetColumnWidth](#getcolumnwidth)|擷取報表檢視] 或 [清單檢視中的資料行的寬度。| |[CListCtrl::GetCountPerPage](#getcountperpage)|計算可以垂直放入清單檢視控制項中的項目數目。| |[CListCtrl::GetEditControl](#geteditcontrol)|擷取用來編輯項目的文字編輯控制項的控制代碼。| |[CListCtrl::GetEmptyText](#getemptytext)|擷取要顯示目前的清單檢視控制項為空字串。| |[CListCtrl::GetExtendedStyle](#getextendedstyle)|擷取目前的延伸的樣式的清單檢視控制項。| |[CListCtrl::GetFirstSelectedItemPosition](#getfirstselecteditemposition)|擷取清單檢視控制項中的第一個選取的清單檢視項目位置。| |[CListCtrl::GetFocusedGroup](#getfocusedgroup)|擷取具有鍵盤焦點在目前的清單檢視控制項中的群組。| |[CListCtrl::GetGroupCount](#getgroupcount)|擷取目前的清單檢視控制項中的群組數目。| |[CListCtrl::GetGroupInfo](#getgroupinfo)|取得一組指定的清單檢視控制項中的資訊。| |[CListCtrl::GetGroupInfoByIndex](#getgroupinfobyindex)|擷取目前的清單檢視控制項中的指定群組的相關資訊。| |[CListCtrl::GetGroupMetrics](#getgroupmetrics)|擷取群組的計量。| |[CListCtrl::GetGroupRect](#getgrouprect)|擷取目前的清單檢視控制項中的指定群組的周框矩形。| |[CListCtrl::GetGroupState](#getgroupstate)|擷取目前的清單檢視控制項中的指定群組的狀態。| |[CListCtrl::GetHeaderCtrl](#getheaderctrl)|擷取的標頭控制項的清單檢視控制項。| |[CListCtrl::GetHotCursor](#gethotcursor)|擷取清單檢視控制項中啟用熱追蹤時所用的游標。| |[CListCtrl::GetHotItem](#gethotitem)|擷取目前游標下的清單檢視項目。| |[CListCtrl::GetHoverTime](#gethovertime)|擷取清單檢視控制項的目前滑鼠停留時間。| |[CListCtrl::GetImageList](#getimagelist)|擷取用於繪圖的清單檢視項目的影像清單的控制代碼。| |[CListCtrl::GetInsertMark](#getinsertmark)|擷取目前的插入標記的位置。| |[CListCtrl::GetInsertMarkColor](#getinsertmarkcolor)|擷取目前的插入標記的色彩。| |[CListCtrl::GetInsertMarkRect](#getinsertmarkrect)|擷取矩形界限的插入點。| |[CListCtrl::GetItem](#getitem)|擷取清單檢視項目的屬性。| |[CListCtrl::GetItemCount](#getitemcount)|擷取清單檢視控制項中的項目數。| |[CListCtrl::GetItemData](#getitemdata)|擷取項目相關聯的應用程式特定值。| |[CListCtrl::GetItemIndexRect](#getitemindexrect)|擷取週框的全部或部分中目前的清單檢視控制項的子項目。| |[CListCtrl::GetItemPosition](#getitemposition)|擷取清單檢視項目的位置。| |[CListCtrl::GetItemRect](#getitemrect)|擷取項目的週框。| |[CListCtrl::GetItemSpacing](#getitemspacing)|計算目前的清單檢視控制項中的項目之間的間距。| |[CListCtrl::GetItemState](#getitemstate)|擷取清單檢視項目的狀態。| |[CListCtrl::GetItemText](#getitemtext)|擷取清單檢視項目或子項目的文字。| |[CListCtrl::GetNextItem](#getnextitem)|使用指定的屬性和指定的項目指定關聯性的清單檢視項目搜尋。| |[CListCtrl::GetNextItemIndex](#getnextitemindex)|擷取具有指定的屬性集的目前清單檢視控制項中項目的索引。| |[CListCtrl::GetNextSelectedItem](#getnextselecteditem)|擷取清單檢視項目位置,並重複存取下一步 的選取的清單檢視項目的位置索引。| |[CListCtrl::GetNumberOfWorkAreas](#getnumberofworkareas)|擷取工作區域的清單檢視控制項的目前數目。| |[CListCtrl::GetOrigin](#getorigin)|擷取目前的檢視原始的清單檢視控制項。| |[CListCtrl::GetOutlineColor](#getoutlinecolor)|擷取清單檢視控制項的框線色彩。| |[CListCtrl::GetSelectedColumn](#getselectedcolumn)|擷取在清單控制項中目前選取之資料行的索引。| |[CListCtrl::GetSelectedCount](#getselectedcount)|擷取清單檢視控制項中選取的項目數目。| |[CListCtrl::GetSelectionMark](#getselectionmark)|擷取清單檢視控制項的選取範圍標記。| |[CListCtrl::GetStringWidth](#getstringwidth)|決定要顯示所有指定的字串所需的最小的資料行寬度。| |[CListCtrl::GetSubItemRect](#getsubitemrect)|擷取清單檢視控制項中項目的週框。| |[CListCtrl::GetTextBkColor](#gettextbkcolor)|擷取清單檢視控制項的文字背景色彩。| |[CListCtrl::GetTextColor](#gettextcolor)|擷取清單檢視控制項的文字色彩。| |[CListCtrl::GetTileInfo](#gettileinfo)|擷取清單檢視控制項中的圖格的相關資訊。| |[CListCtrl::GetTileViewInfo](#gettileviewinfo)|擷取清單檢視控制項中並排顯示檢視的相關資訊。| |[CListCtrl::GetToolTips](#gettooltips)|擷取要顯示工具提示的清單檢視控制項使用的工具提示控制項。| |[CListCtrl::GetTopIndex](#gettopindex)|擷取最上層的可見項目的索引。| |[CListCtrl::GetView](#getview)|取得清單檢視控制項的檢視。| |[CListCtrl::GetViewRect](#getviewrect)|擷取清單檢視控制項中的所有項目的週框。| |[CListCtrl::GetWorkAreas](#getworkareas)|擷取目前的工作區域的清單檢視控制項。| |[CListCtrl::HasGroup](#hasgroup)|判斷清單檢視控制項是否具有指定的群組。| |[CListCtrl::HitTest](#hittest)|決定哪個清單檢視項目位於指定的位置。| |[CListCtrl::InsertColumn](#insertcolumn)|在清單檢視控制項中插入新的資料行。| |[CListCtrl::InsertGroup](#insertgroup)|插入清單檢視控制項中的群組。| |[CListCtrl::InsertGroupSorted](#insertgroupsorted)|插入群組的排序清單中指定的群組。| |[CListCtrl::InsertItem](#insertitem)|在清單檢視控制項中插入新項目。| |[CListCtrl::InsertMarkHitTest](#insertmarkhittest)|擷取最接近指定點的插入點。| |[CListCtrl::IsGroupViewEnabled](#isgroupviewenabled)|判斷是否啟用清單檢視控制項的檢視。| |[CListCtrl::IsItemVisible](#isitemvisible)|指出目前的清單檢視控制項中指定的項目是否可見。| |[CListCtrl::MapIDToIndex](#mapidtoindex)|將目前的清單檢視控制項中項目的唯一識別碼對應至索引。| |[CListCtrl::MapIndexToID](#mapindextoid)|將目前的清單檢視控制項中項目的索引對應至唯一的識別碼。| |[CListCtrl::MoveGroup](#movegroup)|將指定的群組移動。| |[CListCtrl::MoveItemToGroup](#moveitemtogroup)|移動指定群組,來指定零起始的索引清單檢視控制項。| |[CListCtrl::RedrawItems](#redrawitems)|強制重新繪製的項目範圍的清單檢視控制項。| |[CListCtrl::RemoveAllGroups](#removeallgroups)|從清單檢視控制項中移除所有群組。| |[CListCtrl::RemoveGroup](#removegroup)|從清單檢視控制項中移除指定的群組。| |[CListCtrl::Scroll](#scroll)|捲動清單檢視控制項的內容。| |[CListCtrl::SetBkColor](#setbkcolor)|設定清單檢視控制項的背景色彩。| |[CListCtrl::SetBkImage](#setbkimage)|設定目前的背景影像的清單檢視控制項。| |[CListCtrl::SetCallbackMask](#setcallbackmask)|設定清單檢視控制項的回呼遮罩。| |[CListCtrl::SetCheck](#setcheck)|設定目前顯示的項目相關聯之狀態影像的狀態。| |[CListCtrl::SetColumn](#setcolumn)|設定清單檢視資料行的屬性。| |[CListCtrl::SetColumnOrderArray](#setcolumnorderarray)|設定清單檢視控制項的資料行順序 (由左到右)。| |[CListCtrl::SetColumnWidth](#setcolumnwidth)|變更報表檢視] 或 [清單檢視中的資料行的寬度。| |[CListCtrl::SetExtendedStyle](#setextendedstyle)|設定目前的延伸的樣式的清單檢視控制項。| |[CListCtrl::SetGroupInfo](#setgroupinfo)|設定為指定的清單檢視控制項群組的資訊。| |[CListCtrl::SetGroupMetrics](#setgroupmetrics)|設定群組的計量清單檢視控制項。| |[CListCtrl::SetHotCursor](#sethotcursor)|設定已啟用熱追蹤,清單檢視控制項時所使用的游標。| |[CListCtrl::SetHotItem](#sethotitem)|設定清單檢視控制項的目前作用的項目。| |[CListCtrl::SetHoverTime](#sethovertime)|設定目前暫留時間的清單檢視控制項。| |[CListCtrl::SetIconSpacing](#seticonspacing)|設定清單檢視控制項中的圖示之間的間距。| |[CListCtrl::SetImageList](#setimagelist)|將影像清單指派給 清單檢視控制項。| |[CListCtrl::SetInfoTip](#setinfotip)|設定工具提示文字。| |[CListCtrl::SetInsertMark](#setinsertmark)|將插入點設定為定義的位置。| |[CListCtrl::SetInsertMarkColor](#setinsertmarkcolor)|將插入點的色彩設定。| |[CListCtrl::SetItem](#setitem)|設定部分或全部的清單檢視項目的屬性。| |[CListCtrl::SetItemCount](#setitemcount)|準備新增大量的項目清單檢視控制項。| |[CListCtrl::SetItemCountEx](#setitemcountex)|設定虛擬清單檢視控制項的項目計數。| |[CListCtrl::SetItemData](#setitemdata)|設定項目的應用程式特定值。| |[CListCtrl::SetItemIndexState](#setitemindexstate)|在目前的清單檢視控制項中設定項目的狀態。| |[CListCtrl::SetItemPosition](#setitemposition)|將項目移至 清單檢視控制項中的指定位置。| |[CListCtrl::SetItemState](#setitemstate)|變更清單檢視控制項中項目的狀態。| |[CListCtrl::SetItemText](#setitemtext)|變更清單檢視項目或子項目的文字。| |[CListCtrl::SetOutlineColor](#setoutlinecolor)|設定清單檢視控制項的框線色彩。| |[CListCtrl::SetSelectedColumn](#setselectedcolumn)|設定選取的資料行的清單檢視控制項。| |[CListCtrl::SetSelectionMark](#setselectionmark)|設定的選取範圍標記的清單檢視控制項。| |[CListCtrl::SetTextBkColor](#settextbkcolor)|清單檢視控制項中設定文字的背景色彩。| |[CListCtrl::SetTextColor](#settextcolor)|設定清單檢視控制項的文字色彩。| |[CListCtrl::SetTileInfo](#settileinfo)|設定圖格的清單檢視控制項的資訊。| |[CListCtrl::SetTileViewInfo](#settileviewinfo)|設定中並排顯示檢視清單檢視控制項使用的資訊。| |[CListCtrl::SetToolTips](#settooltips)|設定工具提示控制項的清單檢視控制項將用來顯示工具提示。| |[CListCtrl::SetView](#setview)|設定清單檢視控制項的檢視。| |[CListCtrl::SetWorkAreas](#setworkareas)|設定位置顯示圖示,在清單檢視控制項中的區域。| |[CListCtrl::SortGroups](#sortgroups)|排序清單的群組檢視的使用者定義函式的控制項。| |[CListCtrl::SortItems](#sortitems)|使用應用程式定義的比較函式的清單檢視項目進行排序。| |[CListCtrl::SortItemsEx](#sortitemsex)|使用應用程式定義的比較函式的清單檢視項目進行排序。| |[CListCtrl::SubItemHitTest](#subitemhittest)|如果有任何項目,是在給定的位置,請判斷哪個清單檢視項目。| |[CListCtrl::Update](#update)|強制重新繪製指定的項目控制項。| ## <a name="remarks"></a>備註 除了圖示和標籤中,每個項目可以顯示在右邊的圖示和標籤資料行中的資訊。 這個控制項 (並因此`CListCtrl`類別) 僅適用於 Windows 95/98 和 Windows NT 版 3.51 下執行的程式和更新版本。 以下是簡短概觀`CListCtrl`類別。 如需詳細的概念性的討論,請參閱[使用 CListCtrl](../../mfc/using-clistctrl.md)並[控制項](../../mfc/controls-mfc.md)。 ## <a name="views"></a>檢視 清單檢視控制項可以顯示其內容以四種不同的方式,稱為 「 檢視 」。 - 圖示檢視 每個項目會顯示為全螢幕圖示 (32 x 32 像素) 其下方的標籤。 使用者可以將項目拖曳到清單的 [檢視] 視窗中的任何位置。 - 小圖示檢視 每個項目在具有右邊標籤就會顯示為小圖示 (16 x 16 像素為單位)。 使用者可以將項目拖曳到清單的 [檢視] 視窗中的任何位置。 - 清單檢視 每個項目會顯示為小圖示右邊的標籤。 項目會排列在資料行,並無法拖曳至 [清單檢視] 視窗中的任何位置。 - 報表檢視 排列在右邊的資料行中的其他資訊的那一行中,會顯示每個項目。 最左邊的資料行包含的小圖示和標籤,而且後續的資料行包含應用程式所指定的子項目。 為內嵌的標題控制項 (類別[CHeaderCtrl](../../mfc/reference/cheaderctrl-class.md)) 會實作這些資料行。 如需有關標題控制項和報表檢視中的資料行的詳細資訊,請參閱[使用 CListCtrl:將資料行加入至控制項 (報表檢視)](../../mfc/adding-columns-to-the-control-report-view.md)。 目前清單檢視控制項的樣式會判斷目前的檢視。 如需有關這些樣式和其使用方式的詳細資訊,請參閱[使用 CListCtrl:變更清單控制項樣式](../../mfc/changing-list-control-styles.md)。 ## <a name="extended-styles"></a>延伸的樣式 除了標準清單樣式類別`CListCtrl`支援一組大型的延伸樣式,提供豐富的功能。 這項功能的一些範例包括: - 將滑鼠移至 選取項目 啟用時,可讓自動選取項目時的一段時間的資料指標仍然會放在項目。 - 虛擬清單檢視 啟用時,可讓您控制,可支援最多 DWORD 項目。 這可能是加上管理應用程式上的項目資料的額外負荷。 除了項目選取範圍和焦點的資訊,必須由應用程式管理所有項目資訊。 如需詳細資訊,請參閱[使用 CListCtrl:虛擬清單控制項](../../mfc/virtual-list-controls.md)。 - 按一下一個和兩個啟用 啟用時,可讓 (自動反白顯示的項目文字) 的熱追蹤和一個或兩個按一下啟動的反白顯示的項目。 - 將拖放資料行排序 啟用時,可讓拖放時重新排列清單檢視控制項中的資料行。 只有在報表檢視中。 如需使用這些新的資訊延伸樣式,請參閱[使用 CListCtrl:變更清單控制項樣式](../../mfc/changing-list-control-styles.md)。 ## <a name="items-and-subitems"></a>項目和子項目 清單檢視控制項中的每個項目是由圖示 (來自影像清單)、 一個標籤,為目前的狀態,以及應用程式定義的值 (稱為 「 項目資料 」) 所組成。 一個以上的子項目也可以產生關聯與每個項目。 「 子項目 」 是一個字串,在報表檢視中,可以顯示在右邊的項目的圖示和標籤資料行。 清單檢視控制項中的所有項目必須具有相同數目的子項目。 類別`CListCtrl`插入、 刪除、 尋找、 及修改這些項目提供數個函數。 如需詳細資訊,請參閱 < [clistctrl:: Getitem](#getitem), [CListCtrl::InsertItem](#insertitem),並[CListCtrl::FindItem](#finditem),[將項目加入至控制項](../adding-items-to-the-control.md),並[捲動、 排列、 排序和尋找在清單控制項中](../scrolling-arranging-sorting-and-finding-in-list-controls.md)。 根據預設,清單檢視控制項負責儲存項目的圖示和文字屬性。 不過,這些項目類型中,除了類別`CListCtrl`支援 「 回呼項目。 」 「 回呼項目 」 是清單檢視項目,為其應用程式,而不是控制項 — 儲存文字、 圖示或兩者。 回呼遮罩用來指定應用程式所提供的項目屬性 (文字及/或圖示)。 如果應用程式會使用回呼項目,它必須能夠提供隨選的文字及/或圖示的屬性。 當您的應用程式已經會維護某幾項資訊很有幫助回呼項目。 如需詳細資訊,請參閱[使用 CListCtrl:回呼項目和回呼遮罩](../callback-items-and-the-callback-mask.md)。 ## <a name="image-lists"></a>影像清單 圖示、 標頭項目影像和應用程式定義狀態的清單檢視項目包含在數個映像清單中 (由類別實作[CImageList](cimagelist-class.md)),您建立並指派給清單檢視控制項。 每個清單檢視控制項可以有最多四個不同的類型的映像清單: - 大圖示 在圖示檢視用於完整大小的圖示。 - 小圖示 在小圖示、 清單和報表檢視用於圖示檢視中使用的圖示的較小版本。 - 應用程式定義的狀態 包含狀態影像,以指出應用程式定義的狀態項目的圖示旁邊會顯示。 - 標頭項目 在 [報表] 檢視用於每個標頭控制項項目中出現的小型影像。 根據預設,清單檢視控制項終結時終結; 指派給它的映像清單不過,開發人員可以自訂此行為由終結每個映像清單,不會再使用時,由應用程式。 如需詳細資訊,請參閱[使用 CListCtrl:清單項目和影像清單](../list-items-and-image-lists.md)。 ## <a name="inheritance-hierarchy"></a>繼承階層 [CObject](cobject-class.md) [CCmdTarget](ccmdtarget-class.md) [CWnd](cwnd-class.md) `CListCtrl` ## <a name="requirements"></a>需求 **標頭:** afxcmn.h ## <a name="approximateviewrect"></a> CListCtrl::ApproximateViewRect 決定顯示清單檢視控制項的項目所需的高度與寬度。 ``` CSize ApproximateViewRect( CSize sz = CSize(-1, -1), int iCount = -1) const; ``` ### <a name="parameters"></a>參數 *sz*<br/> 建議的維度的控制項,像素為單位。 如果未指定的維度,架構會使用控制項的目前寬度或高度值。 *iCount*<br/> 要在控制項中顯示的項目數目。 如果這個參數是-1,架構會使用項目的總數目前控制項中。 ### <a name="return-value"></a>傳回值 A`CSize`物件,包含大約寬度和高度所需的項目,顯示像素為單位。 ### <a name="remarks"></a>備註 此成員函式實作 Win32 巨集的行為[ListView_ApproximateViewRect](/windows/desktop/api/commctrl/nf-commctrl-listview_approximateviewrect)、 Windows SDK 中所述。 ## <a name="arrange"></a> CListCtrl::Arrange 重新置放在圖示檢視中的項目,使它們對齊方格。 ``` BOOL Arrange(UINT nCode); ``` ### <a name="parameters"></a>參數 *nCode*<br/> 指定項目的對齊樣式。 它可以是下列值之一: - LVA_ALIGNLEFT 對齊項目左邊緣處的視窗。 - LVA_ALIGNTOP 對齊項目上邊緣處的視窗。 - 根據清單檢視的目前對齊樣式 (預設值) LVA_DEFAULT 對齊的項目。 - LVA_SNAPTOGRID 齊最接近的格線位置的所有圖示。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ### <a name="remarks"></a>備註 *則 nCode*參數指定的對齊樣式。 ### <a name="example"></a>範例 ```cpp // Align all of the list view control items along the top // of the window (the list view control must be in icon or // small icon mode). m_myListCtrl.Arrange(LVA_ALIGNTOP); ``` ## <a name="canceleditlabel"></a> CListCtrl::CancelEditLabel 取消編輯作業的項目文字。 ``` void CancelEditLabel(); ``` ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_CANCELEDITLABEL](/windows/desktop/Controls/lvm-canceleditlabel)訊息、 Windows SDK 中所述。 ## <a name="clistctrl"></a> CListCtrl::CListCtrl 建構 `CListCtrl` 物件。 ``` CListCtrl(); ``` ## <a name="create"></a> CListCtrl::Create 建立清單控制項,並將它附加至`CListCtrl`物件。 ``` virtual BOOL Create( DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); ``` ### <a name="parameters"></a>參數 *dwStyle*<br/> 指定清單控制項的樣式。 套用至控制項的清單控制項樣式的任何組合。 請參閱[清單檢視的視窗樣式](/windows/desktop/Controls/list-view-window-styles)如需完整清單,這些樣式的 Windows SDK 中。 設定擴充特定控制項使用的樣式[SetExtendedStyle](#setextendedstyle)。 *rect*<br/> 指定清單控制項的大小和位置。 它可以是`CRect`物件或[RECT](/previous-versions/dd162897\(v=vs.85\))結構。 *pParentWnd*<br/> 指定清單控制項的父視窗,通常`CDialog`。 它必須不是 NULL。 *nID*<br/> 指定清單控制項的識別碼。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ### <a name="remarks"></a>備註 您建構`CListCtrl`兩個步驟。 首先,呼叫建構函式,然後呼叫`Create`,這會建立清單檢視控制項,並將它附加至`CListCtrl`物件。 若要擴充 Windows 將樣式套用至清單控制項物件,呼叫[CreateEx](#createex)而不是`Create`。 ### <a name="example"></a>範例 ```cpp m_myListCtrl.Create( WS_CHILD|WS_VISIBLE|WS_BORDER|LVS_REPORT|LVS_EDITLABELS, CRect(10,10,400,200), pParentWnd, IDD_MYLISTCTRL); ``` ## <a name="createex"></a> CListCtrl::CreateEx 建立控制項 (子視窗),並將它與關聯`CListCtrl`物件。 ``` virtual BOOL CreateEx( DWORD dwExStyle, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); ``` ### <a name="parameters"></a>參數 *dwExStyle*<br/> 指定正在建立之控制項的延伸的樣式。 如需延伸的 Windows 樣式的清單,請參閱 < *dwExStyle*參數[CreateWindowEx](/windows/desktop/api/winuser/nf-winuser-createwindowexa) Windows SDK 中。 *dwStyle*<br/> 指定清單控制項的樣式。 套用至控制項的清單控制項樣式的任何組合。 這些樣式的完整清單,請參閱[清單檢視的視窗樣式](/windows/desktop/Controls/list-view-window-styles)Windows SDK 中。 *rect*<br/> 參考[RECT](/previous-versions/dd162897\(v=vs.85\))結構描述的大小和位置,在中建立工作區座標中的視窗*pParentWnd*。 *pParentWnd*<br/> 是控制項的父視窗的指標。 *nID*<br/> 控制項的子視窗識別碼。 ### <a name="return-value"></a>傳回值 如果成功則為非零;否則為 0。 ### <a name="remarks"></a>備註 使用`CreateEx`而非[建立](#create)套用延伸的 Windows 樣式,由 Windows 延伸的樣式前置詞**WS_EX_** 。 `CreateEx` 建立具有所指定的擴充 Windows 樣式的控制項*dwExStyle*。 若要設定特定延伸的樣式至控制項,呼叫[SetExtendedStyle](#setextendedstyle)。 例如,使用`CreateEx`將這類樣式設定為 WS_EX_CONTEXTHELP,但使用`SetExtendedStyle`將這類樣式設定為 LVS_EX_FULLROWSELECT。 如需詳細資訊,請參閱本文所述的樣式[擴充清單檢視樣式](/windows/desktop/Controls/extended-list-view-styles)Windows SDK 中。 ## <a name="createdragimage"></a> CListCtrl::CreateDragImage 建立指定的項目拖曳影像清單*nItem*。 ``` CImageList* CreateDragImage( int nItem, LPPOINT lpPoint); ``` ### <a name="parameters"></a>參數 *nItem*<br/> 若要建立其拖曳影像清單的項目索引。 *lpPoint*<br/> 位址[點](/previous-versions/dd162805\(v=vs.85\))接收的映像,左上角的初始位置的結構檢視中協調。 ### <a name="return-value"></a>傳回值 如果成功則拖曳影像清單的指標否則為 NULL。 ### <a name="remarks"></a>備註 `CImageList`物件是永久的而且您必須將它完成時刪除。 例如: ```cpp CImageList* pImageList = m_myListCtrl.CreateDragImage(nItem, &point); // do something delete pImageList; ``` ## <a name="deleteallitems"></a> CListCtrl::DeleteAllItems 從清單檢視控制項中刪除所有項目。 ``` BOOL DeleteAllItems(); ``` ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ### <a name="example"></a>範例 ```cpp // Delete all of the items from the list view control. m_myListCtrl.DeleteAllItems(); ASSERT(m_myListCtrl.GetItemCount() == 0); ``` ## <a name="deletecolumn"></a> CListCtrl::DeleteColumn 從清單檢視控制項中刪除資料行。 ``` BOOL DeleteColumn(int nCol); ``` ### <a name="parameters"></a>參數 *nCol*<br/> 要刪除的資料行索引。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ### <a name="example"></a>範例 ```cpp int nColumnCount = m_myListCtrl.GetHeaderCtrl()->GetItemCount(); // Delete all of the columns. for (int i=0; i < nColumnCount; i++) { m_myListCtrl.DeleteColumn(0); } ``` ## <a name="deleteitem"></a> CListCtrl::DeleteItem 從清單檢視控制項中刪除項目。 ``` BOOL DeleteItem(int nItem); ``` ### <a name="parameters"></a>參數 *nItem*<br/> 指定要刪除之項目的索引。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ### <a name="example"></a>範例 ```cpp int nCount = m_myListCtrl.GetItemCount(); // Delete all of the items from the list view control. for (int i=0; i < nCount; i++) { m_myListCtrl.DeleteItem(0); } ``` ## <a name="drawitem"></a> CListCtrl::DrawItem 由架構的視覺外觀的主控描繪清單檢視控制項變更時呼叫。 ``` virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); ``` ### <a name="parameters"></a>參數 *lpDrawItemStruct*<br/> 長指標`DRAWITEMSTRUCT`結構,其中包含的所需的繪圖類型的相關資訊。 ### <a name="remarks"></a>備註 `itemAction`隸屬[DRAWITEMSTRUCT](/windows/desktop/api/winuser/ns-winuser-tagdrawitemstruct)結構會定義要執行的繪圖動作。 根據預設,此成員函式沒有任何作用。 覆寫此成員函式,來實作活動,抽獎獲得主控描繪`CListCtrl`物件。 應用程式應該還原選取的顯示內容中提供所有的圖形裝置介面 (GDI) 物件*lpDrawItemStruct*之前此成員函式會結束。 ## <a name="editlabel"></a> CListCtrl::EditLabel 開始進行就地編輯的項目文字。 ``` CEdit* EditLabel(int nItem); ``` ### <a name="parameters"></a>參數 *nItem*<br/> 要編輯之清單檢視項目的索引。 ### <a name="return-value"></a>傳回值 如果成功,指標`CEdit`用來編輯項目文字的物件; 否則為 NULL。 ### <a name="remarks"></a>備註 具有 LVS_EDITLABELS 視窗樣式的清單檢視控制項可讓使用者編輯進行中的項目標籤。 使用者開始編輯,方法是按一下具有焦點之項目的標籤。 使用此函式開始進行就地編輯指定的清單檢視項目的文字。 ### <a name="example"></a>範例 ```cpp // Make sure the focus is set to the list view control. m_myListCtrl.SetFocus(); // Show the edit control on the label of the first // item in the list view control. CEdit* pmyEdit = m_myListCtrl.EditLabel(1); ASSERT(pmyEdit != NULL); ``` ## <a name="enablegroupview"></a> CListCtrl::EnableGroupView 啟用或停用是否顯示為群組的清單檢視控制項中的項目。 ``` LRESULT EnableGroupView(BOOL fEnable); ``` ### <a name="parameters"></a>參數 *fEnable*<br/> 指出是否要啟用群組的 listview 控制項顯示的項目。 若要啟用群組;,則為 TRUE如果為 false,則將它停用。 ### <a name="return-value"></a>傳回值 會傳回下列值之一: - **0**能夠顯示清單檢視項目,因為群組已啟用或停用。 - **1**已成功變更控制項的狀態。 - **-1**作業失敗。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_ENABLEGROUPVIEW](/windows/desktop/Controls/lvm-enablegroupview)訊息、 Windows SDK 中所述。 ## <a name="ensurevisible"></a> CListCtrl::EnsureVisible 確保至少部分可見的清單檢視項目。 ``` BOOL EnsureVisible( int nItem, BOOL bPartialOK); ``` ### <a name="parameters"></a>參數 *nItem*<br/> 要顯示之清單檢視項目的索引。 *bPartialOK*<br/> 指定是否可接受部分的可見性。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ### <a name="remarks"></a>備註 如有必要,就會捲動清單檢視控制項。 如果*bPartialOK*參數為非零值,不捲動發生項目是否可見部分。 ### <a name="example"></a>範例 ```cpp // Ensure that the last item is visible. int nCount = m_myListCtrl.GetItemCount(); if (nCount > 0) m_myListCtrl.EnsureVisible(nCount-1, FALSE); ``` ## <a name="finditem"></a> CListCtrl::FindItem 搜尋具有指定特性的清單檢視項目。 ``` int FindItem( LVFINDINFO* pFindInfo, int nStart = -1) const; ``` ### <a name="parameters"></a>參數 *pFindInfo*<br/> 指標[LVFINDINFO](/windows/desktop/api/commctrl/ns-commctrl-taglvfindinfoa)結構,其中包含要搜尋項目的相關資訊。 *nStart*<br/> 若要開始,搜尋的項目或是-1,從頭開始的索引。 在項目*n*如果從搜尋結果中排除*n*不等於-1。 ### <a name="return-value"></a>傳回值 如果成功的項目或否則為-1 的索引。 ### <a name="remarks"></a>備註 *PFindInfo*參數所指向`LVFINDINFO`結構,其中包含用來搜尋清單檢視項目的資訊。 ### <a name="example"></a>範例 ```cpp LVFINDINFO info; int nIndex; info.flags = LVFI_PARTIAL|LVFI_STRING; info.psz = _T("item"); // Delete all of the items that begin with the string. while ((nIndex = m_myListCtrl.FindItem(&info)) != -1) { m_myListCtrl.DeleteItem(nIndex); } ``` ## <a name="getbkcolor"></a> CListCtrl::GetBkColor 擷取清單檢視控制項的背景色彩。 ``` COLORREF GetBkColor() const; ``` ### <a name="return-value"></a>傳回值 32 位元值,用來指定的 RGB 色彩。 ### <a name="example"></a>範例 範例,請參閱[CListCtrl::SetBkColor](#setbkcolor)。 ## <a name="getbkimage"></a> CListCtrl::GetBkImage 擷取目前的背景影像的清單檢視控制項。 ``` BOOL GetBkImage(LVBKIMAGE* plvbkImage) const; ``` ### <a name="parameters"></a>參數 *plvbkImage*<br/> 指標`LVBKIMAGE`結構,包含目前的背景影像的清單檢視。 ### <a name="return-value"></a>傳回值 傳回非零值,如果成功或零,否則為。 ### <a name="remarks"></a>備註 這個方法會實作行為的 Win32 巨集[ListView_GetBkImage](/windows/desktop/api/commctrl/nf-commctrl-listview_getbkimage)、 Windows SDK 中所述。 ### <a name="example"></a>範例 ```cpp LVBKIMAGE bki; // If no background image is set for the list view control use // the Microsoft homepage image as the background image. if (m_myListCtrl.GetBkImage(&bki) && (bki.ulFlags == LVBKIF_SOURCE_NONE)) { m_myListCtrl.SetBkImage( _T("http://www.microsoft.com/library/images/gifs/homepage/microsoft.gif"), TRUE); } ``` ## <a name="getcallbackmask"></a> CListCtrl::GetCallbackMask 擷取清單檢視控制項的回呼遮罩。 ``` UINT GetCallbackMask() const; ``` ### <a name="return-value"></a>傳回值 清單檢視控制項的回呼遮罩。 ### <a name="remarks"></a>備註 「 回呼項目 」 是清單檢視項目,為其應用程式,而不是控制項 — 儲存文字、 圖示或兩者。 雖然清單檢視控制項可以讓您儲存這些屬性,您可能想要使用回呼項目,如果您的應用程式已在維護某幾項資訊。 回呼遮罩可讓您指定的項目狀態位元會維護應用程式,並將它套用整個控制項,而不是特定的項目。 回呼遮罩預設為零,表示控制項正在追蹤所有項目的狀態。 如果應用程式會使用回呼項目,或指定非零的回呼遮罩,它必須能夠提供隨選的清單檢視項目屬性。 ### <a name="example"></a>範例 範例,請參閱[clistctrl:: Setcallbackmask](#setcallbackmask)。 ## <a name="getcheck"></a> CListCtrl::GetCheck 擷取目前的項目相關聯之狀態影像的顯示狀態。 ``` BOOL GetCheck(int nItem) const; ``` ### <a name="parameters"></a>參數 *nItem*<br/> 清單控制項項目以零為起始的索引。 ### <a name="return-value"></a>傳回值 非零值,如果選取的項目,否則為 0。 ### <a name="remarks"></a>備註 此成員函式實作 Win32 巨集的行為[ListView_GetCheckState](/windows/desktop/api/commctrl/nf-commctrl-listview_getcheckstate)、 Windows SDK 中所述。 ### <a name="example"></a>範例 範例,請參閱[CListCtrl::SetCheck](#setcheck)。 ## <a name="getcolumn"></a> CListCtrl::GetColumn 擷取清單檢視控制項的資料行的屬性。 ``` BOOL GetColumn( int nCol, LVCOLUMN* pColumn) const; ``` ### <a name="parameters"></a>參數 *nCol*<br/> 要擷取其屬性的資料行的索引。 *pColumn*<br/> 位址[LVCOLUMN](/windows/desktop/api/commctrl/ns-commctrl-taglvcolumna)結構,指定要擷取之資訊,並且接收到的資料行的相關資訊。 `mask`成員可讓您指定哪個資料行屬性來擷取。 如果`mask`成員指定 LVCF_TEXT 值`pszText`成員必須包含接收項目文字的緩衝區的位址和`cchTextMax`成員必須指定緩衝區的大小。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ### <a name="remarks"></a>備註 `LVCOLUMN`結構包含在報表檢視資料行的相關資訊。 ### <a name="example"></a>範例 ```cpp LVCOLUMN col; col.mask = LVCF_WIDTH; // Double the column width of the first column. if (m_myListCtrl.GetColumn(0, &col)) { col.cx *= 2; m_myListCtrl.SetColumn(0, &col); } ``` ## <a name="getcolumnorderarray"></a> CListCtrl::GetColumnOrderArray 擷取清單檢視控制項的資料行順序 (由左到右)。 ``` BOOL GetColumnOrderArray( LPINT piArray, int iCount = -1); ``` ### <a name="parameters"></a>參數 *piArray*<br/> 將包含在清單檢視控制項中的資料行的索引值的緩衝區指標。 緩衝區必須夠大,無法包含在清單檢視控制項中的資料行總數。 *iCount*<br/> 在清單檢視控制項中的資料行數目。 如果這個參數是-1,framework 自動擷取的資料行數目。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ### <a name="remarks"></a>備註 此成員函式實作 Win32 巨集的行為[ListView_GetColumnOrderArray](/windows/desktop/api/commctrl/nf-commctrl-listview_getcolumnorderarray)、 Windows SDK 中所述。 ### <a name="example"></a>範例 ```cpp // Reverse the order of the columns in the list view control // (i.e. make the first column the last, the last column // the first, and so on...). CHeaderCtrl* pHeaderCtrl = m_myListCtrl.GetHeaderCtrl(); if (pHeaderCtrl != NULL) { int nColumnCount = pHeaderCtrl->GetItemCount(); LPINT pnOrder = (LPINT) malloc(nColumnCount*sizeof(int)); ASSERT(pnOrder != NULL); m_myListCtrl.GetColumnOrderArray(pnOrder, nColumnCount); int i, j, nTemp; for (i = 0, j = nColumnCount-1; i < j; i++, j--) { nTemp = pnOrder[i]; pnOrder[i] = pnOrder[j]; pnOrder[j] = nTemp; } m_myListCtrl.SetColumnOrderArray(nColumnCount, pnOrder); free(pnOrder); } ``` ## <a name="getcolumnwidth"></a> CListCtrl::GetColumnWidth 擷取報表檢視] 或 [清單檢視中的資料行的寬度。 ``` int GetColumnWidth(int nCol) const; ``` ### <a name="parameters"></a>參數 *nCol*<br/> 指定要擷取其寬度的資料行索引。 ### <a name="return-value"></a>傳回值 寬度,單位為像素指定之資料行*nCol*。 ### <a name="example"></a>範例 ```cpp // Increase the column width of the second column by 20. int nWidth = m_myListCtrl.GetColumnWidth(1); m_myListCtrl.SetColumnWidth(1, 20 + nWidth); ``` ## <a name="getcountperpage"></a> CListCtrl::GetCountPerPage 計算可以納入垂直清單檢視控制項的可見區域時在清單檢視或報表檢視的項目數目。 ``` int GetCountPerPage() const; ``` ### <a name="return-value"></a>傳回值 可以納入垂直清單檢視控制項的可見區域時在清單檢視或報表檢視的項目數目。 ### <a name="example"></a>範例 範例,請參閱[CListCtrl::GetTopIndex](#gettopindex)。 ## <a name="geteditcontrol"></a> CListCtrl::GetEditControl 擷取用來編輯清單檢視項目的文字編輯控制項的控制代碼。 ``` CEdit* GetEditControl() const; ``` ### <a name="return-value"></a>傳回值 如果成功,指標[CEdit](cedit-class.md)用來編輯項目文字的物件; 否則為 NULL。 ### <a name="example"></a>範例 ```cpp // The string replacing the text in the edit control. LPCTSTR lpszmyString = _T("custom label!"); // If possible, replace the text in the label edit control. CEdit* pEdit = m_myListCtrl.GetEditControl(); if (pEdit != NULL) { pEdit->SetWindowText(lpszmyString); } ``` ## <a name="getemptytext"></a> CListCtrl::GetEmptyText 擷取要顯示目前的清單檢視控制項為空字串。 ``` CString GetEmptyText() const; ``` ### <a name="return-value"></a>傳回值 A [CString](../../atl-mfc-shared/reference/cstringt-class.md) ,其中包含要顯示如果控制項是空的文字。 ### <a name="remarks"></a>備註 這個方法會傳送[LVM_GETEMPTYTEXT](/windows/desktop/Controls/lvm-getemptytext)訊息,Windows SDK 中所述。 ## <a name="getextendedstyle"></a> CListCtrl::GetExtendedStyle 擷取目前的延伸的樣式的清單檢視控制項。 ``` DWORD GetExtendedStyle(); ``` ### <a name="return-value"></a>傳回值 目前使用的清單中的延伸樣式的組合檢視控制項。 如需這些延伸樣式的描述性清單,請參閱[延伸的清單檢視樣式](/windows/desktop/Controls/extended-list-view-styles)Windows SDK 中的文章。 ### <a name="remarks"></a>備註 此成員函式實作 Win32 巨集的行為[ListView_GetExtendedListViewStyle](/windows/desktop/api/commctrl/nf-commctrl-listview_getextendedlistviewstyle)、 Windows SDK 中所述。 ### <a name="example"></a>範例 範例,請參閱[CListCtrl::SetExtendedStyle](#setextendedstyle)。 ## <a name="getfirstselecteditemposition"></a> CListCtrl::GetFirstSelectedItemPosition 取得清單檢視控制項中的第一個選取的項目位置。 ``` POSITION GetFirstSelectedItemPosition() const; ``` ### <a name="return-value"></a>傳回值 位置值,可用來反覆項目或物件指標擷取、如果已不選取任何項目,則為 NULL。 ### <a name="example"></a>範例 下列程式碼範例示範如何使用此函式。 ```cpp POSITION pos = m_myListCtrl.GetFirstSelectedItemPosition(); if (pos == NULL) { TRACE(_T("No items were selected!\n")); } else { while (pos) { int nItem = m_myListCtrl.GetNextSelectedItem(pos); TRACE(_T("Item %d was selected!\n"), nItem); // you could do your own processing on nItem here } } ``` ## <a name="getfocusedgroup"></a> CListCtrl::GetFocusedGroup 擷取具有鍵盤焦點在目前的清單檢視控制項中的群組。 ``` int GetFocusedGroup() const; ``` ### <a name="return-value"></a>傳回值 如果沒有這類群組;,其狀態會是 LVGS_FOCUSED,群組的索引否則為-1。 ### <a name="remarks"></a>備註 這個方法會傳送[LVM_GETFOCUSEDGROUP](/windows/desktop/Controls/lvm-getfocusedgroup)訊息,Windows SDK 中所述。 如需詳細資訊,請參閱 LVGS_FOCUSED 值`state`隸屬[LVGROUP](/windows/desktop/api/commctrl/ns-commctrl-taglvgroup)結構。 ## <a name="getgroupcount"></a> CListCtrl::GetGroupCount 擷取目前的清單檢視控制項中的群組數目。 ``` int GetGroupCount()const; ``` ### <a name="return-value"></a>傳回值 在清單檢視控制項中的群組數目。 ### <a name="remarks"></a>備註 這個方法會傳送[LVM_GETGROUPCOUNT](/windows/desktop/Controls/lvm-getgroupcount) --> Windows SDK 中所述的訊息。 ## <a name="getgroupinfo"></a> CListCtrl::GetGroupInfo 取得一組指定的清單檢視控制項中的資訊。 ``` int GetGroupInfo( int iGroupId, PLVGROUP pgrp) const; ``` ### <a name="parameters"></a>參數 *iGroupId*<br/> 要擷取其資訊的群組識別碼。 *pgrp*<br/> 指標[LVGROUP](/windows/desktop/api/commctrl/ns-commctrl-taglvgroup)包含指定群組的相關資訊。 ### <a name="return-value"></a>傳回值 否則會傳回群組中,如果成功,則為-1 的識別碼。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_GETGROUPINFO](/windows/desktop/Controls/lvm-getgroupinfo)訊息、 Windows SDK 中所述。 ## <a name="getgroupinfobyindex"></a> CListCtrl::GetGroupInfoByIndex 擷取目前的清單檢視控制項中的指定群組的相關資訊。 ``` BOOL GetGroupInfoByIndex( int iIndex, PLVGROUP pGroup) const; ``` ### <a name="parameters"></a>參數 |參數|描述| |---------------|-----------------| |*iIndex*|[in]群組的以零為起始的索引。| |*pGroup*|[out]指標[LVGROUP](/windows/desktop/api/commctrl/ns-commctrl-taglvgroup)接收所指定之群組的相關資訊的結構*iIndex*參數。<br /><br /> 呼叫端負責初始化的成員[LVGROUP](/windows/desktop/api/commctrl/ns-commctrl-taglvgroup)結構。 設定`cbSize`成員的結構,大小和旗標`mask`來指定要擷取之資訊的成員。| ### <a name="return-value"></a>傳回值 如果成功,這個方法,則為 TRUE。否則為 FALSE。 ### <a name="remarks"></a>備註 這個方法會傳送[LVM_GETGROUPINFOBYINDEX](/windows/desktop/controls/lvm-getgroupinfobyindex) --> Windows SDK 中所述的訊息。 ### <a name="example"></a>範例 下列程式碼範例會定義變數`m_listCtrl`,也就是用來存取目前的清單檢視控制項。 下一個範例中會使用此變數。 ```cpp public: // Variable used to access the list control. CListCtrl m_listCtrl; ``` ### <a name="example"></a>範例 下列程式碼範例示範`GetGroupInfoByIndex`方法。 在先前章節中的 這個程式碼範例,我們會建立顯示標題為"ClientID"及"Grade"報表檢視中的兩個資料行的清單檢視控制項。 如果這類群組存在,下列程式碼範例會擷取其索引為 0,群組的相關資訊。 ```cpp // GetGroupInfoByIndex const int GROUP_HEADER_BUFFER_SIZE = 40; // Initialize the structure LVGROUP gInfo = {0}; gInfo.cbSize = sizeof(LVGROUP); wchar_t wstrHeadGet[GROUP_HEADER_BUFFER_SIZE] = {0}; gInfo.cchHeader = GROUP_HEADER_BUFFER_SIZE; gInfo.pszHeader = wstrHeadGet; gInfo.mask = (LVGF_ALIGN | LVGF_STATE | LVGF_HEADER | LVGF_GROUPID); gInfo.state = LVGS_NORMAL; gInfo.uAlign = LVGA_HEADER_LEFT; BOOL bRet = m_listCtrl.GetGroupInfoByIndex( 0, &gInfo ); if (bRet == TRUE) { CString strHeader = CString( gInfo.pszHeader ); CString str; str.Format(_T("Header: '%s'"), strHeader); AfxMessageBox(str, MB_ICONINFORMATION); } else { AfxMessageBox(_T("No group information was retrieved.")); } ``` ## <a name="getgroupmetrics"></a> CListCtrl::GetGroupMetrics 擷取群組的計量。 ``` void GetGroupMetrics(PLVGROUPMETRICS pGroupMetrics) const; ``` ### <a name="parameters"></a>參數 *pGroupMetrics*<br/> 指標[LVGROUPMETRICS](/windows/desktop/api/commctrl/ns-commctrl-taglvgroupmetrics)包含群組度量資訊。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_GETGROUPMETRICS](/windows/desktop/Controls/lvm-getgroupmetrics)訊息、 Windows SDK 中所述。 ## <a name="getgrouprect"></a> CListCtrl::GetGroupRect 擷取目前的清單檢視控制項中的指定群組的周框矩形。 ``` BOOL GetGroupRect( int iGroupId, LPRECT lpRect, int iCoords = LVGGR_GROUP) const; ``` ### <a name="parameters"></a>參數 |參數|描述| |---------------|-----------------| |*iGroupId*|[in]指定群組。| |*lpRect*|[in、 out]指標[RECT](/previous-versions/dd162897\(v=vs.85\))結構。 如果這個方法成功,結構會接收群組所指定的矩形座標*iGroupId*。| |*iCoords*|[in]指定要擷取的矩形座標。 使用下列值之一:<br /><br /> -LVGGR_GROUP-整個已展開群組 (預設值) 座標。<br />-LVGGR_HEADER-僅標頭 (摺疊的群組) 的座標。<br />-LVGGR_SUBSETLINK-座標只子集連結 (標記子集)。| ### <a name="return-value"></a>傳回值 如果成功,這個方法,則為 TRUE。否則為 FALSE。 ### <a name="remarks"></a>備註 呼叫端會負責配置[RECT](/previous-versions/dd162897\(v=vs.85\))所指向結構*pRect*參數。 這個方法會傳送[LVM_GETGROUPRECT](/windows/desktop/Controls/lvm-getgrouprect)訊息,Windows SDK 中所述。 ### <a name="example"></a>範例 下列程式碼範例會定義變數`m_listCtrl`,也就是用來存取目前的清單檢視控制項。 下一個範例中會使用此變數。 ```cpp public: // Variable used to access the list control. CListCtrl m_listCtrl; ``` ### <a name="example"></a>範例 下列程式碼範例示範`GetGroupRect`方法。 在先前章節中的 這個程式碼範例,我們會建立顯示標題為"ClientID"及"Grade"報表檢視中的兩個資料行的清單檢視控制項。 下列程式碼範例 3D 周圍繪製矩形的群組,其索引為 0,如果存在這類的群組。 ```cpp // GetGroupRect // Get the graphics rectangle that surrounds group 0. CRect rect; BOOL bRet = m_listCtrl.GetGroupRect( 0, &rect, LVGGR_GROUP); // Draw a blue rectangle around group 0. if (bRet == TRUE) { m_listCtrl.GetDC()->Draw3dRect( &rect, RGB(0, 0, 255), RGB(0, 0, 255)); } else { AfxMessageBox(_T("No group information was retrieved."), MB_ICONINFORMATION); } ``` ## <a name="getgroupstate"></a> CListCtrl::GetGroupState 擷取目前的清單檢視控制項中的指定群組的狀態。 ``` UINT GetGroupState( int iGroupId, DWORD dwMask) const; ``` ### <a name="parameters"></a>參數 |參數|描述| |---------------|-----------------| |*iGroupId*|[in]群組的以零為起始的索引。| |*dwMask*|[in]指定狀態来擷取之值所指定群組的遮罩。 如需詳細資訊,請參閱 <<c0> `mask` 隸屬[LVGROUP](/windows/desktop/api/commctrl/ns-commctrl-taglvgroup)結構。| ### <a name="return-value"></a>傳回值 指定的群組,或 0,如果找不到群組要求的狀態。 ### <a name="remarks"></a>備註 傳回值是位元的 AND 運算的結果上*dwMask*參數和值`state`隸屬[LVGROUP](/windows/desktop/api/commctrl/ns-commctrl-taglvgroup)結構,表示目前的清單檢視控制項。 這個方法會傳送[LVM_GETGROUPSTATE](/windows/desktop/Controls/lvm-getgroupstate)訊息,Windows SDK 中所述。 如需詳細資訊,請參閱 < [ListView_GetGroupState](/windows/desktop/api/commctrl/nf-commctrl-listview_getgroupstate)巨集。 ## <a name="getheaderctrl"></a> CListCtrl::GetHeaderCtrl 擷取的標頭控制項的清單檢視控制項。 ``` CHeaderCtrl* GetHeaderCtrl(); ``` ### <a name="return-value"></a>傳回值 使用清單檢視控制項之標頭控制項指標。 ### <a name="remarks"></a>備註 此成員函式實作 Win32 巨集的行為[ListView_GetHeader](/windows/desktop/api/commctrl/nf-commctrl-listview_getheader)、 Windows SDK 中所述。 ### <a name="example"></a>範例 範例,請參閱[CListCtrl::GetColumnOrderArray](#getcolumnorderarray)。 ## <a name="gethotcursor"></a> CListCtrl::GetHotCursor 擷取清單檢視控制項中啟用熱追蹤時所用的游標。 ``` HCURSOR GetHotCursor(); ``` ### <a name="return-value"></a>傳回值 目前正由清單檢視控制項的最忙碌的游標資源控制代碼。 ### <a name="remarks"></a>備註 此成員函式實作 Win32 巨集的行為[ListView_GetHotCursor](/windows/desktop/api/commctrl/nf-commctrl-listview_gethotcursor)、 Windows SDK 中所述。 當游標經過任何清單檢視項目,則會出現熱資料指標,啟用暫留時的選取項目時,只顯示。 藉由設定延伸樣式 LVS_EX_TRACKSELECT 啟用暫留時選取。 ### <a name="example"></a>範例 ```cpp // Set the hot cursor to be the system app starting cursor. HCURSOR hCursor = ::LoadCursor(NULL, IDC_APPSTARTING); m_myListCtrl.SetHotCursor(hCursor); ASSERT(m_myListCtrl.GetHotCursor() == hCursor); ``` ## <a name="gethotitem"></a> CListCtrl::GetHotItem 擷取目前游標下的清單檢視項目。 ``` int GetHotItem(); ``` ### <a name="return-value"></a>傳回值 清單檢視控制項的目前作用的項目索引。 ### <a name="remarks"></a>備註 此成員函式實作 Win32 巨集的行為[ListView_GetHotItem](/windows/desktop/api/commctrl/nf-commctrl-listview_gethotitem)、 Windows SDK 中所述。 經常性存取的項目定義為已啟用目前選取的項目,在經常性存取追蹤 (與將滑鼠移至 選取項目)。 如果已啟用熱追蹤,當使用者停留在清單檢視項目,項目標籤會自動反白顯示而不使用滑鼠按鈕。 ### <a name="example"></a>範例 ```cpp // Set the hot item to the first item only if no other item is // highlighted. if (m_myListCtrl.GetHotItem() == -1) m_myListCtrl.SetHotItem(0); ``` ## <a name="gethovertime"></a> CListCtrl::GetHoverTime 擷取清單檢視控制項的目前滑鼠停留時間。 ``` DWORD GetHoverTime() const; ``` ### <a name="return-value"></a>傳回值 傳回的延遲,以毫秒為單位,滑鼠資料指標必須留在項目之前加以選取。 如果傳回的值為-1,暫留時的時間就會是預設的停留時間。 ### <a name="remarks"></a>備註 此成員函式實作 Win32 巨集的行為[ListView_GetHoverTime](/windows/desktop/api/commctrl/nf-commctrl-listview_gethovertime)、 Windows SDK 中所述。 ### <a name="example"></a>範例 ```cpp // If the hover time is the default set to 1 sec. DWORD dwTime = m_myListCtrl.GetHoverTime(); if (dwTime == -1) m_myListCtrl.SetHoverTime(1000); ``` ## <a name="getimagelist"></a> CListCtrl::GetImageList 擷取用於繪圖的清單檢視項目的影像清單的控制代碼。 ``` CImageList* GetImageList(int nImageList) const; ``` ### <a name="parameters"></a>參數 *nImageList*<br/> 值,指定要擷取的映像清單。 它可以是下列值之一: - 使用大圖示 LVSIL_NORMAL 映像清單。 - 使用小圖示的 LVSIL_SMALL 映像清單。 - 狀態影像 LVSIL_STATE 映像清單。 ### <a name="return-value"></a>傳回值 用於繪製清單檢視項目影像清單的指標。 ### <a name="example"></a>範例 ```cpp ASSERT(m_myListCtrl.GetImageList(LVSIL_NORMAL) == NULL); m_myListCtrl.SetImageList(&m_lcImageList, LVSIL_NORMAL); ASSERT(m_myListCtrl.GetImageList(LVSIL_NORMAL) == &m_lcImageList); ``` ## <a name="getinsertmark"></a> CListCtrl::GetInsertMark 擷取目前的插入標記的位置。 ``` BOOL GetInsertMark(LPLVINSERTMARK plvim) const; ``` ### <a name="parameters"></a>參數 *plvim*<br/> 指標[LVINSERTMARK](/windows/desktop/api/commctrl/ns-commctrl-lvinsertmark)結構,包含插入標記的資訊。 ### <a name="return-value"></a>傳回值 否則傳回如果成功,則為 TRUE 或 FALSE。 如果傳回 FALSE 的大小`cbSize`隸屬`LVINSERTMARK`結構不等於結構的實際大小。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_GETINSERTMARK](/windows/desktop/Controls/lvm-getinsertmark)訊息、 Windows SDK 中所述。 ## <a name="getinsertmarkcolor"></a> CListCtrl::GetInsertMarkColor 擷取目前的插入標記的色彩。 ``` COLORREF GetInsertMarkColor() const; ``` ### <a name="return-value"></a>傳回值 傳回[COLORREF](/windows/desktop/gdi/colorref)結構,包含插入點的色彩。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_GETINSERTMARKCOLOR](/windows/desktop/Controls/lvm-getinsertmarkcolor)訊息、 Windows SDK 中所述。 ## <a name="getinsertmarkrect"></a> CListCtrl::GetInsertMarkRect 擷取矩形界限的插入點。 ``` int GetInsertMarkRect(LPRECT pRect) const; ``` ### <a name="parameters"></a>參數 *pRect*<br/> 指標`RECT`結構,其中包含之界限的插入點的矩形的座標。 ### <a name="return-value"></a>傳回值 會傳回下列值之一: - **0**找不到插入點。 - **1**找到插入點。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_GETINSERTMARKRECT](/windows/desktop/Controls/lvm-getinsertmarkrect)訊息、 Windows SDK 中所述。 ## <a name="getitem"></a> CListCtrl::GetItem 擷取部分或全部的清單檢視項目的屬性。 ``` BOOL GetItem(LVITEM* pItem) const; ``` ### <a name="parameters"></a>參數 *pItem*<br/> 指標[LVITEM](/windows/desktop/api/commctrl/ns-commctrl-taglvitema)收到的項目屬性的結構。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ### <a name="remarks"></a>備註 `LVITEM`結構會指定或接收的清單檢視項目屬性。 ## <a name="getitemcount"></a> CListCtrl::GetItemCount 擷取清單檢視控制項中的項目數。 ``` int GetItemCount() const; ``` ### <a name="return-value"></a>傳回值 在清單檢視控制項中的項目數目。 ### <a name="example"></a>範例 範例,請參閱[CListCtrl::DeleteItem](#deleteitem)。 ## <a name="getitemdata"></a> CListCtrl::GetItemData 擷取與指定的項目相關聯的 32 位元應用程式專屬值`nItem`。 ``` DWORD_PTR GetItemData(int nItem) const; ``` ### <a name="parameters"></a>參數 *nItem*<br/> 其資料是要擷取之清單項目的索引。 ### <a name="return-value"></a>傳回值 使用指定的項目相關聯的 32 位元應用程式特定值。 ### <a name="remarks"></a>備註 這個值是`lParam`隸屬[LVITEM](/windows/desktop/api/commctrl/ns-commctrl-taglvitema)結構,在 Windows SDK 中所述 ### <a name="example"></a>範例 ```cpp // If any item's data is equal to zero then reset it to -1. for (int i=0; i < m_myListCtrl.GetItemCount(); i++) { if (m_myListCtrl.GetItemData(i) == 0) { m_myListCtrl.SetItemData(i, (DWORD) -1); } } ``` ## <a name="getitemindexrect"></a> CListCtrl::GetItemIndexRect 擷取週框的全部或部分中目前的清單檢視控制項的子項目。 ``` BOOL GetItemIndexRect( PLVITEMINDEX pItemIndex, int iColumn, int rectType, LPRECT pRect) const; ``` ### <a name="parameters"></a>參數 |參數|描述| |---------------|-----------------| |*pItemIndex*|[in]指標[LVITEMINDEX](/windows/desktop/api/commctrl/ns-commctrl-lvitemindex)結構子項目的父項目。<br /><br /> 呼叫端會負責配置和設定的成員[LVITEMINDEX](/windows/desktop/api/commctrl/ns-commctrl-lvitemindex)結構。 這個參數不能是 NULL。| |*iColumn*|[in]控制項中的資料行的以零為起始索引。| |*rectType*|[in]要為其擷取周框的清單檢視子項目的部分。 指定下列其中一個值:<br /><br /> LVIR_BOUNDS-傳回整個子項目,包括圖示和標籤的週框矩形。<br /><br /> LVIR_ICON-傳回圖示或小圖示子項目的週框。<br /><br /> LVIR_LABEL-傳回子項目文字的週框矩形。| |*pRect*|[out]指標[RECT](/previous-versions/dd162897\(v=vs.85\))接收子項目的週框矩形的相關資訊的結構。<br /><br /> 呼叫端會負責配置[RECT](/previous-versions/dd162897\(v=vs.85\))結構。 這個參數不能是 NULL。| ### <a name="return-value"></a>傳回值 如果成功,這個方法,則為 TRUE。否則為 FALSE。 ### <a name="remarks"></a>備註 這個方法會傳送[LVM_GETITEMINDEXRECT](/windows/desktop/Controls/lvm-getitemindexrect)訊息,Windows SDK 中所述。 如需詳細資訊,請參閱 < [ListView_GetItemIndexRect 巨集](/windows/desktop/api/commctrl/nf-commctrl-listview_getitemindexrect)。 ### <a name="example"></a>範例 下列程式碼範例會定義變數`m_listCtrl`,也就是用來存取目前的清單檢視控制項。 下一個範例中會使用此變數。 ```cpp public: // Variable used to access the list control. CListCtrl m_listCtrl; ``` ### <a name="example"></a>範例 下列程式碼範例示範`GetGroupRect`方法。 進入此程式碼之前我們建立的清單檢視控制項的範例會顯示名為"ClientID"和"Grade"報表檢視中的兩個資料行。 下列程式碼範例會繪製在第二個的子項目周圍的 3D 矩形這兩個資料行中。 ```cpp // GetItemIndexRect // Get the rectangle that bounds the second item in the first group. LVITEMINDEX lvItemIndex; lvItemIndex.iGroup = 0; lvItemIndex.iItem = 1; CRect rect; BOOL bRet = m_listCtrl.GetItemIndexRect( &lvItemIndex, 0, LVIR_BOUNDS, &rect); // Draw a red rectangle around the item. m_listCtrl.GetDC()->Draw3dRect( &rect, RGB(255, 0, 0), RGB(255, 0, 0) ); ``` ## <a name="getitemposition"></a> CListCtrl::GetItemPosition 擷取清單檢視項目的位置。 ``` BOOL GetItemPosition( int nItem, LPPOINT lpPoint) const; ``` ### <a name="parameters"></a>參數 *nItem*<br/> 要擷取其位置的項目索引。 *lpPoint*<br/> 位址[點](/previous-versions/dd162805\(v=vs.85\))檢視中協調收到的項目左上角的位置的結構。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ### <a name="example"></a>範例 ```cpp POINT pt; // Move all items in the list control 100 pixels to the right. UINT i, nCount = m_myListCtrl.GetItemCount(); for (i=0; i < nCount; i++) { m_myListCtrl.GetItemPosition(i, &pt); pt.x += 100; m_myListCtrl.SetItemPosition(i, pt); } ``` ## <a name="getitemrect"></a> CListCtrl::GetItemRect 擷取週框的全部或部分的目前檢視中的項目。 ``` BOOL GetItemRect( int nItem, LPRECT lpRect, UINT nCode) const; ``` ### <a name="parameters"></a>參數 *nItem*<br/> 要擷取其位置的項目索引。 *lpRect*<br/> 位址[RECT](/previous-versions/dd162897\(v=vs.85\))接收的週框的結構。 *nCode*<br/> 清單檢視項目,要擷取周框的部分。 它可以是下列值之一: - LVIR_BOUNDS 傳回整個項目,包括圖示和標籤的週框矩形。 - LVIR_ICON 傳回圖示或小圖示的週框矩形。 - LVIR_LABEL 傳回項目文字的週框矩形。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ### <a name="example"></a>範例 ```cpp // OnClick is the handler for the NM_CLICK notification void CListCtrlDlg::OnClick(NMHDR* pNMHDR, LRESULT* pResult) { UNREFERENCED_PARAMETER(pResult); LPNMITEMACTIVATE pia = (LPNMITEMACTIVATE)pNMHDR; // Get the current mouse location and convert it to client // coordinates. CPoint pos( ::GetMessagePos() ); ScreenToClient(&pos); // Get indexes of the first and last visible items in // the listview control. int index = m_myListCtrl.GetTopIndex(); int last_visible_index = index + m_myListCtrl.GetCountPerPage(); if (last_visible_index > m_myListCtrl.GetItemCount()) last_visible_index = m_myListCtrl.GetItemCount(); // Loop until number visible items has been reached. while (index <= last_visible_index) { // Get the bounding rectangle of an item. If the mouse // location is within the bounding rectangle of the item, // you know you have found the item that was being clicked. CRect r; m_myListCtrl.GetItemRect(index, &r, LVIR_BOUNDS); if (r.PtInRect(pia->ptAction)) { UINT flag = LVIS_SELECTED | LVIS_FOCUSED; m_myListCtrl.SetItemState(index, flag, flag); break; } // Get the next item in listview control. index++; } } ``` ## <a name="getitemspacing"></a> CListCtrl::GetItemSpacing 計算目前的清單檢視控制項中的項目之間的間距。 ``` BOOL GetItemSpacing( BOOL fSmall, int* pnHorzSpacing, int* pnVertSpacing) const; ``` ### <a name="parameters"></a>參數 |參數|描述| |---------------|-----------------| |*fSmall*|[in]要擷取的項目間距的檢視。 小圖示檢視中,或圖示檢視,則為 FALSE,則指定 TRUE。| |*pnHorzSpacing*|[out]包含項目之間的水平間距。| |*pnVertSpacing*|[out]包含項目之間的垂直間距。| ### <a name="return-value"></a>傳回值 如果成功,這個方法,則為 TRUE。否則為 FALSE。 ### <a name="remarks"></a>備註 這個方法會傳送[LVM_GETITEMSPACING](/windows/desktop/Controls/lvm-getitemspacing)訊息,Windows SDK 中所述。 ## <a name="getitemstate"></a> CListCtrl::GetItemState 擷取清單檢視項目的狀態。 ``` UINT GetItemState( int nItem, UINT nMask) const; ``` ### <a name="parameters"></a>參數 *nItem*<br/> 要擷取其狀態的項目索引。 *nMask*<br/> 指定要傳回其中一個項目的狀態旗標的遮罩。 ### <a name="return-value"></a>傳回值 狀態旗標,指定清單檢視項目。 ### <a name="remarks"></a>備註 所指定項目的狀態`state`隸屬[LVITEM](/windows/desktop/api/commctrl/ns-commctrl-taglvitema)結構,在 Windows SDK 中所述。 當您指定或變更項目的狀態`stateMask`成員指定您想要變更的哪些狀態位元。 ### <a name="example"></a>範例 範例,請參閱[CListCtrl::GetTopIndex](#gettopindex)。 ## <a name="getitemtext"></a> CListCtrl::GetItemText 擷取清單檢視項目或子項目的文字。 ``` int GetItemText( int nItem, int nSubItem, LPTSTR lpszText, int nLen) const; CString GetItemText( int nItem, int nSubItem) const; ``` ### <a name="parameters"></a>參數 *nItem*<br/> 要擷取其文字的項目索引。 *nSubItem*<br/> 指定的文字是要擷取的子項目。 *lpszText*<br/> 要接收項目文字的字串指標。 *nLen*<br/> 所指向緩衝區的長度*lpszText*。 ### <a name="return-value"></a>傳回值 傳回的版本**int**傳回擷取字串的長度。 傳回的版本`CString`傳回項目文字。 ### <a name="remarks"></a>備註 如果*nSubItem*為零,此函式會擷取項目標籤; 如果*nSubItem*為非零值,它會擷取子項目的文字。 如需有關子項目的引數的詳細資訊,請參閱討論[LVITEM](/windows/desktop/api/commctrl/ns-commctrl-taglvitema) Windows SDK 中的結構。 ## <a name="getnextitem"></a> CListCtrl::GetNextItem 如需清單的搜尋檢視項目具有指定的屬性,而且,與給定項目指定的關聯性。 ``` int GetNextItem( int nItem, int nFlags) const; ``` ### <a name="parameters"></a>參數 *nItem*<br/> 若要開始使用,搜尋的項目或-1 表示找到第一個項目符合指定的旗標的索引。 從搜尋中排除指定的項目本身。 *nFlags*<br/> 指定的項目,並要求項目的狀態要求項目的幾何的關聯性。 幾何的關聯性可以是下列值之一: - LVNI_ABOVE 搜尋指定的項目上方的項目。 - LVNI_ALL 搜尋後續的項目,依索引 (預設值)。 - LVNI_BELOW 搜尋指定的項目下方的項目。 - LVNI_TOLEFT 搜尋至指定的項目左邊的項目。 - LVNI_TORIGHT 搜尋指定的項目右邊的項目。 此狀態可能是零,或者它可以是下列其中一個或多個這些值: - LVNI_DROPHILITED 項目有 LVIS_DROPHILITED 狀態旗標設定。 - LVNI_FOCUSED 項目有 LVIS_FOCUSED 狀態旗標設定。 - LVNI_SELECTED 項目有 LVIS_SELECTED 狀態旗標設定。 如果項目未包含所有指定的狀態旗標集,就會繼續搜尋下一個項目。 ### <a name="return-value"></a>傳回值 下一個項目,如果成功,否則為-1 的索引。 ## <a name="getnextitemindex"></a> CListCtrl::GetNextItemIndex 擷取具有指定的屬性集的目前清單檢視控制項中項目的索引。 ``` BOOL GetNextItemIndex( PLVITEMINDEX pItemIndex, int nFlags) const; ``` ### <a name="parameters"></a>參數 |參數|描述| |---------------|-----------------| |*pItemIndex*|[in、 out]指標[LVITEMINDEX](/windows/desktop/api/commctrl/ns-commctrl-lvitemindex)結構描述項目開始搜尋或-1 表示找到第一個符合項目,中的旗標*nFlags*參數。<br /><br /> 如果這個方法成功,`LVITEMINDEX`結構描述的搜尋作業找到的項目。| |*nFlags*|[in]位元組合 (OR) 旗標,指定如何執行搜尋。<br /><br /> 搜尋可能取決於索引、 狀態或外觀的目標項目,或以指定目標項目的實體位置,相對於項目*pItemIndex*參數。 如需詳細資訊,請參閱 <<c0> *旗標*中的參數[LVM_GETNEXTITEMINDEX](/windows/desktop/controls/lvm-getnextitemindex)訊息。| ### <a name="return-value"></a>傳回值 如果成功,這個方法,則為 TRUE。否則為 FALSE。 ### <a name="remarks"></a>備註 呼叫端會負責配置和設定的成員`LVITEMINDEX`結構所指*pItemIndex*參數。 這個方法會傳送[LVM_GETNEXTITEMINDEX](/windows/desktop/controls/lvm-getnextitemindex)訊息,Windows SDK 中所述。 ## <a name="getnextselecteditem"></a> CListCtrl::GetNextSelectedItem 取得索引所識別之清單項目的*pos*,然後設定*pos*位置值。 ``` int GetNextSelectedItem(POSITION& pos) const; ``` ### <a name="parameters"></a>參數 *pos*<br/> 先前呼叫所傳回的位置值的參考`GetNextSelectedItem`或`GetFirstSelectedItemPosition`。 這個呼叫是下一個位置來更新此值。 ### <a name="return-value"></a>傳回值 所識別之清單項目的索引*pos*。 ### <a name="remarks"></a>備註 您可以使用`GetNextSelectedItem`向前反覆項目迴圈,如果您建立的初始位置,藉由呼叫`GetFirstSelectedItemPosition`。 您必須確定您位置的值無效。 如果無效,偵錯版本的 Mfc 程式庫判斷提示。 ### <a name="example"></a>範例 下列程式碼範例示範如何使用此函式。 ```cpp POSITION pos = m_myListCtrl.GetFirstSelectedItemPosition(); if (pos == NULL) { TRACE(_T("No items were selected!\n")); } else { while (pos) { int nItem = m_myListCtrl.GetNextSelectedItem(pos); TRACE(_T("Item %d was selected!\n"), nItem); // you could do your own processing on nItem here } } ``` ## <a name="getnumberofworkareas"></a> CListCtrl::GetNumberOfWorkAreas 擷取工作區域的清單檢視控制項的目前數目。 ``` UINT GetNumberOfWorkAreas() const; ``` ### <a name="return-value"></a>傳回值 不使用這一次。 ### <a name="remarks"></a>備註 此成員函式實作 Win32 巨集的行為[ListView_GetNumberOfWorkAreas](/windows/desktop/api/commctrl/nf-commctrl-listview_getnumberofworkareas)、 Windows SDK 中所述。 ### <a name="example"></a>範例 ```cpp UINT i, uCount = m_myListCtrl.GetNumberOfWorkAreas(); LPRECT lpRects = (LPRECT) malloc(uCount*sizeof(RECT)); if (lpRects != NULL) { // Dump all of the work area dimensions. m_myListCtrl.GetWorkAreas(uCount, lpRects); for (i=0; i < uCount; i++) { TRACE(_T("Work area %d; left = %d, top = %d, right = %d, ") _T("bottom = %d\r\n"), i, lpRects[i].left, lpRects[i].top, lpRects[i].right, lpRects[i].bottom); } free(lpRects); } else { TRACE(_T("Couldn't allocate enough memory!")); } ``` ## <a name="getoutlinecolor"></a> CListCtrl::GetOutlineColor 擷取清單檢視控制項的框線色彩。 ``` COLORREF GetOutlineColor() const; ``` ### <a name="return-value"></a>傳回值 傳回[COLORREF](/windows/desktop/gdi/colorref)結構,其中包含外框色彩。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_GETOUTLINECOLOR](/windows/desktop/Controls/lvm-getoutlinecolor)訊息、 Windows SDK 中所述。 ## <a name="getorigin"></a> CListCtrl::GetOrigin 擷取目前的檢視原始的清單檢視控制項。 ``` BOOL GetOrigin(LPPOINT lpPoint) const; ``` ### <a name="parameters"></a>參數 *lpPoint*<br/> 位址[點](/previous-versions/dd162805\(v=vs.85\))接收檢視原始的結構。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 不過,如果控制項是在報表檢視中,傳回值永遠為零。 ## <a name="getselectedcolumn"></a> CListCtrl::GetSelectedColumn 擷取在清單控制項中目前選取之資料行的索引。 ``` UINT GetSelectedColumn() const; ``` ### <a name="return-value"></a>傳回值 所選資料行索引。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_GETSELECTEDCOLUMN](/windows/desktop/Controls/lvm-getselectedcolumn)訊息、 Windows SDK 中所述。 ## <a name="getselectedcount"></a> CListCtrl::GetSelectedCount 擷取清單檢視控制項中選取的項目數目。 ``` UINT GetSelectedCount() const; ``` ### <a name="return-value"></a>傳回值 在清單檢視控制項中選取的項目數目。 ### <a name="example"></a>範例 ```cpp UINT i, uSelectedCount = m_myListCtrl.GetSelectedCount(); int nItem = -1; // Update all of the selected items. if (uSelectedCount > 0) { for (i=0; i < uSelectedCount; i++) { nItem = m_myListCtrl.GetNextItem(nItem, LVNI_SELECTED); ASSERT(nItem != -1); m_myListCtrl.Update(nItem); } } ``` ## <a name="getselectionmark"></a> CListCtrl::GetSelectionMark 擷取清單檢視控制項的選取範圍標記。 ``` int GetSelectionMark(); ``` ### <a name="return-value"></a>傳回值 以零為起始的選取標記或如果沒有選取範圍標記為-1。 ### <a name="remarks"></a>備註 此成員函式實作 Win32 巨集的行為[ListView_GetSelectionMark](/windows/desktop/api/commctrl/nf-commctrl-listview_getselectionmark)、 Windows SDK 中所述。 ### <a name="example"></a>範例 ```cpp // Set the selection mark to the first item only if no other item is // selected. if (m_myListCtrl.GetSelectionMark() == -1) m_myListCtrl.SetSelectionMark(0); ``` ## <a name="getstringwidth"></a> CListCtrl::GetStringWidth 決定要顯示所有指定的字串所需的最小的資料行寬度。 ``` int GetStringWidth(LPCTSTR lpsz) const; ``` ### <a name="parameters"></a>參數 *lpsz*<br/> Null 終止的字串,其寬度是要判斷位址。 ### <a name="return-value"></a>傳回值 寬度,單位為像素所指向的字串*lpsz*。 ### <a name="remarks"></a>備註 傳回的寬度會考慮到控制項的目前字型和資料行邊界,但不是包括小圖示的寬度。 ### <a name="example"></a>範例 ```cpp CString strColumn; int nWidth; // Insert six columns in the list view control. Make the width of // the column be the width of the column header plus 50%. for (int i = 0; i < 6; i++) { strColumn.Format(_T("column %d"), i); nWidth = 3*m_myListCtrl.GetStringWidth(strColumn)/2; m_myListCtrl.InsertColumn(i, strColumn, LVCFMT_LEFT, nWidth); } ``` ## <a name="getsubitemrect"></a> CListCtrl::GetSubItemRect 擷取清單檢視控制項中項目的週框。 ``` BOOL GetSubItemRect( int iItem, int iSubItem, int nArea, CRect& ref); ``` ### <a name="parameters"></a>參數 *iItem*<br/> 子項目父項目的索引。 *iSubItem*<br/> 子項目的以一為基的索引。 *nArea*<br/> 要擷取決定週框 (清單檢視子項目) 的部分。 指定週框矩形的部分 (圖示、 標籤,或兩者) 將位元的 OR 運算子套用至一或多個下列值: - LVIR_BOUNDS 傳回整個項目,包括圖示和標籤的週框矩形。 - LVIR_ICON 傳回圖示或小圖示的週框矩形。 - LVIR_LABEL 傳回整個項目,包括圖示和標籤的週框矩形。 這是 LVIR_BOUNDS 完全相同。 *ref*<br/> 若要參考[CRect](../../atl-mfc-shared/reference/crect-class.md)物件,其中包含的子項目座標的週框矩形。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ### <a name="remarks"></a>備註 此成員函式實作 Win32 巨集的行為[ListView_GetSubItemRect](/windows/desktop/api/commctrl/nf-commctrl-listview_getsubitemrect)、 Windows SDK 中所述。 ## <a name="gettextbkcolor"></a> CListCtrl::GetTextBkColor 擷取清單檢視控制項的文字背景色彩。 ``` COLORREF GetTextBkColor() const; ``` ### <a name="return-value"></a>傳回值 32 位元值,用來指定的 RGB 色彩。 ### <a name="example"></a>範例 範例,請參閱[CListCtrl::SetTextBkColor](#settextbkcolor)。 ## <a name="gettextcolor"></a> CListCtrl::GetTextColor 擷取清單檢視控制項的文字色彩。 ``` COLORREF GetTextColor() const; ``` ### <a name="return-value"></a>傳回值 32 位元值,用來指定的 RGB 色彩。 ### <a name="example"></a>範例 範例,請參閱[CListCtrl::SetTextColor](#settextcolor)。 ## <a name="gettileinfo"></a> CListCtrl::GetTileInfo 擷取清單檢視控制項中的圖格的相關資訊。 ``` BOOL GetTileInfo(PLVTILEINFO plvti) const; ``` ### <a name="parameters"></a>參數 *plvti*<br/> 指標[LVTILEINFO](/windows/desktop/api/commctrl/ns-commctrl-taglvtileinfo)接收 圖格資訊的結構。 ### <a name="return-value"></a>傳回值 不會使用傳回的值。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_GETTILEINFO](/windows/desktop/Controls/lvm-gettileinfo)訊息、 Windows SDK 中所述。 ## <a name="gettileviewinfo"></a> CListCtrl::GetTileViewInfo 擷取清單檢視控制項中並排顯示檢視的相關資訊。 ``` BOOL GetTileViewInfo(PLVTILEVIEWINFO ptvi) const; ``` ### <a name="parameters"></a>參數 *ptvi*<br/> 指標[LVTILEVIEWINFO](/windows/desktop/api/commctrl/ns-commctrl-taglvtileviewinfo)結構會接收所擷取的資訊。 ### <a name="return-value"></a>傳回值 不會使用傳回的值。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_GETTILEVIEWINFO](/windows/desktop/Controls/lvm-gettileviewinfo)訊息、 Windows SDK 中所述。 ## <a name="gettooltips"></a> CListCtrl::GetToolTips 擷取要顯示工具提示的清單檢視控制項使用的工具提示控制項。 ``` CToolTipCtrl* GetToolTips() const; ``` ### <a name="return-value"></a>傳回值 指標[CToolTipCtrl](ctooltipctrl-class.md)清單控制項所使用的物件。 如果[建立](#create)成員函式會使用樣式 LVS_NOTOOLTIPS、 使用任何工具提示,並會傳回 NULL。 ### <a name="remarks"></a>備註 此成員函式實作的 Win32 訊息的行為[LVM_GETTOOLTIPS](/windows/desktop/Controls/lvm-gettooltips)、 Windows SDK 中所述。 MFC 實作`GetToolTips`傳回`CToolTipCtrl`物件,它會使用清單控制項,而不是工具提示控制項的控制代碼。 ### <a name="example"></a>範例 ```cpp CToolTipCtrl* pTip = m_myListCtrl.GetToolTips(); if (NULL != pTip) { pTip->UpdateTipText(_T("I'm a list view!"), &m_myListCtrl, IDD_MYLISTCTRL); } ``` ## <a name="gettopindex"></a> CListCtrl::GetTopIndex 在 清單檢視或報表檢視中擷取最上層的可見項目的索引。 ``` int GetTopIndex() const; ``` ### <a name="return-value"></a>傳回值 最上層的可見項目的索引。 ### <a name="example"></a>範例 ```cpp // Make sure the focus is set to the list view control. m_myListCtrl.SetFocus(); // Select all of the items that are completely visible. int n = m_myListCtrl.GetTopIndex(); int nLast = n + m_myListCtrl.GetCountPerPage(); for (; n < nLast; n++) { m_myListCtrl.SetItemState(n, LVIS_SELECTED, LVIS_SELECTED); ASSERT(m_myListCtrl.GetItemState(n, LVIS_SELECTED) == LVIS_SELECTED); } ``` ## <a name="getview"></a> CListCtrl::GetView 取得清單檢視控制項的檢視。 ``` DWORD GetView() const; ``` ### <a name="return-value"></a>傳回值 清單檢視控制項目前的檢視。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_GETVIEW](/windows/desktop/Controls/lvm-getview)訊息、 Windows SDK 中所述。 ## <a name="getviewrect"></a> CListCtrl::GetViewRect 擷取清單檢視控制項中的所有項目的週框。 ``` BOOL GetViewRect(LPRECT lpRect) const; ``` ### <a name="parameters"></a>參數 *lpRect*<br/> 位址[RECT](/previous-versions/dd162897\(v=vs.85\))結構。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ### <a name="remarks"></a>備註 清單檢視中必須是檢視圖示或小圖示檢視中。 ## <a name="getworkareas"></a> CListCtrl::GetWorkAreas 擷取目前的工作區域的清單檢視控制項。 ``` void GetWorkAreas( int nWorkAreas, LPRECT pRect) const; ``` ### <a name="parameters"></a>參數 *nWorkAreas*<br/> 數目`RECT`中所包含的結構*pRect*陣列。 *pRect*<br/> 陣列的指標`RECT`結構 (或[CRect](../../atl-mfc-shared/reference/crect-class.md)物件),接收工作區域的清單檢視控制項。 在這些架構中的值為在工作區座標。 ### <a name="remarks"></a>備註 此成員函式實作 Win32 巨集的行為[ListView_GetWorkAreas](/windows/desktop/api/commctrl/nf-commctrl-listview_getworkareas)、 Windows SDK 中所述。 ### <a name="example"></a>範例 範例,請參閱[CListCtrl::GetNumberOfWorkAreas](#getnumberofworkareas)。 ## <a name="hasgroup"></a> CListCtrl::HasGroup 判斷清單檢視控制項是否具有指定的群組。 ``` BOOL HasGroup(int iGroupId) const; ``` ### <a name="parameters"></a>參數 *iGroupId*<br/> 所要求之群組的識別碼。 ### <a name="return-value"></a>傳回值 如果成功,則傳回 TRUE 失敗則為 FALSE。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_HASGROUP](/windows/desktop/Controls/lvm-hasgroup)訊息、 Windows SDK 中所述。 ## <a name="hittest"></a> CListCtrl::HitTest 如果有任何項目,是在指定的位置,請判斷哪個清單檢視項目。 ``` int HitTest(LVHITTESTINFO* pHitTestInfo) const; int HitTest( CPoint pt, UINT* pFlags = NULL) const; ``` ### <a name="parameters"></a>參數 *pHitTestInfo*<br/> 位址`LVHITTESTINFO`結構,其中包含要進行點擊測試,位置接收的點擊測試結果的相關資訊。 *pt*<br/> 要測試的點。 *pFlags*<br/> 接收的測試結果的相關資訊的整數指標。 請參閱說明`flags`隸屬[LVHITTESTINFO](/windows/desktop/api/commctrl/ns-commctrl-taglvhittestinfo) Windows SDK 中的結構。 ### <a name="return-value"></a>傳回值 所指定的位置處的項目索引*pHitTestInfo*,若有的話,否則為-1。 ### <a name="remarks"></a>備註 您可以使用的結構 LVHT_ABOVE、 LVHT_BELOW、 LVHT_TOLEFT 和 LVHT_TORIGHT 值`flag`成員來決定是否要捲動清單檢視控制項的內容。 這些旗標的兩個可以結合,例如,如果位置上方和左邊的 工作區。 您可以測試的結構 LVHT_ONITEM 值`flag`成員來判定透過清單檢視項目是否為給定的位置。 這個值是結構的 LVHT_ONITEMICON、 LVHT_ONITEMLABEL 和 LVHT_ONITEMSTATEICON 值的位元 OR 作業`flag`成員。 ### <a name="example"></a>範例 ```cpp void CListCtrlDlg::OnRClick(NMHDR* pNMHDR, LRESULT* pResult) { LPNMITEMACTIVATE pia = (LPNMITEMACTIVATE)pNMHDR; CPoint point(pia->ptAction); // Select the item the user clicked on. UINT uFlags; int nItem = m_myListCtrl.HitTest(point, &uFlags); if (uFlags & LVHT_ONITEMLABEL) { m_myListCtrl.SetItem(nItem, 0, LVIF_STATE, NULL, 0, LVIS_SELECTED, LVIS_SELECTED, 0); } *pResult = 0; } ``` ## <a name="insertcolumn"></a> CListCtrl::InsertColumn 在清單檢視控制項中插入新的資料行。 ``` int InsertColumn( int nCol, const LVCOLUMN* pColumn); int InsertColumn( int nCol, LPCTSTR lpszColumnHeading, int nFormat = LVCFMT_LEFT, int nWidth = -1, int nSubItem = -1); ``` ### <a name="parameters"></a>參數 *nCol*<br/> 新的資料行的索引。 *pColumn*<br/> 位址`LVCOLUMN`結構,其中包含新的資料行的屬性。 *lpszColumnHeading*<br/> 字串,包含資料行標題的位址。 *nFormat*<br/> 整數,指定資料行的對齊方式。 它可以是下列值之一:LVCFMT_LEFT、 LVCFMT_RIGHT 或 LVCFMT_CENTER。 *nWidth*<br/> 資料行,單位為像素寬度。 此參數為-1,如果未設定資料行寬度。 *nSubItem*<br/> 索引資料行相關聯的子項目。 如果這個參數是-1,任何子項目不是資料行相關聯。 ### <a name="return-value"></a>傳回值 新的資料行,如果成功則為-1 則索引。 ### <a name="remarks"></a>備註 清單檢視控制項中的最左邊資料行必須是靠左對齊。 [LVCOLUMN](/windows/desktop/api/commctrl/ns-commctrl-taglvcolumna)結構包含在報表檢視中的資料行的屬性。 它也用來接收資料行的相關資訊。 此結構是 Windows SDK 中所述。 ## <a name="insertgroup"></a> CListCtrl::InsertGroup 插入清單檢視控制項中的群組。 ``` LRESULT InsertGroup( int index, PLVGROUP pgrp); ``` ### <a name="parameters"></a>參數 *index*<br/> 群組是要插入之項目的索引。 *pgrp*<br/> 指標[LVGROUP](/windows/desktop/api/commctrl/ns-commctrl-taglvgroup)結構,其中包含要加入的群組。 ### <a name="return-value"></a>傳回值 如果作業失敗,則傳回群組已加入的項目則為-1 的索引。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_INSERTGROUP](/windows/desktop/Controls/lvm-insertgroup)訊息、 Windows SDK 中所述。 ## <a name="insertgroupsorted"></a> CListCtrl::InsertGroupSorted 插入群組的排序清單中指定的群組。 ``` LRESULT InsertGroupSorted(PLVINSERTGROUPSORTED pStructInsert); ``` ### <a name="parameters"></a>參數 *pStructInsert*<br/> 指標[LVINSERTGROUPSORTED](/windows/desktop/api/commctrl/ns-commctrl-taglvinsertgroupsorted)結構,其中包含要插入的群組。 ### <a name="return-value"></a>傳回值 不會使用傳回的值。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_INSERTGROUPSORTED](/windows/desktop/Controls/lvm-insertgroupsorted)訊息、 Windows SDK 中所述。 ## <a name="insertitem"></a> CListCtrl::InsertItem 將項目插入清單檢視控制項。 ``` int InsertItem(const LVITEM* pItem); int InsertItem( int nItem, LPCTSTR lpszItem); int InsertItem( int nItem, LPCTSTR lpszItem, int nImage); int InsertItem( UINT nMask, int nItem, LPCTSTR lpszItem, UINT nState, UINT nStateMask, int nImage, LPARAM lParam); ``` ### <a name="parameters"></a>參數 *pItem*<br/> 指標[LVITEM](/windows/desktop/api/commctrl/ns-commctrl-taglvitema)結構,指定項目的屬性,在 Windows SDK 中所述。 *nItem*<br/> 要插入之項目的索引。 *lpszItem*<br/> 字串,包含項目的標籤或 LPSTR_TEXTCALLBACK,如果項目回呼項目的位址。 回呼項目上的資訊,請參閱[clistctrl:: Getcallbackmask](#getcallbackmask)。 *nImage*<br/> 項目的映像,或 I_IMAGECALLBACK 如果項目回呼項目的索引。 回呼項目上的資訊,請參閱[clistctrl:: Getcallbackmask](#getcallbackmask)。 *nMask*<br/> *NMask*參數會指定哪一個項目做為參數傳遞的屬性都有效。 它可以是其中一或多個遮罩值中所述[LVITEM 結構](/windows/desktop/api/commctrl/ns-commctrl-taglvitema)Windows SDK 中。 有效的值可以與位元的 OR 運算子結合。 *nState*<br/> 表示項目的狀態、 狀態影像和覆疊影像。 如需詳細資訊,請參閱 Windows SDK 主題[LVITEM 結構](/windows/desktop/api/commctrl/ns-commctrl-taglvitema)並[清單檢視項目狀態](/windows/desktop/Controls/list-view-item-states)如需有效的旗標的清單。 *nStateMask*<br/> 指示的狀態成員會擷取或修改。 如需詳細資訊,請參閱 < [LVITEM 結構](/windows/desktop/api/commctrl/ns-commctrl-taglvitema)Windows SDK 中。 *lParam*<br/> 項目相關聯的 32 位元應用程式特定值。 如果指定此參數,您必須設定*nMask*屬性 LVIF_PARAM。 ### <a name="return-value"></a>傳回值 新的項目,如果成功則為-1 則索引。 ### <a name="remarks"></a>備註 呼叫這個方法可能會導致 LVM_INSERTITEM 訊息傳送至您的控制項視窗。 設定項目文字 (例如使用例如 LVS_OWNERDRAW 的視窗樣式) 的特定情況下,控制項的相關聯的訊息處理常式可能會失敗。 如需有關這些條件的詳細資訊,請參閱 < [LVM_INSERTITEM](/windows/desktop/Controls/lvm-insertitem) Windows SDK 中。 ### <a name="example"></a>範例 ```cpp CString strText; int nColumnCount = m_myListCtrl.GetHeaderCtrl()->GetItemCount(); // Insert 10 items in the list view control. for (int i = 0; i < 10; i++) { strText.Format(TEXT("item %d"), i); // Insert the item, select every other item. m_myListCtrl.InsertItem(LVIF_TEXT | LVIF_STATE, i, strText, (i % 2) == 0 ? LVIS_SELECTED : 0, LVIS_SELECTED, 0, 0); // Initialize the text of the subitems. for (int j = 1; j < nColumnCount; j++) { strText.Format(TEXT("sub-item %d %d"), i, j); m_myListCtrl.SetItemText(i, j, strText); } } ``` ## <a name="insertmarkhittest"></a> CListCtrl::InsertMarkHitTest 擷取最接近指定點的插入點。 ``` int InsertMarkHitTest( LPPOINT pPoint, LPLVINSERTMARK plvim) const; ``` ### <a name="parameters"></a>參數 *pPoint*<br/> 指標[點](/previous-versions/dd162805\(v=vs.85\))結構,包含點擊的測試的座標,相對於清單控制項的用戶端區域。 *plvim*<br/> 指標[LVINSERTMARK](/windows/desktop/api/commctrl/ns-commctrl-lvinsertmark)結構,指定最接近座標點參數所定義的插入點。 ### <a name="return-value"></a>傳回值 最近的插入點至指定點。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_INSERTMARKHITTEST](/windows/desktop/Controls/lvm-insertmarkhittest)訊息、 Windows SDK 中所述。 ## <a name="isgroupviewenabled"></a> CListCtrl::IsGroupViewEnabled 判斷是否啟用清單檢視控制項的檢視。 ``` BOOL IsGroupViewEnabled() const; ``` ### <a name="return-value"></a>傳回值 否則傳回 TRUE,如果已啟用的群組檢視或 FALSE。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_ISGROUPVIEWENABLED](/windows/desktop/Controls/lvm-isgroupviewenabled)訊息、 Windows SDK 中所述。 ## <a name="isitemvisible"></a> CListCtrl::IsItemVisible 指出目前的清單檢視控制項中指定的項目是否可見。 ``` BOOL IsItemVisible(int index) const; ``` ### <a name="parameters"></a>參數 |參數|描述| |---------------|-----------------| |*index*|[in]目前的清單檢視控制項中項目的以零為起始的索引。| ### <a name="return-value"></a>傳回值 如果指定的項目為可見,則為 TRUE否則為 FALSE。 ### <a name="remarks"></a>備註 這個方法會傳送[LVM_ISITEMVISIBLE](/windows/desktop/Controls/lvm-isitemvisible)訊息,Windows SDK 中所述。 ## <a name="mapidtoindex"></a> CListCtrl::MapIDToIndex 將目前的清單檢視控制項中項目的唯一識別碼對應至索引。 ``` UINT MapIDToIndex(UINT id) const; ``` ### <a name="parameters"></a>參數 |參數|描述| |---------------|-----------------| |*id*|[in]項目的唯一識別碼。| ### <a name="return-value"></a>傳回值 目前的索引,做為指定的識別碼。 ### <a name="remarks"></a>備註 清單檢視控制項在內部追蹤索引的項目。 這可以呈現問題,因為索引可能會變更控制項的存留期間。 建立項目,而且您可以使用此識別碼,以保證唯一性的清單檢視控制項的存留期間時,清單檢視控制項可以標記識別碼的項目。 請注意,在多執行緒環境中的索引保證只有在裝載清單檢視控制項,不是在背景執行緒上的執行緒。 這個方法會傳送[LVM_MAPIDTOINDEX](/windows/desktop/controls/lvm-mapidtoindex)訊息,Windows SDK 中所述。 ## <a name="mapindextoid"></a> CListCtrl::MapIndexToID 將目前的清單檢視控制項中項目的索引對應至唯一的識別碼。 ``` UINT MapIndexToID(UINT index) const; ``` ### <a name="parameters"></a>參數 |參數|描述| |---------------|-----------------| |*index*|[in]項目的以零為起始的索引。| ### <a name="return-value"></a>傳回值 指定的項目唯一識別碼。 ### <a name="remarks"></a>備註 清單檢視控制項在內部追蹤索引的項目。 這可以呈現問題,因為索引可能會變更控制項的存留期間。 建立項目時,清單檢視控制項可以標記識別碼的項目。 您可以使用此識別碼的清單檢視控制項的存留期內存取特定的項目。 請注意,在多執行緒環境中的索引保證只有在裝載清單檢視控制項,不是在背景執行緒上的執行緒。 這個方法會傳送[LVM_MAPINDEXTOID](/windows/desktop/Controls/lvm-mapindextoid)訊息,Windows SDK 中所述。 ### <a name="example"></a>範例 下列程式碼範例會定義變數`m_listCtrl`,也就是用來存取目前的清單檢視控制項。 下一個範例中會使用此變數。 ```cpp public: // Variable used to access the list control. CListCtrl m_listCtrl; ``` ### <a name="example"></a>範例 下列程式碼範例示範`MapIndexToID`方法。 在先前章節中的 這個程式碼範例,我們會建立顯示標題為"ClientID"及"Grade"報表檢視中的兩個資料行的清單檢視控制項。 下列範例會將每個清單檢視項目的索引對應到身分證號碼,並接著會擷取每個識別碼的索引。 最後,此範例會報告是否已擷取原始的索引。 ```cpp // MapIndexToID int iCount = m_listCtrl.GetItemCount(); UINT nId = 0; UINT nIndex = 0; for (int iIndexOriginal = 0; iIndexOriginal < iCount; iIndexOriginal++) { // Map index to ID. nId = m_listCtrl.MapIndexToID((UINT)iIndexOriginal); // Map ID to index. nIndex = m_listCtrl.MapIDToIndex(nId); if (nIndex != (UINT)(iIndexOriginal)) { CString str; str.Format(_T("Mapped index (%d) is not equal to original index (%d)"), nIndex, (UINT)(iIndexOriginal)); AfxMessageBox(str); return; } } AfxMessageBox(_T("The mapped indexes and original indexes are equal."), MB_ICONINFORMATION); ``` ## <a name="movegroup"></a> CListCtrl::MoveGroup 移動指定群組,來指定零起始的索引清單檢視控制項。 ``` LRESULT MoveGroup( int iGroupId, int toIndex); ``` ### <a name="parameters"></a>參數 *iGroupId*<br/> 要移動之群組的識別碼。 *toIndex*<br/> 要移動這些群組的以零起始的索引。 ### <a name="return-value"></a>傳回值 不會使用傳回的值。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_MOVEGROUP](/windows/desktop/Controls/lvm-movegroup)訊息、 Windows SDK 中所述。 ## <a name="moveitemtogroup"></a> CListCtrl::MoveItemToGroup 將指定的項目移到指定的群組。 ``` void MoveItemToGroup( int idItemFrom, int idGroupTo); ``` ### <a name="parameters"></a>參數 *idItemFrom*<br/> [in]要移動之項目的索引。 *idGroupTo*<br/> [in]群組的識別項的項目將會移至。 ### <a name="remarks"></a>備註 > [!NOTE] > 這個方法目前未實作。 這個方法會模擬[LVM_MOVEITEMTOGROUP](/windows/desktop/Controls/lvm-moveitemtogroup)訊息、 Windows SDK 中所述。 ## <a name="redrawitems"></a> CListCtrl::RedrawItems 強制重新繪製的項目範圍的清單檢視控制項。 ``` BOOL RedrawItems( int nFirst, int nLast); ``` ### <a name="parameters"></a>參數 *nFirst*<br/> 要重新繪製的第一個項目索引。 *nLast*<br/> 要重新繪製的最後一個項目索引。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ### <a name="remarks"></a>備註 [清單] 檢視視窗接收 WM_PAINT 訊息前,不會實際繪製指定的項目。 若要立即重繪,呼叫 Windows [UpdateWindow](/windows/desktop/api/winuser/nf-winuser-updatewindow)之後使用此函式的函式。 ## <a name="removeallgroups"></a> CListCtrl::RemoveAllGroups 從清單檢視控制項中移除所有群組。 ``` void RemoveAllGroups(); ``` ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_REMOVEALLGROUPS](/windows/desktop/Controls/lvm-removeallgroups)訊息、 Windows SDK 中所述。 ## <a name="removegroup"></a> CListCtrl::RemoveGroup 從清單檢視控制項中移除指定的群組。 ``` LRESULT RemoveGroup(int iGroupId); ``` ### <a name="parameters"></a>參數 *iGroupId*<br/> 要移除之群組的識別碼。 ### <a name="return-value"></a>傳回值 否則會傳回群組中,如果成功,則為-1 的索引。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_REMOVEGROUP](/windows/desktop/Controls/lvm-removegroup)訊息、 Windows SDK 中所述。 ## <a name="scroll"></a> CListCtrl::Scroll 捲動清單檢視控制項的內容。 ``` BOOL Scroll(CSize size); ``` ### <a name="parameters"></a>參數 *size*<br/> A`CSize`物件,指定水平和垂直捲動,像素為單位的數量。 `y`隸屬*大小*除以高度,單位為像素的清單檢視控制項的列,並捲動所產生的行數。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ## <a name="setbkcolor"></a> CListCtrl::SetBkColor 設定清單檢視控制項的背景色彩。 ``` BOOL SetBkColor(COLORREF cr); ``` ### <a name="parameters"></a>參數 *cr*<br/> 若要設定,背景色彩或 CLR_NONE 值沒有背景色彩。 使用背景色彩的清單檢視控制項重繪本身大幅速度快於沒有背景色彩。 如需資訊,請參閱[COLORREF](/windows/desktop/gdi/colorref) Windows SDK 中。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ### <a name="example"></a>範例 ```cpp // Use the 3D button face color for the background. COLORREF crBkColor = ::GetSysColor(COLOR_3DFACE); m_myListCtrl.SetBkColor(crBkColor); ASSERT(m_myListCtrl.GetBkColor() == crBkColor); ``` ## <a name="setbkimage"></a> CListCtrl::SetBkImage 設定清單檢視控制項的背景的影像。 ``` BOOL SetBkImage(LVBKIMAGE* plvbkImage); BOOL SetBkImage( HBITMAP hBitmap, BOOL fTile = TRUE, int xOffsetPercent = 0, int yOffsetPercent = 0); BOOL SetBkImage( LPTSTR pszUrl, BOOL fTile = TRUE, int xOffsetPercent = 0, int yOffsetPercent = 0); ``` ### <a name="parameters"></a>參數 *plvbkImage*<br/> 位址`LVBKIMAGE`結構,包含新的背景映像資訊。 *hBitmap*<br/> 點陣圖的控制代碼。 *pszUrl*<br/> 以 NULL 結尾的字串,包含背景影像的 URL。 *fTile*<br/> 並排顯示在清單檢視控制項之背景影像時,非零值。否則為 0。 *xOffsetPercent*<br/> 位移,單位為像素映像的左邊緣,從清單檢視控制項的原點。 *yOffsetPercent*<br/> 位移,單位為像素影像的上邊緣,從清單檢視控制項的原點。 ### <a name="return-value"></a>傳回值 傳回非零值,如果成功或零,否則為。 ### <a name="remarks"></a>備註 > [!NOTE] > 因為`CListCtrl::SetBkImage`會使用 OLE COM 功能,必須先初始化 OLE 程式庫使用`SetBkImage`。 最好是初始化應用程式時初始化 COM 程式庫和應用程式終止時,解除初始化程式庫。 這是自動在 MFC 應用程式,讓使用 ActiveX 技術、 OLE Automation、 OLE 連結/內嵌或 ODBC/DAO 的作業。 ### <a name="example"></a>範例 範例,請參閱[CListCtrl::GetBkImage](#getbkimage)。 ## <a name="setcallbackmask"></a> CListCtrl::SetCallbackMask 設定清單檢視控制項的回呼遮罩。 ``` BOOL SetCallbackMask(UINT nMask); ``` ### <a name="parameters"></a>參數 *nMask*<br/> 回呼遮罩的新值。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ### <a name="example"></a>範例 ```cpp // Set the callback mask so that only the selected and focused states // are stored for each item. m_myListCtrl.SetCallbackMask(LVIS_SELECTED|LVIS_FOCUSED); ASSERT(m_myListCtrl.GetCallbackMask() == (LVIS_SELECTED|LVIS_FOCUSED)); ``` ## <a name="setcheck"></a> CListCtrl::SetCheck 判斷清單控制項項目的狀態影像是否可見。 ``` BOOL SetCheck( int nItem, BOOL fCheck = TRUE); ``` ### <a name="parameters"></a>參數 *nItem*<br/> 清單控制項項目以零為起始的索引。 *fCheck*<br/> 指定是否狀態影像的項目是否應該顯示。 根據預設, *fCheck*為 TRUE,且狀態影像為可見。 如果*fCheck*為 FALSE 時,看不到。 ### <a name="return-value"></a>傳回值 非零值,如果勾選此項目,否則為 0。 ### <a name="example"></a>範例 ```cpp int nCount = m_myListCtrl.GetItemCount(); BOOL fCheck = FALSE; // Set the check state of every other item to TRUE and // all others to FALSE. for (int i = 0; i < nCount; i++) { m_myListCtrl.SetCheck(i, fCheck); ASSERT((m_myListCtrl.GetCheck(i) && fCheck) || (!m_myListCtrl.GetCheck(i) && !fCheck)); fCheck = !fCheck; } ``` ## <a name="setcolumn"></a> CListCtrl::SetColumn 設定清單檢視資料行的屬性。 ``` BOOL SetColumn( int nCol, const LVCOLUMN* pColumn); ``` ### <a name="parameters"></a>參數 *nCol*<br/> 若要設定其屬性的資料行的索引。 *pColumn*<br/> 位址[LVCOLUMN](/windows/desktop/api/commctrl/ns-commctrl-taglvcolumna)結構,其中包含新的資料行屬性,如 Windows SDK 中所述。 結構的`mask`成員可讓您指定哪個資料行屬性來設定。 如果`mask`成員指定 LVCF_TEXT 值,此結構的`pszText`成員是以 null 結束的字串和結構的位址`cchTextMax`成員會被忽略。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ### <a name="example"></a>範例 範例,請參閱[CListCtrl::GetColumn](#getcolumn)。 ## <a name="setcolumnorderarray"></a> CListCtrl::SetColumnOrderArray 設定清單檢視控制項的資料行順序 (由左到右)。 ``` BOOL SetColumnOrderArray( int iCount, LPINT piArray); ``` ### <a name="parameters"></a>參數 *piArray*<br/> 包含 (從左到右) 的清單檢視控制項中的資料行的索引值之緩衝區的指標。 緩衝區必須夠大,無法包含在清單檢視控制項中的資料行總數。 *iCount*<br/> 在清單檢視控制項中的資料行數目。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ### <a name="remarks"></a>備註 此成員函式實作 Win32 巨集的行為[ListView_SetColumnOrderArray](/windows/desktop/api/commctrl/nf-commctrl-listview_setcolumnorderarray)、 Windows SDK 中所述。 ### <a name="example"></a>範例 範例,請參閱[CListCtrl::GetColumnOrderArray](#getcolumnorderarray)。 ## <a name="setcolumnwidth"></a> CListCtrl::SetColumnWidth 變更報表檢視] 或 [清單檢視中的資料行的寬度。 ``` BOOL SetColumnWidth( int nCol, int cx); ``` ### <a name="parameters"></a>參數 *nCol*<br/> 寬度為其設定的資料行索引。 在清單檢視中,這個參數必須是 0。 *cx*<br/> 新資料行的寬度。 不一定需要 LVSCW_AUTOSIZE LVSCW_AUTOSIZE_USEHEADER,如中所述[LVM_SETCOLUMNWIDTH](/windows/desktop/Controls/lvm-setcolumnwidth) Windows SDK 中。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ## <a name="setextendedstyle"></a> CListCtrl::SetExtendedStyle 設定目前的延伸的樣式的清單檢視控制項。 ``` DWORD SetExtendedStyle(DWORD dwNewStyle); ``` ### <a name="parameters"></a>參數 *dwNewStyle*<br/> 清單檢視控制項所使用的延伸樣式的組合。 如需描述性這些樣式清單,請參閱[擴充清單檢視樣式](/windows/desktop/Controls/extended-list-view-styles)Windows SDK 中的主題。 ### <a name="return-value"></a>傳回值 先前的延伸樣式,清單檢視控制項所使用的組合。 ### <a name="remarks"></a>備註 此成員函式實作 Win32 巨集的行為[ListView_SetExtendedListViewStyle](/windows/desktop/api/commctrl/nf-commctrl-listview_setextendedlistviewstyle)、 Windows SDK 中所述。 ### <a name="example"></a>範例 ```cpp // Allow the header controls item to be movable by the user. m_myListCtrl.SetExtendedStyle (m_myListCtrl.GetExtendedStyle()|LVS_EX_HEADERDRAGDROP); ``` ## <a name="setgroupinfo"></a> CListCtrl::SetGroupInfo 設定描述目前的清單檢視控制項的指定的群組的資訊。 ``` int SetGroupInfo( int iGroupId, PLVGROUP pgrp); ``` ### <a name="parameters"></a>參數 *iGroupId*<br/> 設定其資訊群組的識別碼。 *pgrp*<br/> 指標[LVGROUP](/windows/desktop/api/commctrl/ns-commctrl-taglvgroup)結構,其中包含要設定的資訊。 呼叫端負責配置這個結構,並設定其成員。 ### <a name="return-value"></a>傳回值 如果方法成功,群組的識別碼否則為-1。 ### <a name="remarks"></a>備註 這個方法會傳送[LVM_SETGROUPINFO](/windows/desktop/Controls/lvm-setgroupinfo)訊息,Windows SDK 中所述。 ## <a name="setgroupmetrics"></a> CListCtrl::SetGroupMetrics 設定群組的計量清單檢視控制項。 ``` void SetGroupMetrics(PLVGROUPMETRICS pGroupMetrics); ``` ### <a name="parameters"></a>參數 *pGroupMetrics*<br/> 指標[LVGROUPMETRICS](/windows/desktop/api/commctrl/ns-commctrl-taglvgroupmetrics)結構,其中包含設群組度量資訊。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_SETGROUPMETRICS](/windows/desktop/Controls/lvm-setgroupmetrics)訊息、 Windows SDK 中所述。 ## <a name="sethotcursor"></a> CListCtrl::SetHotCursor 設定已啟用熱追蹤,清單檢視控制項時所使用的游標。 ``` HCURSOR SetHotCursor(HCURSOR hc); ``` ### <a name="parameters"></a>參數 *hc*<br/> 用來代表最忙碌的游標游標資源控制代碼。 ### <a name="return-value"></a>傳回值 清單檢視控制項正在使用與上一個最忙碌的游標資源控制代碼。 ### <a name="remarks"></a>備註 此成員函式實作 Win32 巨集的行為[ListView_SetHotCursor](/windows/desktop/api/commctrl/nf-commctrl-listview_sethotcursor)、 Windows SDK 中所述。 熱資料指標,只顯示啟用暫留時的選取項目時,會顯示為指標通過任何清單檢視項目。 藉由設定延伸樣式 LVS_EX_TRACKSELECT 啟用暫留時選取。 ### <a name="example"></a>範例 範例,請參閱[CListCtrl::GetHotCursor](#gethotcursor)。 ## <a name="sethotitem"></a> CListCtrl::SetHotItem 設定清單檢視控制項的目前作用的項目。 ``` int SetHotItem(int iIndex); ``` ### <a name="parameters"></a>參數 *iIndex*<br/> 要設定為經常性存取的項目之項目的以零為起始的索引。 ### <a name="return-value"></a>傳回值 先前的作用的項目以零為起始的索引。 ### <a name="remarks"></a>備註 此成員函式實作 Win32 巨集的行為[ListView_SetHotItem](/windows/desktop/api/commctrl/nf-commctrl-listview_sethotitem)、 Windows SDK 中所述。 ### <a name="example"></a>範例 範例,請參閱[CListCtrl::GetHotItem](#gethotitem)。 ## <a name="sethovertime"></a> CListCtrl::SetHoverTime 設定目前暫留時間的清單檢視控制項。 ``` DWORD SetHoverTime(DWORD dwHoverTime = (DWORD)-1); ``` ### <a name="parameters"></a>參數 *dwHoverTime*<br/> 新的延遲,以毫秒為單位,滑鼠資料指標必須留在項目之前加以選取。 如果傳遞的預設值,則時間設為預設的停留時間。 ### <a name="return-value"></a>傳回值 上一個滑鼠停留時間 (毫秒)。 ### <a name="remarks"></a>備註 此成員函式實作 Win32 巨集的行為[ListView_SetHoverTime](/windows/desktop/api/commctrl/nf-commctrl-listview_sethovertime)、 Windows SDK 中所述。 ### <a name="example"></a>範例 範例,請參閱[CListCtrl::GetHoverTime](#gethovertime)。 ## <a name="seticonspacing"></a> CListCtrl::SetIconSpacing 設定清單檢視控制項中的圖示之間的間距。 ``` CSize SetIconSpacing( int cx, int cy); CSize SetIconSpacing(CSize size); ``` ### <a name="parameters"></a>參數 *cx*<br/> 在 x 軸 圖示之間距離 (以像素為單位)。 *cy*<br/> Y 軸 圖示之間距離 (以像素為單位)。 *size*<br/> A`CSize`物件,指定圖示,在 x 軸和 y 軸之間的距離 (以像素為單位)。 ### <a name="return-value"></a>傳回值 A [CSize](../../atl-mfc-shared/reference/csize-class.md)物件,包含圖示間距的上一個值。 ### <a name="remarks"></a>備註 此成員函式實作 Win32 巨集的行為[ListView_SetIconSpacing](/windows/desktop/api/commctrl/nf-commctrl-listview_seticonspacing)、 Windows SDK 中所述。 ### <a name="example"></a>範例 ```cpp // Leave lots of space between icons. m_myListCtrl.SetIconSpacing(CSize(100, 100)); ``` ## <a name="setimagelist"></a> CListCtrl::SetImageList 將影像清單指派給 清單檢視控制項。 ``` CImageList* SetImageList( CImageList* pImageList, int nImageListType); ``` ### <a name="parameters"></a>參數 *pImageList*<br/> 若要將指派的影像清單的指標。 *nImageListType*<br/> 影像清單的類型。 它可以是下列值之一: - 使用大圖示 LVSIL_NORMAL 映像清單。 - 使用小圖示的 LVSIL_SMALL 映像清單。 - 狀態影像 LVSIL_STATE 映像清單。 ### <a name="return-value"></a>傳回值 先前的映像清單的指標。 ### <a name="example"></a>範例 範例,請參閱[CListCtrl::GetImageList](#getimagelist)。 ## <a name="setinfotip"></a> CListCtrl::SetInfoTip 設定工具提示文字。 ``` BOOL SetInfoTip(PLVSETINFOTIP plvInfoTip); ``` ### <a name="parameters"></a>參數 *plvInfoTip*<br/> 指標[LVFSETINFOTIP](/windows/desktop/api/commctrl/ns-commctrl-taglvsetinfotip)結構,其中包含要設定的資訊。 ### <a name="return-value"></a>傳回值 如果成功,則傳回 TRUE 失敗則為 FALSE。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_SETINFOTIP](/windows/desktop/Controls/lvm-setinfotip)訊息、 Windows SDK 中所述。 ## <a name="setinsertmark"></a> CListCtrl::SetInsertMark 將插入點設定為定義的位置。 ``` BOOL SetInsertMark(LPLVINSERTMARK plvim); ``` ### <a name="parameters"></a>參數 *plvim*<br/> 指標[LVINSERTMARK](/windows/desktop/api/commctrl/ns-commctrl-lvinsertmark)結構,指定要設定插入點的位置。 ### <a name="return-value"></a>傳回值 否則傳回如果成功,則為 TRUE 或 FALSE。 如果傳回 FALSE 的大小`cbSize`的成員`LVINSERTMARK`結構不等於實際大小結構的一部分,或插入點的時不會套用在目前的檢視。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_SETINSERTMARK](/windows/desktop/Controls/lvm-setinsertmark)訊息、 Windows SDK 中所述。 ## <a name="setinsertmarkcolor"></a> CListCtrl::SetInsertMarkColor 將插入點的色彩設定。 ``` COLORREF SetInsertMarkColor(COLORREF color); ``` ### <a name="parameters"></a>參數 *color*<br/> A [COLORREF](/windows/desktop/gdi/colorref)結構,指定要設定插入點的色彩。 ### <a name="return-value"></a>傳回值 傳回`COLORREF`結構,包含前一個色彩。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_SETINSERTMARKCOLOR](/windows/desktop/Controls/lvm-setinsertmarkcolor)訊息、 Windows SDK 中所述。 ## <a name="setitem"></a> CListCtrl::SetItem 設定部分或全部的清單檢視項目的屬性。 ``` BOOL SetItem(const LVITEM* pItem); BOOL SetItem( int nItem, int nSubItem, UINT nMask, LPCTSTR lpszItem, int nImage, UINT nState, UINT nStateMask, LPARAM lParam); BOOL SetItem( int nItem, int nSubItem, UINT nMask, LPCTSTR lpszItem, int nImage, UINT nState, UINT nStateMask, LPARAM lParam, int nIndent); ``` ### <a name="parameters"></a>參數 *pItem*<br/> 位址[LVITEM](/windows/desktop/api/commctrl/ns-commctrl-taglvitema)結構,其中包含新的項目屬性,如 Windows SDK 中所述。 結構的`iItem`並`iSubItem`成員識別項目或子項目,且結構的`mask`成員指定要設定的屬性。 如需詳細資訊`mask`成員,請參閱 <<c2> **備註**。 *nItem*<br/> 重新設定其屬性的項目索引。 *nSubItem*<br/> 其屬性會設定子項目的索引。 *nMask*<br/> 指定的屬性來設定 (請參閱 < 備註 >)。 *lpszItem*<br/> 指定項目的標籤的 null 終止字串的位址。 *nImage*<br/> 映像清單中的項目影像的索引。 *nState*<br/> 指定的狀態變更 (請參閱 < 備註 >)。 *nStateMask*<br/> 指定的狀態變更 (請參閱 < 備註 >)。 *lParam*<br/> 要與項目相關聯的 32 位元應用程式特定值。 *nIndent*<br/> 寬度,單位為像素的縮排。 如果*nIndent*小於比系統定莪最小寬度,新的寬度設定為系統定義的最小值 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ### <a name="remarks"></a>備註 `iItem`並`iSubItem`的成員`LVITEM`結構和*nItem*並*nSubItem*參數會識別此項目和子項目,其屬性會設定。 `mask`隸屬`LVITEM`結構並*nMask*參數指定哪一個項目屬性會設為: - LVIF_TEXT`pszText`成員或*lpszItem*參數是以 null 結束的字串位址;`cchTextMax`成員會被忽略。 - LVIF_STATE`stateMask`成員或*nStateMask*參數指定哪一個項目狀態變更而`state`成員或是*nState*參數會包含這些狀態的值。 ### <a name="example"></a>範例 範例,請參閱[CListCtrl::HitTest](#hittest)。 ## <a name="setitemcount"></a> CListCtrl::SetItemCount 準備新增大量的項目清單檢視控制項。 ``` void SetItemCount(int nItems); ``` ### <a name="parameters"></a>參數 *nItems*<br/> 最後會包含控制項的項目數目。 ### <a name="remarks"></a>備註 若要設定的虛擬清單檢視控制項的項目計數,請參閱[CListCtrl::SetItemCountEx](#setitemcountex)。 ### <a name="remarks"></a>備註 此成員函式實作 Win32 巨集的行為[ListView_SetItemCount](/windows/desktop/api/commctrl/nf-commctrl-listview_setitemcount)、 Windows SDK 中所述。 ### <a name="example"></a>範例 ```cpp CString str; // Add 1024 items to the list view control. m_myListCtrl.SetItemCount(1024); for (int i = 0; i < 1024; i++) { str.Format(TEXT("item %d"), i); m_myListCtrl.InsertItem(i, str); } ``` ## <a name="setitemcountex"></a> CListCtrl::SetItemCountEx 設定虛擬清單檢視控制項的項目計數。 ``` BOOL SetItemCountEx( int iCount, DWORD dwFlags = LVSICF_NOINVALIDATEALL); ``` ### <a name="parameters"></a>參數 *iCount*<br/> 最後會包含控制項的項目數目。 *dwFlags*<br/> 重設項目計數之後指定清單檢視控制項的行為。 這個值可以是下列組合: - LVSICF_NOINVALIDATEALL 清單檢視控制項將會重新繪製視窗除非受影響的項目目前檢視中。 這是預設值。 - LVSICF_NOSCROLL 清單檢視控制項在項目計數的變更時,不會變更捲軸位置。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ### <a name="remarks"></a>備註 此成員函式實作 Win32 巨集的行為[ListView_SetItemCountEx](/windows/desktop/api/commctrl/nf-commctrl-listview_setitemcountex),如中所述 Windows SDKand 應該只呼叫虛擬清單檢視。 ### <a name="example"></a>範例 ```cpp CString str; // Add 1024 items to the list view control. // Force my virtual list view control to allocate // enough memory for my 1024 items. m_myVirtualListCtrl.SetItemCountEx(1024, LVSICF_NOSCROLL| LVSICF_NOINVALIDATEALL); for (int i = 0; i < 1024; i++) { str.Format(TEXT("item %d"), i); m_myVirtualListCtrl.InsertItem(i, str); } ``` ## <a name="setitemdata"></a> CListCtrl::SetItemData 設定與指定的項目相關聯的 32 位元應用程式專屬值*nItem*。 ``` BOOL SetItemData(int nItem, DWORD_PTR dwData); ``` ### <a name="parameters"></a>參數 *nItem*<br/> 設定為其資料之清單項目的索引。 *dwData*<br/> 要與項目相關聯的 32 位元值。 ### <a name="return-value"></a>傳回值 如果成功則為非零;否則為 0。 ### <a name="remarks"></a>備註 這個值是`lParam`隸屬[LVITEM](/windows/desktop/api/commctrl/ns-commctrl-taglvitema)結構,在 Windows SDK 中所述。 ### <a name="example"></a>範例 ```cpp // Set the data of each item to be equal to its index. for (int i = 0; i < m_myListCtrl.GetItemCount(); i++) { m_myListCtrl.SetItemData(i, i); } ``` ## <a name="setitemindexstate"></a> CListCtrl::SetItemIndexState 在目前的清單檢視控制項中設定項目的狀態。 ``` BOOL SetItemIndexState( PLVITEMINDEX pItemIndex, DWORD dwState, DWORD dwMask) const; ``` ### <a name="parameters"></a>參數 |參數|描述| |---------------|-----------------| |*pItemIndex*|[in]指標[LVITEMINDEX](/windows/desktop/api/commctrl/ns-commctrl-lvitemindex)該結構描述項目。 呼叫端負責配置這個結構,並設定其成員。| |*dwState*|[in]若要設定項目,狀態即的位元組合[清單檢視項目狀態](/windows/desktop/Controls/list-view-item-states)。 指定 0 時可重設,或其中一個狀態設定。| |*dwMask*|[in]所指定的狀態的有效位元遮罩*dwState*參數。 指定的位元組合 (OR)[清單檢視項目狀態](/windows/desktop/Controls/list-view-item-states)。| ### <a name="return-value"></a>傳回值 如果成功,這個方法,則為 TRUE。否則為 FALSE。 ### <a name="remarks"></a>備註 如需詳細資訊*dwState*參數,請參閱[清單檢視項目狀態](/windows/desktop/Controls/list-view-item-states)。 如需詳細資訊*dwMask*參數,請參閱*stateMask*的成員[LVITEM](/windows/desktop/api/commctrl/ns-commctrl-taglvitema)結構。 這個方法會傳送[LVM_SETITEMINDEXSTATE](/windows/desktop/Controls/lvm-setitemindexstate)訊息,Windows SDK 中所述。 ## <a name="setitemposition"></a> CListCtrl::SetItemPosition 將項目移至 清單檢視控制項中的指定位置。 ``` BOOL SetItemPosition( int nItem, POINT pt); ``` ### <a name="parameters"></a>參數 *nItem*<br/> 若要設定其位置的項目索引。 *pt*<br/> A[點](/previous-versions/dd162805\(v=vs.85\))結構,指定檢視中的新位置座標,此項目的左上角。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ### <a name="remarks"></a>備註 控制項必須是圖示或小圖示檢視中。 如果清單檢視控制項有 LVS_AUTOARRANGE 樣式,設定項目的位置之後,會排列清單檢視。 ### <a name="example"></a>範例 範例,請參閱[CListCtrl::GetItemPosition](#getitemposition)。 ## <a name="setitemstate"></a> CListCtrl::SetItemState 變更清單檢視控制項中項目的狀態。 ``` BOOL SetItemState( int nItem, LVITEM* pItem); BOOL SetItemState( int nItem, UINT nState, UINT nMask); ``` ### <a name="parameters"></a>參數 *nItem*<br/> 若要設定其狀態的項目索引。 *pItem*<br/> 位址[LVITEM](/windows/desktop/api/commctrl/ns-commctrl-taglvitema)結構,在 Windows SDK 中所述。 結構的`stateMask`成員可讓您指定哪些狀態位元變更,並將結構的`state`成員包含那些位元的新值。 其他成員會被忽略。 *nState*<br/> 新的狀態位元的值。 如需可能值的清單,請參閱 < [CListCtrl::GetNextItem](#getnextitem)並[LVITEM](/windows/desktop/api/commctrl/ns-commctrl-taglvitema)狀態成員。 *nMask*<br/> 指定要變更的哪些狀態位元遮罩。 這個值會對應至的 stateMask 成員[LVITEM](/windows/desktop/api/commctrl/ns-commctrl-taglvitema)結構。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ### <a name="remarks"></a>備註 項目的 「 狀態 」 是指定的項目可用性、 指出使用者動作或否則反映出的項目狀態的值。 清單檢視控制項變更狀態位元,例如當使用者選取項目。 應用程式可能會變更其他狀態的位元來停用或隱藏項目,或指定重疊影像或狀態影像。 ### <a name="example"></a>範例 範例,請參閱[CListCtrl::GetTopIndex](#gettopindex)。 ## <a name="setitemtext"></a> CListCtrl::SetItemText 變更清單檢視項目或子項目的文字。 ``` BOOL SetItemText( int nItem, int nSubItem, LPCTSTR lpszText); ``` ### <a name="parameters"></a>參數 *nItem*<br/> 若要設定其文字的項目索引。 *nSubItem*<br/> 若要設定項目標籤子項目,則為零的索引。 *lpszText*<br/> 包含新的項目文字的字串指標。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ### <a name="remarks"></a>備註 這個方法不適合使用與包含 LVS_OWNERDATA 視窗樣式的控制項 (事實上,這會導致判斷提示在偵錯組建)。 如需有關此清單控制項樣式的詳細資訊,請參閱[清單檢視控制項概觀](/windows/desktop/Controls/list-view-controls-overview)。 ### <a name="example"></a>範例 範例,請參閱[CListCtrl::InsertItem](#insertitem)。 ## <a name="setoutlinecolor"></a> CListCtrl::SetOutlineColor 如果設定的清單檢視控制項的框線色彩[LVS_EX_BORDERSELECT](/windows/desktop/Controls/list-view-window-styles)延伸的視窗樣式設定。 ``` COLORREF SetOutlineColor(COLORREF color); ``` ### <a name="parameters"></a>參數 *color*<br/> 新[COLORREF](/windows/desktop/gdi/colorref)結構,其中包含外框色彩。 ### <a name="return-value"></a>傳回值 上一個`COLORREF`結構,其中包含外框色彩 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_SETOUTLINECOLOR](/windows/desktop/Controls/lvm-setoutlinecolor)訊息、 Windows SDK 中所述。 ## <a name="setselectedcolumn"></a> CListCtrl::SetSelectedColumn 設定選取的資料行的清單檢視控制項。 ``` LRESULT SetSelectedColumn(int iCol); ``` ### <a name="parameters"></a>參數 *iCol*<br/> 要選取的資料行索引。 ### <a name="return-value"></a>傳回值 不會使用傳回的值。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_SETSELECTEDCOLUMN](/windows/desktop/Controls/lvm-setselectedcolumn)訊息、 Windows SDK 中所述。 ## <a name="setselectionmark"></a> CListCtrl::SetSelectionMark 設定的選取範圍標記的清單檢視控制項。 ``` int SetSelectionMark(int iIndex); ``` ### <a name="parameters"></a>參數 *iIndex*<br/> 多個選取範圍中第一個項目以零為起始的索引。 ### <a name="return-value"></a>傳回值 先前選取的標記或如果沒有選取範圍標記為-1。 ### <a name="remarks"></a>備註 此成員函式實作 Win32 巨集的行為[ListView_SetSelectionMark](/windows/desktop/api/commctrl/nf-commctrl-listview_setselectionmark)、 Windows SDK 中所述。 ### <a name="example"></a>範例 範例,請參閱[CListCtrl::GetSelectionMark](#getselectionmark)。 ## <a name="settextbkcolor"></a> CListCtrl::SetTextBkColor 清單檢視控制項中設定文字的背景色彩。 ``` BOOL SetTextBkColor(COLORREF cr); ``` ### <a name="parameters"></a>參數 *cr*<br/> COLORREF,指定新的文字背景色彩。 如需資訊,請參閱[COLORREF](/windows/desktop/gdi/colorref) Windows SDK 中。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ### <a name="example"></a>範例 ```cpp // Use the 3D button face color for the background. COLORREF crBkColor = ::GetSysColor(COLOR_3DFACE); m_myListCtrl.SetTextBkColor(crBkColor); ASSERT(m_myListCtrl.GetTextBkColor() == crBkColor); ``` ## <a name="settextcolor"></a> CListCtrl::SetTextColor 設定清單檢視控制項的文字色彩。 ``` BOOL SetTextColor(COLORREF cr); ``` ### <a name="parameters"></a>參數 *cr*<br/> COLORREF,指定新的文字色彩。 如需資訊,請參閱[COLORREF](/windows/desktop/gdi/colorref) Windows SDK 中。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ### <a name="example"></a>範例 ```cpp // Use the window text color for // the item text of the list view control. COLORREF crTextColor = ::GetSysColor(COLOR_WINDOWTEXT); m_myListCtrl.SetTextColor(crTextColor); ASSERT(m_myListCtrl.GetTextColor() == crTextColor); ``` ## <a name="settileinfo"></a> CListCtrl::SetTileInfo 設定圖格的清單檢視控制項的資訊。 ``` BOOL SetTileInfo(PLVTILEINFO pTileInfo); ``` ### <a name="parameters"></a>參數 *pTileInfo*<br/> 指標[LVTILEINFO](/windows/desktop/api/commctrl/ns-commctrl-taglvtileinfo)結構,其中包含要設定的資訊。 ### <a name="return-value"></a>傳回值 如果成功,則傳回 TRUE 失敗則為 FALSE。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_SETTILEINFO](/windows/desktop/Controls/lvm-settileinfo)訊息、 Windows SDK 中所述。 ## <a name="settileviewinfo"></a> CListCtrl::SetTileViewInfo 設定中並排顯示檢視清單檢視控制項使用的資訊。 ``` BOOL SetTileViewInfo(PLVTILEVIEWINFO ptvi); ``` ### <a name="parameters"></a>參數 *ptvi*<br/> 指標[LVTILEVIEWINFO](/windows/desktop/api/commctrl/ns-commctrl-taglvtileviewinfo)結構,其中包含要設定的資訊。 ### <a name="return-value"></a>傳回值 如果成功,則傳回 TRUE 失敗則為 FALSE。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_SETTILEVIEWINFO](/windows/desktop/Controls/lvm-settileviewinfo)訊息、 Windows SDK 中所述。 ## <a name="settooltips"></a> CListCtrl::SetToolTips 設定工具提示控制項的清單檢視控制項將用來顯示工具提示。 ``` CToolTipCtrl* SetToolTips(CToolTipCtrl* pWndTip); ``` ### <a name="parameters"></a>參數 *pWndTip*<br/> 指標`CToolTipCtrl`清單控制項將使用的物件。 ### <a name="return-value"></a>傳回值 指標[CToolTipCtrl](ctooltipctrl-class.md)物件,其中包含工具提示,就如同先前不使用任何工具提示一樣,先前使用控制項,則為 NULL。 ### <a name="remarks"></a>備註 此成員函式實作的 Win32 訊息的行為[LVM_SETTOOLTIPS](/windows/desktop/Controls/lvm-settooltips)、 Windows SDK 中所述。 若要不使用工具提示,指出當您建立的 LVS_NOTOOLTIPS 樣式`CListCtrl`物件。 ## <a name="setview"></a> CListCtrl::SetView 設定清單檢視控制項的檢視。 ``` DWORD SetView(int iView); ``` ### <a name="parameters"></a>參數 *iView*<br/> 要選取的檢視。 ### <a name="return-value"></a>傳回值 否則傳回 1,如果成功,則為-1。 例如,如果檢視是無效,則傳回-1。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_SETVIEW](/windows/desktop/Controls/lvm-setview)訊息、 Windows SDK 中所述。 ## <a name="setworkareas"></a> CListCtrl::SetWorkAreas 設定位置顯示圖示,在清單檢視控制項中的區域。 ``` void SetWorkAreas( int nWorkAreas, LPRECT lpRect); ``` ### <a name="parameters"></a>參數 *nWorkAreas*<br/> 數目`RECT`結構 (或[CRect](../../atl-mfc-shared/reference/crect-class.md)物件) 中所指陣列*lpRect*。 *lpRect*<br/> 陣列的地址`RECT`結構 (或`CRect`物件),以指定新的工作區域的清單檢視控制項。 必須在工作區座標中指定這些區域。 如果此參數為 NULL,[工作] 區域將控制項的工作區。 ### <a name="remarks"></a>備註 此成員函式實作 Win32 巨集的行為[ListView_SetWorkAreas](/windows/desktop/api/commctrl/nf-commctrl-listview_setworkareas)、 Windows SDK 中所述。 ### <a name="example"></a>範例 ```cpp // Remove all working areas. m_myListCtrl.SetWorkAreas(0, NULL); ``` ## <a name="sortgroups"></a> CListCtrl::SortGroups 您可以使用應用程式定義的比較函式,排序清單檢視控制項中的群組識別碼。 ``` BOOL SortGroups( PFNLVGROUPCOMPARE _pfnGroupCompare, LPVOID _plv); ``` ### <a name="parameters"></a>參數 *_pfnGroupCompare*<br/> 群組比較函式的指標。 *_plv*<br/> Void 的指標。 ### <a name="return-value"></a>傳回值 如果成功,則傳回 TRUE 失敗則為 FALSE。 ### <a name="remarks"></a>備註 此成員函式會模擬[LVM_SORTGROUPS](/windows/desktop/Controls/lvm-sortgroups)訊息、 Windows SDK 中所述。 ## <a name="sortitems"></a> CListCtrl::SortItems 使用應用程式定義的比較函式,以排序清單檢視項目。 ``` BOOL SortItems( PFNLVCOMPARE pfnCompare, DWORD_PTR dwData); ``` ### <a name="parameters"></a>參數 *pfnCompare*<br/> [in]應用程式定義的比較函式的位址。 排序作業會呼叫比較函式每次需要判斷兩個清單項目的相對順序。 比較函式必須是靜態成員的類別,或是獨立的函式不是任何類別的成員。 *dwData*<br/> [in]應用程式定義的值傳遞給比較函式。 ### <a name="return-value"></a>傳回值 如果方法成功,否則為 FALSE。 ### <a name="remarks"></a>備註 這個方法會變更以反映新的順序的每個項目的索引。 比較函式*pfnCompare*,具有下列格式: ``` int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort); ``` 比較函式必須傳回的負數的值,如果第一個項目之前,應該還有第二個,正數的值,如果第一個項目應該遵循第二個或零,如果兩個項目相等。 *LParam1*參數是 32 位元相關聯的值與第一個項目相比較,而*lParam2*參數是第二個項目相關聯的值。 以下是中所指定的值*lParam*成員的項目[LVITEM](/windows/desktop/api/commctrl/ns-commctrl-taglvitema)結構時它們插入至清單。 *LParamSort*參數是與相同*dwData*值。 這個方法會傳送[LVM_SORTITEMS](/windows/desktop/Controls/lvm-sortitems)訊息,Windows SDK 中所述。 ### <a name="example"></a>範例 以下是簡單的比較函式會導致正在排序的項目及其*lParam*值。 ```cpp // Sort items by associated lParam int CALLBACK CListCtrlDlg::MyCompareProc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort) { UNREFERENCED_PARAMETER(lParamSort); return (int)(lParam1 - lParam2); } ``` ```cpp // Sort the items by passing in the comparison function. void CListCtrlDlg::Sort() { m_myListCtrl.SortItems(&CListCtrlDlg::MyCompareProc, 0); } ``` ## <a name="sortitemsex"></a> CListCtrl::SortItemsEx 目前的清單檢視控制項的項目排序所使用的應用程式定義的比較函式。 ``` BOOL SortItemsEx( PFNLVCOMPARE pfnCompare, DWORD_PTR dwData); ``` ### <a name="parameters"></a>參數 |參數|描述| |---------------|-----------------| |*pfnCompare*|[in]應用程式定義的比較函式的位址。<br /><br /> 排序作業會呼叫比較函式每次需要判斷兩個清單項目的相對順序。 比較函式必須是靜態成員的類別,或是獨立的函式不是任何類別的成員。| |*dwData*|[in]應用程式定義的值傳遞給比較函式。| ### <a name="return-value"></a>傳回值 如果成功,這個方法,則為 TRUE。否則為 FALSE。 ### <a name="remarks"></a>備註 這個方法會變更以反映新的順序的每個項目的索引。 比較函式*pfnCompare*,具有下列格式: ``` int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort); ``` 此訊息就像是[LVM_SORTITEMS](/windows/desktop/Controls/lvm-sortitems),除了的資訊類型傳遞至的比較函式。 在 [LVM_SORTITEMS](/windows/desktop/Controls/lvm-sortitems), *lParam1*並*lParam2*是項目,即可比較的值。 在 [LVM_SORTITEMSEX](/windows/desktop/Controls/lvm-sortitemsex), *lParam1*是目前的索引,要比較的第一個項目並*lParam2*是目前的索引,第二個項目。 您可以傳送[LVM_GETITEMTEXT](/windows/desktop/Controls/lvm-getitemtext)訊息,以擷取項目的詳細資訊。 比較函式必須傳回的負數的值,如果第一個項目之前,應該還有第二個,正數的值,如果第一個項目應該遵循第二個或零,如果兩個項目相等。 > [!NOTE] > 在排序過程中,清單檢視內容是不穩定的。 如果回呼函式會傳送任何訊息至清單檢視控制項以外[LVM_GETITEM](/windows/desktop/Controls/lvm-getitem),是無法預期的結果。 這個方法會傳送[LVM_SORTITEMSEX](/windows/desktop/Controls/lvm-sortitemsex)訊息,Windows SDK 中所述。 ### <a name="example"></a>範例 下列程式碼範例會定義變數`m_listCtrl`,也就是用來存取目前的清單檢視控制項。 下一個範例中會使用此變數。 ```cpp public: // Variable used to access the list control. CListCtrl m_listCtrl; ``` ### <a name="example"></a>範例 下列程式碼範例示範`SortItemEx`方法。 在先前章節中的 這個程式碼範例,我們會建立顯示標題為"ClientID"及"Grade"報表檢視中的兩個資料行的清單檢視控制項。 下列程式碼範例會藉由使用中"Grade"資料行的值排序資料表。 ```cpp // The ListCompareFunc() method is a global function used by SortItemEx(). int CALLBACK ListCompareFunc( LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort) { CListCtrl* pListCtrl = (CListCtrl*) lParamSort; CString strItem1 = pListCtrl->GetItemText(static_cast<int>(lParam1), 1); CString strItem2 = pListCtrl->GetItemText(static_cast<int>(lParam2), 1) int x1 = _tstoi(strItem1.GetBuffer()); int x2 = _tstoi(strItem2.GetBuffer()); int result = 0; if ((x1 - x2) < 0) result = -1; else if ((x1 - x2) == 0) result = 0; else result = 1; return result; } void CCListCtrl_s2Dlg::OnBnClickedButton1() { // SortItemsEx m_listCtrl.SortItemsEx( ListCompareFunc, (LPARAM)&m_listCtrl ); } ``` ## <a name="subitemhittest"></a> CListCtrl::SubItemHitTest 如果有任何項目,是在給定的位置,請判斷哪個清單檢視項目。 ``` int SubItemHitTest(LPLVHITTESTINFO pInfo); ``` ### <a name="parameters"></a>參數 *pInfo*<br/> 指標[LVHITTESTINFO](/windows/desktop/api/commctrl/ns-commctrl-taglvhittestinfo)結構。 ### <a name="return-value"></a>傳回值 以一為索引的項目,或子項目、 要進行測試 (如果有的話),否則為-1。 ### <a name="remarks"></a>備註 此成員函式實作 Win32 巨集的行為[ListView_SubItemHitTest](/windows/desktop/api/commctrl/nf-commctrl-listview_subitemhittest)、 Windows SDK 中所述。 ### <a name="example"></a>範例 ```cpp void CListCtrlDlg::OnDblClk(NMHDR* pNMHDR, LRESULT* pResult) { UNREFERENCED_PARAMETER(pResult); LPNMITEMACTIVATE pia = (LPNMITEMACTIVATE)pNMHDR; LVHITTESTINFO lvhti; // Clear the subitem text the user clicked on. lvhti.pt = pia->ptAction; m_myListCtrl.SubItemHitTest(&lvhti); if (lvhti.flags & LVHT_ONITEMLABEL) { m_myListCtrl.SetItemText(lvhti.iItem, lvhti.iSubItem, NULL); } } ``` ## <a name="update"></a> CListCtrl::Update 強制重新繪製所指定的項目在清單檢視控制項*nItem*。 ``` BOOL Update(int nItem); ``` ### <a name="parameters"></a>參數 *nItem*<br/> 要更新之項目的索引。 ### <a name="return-value"></a>傳回值 如果成功則不為零,否則為 0。 ### <a name="remarks"></a>備註 此函式也會排列清單檢視控制項是否 LVS_AUTOARRANGE 樣式。 ### <a name="example"></a>範例 範例,請參閱[CListCtrl::GetSelectedCount](#getselectedcount)。 ## <a name="see-also"></a>另請參閱 [MFC 範例 ROWLIST](../../overview/visual-cpp-samples.md)<br/> [CWnd 類別](cwnd-class.md)<br/> [階層架構圖表](../hierarchy-chart.md)<br/> [CImageList 類別](cimagelist-class.md)
23.780488
365
0.701035
yue_Hant
0.863414
e5e84031ba04f205ce2b7cbccedb8cd0d2d85ab2
1,663
md
Markdown
README.md
praffn/aoc18
2216cd83f2d8dc8f107e965067fc8bc2b6a7bc36
[ "Unlicense" ]
null
null
null
README.md
praffn/aoc18
2216cd83f2d8dc8f107e965067fc8bc2b6a7bc36
[ "Unlicense" ]
null
null
null
README.md
praffn/aoc18
2216cd83f2d8dc8f107e965067fc8bc2b6a7bc36
[ "Unlicense" ]
null
null
null
# Advent of Code | C++ To compile just run `make`. ## Usage ``` aoc18 [-b] [-i filename] day ``` ###Flags * `-b` Toggles benchmarking. Final result will include running time * `-i` Solutions will read given input file * `day` An integer in the range 1-25 If no input file is given, the executable will default to reading stdin. ### Examples * `aoc18 -bi inputs/input_3.txt 3`<br> will run day 3 with input file `inputs/input_3.txt`. will also run benchmarking. * `aoc18 4 < inputs/input_4.txt`<br> will run 4 day from stdin (which is the contents of `inputs/input_4.txt`) ## LICENSE Copyright &copy; 2018 Phillip Raffnsøe 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.
35.382979
82
0.764281
eng_Latn
0.72886
e5e876c3b84538f4f8e45137d2b8359202b7afa5
7,530
md
Markdown
_posts/1989-06-04-王宗仁:寒冷的一月十一日.md
NodeBE4/mjlsh
1bbfb5d7d62cf731dec6f6e3bfe43e5981fc85ef
[ "MIT" ]
2
2020-09-30T00:09:49.000Z
2021-01-12T10:57:18.000Z
_posts/1989-06-04-王宗仁:寒冷的一月十一日.md
NodeBE4/mjlsh
1bbfb5d7d62cf731dec6f6e3bfe43e5981fc85ef
[ "MIT" ]
null
null
null
_posts/1989-06-04-王宗仁:寒冷的一月十一日.md
NodeBE4/mjlsh
1bbfb5d7d62cf731dec6f6e3bfe43e5981fc85ef
[ "MIT" ]
1
2021-05-29T19:48:31.000Z
2021-05-29T19:48:31.000Z
--- layout: post title: "王宗仁:寒冷的一月十一日" date: 1989-06-04 author: 王宗仁 from: http://mjlsh.usc.cuhk.edu.hk/Book.aspx?cid=4&tid=1610 tags: [ 这样走过 ] categories: [ 这样走过 ] --- <div style="margin: 15px 10px 10px 0px;"> <div> <span id="ctl00_ContentPlaceHolder1_chapter1_SubjectLabel" style="font-weight:bold;text-decoration:underline;"> 分类: </span> </div> <p> <strong> <font size="5"> 寒冷的一月十一日 </font> </strong> </p> <p> <strong> --作者:王宗仁 <br/> </strong> <br/> 一年一度的一月十一日又到了。如果到网络上查阅“历史上的今天”,可以见到许许多多历史事件,也许没有什么特别突出的内容。但是,这一天在我家的家史上是一个重要的“家难日”。 </p> <p> 原本尚属平静的生活在1966年被打断了--在六月份文革全面爆发之前,无帮无派的父亲就被莫名其妙地打成“黑帮分子”“反动学术权威”,原因是一些学术观点“与‘三家村’一样反党反社会主义”。起初,父亲还抱着希望,“是能够说明白、说清楚的”,以为仅仅挨一场“口诛笔伐”的批判就可以过关。万万没有想到,文革竟会发展到无法无天的地步。 </p> <p> 1966-8-18,“百万革命师生、红卫兵”在天安门广场受到伟大领袖接见,“红色风暴”开始上街“扫四旧”(旧思想、旧文化、旧风俗、旧习惯),矛头指向“封、资、修”的店招、路名、“奇装异服”之类。我当时才满14岁,凑热闹,跟着学校的老师同学上街宣传“四新”,到公共汽车、电车上读语录、唱革命歌曲,似乎这就是“文化大革命”。 </p> <p> 但是,紧接着很快出现了“抄家风”。无需任何手续,任何“革命群众”都可以对“地富反坏右、黑帮分子、反动权威、牛鬼蛇神”等等阶级敌人“采取革命行动”,甚至发出各种“勒令”(按照现在的观念,是完全彻底的侵犯人权)。一时间,抄家成风,伴之以大街小巷批斗,大字报标语贴到家里,直至全家老小“扫地出门”。 </p> <p> 1966-9-6。我照样和同学们上街“宣传革命”,照样是吃了晚饭再去学校逛一圈,晚上八九点钟才回家。当我走进弄堂,突然发觉有点异样:自家窗口对面住房的墙上,一片白亮的灯光,这是从来没有见过的,因为在那个年代到晚上九点钟还把楼上楼下的电灯全部大开,是不可想象的浪费行为。忽然,我又听到弄堂里其他楼房黑呼呼的窗口传来低低的话音:“看,回来了,回来了。”我四下张望,发现许多窗口都有人朝我家方向张望着、窃窃私语着。我赶紧再看我家的窗口,岂止是二楼、三楼的窗口一片通明,对面墙上还可以看到晃动的人影呢!再定睛一看,平时晚间没有什么人活动的二楼亭子间,竟然也是灯光大亮!出事了?抄家了? </p> <p> 容不得我再看再想,已经来到家门口了。一打开后门,就是刺目的灯光,上楼的楼梯是灯光通明,平时储藏杂物、很少打开的小搁楼也是灯光大作。上楼时,经过小搁楼,看到有人在里面翻查平日里不去翻动的一些书籍,不时挑出一些扔到楼梯上……。毫无疑问,我家正在被“采取革命行动”--抄家。 </p> <p> 我懵懵懂懂地走上了二楼,环视四周,只见二楼前后楼都有人在“看守”,房间里所有橱柜都已经翻乱,没法关上门了,连平时我们几个小孩子放书本放学习用品的地方,也是一片狼藉。不过,主力已经到三楼我父母的卧室里,不时听到楼上传来急吼吼的叫声。我不记得“红卫兵”“造反派”对我说了些什么。他们让我到一边去睡觉,不准说话。我毕竟还小,提心吊胆地躺在床上,还是睡着了。等到张开眼睛,只听见嘈杂的脚步声和说话声,那些人正在打点“战果”……。 <br/> <br/> 折腾了一夜,幸好没有私藏金银首饰以及“变天帐”之类的严重问题,抄走了一些书籍手稿。虽然没有照当时的做法在里弄里开现场批斗会,但“黑帮分子”“反动学术权威”的身份就此“公诸于世”,本来在众人心目中文质彬彬的“读书人”一夜之间成了另类、文化大革命揪出来的“坏人”,邻居们对我家老老少少都“刮目相看”。 </p> <p> 不久,社会上又出现“红色恐怖万岁”这类“革命口号”,真让全家人陷入惶惶不安之中。 </p> <p> 这时发生了1967年“一月革命”,“新生的革命委员会”从“走资派(党内走资本主义道路的当权派)”手中夺过了权力。我父亲的老同学来看望我父亲时,谈到市革会设立了一个“接待站”,接待群众来访。这两个老实巴交的知识分子,竟然觉得命运与前途出现了一线转机,决定去“上访”。 </p> <p> 当时受到文革冲击、痛苦不堪的受害者出于对“新生政权”的期望,到“接待站”申诉的可谓“蜂拥而至”,每逢接待日,虽然是下午接待,还必须天不亮就去排队。 </p> <p> 3月的一天凌晨,春寒料峭,黑咕隆咚之中,我走出了家门,从我家所在的南阳桥,一路小跑,到“接待站”(襄阳公园附近),为父亲提前排队。(当时舍不得坐公交车,只知道有六七站路。最近在电子地图上查到,差不多有4公里。)天光大亮后,祖父来了,他是把买菜、做早饭等家务活干完了来换我吃早点。记得是在“接待站”对面一家饮食店吃的大饼油条豆浆。我又冷又饿站了几个小时,此刻觉得早点格外香甜……。 </p> <p> 但是,这样做的后果又如何呢?尽管我父亲觉得自己与“黑帮”毫无关联,“浑身不搭界”,问题很容易查清楚,但是“接待站”决不会当场给出什么说法,更不可能让上访者如愿以偿而愉快离去的。他们的专用语是“回去等着吧,我们会联系的。”对这一番“忽悠”信以为真,实在是太天真了! </p> <p> “造反派”很快就知道我父亲“上访”的详细情况。一天晚上,我母亲不像平日一样与我父亲一起回家(他们在同一个单位工作),忧郁地说,“那些人(指造反派)为了前些天的上访之事开批判斗争会,还不知道什么时候结束,晚上还有什么革命行动。”全家愕然。 </p> <p> 晚上七点多钟,那些人带着我父亲来我家“采取革命行动”了。那些人直奔三楼我父母的卧室,留下个别人看守我们这些家属老小。我特意找了一本小册子,放在自己面前,佯装在阅读。“看守”问我看什么,我把小册子递过去了。那书名《何其毒也》,内容是“批判资产阶级反动路线”。我是“别有用心”的,无缘无故把我父亲打成“黑帮”“反动权威”不也是“何其毒也”么?那“看守”翻了翻,朝我看了看,想说什么却又没说,悻悻然走开了。 </p> <p> 那些人吆五喝六,厉声斥责,高喊口号,“威震四方”。他们让我父亲找来一大张牛皮纸(这是父亲平日用来包书的),拿来砚台和墨,边研墨,边听他们的训话——说我父亲是“配合二月逆流,妄想翻案,狗胆包天”!他们写完大字报,又吵吵嚷嚷找浆糊。家里哪有贴大字报的浆糊呢?于是,勒令我祖父用面粉立即调制浆糊……。 </p> <p> “反击翻案逆流”的“造反派”闹完走了,我们才看清楚,父亲的脸上好多的伤痕。母亲偷偷告诉我们,那天父亲还在据理力争--没有人规定我不能去市革会接待站,我是请假离开单位的……。结果挨了一顿耳光。 </p> <p> 毫无用处的解释和抗争啊!全家人再一次深陷惶恐不安,不知道还会有什么新的“惩罚”降临。 </p> <p> 不久,我家所在地段的房管员,带着“造反队”袖章,走进我家。父母都上班去了,只有老祖父在家操劳家务。房管员声称,“像你家这种情况要紧缩住房面积!你家把三楼前楼让出来!” </p> <p> 我祖父听得此言,顿时目瞪口呆-- </p> <p> 祖父从小种田,进私塾读了三个月就因曾祖父病故而辍学,去酱油店、南货店当学徒,后来进纺织厂学机修,刻苦钻研,自学成才,从国外买来的机械出了故障,科班出身的摆弄不好,我祖父埋头琢磨,居然“妙手回春”,于是一鸣惊人,成为技术部主任。可是,日本鬼子侵略中国,“八一三日寇在上海打了仗,江南国土都沦亡”,工厂被毁,一家人在苏南苏北颠簸流离,靠做小本生意谋生。抗战胜利后,来到上海,又合伙经营零布店,陆续有了一些结余。在战乱年代房价低贱的时候,租下了一处石库门住房。当时家里只有四五个人,就把顶层阁楼和三四楼的亭子间租出去了,自己家里使用底楼和二楼两个楼面以及三楼前楼,总计70多平方米。 </p> <p> 到1958大跃进年代,里弄里要办卫生站,我家被动员让出了底楼,近30平方米。然而,在此之前,我和弟弟妹妹相继降临人世,已经预示着家里住房紧张的前景。如今,又过去了八年,家里的小孩也开始长大成人了,想不到文革又要让我家让出住房! </p> <p> 祖父思索许久,还是“实话实说”。不料,答复是“不行”。祖父又去房管所,把家里的实际情况“如实相告”,恳求房管所理解。依旧是一口回绝,还威胁立刻派人上门动手“帮忙”。无可奈何之下,全家老小动手,天天晚上搬挪不止,到67-10-09初步腾空了三楼。 </p> <p> 尽管如此,祖父还是几次向房管员苦苦哀求,“手下留情”。最后,11-01,房管员松了口,“或多或少让出一点吧”,言下之意,同意只让出二楼亭子间。全家感激不尽。 </p> <p> 然而,房管员是个无赖之徒。他几次三番说:“现在你们满意了吧?”“这一下你们称心了吧?”可是当时祖父和父母都听不懂其中的“弦外之音”,只知道连声道谢! </p> <p> 于是,房管员横生枝节,屡屡变卦:忽而硬说亭子间与小搁楼是一起出让的(惹得我祖父发火,指出从未有过这种说法);忽而又突然要求当天搬空亭子间(明知我父母在上班,没有搬家的劳动力,而且已经书面保证11-10交房)。房管员理屈词穷,每每碰壁。 </p> <p> 我们全家老小利用每天晚上时间以“蚂蚁啃骨头”的办法把二楼亭子间的东西全部出清。在11-10按约交房。 </p> <p> 1967就在惶惶不安之中过去了。谁知,更大的灾难马上来到了。 </p> <p> 自从66-9-6被抄家以后担心了一年多的事情终于发生了! </p> <p> 68-1-10。下午4点多。房管员突然上门,宣布:明天上午搬家!至于什么地方,明天就知道了,反正就在现在住的地方附近。一家人都发呆了,没有人说话,也无话可说。 </p> <p> 68-1-11。早上,我家按照习惯打开收音机收听天气预报、新闻广播。这一天的广播里说,一年前的一月十一日,中央给上海市各革命造反团体发出贺电,今天是“一月革命”一周年纪念日……。 </p> <p> 天哪,一月革命、文化大革命,给我家带来的竟然就是这?! </p> <p> 从此以后,我就记住了一月十一日,它是“一月革命纪念日”,更是我家的“家难日”--“牛鬼蛇神,扫地出门!” </p> <p> 记不清那天“造反派”是什么时候来我家的。只记得,祖父跟着“造反派”去看“新居”,很快就回来了,看来真的不远。(现在从电子地图上量的距离是不到300米)只见祖父垂头丧气、有气无力地说:“太小了,太小了。还是朝北的……。没办法了,只能搬了……。”两只眼眶里满是痛苦的泪水。 </p> <p> 至今我还记得,当我迫不及待地第一次到“新居”时,朝北的房间明显地阴暗,里面还没有搬入多少东西,显得空空荡荡的,似乎还不太小,就安慰祖父:“还好,小得不多。”祖父强忍着悲痛和眼泪,打断我的话,说:“你还小,不会看房子。” </p> <p> 全家人差不多花了一天时间,无数次往返于“老家”“新居”之间。不记得是怎么借来手推车来搬运家具、生活用品、书籍的。只记得祖父还几次到旧货商店、旧书店联系上门收购,父母卧室里的家具全数卖掉了,父亲收藏多年的书籍也成捆成捆扔上了收旧车……。 </p> <p> 还有许多胸闷的事—— </p> <p> 盼望了多少年、筹划了几个月、刚刚于12-1开通使用的管道煤气,仅仅“享用”了40天,又一夜回到了煤球炉。 </p> <p> “新居”是把一个工商业者赶到局促的亭子间、空出二楼东厢房、又重新分隔成前后两户的格局,我家在后半部分,朝北一扇窗,正对着一条狭窄的夹弄,冬天正好形成西北风的风口。总共20平方米的面积,其中8个多平方米是没有窗户的暗间,就像一个“黑盒子”,到了夏天更是蒸笼一般。因为薄薄的纤维板墙壁外就是一个火热的煤球炉! </p> <p> 这个煤球炉偏偏还不是自己家的。南半部分是一家“困难户”,已经搬进去了,煤球炉也已经安放就位,“先占为王”,竟然占用了北半部分(也就是我家的“新居”)的门口部位。那么,我们家怎么烧饭呢?主宰我们命运的房管员斩钉截铁地说:“底楼不是还有空的地方吗?”就是说,我们全家住在二楼,烧饭必须去底楼!自己房门口不能自己使用,却必须让“困难户”就近烧饭!我家有60岁的老人,不得不上下奔波;“困难户”家中最大不到50岁,年轻力壮,却照顾就近……。 </p> <p> 说不通啊,想不通! </p> <p> 在经过了一年多磨难之后,祖父和父母“学会”了忍辱负重、忍气吞声……。 </p> <p> 公元一九六八年一月十一日,农历丁未年十二月十二,“三九”的第三天,真真正正是一个寒冷的日子。 </p> <p> 在“一月革命”一周年那天——68-1-11,被“扫地出门”的我家三代七口人,开始了“全新”的生活,这是难以形容的“精神地狱”。 </p> <p> 祖父在五十年代中期“工商业改造运动”中“因言获罪”而被戴上“现行反革命”帽子,在1965年年初获得“回到人民队伍”的资格。然而,68-1-11之后,毫无道理的“理所当然”地回到了“地富反坏”的行列。除了按规定向“专政队”报到、“早晚请罪”、定期交思想汇报、逢年过节贴“认罪书”、有重大政治活动时“画地为牢”式的集中处置……等等之外,一年到头,天天在里弄里监督劳动,花甲之年,还得天不亮起床打扫环境卫生,每逢星期四里弄大扫除时还得弯着腰一刻不停地接连打井水数百桶,“备战”期间与年轻力壮的一起不管烈日严寒、往返几十里拉运为防空洞工程烧砖的砖坯……。直到1973-1-16,里弄里开会宣布“维持文革前的结论”,重新“回到人民队伍”,他在里弄的处境稍有好转。长期不断的与年龄完全不相称的强体力劳动,使祖父的健康遭到极度破坏,再也无法恢复到以前的状态了。 </p> <p> 然而,更可怕的是极度的精神压抑,在他心头始终积压着难以掩饰的痛楚。他多次和我谈起坎坷的命运之路、艰辛的持家历程。他还告诉我,他不止一次萌生短见、想一死了之。但又一次次挺了过来,“说是一了百了,不可能啊,还会连累家里其他人……”。每言及此,总是老泪纵横。 </p> <p> 他还是怀着希望,活着,活着。他看到了1976年10月的“四人帮”垮台。1977年下半年,落实知识分子政策进入实施阶段。父母的单位里确认了我家属于落实政策的对象。祖父欣喜不已,听说有“万体馆”或“武宁路”的高层建筑,他很高兴,虽然远离已经住了几十年的市中心,但还是想离开这块伤心之地。 </p> <p> 然而,天有不测风云,极左路线的流毒远未肃清而是作祟不已。父母的单位迟迟没有通知为我家“落实政策”的具体地点,几经了解,竟然是:因为拟议中分给我家的“万体馆高层”属于“向外宾开放的地区”,而祖父有历史问题,需要继续研究!天啊,什么1965年的结论,什么维持文革前的结论,都是空头支票,祖父还是属于“另册”!他的心碎了,“到底要到什么时候?” </p> <p> 1978-1-11,是我家蒙难整整十周年。天寒地冻,祖父的老慢支、心脏病、高血压都到了“兴风作浪”的高潮。我们都言语谨慎,在这样的敏感日子里,特别要避免触及那些刺激祖父神经的话题。 </p> <p> 1978-1-15,天气阴沉,格外寒冷,是典型的“捂雪天”。在冰窖似的朝北的房间里,祖父蜷缩在小椅子上,自言自语地说:“大概要走了。”但是没有引起我们的注意。晚饭后,祖父和全家人坐在一起,一声不吭,听大家聊天。坐了一会儿,与往常一样,说了一句“我先去睡了”,就独自去那个终年不见阳光的暗间里。没多久,我听到祖父剧烈的咳嗽声,连忙跑到暗间打开灯,问祖父怎么样了,只见他无力地张开眼睛,看了我一眼,又张了一下嘴,头一歪--我觉得大势不好,连忙大叫,可是他毫无反应!父母、弟妹闻声而来,也惊讶不已,连喊带叫,连推带搡,都无济于事。情急之中叫来邻居陆医生,她见状不妙,急忙让我们去打电话叫救护车,自己则为祖父做人工呼吸、体外敲击心脏。 </p> <p> 我在家里隔壁的里委会办公室,打电话叫救护车,然后跑到弄堂口等候。这时候,天空飘着雪花,夹带着雪珠,风雪交加之中,路灯的光线更加黯淡。十多分钟后,救护车来了。医生一看,摇摇头,“没什么用了”。但是我们都还抱着希望,把祖父抬上担架、抬上救护车……。医院的急救室里,一针又一阵的强心针注射进去,作用全无,医生无可奈何,写下了“猝死”的结论。 </p> <p> 祖父没能等到离开阴暗小间、重回阳光洒满家居的那一天,在寒冷的一月风雪夜永远离开了我们……。 </p> <p> 1978-4-16,我们搬入落实政策的新居。这一天,与“家耻日”1966-9-6是4240天,与“家难日”1968-1-11是3748天,与祖父辞世日1978-1-15是91天。仅仅只差了91天啊! </p> <p> <br/> <strong> 感谢作者来稿,版权归作者所有。 <br/> 文责由作者自负 </strong> </p> </div>
38.030303
375
0.757105
yue_Hant
0.363499
e5e894014043ee8330cf2755fba9846c87e663c4
492
md
Markdown
README.md
palashitb/Networking-between-2-C-programs
f1920d686df6012a08120a55d5a3318475834276
[ "MIT" ]
null
null
null
README.md
palashitb/Networking-between-2-C-programs
f1920d686df6012a08120a55d5a3318475834276
[ "MIT" ]
null
null
null
README.md
palashitb/Networking-between-2-C-programs
f1920d686df6012a08120a55d5a3318475834276
[ "MIT" ]
null
null
null
### Networking-between-2-C-programs Networking assignment that I have to complete in the next 3 days # How to run: - First run the server with: gcc server.c ./a.out - Next, run the client with: gcc client.c ./a.out ## What is the whole point? This project is supposed to make a mini version of networking where a server and a client communicate with each other in order for the client to be able to download some files from the native directory of the server to its own.
25.894737
69
0.731707
eng_Latn
0.999945
e5e8bd2cd5d5146ca5def639cf11eb961db488ba
8,296
md
Markdown
articles/site-recovery/vmware-azure-manage-process-server.md
Kraviecc/azure-docs.pl-pl
4fffea2e214711aa49a9bbb8759d2b9cf1b74ae7
[ "CC-BY-4.0", "MIT" ]
null
null
null
articles/site-recovery/vmware-azure-manage-process-server.md
Kraviecc/azure-docs.pl-pl
4fffea2e214711aa49a9bbb8759d2b9cf1b74ae7
[ "CC-BY-4.0", "MIT" ]
null
null
null
articles/site-recovery/vmware-azure-manage-process-server.md
Kraviecc/azure-docs.pl-pl
4fffea2e214711aa49a9bbb8759d2b9cf1b74ae7
[ "CC-BY-4.0", "MIT" ]
null
null
null
--- title: Zarządzanie serwerem przetwarzania maszyn wirtualnych VMware/odzyskiwanie awaryjne serwera fizycznego w Azure Site Recovery description: W tym artykule opisano zarządzanie serwerem przetwarzania na potrzeby odzyskiwania po awarii maszyn wirtualnych VMware/serwerów fizycznych przy użyciu Azure Site Recovery. author: Rajeswari-Mamilla manager: rochakm ms.service: site-recovery ms.topic: conceptual ms.date: 04/28/2019 ms.author: ramamill ms.openlocfilehash: a547a874c42d06d8453b154847561d8b5f0dabb8 ms.sourcegitcommit: a43a59e44c14d349d597c3d2fd2bc779989c71d7 ms.translationtype: MT ms.contentlocale: pl-PL ms.lasthandoff: 11/25/2020 ms.locfileid: "96019201" --- # <a name="manage-process-servers"></a>Zarządzanie serwerami przetwarzania W tym artykule opisano typowe zadania związane z zarządzaniem serwerem przetwarzania Site Recovery. Serwer przetwarzania służy do odbierania, optymalizowania i wysyłania danych replikacji na platformę Azure. Wykonuje także instalację wypychaną usługi mobilności na maszynach wirtualnych programu VMware i serwerach fizycznych, które mają być replikowane, i wykonuje automatyczne odnajdowanie maszyn lokalnych. W przypadku replikowania lokalnych maszyn wirtualnych VMware lub serwerów fizycznych na platformę Azure serwer przetwarzania jest instalowany domyślnie na komputerze serwera konfiguracji. - W przypadku dużych wdrożeń do skalowania pojemności mogą być potrzebne dodatkowe serwery przetwarzania lokalnego. - W przypadku powrotu po awarii z platformy Azure do lokacji lokalnej należy skonfigurować tymczasowy serwer przetwarzania na platformie Azure. Możesz usunąć tę maszynę wirtualną po zakończeniu powrotu po awarii. Dowiedz się więcej o serwerze przetwarzania. ## <a name="upgrade-a-process-server"></a>Uaktualnianie serwera przetwarzania Po wdrożeniu lokalnego serwera procesów lub jako maszyny wirtualnej platformy Azure na potrzeby powrotu po awarii jest zainstalowana najnowsza wersja serwera przetwarzania. Site Recovery zespoły wprowadzają poprawki i ulepszenia w regularnych odstępach czasu, a firma Microsoft zaleca utrzymywanie Aktualności serwerów przetwarzania. Serwer przetwarzania można uaktualnić w następujący sposób: [!INCLUDE [site-recovery-vmware-upgrade -process-server](../../includes/site-recovery-vmware-upgrade-process-server-internal.md)] ## <a name="move-vms-to-balance-the-process-server-load"></a>Przenoszenie maszyn wirtualnych w celu zrównoważenia obciążenia serwera przetwarzania Należy zrównoważyć obciążenie przez przeniesienie maszyn wirtualnych między dwoma serwerami przetwarzania w następujący sposób: 1. W magazynie w obszarze **Zarządzaj** kliknij **Site Recovery infrastruktura**. W obszarze **dla maszyn fizycznych VMware &** kliknij pozycję **serwery konfiguracji**. 2. Kliknij serwer konfiguracji, z którym są zarejestrowane serwery przetwarzania. 3. Kliknij serwer przetwarzania, dla którego chcesz równoważyć obciążenie ruchem. ![Zrzut ekranu przedstawia serwer przetwarzania, dla którego można równoważyć obciążenie ruchem.](media/vmware-azure-manage-process-server/LoadBalance.png) 4. Kliknij pozycję **równoważenie obciążenia** i wybierz docelowy serwer przetwarzania, do którego chcesz przenieść maszyny. Następnie kliknij przycisk **OK** . ![Zrzut ekranu przedstawia okienko równoważenia obciążenia z wybranym docelowym serwerem przetwarzania.](media/vmware-azure-manage-process-server/LoadPS.PNG) 2. Kliknij pozycję **Wybierz Maszyny**, a następnie wybierz maszyny, które chcesz przenieść z bieżącego do docelowego serwera przetwarzania. Szczegóły średniej zmiany danych są wyświetlane dla każdej maszyny wirtualnej. Następnie kliknij przycisk **OK**. 3. W magazynie Monitoruj postęp zadania w obszarze **monitorowanie** > **Site Recovery zadań**. Wprowadzenie zmian w portalu zajmie około 15 minut. Aby uzyskać szybszy efekt, [Odśwież serwer konfiguracji](vmware-azure-manage-configuration-server.md#refresh-configuration-server). ## <a name="switch-an-entire-workload-to-another-process-server"></a>Przełączanie całego obciążenia na inny serwer przetwarzania Przenieś całe obciążenie obsługiwane przez serwer przetwarzania na inny serwer przetwarzania w następujący sposób: 1. W magazynie w obszarze **Zarządzaj** kliknij **Site Recovery infrastruktura**. W obszarze **dla maszyn fizycznych VMware &** kliknij pozycję **serwery konfiguracji**. 2. Kliknij serwer konfiguracji, z którym są zarejestrowane serwery przetwarzania. 3. Kliknij serwer przetwarzania, z którego chcesz przełączyć obciążenie. 4. Kliknij pozycję **przełącznik**, wybierz docelowy serwer przetwarzania, do którego chcesz przenieść obciążenie. Następnie kliknij przycisk **OK** . ![Zrzut ekranu przedstawia okienko Wybieranie docelowego serwera przetwarzania.](media/vmware-azure-manage-process-server/Switch.PNG) 5. W magazynie Monitoruj postęp zadania w obszarze **monitorowanie** > **Site Recovery zadań**. Wprowadzenie zmian w portalu zajmie około 15 minut. Aby uzyskać szybszy efekt, [Odśwież serwer konfiguracji](vmware-azure-manage-configuration-server.md#refresh-configuration-server). ## <a name="register-a-master-target-server"></a>Rejestrowanie głównego serwera docelowego Główny serwer docelowy znajduje się na serwerze konfiguracji i skalowalnych w poziomie serwerach procesów. Musi być zarejestrowany na serwerze konfiguracji. W przypadku awarii tej rejestracji może to mieć wpływ na kondycję chronionych elementów. Aby zarejestrować główny serwer docelowy z serwerem konfiguracji, zaloguj się na konkretnym serwerze konfiguracji/skalowalnym w poziomie serwerze przetwarzania, na którym jest wymagana rejestracja. Przejdź do folderu **%ProgramData%\ASR\Agent**, a następnie uruchom następujące polecenie w wierszu polecenia administratora. ``` cmd cdpcli.exe --registermt net stop obengine net start obengine exit ``` ## <a name="reregister-a-process-server"></a>Ponowne zarejestrowanie serwera przetwarzania Zarejestruj ponownie serwer przetwarzania działający lokalnie lub na maszynie wirtualnej platformy Azure z serwerem konfiguracji w następujący sposób: [!INCLUDE [site-recovery-vmware-register-process-server](../../includes/site-recovery-vmware-register-process-server.md)] Po zapisaniu ustawień wykonaj następujące czynności: 1. Na serwerze przetwarzania Otwórz wiersz polecenia z uprawnieniami administratora. 2. Przejdź do folderu **%ProgramData%\ASR\Agent** i uruchom polecenie: ``` cdpcli.exe --registermt net stop obengine net start obengine ``` ## <a name="modify-proxy-settings-for-an-on-premises-process-server"></a>Modyfikowanie ustawień serwera proxy dla lokalnego serwera przetwarzania Jeśli lokalny serwer przetwarzania używa serwera proxy do łączenia się z platformą Azure, można zmodyfikować ustawienia serwera proxy w następujący sposób: 1. Zaloguj się do maszyny serwera przetwarzania. 2. Otwórz okno poleceń administracyjnych programu PowerShell i uruchom następujące polecenie: ```powershell $pwd = ConvertTo-SecureString -String MyProxyUserPassword Set-OBMachineSetting -ProxyServer http://myproxyserver.domain.com -ProxyPort PortNumber –ProxyUserName domain\username -ProxyPassword $pwd net stop obengine net start obengine ``` 2. Przejdź do folderu **%ProgramData%\ASR\Agent** i uruchom następujące polecenie: ``` cmd cdpcli.exe --registermt net stop obengine net start obengine exit ``` ## <a name="remove-a-process-server"></a>Usuń serwer przetwarzania [!INCLUDE [site-recovery-vmware-unregister-process-server](../../includes/site-recovery-vmware-unregister-process-server.md)] ## <a name="exclude-folders-from-anti-virus-software"></a>Wykluczanie folderów z oprogramowania antywirusowego Jeśli oprogramowanie antywirusowe jest uruchomione na serwerze przetwarzania skalowalnego w poziomie (lub głównym serwerze docelowym), Wyklucz następujące foldery z operacji programu antywirusowego: - C:\Program Files\Microsoft Azure Recovery Services Agent - C:\ProgramData\ASR - C:\ProgramData\ASRLogs - C:\ProgramData\ASRSetupLogs - C:\ProgramData\LogUploadServiceLogs - C:\ProgramData\Microsoft Azure Site Recovery - Katalog instalacji serwera przetwarzania. Na przykład: C:\Program Files (x86) \Microsoft Azure Site Recovery
58.836879
569
0.810873
pol_Latn
0.99951
e5e9f024e0b29ecc971543417cb96b92781969ee
4,132
md
Markdown
_posts/OracleDocs/2021-05-19-Java-Oracle-Doc(1).md
yyyy-oniiii/yyyy.oniiii.github.io
49e543fe1020a326b676fd85838329a6135d1fd2
[ "MIT" ]
null
null
null
_posts/OracleDocs/2021-05-19-Java-Oracle-Doc(1).md
yyyy-oniiii/yyyy.oniiii.github.io
49e543fe1020a326b676fd85838329a6135d1fd2
[ "MIT" ]
null
null
null
_posts/OracleDocs/2021-05-19-Java-Oracle-Doc(1).md
yyyy-oniiii/yyyy.oniiii.github.io
49e543fe1020a326b676fd85838329a6135d1fd2
[ "MIT" ]
null
null
null
--- title: ☕️ [Java] Oracle 매뉴얼 번역 (1) author: Yon Kim date: 2021-05-19 20:00:00 +0900 categories: [☕️Java, Java-Oracle Official Manual] tags: [java] --- **👀 본 포스팅은 Oracle-Java Documentation 원문을 의역한 내용입니다.(오역이 있을 수 있음)** <br><br> **객체지향 프로그래밍** ============ 객체 지향 프로그래밍 언어를 한 번도 사용해 본 적이 없다면,  코드 작성을 시작하기 전에 몇 가지 기본 컨셉을 익힐 필요가 있습니다. 객체, 클래스, 상속, 인터페이스, 그리고 패키지라는 기본 컨셉들에 대해서 먼저 배우게 됩니다.  자바의 문법을 공부하는 동시에 이 컨셉들이 어떻게 현실세계와 연관되어있는지 알아보도록 합니다. <br><br> ## **What is an Object?:객체란?** ------------ 객체란 객체-지향 기술을 이해하는 핵심입니다. 우리는 주변에서 쉽게 `**객체**`를 찾아볼 수 있습니다: 🐶강아지, 📙책, 🖥TV, 🚴‍♂️자전거 같은 것들! 현실 세계의 강아지, 책, TV는 서로 공통점이 없어보이지만, 사실 두 가지 공통된 성질이 있습니다. 바로 `**상태와 행위**`인데요, 예를 들면 강아지는 다음과 같은 상태와 행위가 가능합니다. ``` // 강아지의 상태 종, 털 색상, 배고픔, 크기 등등 // 강아지의 행위 짖기, 킁킁 냄새 맡기, 공 물어오기, 꼬리 흔들기 등등 ``` 자전거도 마찬가지입니다. ``` // 자전거의 상태 현재 기어, 현재 패달의 rpm, 현재 속도 // 자전거의 행위 기어 바꾸기, 패달 빨리 밟기, 브레이크 잡기 등등 ``` 이렇게 현실 세계의 어떠한 객체에 대해 **상태와 행위를 구분하는 것은 객체 지향 프로그래밍에 있어 매우 중요한 사고방식**입니다. 잠시 시간을 들여 현실 세계의 객체들을 관찰해 본 뒤, 다음의 두 가지 질문을 던져보세요. ``` Q1. 이 객체는 어떤 상태일 수 있지? Q2. 이 객체는 어떤 행위를 할 수 있지? ``` 하나씩 답을 하다 보면 현실 세계의 객체는 무수히 많은 상태와 행위가 가능하다는 것을 알게 됩니다. 예를 들어 책상에 놓인 램프는 딱 두 가지 상태만 있습니다. ``` // 책상 위의 램프가 지닐 수 있는 상태 On Off ``` 그리고 두 가지 행위가 가능하죠 ``` // 책상 위의 램프가 지닐 수 있는 상태 Turn On Turn Off ``` 그러나 책상에 놓인 라디오는 조금 더 많은 상태일 수 있습니다.  그리고 조금 더 많은 행위가 가능하죠! ``` // 책상 위의 라디오가 지닐 수 있는 상태 (켜짐, 꺼짐, 현재 볼륨, 현재 채널) // 책상 위의 라디오가 할 수 있는 행위 (켜기, 끄기, 볼륨 키우기, 줄이기, 채널 찾기, 주파수 맟추기) ``` 어떤 객체는 다른 객체들을 포함한 상태를 지닐 수도 있고, 행위를 할 수도 있을거예요. 이러한 현실 세계에 대한 실제 관찰을 객체 지향 프로그래밍으로 해석하는 것! 이것이 바로 객체 지향 프로그래밍의 매우 중요한 핵심 컨셉입니다. ![https://blog.kakaocdn.net/dn/cLurN2/btq5gFc2poF/JgaItAVuomkroQNbXC94H0/img.png](https://blog.kakaocdn.net/dn/cLurN2/btq5gFc2poF/JgaItAVuomkroQNbXC94H0/img.png) 소프트웨어의 `'객체'`는 현실세계의 객체와 흡사합니다.  소프트웨어의 객체도 `상태`와 `행위`로 구성되어 있거든요. 하나의 객체가 지닌 상태는 `필드(변수)`에 저장되고, 행위는 `메소드(기능)`을 통해 노출됩니다. 메소드는 객체 내부 상태에서 작동하며, 객체와 객체가 서로 소통하기 위한 기본 메커니즘으로 사용됩니다. ``` // 소프트웨어의 객체 상태는 필드(변수)에 저장되고, 행위는 메소드(기능)를 통해 노출된다! ``` 그리고 객체의 메소드들을 통해 객체 내부의 상태와 관련된 모든 상호작용을 숨기는 것, 이것이 `**데이터 캡슐화(Data Encapsulation)**`입니다. (객체지향 프로그래밍의 토대) 자전거를 통한 예시를 들어보도록 할게요 ![https://blog.kakaocdn.net/dn/czIPks/btq5fElkwwH/1l0HFAQxz4id4HRF9bMJO1/img.png](https://blog.kakaocdn.net/dn/czIPks/btq5fElkwwH/1l0HFAQxz4id4HRF9bMJO1/img.png) 위 그림을 보면, 자전거의 `상태(State)`에 여러가지 속성이 있죠? `속도(mph)`, `패달(rpm)`, `기어(5th)` 처럼요. 그리고 `브레이크 잡기`, `기어 바꾸기`, `rpm 바꾸기`와 같은 `행위(Method)`를 통해 각각의 상태를 변경할 수 있죠. <br><br> 이렇게 자전거(객체)의 상태에 속성을 부여하고, 메소드를 제공하면, 이 객체를 현실 세계에서도 사용할 수 있도록 컨트롤 할 수 있는 상태가 되죠? <br> 예를 들어서, 자전거의 기어가 1~6단까지만 조절 된다면, Change gears 메소드로 1보다 작거나 6보다 큰 값으로 기어를 조절해보려고 해도, 조절 할 수 없을 거예요. 이렇게 자전거라는 하나의 독립된 객체는 안에 들어 있는 상태를 통해 속성을 정의하고, 메소드를 통해 다양한 기능이 노출됩니다. 이렇게 하나의 객체 안에 각각의 상태와 메소드가 번들처럼 들어있는 소프트웨어는 다음과 같은 장점이 있어요. <br> <br> --- ### **1️⃣ 모듈화(Modularity):** 모듈식 주택(조립식 주택)을 생각하면 쉬운 개념인데요 조립식 주택은 기본 골조에 방이나 거실 모듈을 붙여 공간을 확장해 나갈 수 있습니다. 거실 모듈 옆에 방 모듈을 추가로 붙여도, 거실 모듈의 인테리어나 구조에는 영향을 주지 않죠? 모듈화된 공간을 외부에서 통째로 붙이는 것이니까요.  마찬가지로 방 모듈의 도배를 새로하고 장판을 새로 깔아도 거실 모듈에는 아무런 영향을 주지 않습니다. <br> 이렇게 서로의 상태나 기능이 서로에게 영향을 미치지 않는 것이죠. 소프트웨어에서는 객체들이 하나의 소프트웨어를 구성하는 요소(모듈)로 존재하면서, 각자의 독립성이 유지되는 것을 '모듈화 되어있다'라고 합니다. 모듈화 되어있는 객체들은 각 객체마다 독립적으로 코드를 작성하고, 유지보수 할 수 있어요! <br> <br> ### **2️⃣ 정보 은닉(Information-Hiding):** 객체의 메소드하고만 상호작용함으로써 객체 내부에 구현되어 있는 세부 사항은 외부로부터 숨겨놓습니다. 예를 들어, 스마트폰을 구매한 사람은 목적을 달성하기 위한 기능만 사용할 수 있으면 되요. 전화걸기, 어플 다운받기, 카톡하기와 같은 것들 말이죠. 하지만 전화를 거는 행위(메소드)가 어떤 시스템 경로를 통해 실행되는지, 어떤 코드로 구현되어 있는지와 같은 상세한 정보는 사용자가 알 필요가 없어요. 우리는 전화만 걸면 되니깐요! <br> <br> ### **3️⃣코드 재사용(Code Re-use):** 한 번 만들어 놓은 객체는 프로그램 안에서 재사용할 수 있어요. 어떠한 개발자가 작업별 객체를 구현/테스트/디버그 해 놓으면, 다른 개발자들은 이것을 자신의 코드에서 재사용할 수 있는거죠. <br> <br> ### **4️⃣플러그와 디버깅 용이성(Pluggability and debugging ease):** 플러그를 꽂고, 빼는 것 처럼 특정 객체에 문제가 생겼을 경우, 그 객체를 빼고, 다른 객체를 끼울 수 있어요. 레고를 조립할 때 특정 블럭이 잘 맞지 않으면 레고 전체를 부수고 다시 조립하지 않고, 문제가 되는 부분에 잘 맞는 다른 블럭을 찾아 바꾸어 끼지요? 객체지향 프로그래밍에서도 마찬가지입니다. 문제가 되는 객체를 빼고, 다른 객체로 바꾸어 끼워 넣습니다. 프로그램 전체를 갈아 엎는 것이 아니구요!
16.015504
161
0.632139
kor_Hang
1.00001
e5ea67d4269af571ccf9a9deadeffe062b3f00fb
15,213
md
Markdown
docs/stark-build/NG_CLI_BUILD_CUSTOMIZATIONS.md
christophercr/stark
bee0d7247304703149c91c35ecdcc0b6288304b8
[ "MIT" ]
null
null
null
docs/stark-build/NG_CLI_BUILD_CUSTOMIZATIONS.md
christophercr/stark
bee0d7247304703149c91c35ecdcc0b6288304b8
[ "MIT" ]
503
2021-03-10T12:49:52.000Z
2022-03-31T04:04:21.000Z
docs/stark-build/NG_CLI_BUILD_CUSTOMIZATIONS.md
christophercr/stark
bee0d7247304703149c91c35ecdcc0b6288304b8
[ "MIT" ]
null
null
null
# NG CLI integration Since **Stark** is a framework fully based on Angular, it also integrates with the [Angular CLI](https://angular.io/cli). This means that you can lint ([`ng lint`](https://angular.io/cli/lint)), build ([`ng build`](https://angular.io/cli/build)), run ([`ng serve`](https://angular.io/cli/serve)) and test ([`ng test`](https://angular.io/cli/test) and [`ng e2e`](https://angular.io/cli/e2e)) your app as you would do in any other project directly generated with the CLI. ## CLI Limitations There is however a small limitation in the Angular CLI `ng lint` command compared to what **Stark** provides: such command only runs [TSLint](https://palantir.github.io/tslint/) whereas Stark-Build gives you the possibility to lint your app with [TSLint](https://palantir.github.io/tslint/) for Typescript code and with [Stylelint](https://stylelint.io/) for Stylesheets (CSS, SASS, SCSS, etc). So, in order to lint your app using both linting tools, you should create some NPM scripts in your `package.json`to run them, for example: ```text "scripts": { "lint": "npm run lint-ts && npm run lint-css", "lint-ts": "tslint --config ./tslint.json --project ./tsconfig.json --format codeFrame", "lint-css": "stylelint \"./src/**/*.?(pc|sc|c|sa)ss\" --formatter \"string\"", } ``` # Build Customizations Stark-Build provides all the necessary customizations for the default Angular CLI build configuration for any application based on **Stark**. This is done via partial Webpack configurations that override certain options in the default configuration from the Angular CLI thanks to [@angular-builders](https://github.com/meltedspark/angular-builders). ## Including Stark-Build customizations in your App Any app using **Stark** should include the customizations provided by Stark-Build via the `angular.json` file: ```text // Only the relevant modifications are shown, the rest of options are omitted for brevity "projects": { ... "your-app": { ... "architect": { ... "build": { "builder": "@angular-builders/custom-webpack:browser", "options": { "customWebpackConfig": { "path": "./node_modules/@nationalbankbelgium/stark-build/config/webpack-partial.dev.js", "mergeStrategies": { "modules.rules": "prepend", "plugins": "prepend", "devServer": "prepend", "replaceDuplicatePlugins": false } }, "indexTransform": "./node_modules/@nationalbankbelgium/stark-build/config/index-html.transform.js", ... }, "configurations": { "hmr": { "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.hmr.ts" } ] }, "production": { "customWebpackConfig": { "path": "./node_modules/@nationalbankbelgium/stark-build/config/webpack-partial.prod.js", "mergeStrategies": { "modules.rules": "prepend", "plugins": "prepend", "replaceDuplicatePlugins": false } }, ... "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.prod.ts" } ] } } }, "serve": { "builder": "@angular-builders/custom-webpack:dev-server", "options": { "browserTarget": "your-app:build" }, "configurations": { "hmr": { "browserTarget": "your-app:build:hmr" }, "production": { "browserTarget": "your-app:build:production" }, "e2e.prod": { "browserTarget": "your-app:build:e2e.prod" } } }, ... } } } ``` Notice that the custom Webpack partial configurations are set to the dev and prod configurations in the `build` and the `serve` targets. This must be done by using the `@angular-builders/custom-webpack:browser` builder in the `build` target and set the `customWebpackConfig` options. For the `serve` target this must be done by using `@angular-builders/custom-webpack:dev-server` builder. ## Webpack Customizations As mentioned before, Stark-Build provides all the necessary customizations for the Angular CLI build configuration. This is done by using several Webpack plugins as well as some utils in order to leverage some functionality to your builds (DEV and PROD). This is the list of utils and plugins used by the Stark-Build package: ### Loaders #### [tslint-loader](https://github.com/wbuchwalter/tslint-loader) This loader [lints](https://palantir.github.io/tslint/) your TypeScript files based on the configuration in your `tslint.json`. **Because at this moment disabling `typeCheck` in this loader drasticly improves build time we opted to overwrite and disable all [tslint rules](https://palantir.github.io/tslint/rules/) that require Type Info.** ### Plugins #### [DefinePlugin](https://webpack.js.org/plugins/define-plugin) Allows to define global variables that will be available during the compilation and building of the application bundles. In this case, Stark-Build provides some global variables that are available at compilation time, which means that you can implement some checks in your code and this will be analyzed when your application bundle is being built by Webpack. The global variables available at compilation time are the following: - `ENV` which indicates the current environment: `"development"` or `"production"` - `HMR` which indicates whether the Hot Module Replacement support is enabled (true/false). Since the DefinePlugin defines those variables as global, you can use them everywhere in your code so you can, for example, determine on which environment your app is currently running and execute some logic only on that specific environment: ```typescript // if true, your app is running in development environment if (ENV === "development") { /* the code inside this block will be executed only in development */ } ``` To avoid Typescript compilation issues regarding these global variables, make sure that you include the typings from the Stark-Build package in your app `tsconfig.json`: ```text { "extends": "./node_modules/@nationalbankbelgium/stark-build/tsconfig.json", "compilerOptions": { ... "typeRoots": [ "./node_modules/@types", "./node_modules/@nationalbankbelgium/stark-build/typings" // typings from stark-build ], ... }, ... } ``` #### Why do you need the target environment at compilation time? Sometimes you might need to add some logic or import some files only when your application is running in development or production. **In this case, when Webpack builds your application, the final bundle will contain also that code and/or imports that will only be used on a specific environment. For example, the specific code related to development will never be executed in production and yet it will be included in your production build which will increase the size of your bundle.** This is why knowing the target environment at compilation time is useful. You can put the logic inside an if block and then such code will be tree-shaken by Webpack as it will recognize it as dead code: ```typescript // this check is translated to "if (false)" when ENV is "production" // allowing Webpack to identify it as dead code and so remove it if (ENV === "development") { /* the code inside this block will only be included in development */ } ``` #### [Html indexTransform](https://github.com/NationalBankBelgium/stark/blob/master/packages/stark-build/config/index-html.transform.js "Html indexTransform") This plugin extends the Angular CLI build system. This plugin is configured to use the [Underscore/LoDash Templates](https://lodash.com/docs#template). Which means that you can use that templating syntax in your `src/index.html`. This is really powerful given the information from the Html IndexTransform that you can access in your _index.html_ template to customize it. For example: ```html <html lang="en"> <head> <!-- Use the application name from StarkAppMetadata as the Page title --> <title><%= starkOptions.starkAppMetadata.name %></title> </head> <body> Some content here </body> </html> ``` This is the information from `indexTransform` that is accessible in the template: - **starkOptions:** all options that were passed to the plugin including plugin's own options as well as Stark custom data containing the following: - **metadata:** - **TITLE:** Default title for Stark based apps: "Stark Application by @NationalBankBelgium" - **BASE_URL:** The base URL of the current build - **IS_DEV_SERVER:** Whether the current build is served locally with the development server - **HMR:** Whether the current build has HMR enabled - **AOT:** Whether the current build was generated with AOT compilation enabled - **E2E:** Whether the current build was generated with the E2E configuration - **WATCH:** Whether the option to rebuild on changes is enabled - **TS_CONFIG_PATH:** Path to the application's `tsconfig` file as defined in the `angular.json` - **ENV:** The environment of the current build: `production` or `development` - **environment:** The specific target used for the current build: `hmr`, `dev`, `e2e.prod` or `prod` - **starkAppMetadata:** the Stark metadata of the application available in the `src/stark-app-metadata.json` file - **starkAppConfig:** the Stark specific configuration for the application available in the `src/stark-app-config.json` file The Angular CLI build system will automatically add the base tag `<base href="<custom-base-url>">` to the _index.html_ so you don't need to add it manually yourself. If you desire to customize it, you can define it in the **baseHref** option of your project's `angular.json` file: ```text { ... "projects": { "your-app": { ... "architect": { "yourTargetName": { ... "options": { ... "baseHref": "/some-url" // default value: "/" } } } } } } ``` #### [HtmlHeadElements](https://github.com/NationalBankBelgium/stark/blob/master/packages/stark-build/config/html-head-elements "HtmlHeadElements") This plugin appends head elements during the creation of _index.html_. To use it, you'll have to create the `index-head-config.js` file to specify the `<link>` and `<meta>` you want to include in the `<head>` section of your _index.html_. Create your file at the following location: ```text | +---yourApp | +---config | | index-head-config.js | ... ``` Then, declare your file as follows: ``` module.exports = { link: [ { rel: "manifest", href: "manifest.json" }, { rel: "shortcut icon", type: "image/x-icon", href: "favicon.ico" }, { rel: "apple-touch-icon", sizes: "120x120", href: "assets/images/app-icons/apple-icon-120x120.png" }, { rel: "icon", type: "image/png", sizes: "32x32", href: "assets/images/app-icons/favicon-32x32.png" }, ... ], meta: [ ... { name: "description", "content": "<%= starkOptions.starkAppMetadata.description %>"} { name: "apple-mobile-web-app-capable", content: "yes" }, { name: "apple-mobile-web-app-status-bar-style", content: "black" }, { name: "apple-mobile-web-app-title", content: "template" }, { name: "msapplication-config", content: "none" }, ... ] } ``` _If you do not intend to use this feature, simply don't create the `index-head-config.js` file._ #### [ContextReplacementPlugin](https://webpack.js.org/plugins/context-replacement-plugin/) Allows to override the inferred information in a 'require' context. This is used in Stark-Build to limit the locales from [MomentJs](https://momentjs.com/) that will be included in the bundles: `de`, `fr`, `en-gb`, `nl` and `nl-be`. This is needed because MomentJS package provides all locales available without the possibility to select only some of them. #### [WebpackMonitor](https://github.com/webpackmonitor/webpackmonitor) Gives information about the bundle's size. This plugin is not enabled by default in Stark-Build so you need to pass the environment variable `MONITOR=1` to enable it. You can do this by setting the environment variable yourself before running the `ng serve` command or you can use [cross-env](https://github.com/kentcdodds/cross-env) and use it in an NPM script to set the environment variable temporarily only for this command: ```text "scripts": { "serve:dev:monitor": "cross-env MONITOR=1 ng serve", "serve:prod:monitor": "cross-env MONITOR=1 ng serve --prod=true", } ``` The WebpackMonitor app (for example: http://webpackmonitor.com/demo.html) showing all the bundles relevant information will be served automatically on port 3030. Also all the stats generated by WebpackMonitor will be available in a `stats.json` file under `reports/webpack-monitor`. #### [BundleAnalyzerPlugin](https://github.com/webpack-contrib/webpack-bundle-analyzer) Similar to WebpackMonitor, this plugin also gives information about the bundle's size with the difference that this is more interactive thanks to a zoomable tree map. This plugin is not enabled by default in Stark-Build so you need to pass the environment variable `BUNDLE_ANALYZER=1` to enable it. You can do this by setting the environment variable yourself before running the `ng serve` command or you can use [cross-env](https://github.com/kentcdodds/cross-env) and use it in an NPM script to set the environment variable temporarily only for this command: ```text "scripts": { "serve:dev:bundle-analyzer": "cross-env BUNDLE_ANALYZER=1 ng serve", "serve:prod:bundle-analyzer": "cross-env BUNDLE_ANALYZER=1 ng serve --prod=true", } ``` The interactive treemap visualization showing the contents of all the app bundles will be served automatically on port 3030. Also all the stats generated by WebpackBundleAnalyzer will be available in a `stats.json` file under `reports/bundle-analyzer`.
46.1
212
0.652337
eng_Latn
0.976262
e5eb6884dbc99c49b61b2f638323d1c0c3a4302b
1,930
md
Markdown
content/pages/education/tools-programs/principles-excellence-program.md
jennilynhowell/vets-website
4edea8aee0c80cdbaa0ff731d5e60dc814ed63b7
[ "CC0-1.0" ]
null
null
null
content/pages/education/tools-programs/principles-excellence-program.md
jennilynhowell/vets-website
4edea8aee0c80cdbaa0ff731d5e60dc814ed63b7
[ "CC0-1.0" ]
null
null
null
content/pages/education/tools-programs/principles-excellence-program.md
jennilynhowell/vets-website
4edea8aee0c80cdbaa0ff731d5e60dc814ed63b7
[ "CC0-1.0" ]
1
2018-09-26T12:02:49.000Z
2018-09-26T12:02:49.000Z
--- layout: page-breadcrumbs.html template: detail-page title: Principles of Excellence Program plainlanguage: 12-05-16 certified in compliance with the Plain Writing Act concurrence: incomplete order: 3 --- <div class="va-introtext"> The Principles of Excellence program requires schools that get federal funding through programs such as the GI Bill to follow certain guidelines. Learn about these guidelines. </div> <br> Schools that are a part of the program must: - Give you a written personal summary of the total cost of your educational program, including: - The costs covered by your benefits. - The financial aid you may qualify for. - Your expected student-loan debt after you graduate. - Other information to help you compare aid packages offered by different schools. - Give you an educational plan with a timeline showing how and when you can fulfill everything required for you to graduate. - Assign you a point of contact who will give you ongoing academic and financial advice (including access to disability counseling). - Allow for you to be gone for both long and short periods of time due to service obligations (service you must fulfill) for active-duty Servicemembers and Reservists. - Make sure all new programs are accredited (officially approved) before enrolling students. - Make sure their refund policies follow Title IV rules, which guide federal student financial aid programs. - End fraudulent (deceitful) and aggressive methods of recruiting. Schools that don’t charge tuition and fees don’t have to follow the Principles of Excellence guidelines. These include: - Foreign schools - High schools - On-the-job training and apprenticeship programs - Residency and internship programs Use the GI Bill Comparison Tool to learn which schools are part of the program. You can also compare benefits offered by different schools. [Use the GI Bill Comparison Tool](/gi-bill-comparison-tool/).
52.162162
201
0.796891
eng_Latn
0.999586
e5ebc0e5690a5c3de5651a6e1eb3baf6654b4b38
5,074
md
Markdown
README.md
noomorph/border-approximator
4c930f8c8b1495362401144d297df4d733cd0b98
[ "Apache-2.0" ]
null
null
null
README.md
noomorph/border-approximator
4c930f8c8b1495362401144d297df4d733cd0b98
[ "Apache-2.0" ]
null
null
null
README.md
noomorph/border-approximator
4c930f8c8b1495362401144d297df4d733cd0b98
[ "Apache-2.0" ]
null
null
null
# What does it solve? There is a transparent borderless *Button A* which is styled using `box-shadow` CSS property. You have to create *Button B* which should look as similar as possible to *Button A* without using `box-shadow`. Unfortunately, the only CSS properties you can use are either `border` or `outline`. In our days it is common to search answers or ask smart people on **StackOverflow**, [but sometimes nobody is interested or able to answer your question, like in my case](https://stackoverflow.com/questions/48097129/how-to-approximate-css-box-shadow-property-using-solid-border-only). Fortunately, I had some time and luck to conduct my own research and you came here in time, when I've got some useful results for you. ### Demo <iframe id="demo-iframe" src="demo/index.html?rnd=5" width="100%" height="460" allowtransparency="true" frameborder="0" scrolling="no"></iframe> ### The Useful Code ```javascript const SHADOW_APPROXIMATION_MAP = [ /*blur=00*/ /*blur=01*/ /*blur=02*/ /*blur=03*/ /*blur=04*/ /*blur=05*/ /*blur=06*/ /*blur=07*/ /*blur=08*/ /*blur=09*/ /*blur=10*/ /*blur=11*/ /*blur=12*/ /*blur=13*/ /*blur=14*/ /*blur=15*/ /* size=00 */ [ 0, 0.00], [ 1, 0.27], [ 1, 0.32], [ 1, 0.35], [ 2, 0.27], [ 2, 0.30], [ 2, 0.32], [ 3, 0.27], [ 3, 0.29], [ 3, 0.30], [ 3, 0.31], [ 4, 0.27], [ 4, 0.28], [ 4, 0.29], [ 4, 0.30], [ 5, 0.27], /* size=01 */ [ 1, 1.00], [ 1, 0.73], [ 2, 0.49], [ 2, 0.49], [ 2, 0.48], [ 2, 0.48], [ 3, 0.40], [ 3, 0.40], [ 3, 0.41], [ 4, 0.35], [ 4, 0.36], [ 4, 0.37], [ 4, 0.37], [ 5, 0.33], [ 5, 0.34], [ 5, 0.35], /* size=02 */ [ 2, 1.00], [ 2, 0.86], [ 2, 0.78], [ 3, 0.60], [ 3, 0.59], [ 3, 0.57], [ 3, 0.56], [ 4, 0.47], [ 4, 0.47], [ 4, 0.47], [ 4, 0.47], [ 5, 0.42], [ 5, 0.42], [ 5, 0.42], [ 5, 0.42], [ 6, 0.38], /* size=03 */ [ 3, 1.00], [ 3, 0.91], [ 3, 0.85], [ 3, 0.81], [ 4, 0.67], [ 4, 0.65], [ 4, 0.63], [ 4, 0.62], [ 5, 0.53], [ 5, 0.53], [ 5, 0.52], [ 5, 0.51], [ 5, 0.51], [ 6, 0.46], [ 6, 0.46], [ 6, 0.45], /* size=04 */ [ 4, 1.00], [ 4, 0.93], [ 4, 0.89], [ 4, 0.85], [ 4, 0.82], [ 5, 0.71], [ 5, 0.69], [ 5, 0.67], [ 5, 0.65], [ 5, 0.64], [ 6, 0.57], [ 6, 0.56], [ 6, 0.55], [ 6, 0.55], [ 7, 0.50], [ 7, 0.49], /* size=05 */ [ 5, 1.00], [ 5, 0.94], [ 5, 0.91], [ 5, 0.88], [ 5, 0.86], [ 5, 0.83], [ 6, 0.73], [ 6, 0.71], [ 6, 0.70], [ 6, 0.68], [ 6, 0.67], [ 7, 0.60], [ 7, 0.59], [ 7, 0.58], [ 7, 0.58], [ 8, 0.53], /* size=06 */ [ 6, 1.00], [ 6, 0.95], [ 6, 0.92], [ 6, 0.90], [ 6, 0.88], [ 6, 0.85], [ 7, 0.76], [ 7, 0.75], [ 7, 0.73], [ 7, 0.72], [ 7, 0.70], [ 7, 0.69], [ 8, 0.63], [ 8, 0.62], [ 8, 0.61], [ 8, 0.60], /* size=07 */ [ 7, 1.00], [ 7, 0.96], [ 7, 0.93], [ 7, 0.91], [ 7, 0.89], [ 7, 0.87], [ 7, 0.85], [ 8, 0.78], [ 8, 0.76], [ 8, 0.75], [ 8, 0.73], [ 8, 0.72], [ 8, 0.71], [ 9, 0.65], [ 9, 0.64], [ 9, 0.63], /* size=08 */ [ 8, 1.00], [ 8, 0.96], [ 8, 0.94], [ 8, 0.92], [ 8, 0.91], [ 8, 0.89], [ 8, 0.87], [ 8, 0.85], [ 9, 0.78], [ 9, 0.77], [ 9, 0.76], [ 9, 0.75], [ 9, 0.73], [ 9, 0.72], [10, 0.67], [10, 0.65], /* size=09 */ [ 9, 1.00], [ 9, 0.96], [ 9, 0.95], [ 9, 0.93], [ 9, 0.91], [ 9, 0.90], [ 9, 0.89], [ 9, 0.87], [10, 0.80], [10, 0.79], [10, 0.78], [10, 0.77], [10, 0.75], [10, 0.75], [10, 0.73], [11, 0.68], /* size=10 */ [10, 1.00], [10, 0.97], [10, 0.95], [10, 0.94], [10, 0.92], [10, 0.91], [10, 0.89], [10, 0.88], [10, 0.87], [11, 0.81], [11, 0.80], [11, 0.78], [11, 0.77], [11, 0.76], [11, 0.75], [11, 0.74], /* size=11 */ [11, 1.00], [11, 0.97], [11, 0.95], [11, 0.94], [11, 0.93], [11, 0.92], [11, 0.90], [11, 0.89], [11, 0.88], [12, 0.82], [12, 0.81], [12, 0.80], [12, 0.79], [12, 0.78], [12, 0.77], [12, 0.76], /* size=12 */ [12, 1.00], [12, 0.97], [12, 0.96], [12, 0.95], [12, 0.93], [12, 0.92], [12, 0.91], [12, 0.90], [12, 0.89], [12, 0.87], [13, 0.82], [13, 0.81], [13, 0.80], [13, 0.79], [13, 0.78], [13, 0.77], /* size=13 */ [13, 1.00], [13, 0.97], [13, 0.96], [13, 0.95], [13, 0.94], [13, 0.93], [13, 0.92], [13, 0.91], [13, 0.89], [13, 0.88], [14, 0.84], [14, 0.82], [14, 0.82], [14, 0.81], [14, 0.80], [14, 0.79], /* size=14 */ [14, 1.00], [14, 0.98], [14, 0.96], [14, 0.95], [14, 0.94], [14, 0.93], [14, 0.92], [14, 0.91], [14, 0.90], [14, 0.89], [14, 0.88], [15, 0.84], [15, 0.82], [15, 0.82], [15, 0.81], [15, 0.80], /* size=15 */ [15, 1.00], [15, 0.98], [15, 0.96], [15, 0.95], [15, 0.95], [15, 0.93], [15, 0.93], [15, 0.92], [15, 0.91], [15, 0.90], [15, 0.89], [16, 0.84], [16, 0.84], [16, 0.83], [16, 0.82], [16, 0.81], ]; ``` ### License ``` Copyright 2018 Yaroslav Serhieiev <noomorph@gmail.com> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ```
92.254545
284
0.497635
krc_Cyrl
0.911418
e5ebf892d039492e91cb715e003e2550694c65cb
7,392
md
Markdown
README.md
SabaunT/fyf-token
54cd01f463f53d5280d673354917060a30c43149
[ "MIT" ]
null
null
null
README.md
SabaunT/fyf-token
54cd01f463f53d5280d673354917060a30c43149
[ "MIT" ]
null
null
null
README.md
SabaunT/fyf-token
54cd01f463f53d5280d673354917060a30c43149
[ "MIT" ]
null
null
null
# Frictionless yield farming token Token which distributes fees, taken from transfers amounts, between all its holders. Smart contract works very much like [rfi.finance](https://github.com/reflectfinance) token, but concepts are more clear and implemented in secure manner. ## How it works? ### Distributing fees. The classic way - version 1 So the task sounds pretty simple: take a defined percent of fees from each transfer amount and increase all the balances the next way: `balance = balance + fee * (balance/totalSupply)`. This consequently means that we should iterate over all the balances and change them in the loop. That's about *O(n)*, where *n* is the amount of holders. Such function requires really lots of gas if amount of holders goes really high, so we can face block gas limit restriction. So is there any other more cheap way to do that? ### Distributing fees. Multiply on some *k*. Well, another way to do that is to have some kind of `uint256 k` coefficient, could get us a new balance with earned fees like this: `balance = balance * k`. Obviously, this coefficient is a decimal number. I think it's clear that in such case you should not iterate over all the balances and apply the coefficient. You just use it when the request for the balance comes in (either `balanceOf` or any other operation). I should mention that researching details of this implementation and its pitfalls wasn't the aim of the project, so I continue by jumping to the next part. ### Distributing fees. Divide on some *k*. *Before going further, I should state that using `/` in the text lower is the same as floor division.* This mechanism provided by [Ampleforth](https://github.com/ampleforth) developers. The project had a demand to "instantly" change holders balances in accordance to price changes of the token. Pretty same task as we have. Here are some details how it works. Instead of operation on balances stored in `mapping(address => uint256) private _balances` (further in the text - "standard" or "outer" balance) variable of *ERC20* token we introduce a new dimension for the balances. Let's call it an **inner** balance. Inner type of balance has some correlation with the standard one. It's just the biggest multiple of the standard balance. Calculating its value is pretty easy in solidity: 1. So your maximum number is `uint256 constant MAX = type(uint256).max;`. 2. Sum of all balances is equal to `totalSupply`. 3. Sum of inner balances is equal to `innerTotalSupply` which is the biggest multiple of `totalSupply`. So it's value is `uint256 constant innerTotalSupply = MAX - (MAX % totalSupply);`. 4. The coefficient `uint256 k = innerTotalSupply/totalSupply`. Further we will reference *k* by *rate*. So the inner balance is just a dimension of the outer balance multiplied by the *rate*. Still it doesn't make clear how fees are distributed. So in the project holder actually owns and manage his inner balance. Inner balances are changed only by transferring operations. When fees are taken they are not distributed between holders by changing their inner balances. What is really changed is the representation of their inner balances - the outer balance. Generally, outer balances are presented only when appropriate requests are done (i.e. `balanceOf()`) by returning `innerBalance/rate`. To make outer balance bigger because of earned fees, we should simply make the *rate* lower in the provided earlier ratio. Making fee lower could be done by 2 ways: increasing `totalSupply` or decreasing `innerTotalSupply`. Both increasing and decreasing are done by *fee* value. So the project uses the decreasing method: `rate = innerTotalSupply - fee*rate / totalSupply`. Obviously, this operation makes "value" of inner balances higher in comparison to outer balances - for the same amount of outer total supply you need less amount of inner supply and, consequently, the same amount of inner balance has a bigger outer representation. Another way to do that could be just increasing the denominator value by the *fee*: `rate = innerTotalSupply/totalSupply + fee`. It means that the sum of outer balances increased by *fee* value, so all the outer balances got their respected share of the *fee*, however the actual balance didn't change. So for the same actual inner balance we get a bigger outer representation. #### Example Let's simplify getting a new outer balance like this: ``` 1. newBalance = innerBalance / ((innerTotalSupply - rate*fee) / totalSupply) innerTotalSupply = totalSupply*rate 2. newBalance = innerBalance / (rate * (totalSupply - fee) / totalSupply) innerBalance = balance * rate 3. newBalance = (balance * rate) / (rate * (totalSupply - fee) / totalSupply) 4. newBalance = (balance * rate * totalSupply) / rate * (totalSupply - fee) 5. newBalance = (totalSupply * balance)/(totalSupply - fee) ``` And a simple test. ```python # /usr/bin/python3 balance = 2327327472364723647 fee = 123832300 totalSupply = 1e24 balance1 = balance + balance*(fee/totalSupply) balance2 = (balance*totalSupply)/(totalSupply-fee) balance1 == balance2 # true ``` #### Some things to mention 1. The maximum representation value of the outer balance was used for max granularity. Just the same as Ampleforth devs [did](https://github.com/ampleforth/uFragments/blob/master/contracts/UFragments.sol). 2. A smaller amount of decimals (9) was used for a more precision. 3. Sum of all balances doesn't equal to`totalSupply`, because the conversation between inner and outer has non-zero rounding error. In practice the difference is about 1 or 2. 4. There is a possible bug with `innerTotalSupply` reaching such a small value, that the precision of balances calculation could be lost. However, reaching that in practise is quite hard, because `innerTotalSupply` is a very big number. Still, a possible fix must be mentioned. Firstly, while deploying the contract I suggest using proxy. Secondly, we can define some threshold value for the `innerTotalSupplt` after reaching which we could "reinitialize" our `innerTotalSupply` by the initial value, which is the biggest multiple of `totalSupply` (`MAX - (MAX % totalSupply)`) and recalculate balances in the next manner: `innerBalance = (innerBalance / rateBeforeInitialization) * rateAfterInitialization`, where `rateAfterInitialization` is `(MAX - (MAX % totalSupply)) / totalSupply`. The idea could be implemented in various ways. 5. Some projects want to have a burning with a fee distribution. The burning mechanism could be provided, but should be borne in mind that you can't burn total supply forever. So burning mechanism should be stopped after reaching some threshold value. ## Tests For gas-cheap projects local truffle network can be used: ``` npx truffle test # or with events npx truffle test --show-events ``` If contract deployment requires much gas, use local ganache-network: ``` ganache-cli -p 7545 -i 5777 --allowUnlimitedContractSize --gasLimit 0xFFFFFFFFFFFF npx truffle migrate --reset --network development npx truffle test --network development # or with events npx truffle test --show-events --network development ``` Make sure you have npx package installed globally. ## TODO: 1. Деплой прокси контракта. Ресерчи прокси и как их деплоить. 2. Посмотри, что делают проекты после деплоя. К примеру, они могут делать renounceOwnership и т.п. вещи делать. Посмотри на etherscan.
62.644068
205
0.775162
eng_Latn
0.996514
e5ec2210afc041fb945bcc0b96ee072113a42091
2,923
md
Markdown
docs/framework/unmanaged-api/hosting/iclrappdomainresourcemonitor-getcurrentallocated-method.md
CodeTherapist/docs.de-de
45ed8badf2e25fb9abdf28c20e421f8da4094dd1
[ "CC-BY-4.0", "MIT" ]
null
null
null
docs/framework/unmanaged-api/hosting/iclrappdomainresourcemonitor-getcurrentallocated-method.md
CodeTherapist/docs.de-de
45ed8badf2e25fb9abdf28c20e421f8da4094dd1
[ "CC-BY-4.0", "MIT" ]
null
null
null
docs/framework/unmanaged-api/hosting/iclrappdomainresourcemonitor-getcurrentallocated-method.md
CodeTherapist/docs.de-de
45ed8badf2e25fb9abdf28c20e421f8da4094dd1
[ "CC-BY-4.0", "MIT" ]
null
null
null
--- title: ICLRAppDomainResourceMonitor::GetCurrentAllocated-Methode ms.date: 03/30/2017 api_name: - ICLRAppDomainResourceMonitor.GetCurrentAllocated api_location: - mscoree.dll api_type: - COM f1_keywords: - ICLRAppDomainResourceMonitor::GetCurrentAllocated helpviewer_keywords: - GetCurrentAllocated method [.NET Framework hosting] - ICLRAppDomainResourceMonitor::GetCurrentAllocated method [.NET Framework hosting] ms.assetid: 7bab209c-efd4-44c2-af30-61abab0ae2fc topic_type: - apiref author: rpetrusha ms.author: ronpet ms.openlocfilehash: 4011881e98c109458bf87efcc1b09463c064f23f ms.sourcegitcommit: 3d5d33f384eeba41b2dff79d096f47ccc8d8f03d ms.translationtype: MT ms.contentlocale: de-DE ms.lasthandoff: 05/04/2018 --- # <a name="iclrappdomainresourcemonitorgetcurrentallocated-method"></a>ICLRAppDomainResourceMonitor::GetCurrentAllocated-Methode Ruft die Gesamtgröße in Bytes aller speicherbelegungen, die von der Anwendungsdomäne seit der Erstellung, ohne Subtraktion des freigegebenen Speichers, die Sammlung veralteter Objekte aufgenommen wurde, vorgenommen wurden. ## <a name="syntax"></a>Syntax ``` HRESULT GetCurrentAllocated([in] DWORD dwAppDomainId, [out] ULONGLONG* pBytesAllocated); ``` #### <a name="parameters"></a>Parameter `dwAppDomainId` [in] Die ID der angeforderten Anwendungsdomäne. `pBytesAllocated` [out] Ein Zeiger auf die Gesamtgröße aller speicherbelegungen. ## <a name="return-value"></a>Rückgabewert Diese Methode gibt die folgenden spezifischen HRESULTs sowie HRESULT-Fehler zurück, die Methodenfehler anzeigen. |HRESULT|Beschreibung| |-------------|-----------------| |S_OK|Die Methode wurde erfolgreich abgeschlossen.| |COR_E_APPDOMAINUNLOADED|Die Anwendungsdomäne entladen wurde oder nicht vorhanden.| ## <a name="remarks"></a>Hinweise Diese Methode ist die nicht verwaltete Entsprechung der verwalteten <xref:System.AppDomain.MonitoringTotalAllocatedMemorySize%2A?displayProperty=nameWithType> Eigenschaft. ## <a name="requirements"></a>Anforderungen **Plattformen:** finden Sie unter [Systemanforderungen](../../../../docs/framework/get-started/system-requirements.md). **Header:** MetaHost.h **Bibliothek:** als Ressource in MSCorEE.dll enthalten **.NET Framework-Versionen:** [!INCLUDE[net_current_v40plus](../../../../includes/net-current-v40plus-md.md)] ## <a name="see-also"></a>Siehe auch [ICLRAppDomainResourceMonitor-Schnittstelle](../../../../docs/framework/unmanaged-api/hosting/iclrappdomainresourcemonitor-interface.md) [Überwachung von Anwendungsdomänenressourcen](../../../../docs/standard/garbage-collection/app-domain-resource-monitoring.md) [Hosten von Schnittstellen](../../../../docs/framework/unmanaged-api/hosting/hosting-interfaces.md) [Hosting](../../../../docs/framework/unmanaged-api/hosting/index.md)
42.985294
224
0.749572
deu_Latn
0.634388
e5ec9d295b209e113e04f0732bc847e2a984dc53
49,983
md
Markdown
docs/block-elements.md
75asa/jsx-slack
9524902e08b2d91b61ff3000c08af7f92387be44
[ "MIT" ]
null
null
null
docs/block-elements.md
75asa/jsx-slack
9524902e08b2d91b61ff3000c08af7f92387be44
[ "MIT" ]
1
2021-03-18T01:35:34.000Z
2021-03-18T01:35:34.000Z
docs/block-elements.md
75asa/jsx-slack
9524902e08b2d91b61ff3000c08af7f92387be44
[ "MIT" ]
null
null
null
###### [Top](../README.md) &raquo; [JSX components for Block Kit](jsx-components-for-block-kit.md) &raquo; Block elements # Block elements Slack provides some **[block elements](https://api.slack.com/reference/block-kit/block-elements)** that may include in [layout blocks](layout-blocks.md). e.g. interactive components to exchange information with Slack app. ## Interactive components ### <a name="button" id="button"></a> [`<Button>`: Button element](https://api.slack.com/reference/messaging/block-elements#button) A simple button to send action to registered Slack App, or open external URL. `<button>` intrinsic HTML element also works as well. ```jsx <Blocks> <Actions> <Button actionId="action" value="value" style="primary"> Action button </Button> <Button url="https://example.com/">Link to URL</Button> </Actions> </Blocks> ``` [<img src="./preview-btn.svg" width="240" />](https://jsx-slack.netlify.app/#bkb:jsx:eJxVjk0KwjAQhfeeYpgDNHtJCnYndCV4gJgGDM0fyUTs7Q0ZEF29H3gfTy4-mb3OJwB5MeRSHL6npRGlCHqU100hO4SX9s0qHIJQ6fA95eKCLgfyGIBZ8BgQBgom_uNb8QqfRLmehbBvHbK3k0lB4Ly6uAMluN_W360U35-95vcfbN8-4Q==) #### Props - `name` / `actionId` (optional): An identifier for the action. - `value` (optional): A string value to send to Slack App when clicked button. - `url` (optional): URL to load when clicked button. - `style` (optional): Select the color scheme of the button from `primary` and `danger`. - `confirm` (optional): [Confirmation dialog object] or [`<Confirm>` element](#confirm) to show confirmation dialog. If the confirmation object has not defined `style` prop, the style for confirm button may be inherited from the assigned button. [confirmation dialog object]: https://api.slack.com/reference/block-kit/composition-objects#confirm ### <a name="select" id="select"></a> [`<Select>`: Select menu with static options](https://api.slack.com/reference/messaging/block-elements#static_select) A menu element with static options passed by `<Option>` or `<Optgroup>`. It has a interface similar to `<select>` HTML element. In fact, `<select>` intrinsic HTML element works as well. ```jsx <Blocks> <Actions> <Select actionId="rating" placeholder="Rate it!"> <Option value="5">5 {':star:'.repeat(5)}</Option> <Option value="4">4 {':star:'.repeat(4)}</Option> <Option value="3">3 {':star:'.repeat(3)}</Option> <Option value="2">2 {':star:'.repeat(2)}</Option> <Option value="1">1 {':star:'.repeat(1)}</Option> </Select> </Actions> </Blocks> ``` [<img src="./preview-btn.svg" width="240" />](https://jsx-slack.netlify.app/#bkb:jsx:eJyVkE0KwjAQRveeYpwLhP5tShLQnStBTxDSQYOhKeno-a2JuGooboaZ4Xvf4smjD_Yx6x2APFh2YUz7cl3Jk2Uw6XkaFEbDbrwhTN5Yugc_UFR4MUzgeI-ZWrjz9AHgZfyTFHaoO-hnNrEvTSkyUmhoUbfFhg22Qd2ssBtUjbqGP_IV6grWklJkicmu-OmV4iv9DexCdbo=) #### Props - `name` / `actionId` (optional): An identifier for the action. - `placeholder` (optional): A plain text to be shown at first. - `value` (optional): A value of item to show initially. It must choose defined `value` from `<Option>` elements in children. It can pass multiple string values by array when `multiple` is enabled. - `confirm` (optional): [Confirmation dialog object] or [`<Confirm>` element](#confirm) to show confirmation dialog. #### Multiple select By defining `multiple` attribute, you also can provide [the selectable menu from multiple options][multi-select] with an appearance is similar to button or text input. The same goes for other select-like components. [multiple select]: #multiple-select [multi-select]: https://api.slack.com/reference/block-kit/block-elements#multi_select ```jsx <Blocks> <Section> What kind of dogs do you love? :dog: <Select actionId="dogs" multiple placeholder="Choose favorite dog(s)" value={['labrador', 'golden_retriver']} > <Option value="labrador">Labrador</Option> <Option value="german_shepherd">German Shepherd</Option> <Option value="golden_retriver">Golden Retriever</Option> <Option value="bulldog">Bulldog</Option> </Select> </Section> </Blocks> ``` [<img src="./preview-btn.svg" width="240" />](https://jsx-slack.netlify.app/#bkb:jsx:eJyFkbGKwzAMhvd7CuHpbspeHB-0QzkoFK5Dx-LGam2qRMF2An37sx1ztEPpYuRf-n7JllwTd7egPgDkAbvoeMgxwNHqCDc3GOALGL6GdMCdJyCe8RtWSVqVwoRRAksMoIvFj2lFZkRV-4miGwnrdSTdoWUy6FuxscwB4aJn9i5i7vUZvhZSVUDux2wLs6YJW0H67LVhLyCU3mjUrkqyWUpfkFf0vR5OweJo0RuhtkWAQxXe4Xnm4eQxejfjY_9tycBvzmBKvTE6T0TpoUKtl-C5XDbLn5atNP9rkU1d1h__ZYum) > :warning: **Slack does not allow to place the multi-select menu in `Actions` block.** So jsx-slack throws error if you're trying to use `multiple` attribute in the children of `<Actions>`. ##### Props for [multiple select] - `multiple` (optional): A boolean value that shows whether multiple options can be selected. - `maxSelectedItems` (optional): A maximum number of items to allow selected. #### As [an input component](#input-components) In `<Modal>` container, select-like components will work as [input components](#input-components) by passing suitable props such as required `label` prop. Thereby it would allow natural templating like as HTML form. ```jsx <Modal title="Programming survey"> <Select label="Language" name="language" title="Pick language you want to learn." required > <Option value="javascript">JavaScript</Option> <Option value="python">Python</Option> <Option value="java">Java</Option> <Option value="c-sharp">C#</Option> <Option value="php">PHP</Option> </Select> </Modal> ``` [<img src="./preview-btn.svg" width="240" />](https://jsx-slack.netlify.app/#bkb:jsx:eJx9kMEKwjAMhu8-Rahn3Qt0vXgRURzsCWIXtmrXzq6d7O2tLQMF2Sl__nz5A-EX26AGr7ymklXOtg77XpkWxuAmmpnYAPCaNEkfFYDGG-mSndG0AVtiyTTYx2394y2RSj5gmcBsA7zQePAWNKEz-ww7egblqImNSAa_Dl5ZAxPqEFPuOOEonRo8E6eo66R5kam_K8PsO2uYqFJdRT_pOXcVk7uxQzcwcdiuX-4iUx2rb4gX-Ydiw4v0cvEGXNR5RA==) The above JSX means exactly same as following usage of [`<Input>` layout block](layout-blocks.md#input): <!-- prettier-ignore-start --> ```jsx <Modal title="Programming survey"> <Input label="Language" title="Pick language you want to learn." required> <Select actionId="language"> ... </Select> </Input> </Modal> ``` <!-- prettier-ignore-end --> ##### Props for an input component - `label` (**required**): The label string for the element. - `id` / `blockId` (optional): A string of unique identifier of [`<Input>` layout block](layout-blocks.md#input). - `title`/ `hint` (optional): Specify a helpful text appears under the element. - `required` (optional): A boolean prop to specify whether any value must be filled when user confirms modal. - `dispatchAction` (optional): By setting `true`, the input element will dispatch [`block_actions` payload](https://api.slack.com/reference/interaction-payloads/block-actions) when used this. ### <a name="option" id="option"></a> `<Option>`: Menu item Define an item for `<Select>`. `<option>` intrinsic HTML element works as well. #### Props - `value` (optional): A string value to send to Slack App when choose item. Use its content string as value if omitted. - `selected` (optional): A boolean value to indicate initially selected option(s). _It will work only when the parent `<Select>` did not define `value` prop._ ### <a name="optgroup" id="optgroup"></a> `<Optgroup>`: Group of menu items Define a group for `<Select>`. `<optgroup>` intrinsic HTML element works as well. ```jsx <Blocks> <Actions> <Select actionId="action" placeholder="Action..."> <Optgroup label="Search with"> <Option value="search_google">Google</Option> <Option value="search_bing">Bing</Option> <Option value="search_duckduckgo">DuckDuckGo</Option> </Optgroup> <Optgroup label="Share to"> <Option value="share_facebook">Facebook</Option> <Option value="share_twitter">Twitter</Option> </Optgroup> </Select> </Actions> </Blocks> ``` [<img src="./preview-btn.svg" width="240" />](https://jsx-slack.netlify.app/#bkb:jsx:eJyNkU0OgjAQhfeeopkD0AuUJhIjceUC96SUsRAah5Si17e0hIWJ4mI6b5r3JfMjCkt6mOSBMXHUvqdH1KGq0KL2TMXPS5tDUsBGqzR2ZFt0OSQmyzJIWACvozeO5pFZ1aDNoULldMdeve82U7IFkj2VnTGHKZpqQ2QsgixjFjyZ9qimfxiQRXj_JdpZD0sYAnkKeYmSPulYx1m-D9cph8zTj8kWR30PO2uIBpDnVe23GkEf9ubRgbwlsdej4Olw8aJ8O6ng66Hf3Gyc2A==) #### Props - `label` (**required**): A plain text to be shown as a group name. ### <a name="external-select" id="external-select"></a> [`<ExternalSelect>`: Select menu with external data source](https://api.slack.com/reference/messaging/block-elements#external_select) You should use `<ExternalSelect>` if you want to provide the dynamic list from external source. It requires setup JSON entry URL in your Slack app. [Learn about external source in Slack documentation.](https://api.slack.com/reference/messaging/block-elements#external_select) ```jsx <Blocks> <Actions> <ExternalSelect actionId="category" placeholder="Select category..." minQueryLength={2} /> </Actions> </Blocks> ``` [<img src="./preview-btn.svg" width="240" />](https://jsx-slack.netlify.app/#bkb:jsx:eJyzccrJT84utuNSULBxTC7JzM8Ds4E814qS1KK8xJzg1JzU5BKwmIJCIliJZ4qtUnJiSWp6flGlElSmICcxOTUjPycltchWCaJHAaZGT08Ppiw3My-wNLWo0ic1L70kw1bJCCKhD3aAPtwFNvpQdwEAS3Mv5g==) #### Props - `name` / `actionId` (optional): An identifier for the action. - `placeholder` (optional): A plain text to be shown at first. - `initialOption` / `value` (optional): An initial option exactly matched to provided options from external source. It allows raw JSON object or `<Option>`. It can pass multiple options by array when `multiple` is enabled. - `minQueryLength` (optional): A length of typed characters to begin JSON request. - `confirm` (optional): [Confirmation dialog object] or [`<Confirm>` element](#confirm) to show confirmation dialog. ##### Props for [multiple select] - `multiple` (optional): A boolean value that shows whether multiple options can be selected. - `maxSelectedItems` (optional): A maximum number of items to allow selected. ##### Props for an input component - `label` (**required**): The label string for the element. - `id` / `blockId` (optional): A string of unique identifier of [`<Input>` layout block](layout-blocks.md#input). - `title`/ `hint` (optional): Specify a helpful text appears under the element. - `required` (optional): A boolean prop to specify whether any value must be filled when user confirms modal. - `dispatchAction` (optional): By setting `true`, the input element will dispatch [`block_actions` payload](https://api.slack.com/reference/interaction-payloads/block-actions) when used this. ### <a name="select-fragment" id="select-fragment"></a> `<SelectFragment>`: Generate options for external source You may think want to build also the data source through jsx-slack. `<SelectFragment>` component can create JSON object for external data source usable in `<ExternalSelect>`. #### Example A following is a super simple example to serve JSON for external select via [express](https://expressjs.com/). It is using [`jsxslack` tagged template literal](../README.md#quick-start-template-literal). ```javascript import { jsxslack } from 'jsx-slack' import express from 'express' const app = express() app.get('/external-data-source', (req, res) => { res.json(jsxslack` <SelectFragment> <Option value="item-a">Item A</Option> <Option value="item-b">Item B</Option> <Option value="item-c">Item C</Option> </SelectFragment> `) }) app.listen(80) ``` ### <a name="users-select" id="users-select"></a> [`<UsersSelect>`: Select menu with user list](https://api.slack.com/reference/messaging/block-elements#users_select) A select menu with options consisted of users in the current workspace. #### Props - `name` / `actionId` (optional): An identifier for the action. - `placeholder` (optional): A plain text to be shown at first. - `initialUser` / `value` (optional): The initial user ID. It can pass multiple string values by array when `multiple` is enabled. - `confirm` (optional): [Confirmation dialog object] or [`<Confirm>` element](#confirm) to show confirmation dialog. ##### Props for [multiple select] - `multiple` (optional): A boolean value that shows whether multiple options can be selected. - `maxSelectedItems` (optional): A maximum number of items to allow selected. ##### Props for an input component - `label` (**required**): The label string for the element. - `id` / `blockId` (optional): A string of unique identifier of [`<Input>` layout block](layout-blocks.md#input). - `title`/ `hint` (optional): Specify a helpful text appears under the element. - `required` (optional): A boolean prop to specify whether any value must be filled when user confirms modal. - `dispatchAction` (optional): By setting `true`, the input element will dispatch [`block_actions` payload](https://api.slack.com/reference/interaction-payloads/block-actions) when used this. ### <a name="conversations-select" id="conversations-select"></a> [`<ConversationsSelect>`: Select menu with conversations list](https://api.slack.com/reference/messaging/block-elements#conversation_select) A select menu with options consisted of any type of conversations in the current workspace. #### Props - `name` / `actionId` (optional): An identifier for the action. - `placeholder` (optional): A plain text to be shown at first. - `initialConversation` / `value` (optional): The initial conversation ID, or a special value `current`. It can pass multiple string values by array when `multiple` is enabled. - `include` (optional): An array of the kind or a string of space-separated kinds, to indicate which kind of conversation types are included in list. By default, all conversation types are included. - `public`: Public channel - `private`: Private channel - `im`: Direct message - `mpim`: Group direct message - `excludeExternalSharedChannels` (optional): A boolean value whether to exclude external [shared channels](https://api.slack.com/enterprise/shared-channels) from conversations list. - `excludeBotUsers` (optional): A boolean value whether to exclude bot users from conversations list. - `confirm` (optional): [Confirmation dialog object] or [`<Confirm>` element](#confirm) to show confirmation dialog. ##### Props for [multiple select] - `multiple` (optional): A boolean value that shows whether multiple options can be selected. - `maxSelectedItems` (optional): A maximum number of items to allow selected. ##### Props for an input component - `label` (**required**): The label string for the element. - `id` / `blockId` (optional): A string of unique identifier of [`<Input>` layout block](layout-blocks.md#input). - `title`/ `hint` (optional): Specify a helpful text appears under the element. - `required` (optional): A boolean prop to specify whether any value must be filled when user confirms modal. - `dispatchAction` (optional): By setting `true`, the input element will dispatch [`block_actions` payload](https://api.slack.com/reference/interaction-payloads/block-actions) when used this. - `responseUrlEnabled` (optional): A boolean prop whether include extra `response_urls` field to the `view_submission` event callback, for responding into selected channel via unique URL entrypoint. _This is only available in modal's input component and cannot coexist with `multiple` prop._ #### Special initial conversation: `current` jsx-slack accepts a special value `current` as an initial conversation. It indicates the origin conversation that the container surface belongs to. For example, `<ConversationsSelect initialConversation="current" />` in the modal will initially select the conversation that triggered opening the modal. ```jsx <Modal title="Send a message"> <ConversationsSelect label="Send to..." initialConversation="current" required /> <Textarea label="Message" maxLength={280} required /> </Modal> ``` [<img src="./preview-btn.svg" width="240" />](https://jsx-slack.netlify.app/#bkb:jsx:eJxNjjEOwjAUQ3dO8ZUDpIiJIenCSqf2Ap_GKpHSRCS_qMenhIIYbfnZNl1yHEi8BFjVIzpimlEKT1DtgchcUnwiFxafYukRMMpmEwW-IeyIJK21qraPXjyHf8qqcckZUT6JjMfiM9wmmrowYBXO4G9lt8_TzOsVcZK7VafzUf3IN2ea-rx9Ach6PgE=) By previewing the above JSX through [Slack Developer Tools](https://devtools.builtbyslack.com/), you can confirm its conversation is initially selected. ![](./conversations-select-current.gif) > :warning: `current` actually corresponds to [`default_to_current_conversation` field](https://api.slack.com/reference/block-kit/block-elements#conversation_multi_select) in Slack API. It will be ignored if defined initial conversations, so _multiple conversations select cannot specify `current` along with specific conversations_. ### <a name="channels-select" id="channels-select"></a> [`<ChannelsSelect>`: Select menu with channel list](https://api.slack.com/reference/messaging/block-elements#channel_select) A select menu with options consisted of public channels in the current workspace. #### Props - `name` / `actionId` (optional): An identifier for the action. - `placeholder` (optional): A plain text to be shown at first. - `initialChannel` / `value` (optional): The initial channel ID. It can pass multiple string values by array when `multiple` is enabled. - `confirm` (optional): [Confirmation dialog object] or [`<Confirm>` element](#confirm) to show confirmation dialog.irmation dialog. ##### Props for [multiple select] - `multiple` (optional): A boolean value that shows whether multiple options can be selected. - `maxSelectedItems` (optional): A maximum number of items to allow selected. ##### Props for an input component - `label` (**required**): The label string for the element. - `id` / `blockId` (optional): A string of unique identifier of [`<Input>` layout block](layout-blocks.md#input). - `title`/ `hint` (optional): Specify a helpful text appears under the element. - `required` (optional): A boolean prop to specify whether any value must be filled when user confirms modal. - `dispatchAction` (optional): By setting `true`, the input element will dispatch [`block_actions` payload](https://api.slack.com/reference/interaction-payloads/block-actions) when used this. - `responseUrlEnabled` (optional): A boolean prop whether include extra `response_urls` field to the `view_submission` event callback, for responding into selected channel via unique URL entrypoint. _This is only available in modal's input component and cannot coexist with `multiple` prop._ ### <a name="overflow" id="overflow"></a> [`<Overflow>`: Overflow menu](https://api.slack.com/reference/messaging/block-elements#overflow) An overflow menu displayed as `...` can access to some hidden menu items. It must contain 1 to 5 `<OverflowItem>` component(s). ```jsx <Blocks> <Actions> <Overflow actionId="overflow_menu"> <OverflowItem value="share">Share</OverflowItem> <OverflowItem value="reply">Reply message</OverflowItem> <OverflowItem url="https://example.com/">Open in browser</OverflowItem> </Overflow> </Actions> </Blocks> ``` [<img src="./preview-btn.svg" width="240" />](https://jsx-slack.netlify.app/#bkb:jsx:eJyNkDsOwjAQRHtOsdoD4B7ZlqBLFQkOEBmzkAj_5E8Ct4eECFIgRDWzTzNbDN8Zr69JrgD4VufOu8k_r7qneDZ-ADXh6iTQz6ix5Aq-cotklclCr0whgalVkVAeRuFsmfhZixTMHeV-FLCUkrr8VS_RCGxzDmnDGN2UDYbW2luGsg7koHNwjH5IFL99-7BpB_YegrN5nge2wGJC) #### Props - `name` / `actionId` (optional): An identifier for the action. - `confirm` (optional): [Confirmation dialog object] or [`<Confirm>` element](#confirm) to show confirmation dialog. ### <a name="overflow-item" id="overflow-item"></a> `<OverflowItem>`: Menu item in overflow menu #### Props - `value` (optional): A string value to send to Slack App when choose item. - `url` (optional): URL to load when clicked button. ### <a name="date-picker" id="date-picker"></a> [`<DatePicker>`: Select date from calendar](https://api.slack.com/reference/messaging/block-elements#datepicker) An easy way to let the user selecting any date is using `<DatePicker>` component. ```jsx <Blocks> <Actions> <DatePicker actionId="date_picker" initialDate={new Date()} /> </Actions> </Blocks> ``` [<img src="./preview-btn.svg" width="240" />](https://jsx-slack.netlify.app/#bkb:jsx:eJyzccrJT84utuNSULBxTC7JzM8Ds4E8l8SS1IDM5OzUIoVEsIRniq1SClAwvgAsqqSQmZdZkpmYA1Joq2RkYGipa2Cka2SkpKAPNk4fbp6NPtQWAHYmIa4=) #### Props - `name` / `actionId` (optional): An identifier for the action. - `placeholder` (optional): A plain text to be shown at first. - `initialDate` / `value` (optional): An initially selected date. It allows `YYYY-MM-DD` formatted string, UNIX timestamp in millisecond, and JavaScript [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) instance. - `confirm` (optional): [Confirmation dialog object] or [`<Confirm>` element](#confirm) to show confirmation dialog. #### As [an input component](#input-components) `<DatePicker>` also will work as [input components](#input-components), and may place as the children of `<Modal>` by passing required props. ```jsx <Modal title="My App"> <DatePicker label="Date" name="date" /> </Modal> ``` [<img src="./preview-btn.svg" width="240" />](https://jsx-slack.netlify.app/#bkb:jsx:eJyz8c1PScxRKMksyUm1VfKtVHAsKFCy41JQsHFJLEkNyEzOTi1SyElMSs2xVQKJKCnkJeYCVaaA2fp2XDb6YBPsAFtcFsA=) ##### Props for an input component - `label` (**required**): The label string for the element. - `id` / `blockId` (optional): A string of unique identifier of [`<Input>` layout block](layout-blocks.md#input). - `title`/ `hint` (optional): Specify a helpful text appears under the element. - `required` (optional): A boolean prop to specify whether any value must be filled when user confirms modal. - `dispatchAction` (optional): By setting `true`, the input element will dispatch [`block_actions` payload](https://api.slack.com/reference/interaction-payloads/block-actions) when used this. ### <a name="time-picker" id="time-picker"></a> [`<TimePicker>`: Select time through picker](https://api.slack.com/reference/messaging/block-elements#timepicker) `<TimePicker>` component lets users input or select a specific time easily. ```jsx <Blocks> <Actions> <TimePicker actionId="time_picker" initialTime={new Date()} /> </Actions> </Blocks> ``` [<img src="./preview-btn.svg" width="240" />](https://jsx-slack.netlify.app/#bkb:jsx:eJyzccrJT84utuNSULBxTC7JzM8Ds4G8kMzc1IDM5OzUIoVEsIRniq1SCVAwvgAsqqSQmZdZkpmYA1Joq2RoZGVsrqSgDzZJH26UjT7UAgDo1SD8) #### Props - `name` / `actionId` (optional): An identifier for the action. - `placeholder` (optional): A plain text to be shown at first. - `initialTime` / `value` (optional): An initially selected time. It accepts `HH:mm` formatted string, and a value that points out designated datetime: UNIX timestamp in millisecond or JavaScript [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) instance. - `confirm` (optional): [Confirmation dialog object] or [`<Confirm>` element](#confirm) to show confirmation dialog. #### As [an input component](#input-components) ```jsx <Home> <TimePicker label="Time" name="time" required dispatchAction /> </Home> ``` [<img src="./preview-btn.svg" width="240" />](https://jsx-slack.netlify.app/#bkb:jsx:eJyz8cjPTbXjUlCwCcnMTQ3ITM5OLVLISUxKzbFVAokoKeQl5qbaKpWA2UWphaWZRakpCimZxQWJJckZjsklmfl5Cvp2XDb6YJMALlUasA==) ##### Props for an input component - `label` (**required**): The label string for the element. - `id` / `blockId` (optional): A string of unique identifier of [`<Input>` layout block](layout-blocks.md#input). - `title`/ `hint` (optional): Specify a helpful text appears under the element. - `required` (optional): A boolean prop to specify whether any value must be filled when user confirms modal. - `dispatchAction` (optional): By setting `true`, the input element will dispatch [`block_actions` payload](https://api.slack.com/reference/interaction-payloads/block-actions) when used this. ### <a name="checkbox-group" id="checkbox-group"></a> [`<CheckboxGroup>`: Checkbox group](https://api.slack.com/reference/block-kit/block-elements#checkboxes) A container for grouping checkboxes. ```jsx <Home> <Section> <b>ToDo List</b> <CheckboxGroup actionId="todo"> <Checkbox value="xxx-0001"> <b>Learn about Slack app</b> ( <time dateTime={new Date(2020, 1, 24)}>{'{date}'}</time>) <small> <i> XXX-0001: <b>High</b> </i> </small> </Checkbox> <Checkbox value="xxx-0002"> <b>Learn about jsx-slack</b> ( <time dateTime={new Date(2020, 1, 27)}>{'{date}'}</time>) <small> <i> XXX-0002: <b>Medium</b> </i> </small> </Checkbox> <Checkbox value="xxx-0003" checked> <s> <b>Prepare development environment</b> ( <time dateTime={new Date(2020, 1, 21)}>{'{date}'}</time>) </s> <small> <i> XXX-0003: <b>Medium</b> </i> </small> </Checkbox> </CheckboxGroup> </Section> </Home> ``` [<img src="./preview-btn.svg" width="240" />](https://jsx-slack.netlify.app/#bkb:jsx:eJy1k89LwzAUx-_-FY-c9DDSZsqmpLkoOGGCMA-9pu3DxbVNadJSEP93mzjb7rCJMG_vxzffl8-Dx1e6QHEBwDeYWqVLF_dZIl71g4a1MpbTZF-832K6S3T3WOumAun1T1lErM40-dZMVNDKvMGIdF03C4IgHBTefo2yLkEmurGwyWW6A1lVbhRccqsKhExadEFEwpslu170FgERH678yanriKvR0BQyz8cBfUVNM4A4jv0v7tzwlXrbDlh7PZ084PTAj9Mfpt8g2XHId9PNjAM9Drlgt-wckMxDPmOmmuJfMOcEUtfBbGJmDuYk4qXGStY9I7aY66rA0gKWrap16eLja2BhsDy1BmrE33cyP89Oxtwfgb8cOpwOp_6cvgAwn91k) #### Props - `name` / `actionId` (optional): An identifier for the action. - `values` (optional): An array of value for initially selected checkboxes. They must match to `value` property in `<Checkbox>` elements in children. - `confirm` (optional): [Confirmation dialog object] or [`<Confirm>` element](#confirm) to show confirmation dialog. #### As [an input component](#input-components) ```jsx <Modal title="Quick survey"> <CheckboxGroup id="foods" name="foods" label="What do you want to eat for the party in this Friday?" required > <Checkbox value="burger">Burger :hamburger:</Checkbox> <Checkbox value="pizza">Pizza :pizza:</Checkbox> <Checkbox value="taco">Tex-Mex taco :taco:</Checkbox> <Checkbox value="sushi">Sushi :sushi:</Checkbox> <Checkbox value="others"> Others <small> <i>Let me know in the below form.</i> </small> </Checkbox> </CheckboxGroup> <Input type="text" id="others" name="others" label="What do you want?" /> </Modal> ``` [<img src="./preview-btn.svg" width="240" />](https://jsx-slack.netlify.app/#bkb:jsx:eJyFks1OwzAQhO99ipHvkHvkuBJIICQqQCBxdpotseLEwT9t0qfHcRqgh6oXr76xx17tmG9MJTW88poK9hbUtoELdk8jEyuA39e0bUozPFoT-igAqirYzpjKsYSdbOlM0LIkXbDPWnpUBqMJOMjOwxtQlHbGwteEXlo_QnURlMODVZUc1_MNlr6DslRFEEn47QJ7qUN8rgz2iywTd6kir2U7SznPlrMXrL06HiUTr1NBnui6ycutYeKDhpsNDZgI-bRed7rgasXE-1SQJ7puMnFA1rF5F3hJeALuWqn1shVZiWfyaAlNZw7zQAkxgghx1u0tz9Rymmf_zOdd_FFKOklPXR9ibmM_TYAGz1L2p-ZOwS90IfU1QyZWPEu_TPwAz_3ERA==) ##### Props for an input component - `label` (**required**): The label string for the group. - `id` / `blockId` (optional): A string of unique identifier of [`<Input>` layout block](layout-blocks.md#input). - `title`/ `hint` (optional): Specify a helpful text appears under the group. - `required` (optional): A boolean prop to specify whether any value must be filled when user confirms modal. - `dispatchAction` (optional): By setting `true`, the input element will dispatch [`block_actions` payload](https://api.slack.com/reference/interaction-payloads/block-actions) when used this. ### <a name="checkbox" id="checkbox"></a> `<Checkbox>`: Checkbox A checkbox item. It must place in the children of `<CheckboxGroup>`. It supports raw [mrkdwn format](https://api.slack.com/reference/surfaces/formatting) / [HTML-like formatting](./html-like-formatting.md) in the both of contents and `description` property. ```jsx <Checkbox value="checkbox" description={ <> XXX-1234 - <i>by Yuki Hattori</i> </> } > <b>Checkbox item</b>: foobar </Checkbox> ``` [<img src="./preview-btn.svg" width="240" />](https://jsx-slack.netlify.app/#bkb:jsx:eJxlj80KwjAQhO8-xdJ7Wfw5yRoQD_YR4jEpEZcmrqSJ6NtbtX_ibWf5hpmhSoJTCwDa14nl2r7vTh0urm6sPI5R8u37m33hbnx2u6LudTEQHWPVSHFygdCqLZxFrIkT1Abj_WQC0FqXy9V6AyUQK_uEU24YKpOSRCbkWQD-mAmHuL45_lUnHLcRfva-AG1pRKg=) > :information_source: [Links and mentions through `<a>` tag](https://github.com/yhatt/jsx-slack/blob/master/docs/html-like-formatting.md#links) will be ignored by Slack. #### Props - `value` (**required**): A string value to send to Slack App when choosing the checkbox. - `description` (optional): A description string or JSX element for the current checkbox. It can see with faded color just below the main label. `<Checkbox>` prefers this prop than redirection by `<small>`. - `checked` (optional): A boolean value indicating the initial state of the checkbox. _It will work only when the parent `<CheckboxGroup>` did not define `values` prop._ #### Redirect `<small>` into description `<Checkbox>` allows `<small>` element for ergonomic templating, to redirect the content into description when `description` prop is not defined. A below checkbox is meaning exactly the same as an example shown earlier. ```jsx <Checkbox value="checkbox"> <b>Checkbox item</b>: foobar <small> XXX-1234 - <i>by Yuki Hattori</i> </small> </Checkbox> ``` ### <a name="radio-button-group" id="radio-button-group"></a> [`<RadioButtonGroup>`: Radio button group](https://api.slack.com/reference/block-kit/block-elements#radio) A container for grouping radio buttons. ```jsx <Home> <Section> Select the tier of our service: <RadioButtonGroup actionId="tier" value="free"> <RadioButton value="free" description="$0!"> <b>Free</b> </RadioButton> <RadioButton value="standard" description={ <Fragment> $5/month, <b>and 30 days trial!</b> </Fragment> } > <b>Standard</b> </RadioButton> <RadioButton value="premium" description="$30/month"> <b>Premium</b> </RadioButton> <RadioButton value="business" description={<i>Please contact to support.</i>} > <b>Business</b> </RadioButton> </RadioButtonGroup> </Section> </Home> ``` [<img src="./preview-btn.svg" width="240" />](https://jsx-slack.netlify.app/#bkb:jsx:eJydkrtuAyEQRft8xRi5jMJKVpqI3cKFk3RW9gvYZSwj8RIPS_n7AGttTIq8Ori69zCMLnuxGoc7ADbiHKU15QwwospXiGeEKNGDPYFNHgL6i5zxqXrYGxfS7lOM1jx7mxzwSngVPSkhAheuEvbk5BHJwm1TjQEEhtlLVxA92XabNZJD03DIHkanFUNvON-xQ-RGcC9a2nhVb4hZD5or9XkH2D5SbU0835dMTsCuA8HfA0Qvudq0adrEfz2g86hl0l__v-uWp9u5j4v5P4uYUpAGQ2iB-6v6wyKYHI4KeUCY81C8VMNCSM5ZHx8YlX9ZQyPV4tT-0bWAjNZSfgDbYMF4) #### Props - `name` / `actionId` (optional): An identifier for the action. - `value` (optional): A value for initially selected option. It must match to `value` property in one of `<RadioButton>` elements in children. - `confirm` (optional): [Confirmation dialog object] or [`<Confirm>` element](#confirm) to show confirmation dialog. #### As [an input component](#input-components) In `<Modal>` and `<Home>` container, `<RadioButtonGroup>` as an input component can place as the direct child of container by passing `label` prop. ```jsx <Modal title="Preferences" close="Cancel"> <RadioButtonGroup label="Notifications" id="notifications" name="notifications" title="Setting a frequency of notifications by app." value="all" required > <RadioButton value="all"> All events <small>Notify all received events every time.</small> </RadioButton> <RadioButton value="summary"> Daily summary <small>Send a daily summary at AM 9:30 every day.</small> </RadioButton> <RadioButton value="off">Off</RadioButton> </RadioButtonGroup> <Input type="submit" value="OK" /> </Modal> ``` [<img src="./preview-btn.svg" width="240" />](https://jsx-slack.netlify.app/#bkb:jsx:eJydUttKxDAQfd-vGPIBW8EnpQ2sCiKyrrhfMG0mSyBNajIt5O_NplW6rL74FOZcck4u9d4rtMCGLTXiPZCmQK6jKKCzPmbsEfNohdwA1B-ojH8Ymb17Dn4cMgZgsSXbiDfPRpsO2XgXRWGMaoS7hh329CuxtDgSs3EnQNCBPsdcJ4HXcGGANgEOw3Y2TmjHbERr5_lsM4FUHmQB1s3X6pkF2FkLNJHjuAB17DMvy6FyUqYDdWQmUovuvISUK_e0ratZPUdVq6y_0-PY9xjST4MnNDbBgl6WOJJT-TLUWgHIsNvD3f3tzdJEYfpXEa-1kAetr-QXQHnugr64YWTgNJRDtL1h8b3V4VVAJTd1VT6V_AJi8MGk) ##### Props for an input component - `label` (**required**): The label string for the group. - `id` / `blockId` (optional): A string of unique identifier of [`<Input>` layout block](layout-blocks.md#input). - `title`/ `hint` (optional): Specify a helpful text appears under the group. - `required` (optional): A boolean prop to specify whether any value must be filled when user confirms modal. - `dispatchAction` (optional): By setting `true`, the input element will dispatch [`block_actions` payload](https://api.slack.com/reference/interaction-payloads/block-actions) when used this. ### <a name="radio-button" id="radio-button"></a> `<RadioButton>`: Radio button An item of the radio button. It must place in the children of `<RadioButtonGroup>`. It supports raw [mrkdwn format](https://api.slack.com/reference/surfaces/formatting) / [HTML-like formatting](./html-like-formatting.md) in the both of contents and `description` property. ```jsx <RadioButton value="radio" description={<i>Description</i>}> <b>Radio button</b> </RadioButton> ``` [<img src="./preview-btn.svg" width="240" />](https://jsx-slack.netlify.app/#bkb:jsx:eJyz8cjPTbXjUlCwcUwuyczPKwaxgbygxJTMfKfSkpL8PPei_NICiDCqhEJZYk5pqq1SEUhICaYCqCbJDqxKIQmszEY_CUmuODcxJwfBB4pk2rmkFicXZRaA7LfRz0RSrI-i2kYfyXKoO_WxOdRGH-4ZG32wBwHp90Hi) > :information_source: [Links and mentions through `<a>` tag](https://github.com/yhatt/jsx-slack/blob/master/docs/html-like-formatting.md#links) will be ignored by Slack. #### Props - `value` (**required**): A string value to send to Slack App when choosing the radio button. - `description` (optional): A description string or JSX element for the current radio button. It can see with faded color just below the main label. `<RadioButton>` prefers this prop than redirection by `<small>`. - `checked` (optional): A boolean value indicating the initial state of the radio button. _It will work only when the parent `<RadioButtonGroup>` did not define `value` prop._ #### Redirect `<small>` into description `<RadioButton>` allows `<small>` element for ergonomic templating, to redirect the text content into description when `description` prop is not defined. A below radio button is meaning exactly the same as an example shown earlier. ```jsx <RadioButton value="radio"> <b>Radio button</b> <small> <i>Description</i> </small> </RadioButton> ``` ## [Composition objects](https://api.slack.com/reference/messaging/composition-objects) ### <a name="confirm" id="confirm"></a> [`<Confirm>`: Confirmation dialog](https://api.slack.com/reference/messaging/composition-objects#confirm) Define confirmation dialog. Many interactive elements can open confirmation dialog when selected, by passing `<Confirm>` to `confirm` prop. ```jsx <Blocks> <Actions> <Button actionId="commit" value="value" confirm={ <Confirm title="Commit your action" confirm="Yes, please" deny="Cancel"> <b>Are you sure?</b> Please confirm your action again. </Confirm> } > Commit </Button> </Actions> </Blocks> ``` [<img src="./confirmation.png" width="500" />][confirmation] [<img src="./preview-btn.svg" width="240" />][confirmation] [confirmation]: https://api.slack.com/tools/block-kit-builder?blocks=%5B%7B%22type%22%3A%22actions%22%2C%22elements%22%3A%5B%7B%22type%22%3A%22button%22%2C%22text%22%3A%7B%22type%22%3A%22plain_text%22%2C%22text%22%3A%22Commit%22%2C%22emoji%22%3Atrue%7D%2C%22action_id%22%3A%22commit%22%2C%22confirm%22%3A%7B%22title%22%3A%7B%22type%22%3A%22plain_text%22%2C%22text%22%3A%22Commit%20your%20action%22%2C%22emoji%22%3Atrue%7D%2C%22text%22%3A%7B%22type%22%3A%22mrkdwn%22%2C%22text%22%3A%22*Are%20you%20sure%3F*%20Please%20confirm%20your%20action%20again.%22%2C%22verbatim%22%3Atrue%7D%2C%22confirm%22%3A%7B%22type%22%3A%22plain_text%22%2C%22text%22%3A%22Yes%2C%20please%22%2C%22emoji%22%3Atrue%7D%2C%22deny%22%3A%7B%22type%22%3A%22plain_text%22%2C%22text%22%3A%22Cancel%22%2C%22emoji%22%3Atrue%7D%7D%2C%22value%22%3A%22value%22%7D%5D%7D%5D You can use [HTML-like formatting](./html-like-formatting.md) to the content of confirmation dialog. However, you have to be careful that _Slack ignores any line breaks and the content will render just in a line._ #### Props - `title` (optional): The title of confirmation dialog. - `confirm` (optional): A text content of the button to confirm. Slack would use the default localized label if not defined. - `deny` (optional): A text content of the button to cancel. Slack would use the default localized label if not defined. - `style` (optional): Select the color scheme of the confirm button. _When not defined, jsx-slack may inherit a value from assigned component such as [`<Button>`](#button)._ - `primary`: Green button on desktop, and blue text on mobile. (Slack's default if not defined) - `danger`: Red button on desktop, and red text on mobile. ### <a name="mrkdwn" id="mrkdwn"></a> [`<Mrkdwn>`: Text composition object for `mrkdwn` type](https://api.slack.com/reference/block-kit/composition-objects#text) Generates text composition object for `mrkdwn` type. You can use `<Mrkdwn>` component as immediate child of components which support HTML-like formatting to override mrkdwn text generated by jsx-slack. #### Bypass HTML-like formatting [HTML-like formatting](./html-like-formatting.md) is a comfortable way to define Slack Block Kit surfaces with familiar syntaxes, but auto-escape for [mrkdwn special chracters](https://api.slack.com/reference/surfaces/formatting#escaping) may interfere with the completed mrkdwn text. You can use `<Mrkdwn raw>` if you want to use the raw mrkdwn string as is. It bypasses HTML-like formatting so you cannot use any JSX tags in contents. ```jsx <Blocks> <Section> <Mrkdwn raw verbatim> {'Hey <@U0123ABCD>, thanks for submitting your report.'} </Mrkdwn> </Section> </Blocks> ``` [<img src="./preview-btn.svg" width="240" />](https://jsx-slack.netlify.app/#bkb:jsx:eJyzccrJT84utuNSULAJTk0uyczPA7GBPN-i7JTyPIWixHKFstSipMSSzFyIjIKCR2qlglpOibVDqIGhkbGjk7OLWnqJtY5CSUZiXnaxQlp-kUJxaVJuZklJZl66QmV-aZFCUWpBflGJHsRofYjZYEv14bba6EPdAgAgsC25) In this case, `<@U0123ABCD>` will render as the mention link to specific user. #### Automatic parsing _(not recommended)_ Setting `verbatim` prop to `false` will tell Slack to auto-convert links, conversation names, and certain mentions to be linkified and automatically parsed. If `verbatim` set to true Slack will skip any preprocessing. ```jsx <Blocks> {/* Section block */} <Section> <Mrkdwn verbatim={false}>https://example.com/</Mrkdwn> </Section> {/* Section block with fields */} <Section> <Field> <Mrkdwn verbatim={false}>#general</Mrkdwn> </Field> </Section> {/* Context block */} <Context> <Mrkdwn verbatim={false}>@here</Mrkdwn> Hello! </Context> {/* Confirm composition object */} <Actions> <Button confirm={ <Confirm title="Commit your action" confirm="Yes, please" deny="Cancel"> <Mrkdwn verbatim={false}> <b>@foobar</b> Are you sure? </Mrkdwn> </Confirm> } > Button </Button> </Actions> </Blocks> ``` [<img src="./preview-btn.svg" width="240" />](https://api.slack.com/tools/block-kit-builder?mode=message&blocks=%5B%7B%22type%22%3A%22section%22%2C%22text%22%3A%7B%22type%22%3A%22mrkdwn%22%2C%22text%22%3A%22https%3A%2F%2Fexample.com%2F%22%2C%22verbatim%22%3Afalse%7D%7D%2C%7B%22type%22%3A%22section%22%2C%22fields%22%3A%5B%7B%22type%22%3A%22mrkdwn%22%2C%22text%22%3A%22%23general%22%2C%22verbatim%22%3Afalse%7D%5D%7D%2C%7B%22type%22%3A%22context%22%2C%22elements%22%3A%5B%7B%22type%22%3A%22mrkdwn%22%2C%22text%22%3A%22%40here%22%2C%22verbatim%22%3Afalse%7D%2C%7B%22type%22%3A%22mrkdwn%22%2C%22text%22%3A%22Hello!%22%2C%22verbatim%22%3Atrue%7D%5D%7D%2C%7B%22type%22%3A%22actions%22%2C%22elements%22%3A%5B%7B%22type%22%3A%22button%22%2C%22text%22%3A%7B%22type%22%3A%22plain_text%22%2C%22text%22%3A%22Button%22%2C%22emoji%22%3Atrue%7D%2C%22confirm%22%3A%7B%22title%22%3A%7B%22type%22%3A%22plain_text%22%2C%22text%22%3A%22Commit%20your%20action%22%2C%22emoji%22%3Atrue%7D%2C%22text%22%3A%7B%22type%22%3A%22mrkdwn%22%2C%22text%22%3A%22*%40here*%20Are%20you%20sure%3F%22%2C%22verbatim%22%3Afalse%7D%2C%22confirm%22%3A%7B%22type%22%3A%22plain_text%22%2C%22text%22%3A%22Yes%2C%20please%22%2C%22emoji%22%3Atrue%7D%2C%22deny%22%3A%7B%22type%22%3A%22plain_text%22%2C%22text%22%3A%22Cancel%22%2C%22emoji%22%3Atrue%7D%7D%7D%5D%7D%5D) <!-- INFO: We have no example in checkbox due to meaningless: Slack will be ignored links and mentions in checkbox. --> ##### Note _Slack recommends disabling automatic parsing on text composition components and they have made it clear that they might deprecate this feature in the future._ More information can be found [here](https://api.slack.com/reference/surfaces/formatting#why_you_should_consider_disabling_automatic_parsing). jsx-slack will disable automatic parsing by default even if you were not used `<Mrkdwn>` specifically. If possible, **we recommend never to use `<Mrkdwn>`** in Slack app created newly with jsx-slack. #### Props - `raw` (optional): A boolean value whether to bypass HTML-like formatting and auto-escaping. Any JSX tags cannot use in the content if enabled. - `verbatim` (optional): A boolean prop whether to disable automatic parsing for links, conversation names, and mentions by Slack. ## Input components **Input components** are available in [`<Modal>`](block-containers.md#modal) and [`<Home>`](block-containers.md#home). These include a part of [interactive components](#interactive-components) and dedicated components such as [`<Input>`](#input) and [`<Textarea>`](#textarea). All of input components **must be placed as the direct children of the container component, and defining `label` prop is required.** (for [`<Input>` layout block](layout-blocks.md#input)) The list of input components is following: - [`<Input>`](#input) / `<input>` - [`<Textarea>`](#textarea) / `<textarea>` - [`<Select>`](#select) / `<select>` - [`<ExternalSelect>`](#external-select) - [`<UsersSelect>`](#users-select) - [`<ConversationsSelect>`](#conversations-select) - [`<ChannelsSelect>`](#channels-select) - [`<DatePicker>`](#date-picker) - [`<TimePicker>`](#time-picker) - [`<CheckboxGroup>`](#checkbox-group) - [`<RadioButtonGroup>`](#radio-button-group) ### <a name="input" id="input"></a> [`<Input>`: Plain-text input element](https://api.slack.com/reference/block-kit/block-elements#input) `<Input>` component is for placing a single-line input form within supported container. It can place as children of the container component directly. It has an interface similar to `<input>` HTML element and `<input>` intrinsic HTML element also works as well, but must be defined `label` prop as mentioned above. ```jsx <Modal title="My App"> <Input label="Title" name="title" maxLength={80} required /> </Modal> ``` [<img src="./preview-btn.svg" width="240" />](https://jsx-slack.netlify.app/#bkb:jsx:eJyz8c1PScxRKMksyUm1VfKtVHAsKFCy41JQsPHMKygtUchJTErNsVUKAckrKeQl5gJVlUA4uYkVPql56SUZtkoWBkoKRamFpZlFqSkK-nZcNvpgY-0AosweLg==) #### <a name="input-props" id="input-props"></a> Props - `label` (**required**): The label string for the element. - `id` / `blockId` (optional): A string of unique identifier for [`<Input>` layout block](layout-blocks.md#input). - `name` / `actionId` (optional): A string of unique identifier for the action. - `type` (optional): `text` by default. - `title`/ `hint` (optional): Specify a helpful text appears under the element. - `placeholder` (optional): Specify a text string appears within the content of input is empty. (150 characters maximum) - `required` (optional): A boolean prop to specify whether any value must be filled when user confirms modal. - `dispatchAction` (optional): By setting `true`, the input element will dispatch [`block_actions` payload](https://api.slack.com/reference/interaction-payloads/block-actions) when used this. By defining interaction type(s) as space-separated string or array, [you can determine when `<Input>` will return the payload.](https://api.slack.com/reference/block-kit/composition-objects#dispatch_action_config) - `onEnterPressed`: Payload is dispatched when hitting Enter key while focusing to the input component. - `onCharacterEntered`: Payload is dispatched when changing input characters. - `value` (optional): An initial value for plain-text input. - `maxLength` (optional): The maximum number of characters allowed for the input element. It must up to 3000 character. - `minLength` (optional): The minimum number of characters allowed for the input element. ### <a name="input-hidden" id="input-hidden"></a> `<Input type="hidden">`: Store hidden values to the parent `<Modal>` and `<Home>` By using `<Input type="hidden">`, you can assign hidden values as the private metadata JSON of the parent `<Modal>` or `<Home>` with a familiar way in HTML form. ```jsx <Modal title="modal"> <Input type="hidden" name="foo" value="bar" /> <Input type="hidden" name="userId" value={123} /> <Input type="hidden" name="data" value={[{ hidden: 'value' }]} /> <Input name="name" label="Name" /> </Modal> ``` The above example indicates the same modal as following: ```jsx <Modal title="modal" privateMetadata={JSON.stringify({ foo: 'bar', userId: 123, data: [{ hidden: 'value' }], })} > <Input name="name" label="Name" /> </Modal> ``` You can use hidden values by parsing JSON stored in [callbacked `private_metadata` from Slack](https://api.slack.com/block-kit/surfaces/modals#private_metadata). Not only `<Modal>` but also `<Home>` accepts `<Input type="hidden">` for to store private metadata. ```jsx <Home> <Input type="hidden" name="foo" value="bar" /> <Input type="hidden" name="userId" value={123} /> <Input type="hidden" name="data" value={[{ hidden: 'value' }]} /> </Home> ``` #### Note `<Modal>` and `<Home>` prefers the string defined in `privateMetadata` prop directly than `<Input type="hidden">`. And please take care that the maximum length validation by Slack will still apply for stringified JSON. The value like string and array that cannot predict the length might over the limit of JSON string length easily (3000 characters). The best practice is only storing the value of a pointer to reference data stored elsewhere. _It's better not to store complex data as hidden value directly._ #### Props - `type` (**required**): Must be `hidden`. - `name` (**required**): The name of hidden value. - `value` (**required**): A value to store into the parent container. It must be [a serializable value to JSON](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Description). #### Custom transformer If you want to store hidden values by own way, you can use a custom transformer by passing function to `privateMetadata` prop in the parent `<Modal>` and `<Home>`. ```jsx <Modal title="test" privateMetadata={(hidden) => hidden && new URLSearchParams(hidden).toString()} > <Input type="hidden" name="A" value="foobar" /> <Input type="hidden" name="B" value={123} /> <Input type="hidden" name="C" value={true} /> </Modal> ``` In this example, the value of `private_metadata` field in returned payload would be **`A=foobar&B=123&C=true`** by transformation using [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) instead of `JSON.stringify`. The transformer takes an argument: JSON object of hidden values or `undefined` when there was no hidden values. It must return the transformed string, or `undefined` if won't assign private metadata. ### <a name="input-submit" id="input-submit"></a> `<Input type="submit">`: Set submit button text of modal `<Input type="submit">` can set the label of submit button for the current modal. It is meaning just an alias into `submit` prop of `<Modal>`, but JSX looks like more natural HTML form. ```jsx <Modal title="Example"> <Input name="name" label="Name" /> <Input type="submit" value="Send" /> </Modal> ``` `submit` prop in `<Modal>` must not define when using `<Input type="submit">`. `<Modal>` prefers the prop defined directly. #### Props - `type` (**required**): Must be `submit`. - `value` (**required**): A string of submit button for the current modal. (24 characters maximum) ### <a name="textarea" id="textarea"></a> `<Textarea>`: Plain-text input element with multiline `<Textarea>` component has very similar interface to [`<Input>` input component](#input). An only difference is to allow multi-line input. ```jsx <Modal title="My App"> <Textarea label="Tweet" name="tweet" placeholder="What’s happening?" maxLength={280} required /> </Modal> ``` [<img src="./preview-btn.svg" width="240" />](https://jsx-slack.netlify.app/#bkb:jsx:eJxFjjEOwjAQBPu84nQfCKKisI3oSReJ-sCn2NLFMc4hQsc3-B4vwUoKut3RrLSmmzwJaFRhi90LTjmjawBMz4tSYaoZQOjKYrF_MiuuJNFYB_oHWejGYRLPxeIlkH7fnxkC5cwppuG4WSMtZ06DBov7w25jhe-PWNjX0rrGtOsl9wNwCS8X) `<textarea>` intrinsic HTML element also works as well. #### Props It's exactly same as [`<Input>` component](#input-props), except `type` prop. --- ###### [Top](../README.md) &raquo; [JSX components for Block Kit](jsx-components-for-block-kit.md) &raquo; Block elements
49.635551
1,320
0.731689
eng_Latn
0.818254
e5ed4fa79afec3459a5069616086e84fad2163da
5,207
md
Markdown
docs/framework/data/adonet/dataset-datatable-dataview/sorting-and-filtering-data.md
turibbio/docs.it-it
2212390575baa937d6ecea44d8a02e045bd9427c
[ "CC-BY-4.0", "MIT" ]
null
null
null
docs/framework/data/adonet/dataset-datatable-dataview/sorting-and-filtering-data.md
turibbio/docs.it-it
2212390575baa937d6ecea44d8a02e045bd9427c
[ "CC-BY-4.0", "MIT" ]
null
null
null
docs/framework/data/adonet/dataset-datatable-dataview/sorting-and-filtering-data.md
turibbio/docs.it-it
2212390575baa937d6ecea44d8a02e045bd9427c
[ "CC-BY-4.0", "MIT" ]
null
null
null
--- title: Ordinamento e applicazione di filtri ai dati ms.date: 03/30/2017 dev_langs: - csharp - vb ms.assetid: fdd9c753-39df-48cd-9822-2781afe76200 ms.openlocfilehash: 09cee2f2b2c3288c835912c9f311bf2511c7b0d0 ms.sourcegitcommit: d2e1dfa7ef2d4e9ffae3d431cf6a4ffd9c8d378f ms.translationtype: MT ms.contentlocale: it-IT ms.lasthandoff: 09/07/2019 ms.locfileid: "70785920" --- # <a name="sorting-and-filtering-data"></a>Ordinamento e applicazione di filtri ai dati In <xref:System.Data.DataView> sono disponibili diversi metodi di ordinamento e applicazione di filtri ai dati in una <xref:System.Data.DataTable>: - La proprietà <xref:System.Data.DataView.Sort%2A> viene usata per specificare criteri di ordinamento basati su una o più colonne e includere i parametri ASC (ascendente) e DESC (discendente). - La proprietà <xref:System.Data.DataView.ApplyDefaultSort%2A> consente di creare automaticamente un criterio di ordinamento ascendente, basato sulla colonna o sulle colonne di chiave primaria della tabella. <xref:System.Data.DataView.ApplyDefaultSort%2A>si applica solo quando la proprietà **Sort** è un riferimento null o una stringa vuota e quando la tabella contiene una chiave primaria definita. - La proprietà <xref:System.Data.DataView.RowFilter%2A> consente di specificare subset di righe sulla base dei relativi valori di colonna. Per informazioni dettagliate sulle espressioni valide per la proprietà **RowFilter** , vedere le informazioni di riferimento <xref:System.Data.DataColumn.Expression%2A> per la proprietà <xref:System.Data.DataColumn> della classe. Se si desidera restituire i risultati di una particolare query sui dati, anziché fornire una visualizzazione dinamica di un subset di dati, utilizzare i <xref:System.Data.DataView.Find%2A> metodi o <xref:System.Data.DataView.FindRows%2A> del **DataView** per ottenere prestazioni ottimali anziché impostare **Proprietà RowFilter** . Impostando la proprietà **RowFilter** , viene ricompilato l'indice per i dati, aggiungendo un sovraccarico all'applicazione e diminuendo le prestazioni. È consigliabile usare la proprietà **RowFilter** in un'applicazione con associazione a dati in cui un controllo associato Visualizza i risultati filtrati. I metodi **Find** e **FindRows** sfruttano l'indice corrente senza richiedere la ricompilazione dell'indice. Per ulteriori informazioni sui metodi **Find** e **FindRows** , vedere [ricerca di righe](finding-rows.md). - La proprietà <xref:System.Data.DataView.RowStateFilter%2A> consente di specificare le versioni di riga da visualizzare. Il **DataView** gestisce in modo implicito la versione di riga da esporre a seconda del tipo di **RowState** della riga sottostante. Se, ad esempio, **RowStateFilter** è impostato su **DataViewRowState. Deleted**, il **DataView** espone la versione di riga **originale** di tutte le righe **eliminate** perché non è disponibile una versione di riga **corrente** . È possibile determinare la versione di riga di una riga esposta tramite la proprietà **rowversion** dell'oggetto **DataRowView**. Nella tabella seguente vengono illustrate le opzioni per **DataViewRowState**. |Opzioni di DataViewRowState|Descrizione| |------------------------------|-----------------| |**CurrentRows**|La versione di riga **corrente** di tutte le righe non **modificate**, **aggiunte**e **modificate** . Questa è l'impostazione predefinita.| |**Aggiunto**|Versione di riga **corrente** di tutte le righe **aggiunte** .| |**Eliminato**|Versione di riga **originale** di tutte le righe **eliminate** .| |**ModifiedCurrent**|Versione di riga **corrente** di tutte le righe **modificate** .| |**ModifiedOriginal**|Versione di riga **originale** di tutte le righe **modificate** .| |**None**|Nessuna riga.| |**OriginalRows**|Versione di riga **originale** di tutte le righe non **modificate**, **modificate**ed **eliminate** .| |**Invariato**|Versione di riga **corrente** di tutte le righe non **modificate** .| Per altre informazioni sugli Stati delle righe e sulle versioni delle righe, vedere Stati di riga [e versioni](row-states-and-row-versions.md)di riga. Nell'esempio di codice seguente viene creata una visualizzazione in cui vengono mostrati tutti i prodotti il cui numero di unità disponibili in magazzino è inferiore o uguale al livello di riordinamento. I prodotti vengono ordinati prima in base all'identificatore del fornitore, quindi in base al nome del prodotto. ```vb Dim prodView As DataView = New DataView(prodDS.Tables("Products"), _ "UnitsInStock <= ReorderLevel", _ "SupplierID, ProductName", _ DataViewRowState.CurrentRows) ``` ```csharp DataView prodView = new DataView(prodDS.Tables["Products"], "UnitsInStock <= ReorderLevel", "SupplierID, ProductName", DataViewRowState.CurrentRows); ``` ## <a name="see-also"></a>Vedere anche - <xref:System.Data.DataViewRowState> - <xref:System.Data.DataColumn.Expression%2A?displayProperty=nameWithType> - <xref:System.Data.DataTable> - <xref:System.Data.DataView> - [DataView](dataviews.md) - [Panoramica di ADO.NET](../ado-net-overview.md)
77.716418
865
0.748416
ita_Latn
0.99003
e5ee15e8b60ed55d2b9b5974eb3fd3b995b386fd
15,874
md
Markdown
private/termsOfService.md
dmarkrollins/kwote
c9d7436009de7f3d94ed7868c0a78412c8247b4a
[ "MIT" ]
1
2020-11-14T21:45:23.000Z
2020-11-14T21:45:23.000Z
private/termsOfService.md
dmarkrollins/kwote
c9d7436009de7f3d94ed7868c0a78412c8247b4a
[ "MIT" ]
2
2018-04-29T17:57:36.000Z
2019-02-04T12:20:32.000Z
private/termsOfService.md
dmarkrollins/kwote
c9d7436009de7f3d94ed7868c0a78412c8247b4a
[ "MIT" ]
1
2021-03-01T18:34:20.000Z
2021-03-01T18:34:20.000Z
#### Terms of Service 6th Cents, LLC ("we", "us", "our", "6thcents") present the following terms and conditions, which govern your use of the kwotes.herokuapp.com site (Website), and all content, services and products available at or through the Website, including but not limited to [https://kwotes.herokuapp.com](https://kwotes.herokuapp.com) The Website is offered subject to your acceptance, without modification, of all of the terms and conditions contained within, along with all other operating rules, policies (including, without limitation, 6thcents's Privacy Policy) and procedures that may be published from time to time on this Website by us (collectively, the Agreement). Please read this Agreement carefully before accessing or using the Website. By accessing or using any part of the Website, you agree that you are bound by the terms and conditions of this Agreement. If you do not agree to all the terms and conditions of this Agreement, then you may not access the Website or use any services. If these terms and conditions are considered an offer by 6th Cents, acceptance is expressly limited to these terms. The Website is available only to individuals who are at least 13 years old. If you operate an account, comment on an account, post material to the Website, post links on the Website, or otherwise make (or allow any third party to make) material available by means of the Website (any such material, also known as "Content"), you are entirely responsible for that Content and any harm that may result from it. That is the case regardless of whether the Content in question constitutes text, graphics, an audio file, a video file, or computer software. #### I. Your Account If you create an account on the Website, you are responsible for maintaining the security of your account. You are responsible for all activities that occur under the account and any other actions taken in connection with the account. You must take reasonable steps to guard the security of your account. We will not be liable for any acts or omissions resulting from a breach of security, including any damages of any kind incurred as a result of such acts or omissions. #### II. Account Structure 6th Cents currently has a tiered account structure. Free Accounts can be registered free of charge. Free accounts can access basic site features Payments to 6th Cents, for account services or for any other purpose, are refundable or transferable solely at 6thcents's discretion. By using this Service, you agree to this account structure, and to 6thcents's right to change, modify, or discontinue any type of account or the features available to it at any time. #### III. Privacy Policy Your use of the Website is governed by the Privacy Policy, currently located at [https://www.6thcents.org/legal/privacy](https://www.6thcents.org/legal/privacy). #### IV. Indemnity You agree to indemnify and hold harmless 6th Cents, LLC, its contractors, its licensors, and their respective directors, officers, employees and agents from and against any and all claims and expenses, including attorneys' fees, arising out of your use of the Website, including but not limited to out of your violation of this Agreement. #### V. Termination We may terminate your access to all or any part of the Website at any time, at our sole discretion, if we believe that you have violated this Agreement. You agree that any termination of your access to the Website may involve removing or discarding any content you have provided. We may, at our sole discretion, discontinue providing the Website at any time, with or without notice. If you wish to terminate this Agreement, you may delete your account and cease using the Website. You agree that, upon deletion of your account, we may, but are not required to, remove any content you have provided, at any time past the deletion of your account. Paid accounts that are terminated for violations of this Agreement will only be refunded at our discretion, and only if such termination should come under our established criteria for issuing refunds. All provisions of this Agreement which by their nature should survive termination shall survive termination, including, without limitation, ownership provisions, warranty disclaimers, indemnity and limitations of liability. #### VI. License to Reproduce Content By submitting Content to us for inclusion on the Website, you grant us a world-wide, royalty-free, and non-exclusive license to reproduce, modify, adapt and publish the Content, solely for the purpose of displaying, distributing and promoting the contents of your account, including through downloadable clients and external feeds. If you delete Content, we will use reasonable efforts to remove it from the Website, but you acknowledge that caching or references to the Content may not be made immediately unavailable. #### VII. Account Content You agree to the following provisions for posting Content to the Website: 1. We claim no ownership or control over any Content that you post to the Website. You retain any intellectual property rights to the Content you post, in accordance with applicable law. By posting Content, you represent that you have the rights to reproduce that Content (and the right to allow us to serve such Content) without violation of the rights of any third party. You agree that you will bear any liability resulting from the posting of any Content that you do not have the rights to post. 2. All Content posted to the Website in any way is the responsibility of the owner. Within the confines of international and local law, we will generally not place a restriction on the type or appropriateness of any Content. If Content is deemed illegal by any law having jurisdiction over you, you agree that we may submit any necessary information to the proper authorities. 3. We do not pre-screen Content. However, you acknowledge that we have the right (but not the obligation), in our sole discretion, to remove or refuse to remove any Content from the service. You also agree that we may, without limitation, take any steps necessary to remove Content from the site search engine or member directory, at our sole discretion. 4. If any Content you have submitted is reported to us as violating this Agreement, you agree that we may call upon you to change, modify, or remove that Content, within a reasonable amount of time, as defined by us. If you do not follow this directive, we may terminate your account. #### VIII. Content Posted on Other Websites We have not reviewed, and cannot review, all of the material, including computer software, made available through the websites and webpages to which we, any user, or any provider of Content links, or that link to us. We do not have any control over those websites and webpages, and are not responsible for their contents or their use. By linking to an external website or webpage, we do not represent or imply that we endorse such website or webpage. You are responsible for taking precautions as necessary to protect yourself and your computer systems from viruses, worms, Trojan horses, and other harmful or destructive content. We disclaim any responsibility for any harm resulting from your use of external websites and webpages, whether that link is provided by us or by any provider of Content on the Website. #### IX. No Resale of Services You agree not to reproduce, duplicate, copy, sell, resell, or exploit any portion of the Website, use of the Website, or access to the Website. #### X. Exposure to Content You agree that by using the service, you may be exposed to Content you find offensive or objectionable. If such Content is reported to us, it will be our sole discretion as to what action, if any, should be taken. #### XI. Member Conduct You agree that you will not use the Website to: 1. Upload, post, or otherwise transmit any Content that is harmful, threatening, abusive, hateful, invasive to the privacy and publicity rights of any person, or that violates any applicable local, state, national, or international law, including any regulation having the force of law; 2. Upload, post, or otherwise transmit any Content that is spam, or contains unethical or unwanted commercial content designed to drive traffic to third party sites or boost the search engine rankings of third party sites, or to further unlawful acts (such as phishing) or mislead recipients as to the source of the material (such as spoofing); 3. Maliciously impersonate any real person or entity, including but not limited to a 6thcents staff member or volunteer, or to otherwise misrepresent your affiliation with any person or entity; 4. Upload, post or otherwise transmit any Content that you do not have a right to transmit under any law or under contractual or fiduciary relationships (such as inside information, proprietary and confidential information learned or disclosed as part of employment relationships or under nondisclosure agreements); 5. Upload, post or otherwise transmit any Content that infringes any patent, trademark, trade secret, copyright, or other proprietary rights of any party; 6. Interfere with or disrupt the Website or servers or networks connected to the Website, or disobey any requirements, procedures, policies or regulations of networks connected to the Website; 7. Solicit passwords or personal identifying information for unintended, commercial or unlawful purposes from other users; 8. Provide any material that is illegal under United States law; 9. Upload, post or otherwise transmit any Content that contains viruses, worms, malware, Trojan horses or other harmful or destructive content; 10. Allow usage by others in such a way as to violate this Agreement; 11. Make excessive or otherwise harmful automated use of the Website; 12. Access any other person's account, or exceed the scope of the Website that you have signed up for; for example, accessing and using features you don't have a right to use. #### XII. Copyright Infringement If you believe that material located on the Website violates your copyright, you may notify us in accordance with our Digital Millennium Copyright Act ('DMCA') Policy. We will respond to all such notices as required by law, including by removing the infringing material or disabling access to the infringing material. As set forth by law, we will, in our sole discretion, terminate or deny access to the Website to users of the site who have repeatedly infringed upon the copyrights or intellectual property rights of others. #### XIII. Volunteers We appreciate the service of volunteers in many aspects of Website management, including but not limited to providing technical support, creating web-based content, performing site administration duties, providing expert advice, research, technical writing, reviewing, categorizing, and other duties as necessary. All volunteers are expected to be of legal age, or volunteering with the consent of a legal parent or guardian. By volunteering, you agree that any work created as a result of your volunteer service shall be licensed to 6thcents on a perpetual, irrevocable, and world-wide basis, to the extent permitted by law. You agree that 6thcents may determine the basis upon which your volunteer work shall be licensed to others, including under Open Source licenses that may permit the further alteration or dissemination of your work. If laws prevent such licensing, you agree never to sue 6thcents for the use of said work. By volunteering, you agree that you are providing your work with no expectation of pay or future consideration by 6thcents. You also agree that you have taken reasonable diligence to ensure that the work is correct, accurate, and free of defect. You agree that you will not disclose or share any proprietary or confidential information you are provided with in the course of your volunteer work. No user is required to volunteer for the Website, and users without volunteer status will receive equal care, support, and attention. #### XIV. Changes We reserve the right, at our sole discretion, to modify or replace any part of this Agreement at any time. We will take reasonable steps to notify you of any substantial changes to this Agreement; however, it is your responsibility to check this Agreement periodically for changes. Your continued use of or access to the Website following the posting of any changes to this Agreement constitutes acceptance of those changes. We may also, in the future, offer new services and/or features through the Website (including the release of new tools and resources). Such new features and/or services shall be subject to the terms and conditions of this Agreement. #### XV. Disclaimer of Warranties This Website is provided "as is". 6th Cents, LLC and its suppliers and licensors hereby disclaim all warranties of any kind, express or implied, including, without limitation, the warranties of merchantability, fitness for a particular purpose and non-infringement. Neither 6th Cents, LLC, nor its suppliers and licensors, makes any warranty that the Website will be error free or that access to the Website will be continuous or uninterrupted. You agree that any interruptions to the service will not qualify for reimbursement or compensation. You understand that you download from, or otherwise obtain content or services through, the Website at your own discretion and risk. No advice or information, whether oral or written, obtained by you in any fashion shall create any warranty not expressly stated in this Agreement. #### XVI. Limitation of Liability You expressly understand and agree that in no event will 6th Cents, LLC, or its suppliers or licensors, be liable with respect to any subject matter of this agreement under any contract, negligence, strict liability or other legal or equitable theory for: (i) any special, incidental or consequential damages; (ii) the cost of procurement or substitute products or services; (iii) interruption of use or loss or corruption of data; (iv) any statements or conduct of any third party on the service; or (v) any unauthorized access to or alterations of your Content. We shall have no liability for any failure or delay due to matters beyond our reasonable control. The foregoing shall not apply to the extent prohibited by applicable law. #### XVII. General Information This Agreement constitutes the entire agreement between us and you concerning your use of the Website. This Agreement may only be modified by a written amendment signed by an authorized representative of 6th Cents, LLC, or by the posting of a revised version to this location. Except to the extent that applicable law (if any) provides otherwise, any dispute arising between you and 6th Cents, LLC regarding these Terms of Service and/or your use or access of the Website will be governed by the laws of the state of Maryland and the federal laws of the United States of America, excluding any conflict of law provisions. You agree to submit to the jurisdiction of the state and federal courts located in Baltimore City, Maryland for any disputes arising out of or relating to your use of the Website or your acceptance of this Agreement. If any part of this Agreement is held invalid or unenforceable, that part will be construed to reflect the parties' original intent, and the remaining portions will remain in full force and effect. A waiver by either party of any term or condition of this Agreement or any breach thereof, in any one instance, will not waive such term or condition or any subsequent breach thereof. The section titles in this Agreement are for convenience only and have no legal or contractual effect. #### XVIII. Reporting Violations To report a violation of this Agreement, please contact [mailto:support@6thcents.com](support@6thcents.com)
109.475862
838
0.801058
eng_Latn
0.999921
e5ee201de5f10f34522b00c13c8b462d95b1527b
68
md
Markdown
README.md
dilsoncampelo10/netflix_adaptation
ab53ea3382971a14baa89a6fe3a8e2b693578111
[ "MIT" ]
null
null
null
README.md
dilsoncampelo10/netflix_adaptation
ab53ea3382971a14baa89a6fe3a8e2b693578111
[ "MIT" ]
null
null
null
README.md
dilsoncampelo10/netflix_adaptation
ab53ea3382971a14baa89a6fe3a8e2b693578111
[ "MIT" ]
null
null
null
# netflix_adaptation Replicando netflix com html, css e javascript
22.666667
46
0.823529
por_Latn
0.485848
e5ee7ffa69960ef868554abb8442fd07b0093db4
1,588
md
Markdown
README.md
rodneylab/sveltekit-nextgen-background
d53aa05c9b552496c3a227c0c6a5828ca04648c4
[ "BSD-3-Clause" ]
null
null
null
README.md
rodneylab/sveltekit-nextgen-background
d53aa05c9b552496c3a227c0c6a5828ca04648c4
[ "BSD-3-Clause" ]
null
null
null
README.md
rodneylab/sveltekit-nextgen-background
d53aa05c9b552496c3a227c0c6a5828ca04648c4
[ "BSD-3-Clause" ]
null
null
null
<img src="./images/rodneylab-github-sveltekit-nextgen-background.png" alt="Rodney Lab sveltekit-nextgen-background Github banner"> <p align="center"> <a aria-label="Open Rodney Lab site" href="https://rodneylab.com" rel="nofollow noopener noreferrer"> <img alt="Rodney Lab logo" src="https://rodneylab.com/assets/icon.png" width="60" /> </a> </p> <h1 align="center"> SvelteKit NextGen Background Image </h1> [![Netlify Status](https://api.netlify.com/api/v1/badges/a0dd75d1-108f-4852-9bef-3456b5476243/deploy-status)](https://app.netlify.com/sites/eloquent-beaver-f13d7d/deploys) # sveltekit-nextgen-background [![Open in Visual Studio Code](https://open.vscode.dev/badges/open-in-vscode.svg)](https://open.vscode.dev/rodneylab/sveltekit-nextgen-background) SvelteKit demo code for adding a NextGen background image to a site page with a JPEG or PNG fallback for older browsers. See <a href="https://rodneylab.com/sveltekit-next-gen-background-image/">video explaining how add a WebP background image in SvelteKit</a>. Drop any questions you have into a comment on that page. ## Building and previewing the site If you're seeing this, you've probably already done this step. Congrats! ```bash git clone https://github.com/rodneylab/sveltekit-nextgen-background.git my-new-mdsvex-blog cd sveltekit-nextgen-background pnpm install # or npm install pnpm run dev ``` ## Building ```bash pnpm run build ``` > You can preview the built app with `pnpm run preview`, regardless of whether you installed an adapter. This should _not_ be used to serve your app in production.
39.7
196
0.760705
eng_Latn
0.557989
e5eeca32cea61423bc43ced02f91a8a32759e7d9
11,304
md
Markdown
writeup_template.md
s-rezayi/traffic_sign_classifier
92fa622a606a35bf417374ed103f8e5983b906f4
[ "MIT" ]
null
null
null
writeup_template.md
s-rezayi/traffic_sign_classifier
92fa622a606a35bf417374ed103f8e5983b906f4
[ "MIT" ]
null
null
null
writeup_template.md
s-rezayi/traffic_sign_classifier
92fa622a606a35bf417374ed103f8e5983b906f4
[ "MIT" ]
null
null
null
# **Traffic Sign Recognition** ## Writeup ### You can use this file as a template for your writeup if you want to submit it as a markdown file, but feel free to use some other method and submit a pdf if you prefer. --- **Build a Traffic Sign Recognition Project** The goals / steps of this project are the following: * Load the data set (see below for links to the project data set) * Explore, summarize and visualize the data set * Design, train and test a model architecture * Use the model to make predictions on new images * Analyze the softmax probabilities of the new images * Summarize the results with a written report [//]: # (Image References) [image1]: ./sign.png "Visualization" [image2]: ./training_data.jpg "Training Data Distribution" [image3]: ./validation_data.jpg "Validation Data Distribution" [image4]: ./testing_data.jpg "Test Data Distribution" [image5]: ./test_new_images/original/bumpy.jpg "Traffic Sign 1" [image6]: ./test_new_images/original/general_caution.jpg "Traffic Sign 2" [image7]: ./test_new_images/original/slippery.jpg "Traffic Sign 3" [image8]: ./test_new_images/original/wild_animal.jpg "Traffic Sign 4" [image9]: ./test_new_images/original/work.jpg "Traffic Sign 5" ## Rubric Points ### Here I will consider the [rubric points](https://review.udacity.com/#!/rubrics/481/view) individually and describe how I addressed each point in my implementation. --- ### Writeup / README #### 1. Provide a Writeup / README that includes all the rubric points and how you addressed each one. You can submit your writeup as markdown or pdf. You can use this template as a guide for writing the report. The submission includes the project code. You're reading it! and here is a link to my [project code](https://github.com/udacity/CarND-Traffic-Sign-Classifier-Project/blob/master/Traffic_Sign_Classifier.ipynb) ### Data Set Summary & Exploration #### 1. Provide a basic summary of the data set. In the code, the analysis should be done using python, numpy and/or pandas methods rather than hardcoding results manually. I used the pandas and numpy libraries to calculate summary statistics of the traffic signs data set: * The size of training set is 34799. * The size of the validation set is 4410. * The size of test set is 12630. * The shape of a traffic sign image is (32, 32, 3). * The number of unique classes/labels in the data set is 43. #### 2. Include an exploratory visualization of the dataset. Here is an exploratory visualization of the data set. It is a bar chart showing how the data is distributed in different classes. ![alt text][image2] ![alt text][image3] ![alt text][image4] As it is shown in the images, the data is not evenly distributed between all the classes. ### Design and Test a Model Architecture #### 1. Describe how you preprocessed the image data. What techniques were chosen and why did you choose these techniques? Consider including images showing the output of each preprocessing technique. Pre-processing refers to techniques such as converting to grayscale, normalization, etc. (OPTIONAL: As described in the "Stand Out Suggestions" part of the rubric, if you generated additional data for training, describe why you decided to generate additional data, how you generated the data, and provide example images of the additional data. Then describe the characteristics of the augmented training set like number of images in the set, number of images for each class, etc.) I decided to normalized the image data and bring all the variables to the same range. This will reduce the dependency on on the scale of the parameters. ![alt text][image1] Generating additional data with ImageDataGenerator method from preprocessing.image module of keras would be beneficial to avoid overfitting. #### 2. Describe what your final model architecture looks like including model type, layers, layer sizes, connectivity, etc.) Consider including a diagram and/or table describing the final model. My final model consisted of the following layers with total of 64,811 parameters to train: Model: "sequential" _________________________________________________________________ Layer (type) | Output Shape | Param # ================================================================= Input | (None, 32, 32, 3) | 0 _________________________________________________________________ conv2d (Conv2D) | (None, 28, 28, 6) | 456 _________________________________________________________________ max_pooling2d (MaxPooling2D) | (None, 14, 14, 6) | 0 _________________________________________________________________ activation (Activation) | (None, 14, 14, 6) | 0 _________________________________________________________________ dropout (Dropout) | (None, 14, 14, 6) | 0 _________________________________________________________________ conv2d_1 (Conv2D) | (None, 10, 10, 16) | 2416 _________________________________________________________________ max_pooling2d_1 (MaxPooling2 | (None, 5, 5, 16) | 0 _________________________________________________________________ activation_1 (Activation) | (None, 5, 5, 16) | 0 _________________________________________________________________ dropout_1 (Dropout) | (None, 5, 5, 16) | 0 _________________________________________________________________ flatten (Flatten) | (None, 400) | 0 _________________________________________________________________ dense (Dense) | (None, 120) | 48120 _________________________________________________________________ dense_1 (Dense) | (None, 84) | 10164 _________________________________________________________________ dense_2 (Dense) | (None, 43) | 3655 _________________________________________________________________ Total params: 64,811 Trainable params: 64,811 Non-trainable params: 0 #### 3. Describe how you trained your model. The discussion can include the type of optimizer, the batch size, number of epochs and any hyperparameters such as learning rate. To train the model, using Lenet arcitecture with adding two dropout layers after each convolutions to prevent over fitting. Padding is set to valid for both convolutional layers, and activation functions for all layers except the last one are set to relu. The last layer activation function is softmax. I, also used Adam optimizer and sparse categorical crossentropy loss operation. The hyper parameters are choosed as follow: EPOCHS = 15 BATCH_SIZE = 128 learning_rate = 0.001 dropout rate = 0.3 #### 4. Describe the approach taken for finding a solution and getting the validation set accuracy to be at least 0.93. Include in the discussion the results on the training, validation and test sets and where in the code these were calculated. Your approach may have been an iterative process, in which case, outline the steps you took to get to the final solution and why you chose those steps. Perhaps your solution involved an already well known implementation or architecture. In this case, discuss why you think the architecture is suitable for the current problem. My final model results were: * training set accuracy of 0.9543 * validation set accuracy of 0.9336 * test set accuracy of 0.9030 I started working with Tensorflow 1.0, but as it is outdated and the Tensorflow 2.0 is much more convenient to work with, I developed a model using Keras based on Lenet arcitecture. In first few attempts with learning rate of 0.01 and 10 epochs, the model did not satisfy the required 0.93 accuracy on validation set. By settig learning rate to 0.001, and incresing the number of epochs, the model showed the characteristics of being overfitted since the training dataset accuracy was much higher than the validation dataset. Therefore, to solve the overfitting problem two dropout layers with rate of 0.3 was added after each convolutional layers. More then 90% accuracy on evaluating test dataset along with the high training and validation accuracy shows that the model is suitable classifier for German traffic signs. ### Test a Model on New Images #### 1. Choose five German traffic signs found on the web and provide them in the report. For each image, discuss what quality or qualities might be difficult to classify. Here are five German traffic signs that I found on the web: ![alt text][image5] ![alt text][image6] ![alt text][image7] ![alt text][image8] ![alt text][image9] The images of bumpy and sippery road signs are difficult to predict because of the lack of data. Also, the backgrounds of the images make things worse as the images in provided training dataset are mostly without backgrounds. #### 2. Discuss the model's predictions on these new traffic signs and compare the results to predicting on the test set. At a minimum, discuss what the predictions were, the accuracy on these new predictions, and compare the accuracy to the accuracy on the test set (OPTIONAL: Discuss the results in more detail as described in the "Stand Out Suggestions" part of the rubric). Here are the results of the prediction: | Image | Prediction(original) Prediction(cropped) | |:---------------------:|:---------------------------------------------:| | Bumpy Road | Right-of-way | Bumpy Road | | General Caution | Pedestrians | General Caution | | Slippery Road | Bicycles Crossing | Slippery Road | | Wild Animals Crossing | Bicycles Crossing | Wild Animals Crossing | | Road Work | Road Work | Road Work | The model was able to correctly guess 1 of the 5 traffic signs, which gives an accuracy of 20% on original images. By cropping the images(removing the backgrounds) the accuracy went up to 100%. This compares favorably to the accuracy on the test set of more than 90%. #### 3. Describe how certain the model is when predicting on each of the five new images by looking at the softmax probabilities for each prediction. Provide the top 5 softmax probabilities for each image along with the sign type of each probability. (OPTIONAL: as described in the "Stand Out Suggestions" part of the rubric, visualizations can also be provided such as bar charts) The code for making predictions on my final model is located in the second to last part of the Ipython notebook. For the second image, the model is relatively sure that this is a Pedestrians sign (probability of .85), and the image does contain a Bumpy Road sign. The top five soft max probabilities were: | Probability | Prediction | |:---------------------:|:---------------------------------------------:| | .85 | Pedestrians | | .14 | Right-of-wa | | .01 | Children crossing | | -- | -- | | -- | -- | ### (Optional) Visualizing the Neural Network (See Step 4 of the Ipython notebook for more details) #### 1. Discuss the visual output of your trained network's feature maps. What characteristics did the neural network use to make classifications?
62.10989
681
0.732219
eng_Latn
0.990587
e5efca94b6fe21509bd280e4b628821cbd98b64f
872
md
Markdown
accessibility/css.md
elisoncrum/design.chicago.gov
5b3da42cb61dc68959a6d8dc3bb5f9f9e07d5229
[ "MIT" ]
10
2019-11-18T13:34:22.000Z
2021-09-15T21:20:53.000Z
accessibility/css.md
elisoncrum/design.chicago.gov
5b3da42cb61dc68959a6d8dc3bb5f9f9e07d5229
[ "MIT" ]
41
2018-03-06T19:18:40.000Z
2018-07-31T16:01:52.000Z
accessibility/css.md
elisoncrum/design.chicago.gov
5b3da42cb61dc68959a6d8dc3bb5f9f9e07d5229
[ "MIT" ]
2
2019-07-22T16:29:07.000Z
2022-01-20T23:02:41.000Z
--- title: CSS Dependence layout: post description: 'How we deal with CSS' permalink: /accessibility/css/ page_title: CSS dependence sidenav: accessibility --- CSS dependence just means site shouldn't rely on CSS to be functional or understandable. Often sites will use CSS to load important images for example. This is bad for several reasons. Background images can't be tagged for accessiblity and with CSS turned off they aren't shown. The other issue that pops up with CSS dependence is content order. Sometimes, content will be arranged on screen with CSS instead of the natural code flow. ### Testing 1. Disable CSS. 2. Check for missing information (images, text, etc). 3. Check for code or other items the developer doesn't want you to see. * Confusing elements shouldn't be present such as CSS, JavaScript, or other code, etc. 4. Check for overlapping text.
43.6
278
0.77867
eng_Latn
0.997337
e5effc8b8352db71bb3c28265d65c59797c4a0ab
7,300
md
Markdown
README.md
TheBoringDude/fwitter
8e618cc19687a203b98746782879e1ba4c22bb47
[ "MIT-0" ]
null
null
null
README.md
TheBoringDude/fwitter
8e618cc19687a203b98746782879e1ba4c22bb47
[ "MIT-0" ]
null
null
null
README.md
TheBoringDude/fwitter
8e618cc19687a203b98746782879e1ba4c22bb47
[ "MIT-0" ]
null
null
null
A full introduction to this project can be found in the [docs](https://docs.fauna.com/fauna/current/start/apps/fwitter.html). This project is an example of how to a 'real-world' app with highly dynamic data in a serverless fashion using React hooks, FaunaDB, and Cloudinary. Since FaunaDB was developed by ex-Twitter engineers, a Twitter-like application felt like an appropriately sentimental choices so we call this serverless baby ‘Fwitter’. <img src="https://github.com/fauna-brecht/fwitter/blob/main/readme/fwitter.png?raw=true" width="600"> There is a first [CSS-tricks article](https://css-tricks.com/rethinking-twitter-as-a-serverless-app/) that describes the application in general, explains auth, data modeling and simple queries and brushes over the other features. More articles are coming on the [Fauna blog](https://fauna.com/blog) and/or CSS Tricks It uses the Fauna Query Language (FQL) and starts with a frontend-only approach that directly accesses the serverless database FaunaDB for data storage, authentication, and authorization. <img src="https://github.com/fauna-brecht/fwitter/blob/main/readme/stack1.png?raw=true" width="400"> A few features are still missing and will be covered in future articles, including streaming, pagination, benchmarks, and a more advanced security model with short-lived tokens, JWT tokens, single sign-on (possibly using a service like Auth0), IP-based rate limiting (with Cloudflare workers), e-mail verification (with a service like SendGrid), and HttpOnly cookies. <img src="https://github.com/fauna-brecht/fwitter/blob/main/readme/stack2.png?raw=true" width="400"> ## Pre-requisites This app requires Node.js version 14 (LTS) or 15. It relies on [node-sass](https://github.com/sass/node-sass), which currently [does not support Node.js version 16](https://github.com/sass/node-sass/issues/3077). ## Setup the project This app was created with Create React App, to start using it we need to: ### Install npm packages `npm install` ### Setup the database To set up the project, go to the [FaunaDB Dashboard](https://dashboard.fauna.com/) and sign up. <img src="https://github.com/fauna-brecht/fwitter/blob/main/readme/sign_up.png?raw=true" width="600"> Once you are in the dashboard, click on New Database, fill in a name, and click Save. <img src="https://github.com/fauna-brecht/fwitter/blob/main/readme/new_database.png?raw=true" width="600"> <img src="https://github.com/fauna-brecht/fwitter/blob/main/readme/new_database2.png?raw=true" width="600"> You should now be on the "Overview" page of your new database. Next, to manipulate the database from within our setup scripts, we need a key. Click on the Security tab in the left sidebar, then click the New key button. <img src="https://github.com/fauna-brecht/fwitter/blob/main/readme/admin_key1.png?raw=true" width="600"> In the "New key" form, the current database should already be selected. For "Role", leave it as "Admin" and give it a name. <img src="https://github.com/fauna-brecht/fwitter/blob/main/readme/admin_key2.png?raw=true" width="600"> Next, click Save and copy the key secret displayed on the next page. It will not be displayed again. <img src="https://github.com/fauna-brecht/fwitter/blob/main/readme/admin_key3.png?raw=true" width="600"> You now have the option to place it in your environment variables (REACT_APP_LOCAL___ADMIN) via .env.local, we have provided an example file .env.local.example that you can rename. Although the .env.local file is gitignored, make sure not to push your admin key, this key is powerful and meant to stay private. The setup scripts will therefore also ask you the key if you did not place it in your environment vars so you could opt to paste them in then instead. ``` REACT_APP_LOCAL___ADMIN=<insert your admin key> ``` We have prepared a few scripts so that you only have to run the following commands to initialize your app, create all collections, and populate your database. The scripts will ask for the admin token that you have created and will give you further instructions. ``` // run setup, this will create all the resources in your database // provide the admin key when the script asks for it. npm run setup ``` When this script has finished setting up everything you will receive a new key which will automatically be written in your .env.local file (or create this file if it doesn't exist yet from the example file). This key is the bootstrap key that has very tight permissions (it can only register and login) and will be used to bootstrap our application. ``` REACT_APP_LOCAL___BOOTSTRAP_FAUNADB_KEY=<insert faunadb bootstrap key> ``` ### Populate the database (optional) We also provided a script that adds some data to the database (accounts, users, fweets, comments, likes, etc..) for you to play around with, it will use or ask the same admin key. ``` npm run populate ``` Once you do, you will get 4 users to login with: - user1@test.com - user2@test.com - user3@test.com - user4@test.com all with password: 'testtest' If you do not see a lot on the feed yet of the user you logged in with, search for another user (type in a letter such as 'b' or 'a') and click the + sign to follow him/her. ### Setup cloudinary. We use [Cloudinary](https://cloudinary.com/) to allow users to upload media, automatically optimise and serve this media which will be linked to the data of our application such as video and images. It's truly quite amazing what Cloudinary does behind the scenes. To see this feature in action, create an account with Cloudinary and add your cloudname and a public template (there is a default template called ‘ml_default’ which you can make public) to the environment. ``` REACT_APP_LOCAL___CLOUDINARY_CLOUDNAME=<cloudinary cloudname> REACT_APP_LOCAL___CLOUDINARY_TEMPLATE=<cloudinary template> ``` ## Run the project This project has been created with [Create React App](https://reactjs.org/docs/create-a-new-react-app.html#create-react-app)and therefore has the same familiar commands such as `npm start` to start your application. ### Update something in the setup What if I am experimenting and want to update something? To update User Defined Functions or Roles you can just alter the definition and run `npm run setup` again, it will verify whether the role/function exists and override it. One thing that can't be altered just like that are indexes (makes sense of course, they could contain quite some data). In order to just setup from scratch again you can run `npm run destroy` followed by `npm run setup`. Note, that since names such as collections and indexes are cached, you will have to wait +-60 secs but we can easily get around that by just removing and adding the complete database. In that case, we would remove our ADMIN key as well which would mean that we have to generate a new one each time. However, if we just create an admin key and use that to add (on setup) and remove (on destroy) a child database, than we can get around that inconvenience. We have provided you with that option. When you add the environment variable 'REACT_APP_LOCAL___CHILD_DB_NAME', the script will create a child database on `npm run setup` and destroy it on `npm run destroy` instead of removing all collections/indices/functions.
67.592593
818
0.774247
eng_Latn
0.994818
e5f136fc837e37fc30003d9cdf0da21506bcc532
3,320
md
Markdown
vendor/adldap2/adldap2/readme.md
bgarner/ensphereportal
27741b90defd862cd378571c891da982cc4dba79
[ "MIT" ]
1
2019-09-10T16:57:04.000Z
2019-09-10T16:57:04.000Z
vendor/adldap2/adldap2/readme.md
bgarner/ensphereportal
27741b90defd862cd378571c891da982cc4dba79
[ "MIT" ]
7
2019-07-26T12:40:21.000Z
2022-02-18T02:56:34.000Z
vendor/adldap2/adldap2/readme.md
bgarner/ensphereportal
27741b90defd862cd378571c891da982cc4dba79
[ "MIT" ]
null
null
null
# Adldap2 [![Build Status](https://img.shields.io/travis/Adldap2/Adldap2.svg?style=flat-square)](https://travis-ci.org/Adldap2/Adldap2) [![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/adLDAP2/adLDAP2/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/adLDAP2/adLDAP2/?branch=master) [![Total Downloads](https://img.shields.io/packagist/dt/adldap2/adldap2.svg?style=flat-square)](https://packagist.org/packages/adldap2/adldap2) [![Latest Stable Version](https://img.shields.io/packagist/v/adldap2/adldap2.svg?style=flat-square)](https://packagist.org/packages/adldap2/adldap2) [![License](https://img.shields.io/packagist/l/adldap2/adldap2.svg?style=flat-square)](https://packagist.org/packages/adldap2/adldap2) Working with LDAP doesn't need to be hard. Adldap2 is a tested PHP package that provides LDAP authentication and directory management tools using the Active Record pattern. ## Index - [Quick Start](docs/quick-start.md) - [Configuration](docs/configuration.md) - [Connecting](docs/connecting.md) - [Authenticating](docs/authenticating.md) - [Query Builder (Searching)](docs/query-builder.md) - [Models](docs/models/model.md) - [Computer](docs/models/computer.md) - [Contact](docs/models/contact.md) - [Container](docs/models/container.md) - [Entry](docs/models/entry.md) - [Group](docs/models/group.md) - [Organizational Unit](docs/models/ou.md) - [Printer](docs/models/printer.md) - [RootDse](docs/models/root-dse.md) - [User](docs/models/user.md) - [Working with Distinguished Names](docs/distinguished-names.md) - [Schema](docs/schema.md) - [Troubleshooting](docs/troubleshooting.md) ## Installation ### Requirements To use Adldap2, your server must support: - PHP 5.5.9 or greater - PHP LDAP Extension - An LDAP Server > **Note**: OpenLDAP support is experimental, success may vary. ### Optional Requirements > **Note: Adldap makes use of `ldap_modify_batch()` for executing modifications to LDAP records**. Your server must be on **PHP >= 5.5.10 || >= 5.6.0** to make modifications. If your AD server requires SSL, your server must support the following libraries: - PHP SSL Libraries (http://php.net/openssl) ### Installing Adldap2 utilizes composer for installation. Run the following command in the root directory of your project: ``` composer require adldap2/adldap2 ``` > **Note**: If you're upgrading from an earlier release, please take a look > at the [release notes](https://github.com/Adldap2/Adldap2/releases). ## Implementations - [Laravel](https://github.com/Adldap2/Adldap2-Laravel) - [Kohana](https://github.com/Adldap2/Adldap2-Kohana) ## Versioning Adldap2 is versioned under the [Semantic Versioning](http://semver.org/) guidelines as much as possible. Releases will be numbered with the following format: `<major>.<minor>.<patch>` And constructed with the following guidelines: * Breaking backward compatibility bumps the major and resets the minor and patch. * New additions without breaking backward compatibility bumps the minor and resets the patch. * Bug fixes and misc changes bumps the patch. Minor versions are not maintained individually, and you're encouraged to upgrade through to the next minor version. Major versions are maintained individually through separate branches.
36.888889
173
0.751205
eng_Latn
0.729591
e5f4261d8b9fc462c12a653c4b16690fb9ea56b3
3,008
md
Markdown
docs/extensibility/debugger/reference/idebugengineprogram2.md
MicrosoftDocs/visualstudio-docs.es-es
9d654c35ecad85edadd91aefb49b7bd0ebd2eee2
[ "CC-BY-4.0", "MIT" ]
6
2020-05-20T07:48:51.000Z
2022-03-09T07:27:32.000Z
docs/extensibility/debugger/reference/idebugengineprogram2.md
MicrosoftDocs/visualstudio-docs.es-es
9d654c35ecad85edadd91aefb49b7bd0ebd2eee2
[ "CC-BY-4.0", "MIT" ]
30
2018-10-02T15:11:15.000Z
2021-12-17T11:02:02.000Z
docs/extensibility/debugger/reference/idebugengineprogram2.md
MicrosoftDocs/visualstudio-docs.es-es
9d654c35ecad85edadd91aefb49b7bd0ebd2eee2
[ "CC-BY-4.0", "MIT" ]
25
2018-01-24T17:02:46.000Z
2022-03-04T14:06:19.000Z
--- description: Esta interfaz proporciona compatibilidad con la depuración multiproceso. title: IDebugEngineProgram2 | Microsoft Docs ms.date: 11/04/2016 ms.topic: reference f1_keywords: - IDebugEngineProgram2 helpviewer_keywords: - IDebugEngineProgram2 interface ms.assetid: 151003a9-2e4d-4acf-9f4d-365dfa6b9596 author: leslierichardson95 ms.author: lerich manager: jmartens ms.technology: vs-ide-debug ms.workload: - vssdk ms.openlocfilehash: 8c2660c430ac18f337c61275297eb385216904cf ms.sourcegitcommit: 68897da7d74c31ae1ebf5d47c7b5ddc9b108265b ms.translationtype: MT ms.contentlocale: es-ES ms.lasthandoff: 08/13/2021 ms.locfileid: "122035155" --- # <a name="idebugengineprogram2"></a>IDebugEngineProgram2 Esta interfaz proporciona compatibilidad con la depuración multiproceso. ## <a name="syntax"></a>Syntax ``` IDebugEngineProgram2 : IUnknown ``` ## <a name="notes-for-implementers"></a>Notas de los implementadores Un motor de depuración implementa esta interfaz para admitir la depuración simultánea de varios subprocesos. Esta interfaz se implementa en el mismo objeto que implementa la [interfaz IDebugProgram2.](../../../extensibility/debugger/reference/idebugprogram2.md) ## <a name="notes-for-callers"></a>Notas de los autores de llamadas Use [QueryInterface](/cpp/atl/queryinterface) para obtener esta interfaz de una `IDebugProgram2` interfaz. ## <a name="methods-in-vtable-order"></a>Métodos en orden de Vtable En la tabla siguiente se muestran los métodos de `IDebugEngineProgram2` . |Método|Descripción| |------------|-----------------| |[Detención](../../../extensibility/debugger/reference/idebugengineprogram2-stop.md)|Detiene todos los subprocesos que se ejecutan en este programa.| |[WatchForThreadStep](../../../extensibility/debugger/reference/idebugengineprogram2-watchforthreadstep.md)|Busca la ejecución (o detiene la observación de la ejecución) en el subproceso determinado.| |[WatchForExpressionEvaluationOnThread](../../../extensibility/debugger/reference/idebugengineprogram2-watchforexpressionevaluationonthread.md)|Permite (o no permite) la evaluación de expresiones en el subproceso determinado, incluso si se detiene el programa.| ## <a name="remarks"></a>Comentarios Visual Studio llama a esta interfaz en respuesta a un evento [IDebugProgramCreateEvent2](../../../extensibility/debugger/reference/idebugprogramcreateevent2.md) y para establecer los estados "Watch for Thread Step" y "Watch for Expression Evaluation on Thread" del programa. [Se](../../../extensibility/debugger/reference/idebugengineprogram2-stop.md) llama a Stop cada vez que se va a detener el programa; este método ofrece al programa la oportunidad de finalizar todos los subprocesos. ## <a name="requirements"></a>Requisitos Encabezado: msdbg.h Espacio de nombres: Microsoft.VisualStudio.Debugger.Interop Ensamblado: Microsoft.VisualStudio.Debugger.Interop.dll ## <a name="see-also"></a>Vea también - [IDebugProgram2](../../../extensibility/debugger/reference/idebugprogram2.md)
50.133333
489
0.788564
spa_Latn
0.783129
e5f457ce4de7a715cc86600ee63ae6bd3d6a44cc
126
md
Markdown
README.md
JochenSchwander/TSW-Scripts
8a248518e2dcff67e0285b86c4cf2ac133162c4b
[ "MIT" ]
null
null
null
README.md
JochenSchwander/TSW-Scripts
8a248518e2dcff67e0285b86c4cf2ac133162c4b
[ "MIT" ]
null
null
null
README.md
JochenSchwander/TSW-Scripts
8a248518e2dcff67e0285b86c4cf2ac133162c4b
[ "MIT" ]
null
null
null
# TSW-Scripts Some PowerShell 4.0 scripts for [The Secret World](http://www.thesecretworld.com/ "The Secret World | Funcom").
42
111
0.746032
kor_Hang
0.566714
e5f4a52d1a897dfe1fb4952ec2907ac467780203
6,024
md
Markdown
source/_posts/grieving_radio_host_fifi_box_spends_time_with_her_daughter_daisy_belle.md
soumyadipdas37/finescoop.github.io
0346d6175a2c36d4054083c144b7f8364db73f2f
[ "MIT" ]
null
null
null
source/_posts/grieving_radio_host_fifi_box_spends_time_with_her_daughter_daisy_belle.md
soumyadipdas37/finescoop.github.io
0346d6175a2c36d4054083c144b7f8364db73f2f
[ "MIT" ]
null
null
null
source/_posts/grieving_radio_host_fifi_box_spends_time_with_her_daughter_daisy_belle.md
soumyadipdas37/finescoop.github.io
0346d6175a2c36d4054083c144b7f8364db73f2f
[ "MIT" ]
2
2021-09-18T12:06:26.000Z
2021-11-14T15:17:34.000Z
--- extends: _layouts.post section: content image: https://i.dailymail.co.uk/1s/2020/09/17/10/33295218-0-image-a-113_1600336659746.jpg title: Grieving radio host Fifi Box spends time with her daughter Daisy Belle description: Fifi Box appeared downcast as she visited the shops with her daughter Daisy Belle on Thursday, following the death of her oldest child Trixies half-sister Jaimi Kenny. date: 2020-09-17-11-20-45 categories: [latest, tv] featured: true --- Fifi Box appeared downcast as she visited the shops with her daughter Daisy Belle on Thursday, following the death of her oldest child Trixie's half-sister Jaimi Kenny. The radio host,43, wore a black mask as she carried her one-year-old daughter in her arms and entered the shopping complex. The mother-of-two was dressed in loose black trousers, a navy blue shirt and a warm pink jacket for the outing. Grieving: Radio host Fifi Box spent time with her baby girl Daisy Belle as she mourned the death of her daughter Trixie's older half-sister Jaimi Kenny on Thursday She completed her outfit with a pair of multi-print flats and appeared to be makeup-free. Fifi appeared in low spirits as she held a shopping bag in one hand and her daughter with the other. On Wednesday, Fifi shared a heartbreaking tribute to Jaimi, the eldest daughter of ex-partner Grant Kenny, who died on Monday at the age of 33 after secretly battling an eating disorder. Outing: The radio host wore a black mask as she carried her one-year-old daughter in her arms and entered the shopping complex Outfit: The mother-of-two was dressed in loose black trousers, a navy blue shirt and a warm pink jacket for the outing The radio host, who shared a close bond with Jaimi despite splitting from Grant eight years ago, posted a series of photos of her daughter Trixie with her older half-sister to Instagram. 'The loss of such a beautiful loving sister and friend is suffocating. We laughed, we cried, we shared so many wonderful memories that I will keep alive for Trixie who loved her big sister so much, her little heart is broken,' she wrote. 'You loved Trixie with all your heart and she felt every inch of your love. With every tight squeezy cuddle your love poured into her,' she added.  Makeup-free: She completed her outfit with a pair of multi-print flats and appeared to be makeup-free Low spirits: Fifi appeared in low spirits as she held a shopping bag in one hand and her daughter with the other The 43-year-old media personality continued: 'We were so blessed to have you in our lives. You were such a true and loyal friend, we love you so much and can't bear the pain of you not being here.'  Jaimi was the older half-sister of Fifi's daughter Trixie, who she welcomed in 2013 after a brief relationship with Grant. Despite splitting with Grant months before giving birth, Fifi remained close to his children Jaimi, Morgan and Jett from his first marriage to Australian swimming legend Lisa Curry.  Devastating: On Wednesday, Fifi shared a heartbreaking tribute to Jaimi Kenny, the eldest daughter of ex-partner Grant Kenny, who died on Monday at the age of 33 after secretly battling an eating disorder Break: Fifi had also been absent from Fox FM's Fifi, Fev and Byron radio show on Tuesday and Wednesday morning Jaimi would even babysit Trixie on occasion while single mum Fifi was at work.  Jaimi's mother, three-time Olympian Lisa Curry, separated from Grant in 2009 after 23 years of marriage, before finalising their divorce in 2017.  Fifi and Grant dated for several months in 2012, but had broken up by the time she welcomed daughter Beatrix 'Trixie' Belle via IVF the following year. She did not acknowledge Grant was Trixie's father until 2016, when she shared a photo to Instagram of the retired athlete attending their child's third birthday party. In June 2019, Fifi welcomed another daughter, Daisy Belle, via IVF and an anonymous donor. The identity of Daisy's father is not public knowledge. Family: Jaimi was the older half-sister of Fifi's daughter Trixie, who she welcomed in 2013 after a brief relationship with Grant The Kenny-Curry family confirmed Jaimi's death in a statement on Monday afternoon. 'It is with a very heavy heart that Lisa and I confirm our beautiful daughter Jaimi has lost her battle with a long-term illness and passed away peacefully in hospital this morning in the company of loving family,' read the statement by Jaimi's father, Grant. 'Jaimi will forever be remembered as a caring, bright and loving soul who always put others before herself,' it continued. History: Fifi and Grant dated for several months in 2012, but had broken up by the time she welcomed daughter Beatrix 'Trixie' Belle via IVF the following year  'Our hearts are broken and the pain is immense but we must move forward cherishing every wonderful moment we got to share with our treasured first child. 'We thank the incredible team at the Sunshine Coast University Hospital for their tireless commitment to making her better and giving us the extra time we were able to spend with her. 'It goes without saying that this is a very difficult time for family and friends and we trust we will all be allowed to grieve in privacy.' New addition: In June 2019, Fifi welcomed another daughter, Daisy Belle, via IVF and an anonymous donor. The identity of Daisy's father is not public knowledge While the family's statement did not specify the exact nature of Jaimi's illness, it's understood she had long battled an eating disorder. Her family had supported her through years of treatment at the End ED private clinic on the Sunshine Coast. Jaimi is survived her her sister Morgan, brother Jett, mother Lisa, father Grant and half-sister Trixie. For free and confidential support, contact Lifeline on 13 11 14 or the Butterfly Foundation for eating disorder concerns on 1800 ED HOPE Heartbreaking: The Kenny-Curry family confirmed Jaimi's death in a statement on Monday afternoon. Pictured: Fifi, Jaimi and Trixie
67.685393
259
0.794157
eng_Latn
0.999773
e5f4b744c17bed6922bd33448bfa9cf8316129a6
748
md
Markdown
README.md
metaraine/reduce-arguments
289b458fe48265d672aea35b34cd821544872895
[ "ISC" ]
null
null
null
README.md
metaraine/reduce-arguments
289b458fe48265d672aea35b34cd821544872895
[ "ISC" ]
null
null
null
README.md
metaraine/reduce-arguments
289b458fe48265d672aea35b34cd821544872895
[ "ISC" ]
null
null
null
# reduce-arguments [![npm version](https://img.shields.io/npm/v/reduce-arguments.svg)](https://npmjs.org/package/reduce-arguments) [![Build Status](https://travis-ci.org/metaraine/reduce-arguments.svg?branch=master)](https://travis-ci.org/metaraine/reduce-arguments) > Convert a function that takes two arguments into one that reduces all of its arguments. ## Install ```sh $ npm install --save reduce-arguments ``` ## Usage ```js var reduceArguments = require('reduce-arguments') var addTwo = (x,y) -> x+y var add = reduceArguments(addTwo) assert.equal(add(1,2,3,4,5), 15) ``` ## Complete source code ```coffee module.exports = (f)-> (args...)-> args.reduce f ``` ## License ISC © [Raine Lourie](https://github.com/metaraine)
19.684211
135
0.695187
kor_Hang
0.2339
e5f59abb676ab1eb5dbc61b58b8ae8eff4638a07
891
md
Markdown
_posts/other/2020-09-23-面试试题.md
Conerlius/conerlius.github.io
6422eea89c53675acb7d33f2470212bbf0c1a391
[ "MIT" ]
null
null
null
_posts/other/2020-09-23-面试试题.md
Conerlius/conerlius.github.io
6422eea89c53675acb7d33f2470212bbf0c1a391
[ "MIT" ]
null
null
null
_posts/other/2020-09-23-面试试题.md
Conerlius/conerlius.github.io
6422eea89c53675acb7d33f2470212bbf0c1a391
[ "MIT" ]
1
2021-08-04T03:16:19.000Z
2021-08-04T03:16:19.000Z
--- layout: article title: "面试试题" subtitle: " \"面试\"" date: 2020-09-23 18:00:00 author: "Conerlius" category: other keywords: 面试 tags: - other - 面试 --- # 数学 - 怎么判定点在矩形外? - 判断一个点是否在多边形内部? - 两个向量的最小夹角? - 两个向量的同向和反向判定? # 数据结构 - 简述快速排序过程? - 红黑树、二叉树、平衡二叉树,三者有什么区别? - 堆排序原理 - 贪心算法和动态规划的区别? - 贪心算法的复杂度是多少? - 哈希表解决哈希冲突的方法? - 给定的一系列数组中查找指定的数据(重复,丢失,最大,最小) - 如何检查两个矩形是否重叠? - 如何在不使用第三个变量的情况下交换两个数字? # 网络相关 - OSI网络模型有多少层,分别是什么? - TCP与UDP的区别? - TCP连接/断线多少次握手,多少次挥手,分别做的是什么? - ~~TCP有没有方法可以优化其速度?~~ # C++ - 全局对象的构造函数在main 函数前还是后? - volatile restrict const三个修饰符有什么用? - 子类析构时要调用父类的析构函数吗? - ~~c++编译过程是怎么样的?~~ - ~~C#/C++编译后的类文件结构是怎么样的~~ # C# - volatile - internal protected - C#是否支持多重继承? - string和stringbuilder的区别? - 如何使用`new`覆盖方法? - 深克隆、浅克隆的区别? # other - 进程间通信的几种方式, 分别是什么? - 描述线程与进程的区别? - ~~程序调试的原理?~~ - ~~如何提高CPU的使用率?~~ - ~~什么是内存命中率,内存命中率如何提高?~~ - ~~说说txt文件的存储格式?~~
13.921875
35
0.659933
yue_Hant
0.207743
e5f5a383e238f30721dddbb2843daf6194d20adf
1,701
md
Markdown
README.md
krishna-commits/frogtoberfest
7838e9c14662860b131c0dd3fe82e37433564a3f
[ "MIT" ]
null
null
null
README.md
krishna-commits/frogtoberfest
7838e9c14662860b131c0dd3fe82e37433564a3f
[ "MIT" ]
null
null
null
README.md
krishna-commits/frogtoberfest
7838e9c14662860b131c0dd3fe82e37433564a3f
[ "MIT" ]
1
2021-10-03T21:33:22.000Z
2021-10-03T21:33:22.000Z
<h1 align="center">Frogtoberfest Checker</h1> <p align="center">Web app to track your progress for Frogtoberfest.</p> <p align="center">:point_right: <a href="https://frogtoberfest.lftechnology.com">https://frogtoberfest.lftechnology.com</a></p> ## CI Status [![CircleCI](https://circleci.com/gh/leapfrogtechnology/frogtoberfest/tree/master.svg?style=svg)](https://circleci.com/gh/leapfrogtechnology/frogtoberfest/tree/master) ## Requirements - Node v8+ ## Running the App - [Generate a GitHub personal access token](https://github.com/settings/tokens/new?scopes=&description=Frogtoberfest) to ensure you don't get rate limited as often. - Create a `.env` file using `.env.example`. ```bash $ cp .env.example .env ``` - Set your GitHub token as `REACT_APP_GITHUB_TOKEN` environment variable in `.env`: - Install dependencies and start. ```bash $ yarn $ yarn start ``` ### Running the app within Docker As an alternative to the section above, you can run the app within a Docker container: ```bash $ docker build -t frogtoberfest-checker . $ docker run -p 5000:5000 -e "REACT_APP_GITHUB_TOKEN=YOUR_TOKEN" frogtoberfest-checker ``` Alternatively, you can use docker-compose. ```bash $ docker-compose up --build ``` ## License Redistributed and sub-licensed under [MIT License](LICENSE) © 2019 - present by [Leapfrog Technology](https://github.com/leapfrogtechnology). Originally distributed and licensed under [MIT License](https://github.com/jenkoian/hacktoberfest-checker/LICENSE) by [Ian Jenkins](https://github.com/jenkoian). Check the original source code [here](https://github.com/jenkoian/hacktoberfest-checker). Happy Hacking! 🎃 🐸 # leapfrogfest # leapfrogfest
30.375
251
0.744856
eng_Latn
0.574779
e5f5ab4a5efc5761f2708e1922e222d3d5fc5c8d
605
md
Markdown
README.md
vrunoa/getting-started-with-appium
3d9e2ce3399aa79f9225f81ba54d9a1f509863a1
[ "MIT" ]
null
null
null
README.md
vrunoa/getting-started-with-appium
3d9e2ce3399aa79f9225f81ba54d9a1f509863a1
[ "MIT" ]
null
null
null
README.md
vrunoa/getting-started-with-appium
3d9e2ce3399aa79f9225f81ba54d9a1f509863a1
[ "MIT" ]
2
2019-06-06T05:49:32.000Z
2022-03-01T11:11:39.000Z
# Getting started with Appium [![Build Status](https://travis-ci.org/vrunoa/getting-started-with-appium.svg?branch=master)](https://travis-ci.org/vrunoa/getting-started-with-appium) [![Sauce Test Status](https://saucelabs.com/buildstatus/vrunoa)](https://saucelabs.com/u/vrunoa) # Preparing the environment Before starting make sure you have node 8+ installed. Installing appium ``` npm i -g appium ``` Installing the workshop dependencies ``` npm i ``` Run your first android test ``` npm run my-first-android-test ``` # Follow the workshop https://slides.com/vrunoa/getting-started-with-appium#/
25.208333
278
0.74876
eng_Latn
0.499598
e5f6acdaa900933ea3d78f7df643f4e90c21b474
28,357
md
Markdown
Topics/09. Using-modules-and-data-hiding/README.md
iliangogov/JavaScriptOOP
c890a39ecf037c7ab0afc6f66914346bb330fcfb
[ "MIT" ]
null
null
null
Topics/09. Using-modules-and-data-hiding/README.md
iliangogov/JavaScriptOOP
c890a39ecf037c7ab0afc6f66914346bb330fcfb
[ "MIT" ]
null
null
null
Topics/09. Using-modules-and-data-hiding/README.md
iliangogov/JavaScriptOOP
c890a39ecf037c7ab0afc6f66914346bb330fcfb
[ "MIT" ]
null
null
null
<!-- section start --> <!-- attr: { id:'', class:'slide-title', showInPresentation:true, hasScriptWrapper:true } --> # Classical Inheritance in JavaScript ## The way of Object-oriented Ninja <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic00.png" style="top:2.65%; left:70.59%; width:27.91%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic01.png" style="top:10.86%; left:93.39%; width:8.21%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic02.png" style="top:50.03%; left:51.08%; width:13.38%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic03.png" style="top:2.64%; left:32.98%; width:28.93%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic04.png" style="top:48.48%; left:65.53%; width:38.79%; z-index:-1" /> --> <article class="signature"> <p class="signature-course">JavaScript OOP</p> <p class="signature-initiative">Telerik Software Academy</p> <a href="http://academy.telerik.com " class="signature-link">http://academy.telerik.com </a> </div> <!-- section start --> <!-- attr: { id:'', showInPresentation:true, hasScriptWrapper:true } --> # Table of Contents - Objects in JavaScript - Object-oriented Design - OOP in JavaScript - Classical OOP - Prototype-chain - Object Properties - Function Constructors - The values of the this object - Implementing Inheritance <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic05.png" style="top:33.59%; left:63.79%; width:38.79%; z-index:-1" /> --> <!-- section start --> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Object-oriented Programming - OOP means that the application/program is **constructed as a set of objects** - Each object has its purpose - Each object can hold other objects - JavaScript is **prototype-oriented** language - Uses prototypes to define hierarchies - Does not have definition for class or constructor - ECMAScript 1.6 introduces classes <!-- section start --> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # OOP in JavaScript - JavaScript is **dynamic**language - No such things as variable **types** and **polymorphism** - JavaScript is also highly expressive language - Most things can be achieved in many ways - That is why JavaScript has many ways to support OOP - **Classical/Functional**, **Prototypal** - Each has its advantages and drawbacks - Usage depends on the case <!-- section start --> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Classical OOP - JavaScript uses functions to create objects - It has **no definition for class or constructor** - Functions play the role of object constructors - Create/initiate object by calling the function with the "**new**" keyword ```javascript function Person(){} var gosho = new Person(); //instance of Person var maria = new Person(); //another instance of Person ``` <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Creating Objects - When using a function as an object constructor it is executed when called with **new** - Each of the instances is independent - They have their **own state and behavior** - Function constructors can take parameters to give instances different state ```javascript function Person(){} var personGosho = new Person(); //instance of Person var personMaria = new Person(); //instance of Person ``` <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Creating Objects - Function constructor with parameters - Just a regular function with parameters, invoked with **new** ```javascript function Person(name, age){ this.name = name; this.age = age; } var person1 = new Person("George", 23); console.log(person1.name); //logs: George var person2 = new Person("Maria", 18); console.log(person2.age); //logs: 18 ``` <!-- section start --> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # The prototype Object - JavaScript is **prototype-oriented** programming language - Every object has a **prototype** - Its kind of its parent object - Prototypes have properties available to all instances - The **O****bject** type is the parent of all objects - Every object inherits object - Object provides common methods such as **toString** and **valueOf** <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> - When adding properties to a prototype, **all instances**will **have these properties** ```javascript //adding a repeat method to the String type String.prototype.repeat = function (count) { var str, pattern, i; pattern = String(this); if (!count) { return pattern; } str = ''; for (i = 0; i < count; i += 1) { str += pattern; } return str; }; ``` <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> - When adding properties to a prototype, **all instances**will **have these properties** ```javascript //adding a repeat method to the String type String.prototype.repeat = function (count) { var str, pattern, i; pattern = String(this); if (!count) { return pattern; } str = ''; for (i = 0; i < count; i += 1) { str += pattern; } return str; }; ``` <div class="fragment balloon" style="top:34.19%; left:42.71%; width:24.21%">Add method to all strings</div> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> - When adding properties to a prototype, **all instances**will **have these properties** ```javascript //adding a repeat method to the String type String.prototype.repeat = function (count) { var str, pattern, i; pattern = String(this); if (!count) { return pattern; } str = ''; for (i = 0; i < count; i += 1) { str += pattern; } return str; }; ``` <div class="fragment balloon" style="top:50.57%; left:42.71%; width:24.21%">Here this means the string</div> <div class="fragment balloon" style="top:34.19%; left:42.71%; width:24.21%">Add method to all strings</div> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> - When adding properties to a prototype, **all instances**will **have these properties** ```javascript //adding a repeat method to the String type String.prototype.repeat = function (count) { var str, pattern, i; pattern = String(this); if (!count) { return pattern; } str = ''; for (i = 0; i < count; i += 1) { str += pattern; } return str; }; ``` <div class="fragment balloon" style="top:50.57%; left:42.71%; width:24.21%">Here this means the string</div> <div class="fragment balloon" style="top:34.19%; left:42.71%; width:24.21%">Add method to all strings</div> ```javascript //use it with: '-'.repeat(25); ``` <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Object Members - Objects can also define custom state - Custom properties that only instances of this type have - Use the keyword **this** - To attach properties to object ```javascript function Person(name,age){ this.name = name; this.age = age; } var personMaria = new Person("Maria",18); console.log(personMaria.name); ``` <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> - Property values can be either variables or functions - Functions are called **methods** ```javascript function Person(name,age){ this.name = name; this.age = age; this.sayHello = function(){ console.log("My name is " + this.name + " and I am " + this.age + "-years old"); } } var maria = new Person("Maria",18); maria.sayHello(); ``` <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Attaching Methods - Attaching methods inside the object constructor is a tricky operation - Its is slow - Every object has a function with the same functionality, yet different instance - Having the function constructor ```javascript function Constr(name, age){ this.m = function(){ // Very important code }; } ``` <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Attaching Methods ```javascript var x = new Constr(); var y = new Constr(); console.log (x.m === y.m); ``` - Attaching methods inside the object constructor is a tricky operation - Its is slow - Every object has a function with the same functionality, yet different instance - Having the function constructor ```javascript function Constr(name, age){ this.m = function(){ // Very important code }; } ``` <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Attaching Methods <div class="fragment balloon" style="top:68.72%; left:59.05%; width:24.21%">Logs 'false'</div> - Attaching methods inside the object constructor is a tricky operation - Its is slow - Every object has a function with the same functionality, yet different instance - Having the function constructor ```javascript var x = new Constr(); var y = new Constr(); console.log (x.m === y.m); ``` ```javascript function Constr(name, age){ this.m = function(){ // Very important code }; } ``` <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Better Method Attachment - Instead of attaching the methods to **this**in the constructor ```javascript function Person(name,age){ //… this.sayHello = function(){ //… } } ``` <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Better Method Attachment - Instead of attaching the methods to **this**in the constructor - Attach them to the **prototype** of the constructor ```javascript function Person(name,age){ //… this.sayHello = function(){ //… } } ``` ```javascript function Person(name,age){ } Person.prototype.sayHello = function(){ //… }; ``` <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Better Method Attachment - Instead of attaching the methods to **this**in the constructor - Attach them to the **prototype** of the constructor ```javascript function Person(name,age){ //… this.sayHello = function(){ //… } } ``` ```javascript function Person(name,age){ } Person.prototype.sayHello = function(){ //… }; ``` <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Pros and Cons When Attaching Methods - Attaching to **this** - Attaching to **prototype** <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Pros and Cons When Attaching Methods - Attaching to **this** - Attaching to **prototype** <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic06.png" style="top:20.01%; left:40.86%; width:6.47%; z-index:-1" /> --> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Pros and Cons When Attaching Methods - Attaching to **this** - Attaching to **prototype** <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic07.png" style="top:20.01%; left:40.86%; width:6.47%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic08.png" style="top:20.69%; left:95.77%; width:6.47%; z-index:-1" /> --> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Pros and Cons When Attaching Methods - Attaching to **this** - Attaching to **prototype** <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic09.png" style="top:20.01%; left:40.86%; width:6.47%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic10.png" style="top:20.69%; left:95.77%; width:6.47%; z-index:-1" /> --> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Pros and Cons When Attaching Methods - Attaching to **this** - Attaching to **prototype** <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic11.png" style="top:20.01%; left:40.86%; width:6.47%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic12.png" style="top:31.36%; left:40.86%; width:6.47%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic13.png" style="top:20.69%; left:95.77%; width:6.47%; z-index:-1" /> --> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Pros and Cons When Attaching Methods - Attaching to **this** - Attaching to **prototype** <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic14.png" style="top:20.01%; left:40.86%; width:6.47%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic15.png" style="top:31.36%; left:40.86%; width:6.47%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic16.png" style="top:20.69%; left:95.77%; width:6.47%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic17.png" style="top:31.49%; left:95.78%; width:6.46%; z-index:-1" /> --> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Pros and Cons When Attaching Methods - Attaching to **this** - Attaching to **prototype** <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic18.png" style="top:20.01%; left:40.86%; width:6.47%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic19.png" style="top:31.36%; left:40.86%; width:6.47%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic20.png" style="top:20.69%; left:95.77%; width:6.47%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic21.png" style="top:31.49%; left:95.78%; width:6.46%; z-index:-1" /> --> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Pros and Cons When Attaching Methods - Attaching to **this** - Attaching to **prototype** <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic22.png" style="top:20.01%; left:40.86%; width:6.47%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic23.png" style="top:31.36%; left:40.86%; width:6.47%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic24.png" style="top:39.68%; left:40.79%; width:6.46%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic25.png" style="top:20.69%; left:95.77%; width:6.47%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic26.png" style="top:31.49%; left:95.78%; width:6.46%; z-index:-1" /> --> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Pros and Cons When Attaching Methods - Attaching to **this** - Attaching to **prototype** <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic27.png" style="top:20.01%; left:40.86%; width:6.47%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic28.png" style="top:31.36%; left:40.86%; width:6.47%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic29.png" style="top:39.68%; left:40.79%; width:6.46%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic30.png" style="top:20.69%; left:95.77%; width:6.47%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic31.png" style="top:39.90%; left:95.70%; width:6.47%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic32.png" style="top:31.49%; left:95.78%; width:6.46%; z-index:-1" /> --> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Pros and Cons When Attaching Methods - Attaching to **this** - Attaching to **prototype** <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic33.png" style="top:20.01%; left:40.86%; width:6.47%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic34.png" style="top:31.36%; left:40.86%; width:6.47%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic35.png" style="top:39.68%; left:40.79%; width:6.46%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic36.png" style="top:20.69%; left:95.77%; width:6.47%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic37.png" style="top:39.90%; left:95.70%; width:6.47%; z-index:-1" /> --> <!-- <img class="slide-image" showInPresentation="true" src="imgs\pic38.png" style="top:31.49%; left:95.78%; width:6.46%; z-index:-1" /> --> <!-- section start --> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Properties in JavaScript - JavaScript supports properties - i.e. a way to execute code when: - Getting a value - Setting a value - They are two ways to create properties in JS: - At object declaration with - and - Anytime with ```javascript get propName(){ } ``` ```javascript set propName(propValue){ } ``` ```javascript Object.defineProperty(obj, propName, descriptor) ``` <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> - **Object.defineProperty****(****obj****,****p****,****dscrptr****)**defines property **p** on object **obj** - _Example_: ```javascript Object.defineProperty(Person.prototype, 'name', { get: function () { return this._name; }, set: function (name) { if (!validateName(name)) { throw new Error('Name is invalid'); } this._name = name; } }); ``` ```javascript //calls the setter p.name = 'Jane Doe'; //calls the getter console.log(p.name); ``` <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # ES 6 Get and Set - ES6 introduces a new way to create properties and directly attach them to the prototype of the object: - Yet they can be defined only at the declaration of the object/function constructor ```javascript Person.prototype = { get name() { return this._name; }, set name(name) { if (!validateName(name)) { throw new Error('Name is invalid'); } this._name = name; return this; } } ``` ```javascript //calls the setter p.name = 'Jane Doe'; //calls the getter console.log(p.name); ``` <!-- section start --> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # The this Object - **this** is a special kind of object - It is available everywhere in JavaScript - Yet it has a different meaning - The **this** object can have two different values - **The parent scope** - The **value of this** of the containing scope - If none of the parents is object,**its value is window** - **A concrete object** - When using the new operator <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # this in Function Scope - When executed over a function, without the **new** operator - **this** refers to the **parent scope** ```javascript function Person(name) { this.name = name; this.getName = function getPersonName() { return this.name; } } var p = new Person("Gosho"); var getName = p.getName; console.log(p.getName()); //Gosho console.log(getName()); //undefined ``` <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # this in Function Scope - When executed over a function, without the **new** operator - **this** refers to the **parent scope** ```javascript function Person(name) { this.name = name; this.getName = function getPersonName() { return this.name; } } var p = new Person("Gosho"); var getName = p.getName; console.log(p.getName()); //Gosho console.log(getName()); //undefined ``` <div class="fragment balloon" style="top:49.02%; left:51.53%; width:30.99%">Here **this** means the Person object</div> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # this in Function Scope - When executed over a function, without the **new** operator - **this** refers to the **parent scope** ```javascript function Person(name) { this.name = name; this.getName = function getPersonName() { return this.name; } } var p = new Person("Gosho"); var getName = p.getName; console.log(p.getName()); //Gosho console.log(getName()); //undefined ``` <div class="fragment balloon" style="top:49.02%; left:51.53%; width:30.99%">Here **this** means the Person object</div> <div class="fragment balloon" style="top:60.51%; left:63.77%; width:33.06%">Here **this** means its parent scope (window)</div> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Function Constructors - JavaScript cannot limit function to be used only as constructors - JavaScript was meant for simple UI purposes ```javascript function Person(name) { var self = this; self.name = name; self.getName = function getPersonName() { return self.name; } } var p = Person("Peter"); ``` <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Function Constructors - JavaScript cannot limit function to be used only as constructors - JavaScript was meant for simple UI purposes ```javascript function Person(name) { var self = this; self.name = name; self.getName = function getPersonName() { return self.name; } } var p = Person("Peter"); ``` <div class="fragment balloon" style="top:60.90%; left:50.82%; width:30.99%">What will be the value of **this**?</div> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> - The only way to mark something as contructor is to name it **PascalCase** - And hope that the user of you code will be so nice to call PascalCase-named functions with new <!-- section start --> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Constructors with Modules - Function constructors can be put inside a module - Introduces a better abstraction of the code - Allows to hide constants and functions - JavaScript has first-class functions, so they can be easily returned by a module ```javascript var Person = (function () { function Person(name) { //… } Person.prototype.walk = function (distance){ /*...*/ }; return Person; }()); ``` <!-- section start --> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Hidden Funcitons - When a function constructor is wrapped inside a module: - The module can contain hidden functions - The function constructor can use these hidden functions - Yet, to use these functions as object methods, we should use **apply** or **call** <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Hidden Functions: _Example_ - Using hidden functions - var Rect = (function () { - function validatePosition() { - //… - } - function Rect(x, y, width, height) { - var isPositionValid = validatePosition.call(this); - if (!isPositionValid) { - throw new Error('Invalid Rect position'); - } - } - Rect.prototype = { /* … */}; - return Rect; - }()); <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Hidden Functions: _Example_ - var Rect = (function () { - function validatePosition() { - //… - } - function Rect(x, y, width, height) { - var isPositionValid = validatePosition.call(this); - if (!isPositionValid) { - throw new Error('Invalid Rect position'); - } - } - Rect.prototype = { /* … */}; - return Rect; - }()); - Using hidden functions <div class="fragment balloon" style="top:23.71%; left:61.21%; width:30.99%">This is not exposed from the module</div> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Hidden Functions: _Example_ - Using hidden functions - var Rect = (function () { - function validatePosition() { - //… - } - function Rect(x, y, width, height) { - var isPositionValid = validatePosition.call(this); - if (!isPositionValid) { - throw new Error('Invalid Rect position'); - } - } - Rect.prototype = { /* … */}; - return Rect; - }()); <div class="fragment balloon" style="top:23.71%; left:61.21%; width:30.99%">This is not exposed from the module</div> <div class="fragment balloon" style="top:52.17%; left:62.15%; width:30.99%">Use call() to invoke the function over this</div> <!-- section start --> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Inheritance in Classical OOP - Inheritance is a way to extend the functionality of an object, into another object - Like Student inherits Person - Person inherits Mammal, etc… - In JavaScript inheritance is achieved by setting the prototype of the derived type to the prototype of the parent ```javascript function Person(fname, lname) {} function Student(fname, lname, grade) {} Student.prototype = Person.prototype; ``` ```javascript var student = new Student("Kiro", "Troikata", 7); ``` <!-- section start --> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # The Prototype Chain - Objects in JavaScript can have only a single prototype - Their prototype also has a prototype, etc… - This is called the prototype chain - When a property is called on an object - This object is searched for the property - If the object does not contain such property, its prototype is checked for the property, etc… - If a null prototype is reached, the result is undefined <!-- section start --> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Calling Parent Methods - JavaScript has no direct way of calling its parent methods - Function constructors actually does not know who or what is their parent - Calling parent methods is done using call and apply <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Calling Parent Methods: _Example_ - Having Shape: ```javascript var Shape = (function () { function Shape(x, y) { //initialize the shape } Shape.prototype = { serialize: function () { //serialize the shape //return the serialized } }; return Shape; }()); ``` ```javascript var Rect = (function () { function Rect(x, y, width, height) { Shape.call(this, x, y); //init the Rect } Rect.prototype = new Shape(); Rect.prototype.serialize=function (){ Shape.prototype .serialize .call(this); //add Rect specific serialization //return the serialized; }; return Rect; }()); ``` - Inheriting it with Rect <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Calling Parent Methods: _Example_ - Having Shape: ```javascript var Shape = (function () { function Shape(x, y) { //initialize the shape } Shape.prototype = { serialize: function () { //serialize the shape //return the serialized } }; return Shape; }()); ``` ```javascript var Rect = (function () { function Rect(x, y, width, height) { Shape.call(this, x, y); //init the Rect } Rect.prototype = new Shape(); Rect.prototype.serialize=function (){ Shape.prototype .serialize .call(this); //add Rect specific serialization //return the serialized; }; return Rect; }()); ``` - Inheriting it with Rect <div class="fragment balloon" style="top:40.03%; left:64.38%; width:24.21%">Call parent constructor</div> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Calling Parent Methods: _Example_ - Having Shape: ```javascript var Shape = (function () { function Shape(x, y) { //initialize the shape } Shape.prototype = { serialize: function () { //serialize the shape //return the serialized } }; return Shape; }()); ``` ```javascript var Rect = (function () { function Rect(x, y, width, height) { Shape.call(this, x, y); //init the Rect } Rect.prototype = new Shape(); Rect.prototype.serialize=function (){ Shape.prototype .serialize .call(this); //add Rect specific serialization //return the serialized; }; return Rect; }()); ``` - Inheriting it with Rect <div class="fragment balloon" style="top:40.03%; left:64.38%; width:24.21%">Call parent constructor</div> <div class="fragment balloon" style="top:64.65%; left:75.65%; width:24.21%">Call parent method</div> <!-- attr: { showInPresentation:true, hasScriptWrapper:true } --> # Inheritance in Classical OOP - http://academy.telerik.com
27.557823
141
0.661318
eng_Latn
0.824423
e5f6d6046cb2708680b757690cec30edd8530c10
159
md
Markdown
1-Machine-Learning/0-Basic-Knowledge/Math-Knowledge/激活函数.md
yzy1996/Artificial-Intelligence
30a9a2ce1602b9fa9be5981e98885c1c4244cbbd
[ "MIT" ]
7
2019-11-09T02:55:35.000Z
2021-08-16T12:43:44.000Z
1-Machine-Learning/0-Basic-Knowledge/Math-Knowledge/激活函数.md
yzy1996/Artificial-Intelligence
30a9a2ce1602b9fa9be5981e98885c1c4244cbbd
[ "MIT" ]
3
2020-10-13T03:12:03.000Z
2021-03-21T09:03:02.000Z
1-Machine-Learning/0-Basic-Knowledge/Math-Knowledge/激活函数.md
yzy1996/Artificial-Intelligence
30a9a2ce1602b9fa9be5981e98885c1c4244cbbd
[ "MIT" ]
6
2020-06-07T08:14:15.000Z
2021-08-02T09:04:31.000Z
# 激活函数 ## Sigmoid Also called logistic function $$ f(x) = \frac{1}{1 + e^{-x}} $$ ## Softmax ## Relu $$ f(x) = \max(0, x) = \frac{x+|x|}{2} $$
5.678571
35
0.45283
eng_Latn
0.70666
e5f7041887122c21d34cc713ce4a714a1b5b3359
3,527
md
Markdown
Easy Challenges/Challenge #0183 [Easy] Semantic Version Sort/challenge_text.md
doctorBeast/challenges
dcfc7737afd8325d70cf6119c06820de2814d539
[ "MIT" ]
331
2016-03-04T02:13:43.000Z
2017-10-18T09:07:53.000Z
Easy Challenges/Challenge #0183 [Easy] Semantic Version Sort/challenge_text.md
doctorBeast/challenges
dcfc7737afd8325d70cf6119c06820de2814d539
[ "MIT" ]
64
2016-03-15T23:46:42.000Z
2017-10-19T18:25:30.000Z
Easy Challenges/Challenge #0183 [Easy] Semantic Version Sort/challenge_text.md
doctorBeast/challenges
dcfc7737afd8325d70cf6119c06820de2814d539
[ "MIT" ]
116
2016-03-11T19:59:12.000Z
2017-10-19T18:23:37.000Z
# [](#EasyIcon) __(Easy)__: Semantic Version Sort Semantic Versioning, or *Semver* as it's known on the streets, is an attempt to standardise the way that software versions are incrementally changed. In the world there are many different pieces of software whose developers have conflicting ideas about how software should be developed. For example, [Dwarf Fortress](http://www.bay12games.com/dwarves/) is currently at version 0.40.13, whereas [Google Chrome](https://en.wikipedia.org/wiki/Google_Chrome) (which has been around for 2 years *less* than Dwarf Fortress) is currently at version 37.0.2062.124. How can those version numbers even be compared? They both represent around the same progress of development but in totally different ways. Semantic versioning aims to solve this problem by splitting the version string into 3, 4 or 5 parts: <major>.<minor>.<patch>-<label>+<metadata> * **major**: Increased when your program changes in a way that makes it incompatible with older versions (major changes) - like the Python 2 to Python 3 change which, in order to make progress, broke a lot of existing programs. * **minor**: Increased when you add functionality but keep compatibility and don't change existing bits of the API (minor changes) - for example, adding a new section of a standard library to a programming language. * **patch**: Increased when you make minor functionality changes or bug fixes, like adding a new keyboard shortcut. * **label**: Used to indicate pre-release program status, such as *beta*, *alpha* or *rc2* (release candidate 2.) * **metadata**: Used to describe build metadata when a version is in the early development stages - this might include the build date of the program. For the purpose of this challenge, you will be sorting a list of Semantic Versions into chronological order, and you will do it like so: 1. First, compare the major version. 2. If they are the same, compare the minor version. 3. If they are the same, compare the patch version. 4. If those are all the same, check if the version has a label - ignore the content of the label. A version with a label (prerelease) comes before one without a label (final release.) 5. Ignore the build metadata. If the semantic versions are still the same at this point, they can be considered the same version. For the purpose of this challenge we won't attempt to parse the label - but if you're feeling up to you can give it a try! The full specification for Semantic Versioning [can be found here](http://semver.org/). # Formal Inputs and Outputs ## Input Description You will first be given a number **N**. You will then be given **N** more lines, each one with a semantic version. ## Output Description You will print the versions in chronological order, as described by the rules above. # Sample Inputs and Outputs ## Sample Input 7 2.0.11-alpha 0.1.7+amd64 0.10.7+20141005 2.0.12+i386 1.2.34 2.0.11+i386 20.1.1+i386 ## Sample Output 0.1.7+amd64 0.10.7+20141005 1.2.34 2.0.11-alpha 2.0.11+i386 2.0.12+i386 20.1.1+i386 # Tip If your chosen language supports it, create a `SemanticVersion` record/structure with the appropriate fields. If your language supports it, overload the comparison (`<`, `>`) operators to compare for you. If your language does not support sorting of data structures by default, you could adjust your solution to [the Quicksort](/r/dailyprogrammer/comments/2ejl4x/) challenge to work with this one.
53.439394
797
0.747661
eng_Latn
0.99908
e5f712ab04ab2f710d2df0ad2413257206d4750b
228
md
Markdown
_events/2017-03-24-nescala.md
pzapletal/scala-lang
b60c59496ca6a86d5874f5c355a295aa41ca4bed
[ "Apache-2.0", "BSD-3-Clause" ]
223
2015-02-03T14:15:49.000Z
2022-03-28T13:19:13.000Z
_events/2017-03-24-nescala.md
pzapletal/scala-lang
b60c59496ca6a86d5874f5c355a295aa41ca4bed
[ "Apache-2.0", "BSD-3-Clause" ]
835
2015-01-14T18:49:51.000Z
2022-03-31T20:56:34.000Z
_events/2017-03-24-nescala.md
pzapletal/scala-lang
b60c59496ca6a86d5874f5c355a295aa41ca4bed
[ "Apache-2.0", "BSD-3-Clause" ]
276
2015-01-28T14:09:16.000Z
2022-03-18T08:46:49.000Z
--- category: event title: Northeast Scala Symposium logo: /resources/img/nescala.png location: New York, NY, USA description: "7th year!" start: 24 March 2017 end: 25 March 2017 link-out: https://nescala.io/2017/index.html ---
20.727273
44
0.741228
yue_Hant
0.824311
e5f733659cad99bb9061e6c3d0dfa5a0812a431d
2,325
md
Markdown
README.md
Grubbly/Evoventure
50c0b5e44f1542d7b2ee09e0b5dd2f9fce57a6a3
[ "MIT" ]
null
null
null
README.md
Grubbly/Evoventure
50c0b5e44f1542d7b2ee09e0b5dd2f9fce57a6a3
[ "MIT" ]
null
null
null
README.md
Grubbly/Evoventure
50c0b5e44f1542d7b2ee09e0b5dd2f9fce57a6a3
[ "MIT" ]
null
null
null
# Evoventure An adventure game based on [Evoland](http://www.evoland2.com/) that implements topics learned in an introductory graphics course. ## Premise You are a renderer in a world that constantly changes appearance. Throughout your various quests and explorations, you will discover new graphical enhancements that will expand where and what you can do in the game. The world is extensive, but your rendering capabilities are not. In the beginning you will be limited to a capped number of graphical enhancements that can be active at a time. The combinations you choose will affect how you can interact with the environment. ___ # Developer Documentation As assigned, the primary theme for this game is a journey. The fact users have to choose between different graphical enhancements allows us to adopt the previous Ludum Dare theme of sacrifice. Added plus! ## Setting Cyber-punk/Foresty [See Horizon Zero Dawn](https://www.playstation.com/en-us/games/horizon-zero-dawn-ps4/) ## Primary Features (In order of priority) * 2D Platforming * Birds-eye 2D Exploration * Title screen * Save/load * 3rd Person Control * Combat * Sound and Music * Animations * Different locomotion styles ## Secondary Features * Shaders * Agents * Perlin noise * Terrain generation * Multiple input channels (keyboard, gamepad, VR, etc.) * NPR to PBR transitions * Flying * Lighting * Shadows * Subdivision curves/surfaces ___ ![Evoventure Pipeline](https://github.com/Grubbly/Evoventure/blob/master/evoventure.png) #### Figure 1: In the beginning, up to three graphical enhancements are loaded into empty rendering slots (the middle boxes in the diagram). Depending on the equipped enhancements, the rendering could help or harm the player. Imagine a user has four graphical enhancements: 3rd person control, combat, sound and music, and animation. An example of a valid combination would be 3rd person control, sound and music, and animations, but the user would have to figure out ways to avoid combat because they would not be able to fight. Some enhancements are obviously incompatible like 2D platforming and 3rd person controls, so keep this in mind when implementing error checking. ___ ![UI Concept](https://github.com/Grubbly/Evoventure/blob/master/UIConcept.png) #### Figure 2: UI design concept for using collectables.
47.44898
674
0.790538
eng_Latn
0.99326
e5f798852aaf4bcc624270cb52d0e2c7b4cded95
1,099
md
Markdown
practicesBash/Readme.md
StyvenSoft/Learn-Command-Line
152d7c4d9537d2b73c14b6a093d5069f6ec9833c
[ "MIT" ]
null
null
null
practicesBash/Readme.md
StyvenSoft/Learn-Command-Line
152d7c4d9537d2b73c14b6a093d5069f6ec9833c
[ "MIT" ]
null
null
null
practicesBash/Readme.md
StyvenSoft/Learn-Command-Line
152d7c4d9537d2b73c14b6a093d5069f6ec9833c
[ "MIT" ]
null
null
null
# Bash Scripting Full practices ![Bash screen](../assets/bash.png) In this Bash Scripting practice, I perform the exercises from printing a simple "Hello World" to using conditional statements like if statements, case statements to using loops like while, for, and even loops to using awk, sed, and bash debugging scripts. In general, I practice and cover the following topics: - [x] 1-Hello Bash Scripting - [x] 2-Redirect to file - [x] 3-Comments - [x] 4-Conditional Statements - [x] 5-Loops - [x] 6-Script input - [x] 7-Script output - [x] 8-how to send output from one script to another scrpt - [x] 9-String Processing - [x] 10-Numbers and Arithmetic - [X] 11-Declare Command - [X] 12-Arrays - [x] 13-Functions - [x] 14-Files and Directories - [x] 15-Send Email Via Script - [x] 16-Curl in Scripts - [x] 17-Professional Menus - [x] 18-Wait for filesystem events with inotify - [x] 19-Introduction to grep - [x] 20-Introduction to awk - [x] 21-Introduction to sed - [x] 22- Debugging bash scripts --- [Bash Reference Manual](https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html)
33.30303
310
0.724295
eng_Latn
0.801479
e5f89a3789b06872b0a7b5123e48b5a515c0e424
1,319
md
Markdown
src/pages/weekly-links/2018-04-21.md
liorgu/yearn2learn
c81c9f61f02dc9570a5d6f0c1861e4c3da405bc0
[ "MIT" ]
1
2021-06-05T05:13:21.000Z
2021-06-05T05:13:21.000Z
src/pages/weekly-links/2018-04-21.md
liorgu/yearn2learn
c81c9f61f02dc9570a5d6f0c1861e4c3da405bc0
[ "MIT" ]
13
2020-07-16T19:39:33.000Z
2022-02-26T10:04:36.000Z
src/pages/weekly-links/2018-04-21.md
liorgu/yearn2learn
c81c9f61f02dc9570a5d6f0c1861e4c3da405bc0
[ "MIT" ]
null
null
null
--- title: 'Weekly Links #109' date: '2018-04-21' --- **Top 10 Links For 13-19/4** 1. [Web Security for Single Page Applications: great impact with little effort](https://techblog.commercetools.com/web-security-for-single-page-applications-great-impact-with-little-effort-a7a506cec20b) 2. [getDerivedStateFromState — making complex things simpler](https://itnext.io/getderivedstatefromstate-making-complex-things-simpler-4450115e49d6) 3. [Designing very large (JavaScript) applications](https://medium.com/@cramforce/designing-very-large-javascript-applications-6e013a3291a3) 4. [8 Useful but Not Well-Known Git Concepts](https://dzone.com/articles/8-useful-but-not-well-known-git-concepts) 5. [30 tips for creating great software releases](https://successfulsoftware.net/2018/04/17/30-tips-for-creating-great-software-releases/) 6. [Change how you perceive time](https://hackernoon.com/change-how-you-perceive-time-618282a1a9ec) 7. [AST for JavaScript developers](https://itnext.io/ast-for-javascript-developers-3e79aeb08343) 8. [Release v4.0.0 · reactjs/redux](https://github.com/reactjs/redux/releases/tag/v4.0.0) 9. [Oh Man, Look at Your API!](https://medium.com/pixelpoint/oh-man-look-at-your-api-22f330ab80d5) 10. [Dependencies Done Right](https://yarnpkg.com/blog/2018/04/18/dependencies-done-right/)
73.277778
203
0.776346
eng_Latn
0.262275
e5f8f4d3e982c4440f78f70fc92088100ec4615b
845
md
Markdown
kobiton-rest-api/upload-app-to-kobiton-apps-repo/java/README.md
oanhpham173/samples
47bcf2485a178a38a7aa51bbe81934e0b2411a25
[ "MIT" ]
null
null
null
kobiton-rest-api/upload-app-to-kobiton-apps-repo/java/README.md
oanhpham173/samples
47bcf2485a178a38a7aa51bbe81934e0b2411a25
[ "MIT" ]
null
null
null
kobiton-rest-api/upload-app-to-kobiton-apps-repo/java/README.md
oanhpham173/samples
47bcf2485a178a38a7aa51bbe81934e0b2411a25
[ "MIT" ]
1
2019-12-05T06:03:26.000Z
2019-12-05T06:03:26.000Z
# Prerequisites - Install Java JDK 1.8 [here](https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) - Install IntelliJ IDEA (Community Edition) [here](https://www.jetbrains.com/idea/download/) - Open project as Maven project # Steps - Update your username & apiKey on Common class ``` static String username = ""; static String apiKey = ""; ``` - Run Main class - The default script will download an app from URL and then upload it into your Kobiton Apps Repo ``` Common.downloadFile("https://s3-ap-southeast-1.amazonaws.com/kobiton-devvn/apps-test/demo/com.dozuki.ifixit.apk", "com.dozuki.ifixit.apk"); ``` - If you want to upload your app from local, please update variables filePath & fileName on Main class ``` static String filePath ="com.dozuki.ifixit.apk"; static String fileName ="iFixit"; ```
29.137931
140
0.738462
eng_Latn
0.426898
e5fa0b4fb8bcd0ffe6a28e9800b5482c8ae5cc34
426
md
Markdown
src/pages/articles/2007-01-03---crazy-esher-style-pictures/2007-01-03-crazy-esher-style-pictures.md
monquixote/nick_long_blog
946fc841ac20ebe5ecc7a7ea478534dbf8e0f563
[ "MIT" ]
1
2020-07-24T20:07:40.000Z
2020-07-24T20:07:40.000Z
src/pages/articles/2007-01-03---crazy-esher-style-pictures/2007-01-03-crazy-esher-style-pictures.md
monquixote/nick_long_blog
946fc841ac20ebe5ecc7a7ea478534dbf8e0f563
[ "MIT" ]
null
null
null
src/pages/articles/2007-01-03---crazy-esher-style-pictures/2007-01-03-crazy-esher-style-pictures.md
monquixote/nick_long_blog
946fc841ac20ebe5ecc7a7ea478534dbf8e0f563
[ "MIT" ]
null
null
null
--- id: 112 title: Crazy Esher Style Pictures date: 2007-01-03T21:08:00+00:00 author: admin layout: post guid: http://www.nick-long.com/crazy-esher-style-pictures/ permalink: /crazy-esher-style-pictures/ blogger_blog: - monquixote.blogspot.com blogger_author: - Monquixote blogger_permalink: - /2007/01/crazy-esher-style-pictures.html category: Link --- [Check it out here](http://www.sapergalleries.com/Gonsalves.html)
23.666667
65
0.760563
yue_Hant
0.501223
e5fa711ebdb64cd916957042af0ace99d26c5298
1,239
md
Markdown
README.md
ErikZA/app_e-book
27a624e9958e19f48f2ade91d819b150afe66fba
[ "RSA-MD" ]
null
null
null
README.md
ErikZA/app_e-book
27a624e9958e19f48f2ade91d819b150afe66fba
[ "RSA-MD" ]
4
2021-03-11T00:31:44.000Z
2022-02-19T04:55:25.000Z
README.md
ErikZA/app_e-book
27a624e9958e19f48f2ade91d819b150afe66fba
[ "RSA-MD" ]
null
null
null
# My App <p align="center"> <img alt="License" src="https://img.shields.io/static/v1?label=license&message=MIT&color=7159c1&labelColor=000000"> </p> App desenvolvido para a testar o framework Adonis 5 e a prática de autenticação em react e react native. ## My Site web <p align="center"> <img src="imagesReadme/foxWeb.jpeg" alt="Tela 1" width="35%" /> <img src="imagesReadme/signWeb.jpeg" alt="Tela 2" width="35%"/> <img src="imagesReadme/startWeb.jpeg" alt="Tela 3" width="35%" /> </p> ## My App <p align="center"> <img src="imagesReadme/fox.jpeg" alt="Tela 9" width="20%" /> <img src="imagesReadme/sign.jpeg" alt="Tela 10" width="20%"/> <img src="imagesReadme/start.jpeg" alt="Tela 11" width="20%" /> <img src="imagesReadme/recover.jpeg" alt="Tela 12" width="20%" /> </p> ## Tecnologias Esse projeto foi desenvolvido com as seguintes tecnologias: - [Node.js](https://nodejs.org/en/) - [AdonisJs](https://preview.adonisjs.com/) - [React](https://reactjs.org) - [React Native](https://facebook.github.io/react-native/) - [Expo](https://expo.io/) ## Licença Esse projeto está sob a licença MIT. Veja o arquivo [LICENSE](LICENSE.md) para mais detalhes.
24.78
118
0.652139
por_Latn
0.53663
e5fa93d61209c4f1414d303b8f658944be591d6d
2,763
md
Markdown
README.md
platanus/khipu-api-ruby-client
c5dcd8486a6ae29df2dbcdab96c26305a086684e
[ "Apache-2.0" ]
5
2016-02-08T20:05:19.000Z
2021-05-19T16:39:46.000Z
README.md
platanus/khipu-api-ruby-client
c5dcd8486a6ae29df2dbcdab96c26305a086684e
[ "Apache-2.0" ]
9
2015-11-29T05:03:15.000Z
2020-11-19T00:18:46.000Z
README.md
platanus/khipu-api-ruby-client
c5dcd8486a6ae29df2dbcdab96c26305a086684e
[ "Apache-2.0" ]
11
2015-11-11T12:09:09.000Z
2021-09-30T22:53:27.000Z
## Installation ```sh gem install khipu-api-client ``` ## Usage ### Basic configuration ```ruby require 'khipu-api-client' Khipu.configure do |c| c.secret = 'abc123' c.receiver_id = 1234 c.platform = 'my-ecomerce' # (optional) please let us know :) c.platform_version = '1.0' end ``` ### Basic usage #### Create a new payment ```ruby api = Khipu::PaymentsApi.new() options = { expires_date: Time.now + (24*60*60) # 1 day from now send_email: true, payer_name: "payer", payer_email: "payer@mail.com" } response = api.payments_post("Test de api nueva", "CLP", 1, options) print response # response keys: # [:payment_id, :payment_url, :simplified_transfer_url, :transfer_url, :app_url] ``` There are a more params you can send in each request. You might want to consider adding these to the options: ```ruby transaction_id # transaction id in your system return_url # after (potential) success, the client will be redirected to this url cancel_url # if the payment is canceled, the client will be redirected to this url notify_url # khipu will send a notification to this url - the client will not see this request notify_api_version # "1.3" ``` #### Ask for payment status ```ruby api = Khipu::PaymentsApi.new() status = api.payments_id_get(response.payment_id) print status ``` #### Confirm a payment If you send a notification_url when creating the payment or if you have set it up on your account configuration, Khipu will sent you a request with a notification_token and a api_version. You can use the notification_token param to get the payment information from the khipu service. ```ruby notification_token = params["notification_token"] client = Khipu::PaymentsApi.new response = client.payments_get(notification_token) if response.status == 'done' # order = get_order(response.transaction_id) # if order != nil and is_valid?(order, response) # setPurchased(order) # end end print response # response keys: # [ # :payment_id, :payment_url, :simplified_transfer_url, :transfer_url, # :app_url, :ready_for_terminal, :subject, :amount, :currency, :status, # :status_detail, :body, :picture_url, :receipt_url, :return_url, # :cancel_url, :notify_url, :notify_api_version, :expires_date, # :attachment_urls, :bank, :bank_id, :payer_name, :payer_email, # :personal_identifier, :bank_account_number, :out_of_date_conciliation, # :transaction_id, :custom, :responsible_user_email, :send_reminders, :send_email # ] ``` ### Documentation - [API docs](https://khipu.com/page/api) - [gem docs](http://www.rubydoc.info/gems/khipu-api-client/)
31.044944
283
0.688382
eng_Latn
0.824555
e5fab9852892b3cddd3d67eb4e7ce298282b46fe
1,666
md
Markdown
examples/iam-user/README.md
HappyPathway/terraform-aws-iam
6ef0b56b66fac63cd4c7c561280c9ce187b12e63
[ "Apache-2.0" ]
null
null
null
examples/iam-user/README.md
HappyPathway/terraform-aws-iam
6ef0b56b66fac63cd4c7c561280c9ce187b12e63
[ "Apache-2.0" ]
null
null
null
examples/iam-user/README.md
HappyPathway/terraform-aws-iam
6ef0b56b66fac63cd4c7c561280c9ce187b12e63
[ "Apache-2.0" ]
1
2021-08-14T22:14:26.000Z
2021-08-14T22:14:26.000Z
# IAM user example Configuration in this directory creates IAM user with a random password, a pair of IAM access/secret keys and uploads IAM SSH public key. User password and secret key is encrypted using public key of keybase.io user named `test`. # Usage To run this example you need to execute: ```bash $ terraform init $ terraform plan $ terraform apply ``` Run `terraform destroy` when you don't need these resources. <!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> ## Outputs | Name | Description | |------|-------------| | keybase_password_decrypt_command | | | keybase_password_pgp_message | | | keybase_secret_key_decrypt_command | | | keybase_secret_key_pgp_message | | | pgp_key | PGP key used to encrypt sensitive data for this user (if empty - secrets are not encrypted) | | this_iam_access_key_encrypted_secret | The encrypted secret, base64 encoded | | this_iam_access_key_id | The access key ID | | this_iam_access_key_key_fingerprint | The fingerprint of the PGP key used to encrypt the secret | | this_iam_access_key_ses_smtp_password | The secret access key converted into an SES SMTP password | | this_iam_access_key_status | Active or Inactive. Keys are initially active, but can be made inactive by other means. | | this_iam_user_arn | The ARN assigned by AWS for this user | | this_iam_user_login_profile_encrypted_password | The encrypted password, base64 encoded | | this_iam_user_login_profile_key_fingerprint | The fingerprint of the PGP key used to encrypt the password | | this_iam_user_name | The user's name | | this_iam_user_unique_id | The unique ID assigned by AWS | <!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
40.634146
137
0.769508
eng_Latn
0.943327
e5fb28a29686c4510329640f4f54e8fc1fff578c
2,255
md
Markdown
basic/15-nft-blindbox-chainlink-vrf/readme.md
yilugit/Dapp-Learning
70a9f45c5c21f9e367bca1a488810b612025ebb7
[ "MIT" ]
1
2022-03-22T09:35:36.000Z
2022-03-22T09:35:36.000Z
basic/15-nft-blindbox-chainlink-vrf/readme.md
pengjinning/Dapp-Learning
3e9bbeb600dc8a5601e6bd3dae00d38662099140
[ "MIT" ]
null
null
null
basic/15-nft-blindbox-chainlink-vrf/readme.md
pengjinning/Dapp-Learning
3e9bbeb600dc8a5601e6bd3dae00d38662099140
[ "MIT" ]
1
2022-01-03T08:18:31.000Z
2022-01-03T08:18:31.000Z
## 基于 chainlink vrf的 nft盲盒设计 VRF 为链上安全可验证随机数, 用于安全的生成随机数, 具体可参考 [chainlink vrf官方文档](https://docs.chain.link/docs/get-a-random-number). 本样例代码演示如何使用 ChainLink 进行 NFT 盲盒设计. ## 操作步骤 - 配置私钥 在 .env 中放入的私钥,格式为 "PRIVATE_KEY=xxxx", 然后代码自动从中读取 - 获取 test Link 每次去 ChainLink 请求 VRF 随机数时, 都需要消耗 Link 币, 所以在测试前需要申请 Link 测试币. 以 Kovan 测试网为例, 前往 [Request testnet LINK](https://faucets.chain.link/kovan?_ga=2.35440098.2104755910.1637393798-1377742816.1635817935) , 然后 "Netwrok" 选择 "Ethereum Kovan", "Testnet account address" 输入 .env 文件中 PRIVATE_KEY 对应的账户地址 ![](./images/chainlink.png) <center><img src="https://github.com/Dapp-Learning-DAO/Dapp-Learning-Arsenal/blob/main/images/basic/15-nft-blindbox-chainlink-vrf/chainlink.png?raw=true" /></center> - 安装依赖 ``` npm install ``` - 创建 ChainLink SubscriptionID 登陆 [ChainLink VRF 测试网](https://vrf.chain.link/?_ga=2.225785050.1950508783.1645630272-1230768383.1643005305) , 点击 "Create Subscription" 创建 SubscriptionID , 之后可以在 "My Subscriptions" 中看到创建的 SubscriptionID <center><img src="https://github.com/Dapp-Learning-DAO/Dapp-Learning-Arsenal/blob/main/images/basic/14-chainlink-price-feed/ChainLinkVRF.png?raw=true" /></center> - 保存 SubscriptionID 将上一步创建的 SubscriptionID 保存到 .env 文件中 <center><img src="https://github.com/Dapp-Learning-DAO/Dapp-Learning-Arsenal/blob/main/images/basic/14-chainlink-price-feed/SubscriptionID.png?raw=true" /></center> ```sh ## .env SubscriptionId=ddddd ``` - 配置环境变量 在 .env 文件中放入私钥, infura 节点 id ```sh ## .env PRIVATE_KEY=xxxxxxxxxxxxxxxx INFURA_ID=yyyyyyyy ``` - 部署测试合约 ``` npx hardhat run scripts/deploy.js --network rinkeby ``` - 获取随机数 ``` npx hardhat run scripts/random-number-vrf.js --network rinkeby ``` - 生成随机 Character ``` npx hardhat run scripts/transaction.js --network rinkeby ``` ## 参考链接 github 样例代码: https://github.com/PatrickAlphaC/dungeons-and-dragons-nft Chainlink链下报告概览: https://learnblockchain.cn/article/2186 如何在NFT(ERC721)中获取随机数: https://learnblockchain.cn/article/1776 使用Chainlink预言机,十分钟开发一个DeFi项目: https://learnblockchain.cn/article/1056 chainlink kovan faucet: https://faucets.chain.link/kovan?_ga=2.35440098.2104755910.1637393798-1377742816.1635817935 ChainLink VRF 官网文档: https://docs.chain.link/docs/get-a-random-number/
35.793651
290
0.756541
yue_Hant
0.705905
e5fbdb68224957e82b505233116fd0322e03cc46
1,580
md
Markdown
docs/visual-basic/misc/bc30138.md
CodeTherapist/docs.de-de
45ed8badf2e25fb9abdf28c20e421f8da4094dd1
[ "CC-BY-4.0", "MIT" ]
null
null
null
docs/visual-basic/misc/bc30138.md
CodeTherapist/docs.de-de
45ed8badf2e25fb9abdf28c20e421f8da4094dd1
[ "CC-BY-4.0", "MIT" ]
null
null
null
docs/visual-basic/misc/bc30138.md
CodeTherapist/docs.de-de
45ed8badf2e25fb9abdf28c20e421f8da4094dd1
[ "CC-BY-4.0", "MIT" ]
null
null
null
--- title: 'Kann nicht zum Erstellen der temporären Datei im Pfad &#39; &lt;Filename&gt;&#39;: &lt;Fehlermeldung&gt;' ms.date: 07/20/2015 f1_keywords: - bc30138 - vbc30138 helpviewer_keywords: - BC30138 ms.assetid: fa47c3bb-3bbf-4fca-800e-de728e9e1779 ms.openlocfilehash: 906c0844a4bc8bfd6a39c77f00731c92d91b1e51 ms.sourcegitcommit: 3d5d33f384eeba41b2dff79d096f47ccc8d8f03d ms.translationtype: MT ms.contentlocale: de-DE ms.lasthandoff: 05/04/2018 ms.locfileid: "33606557" --- # <a name="unable-to-create-temp-file-in-path-39ltfilenamegt39-lterror-messagegt"></a>Kann nicht zum Erstellen der temporären Datei im Pfad &#39; &lt;Filename&gt;&#39;: &lt;Fehlermeldung&gt; Visual Basic-Compiler Ruft den Assemblylinker (Al.exe, auch bekannt als Alink) auf, um eine Assembly mit einem Manifest zu erstellen. Der Linker hat beim Erstellen einer Datei oder beim Schreiben in eine speicherinterne Ressource einen Fehler gemeldet. Dies kann ein Konfigurationsproblem sein. **Fehler-ID:** BC30138 ## <a name="to-correct-this-error"></a>So beheben Sie diesen Fehler 1. Überprüfen Sie die angegebene Fehlermeldung, und wenden Sie sich an das Thema [Al.exe (Assembly Linker)](../../framework/tools/al-exe-assembly-linker.md) für weitere erläuterungen und Hinweise zu erhalten. 2. Wenn der Fehler weiterhin besteht, tragen Sie Informationen zu den Umständen zusammen, und benachrichtigen Sie den Produktsupport von Microsoft. ## <a name="see-also"></a>Siehe auch [Al.exe (Assembly Linker-Tool)](../../framework/tools/al-exe-assembly-linker.md)
49.375
296
0.760759
deu_Latn
0.942419
e5fc47cf21cef077a5ca5dbb2e1aa81d8de3c683
1,285
md
Markdown
docs/scripts/docs/en/guide/kill-ie.md
balmjs/balm-f7
86832d2084e69f40d3b757905f1c01a6bf09348b
[ "MIT" ]
null
null
null
docs/scripts/docs/en/guide/kill-ie.md
balmjs/balm-f7
86832d2084e69f40d3b757905f1c01a6bf09348b
[ "MIT" ]
null
null
null
docs/scripts/docs/en/guide/kill-ie.md
balmjs/balm-f7
86832d2084e69f40d3b757905f1c01a6bf09348b
[ "MIT" ]
null
null
null
# Kill IE > Please `Copy` + `Paste` or customize yours, if your need - File: `/path/to/app/scripts/kill-ie.js` ```js import { detectIE } from 'balm-ui'; // Default Usage // OR // import detectIE from 'balm-ui/utils/ie'; // Individual Usage const IE = detectIE(); const isIE = IE && IE <= 11; const killIE = () => { let body = document.getElementsByTagName('body')[0]; let template = `<div class="kill-ie"> <h1>Your browser is out-of-date. Please <a href="https://browsehappy.com/">download</a> one of the up-to-date, free and excellent browsers for better security, speed and comfort.</h1> <p>Recommended Choice:<a href="https://www.google.com/chrome/">Chrome</a></p> </div>`; body.innerHTML = template; }; export { isIE, killIE }; ``` - File: `/path/to/app/scripts/main.js` ```js import { isIE, killIE } from './kill-ie'; if (isIE) { killIE(); } else { // your code } ``` - File: `/path/to/app/styles/_kill-ie.scss` ```scss .kill-ie { position: absolute; text-align: center; background-color: #bdbdbd; h1 { font-size: 36px; } p { font-size: 24px; } a { text-decoration: underline; color: red; font-weight: bold; } } ```
20.078125
191
0.576654
eng_Latn
0.342721
e5fc666982c58f6cd43ea3095b6e2eb162896f72
955
md
Markdown
windows-driver-docs-pr/debugger/bug-check-0xb1--bgi-detected-violation.md
Ryooooooga/windows-driver-docs.ja-jp
c7526f4e7d66ff01ae965b5670d19fd4be158f04
[ "CC-BY-4.0", "MIT" ]
null
null
null
windows-driver-docs-pr/debugger/bug-check-0xb1--bgi-detected-violation.md
Ryooooooga/windows-driver-docs.ja-jp
c7526f4e7d66ff01ae965b5670d19fd4be158f04
[ "CC-BY-4.0", "MIT" ]
null
null
null
windows-driver-docs-pr/debugger/bug-check-0xb1--bgi-detected-violation.md
Ryooooooga/windows-driver-docs.ja-jp
c7526f4e7d66ff01ae965b5670d19fd4be158f04
[ "CC-BY-4.0", "MIT" ]
null
null
null
--- title: Bug Check 0xB1 BGI_DETECTED_VIOLATION description: BGI_DETECTED_VIOLATION のバグ チェックでは、0x000000B1 の値を持ちます。 ms.assetid: B1DE8C2B-FBE3-4EFC-8DD8-4222AD5E1E36 keywords: - Bug Check 0xB1 BGI_DETECTED_VIOLATION - BGI_DETECTED_VIOLATION ms.date: 05/23/2017 topic_type: - apiref api_name: - BGI_DETECTED_VIOLATION api_type: - NA ms.localizationpriority: medium ms.openlocfilehash: 0bf45b29f05e7013c3b7d079a19d4658ff1faf25 ms.sourcegitcommit: d03b44343cd32b3653d0471afcdd3d35cb800c0d ms.translationtype: MT ms.contentlocale: ja-JP ms.lasthandoff: 07/02/2019 ms.locfileid: "67519021" --- # <a name="bug-check-0xb1-bgidetectedviolation"></a>バグ チェック 0xB1:BGI\_検出\_違反 BGI\_検出\_違反のバグ チェックが 0x000000B1 の値を持ちます。 > [!IMPORTANT] > このトピックはプログラマーを対象としています。 コンピューターを使用しているときに、エラー コードがブルー スクリーンが受信した顧客の場合を参照してください。[トラブルシューティング ブルー スクリーン エラー](https://www.windows.com/stopcode)します。 ## <a name="bgidetectedviolation-parameters"></a>BGI\_検出\_違反パラメーター なし
21.704545
146
0.806283
yue_Hant
0.663298
e5fc6aea6e9a471f4d181e5552767823e11617d9
262
md
Markdown
kubernetes/addons/ingress/nginx/README.md
npmmirror/lnmp
2b58ef0267f50984682c3cbb1aa04ad472c7f871
[ "Apache-2.0" ]
512
2017-09-22T16:20:15.000Z
2022-03-31T05:24:21.000Z
kubernetes/addons/ingress/nginx/README.md
npmmirror/lnmp
2b58ef0267f50984682c3cbb1aa04ad472c7f871
[ "Apache-2.0" ]
863
2017-09-12T00:52:03.000Z
2022-02-12T07:37:17.000Z
kubernetes/addons/ingress/nginx/README.md
npmmirror/lnmp
2b58ef0267f50984682c3cbb1aa04ad472c7f871
[ "Apache-2.0" ]
127
2017-10-13T17:38:10.000Z
2022-03-19T04:55:46.000Z
* https://github.com/kubernetes/ingress-nginx/tree/main/deploy/static/provider/cloud ```yaml - name: proxied-udp-53 port: 53 targetPort: 53 protocol: UDP nodePort: 53 - name: proxied-tcp-53 port: 53 targetPort: 53 protocol: TCP nodePort: 53 ```
17.466667
84
0.698473
kor_Hang
0.168645
e5fca79a9aaf43e50c2a06fee1f783bd4c176fb1
1,231
md
Markdown
CHANGELOG.md
lwblackledge/file-watchr
9217a0d988e960540614179a7ed0c2e7f573f24b
[ "MIT" ]
42
2015-05-09T15:40:01.000Z
2021-03-02T11:21:12.000Z
CHANGELOG.md
lwblackledge/file-watchr
9217a0d988e960540614179a7ed0c2e7f573f24b
[ "MIT" ]
39
2015-05-28T16:12:11.000Z
2019-05-14T17:47:37.000Z
CHANGELOG.md
lwblackledge/file-watchr
9217a0d988e960540614179a7ed0c2e7f573f24b
[ "MIT" ]
7
2016-04-18T17:45:48.000Z
2018-04-27T03:10:41.000Z
## 2.0.0 - Atom Compatibility Update * Switching to ES6 * Rewriting to accommodate changes in `atom/text-buffer` * Additional clarity on the WatchFile documentation (#35) * Bug fixes ## 1.1.0 - Adding Ignore All * Add an option to ignore all future changes on a file (during the session) * Bug fixes ## 1.0.0 - Mounted File Systems * Add an option to use polling on mounted file systems (experimental!) * Add a post-compare command to trigger another package after the compare is opened (e.g. split-diff) * Add an option to auto-reload - use at your own risk! * Bug fixes ## 0.4.0 - Add Prompt on Change * Allow users to also show the prompt when the file changes, even if there are no unsaved changes in Atom ## 0.3.1 - Add Compare Grammar support * Add grammar settings to the new buffer * credit to [@kankaristo](https://github.com/lwblackledge/file-watcher/issues/1#issuecomment-109119005) for change ## 0.3.0 - Add Compare * Allows users to compare the disk and memory version of the file ## 0.1.0 - Confirm implementation * Prompts for every file that has a conflict ## 0.0.2 - Initial single-file implementation * Shows a single prompt when one file changes ## 0.0.1 - Alpha * Added console logs when files change
35.171429
116
0.740861
eng_Latn
0.98634
e5fd1b0188962135c2edd287e9045803137ad64f
1,905
md
Markdown
files/en-us/web/css/-webkit-text-stroke-color/index.md
liannemarie/content
6d614dad93f3e0dfd6acd58a44fd0b35a0b0ba6c
[ "OML", "CECILL-B", "RSA-MD" ]
null
null
null
files/en-us/web/css/-webkit-text-stroke-color/index.md
liannemarie/content
6d614dad93f3e0dfd6acd58a44fd0b35a0b0ba6c
[ "OML", "CECILL-B", "RSA-MD" ]
null
null
null
files/en-us/web/css/-webkit-text-stroke-color/index.md
liannemarie/content
6d614dad93f3e0dfd6acd58a44fd0b35a0b0ba6c
[ "OML", "CECILL-B", "RSA-MD" ]
null
null
null
--- title: '-webkit-text-stroke-color' slug: Web/CSS/-webkit-text-stroke-color tags: - CSS - CSS Property - Non-standard - Reference - WebKit - recipe:css-property browser-compat: css.properties.-webkit-text-stroke-color --- {{CSSRef}}{{Non-standard_header}} The **`-webkit-text-stroke-color`** CSS property specifies the stroke [color](/en-US/docs/Web/CSS/color_value) of characters of text. If this property is not set, the value of the {{cssxref("color")}} property is used. ```css /* <color> values */ -webkit-text-stroke-color: red; -webkit-text-stroke-color: #e08ab4; -webkit-text-stroke-color: rgb(200, 100, 0); /* Global values */ -webkit-text-stroke-color: inherit; -webkit-text-stroke-color: initial; -webkit-text-stroke-color: unset; ``` ## Syntax ### Values - `<color>` - : The color of the stroke. ## Formal definition {{CSSInfo}} ## Formal syntax {{csssyntax}} ## Examples ### Varying the stroke color #### HTML ```html <p>Text with stroke</p> <input type="color" value="#ff0000"> ``` #### CSS ```css p { margin: 0; font-size: 4em; -webkit-text-stroke-width: 3px; -webkit-text-stroke-color: #ff0000; /* Can be changed in the live sample */ } ``` ```js hidden var colorPicker = document.querySelector("input"); colorPicker.addEventListener("change", function(evt) { document.querySelector("p").style.webkitTextStrokeColor = evt.target.value; }); ``` #### Results {{EmbedLiveSample("Varying_the_stroke_color", "500px", "100px")}} ## Specifications {{Specifications}} ## Browser compatibility {{Compat}} ## See also - [Surfin' Safari blog post announcing this feature](https://www.webkit.org/blog/85/introducing-text-stroke/) - [CSS-Tricks article explaining this feature](https://css-tricks.com/adding-stroke-to-web-text/) - {{cssxref("-webkit-text-fill-color")}} - {{cssxref("-webkit-text-stroke-width")}} - {{cssxref("-webkit-text-stroke")}}
20.706522
218
0.687664
yue_Hant
0.262544
e5fd8f4b4d683a9ab38431d90a08fcbf58176b9b
1,358
md
Markdown
README.md
mahmoudgalal/Irrlicht-Bullet-Integration
4c4ad2f5b2fea010b57f2ee70ba9e321d7c2de05
[ "W3C" ]
11
2018-11-09T02:34:43.000Z
2021-02-21T03:46:05.000Z
README.md
mahmoudgalal/Irrlicht-Bullet-Integration
4c4ad2f5b2fea010b57f2ee70ba9e321d7c2de05
[ "W3C" ]
null
null
null
README.md
mahmoudgalal/Irrlicht-Bullet-Integration
4c4ad2f5b2fea010b57f2ee70ba9e321d7c2de05
[ "W3C" ]
3
2019-11-10T23:32:03.000Z
2021-02-16T21:09:05.000Z
# Irrlicht-Bullet-Integration A <b>C++ Demos</b> showing how to integrate The [Irrlicht 3d](http://irrlicht.sourceforge.net/) engine with [Bullet](https://github.com/bulletphysics/bullet3) physics engine ### The demos shows the following: - Intializing / Deintializing the Bullet physics engine - Creating a RigidBody with collision shape. - Creating physics constraints and joints. - Creating a softbody - Simulating a vehicle ### How to build: - open the solution in Visual Studio and compile . You will need a pre-compiled bullet physics and irrlicht3d engine ### How to Use: <i>Basic Demo:</i> - Press C to drop a box. - Press H to Create a Chain. - Press E to Fire a box. - Press space to close. ![](https://github.com/mahmoudgalal/Irrlicht-Bullet-Integration/blob/master/irrlichtbullet.jpg) <i>Vehicle Demo:</i> - Press (W) to Move Forward - Press (S) to Move Backward - Press (D) to Turn Right - Press (A) to Turn Left - Click (E) to Throw a Box - Use Arrow Keys to move around. ![Vehicle Demo](https://github.com/mahmoudgalal/Irrlicht-Bullet-Integration/blob/master/media/Vehicle.png) <i>Softbody Demo:</i> - Click (C) to create a Curtain - Click (W) to Enable/Disable Wind - Click (E) to Throw a Box - Use Arrow Keys to move around ![Softbody Demo](https://github.com/mahmoudgalal/Irrlicht-Bullet-Integration/blob/master/media/softbody.png)
35.736842
173
0.742268
eng_Latn
0.548279
e5fdc90ce53572aad7268386c5e1714a425d59af
5,092
md
Markdown
benchmarks/system_profile_i9-9980XE.md
ba0f3/laser
28ece435589e2f4c2198142e0a3d7d9a5f2e4273
[ "Apache-2.0" ]
256
2018-10-25T10:20:51.000Z
2022-03-21T19:10:01.000Z
benchmarks/system_profile_i9-9980XE.md
ba0f3/laser
28ece435589e2f4c2198142e0a3d7d9a5f2e4273
[ "Apache-2.0" ]
30
2018-10-17T10:04:11.000Z
2019-11-10T09:31:55.000Z
benchmarks/system_profile_i9-9980XE.md
ba0f3/laser
28ece435589e2f4c2198142e0a3d7d9a5f2e4273
[ "Apache-2.0" ]
14
2018-11-05T17:01:43.000Z
2022-02-08T01:56:54.000Z
# Profile of my reference benchmark system i9-9980XE, Skylake-X, 18 cores with AVX512 support - All clock turbo: 4.1 Ghz - All AVX clock turbo: 4.0 Ghz - All AVX512 clock turbo: 3.5 Ghz - 2x FMA units per core # Theoretical performance - Theoretical peak GFlop/s - Cores: 18 - CpuGhz: 3.5 - VectorWidth: 16 - Instr/cycle: 2x FMA - Flop/Instr: 2 (FMA = 1 add + 1 mul) ==> 4032 GFlop/s # Performance report Measured by https://github.com/Mysticial/Flops/ ``` Running Skylake Purley tuned binary with 1 thread... Single-Precision - 128-bit AVX - Add/Sub GFlops = 32.704 Result = 4.19594e+06 Double-Precision - 128-bit AVX - Add/Sub GFlops = 16.4 Result = 2.06506e+06 Single-Precision - 128-bit AVX - Multiply GFlops = 32.736 Result = 4.17422e+06 Double-Precision - 128-bit AVX - Multiply GFlops = 16.368 Result = 2.07052e+06 Single-Precision - 128-bit AVX - Multiply + Add GFlops = 31.536 Result = 3.36271e+06 Double-Precision - 128-bit AVX - Multiply + Add GFlops = 15.768 Result = 1.67479e+06 Single-Precision - 128-bit FMA3 - Fused Multiply Add GFlops = 65.664 Result = 4.17071e+06 Double-Precision - 128-bit FMA3 - Fused Multiply Add GFlops = 32.832 Result = 2.08244e+06 Single-Precision - 256-bit AVX - Add/Sub GFlops = 64 Result = 8.26566e+06 Double-Precision - 256-bit AVX - Add/Sub GFlops = 32 Result = 4.08321e+06 Single-Precision - 256-bit AVX - Multiply GFlops = 64.032 Result = 8.16782e+06 Double-Precision - 256-bit AVX - Multiply GFlops = 32.016 Result = 4.06897e+06 Single-Precision - 256-bit AVX - Multiply + Add GFlops = 61.536 Result = 6.57213e+06 Double-Precision - 256-bit AVX - Multiply + Add GFlops = 30.768 Result = 3.27099e+06 Single-Precision - 256-bit FMA3 - Fused Multiply Add GFlops = 128.064 Result = 8.18976e+06 Double-Precision - 256-bit FMA3 - Fused Multiply Add GFlops = 64.032 Result = 4.09577e+06 Single-Precision - 512-bit AVX512 - Add/Sub GFlops = 112.128 Result = 1.42363e+07 Double-Precision - 512-bit AVX512 - Add/Sub GFlops = 56.064 Result = 7.07992e+06 Single-Precision - 512-bit AVX512 - Multiply GFlops = 112.128 Result = 1.42943e+07 Double-Precision - 512-bit AVX512 - Multiply GFlops = 56.064 Result = 7.14002e+06 Single-Precision - 512-bit AVX512 - Multiply + Add GFlops = 112.128 Result = 1.19709e+07 Double-Precision - 512-bit AVX512 - Multiply + Add GFlops = 56.064 Result = 5.97725e+06 Single-Precision - 512-bit AVX512 - Fused Multiply Add GFlops = 224.256 Result = 1.42891e+07 Double-Precision - 512-bit AVX512 - Fused Multiply Add GFlops = 112.128 Result = 7.14155e+06 Running Skylake Purley tuned binary with 36 thread(s)... Single-Precision - 128-bit AVX - Add/Sub GFlops = 588.8 Result = 7.49435e+07 Double-Precision - 128-bit AVX - Add/Sub GFlops = 294.992 Result = 3.76555e+07 Single-Precision - 128-bit AVX - Multiply GFlops = 590.4 Result = 7.53444e+07 Double-Precision - 128-bit AVX - Multiply GFlops = 295.296 Result = 3.76554e+07 Single-Precision - 128-bit AVX - Multiply + Add GFlops = 590.4 Result = 6.2638e+07 Double-Precision - 128-bit AVX - Multiply + Add GFlops = 295.248 Result = 3.13618e+07 Single-Precision - 128-bit FMA3 - Fused Multiply Add GFlops = 1181.09 Result = 7.52832e+07 Double-Precision - 128-bit FMA3 - Fused Multiply Add GFlops = 590.592 Result = 3.76499e+07 Single-Precision - 256-bit AVX - Add/Sub GFlops = 1151.42 Result = 1.46472e+08 Double-Precision - 256-bit AVX - Add/Sub GFlops = 575.52 Result = 7.3292e+07 Single-Precision - 256-bit AVX - Multiply GFlops = 1151.9 Result = 1.46865e+08 Double-Precision - 256-bit AVX - Multiply GFlops = 575.76 Result = 7.33665e+07 Single-Precision - 256-bit AVX - Multiply + Add GFlops = 1151.71 Result = 1.22439e+08 Double-Precision - 256-bit AVX - Multiply + Add GFlops = 575.808 Result = 6.12064e+07 Single-Precision - 256-bit FMA3 - Fused Multiply Add GFlops = 2302.66 Result = 1.46864e+08 Double-Precision - 256-bit FMA3 - Fused Multiply Add GFlops = 1151.42 Result = 7.34076e+07 Single-Precision - 512-bit AVX512 - Add/Sub GFlops = 2017.54 Result = 2.57166e+08 Double-Precision - 512-bit AVX512 - Add/Sub GFlops = 1008.38 Result = 1.28578e+08 Single-Precision - 512-bit AVX512 - Multiply GFlops = 2017.92 Result = 2.57183e+08 Double-Precision - 512-bit AVX512 - Multiply GFlops = 1009.54 Result = 1.28591e+08 Single-Precision - 512-bit AVX512 - Multiply + Add GFlops = 2019.46 Result = 2.14496e+08 Double-Precision - 512-bit AVX512 - Multiply + Add GFlops = 1009.54 Result = 1.07391e+08 Single-Precision - 512-bit AVX512 - Fused Multiply Add GFlops = 4036.61 Result = 2.57604e+08 Double-Precision - 512-bit AVX512 - Fused Multiply Add GFlops = 2018.3 Result = 1.2861e+08 ```
23.145455
56
0.661822
kor_Hang
0.265352
e5fdfbda520ae00ff235684ab586308f1d1cd237
434
md
Markdown
debs/README.md
mrts/docker-python-selenium-xvfb
6f8322a70331f6c01f79ebaa60625e7186e1dc7a
[ "MIT" ]
2
2017-08-21T07:33:47.000Z
2021-01-11T03:23:25.000Z
debs/README.md
mrts/docker-python-selenium-xvfb
6f8322a70331f6c01f79ebaa60625e7186e1dc7a
[ "MIT" ]
null
null
null
debs/README.md
mrts/docker-python-selenium-xvfb
6f8322a70331f6c01f79ebaa60625e7186e1dc7a
[ "MIT" ]
null
null
null
# Oracle drivers for Records Get the driver RPMs from official Oracle site or with `curl` below and convert them to DEBs with `alien -d *.rpm`. ## curling the RPMs (from unofficial location) curl -O http://repo.dlt.psu.edu/RHEL5Workstation/x86_64/RPMS/oracle-instantclient12.1-basic-12.1.0.1.0-1.x86_64.rpm curl -O http://repo.dlt.psu.edu/RHEL5Workstation/x86_64/RPMS/oracle-instantclient12.1-devel-12.1.0.1.0-1.x86_64.rpm
43.4
119
0.753456
eng_Latn
0.609606
e5fe2fbcfedda620bf8f4b01b35201f102290c68
782
md
Markdown
README.md
agners/hass-weather-srgssr
e6129cbc619042bcc52a16bf63cd215ce88ba76e
[ "MIT" ]
null
null
null
README.md
agners/hass-weather-srgssr
e6129cbc619042bcc52a16bf63cd215ce88ba76e
[ "MIT" ]
null
null
null
README.md
agners/hass-weather-srgssr
e6129cbc619042bcc52a16bf63cd215ce88ba76e
[ "MIT" ]
null
null
null
# Home Assistant SRG SSR Weather integration > IMPORTANT: The API has been deprecated in favour of a different one and I haven't updated yet. As such, this integration doesn't currently work! Brings [SRF Meteo](https://www.srf.ch/meteo) weather forecasts to your Home Assistant. Note that the SRG SSR APIs require a developer account. Follow the installation instructions shown in HACS or read the [info](info.md) file directly. ## Installation with HACS 1. Go to the HACS Settings and add the custom repository `siku2/hass-weather-srgssr` with category "Integration". 2. Open the "Integrations" tab and search for "SRG SSR Weather". 3. Follow the instructions there to set the integration up. ## Limitations The SRG SSR Weather API doesn't report humidity and air pressure.
41.157895
146
0.778772
eng_Latn
0.973493
e5fe8c90c9cd5ad78f6ad84f788a73f2266d3268
820
md
Markdown
react/hooks/useMemo.md
Jilesh-Soni/Daily-Learnings
e588e82300db948b4818e19e59bd0d104793ff42
[ "MIT" ]
null
null
null
react/hooks/useMemo.md
Jilesh-Soni/Daily-Learnings
e588e82300db948b4818e19e59bd0d104793ff42
[ "MIT" ]
null
null
null
react/hooks/useMemo.md
Jilesh-Soni/Daily-Learnings
e588e82300db948b4818e19e59bd0d104793ff42
[ "MIT" ]
null
null
null
# useMemo - any of the state changes - causes component to re render - re render means calling of all functions called in comp ## used when ? (benefit) - slow function => faster by storing the results in hashmap - for refernetial equality - value vs reference in js - comparing 2 variables in js it compares their reference in the case of obj & arrays - 2 obj with same values are still not equal ??? - so we can usememo here too somehow they refer the exact same object after using it - idk how ## how 1st one works ? - memoization - caching the value - no recomputation - input => output - key => value - it accepts a function which needs to be memoized ()=>slowFun() - & takes a dependancy array ## cons - performance & memory overheads - useMemo is called every single render - + caching
32.8
87
0.714634
eng_Latn
0.999518
e5feb2a2d690f33e36b2e618e3ca7667e2d20191
1,634
md
Markdown
dynamicsax2012-technet/responseerror-source-property-microsoft-dynamics-retail-ecommerce-sdk-services.md
MicrosoftDocs/DynamicsAX2012-technet
4e3ffe40810e1b46742cdb19d1e90cf2c94a3662
[ "CC-BY-4.0", "MIT" ]
9
2019-01-16T13:55:51.000Z
2021-11-04T20:39:31.000Z
dynamicsax2012-technet/responseerror-source-property-microsoft-dynamics-retail-ecommerce-sdk-services.md
MicrosoftDocs/DynamicsAX2012-technet
4e3ffe40810e1b46742cdb19d1e90cf2c94a3662
[ "CC-BY-4.0", "MIT" ]
265
2018-08-07T18:36:16.000Z
2021-11-10T07:15:20.000Z
dynamicsax2012-technet/responseerror-source-property-microsoft-dynamics-retail-ecommerce-sdk-services.md
MicrosoftDocs/DynamicsAX2012-technet
4e3ffe40810e1b46742cdb19d1e90cf2c94a3662
[ "CC-BY-4.0", "MIT" ]
32
2018-08-09T22:29:36.000Z
2021-08-05T06:58:53.000Z
--- title: ResponseError.Source Property (Microsoft.Dynamics.Retail.Ecommerce.Sdk.Services) TOCTitle: Source Property ms:assetid: P:Microsoft.Dynamics.Retail.Ecommerce.Sdk.Services.ResponseError.Source ms:mtpsurl: https://technet.microsoft.com/library/microsoft.dynamics.retail.ecommerce.sdk.services.responseerror.source(v=AX.60) ms:contentKeyID: 65317773 author: Khairunj ms.date: 05/18/2015 mtps_version: v=AX.60 f1_keywords: - Microsoft.Dynamics.Retail.Ecommerce.Sdk.Services.ResponseError.Source dev_langs: - CSharp - C++ - VB --- # Source Property [!INCLUDE[archive-banner](includes/archive-banner.md)] **Namespace:**  [Microsoft.Dynamics.Retail.Ecommerce.Sdk.Services](microsoft-dynamics-retail-ecommerce-sdk-services-namespace.md) **Assembly:**  Microsoft.Dynamics.Retail.Ecommerce.Sdk.Services (in Microsoft.Dynamics.Retail.Ecommerce.Sdk.Services.dll) ## Syntax ``` vb 'Declaration <DataMemberAttribute> _ Public Property Source As String Get Set 'Usage Dim instance As ResponseError Dim value As String value = instance.Source instance.Source = value ``` ``` csharp [DataMemberAttribute] public string Source { get; set; } ``` ``` c++ [DataMemberAttribute] public: property String^ Source { String^ get (); void set (String^ value); } ``` #### Property Value Type: [System.String](https://technet.microsoft.com/library/s1wwdcbf\(v=ax.60\)) ## See Also #### Reference [ResponseError Class](responseerror-class-microsoft-dynamics-retail-ecommerce-sdk-services.md) [Microsoft.Dynamics.Retail.Ecommerce.Sdk.Services Namespace](microsoft-dynamics-retail-ecommerce-sdk-services-namespace.md)
23.681159
131
0.766218
yue_Hant
0.54358
f90010343cd897213dcab2dadb909b66d91c8e9c
1,681
md
Markdown
content/en/docs/introduction/foreword.md
toubar/devpill.me
8e85aa349fa72c85ead301f0606500065f7a76ee
[ "MIT" ]
12
2022-03-08T20:19:31.000Z
2022-03-27T14:24:32.000Z
content/en/docs/introduction/foreword.md
toubar/devpill.me
8e85aa349fa72c85ead301f0606500065f7a76ee
[ "MIT" ]
18
2022-03-08T15:42:57.000Z
2022-03-28T04:40:48.000Z
content/en/docs/introduction/foreword.md
toubar/devpill.me
8e85aa349fa72c85ead301f0606500065f7a76ee
[ "MIT" ]
5
2022-03-12T17:07:31.000Z
2022-03-30T09:53:27.000Z
--- title : "Foreword" description: "What is this devpill.me all about?" lead: "" date: 2022-03-09T08:47:36+00:00 lastmod: 2022-03-09T08:47:36+00:00 draft: false images: [] weight: 10 --- Nowadays there are countless well-made resources on how to learn blockchain development of all kinds and with different specializations in mind, however, it is still very hard to get guidance and personalized suggestions based on your interests. I am writing this guide in order to provide an aggregator of all the resources that I've found over the years, plus give some opinionated commentary on how to approach them and how to use them in order to maximize learning and practical understanding in order to get building cool things in the space as soon as possible. This guide will focus on the Ethereum ecosystem as that's where most developers and applications are. If you are interested in other ecosystems that are non-EVM compatible and are not L2s on Ethereum, then check out their respective documentation or guides written by their developer communities. Examples of other non-EVM compatible blockchains that are popular are Solana (Rust/Anchor), Polkadot (Rust/Substrate), Cosmos, Terra, and others. Most of these blockchains do or will support the EVM stack through various initiatives like Neon EVM (Solana), Moonbeam/Moonriver (Polkadot/Kusama), EVMOS (Cosmos), etc. I really want this guide to become a community-sourced public good that everyone will be able to take advantage of. I will do my best to present it to the wider blockchain developer community to get constructive feedback, proofreading help, and insight into how to make it the best available guide available.
98.882353
612
0.798929
eng_Latn
0.999451
f90059a3c440f2086d4656361a3f536cfac43204
229
md
Markdown
README.md
squattydent/ServerInfo
1d084bab763bb45c95778b019ce93dbc51bae87f
[ "MIT" ]
1
2017-11-17T07:15:26.000Z
2017-11-17T07:15:26.000Z
README.md
squattydent/ServerInfo
1d084bab763bb45c95778b019ce93dbc51bae87f
[ "MIT" ]
null
null
null
README.md
squattydent/ServerInfo
1d084bab763bb45c95778b019ce93dbc51bae87f
[ "MIT" ]
null
null
null
# ServerInfo [MIT License](https://raw.githubusercontent.com/squattydent/ServerInfo/master/LICENSE "MIT License") ![alt text](https://raw.githubusercontent.com/squattydent/ServerInfo/master/screenshoot.jpg "Widget server info")
57.25
113
0.803493
yue_Hant
0.318672
f9013db7f29fabfeb4114dc88aed1f3b7bed7c7a
515
md
Markdown
jre/JRE_README.md
rquast/swingsane-package
886663ab7f7d631850139c4112256078e481d969
[ "Apache-2.0" ]
null
null
null
jre/JRE_README.md
rquast/swingsane-package
886663ab7f7d631850139c4112256078e481d969
[ "Apache-2.0" ]
null
null
null
jre/JRE_README.md
rquast/swingsane-package
886663ab7f7d631850139c4112256078e481d969
[ "Apache-2.0" ]
1
2022-03-28T08:42:44.000Z
2022-03-28T08:42:44.000Z
# Including the JRE tar bundles Download the Oracle JRE tar bundles from: [http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html](http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html) ## Download the following files: jre-8u31-linux-i586.tar.gz jre-8u31-macosx-x64.tar.gz jre-8u31-windows-x64.tar.gz jre-8u31-linux-x64.tar.gz jre-8u31-windows-i586.tar.gz Place in this jre directory or create symbolic links to the files if they are located elsewhere.
39.615385
212
0.796117
eng_Latn
0.618939
f9017b38e5fe50bf290ffbaae5a272c86c27c0ff
2,643
md
Markdown
data-explorer/kusto/query/not-has-operator.md
davidni/dataexplorer-docs
7421608fe70ab2fdc2077357c322db030d774174
[ "CC-BY-4.0", "MIT" ]
54
2020-05-18T14:26:20.000Z
2022-03-24T10:47:53.000Z
data-explorer/kusto/query/not-has-operator.md
davidni/dataexplorer-docs
7421608fe70ab2fdc2077357c322db030d774174
[ "CC-BY-4.0", "MIT" ]
920
2020-04-15T15:16:10.000Z
2022-03-31T17:07:55.000Z
data-explorer/kusto/query/not-has-operator.md
davidni/dataexplorer-docs
7421608fe70ab2fdc2077357c322db030d774174
[ "CC-BY-4.0", "MIT" ]
225
2020-04-14T19:35:54.000Z
2022-03-28T13:21:05.000Z
--- title: The case-insensitive !has string operators - Azure Data Explorer description: This article describes the case-insensitive !has string operator in Azure Data Explorer. services: data-explorer author: orspod ms.author: orspodek ms.reviewer: alexans ms.service: data-explorer ms.topic: reference ms.date: 09/19/2021 ms.localizationpriority: high --- # !has operator Filters a record set for data that does not have a matching case-insensitive string. The following table provides a comparison of the `has` operators: |Operator |Description |Case-Sensitive |Example (yields `true`) | |-----------|--------------|----------------|-------------------------| |[`has`](has-operator.md) |Right-hand-side (RHS) is a whole term in left-hand-side (LHS) |No |`"North America" has "america"`| |[`!has`](not-has-operator.md) |RHS isn't a full term in LHS |No |`"North America" !has "amer"`| |[`has_cs`](has-cs-operator.md) |RHS is a whole term in LHS |Yes |`"North America" has_cs "America"`| |[`!has_cs`](not-has-cs-operator.md) |RHS isn't a full term in LHS |Yes |`"North America" !has_cs "amer"`| > [!NOTE] > The following abbreviations are used in the table above: > > * RHS = right hand side of the expression > * LHS = left hand side of the expression For further information about other operators and to determine which operator is most appropriate for your query, see [datatype string operators](datatypes-string-operators.md). Case-insensitive operators are currently supported only for ASCII-text. For non-ASCII comparison, use the [tolower()](tolowerfunction.md) function. ## Performance tips > [!NOTE] > Performance depends on the type of search and the structure of the data. For faster results, use the case-sensitive version of an operator, for example, `has_cs`, not `has`. If you're testing for the presence of a symbol or alphanumeric word that is bound by non-alphanumeric characters at the start or end of a field, for faster results use `has` or `in`. For best practices, see [Query best practices](best-practices.md). ## Syntax *T* `|` `where` *col* `!has` `(`*expression*`)` ## Arguments * *T* - The tabular input whose records are to be filtered. * *col* - The column to filter. * *expression* - Scalar or literal expression. ## Returns Rows in *T* for which the predicate is `true`. ## Example <!-- csl: https://help.kusto.windows.net/Samples --> ```kusto StormEvents | summarize event_count=count() by State | where State !has "NEW" | where event_count > 3000 | project State, event_count ``` **Output** |State|event_count| |-----|-----------| |TEXAS|4,701| |KANSAS|3,166|
34.324675
183
0.697692
eng_Latn
0.978381
f901c3314e1cd62427922b5bb45a4554ec1271cc
126
md
Markdown
DevChangelog/Update_0.0.4.0.md
Team-on/LD45
2daa2d1af9f219c647871bbb7c635a5552f4c8f6
[ "MIT" ]
5
2019-11-01T03:54:26.000Z
2020-03-16T08:06:10.000Z
DevChangelog/Update_0.0.4.0.md
Team-on-gamejams/Cave
2daa2d1af9f219c647871bbb7c635a5552f4c8f6
[ "MIT" ]
null
null
null
DevChangelog/Update_0.0.4.0.md
Team-on-gamejams/Cave
2daa2d1af9f219c647871bbb7c635a5552f4c8f6
[ "MIT" ]
2
2020-04-08T20:47:30.000Z
2020-07-24T01:16:33.000Z
[Team] [FTR] Add dwarf animations [Team] [FTR] Create simple scene [Team] [FTR] How To Play window [Team] [FTR] Credits window
31.5
33
0.722222
eng_Latn
0.438515
f901cf1e20d7d074b3d52e1a09c83e81b68f5879
78
md
Markdown
content/blog/jjameson/2012/02/19/_index.md
technology-toolbox/website
9d845dc68e650ee164959da418fde24eacecf1c9
[ "MIT" ]
null
null
null
content/blog/jjameson/2012/02/19/_index.md
technology-toolbox/website
9d845dc68e650ee164959da418fde24eacecf1c9
[ "MIT" ]
109
2021-03-25T11:16:17.000Z
2022-01-23T20:55:51.000Z
content/blog/jjameson/2012/02/19/_index.md
technology-toolbox/website
9d845dc68e650ee164959da418fde24eacecf1c9
[ "MIT" ]
null
null
null
--- title: "February 19, 2012 Blog Posts" date: 2012-02-19T00:00:00-07:00 ---
15.6
37
0.653846
yue_Hant
0.302808
f902c7c1d4640884f3d5bbc033696ade413d04e0
28,741
md
Markdown
docs/SETUP-FULL.md
ucsb-cs156-f20/ucsb-courses-search
c1dd2295a535097814cfdbe650aef9bc1079558c
[ "MIT" ]
3
2021-05-10T11:14:36.000Z
2021-05-24T18:36:36.000Z
docs/SETUP-FULL.md
ucsb-cs156-s21/proj-ucsb-courses-search
9a82302992a87f0db676c0e87771aeef84069181
[ "MIT" ]
156
2021-04-24T22:17:12.000Z
2022-02-02T01:37:03.000Z
docs/SETUP-FULL.md
ucsb-cs156-f20/ucsb-courses-search
c1dd2295a535097814cfdbe650aef9bc1079558c
[ "MIT" ]
5
2021-05-08T16:05:36.000Z
2022-03-11T00:18:58.000Z
# ./docs/SETUP_FULL.md These instructions are the full version of the setup instructions. If this is your first time working with setting up a Spring Boot / React application for this course, you should follow these instructions. You may follow the [SETUP-QUICKSTART.md](./SETUP-QUICKSTART.md) version instead if: * You've already been through the full instructions at least once * You already have an Auth0 account with a tenant * You already have Google Developer Project set up on your Google account # What setup enables you to do To get started with this application, you'll need to be able to * Run it locally (i.e. on localhost) * Deploy it to Heroku These instructions cover this setup. There are separate instructions in the file [./github-actions-secrets.md](./github-actions-secrets.md) for: * Getting the test cases running on GitHub Actions * Seeing aggregrated code coverage statistics on Codecov # List of integrations This application has integrations with the following third-party services that require configuration * Auth0.com (for authentication) * Google (for authentication) * A postgres database provisioned on Heroku * UCSB Developer API <https://developer.ucsb.edu/> * MongoDB Database provisioned at <https://cloud.mongodb.com/> ## Step 0: Get Organized You are going to need to keep track of a few values that you are going to need to copy/paste into various places. Therefore, we suggest that you copy and paste the following table into a file in your editor, and fill in the values on the right hand side as we define them. We'll call this: `temp-credentials.txt` Example `temp-credentials.txt` ``` heroku.app: heroku.url: auth0.tenant: auth0.domain: auth0.clientId: google.clientId: google.clientSecret: ``` Note that some of these values, if they leak into public GitHub repos, could be used to compromise the integrity of your account, Some of these values are things that you *should not commit into a GitHub repo*, and should not be put into a file that you save inside your repo. Make this a temporary file that you have open just while working on the app. We have put the name `temp-credentials.txt` into the `.gitignore` of this repo to avoid a scenario where you accidentally commit this file to the repo. Note that the file `temp-credentials.txt` in this instructions is for helping you keep track of things only, and *has no effect* on your actual application. ## Step 1: Choose an application name. We ask you to choose a heroku app name even before getting started with configuring the app localhost, because then we can do the set up on Auth0 and Google just once, instead of having to revisit it multiple times. Therefore, the first step is to choose a Heroku application name. You should do this even if you plan, right now, only to get the application running on localhost. Login to Heroku.com and choose an application name. To avoid name collisions with other students, we suggest that your application name be `project-name-ucsbnetid` where * `project-name` is either the name of the course assignment, the name of the repo, or if needed, an abbreviated name of the repo * `ucsbnetid` is your UCSBNetId, i.e. the part of your `@ucsb.edu` email address that comes before `@ucsb.edu` There is a limit of 30 characters on application names in Heroku, so if necessary, abbreviate parts of your app name: Examples: * `jpa03-cgaucho` * `ucsb-courses-search-cgaucho` * `demo-spring-react-min-cgaucho` * `dsr-min-cgaucho` Make the following adjustments to your `ucsbnetid`: * upper case letters become lowercase (e.g `Gaucho4Life` becomes `gaucho4life`) * underscores become hyphens (e.g. `Del_Playa` becomes `del-playa`) * dots become hyphens (`Chris.Gaucho` becomes `chris-gaucho`) Enter your app name into Heroku.com to create a new application as shown below. If your app name is, for example, `dsr-min-cgaucho`, then the eventual URL of this application is now, for example `https://dsr-min-cgaucho.herokuapp.com` ![Create new app on Heroku](./images/heroku-new-app.gif) Then enter this name for the value `heroku.app` in your `temp-credentials.txt`, and enter the full url for `heroku.url` so that the file looks something like this: ``` heroku.app: dsr-min-cgaucho heroku.url: https://dsr-min-cgaucho.herokuapp.com auth0.tenant: auth0.domain: auth0.clientId: ``` ## Step 2: Create an Auth0.com Account and/or Tenant Creating an Auth0 account is a one-time setup step for the entire course. Auth0.com is a third-party service that developers manage authentication in their apps. We'll be using that in this course. To set up Auth0, visit <https://auth0.com> and sign in using Google Authentication, and your UCSB email address. * Why my UCSB email address? Because when we manage shared applications later in the quarter, it will be much easier if we are all using a consistent, predictable account. The staff and your fellow team members can look you up by your UCSB email address, while if you use something else, that's a lot harder to do, which makes configuring shared access a lot harder to manage. If you are new to Auth0, you should then be asked to create your first _tenant_. Setting up a new Auth0 tenant is typically done just once per course for your individual work, and then possibly later for work you do in your team. A default name for your new _tenant_ is shown, something like `dev-krn9map` (yours will be different.) We are doing to suggest changing that name as explained below; but first let's understand what a _tenant_ is in Auth0. A _tenant_ in Auth0 is simply a group of related applications. For example, you can create separate _tenants_ for: * all the individual work you do in your Auth0 account for this course * all the work your team does as a team * work you might do on a separate personal project for a Hackathon Each of these _tenants_ can be managed separately, and access to them can be shared (or not) separately from one another. Please call your first tenant: `ucsb-cs156-cgaucho` where `cgaucho` is your ucsb email address (modified in the same way as we do for Heroku app names, i.e. all lowercase, and dots/underscore replaced with hyphens). Here's what that looks like: ![rename first auth0 tenant](./images/auth0-first-tenant.gif) If already have an Auth0 account, or went past this step without giving your first tenant this name, no problem. You can create a new tenant as shown below, and give it the correct name (Note that it is [*not possible* to "rename a tenant" in Auth0](https://community.auth0.com/t/any-way-to-change-a-tenant-name/44193)). ![new auth0 tenant](./images/auth0-new-tenant.gif) As you can see it is possible to switch tenants at any time using the menu options at the upper right hand corner of the Auth0.com website. You will need the name of your tenant (e.g. `ucsb-cs156-cgaucho`) for subsequent steps, so let's put that in our `temp-credentials.txt` file as the value for `auth0.tenant`. If you've been following up to this point, you should have value like this in your `temp-credentials.txt`: ``` heroku.app: dsr-min-cgaucho heroku.url: https://dsr-min-cgaucho.herokuapp.com auth0.tenant: ucsb-cs156-cgaucho auth0.domain: auth0.clientId: google.clientId: google.clientSecret: app.ucsb.api.consumer_key: spring.data.mongodb.uri: ``` ## Step 3: Set up new Auth0 application The next step is to set up a new Auth0 application. While logged in to Auth0.com, with the correct tenant selected, navigating to the "Applications" page in the sidebar and clicking the "Create Application" button. Name your application that same thing as you named your heroku application (e.g. when you put in a name, make it the same name as what you put in for `heroku.app` in your `temp-credentials.txt`. Select "Single Page Application" as the application type, and click "Create". You'll be shown a screen under the "Quick Start" tab where it asks you to select what technology you are using. *You may skip this step*. Instead, in the configuration for the application you just created, click on the "Settings" tab and scroll down to the section with the heading `Application URIs`, and fill in the following values in the appropriate fields. _Errors at this step are responsible for most of the problems students run into, so do this step carefully_. Note the following: * The URL values that include the word `localhost` start with `http`, while the ones that contain `herokuapp` start with `https`. * The value `ucsb-cgaucho-dsr-minimal` should be replaced in EVERY case with the actual value you used for `heroku_app_name` in your `temp-credentials.txt`; it should not literally be `ucsb-cgaucho-dsr-minimal`. * It is important to copy these values accurately; any small typo here can result into errors that are very annoying to debug. So do this step _carefully_. | Field | Value | | --------------------- | -------------------------------------------- | | Allowed Callback URLs | http://localhost:3000, http://localhost:8080, https://dsr-min-cgaucho.herokuapp.com | | Allowed Logout URLs | http://localhost:3000, http://localhost:8080, https://dsr-min-cgaucho.herokuapp.com | | Allowed Web Origins | http://localhost:3000, http://localhost:8080, https://dsr-min-cgaucho.herokuapp.com | Make sure to scroll down and click "Save Changes" at the bottom of the page. Now, in the "Connections" tab of **your app** (not from the sidebar) - Uncheck Username-Password-Authentication. - Ensure `google-oauth2` is checked (it should be by default). See image below for an example of what it should look like. ![Auth0 Connections Settings](./images/auth0-connections-settings.png) Next, go back to the Settings tab of your app (the same tab where you entered the callback URIs). At this point, you should be able to find the value for for `Domain` and `Client ID`, and use these to fill in the values for `auth0.domain` and `auth0.clientId` in your `temp-credentials.txt` file. * The value of the `Domain` field should be something like `ucsb-cs156-cgaucho.us.auth0.com`, where `ucsb-cs156-cgaucho` is the name of your Auth0 tenant. - Copy this value into your `temp-credentials.txt` file as the value for `auth0.domain`. * The value of the `Client ID` field should be a alphanumeric string, something like: `6KoPsWMM2A27PjAejHHWTXApra8CVQ6C`. - Copy this value into your `temp-credentials.txt` file as the value for `auth0.clientid`. Your `temp-credentials.txt` file should now look something like this: ``` heroku.app: dsr-min-cgaucho heroku.url: https://dsr-min-cgaucho.herokuapp.com auth0.tenant: ucsb-cs156-cgaucho auth0.domain: ucsb-cs156-cgaucho.us.auth0.com auth0.clientid: 6KoPsWMM2A27PjAejHHWTXApra8CVQ6C google.clientId: google.clientSecret: app.ucsb.api.consumer_key: spring.data.mongodb.uri: ``` ## Step 4: Set up an API under Auth0 The next step is to create an API under Auth0. To do this, go to the sidebar in Auth0, and locate the `APIs` tab. You should see (at least) one API listed, namely the `Auth0 Management API`. This API is used to manage all other APIs, so we'll create an API that is specific to just our application. First, click on the `Create API` button. Next, fill in the fields as follows: | Field name | Value | Description | |------------|-------|-------------| | Name | The name of your application | This is just a visual name for the Auth0 API of your application, and in principle it could be anything. But to help keep things organized, we'll use the same value that we used for the `heroku.app`, Example `dsr-min-cgaucho`| | Identifier | Copy your full heroku url into this field; e.g. `https://dsr-min-cgaucho.herokuapp.com` | This will end up serving as the "audience" value, the "key" that identifies custom claims in the JWT token. | | Signing algorithm | RS256 | This determines what cryptographic algorithm is used to verify tokens. The standard is RS256, so we use that here | It should end up looking like the below image (with your application name): ![Auth0 API setup](./images/auth0-api-setup.png) Hit `Create` to create your API. ## Step 5: Set up new Google OAuth Application (once per Auth0 tentant) (NOTE: This step only has to be done *once per Auth0 tenant*, not once per application. So if this is the first application you are setting up for this Auth0 tenant, you need to do this step in full. Otherwise, you can simply reuse the credentials from the Google OAuth Application you already set up for this Auth0 tenant. It is for this reason that we recommend naming the Application the same thing as your Auth0 tenant.) Because UCSB uses Google Gmail as an email provider for all students, staff and faculty, we can depend on the fact that every member of the UCSB community has the ability to authenticate through Google. For that reason, we use Google Authentication via a protocol called "OAuth" in many appllications we develop in this course. To get started with Google Authentication, you need to login with a Google Account; for a variety of reasons, we suggest that you use your UCSB Google Account for this purpose. * Here's why: the course staff are in a better position to help you troubleshoot when we are able to look up your username--which we can do with your UCSB username. The instructions below are based on the instructions <a href="https://developers.google.com/identity/sign-in/web/sign-in" target="_blank">here</a>. You'll need the values from your `temp-credentials.txt` file for: * `heroku.app` (e.g. `dsr-min-cgaucho`) * `auth0.tenant` (e.g.`ucsb-cs156-cgaucho`) * `auth0.domain` (e.g. `ucsb-cs156-cgaucho.us.auth0.com`) so, have those handy. 1. Navigate to page <a href="https://developers.google.com/identity/sign-in/web/sign-in" target="_blank">Google OAuth Instructions</a> and click where it says "Go to the Credentials Page". 2. When you land on this page, if you haven't already done so, click as shown in the following animation to create a new project. Please call your project `cmpsc156-yourUCSBNetID`, and for the "location", select `ucsb.edu`, then `UnPaid`, as shown here: ![New Google API Project](./images/google-api-create-new-project.gif) Or, if you already have a `cmpsc156-yourUCSBNetID` project, select that project. 2. Click `Create credentials > OAuth client ID.` 3. For the `User Type`, click `Internal` then click `Create` 4. For the `App Name`, enter your the value you chose for `heroku.app`, e.g. `dsr-min-cgaucho` 5. For the `User Support Email` and `Developer Contact Info` put in your own `@ucsb.edu` email address. You can leave the other fields with their default values. 6. There is a button to "Add or Remove Scopes". Please click the buttons beside `auth/userinfo/email` and `auth/userinfo/profile`, then click `Update` 7. Return to the screen where you can click to `Create credentials > OAuth client ID.` 8. You should now be asked to select an application type; choose `Web application` 9. Name your OAuth 2.0 client using the same name as your `auth0.tenant` (e.g. `ucsb-cs156-cgaucho`). Since you only need one client per Auth0 tenant, it makes sense to give these the same name. 10. Add an authorized JavaScript origin with the value `https://insert-your-auth0-domain-here`, substituting in the value of `auth0.domain` prefixed with `https://`, e.g. `https://ucsb-cs156-cgaucho.us.auth0.com` 11. Add an authorized redirect URI, with the value `https://insert-your-auth0-domain-here/login/callback`, substituting in the value of `auth0.domain` prefixed with `https://`, and suffixed with `/login/callback/` e.g. `https://ucsb-cs156-cgaucho.us.auth0.com/login/callback` It should look something like this: ![](./images/google-create-oauth-client.png) 12. Scroll down and click "Create" to create your Google OAuth App. 13. You should see a pop-up with a "Client ID" and "Client Secret". Copy these values into your `temp-credentials.txt` as the values of `google.clientId` and `google.clientSecret`. You'll need these in a later step. ## Step 6: Set up new Auth0 Social Login Connection (once per Auth0 tentant) Now, return to the browser tab open to your Auth0 application. - One point to clear up: There are two client id and client secret pairs floating around here; one for the Auth0 application, and another for the Google API. Don't be confused. Right now, we are working with the Google client id and client secret. - Navigate to the "Connections -> Social" page in the sidebar of the Auth0.com web interface, as shown in the image below. - Click on "Google" and fill in the "Client ID" and "Client Secret" from the values of `google.clientId` and `google.clientSecret` that you put into your `temp-credentials.txt` file in the previous step. - Make sure to scroll down and click "Save Changes" at the bottom of the dialog to save your changes. When you have completed this step, you may return to the main instructions in the [../README.md](../README.md) to continue. ![auth0 connections social](./images/auth0-connections-social.png) ## Step 7: Setting up Custom Claims in Auth0 **Introduction** JWT User Access Tokens are base-64 encoded JSON objects: within these json objects there are some keys and fields that are expected to be there. If you want to add additional keys and values, these are called _custom claims_. We can provide Auth0 with some JavaScript code that will insert custom values into the JWT token provided to our application for authentication. The keys for custom claims must begin with a unique value. This makes sure that claims from one application don't interfere with claims from another application. For our key, we are using the name of our Heroku app; this is the "audience" value for our custom claim. The specific "custom claims" we need for our application are * email * first name (given name) * last name (family name) These are values we can get from the authentication provider (i.e. from Google, via Auth0), and then access in our application. If your application is mostly working properly, but does not load a user's _role_ properly, this is often a symptom that the following step was not done properly. **Instructions** In Auth0.com go to the left hand sidebar and click `Rules`, then click `Create Rule`. Select `Empty Rule` at the top. There is a function that takes a user, a context, and a callback. Context has an access token as a property. User has all of the user information. We want to add a property to `context.accessToken`. To do this, add the following code, _being sure to change_ where it says `""https://dsr-min-cgaucho.herokuapp.com""`, replacing that with your value for the name of your heroku app (the value of `heroku.url` in your `temp-credentials.txt` file). If this does not match the values that you fill in later for `REACT_APP_AUTH0_AUDIENCE` (which we should also be the value of `heroku.app` in your `temp-credentials.txt` file) then things will not work properly. Insert this code into the template for the custom claim, replacing the line that says: `// TODO: implement your rule` ```javascript context.accessToken["https://dsr-min-cgaucho.herokuapp.com"]={ "email" : user.email, "given_name" : user.given_name, "family_name" : user.family_name }; ``` The whole thing should look something like this when you are done: ```javascript function (user, context, callback) { context.accessToken["https://dsr-min-cgaucho.herokuapp.com"]={ "email" : user.email, "given_name" : user.given_name, "family_name" : user.family_name }; return callback(null, user, context); } ``` ## Step 8: Custom configuration for this app Steps 1-7 and Step 9 are generally the same for all applications in this course. Step 8 is where we put special configuration that is particular this this application. ## Step 8a: UCSB Developer API Key See the top level README.md for details about how to set the value of `app.ucsb.api.consumer_key:` in `temp-credentials.txt` ## Step 8b: MongoDB Database credentials See the top level README.md for details about how to set the value of `spring.data.mongodb.uri:` in `temp-credentials.txt` ## Step 9: Set up the secrets files There are now three files that you have to configure in your app&mdash;two for the frontend, and two for backend. | Filename | Layer | Purpose | |-|-|-| | `./secrets-localhost.properties` | backend (Java, Spring) | Sets properties used by the backend Java code when running on localhost | | `./secrets-heroku.properties` | backend (Java, Spring) | Used as a source for copying properties to the Heroku backend config var `SPRING_PROPERTIES` by the python script `setHerokuVars.py` (more detail below)| | `./javascript/.env.local` | frontend (JavaScript, React) | Used by the frontend JavaScript code to set properties | Some of the values in each of these files are considered _secrets_, i.e. token values that similar to passwords. These values can be used to compromise the security of your system; accordingly they should * not be hardcoded in Java or JavaScript source code * not be stored in files in your GitHub repo (since many of our repos are open source.) Accordingly, in the repo, you will only find `.SAMPLE` versions of these file: | Sample filename | Actual filename | |-|-| | `secrets-localhost.properties.SAMPLE` | `secrets-localhost.properties` | | `secrets-heroku.properties.SAMPLE` | `secrets-heroku.properties` | | `javascript/.env.local.SAMPLE` | `javascript/.env.local` | In each case, you will need to copy from the `.SAMPLE` version of the file to the actual filename, and then edit the file to put in the correct values. We'll do this first for the files needed to run on localhost, and then on the files needed for Heroku. ### Step 9a: Set up the secrets files for localhost For localhost, copy from the `.SAMPLE` files to the actual files needed for the application. From the root of the repo: ``` cp secrets-localhost.properties.SAMPLE secrets-localhost.properties cp javascript/.env.local.SAMPLE javascript/.env.local ``` Now, you will edit the `secrets-localhost.properties` file with your preferred text editor, and fill in the values as shown below: | Key | Example value | Explanation | Copy from corresponding value in `temp-credentials.txt` for | |-----|---------------|-------------|---| | `app.namespace` | `https://dsr-min-cgaucho.herokuapp.com` | The name you gave to your app on Heroku | `heroku.url` | | `app.admin.emails` | `phtcon@ucsb.edu,youremail@ucsb.edu` | A comma separated list of emails for admins for the app. Add your email. | (none) | | `auth0.domain` | `ucsb-cs156-cgaucho.us.auth0.com` | The DNS hostname used to access Auth0 services; starts wtih the name of your tenant, and ends with something like `.us.auth0.com` | `auth0.domain` | | `auth0.clientId` | `6KoPsWMM2A27PjAejHHWTXApra8CVQ6C` | The value that identifies the specific Auth0 application from your tenant | `auth0.clientId` | | `app.ucsb.api.consumer_key` | | Key for UCSB Developer API| `app.ucsb.api.consumer_key` | | `spring.data.mongodb.uri` | | URI for accessing MongoDB data | `spring.data.mongodb.uri` | | `security.oauth2.resource.id` | `https://dsr-min-cgaucho.herokuapp.com` | Copy the same value as `app.namespace` | `heroku.url` | |`security.oauth2.resource.jwk.keySetUri`| (no change)| Leave unchanged from value in `.SAMPLE` file | | Next, you will edit the `javascript/.env.local` file with your preferred text editor, and fill in the values as shown below: | Key | Example value | Explanation | Copy from corresponding value in `temp-credentials.txt` for | |-----|---------------|-------------|---| |`REACT_APP_AUTH0_DOMAIN`| `ucsb-cs156-cgaucho.us.auth0.com` | The DNS hostname used to access Auth0 services; starts wtih the name of your tenant, and ends with something like `.us.auth0.com` | `auth0.domain` | |`REACT_APP_AUTH0_CLIENT_ID`| `6KoPsWMM2A27PjAejHHWTXApra8CVQ6C`| The value that identifies the specific Auth0 application from your tenant | `auth0.clientId` | |`REACT_APP_AUTH0_AUDIENCE`| `https://dsr-min-cgaucho.herokuapp.com` | The name you gave to your app on Heroku (used here to identify which Auth0 API we are using)`heroku.url` | At this point, you should be able to run the app on localhost with the command: ```bash mvn spring-boot:run ``` ### Step 9b: Set up the secrets files for Heroku For Heroku, copy from the `.SAMPLE` file the backend file to the actual file: ``` cp secrets-heroku.properties.SAMPLE secrets-heroku.properties ``` We'll update that file in a moment. First, let's note that while some repos set up for this course might have a file `javascript/.env.production.SAMPLE`, it is actually not necessary to have a separate `.env.production` file. For the frontend code, if you have a `.env.local` file defined, and if the values that will be used on Heroku are the same as those used on localhost, it is not necessary to have a separate `.env.production` file. The details are explained here: <https://create-react-app.dev/docs/adding-custom-environment-variables/)>. Now, let us return to updating the values in the secrets-heroku.properties file. First, all of the following variables should be set up *exactly* as they are in the `secrets-localhost.properties` file. So it's best to just copy/paste this entire section: ``` app.namespace app.admin.emails auth0.domain auth0.clientId app.ucsb.api.consumer_key spring.data.mongodb.uri security.oauth2.resource.id security.oauth2.resource.jwk.keySetUri ``` The remainder of the values should typically be unmodified. That includes all of the following: ``` spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect spring.datasource.driver-class-name = org.postgresql.Driver spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false spring.datasource.url=${JDBC_DATABASE_URL} spring.datasource.username=${JDBC_DATABASE_USERNAME} spring.datasource.password=${JDBC_DATABASE_PASSWORD} spring.jpa.hibernate.ddl-auto=update ``` Now, it is important to note that when running on Heroku, the backend gets its properties values from the Heroku config variable `SPRING_PROPERTIES`, _not_ directly from the `secrets-heroku.properties` file. The purpose of the `secrets-heroku.properties` is to initialize the values of the Heroku Config variable `SPRING_PROPERTIES` via the Python script `./setHerokuVars.py`. Therefore, once the file `secrets-heroku.properties` is properly configured, the next step is to login to the Heroku CLI. * If you are on CSIL, use `heroku login -i` * If you are working on your own machine, installation instructions are here: <https://devcenter.heroku.com/articles/heroku-cli>. You should then be able to do `heroku login` or `heroku login -i` to login. Once you are logged into the Heroku CLI, you should be able to run the script to set the variables to the values from your `secrets-heroku.properties` file using the script `./setHerokuVars.py`, as shown below. You will need to specify the name of your own Heroku app; the value `ucsb-cs156-dsr-minimal` is just an example. This is the value of `heroku.app` from your `temp-credentials.txt` file: ```bash python3 setHerokuVars.py ucsb-cs156-dsr-minimal ``` Note that the first line of this command might be `python3` or simply `python`, depending on your particular operating system and installation of Python. If you are not sure, use `python -v` or `python3 -v` to see which command gives you some version of Python 3. After doing this, if you visit you app on the Heroku dashboard (<https://dashboard.heroku.com>), go to the Settings tab, click "Reveal Config Vars", and look for the value of the variable `SPRING_PROPERTIES`, you should see the values from your file reflected there. | At this point, if you deploy the main branch of your repo on Heroku, the app should load. If instead, you get `Application Error` when opening the page, before you'll need to consult the logs to debug the problem; _however_, if this is your first deploy, try simply redeploying once. Our experience has been that sometimes on the very _first_ deploy to Heroku, the database connection is not properly established, but this problem corrects itself on the second deploy. If after the second deploy attempt you are still getting `Application Error` when loading the app, you'll need to consult the logs for further debugging. You can see these either through the Heroku Dashboard, or at the command line if you have the Heroku CLI installed. The command is: `heroku logs --app APP-NAME-ON-HEROKU`.
51.785586
512
0.753279
eng_Latn
0.994889
f903bf2450c38fba82df234a8e3020e1720c4a04
376
md
Markdown
README.md
ErikRosengren/CppLog
97d01d6f155e6126e2e7906a43df033ec895e8f2
[ "MIT" ]
1
2020-01-30T19:54:05.000Z
2020-01-30T19:54:05.000Z
README.md
ErikRosengren/CppLog
97d01d6f155e6126e2e7906a43df033ec895e8f2
[ "MIT" ]
null
null
null
README.md
ErikRosengren/CppLog
97d01d6f155e6126e2e7906a43df033ec895e8f2
[ "MIT" ]
null
null
null
# CppLog A very simple logging implementation with coloured output and log to file support. ## Settings Changing file path, log level, colours or disabling file logging can be done in the header file. ## Samples ### Terminal output: ![](images/terminal-output.png) ### Log file content ![](images/log-file.png) NOTE: Colours come from vim's default syntax highlighting.
26.857143
97
0.75
eng_Latn
0.928791
f903da7cda6a96e474eb0a072fb6ea61e2d73bca
1,160
md
Markdown
AlchemyInsights/invalid-file-names-in-onedrive.md
isabella232/OfficeDocs-AlchemyInsights-pr.ro-RO
03015a129e62a25629e7430f7fa7208c74a08ad7
[ "CC-BY-4.0", "MIT" ]
3
2020-05-19T19:07:36.000Z
2021-11-10T22:45:21.000Z
AlchemyInsights/invalid-file-names-in-onedrive.md
MicrosoftDocs/OfficeDocs-AlchemyInsights-pr.ro-RO
7e915e888b922fd3272e8c1a0781a3b3373d8082
[ "CC-BY-4.0", "MIT" ]
3
2020-06-02T23:26:32.000Z
2022-02-09T06:55:22.000Z
AlchemyInsights/invalid-file-names-in-onedrive.md
isabella232/OfficeDocs-AlchemyInsights-pr.ro-RO
03015a129e62a25629e7430f7fa7208c74a08ad7
[ "CC-BY-4.0", "MIT" ]
2
2019-10-09T20:32:20.000Z
2020-06-02T23:26:01.000Z
--- title: Numele de fișiere nevalide din OneDrive ms.author: matteva author: pebaum manager: scotv ms.date: 04/21/2020 ms.audience: Admin ms.topic: article ms.service: o365-administration ROBOTS: NOINDEX, NOFOLLOW localization_priority: Normal ms.collection: Adm_O365 ms.custom: '' ms.assetid: 1e27cb97-e3e5-4533-9f49-585b63399fb5 ms.openlocfilehash: 2564d25d9385e629ead0fd5af7e178f9d73cfd766c672fa31abc493185786c76 ms.sourcegitcommit: b5f7da89a650d2915dc652449623c78be6247175 ms.translationtype: MT ms.contentlocale: ro-RO ms.lasthandoff: 08/05/2021 ms.locfileid: "54088120" --- # <a name="invalid-file-and-folder-names-in-onedrive-and-sharepoint"></a>Numele nevalide de fișiere și foldere OneDrive și SharePoint Aceste caractere nu sunt permise în numele de fișiere și foldere " \* : \< \> ? / \ | Unele organizații nu au încă suport pentru # și % activat. Pentru a afla cum să permiteți aceste caractere în organizația dvs., consultați [Activarea suportului pentru # și %.](https://go.microsoft.com/fwlink/?linkid=862611) [Mai multe informații despre restricțiile numelor de fișiere și foldere](https://go.microsoft.com/fwlink/?linkid=866430)
37.419355
225
0.787931
ron_Latn
0.988206
f903eb23ba778962b9c563ff7060f4398d80042f
2,639
md
Markdown
_posts/2017-06-07-intro.md
reesesun/reese-site
3ad29b1d069f5958277b448472d00f3ff90bafd3
[ "MIT" ]
null
null
null
_posts/2017-06-07-intro.md
reesesun/reese-site
3ad29b1d069f5958277b448472d00f3ff90bafd3
[ "MIT" ]
null
null
null
_posts/2017-06-07-intro.md
reesesun/reese-site
3ad29b1d069f5958277b448472d00f3ff90bafd3
[ "MIT" ]
null
null
null
--- title: Introduction --- Basketball, one of the de facto national sports, which means that it’s considered important to the nation’s culture though not established by law, has existed for more than a century (Schultz, 2017). The original game was invented in 1891 in Springfield by James Naismith and had very different rules than the game we know today. The sport has grown from a recreational YMCA game to an international competitive sport. It was cold in Massachusetts and people wanted a game that they could play indoor. Naismith was asked to invent such sport in 14 days and he also wanted to develop a sport that is easy to play by his class. He adapted the idea from soccer and football and then invented basketball (Wolff, 1991). Due to the simple equipment requirements and easily understood rules, basketball has become popular quickly. Today, it has become one of the most popular sports in the world and the NBA has become one of the major sports leagues in the US. According to the consulting firm A.T. Kearney, the NBA constituted about 6% of the global sports market in terms of revenue produced in 2009 with 2.7 billion Euros (Martin, 2014). As a Chinese, I personally spend more time on watching the NBA instead of watching “the Chinese ball”, table tennis, which can emphasize the popularity of the basketball. The NBA is recognized by FIBA, the national governing body for basketball in the US. It is the organization that set the international basketball rules, regulates the equipment and facilities and other important factors on the basketball courts by using critical sensibility (“How does it work”, n.d.). Critical sensibility is about being skeptical, and being engaging in systematic doubt (Schultz, 2017). This sensibility is essential for the FIBA in order to maintain the equity and consistency of the basketball court. It will be used frequently in my following part of the project. Historical sensibility, a sensibility about sensing the change of the sport over time, will also be used frequently because of the long and diverse history of basketball (Schultz, 2017). ### Reference: Wolff, A. (1991). _Sports illustrated 100 years of hoops_. New York, NY: Crescent Books. Martin, J. (2014). _Could basketball even become the most popular sport in the world_. Retrieved from http://bleacherreport.com/articles/2178053-could-basketball-ever-become-the-most-popular-sport-in-the-world _“How does it work?_” (n.d.) Retrieved from http://www.fiba.com/calendar2017 Schultz, J. (2017a). _Sport and the sociological imagination_ [PowerPoint slides]. Retrieved from https://cms.psu.edu/
87.966667
773
0.789693
eng_Latn
0.999712
f90445b33061b35385b5cee14013b397e8ebc5c3
4,137
md
Markdown
Spanner/README.md
brooklynrail/google-cloud-php
5f46bffd37bb1fcaa2c39e8805460f8b0c4c24fa
[ "Apache-2.0" ]
3
2019-03-20T03:21:47.000Z
2019-03-24T17:26:38.000Z
Spanner/README.md
brooklynrail/google-cloud-php
5f46bffd37bb1fcaa2c39e8805460f8b0c4c24fa
[ "Apache-2.0" ]
null
null
null
Spanner/README.md
brooklynrail/google-cloud-php
5f46bffd37bb1fcaa2c39e8805460f8b0c4c24fa
[ "Apache-2.0" ]
1
2019-03-26T17:18:50.000Z
2019-03-26T17:18:50.000Z
# Google Cloud Spanner for PHP > Idiomatic PHP client for [Cloud Spanner](https://cloud.google.com/spanner/). [![Latest Stable Version](https://poser.pugx.org/google/cloud-spanner/v/stable)](https://packagist.org/packages/google/cloud-spanner) [![Packagist](https://img.shields.io/packagist/dm/google/cloud-spanner.svg)](https://packagist.org/packages/google/cloud-spanner) * [API documentation](http://googleapis.github.io/google-cloud-php/#/docs/cloud-spanner/latest) **NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any support requests, bug reports, or development contributions should be directed to that project. A fully managed, mission-critical, relational database service that offers transactional consistency at global scale, schemas, SQL (ANSI 2011 with extensions), and automatic, synchronous replication for high availability. ### Installation To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/). Now to install just this component: ```sh $ composer require google/cloud-spanner ``` Or to install the entire suite of components at once: ```sh $ composer require google/cloud ``` This component requires the gRPC extension. Please see our [gRPC installation guide](https://cloud.google.com/php/grpc) for more information on how to configure the extension. ### Authentication Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/master/AUTHENTICATION.md) for more information on authenticating your client. Once authenticated, you'll be ready to start making requests. ### Sample ```php require 'vendor/autoload.php'; use Google\Cloud\Spanner\SpannerClient; $spanner = new SpannerClient(); $db = $spanner->connect('my-instance', 'my-database'); $userQuery = $db->execute('SELECT * FROM Users WHERE id = @id', [ 'parameters' => [ 'id' => $userId ] ]); $user = $userQuery->rows()->current(); echo 'Hello ' . $user['firstName']; ``` ### Session warmup To issue a query against the Spanner service, the client library needs to request a session id from the server under the cover. This API call will add significant latency to your program. The Spanner client library provides a handy way to alleviate this problem by having a cached session pool. For more details, see: https://github.com/googleapis/google-cloud-php/blob/master/Spanner/src/Session/CacheSessionPool.php#L30 The following example shows how to use the `CacheSessionPool` with `SysVCacheItemPool` as well as how to configure a proper cache for authentication: ```php require __DIR__ . '/vendor/autoload.php'; use Google\Cloud\Spanner\SpannerClient; use Google\Cloud\Spanner\Session\CacheSessionPool; use Google\Auth\Cache\SysVCacheItemPool; $authCache = new SysVCacheItemPool(); $sessionCache = new SysVCacheItemPool([ // Use a different project identifier for ftok than the default 'proj' => 'B' ]); $spanner = new SpannerClient([ 'authCache' => $authCache ]); $sessionPool = new CacheSessionPool( $sessionCache, [ 'minSession' => 10, 'maxSession' => 10 // Here it will create 10 sessions under the cover. ] ); $database = $client->connect( 'my-instance', 'my-db', [ 'sessionPool' => $sessionPool ] ); // `warmup` will actually create the sessions for the first time. $sessionPool->warmup(); ``` By using a cache implementation like `SysVCacheItemPool`, you can share the cached sessions among multiple processes, so that for example, you can warmup the session upon the server startup, then all the other PHP processes will benefit from the warmed up sessions. ### Version This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in any minor or patch releases. We will address issues and requests with the highest priority. ### Next Steps 1. Understand the [official documentation](https://cloud.google.com/spanner/docs/). 2. Take a look at [in-depth usage samples](https://github.com/GoogleCloudPlatform/php-docs-samples/tree/master/spanner/).
35.358974
294
0.746676
eng_Latn
0.796094
f9050fa4f8248070897020c72f3ffa570ac99672
642
md
Markdown
styleguide/examples/PrintableGiftCard.md
Palem1988/opencollective-giftcards-generator
53cd9038e4638657996062a9a28e6a1709fe825d
[ "MIT" ]
7
2019-06-12T16:43:56.000Z
2021-11-29T05:06:36.000Z
styleguide/examples/PrintableGiftCard.md
Palem1988/opencollective-giftcards-generator
53cd9038e4638657996062a9a28e6a1709fe825d
[ "MIT" ]
144
2019-05-14T20:41:40.000Z
2020-04-29T03:21:41.000Z
styleguide/examples/PrintableGiftCard.md
opencollective/opencollective-giftcards-generator
30528997c4f0fc8cf16609cc797e1c119c5a2b2a
[ "MIT" ]
4
2019-09-19T16:57:32.000Z
2020-12-03T11:34:02.000Z
## Default ```js <PrintableGiftCard amount={2500} currency="USD" code="8X4WWD2G" expiryDate="Wed May 13 2020 00:00:00 GMT+0200 (GMT+02:00)" /> ``` ## Customization ```js <div> <PrintableGiftCard amount={50000} currency="USD" code="8X4WWD2G" expiryDate="Wed May 13 2020 00:00:00 GMT+0200 (GMT+02:00)" style={{ marginRight: 15 }} tagline="I have a QR code!" withQRCode /> <br /> <PrintableGiftCard amount={4200} currency="USD" code="8X4WWD2G" expiryDate="Wed May 13 2020 00:00:00 GMT+0200 (GMT+02:00)" borderRadius="0.2in" tagline="I have rounded corners!" /> </div> ```
17.833333
62
0.619938
eng_Latn
0.267188
f906a103dcebeae65706f471f0cc4a6146c12bc1
3,269
md
Markdown
docs/framework/winforms/controls/how-to-enable-check-margins-and-image-margins-in-contextmenustrip-controls.md
lucieva/docs.cs-cz
a688d6511d24a48fe53a201e160e9581f2effbf4
[ "CC-BY-4.0", "MIT" ]
1
2018-12-19T17:04:23.000Z
2018-12-19T17:04:23.000Z
docs/framework/winforms/controls/how-to-enable-check-margins-and-image-margins-in-contextmenustrip-controls.md
lucieva/docs.cs-cz
a688d6511d24a48fe53a201e160e9581f2effbf4
[ "CC-BY-4.0", "MIT" ]
null
null
null
docs/framework/winforms/controls/how-to-enable-check-margins-and-image-margins-in-contextmenustrip-controls.md
lucieva/docs.cs-cz
a688d6511d24a48fe53a201e160e9581f2effbf4
[ "CC-BY-4.0", "MIT" ]
null
null
null
--- title: 'Postupy: Povolení okrajů pro zaškrtnutí a okrajů obrázků v ovládacích prvcích ContextMenuStrip' ms.date: 03/30/2017 dev_langs: - csharp - vb helpviewer_keywords: - toolbars [Windows Forms] - ShowCheckMargin property [Windows Forms] - ShowImageMargin property [Windows Forms] - ToolStrip control [Windows Forms] - MenuStrip control [Windows Forms] ms.assetid: eb584e71-59da-4012-aaca-dbe1c7c7a156 ms.openlocfilehash: f7128c8ba6e2a221e359cd761cdc4c3521bb2b99 ms.sourcegitcommit: 4b6490b2529707627ad77c3a43fbe64120397175 ms.translationtype: MT ms.contentlocale: cs-CZ ms.lasthandoff: 09/10/2018 ms.locfileid: "44260253" --- # <a name="how-to-enable-check-margins-and-image-margins-in-contextmenustrip-controls"></a>Postupy: Povolení okrajů pro zaškrtnutí a okrajů obrázků v ovládacích prvcích ContextMenuStrip Můžete přizpůsobit <xref:System.Windows.Forms.ToolStripMenuItem> objekty ve vaší <xref:System.Windows.Forms.MenuStrip> ovládací prvek s značky zaškrtnutí a vlastní Image. ## <a name="example"></a>Příklad Následující příklad kódu ukazuje, jak vytvořit položky nabídky, které mají značky zaškrtnutí a vlastní Image. [!code-csharp[System.Windows.Forms.ToolStrip.Misc#1](../../../../samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/CS/Program.cs#1)] [!code-vb[System.Windows.Forms.ToolStrip.Misc#1](../../../../samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb#1)] [!code-csharp[System.Windows.Forms.ToolStrip.Misc#60](../../../../samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/CS/Program.cs#60)] [!code-vb[System.Windows.Forms.ToolStrip.Misc#60](../../../../samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb#60)] Nastavte <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowCheckMargin%2A?displayProperty=nameWithType> a <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A?displayProperty=nameWithType> vlastnosti, které chcete určit, když se ve vašich položkách nabídky zobrazí značky zaškrtnutí a vlastní Image. ## <a name="compiling-the-code"></a>Probíhá kompilace kódu Tento příklad vyžaduje: - Odkazy na sestavení System.Design System.Drawing a System.Windows.Forms. Informace o vytváření tento příklad z příkazového řádku pro Visual Basic nebo Visual C# najdete v tématu [sestavení z příkazového řádku](~/docs/visual-basic/reference/command-line-compiler/building-from-the-command-line.md) nebo [sestavení pomocí příkazového řádku csc.exe](~/docs/csharp/language-reference/compiler-options/command-line-building-with-csc-exe.md). Tento příklad v sadě Visual Studio můžete také vytvořit vložením kódu do nového projektu. Viz také [postupy: zkompilování a spuštění dokončení Windows Forms kód příklad pomocí sady Visual Studio](https://msdn.microsoft.com/library/Bb129228\(v=vs.110\)). ## <a name="see-also"></a>Viz také <xref:System.Windows.Forms.ToolStripMenuItem> <xref:System.Windows.Forms.ToolStripDropDownMenu> <xref:System.Windows.Forms.MenuStrip> <xref:System.Windows.Forms.ToolStrip> [Ovládací prvek ToolStrip](../../../../docs/framework/winforms/controls/toolstrip-control-windows-forms.md)
69.553191
621
0.788926
ces_Latn
0.941811
f906a800bab746462c3489b127c811966245adcd
2,719
md
Markdown
README.md
mhlo/gcp-reports
1f66c6a909a3d5edeb01d5bac81b718278a4f4e6
[ "Apache-2.0" ]
null
null
null
README.md
mhlo/gcp-reports
1f66c6a909a3d5edeb01d5bac81b718278a4f4e6
[ "Apache-2.0" ]
null
null
null
README.md
mhlo/gcp-reports
1f66c6a909a3d5edeb01d5bac81b718278a4f4e6
[ "Apache-2.0" ]
null
null
null
# gcp-reports some useful reports on GCP resources: app-engine apps, backups, etc This is built mostly around projects which run in multiple environments (per-developer, or standard dev/uat/prod, whatever). It will attempt to list things out according to labels that have set against GCP resources. At this time, those 'things' are projects, and GCS buckets. The code is currently aimed at App Engine setups, but can be extended to GCE or GKE environments: it uses the standard Google APIs to interrogate. ## Building Remotely: just do the usual: `go get -u github.com/mhlo/gcp-reports` ### Docker image You can build a simple Docker image this way: ``` cd $ROOT_DIRECTORY_OF_SOURCE_REPO docker build -t gcp-reports . ``` Note that this is built from an official Docker hub image, with all the security characteristics that come with that. ## Running `gcp-reports --help` should get you going. The '-v' option emits more output; be careful if you have very historied project or lots of them. A couple examples: ``` gcp-reports apps foo bar ``` Produces information about all App Engine applications which have a component label of either 'foo' or 'bar'. ``` gcp-reports --env-filter=dev backups ``` Produces information about backups for all the applications which are in the 'dev' environment. ### Docker image Running the docker image is the same, except for two things: * usual Docker stuff: `docker run ...` * the Google Cloud application-default credentials are not available within the Docker container. The following incantation addresses both of these concerns: ``` docker run --rm -it -v $HOME/.config/gcloud:/root/.config/gcloud gcp-reports --env-filter=dev backups ``` #### Google Container Registry It is sometimes useful to throw this into your GCR. In this case, do the following after building the image locally: ``` # you will probably better versioning that 'latest'! docker tag gcp-reports:latest gcr.io/YOUR_PROJECT_HERE/gcp-reports gcloud docker -- push gcr.io/YOUR_PROJECT_HERE/gcp-reports ``` ### Labels These reports are best used against projects and buckets which are _labelled_. These labels categorize resources in ways that are independent of the project-id, or other 1:1 style mapping. It's interesting to filter the query by (at least) two labels: * the project environment is described by a key:value pair where the key == `env` by default. * the project 'component' is a description of the nature of its capabilities GCP has methods (found in the 'IAM & Admin' section of any project's conosole) to label a project. GCS buckets have the same capabilities. For GCS, use the command-line: ``` gsutil label ch -l backup:true gs://YOUR_BUCKET_NAME_HERE ```
37.246575
276
0.762413
eng_Latn
0.998133
f906dca6479268de3ff723072b44fa0754dbbe01
2,359
md
Markdown
README.md
TheDonDope/gordle
32b10cd42361ad0b6c12822224a830086c8a1622
[ "Unlicense" ]
13
2022-01-15T21:00:15.000Z
2022-03-03T00:20:23.000Z
README.md
TheDonDope/gordle
32b10cd42361ad0b6c12822224a830086c8a1622
[ "Unlicense" ]
3
2022-01-15T00:51:47.000Z
2022-01-16T01:10:48.000Z
README.md
TheDonDope/gordle
32b10cd42361ad0b6c12822224a830086c8a1622
[ "Unlicense" ]
null
null
null
# Gordle [![CodeQL](https://github.com/TheDonDope/gordle/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/TheDonDope/gordle/actions/workflows/codeql-analysis.yml) [![codecov](https://codecov.io/gh/TheDonDope/gordle/branch/develop/graph/badge.svg?token=DM0KH9IJLG)](https://codecov.io/gh/TheDonDope/gordle) A golang TUI implementation of the popular word quiz [Wordle](https://www.powerlanguage.co.uk/wordle/)! ## System requirements A system dictionary must be installed. On debian based systems run `$ apt-get install wbritish` or `$ apt-get install wamerican`. ```shell $ go run ./cmd/cli Welcome to 🟩🟨⬛ Gordle ⬛🟨🟩 You have 6 trys to guess the word of the day. NOTE: The current implementation will pick a new word on every run! 🟩 means, the letter is in the word and in the correct spot. 🟨 means, that the letter is in the word but in the wrong spot. ⬛ means, that the letter is in not in the word in any spot. Enter 5 characters alter ⬛🟨🟨🟨🟨 (Try 1/6): alter Enter 5 characters rutel 🟨⬛🟨🟨🟨 (Try 2/6): rutel Enter 5 characters rolet 🟨⬛🟨🟨🟨 (Try 3/6): rolet Enter 5 characters toler 🟨⬛🟨🟨🟨 (Try 4/6): toler Enter 5 characters mulls ⬛⬛🟨🟨🟨 (Try 5/6): mulls Enter 5 characters mills ⬛🟩🟨🟨🟨 (Try 6/6): mills Your Gordle results (2022-01-18): ⬛🟨🟨🟨🟨 (1/6): alter 🟨⬛🟨🟨🟨 (2/6): rutel 🟨⬛🟨🟨🟨 (3/6): rolet 🟨⬛🟨🟨🟨 (4/6): toler ⬛⬛🟨🟨🟨 (5/6): mulls ⬛🟩🟨🟨🟨 (6/6): mills The solution was: lister ``` ## Building - Build the cli command (alternatively `$ task build` if you are using [Task](https://taskfile.dev/#/)): ```shell $ go build ./cmd/cli <Empty output on build success> ``` ## Running - Either run (alternatively `$ task run` if you are using [Task](https://taskfile.dev/#/)): ```shell $ go run ./cmd/cli [...] ``` - Or run this after having build the command: ```shell $ ./cli [...] ``` ## Running Tests - Run the testsuite with coverage enabled (alternatively `$ task test` if you are using [Task](https://taskfile.dev/#/)): ```shell $ go test -race ./... -coverprofile cp.out ? github.com/TheDonDope/gordle/cmd/cli [no test files] ok github.com/TheDonDope/gordle/pkg/game 0.584s coverage: 63.8% of statements ok github.com/TheDonDope/gordle/pkg/storage 0.019s coverage: 57.1% of statements ``` - Open the results in the browser: ```shell $ go tool cover -html cp.out -o cp.html <Opens Browser> ```
27.752941
316
0.680373
eng_Latn
0.861124
f906e93674fd4ee2664202123a0d35c41217a047
2,261
md
Markdown
dynamicsax2012-technet/productmanager-beginreadchangedproducts-method-microsoft-dynamics-commerce-runtime-client.md
s0pach/DynamicsAX2012-technet
8412306681e6b914ebcfad0a9ee05038474ef1e6
[ "CC-BY-4.0", "MIT" ]
1
2020-06-16T22:06:04.000Z
2020-06-16T22:06:04.000Z
dynamicsax2012-technet/productmanager-beginreadchangedproducts-method-microsoft-dynamics-commerce-runtime-client.md
s0pach/DynamicsAX2012-technet
8412306681e6b914ebcfad0a9ee05038474ef1e6
[ "CC-BY-4.0", "MIT" ]
null
null
null
dynamicsax2012-technet/productmanager-beginreadchangedproducts-method-microsoft-dynamics-commerce-runtime-client.md
s0pach/DynamicsAX2012-technet
8412306681e6b914ebcfad0a9ee05038474ef1e6
[ "CC-BY-4.0", "MIT" ]
null
null
null
--- title: ProductManager.BeginReadChangedProducts Method (Microsoft.Dynamics.Commerce.Runtime.Client) TOCTitle: BeginReadChangedProducts Method ms:assetid: M:Microsoft.Dynamics.Commerce.Runtime.Client.ProductManager.BeginReadChangedProducts(Microsoft.Dynamics.Commerce.Runtime.DataModel.ChangedProductsSearchCriteria) ms:mtpsurl: https://technet.microsoft.com/library/microsoft.dynamics.commerce.runtime.client.productmanager.beginreadchangedproducts(v=AX.60) ms:contentKeyID: 62210766 author: Khairunj ms.date: 05/18/2015 mtps_version: v=AX.60 f1_keywords: - Microsoft.Dynamics.Commerce.Runtime.Client.ProductManager.BeginReadChangedProducts dev_langs: - CSharp - C++ - VB --- # BeginReadChangedProducts Method Begins session to read changed products. **Namespace:**  [Microsoft.Dynamics.Commerce.Runtime.Client](microsoft-dynamics-commerce-runtime-client-namespace.md) **Assembly:**  Microsoft.Dynamics.Commerce.Runtime.Client (in Microsoft.Dynamics.Commerce.Runtime.Client.dll) ## Syntax ``` vb 'Declaration Public Function BeginReadChangedProducts ( _ searchCriteria As ChangedProductsSearchCriteria _ ) As ReadChangedProductsSession 'Usage Dim instance As ProductManager Dim searchCriteria As ChangedProductsSearchCriteria Dim returnValue As ReadChangedProductsSession returnValue = instance.BeginReadChangedProducts(searchCriteria) ``` ``` csharp public ReadChangedProductsSession BeginReadChangedProducts( ChangedProductsSearchCriteria searchCriteria ) ``` ``` c++ public: ReadChangedProductsSession^ BeginReadChangedProducts( ChangedProductsSearchCriteria^ searchCriteria ) ``` #### Parameters - searchCriteria Type: [Microsoft.Dynamics.Commerce.Runtime.DataModel.ChangedProductsSearchCriteria](changedproductssearchcriteria-class-microsoft-dynamics-commerce-runtime-datamodel.md) #### Return Value Type: [Microsoft.Dynamics.Commerce.Runtime.DataModel.ReadChangedProductsSession](readchangedproductssession-class-microsoft-dynamics-commerce-runtime-datamodel.md) The session. ## See Also #### Reference [ProductManager Class](productmanager-class-microsoft-dynamics-commerce-runtime-client.md) [Microsoft.Dynamics.Commerce.Runtime.Client Namespace](microsoft-dynamics-commerce-runtime-client-namespace.md)
31.84507
175
0.827068
yue_Hant
0.79955
f9074d3b3eb1033c5f292d79c7175af34e932757
739
md
Markdown
windows.web.http/httpbuffercontent_trycomputelength_1823707804.md
gbaychev/winrt-api
25346cd51bc9d24c8c4371dc59768e039eaf02f1
[ "CC-BY-4.0", "MIT" ]
199
2017-02-09T23:13:51.000Z
2022-03-28T15:56:12.000Z
windows.web.http/httpbuffercontent_trycomputelength_1823707804.md
gbaychev/winrt-api
25346cd51bc9d24c8c4371dc59768e039eaf02f1
[ "CC-BY-4.0", "MIT" ]
2,093
2017-02-09T21:52:45.000Z
2022-03-25T22:23:18.000Z
windows.web.http/httpbuffercontent_trycomputelength_1823707804.md
gbaychev/winrt-api
25346cd51bc9d24c8c4371dc59768e039eaf02f1
[ "CC-BY-4.0", "MIT" ]
620
2017-02-08T19:19:44.000Z
2022-03-29T11:38:25.000Z
--- -api-id: M:Windows.Web.Http.HttpBufferContent.TryComputeLength(System.UInt64@) -api-type: winrt method --- <!-- Method syntax public bool TryComputeLength(System.UInt64 length) --> # Windows.Web.Http.HttpBufferContent.TryComputeLength ## -description Computes the [HttpBufferContent](httpbuffercontent.md) length in bytes. ## -parameters ### -param length The length in bytes of the [HttpBufferContent](httpbuffercontent.md). ## -returns **true** if *length* is a valid length; otherwise, **false**. ## -remarks The TryComputeLength method calculates the content length for the [HttpBufferContent](httpbuffercontent.md). This is useful for content types that are easy to calculate the content length. ## -examples ## -see-also
26.392857
188
0.760487
eng_Latn
0.677364
f907f9395587c4c2e04a381d6c29212f63223aa0
4,528
md
Markdown
docs/11.1/api/nestedHeaders.md
Quire/handsontable
598688aad8bad589b428cc1f467c2a7aeb985010
[ "MIT" ]
null
null
null
docs/11.1/api/nestedHeaders.md
Quire/handsontable
598688aad8bad589b428cc1f467c2a7aeb985010
[ "MIT" ]
null
null
null
docs/11.1/api/nestedHeaders.md
Quire/handsontable
598688aad8bad589b428cc1f467c2a7aeb985010
[ "MIT" ]
null
null
null
--- title: NestedHeaders metaTitle: NestedHeaders - Plugin - Handsontable Documentation permalink: /11.1/api/nested-headers canonicalUrl: /api/nested-headers hotPlugin: true editLink: false --- # NestedHeaders [[toc]] ## Description The plugin allows to create a nested header structure, using the HTML's colspan attribute. To make any header wider (covering multiple table columns), it's corresponding configuration array element should be provided as an object with `label` and `colspan` properties. The `label` property defines the header's label, while the `colspan` property defines a number of columns that the header should cover. __Note__ that the plugin supports a *nested* structure, which means, any header cannot be wider than it's "parent". In other words, headers cannot overlap each other. **Example** ```js const container = document.getElementById('example'); const hot = new Handsontable(container, { data: getData(), nestedHeaders: [ ['A', {label: 'B', colspan: 8}, 'C'], ['D', {label: 'E', colspan: 4}, {label: 'F', colspan: 4}, 'G'], ['H', {label: 'I', colspan: 2}, {label: 'J', colspan: 2}, {label: 'K', colspan: 2}, {label: 'L', colspan: 2}, 'M'], ['N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W'] ], ``` ## Options ### nestedHeaders ::: source-code-link https://github.com/handsontable/handsontable/blob/0472af66268f29ceb64d1f046b74a05149cffe8d/handsontable/src/dataMap/metaManager/metaSchema.js#L2997 ::: _nestedHeaders.nestedHeaders : Array&lt;Array&gt;_ The `nestedHeaders` option configures the [`NestedHeaders`](@/api/nestedHeaders.md) plugin. You can set the `nestedHeaders` option to an array of arrays: - Each array configures one set of nested headers. - Each array element configures one header, and can be one of the following: | Array element | Description | | ------------- | -------------------------------------------------------------------------------------------- | | A string | The header's label | | An object | Properties:<br>`label` (string): the header's label<br>`colspan` (integer): the column width | Read more: - [Plugins: `NestedHeaders` &#8594;](@/api/nestedHeaders.md) - [Column groups: Nested headers &#8594;](@/guides/columns/column-groups.md#nested-headers) **Default**: <code>undefined</code> **Example** ```js nestedHeaders: [ ['A', {label: 'B', colspan: 8}, 'C'], ['D', {label: 'E', colspan: 4}, {label: 'F', colspan: 4}, 'G'], ['H', 'I', 'J', 'K', 'L', 'M', 'N', 'R', 'S', 'T'] ], ``` ## Members ### detectedOverlappedHeaders ::: source-code-link https://github.com/handsontable/handsontable/blob/0472af66268f29ceb64d1f046b74a05149cffe8d/handsontable/src/plugins/nestedHeaders/nestedHeaders.js#L90 ::: _nestedHeaders.detectedOverlappedHeaders : boolean_ The flag which determines that the nested header settings contains overlapping headers configuration. ## Methods ### destroy ::: source-code-link https://github.com/handsontable/handsontable/blob/0472af66268f29ceb64d1f046b74a05149cffe8d/handsontable/src/plugins/nestedHeaders/nestedHeaders.js#L610 ::: _nestedHeaders.destroy()_ Destroys the plugin instance. ### disablePlugin ::: source-code-link https://github.com/handsontable/handsontable/blob/0472af66268f29ceb64d1f046b74a05149cffe8d/handsontable/src/plugins/nestedHeaders/nestedHeaders.js#L190 ::: _nestedHeaders.disablePlugin()_ Disables the plugin functionality for this Handsontable instance. ### enablePlugin ::: source-code-link https://github.com/handsontable/handsontable/blob/0472af66268f29ceb64d1f046b74a05149cffe8d/handsontable/src/plugins/nestedHeaders/nestedHeaders.js#L104 ::: _nestedHeaders.enablePlugin()_ Enables the plugin functionality for this Handsontable instance. ### isEnabled ::: source-code-link https://github.com/handsontable/handsontable/blob/0472af66268f29ceb64d1f046b74a05149cffe8d/handsontable/src/plugins/nestedHeaders/nestedHeaders.js#L97 ::: _nestedHeaders.isEnabled() ⇒ boolean_ Check if plugin is enabled. ### updatePlugin ::: source-code-link https://github.com/handsontable/handsontable/blob/0472af66268f29ceb64d1f046b74a05149cffe8d/handsontable/src/plugins/nestedHeaders/nestedHeaders.js#L137 ::: _nestedHeaders.updatePlugin()_ Updates the plugin state. This method is executed when [Core#updateSettings](@/api/core.md#updatesettings) is invoked.
30.594595
172
0.694346
eng_Latn
0.559187
f908778993f0ae2b6f61b50512f11fb69173e11f
289
md
Markdown
README.md
WengChaoxi/password-generator
25507de99d3ef807d4b517e1f8e22f605190ef31
[ "MIT" ]
null
null
null
README.md
WengChaoxi/password-generator
25507de99d3ef807d4b517e1f8e22f605190ef31
[ "MIT" ]
null
null
null
README.md
WengChaoxi/password-generator
25507de99d3ef807d4b517e1f8e22f605190ef31
[ "MIT" ]
1
2021-12-15T00:37:09.000Z
2021-12-15T00:37:09.000Z
## 密码生成器 > 一个根据个人信息生成密码的工具(基于Qt/C++编写) ### 介绍 > 这个工具原理很简单,就是用hash和base64处理输入的信息,进行单向加密。通过你计算机的相关信息实现了不同电脑对于相同输入的信息所得到的密文是不一样的,这个功能你可以通过勾选“本机唯一性”开启。 > > 你可以用这个工具根据一些易于记住的信息(比如:姓名、学校、网站地址、电话号码等等)来生成一个较复杂的密码。 ### 效果 ![1](test/1.png) ![2](test/2.png) ![3](test/3.png) ![4](test/4.png)
14.45
101
0.709343
zho_Hans
0.475531
f908aa5e27730196c34d72c2f61e0e4a46d6dec9
8,480
md
Markdown
_posts/2019-02-01-porto-seguro-kaggle-challenge-part3.md
KBOct/KBOct.github.io
6d259141bc31ae291fc21dd977981448b03d4780
[ "MIT" ]
null
null
null
_posts/2019-02-01-porto-seguro-kaggle-challenge-part3.md
KBOct/KBOct.github.io
6d259141bc31ae291fc21dd977981448b03d4780
[ "MIT" ]
2
2021-09-27T21:47:57.000Z
2022-02-26T04:42:28.000Z
_posts/2019-02-01-porto-seguro-kaggle-challenge-part3.md
KBOct/KBOct.github.io
6d259141bc31ae291fc21dd977981448b03d4780
[ "MIT" ]
2
2021-10-30T13:25:24.000Z
2021-10-30T13:37:54.000Z
--- title: "Porto Seguro Kaggle challenge (French) - Part 3" date: 2019-02-01 categories: [data science, python] tags: [machine learning, data science, eda, exploratory data analysis, kaggle, porto seguro, python] #header: # image: "/images/2 - heat equation/heat.jpg" excerpt: "Porto Seguro Kaggle challenge" toc: true toc_label: "Contents" toc_icon: "list-ul" # corresponding Font Awesome icon name (without fa prefix toc_sticky: true mathjax: true --- # Construction des modèles ## 1) Choix du classifieur ### a) Séparation du jeu de données ```python from sklearn.model_selection import train_test_split from sklearn.linear_model import LogisticRegression, LogisticRegressionCV X=donnees.drop(['target'], axis=1) #X=donnees.drop(['id','target'], axis=1) y=target X_train, X_test, y_train, y_test = train_test_split(X, y, stratify=y, test_size=1/5) #from imblearn.over_sampling import SMOTE #from collections import Counter #sm = SMOTE(ratio = 0.30, random_state = 42, k_neighbors=5) #print('Original dataset shape {}'.format(Counter(y))) #X_train, y_train = sm.fit_sample(X, y) #print('Resampled dataset shape {}'.format(Counter(y_train))) #X_train, X_test, y_train, y_test = train_test_split(X_train, y_train, stratify=y_train, test_size=0.3) ``` ### b) Cross-validation des classifieurs ```python X_array = X_train.values Y_array = y_train.values #X_array = X_train #Y_array = y_train X_learning = X_array[:10000][:,0:7] Y_learning = Y_array[:10000] kfold = StratifiedKFold(n_splits=5) clfs = [] clfs.append(("RF", RandomForestClassifier()) ) clfs.append(("AdaBoost", AdaBoostClassifier()) ) clfs.append(("GBoost", GradientBoostingClassifier()) ) clfs.append(("DTree", DecisionTreeClassifier()) ) clfs.append(("ExTree", ExtraTreeClassifier()) ) clfs.append(("LogReg", LogisticRegression()) ) clfs.append(("XGBoost", XGBClassifier()) ) clf_names = [] means = [] stds = [] for nom, clf in clfs: #cross validation among models, score based on accuracy cv_results = cross_val_score(clf, X_learning, Y_learning, scoring='accuracy', cv=kfold) print(clf.__class__.__name__) #clf_names.append(clf.__class__.__name__) clf_names.append(nom) print("Résultat: " + str(cv_results)) print("Moyenne: " + str(cv_results.mean())) print("Ecart type: " + str(cv_results.std())+'\n') means.append(cv_results.mean()) stds.append(cv_results.std()) ``` RandomForestClassifier Résultat: [0.96501749 0.96401799 0.965 0.96498249 0.96548274] Moyenne: 0.9649001429750357 Ecart type: 0.0004791943804980242 AdaBoostClassifier Résultat: [0.96501749 0.96501749 0.9655 0.96548274 0.96548274] Moyenne: 0.9653000930500234 Ecart type: 0.0002308294420302726 GradientBoostingClassifier Résultat: [0.96501749 0.96501749 0.9655 0.96548274 0.96548274] Moyenne: 0.9653000930500234 Ecart type: 0.0002308294420302726 DecisionTreeClassifier Résultat: [0.96501749 0.96401799 0.965 0.96548274 0.96498249] Moyenne: 0.9649001429750357 Ecart type: 0.0004791943804980242 ExtraTreeClassifier Résultat: [0.96501749 0.96401799 0.9655 0.96548274 0.96548274] Moyenne: 0.9651001930000482 Ecart type: 0.0005710574203836229 LogisticRegression Résultat: [0.96501749 0.96501749 0.9655 0.96548274 0.96548274] Moyenne: 0.9653000930500234 Ecart type: 0.0002308294420302726 XGBClassifier Résultat: [0.96501749 0.96501749 0.9655 0.96548274 0.96548274] Moyenne: 0.9653000930500234 Ecart type: 0.0002308294420302726 ```python x_loc = np.arange(len(clfs)) width = 0.5 plt.figure(figsize=(9, 5), dpi=100) clf_graph = plt.bar(x_loc, means, width, yerr=stds) plt.ylabel('Accuracy') plt.title('Scores par modèles\n') plt.xticks(x_loc, clf_names) def addLabel(rects): for rect in rects: height = rect.get_height() plt.text(rect.get_x() + rect.get_width()/2., 1.05*height, '%f' % height, ha='center', va='bottom') addLabel(clf_graph) plt.show() ``` ![alt]({{ site.url }}{{ site.baseurl }}/images/kaggle/output_101_0.png) {:class="img-responsive"} ### c) Courbes ROC ```python clfrs = [ RandomForestClassifier(), AdaBoostClassifier(), GradientBoostingClassifier(), DecisionTreeClassifier(), ExtraTreeClassifier(), LogisticRegression(), XGBClassifier() ] aucs = [] fprs = [] tprs = [] precisions = [] recalls = [] f1_scores = [] for clf in clfrs: print(clf.__class__.__name__) clf.fit(X_train, y_train) fpr, tpr, _ = roc_curve(y_test, clf.predict_proba(X_test)[:, 1]) fprs.append(fpr) tprs.append(tpr) aucs.append(auc(fpr, tpr)) precision, recall, _ = precision_recall_curve(y_test, clf.predict_proba(X_test)[:, 1]) precisions.append(precision) recalls.append(recall) f1_scores.append(f1_score(y_test, clf.predict(X_test))) ``` RandomForestClassifier AdaBoostClassifier GradientBoostingClassifier DecisionTreeClassifier ExtraTreeClassifier LogisticRegression XGBClassifier ```python names = [clf.__class__.__name__ for clf in clfrs] plt.figure(figsize=(8, 6)) plt.plot([0, 1], [0, 1], 'k--') for fpr, tpr, auc, name in zip(fprs, tprs, aucs, names): plt.plot(fpr, tpr, label=name + ' (AUC=%.2f)' % auc, lw=2) plt.xlim([0.0, 1.0]) plt.ylim([0.0, 1.05]) plt.xlabel('Taux de Faux Positifs \n False Positive Rate', fontsize=12) plt.ylabel('Taux de Vrais Positifs \n True Positive Rate', fontsize=12) plt.title('Receiver operating characteristic\n', fontsize=16) plt.legend(loc="lower right", fontsize=10) ``` <matplotlib.legend.Legend at 0x7fefc4a07630> ![alt]({{ site.url }}{{ site.baseurl }}/images/kaggle/output_104_1.png) {:class="img-responsive"} ### d) Courbes Precision-Recall ```python plt.figure(figsize=(9, 7)) for precision, recall, f1_score, name in zip(precisions, recalls, f1_scores, names): plt.plot(recall, precision, label=name + ' (F1=%.5f)' % f1_score, lw=3) plt.xlim([0.0, 1.0]) plt.ylim([0.0, 1.05]) plt.xlabel('Recall', fontsize=12) plt.ylabel('Precision', fontsize=12) plt.title('Courbe Precision-Recall\n', fontsize=16) plt.legend(loc="upper right", fontsize=11) ``` <matplotlib.legend.Legend at 0x7fefc49a2f28> ![alt]({{ site.url }}{{ site.baseurl }}/images/kaggle/output_106_1.png) {:class="img-responsive"} ## 2) Tuning des hyperparamètres ```python # Fonction de calcul du coefficient de Gini issue du kernel disponible à l'adresse URL : # https://www.kaggle.com/tezdhar/faster-gini-calculation from sklearn.metrics.scorer import make_scorer def ginic(actual, pred): actual = np.asarray(actual) #In case, someone passes Series or list n = len(actual) a_s = actual[np.argsort(pred)] a_c = a_s.cumsum() giniSum = a_c.sum() / a_s.sum() - (n + 1) / 2.0 return giniSum / n def gini_normalizedc(a, p): if p.ndim == 2:#Required for sklearn wrapper p = p[:,1] #If proba array contains proba for both 0 and 1 classes, just pick class 1 return ginic(a, p) / ginic(a, a) gini_sklearn = make_scorer(gini_normalizedc, True, True) ``` **Séparation du jeu de données** On va entraîner nos modèles par K-fold cross-validation. Etant donné que le jeu de données est très déséquilibré, on veut avoir le même nombre de "True" dans chacun des folds pour être sur que les modèles ne prédisent pas la classe "False" trop souvent. ```python folds = 4 skf = StratifiedKFold(n_splits=folds, shuffle = True, random_state = 1001) ``` **Grille d'hyperparamètres pour GradientBoostingClassifier** ```python params = { 'min_samples_leaf': [1,5,10], 'max_depth': [3, 5,7], 'subsample': [0.6, 0.7,0.8], 'max_features': [None, 50, 100] } ``` ```python gb_clr = XGBClassifier(n_estimators=100, learning_rate=0.02) ``` ```python #from sklearn.model_selection import RandomizedSearchCV n_iter = 5 random_search = RandomizedSearchCV(gb_clr, param_distributions=params, n_iter=n_iter, scoring=gini_sklearn, n_jobs=-2, cv=skf.split(X_train, y_train), verbose=3, random_state=2018) random_search.fit(X_train, y_train) ``` Fitting 4 folds for each of 5 candidates, totalling 20 fits [CV] subsample=0.8, min_samples_leaf=1, max_features=50, max_depth=3 . [Parallel(n_jobs=-2)]: Using backend SequentialBackend with 1 concurrent workers. ```python print('Meilleurs hyperparamètres :') print(random_search.best_params_) ```
24.868035
253
0.700825
fra_Latn
0.166433
f90958edec2362632b067286c2c64e0875cac892
50,222
markdown
Markdown
_posts/2012-02-15-methods-for-generating-visual-data-from-nodes-containing-identity-data-for-persons-from-a-set-point-of-view.markdown
api-evangelist/patents-2012
b40b8538ba665ccb33aae82cc07e8118ba100591
[ "Apache-2.0" ]
3
2018-09-08T18:14:33.000Z
2020-10-11T11:16:26.000Z
_posts/2012-02-15-methods-for-generating-visual-data-from-nodes-containing-identity-data-for-persons-from-a-set-point-of-view.markdown
api-evangelist/patents-2012
b40b8538ba665ccb33aae82cc07e8118ba100591
[ "Apache-2.0" ]
null
null
null
_posts/2012-02-15-methods-for-generating-visual-data-from-nodes-containing-identity-data-for-persons-from-a-set-point-of-view.markdown
api-evangelist/patents-2012
b40b8538ba665ccb33aae82cc07e8118ba100591
[ "Apache-2.0" ]
4
2018-04-05T13:55:08.000Z
2022-02-10T11:30:07.000Z
--- title: Methods for generating visual data from nodes containing identity data for persons from a set point of view abstract: Computer implemented methods for constructing dynamic relationships between data for presentation on a display are provided. The data is obtained from one or more data sources and managed as a plurality of nodes. The nodes increase or decrease in number over time. One method includes setting a point of view from one of the nodes of the plurality of nodes, and the setting of the point of view acting to order certain ones of the plurality of nodes to produce a representation from the point of view. The method generates visual data that illustrates the representation of the plurality of nodes from the set point of view and provides the visual data for rendering on a display of a device. Certain ones of the nodes contain unique identity data for individuals, and the nodes are associated with other nodes based on relationships between the individuals. url: http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITOFF&p=1&u=%2Fnetahtml%2FPTO%2Fsearch-adv.htm&r=1&f=G&l=50&d=PALL&S1=09530227&OS=09530227&RS=09530227 owner: GOOGLE INC. number: 09530227 owner_city: Mountain View owner_country: US publication_date: 20120215 --- The application is a continuation of U.S. patent application Ser. No. 13 198 301 filed on Aug. 4 2011 which is a continuation of U.S. patent application Ser. No. 10 810 407 issued as U.S. Pat. No. 8 019 786 filed on Mar. 26 2004 which is a continuation of U.S. patent application Ser. No. 09 578 127 filed on May 24 2000 issued as U.S. Pat. No. 6 714 936 and claims the benefit of U.S. Provisional Application No. 60 135 740 filed May 25 1999. The invention is a computer implemented method of storing manipulating accessing and displaying data and its relationships and a computer system with memory containing data programmed to implement such method. Today s GUI graphical user interface software requires a great deal of training for proficiency. They rarely show their context and rarely show internal data and control points. The actions of applications should be fast and easy to use not confusing and restrictive. Navigating a current GUI is to learn how the programmers have organized the data and the control points. Today s UI user interface relies on windows and pull down menus which hide prior ones as the user makes selections and an often complex series of mouse selections to navigate to the desired control point. In performing an action after traversing a path of pull down menus and button selections on different sub windows the user may be returned to the beginning forced to retrace their steps if they wish to apply an action repeatedly. The UI does not shift from one state to another in a smooth way. Current GUI s with pop up menus and layers of text based windows. Today s GUI s suffer from a list mentality rows of icons with little or no meaning in their position no relationships readily visible between themselves or to concepts which the user may be interested in or have knowledge of. The standard GUI concept of a canvas with buttons and pull downs require reading and thinking about the meaning of text to hopefully grasp the model of control flow. Virtually no information is given outside of static text to help the user understand relationships and control points. Gaining access to fields or parameters in current applications can also be a challenge. For example the Microsoft POP mail retrieval service uses a configuration profile defined by the user to access the mail server and displays the name of that configuration when logging. Although one sees evidence of the existence of this configuration how does one change it The answer may not be obvious. An object oriented system that implemented all actions on an object could also provide the mechanism of self deletion but this helps only if the object itself is visible and accessible via the GUI. This is what DataSea does. Windows technology is moving in this direction by having many words in menus modifiable but DataSea achieves this automatically by virtue of its design. A complex GUI such as a presentation and control system for database administration today consists of many canvases and widgets which hopefully present through multiple mouse clicks all information that is available. Any data can be changed by any part of the program and this leads to bugs if the programmer can not easily see these interactions. A DataSea presentation of data and control shows all the objects and their relationships and thus shows immediately what nodes can affect changes to the data reducing bugs. To turn a DataSea view into an application means to set internal parameters create and link together application nodes and add programmatic instructions to these nodes. DataSea will implement a means to invoke these instructions. DataSea can serve as the single source of data for any application. Any RDBMS relational database management system can do this but DataSea is completely flexible in its data storage and linkage guaranteeing forward compatibility by eliminating the risk of changes to database structure and entity relationships of RDBs Relational Databases . Two separate DataSea databases can be joined and automatic linkage routines will merge them without programmer effort. This is generally impossible in RDBs. This joining can occur by simply adding nodes and links from the two data sets and adding together the contents of the master index NameListObj. Or the two data sets can be blended merging their contents taking two nodes with the same name from the two separate data sets creating one node which has all the links from the two separate nodes. In most storage systems especially RDBMS s the user must know how information is stored in the computer and which parameter or parameters that the computer is using to store the data as well as the proper range of values. This is often non intuitive and may seem somewhat arbitrary for a non technical user. Ideally the computer would better mimic human associative memory allowing the user to look for new information associated with that which is better known such as a particular context or a range of values without regard to parameterization to specify the target of interest. OLAP online analytical processing and data mining require both analytical models and custom code to apply these models to particular database structures. These customizations may be hard coded non portable and irrelevant to the model. The DataSea API application programming interface provides access to all data while eliminating the need to worry about database structure such as tables columns and foreign keys. Up coming non linear presentation tools such as fish eye or hyperbolic views do not address the difficult problem of how to lay out the data and their relationships before the viewing method is applied. These may be useful but do not address the difficult issue of how the graph is laid out initially. Nor are they appropriate for highly linked data sets because the plethora of links resembles a cobweb from a psychotic spider. VR takes advantage of visual clues and spatial awareness but only for data sets that may be appropriately mapped to a 3 dimensional space. Generally data is N dimensional and thus in general virtual reality which models information as physical objects in 3D space is inappropriate for viewing arbitrary data. even more than a GUI voice control needs a smooth transition from state to state in response to commands so that the user can follow what is happening. GUIs hide previous states with new windows while the present invention moves objects gradually and continuously in response to programmatic or user events. The inventive method referred to as DataSea is a method for storing accessing and visualizing information. Data is stored into nodes and visualized as a sea of linked nodes. Nodes can contain anything such as documents movies telephone numbers applications or words containing concepts. Interactions with the user organize the data from a defined and then refined point of view with relevant data brought to their attention by smooth changes in the data s appearance. Essentially a handful of nodes which are typically selected by value are linked to the point of view turning the web of data into a hierarchical network. Further order is imposed by the use of two types of commands one which relies on the data values the other on the links and types of the data nodes. The user typically enters words into a computer programmed in accordance with DataSea and watches DataSea s response. Individual nodes are rendered according to the sequence of nodes between themselves and the point of view allowing different presentations of data. Applications may be stored into nodes and can be located and executed by DataSea. These applications can operate on and present information from DataSea in the conventional manner with windows and menus or by using the DataSea mechanisms of visualization including the so called virtual reality mode VR mode which supports deterministic data placement as needed in such things as forms and spread sheets. This is a disclosure of computer implemented methods for storing manipulating accessing and displaying data and its relationships and of computer systems programmed to implement such methods. These methods are flexible applicable to any kind of data and are useful to diverse groups of users. A prototype is implemented in the Java programming language. Data is stored into nodes which are linked together. All nodes contain variables including descriptions types magnitudes and timestamps. Links also contain information about themselves including connection strength of the link and descriptive information. Data is accessed and modified based on the values of data their relationships the values of DataSea parameters and links between nodes rather than pre determined locations in memory as is done in most programming models. Any existing application can be emulated in DataSea by creating and linking appropriate nodes. Positions of nodes as displayed on the screen are a result of processing force parameters rather than pre determined positions. This approach to the command interface and the smooth changes of state in visual feedback lends DataSea to voice input and thus wireless PDA personal digital assistant type devices. As shown in each node has a link to at least one other node. Each link is defined by three values CS which is Connection Strength of a link initially set to 1.0 Description which is a free form String describing the node and Type For example DN data node and AN abstract node . A candy factory supervisor performs the following tasks there are many different commands and choices of values which will give similar results DataSea is a comprehensive program that stores manipulates and visualizes all forms of data. Visually animated objects or nodes represent data or abstract concepts. Interactive commands which something like verbs operate on nodes and the links between them which act something like nouns . These commands change internal parameters of the nodes and links. These parameters are visualized by qualities such as position and size. Certain nodes are emphasized presenting information. The user finds the data or resource needed without knowledge of the data structure. Unusual features of DataSea include relatively natural commands robustness to imprecise queries ability to generalize absence of restrictive structure use of semantic information and smooth transitions between visual states of the user interface. The simple commands and feedback from smooth visual transitions is key in integration DataSea with a voice interface. The front end of DataSea is a query interpreter and visualization system and on the back end is a database and API application programming interface . Briefly one sees a Sea of Data and after each of a series of commands one sees increasingly relevant data more prominently. DataSea nodes act something like nouns of a natural language and DataSea commands something like verbs. Here are the principal steps involved in a user query In a preferred embodiment DataSea is a pure Java application that can serve in a range of roles. It can view and control existing and legacy data such as email documents file directories and system utilities. It can ultimately serve as the principal UI to a system managing all data and system resources of a personal computer or workstation. The natural ability of people to recognize visual patterns can be leveraged to convey information rapidly to the user. For instance certain algorithms which depend on particular node and link configurations can render and position those nodes for rapid recognition. For example if a target DN is surrounded by intermediate DNs which are themselves linked each to a distal AN then those intermediate DNs are probably describing the target DN. The number of intermediates is then a measure of how much information is known about the target DN. Its ability to gracefully reduce the complexity of the visual output means that a wireless hand held client can be used to quickly browse and retrieve information from a remote server. The simplicity of commands and accessibility of DataSea to the novice user lends itself to voice commands that can be used to navigate and control the display of DataSea. The simplicity of DataSea s data structure allows easy acquisition and integration of legacy data into DataSea. Because new data is integrated with old the acquisition of new data not only allows its retrieval by the user but also enhances the user s retrieval of older data. Thus as DataSea matures in its data content queries are more robust to imprecise terms from the user. Since DataSea captures the information in the data and its structure from legacy databases applications in DataSea can emulate legacy applications while of course making this information available to broader use within DataSea. While DataSea can emulate a RDBMS without the complications of tables and foreign keys the rich connections of DataSea and its ability to insert abstract nodes opens the way for neural type processing. Learning by example is one example of that new capability. Learning by example refers to adjusting mag and CS values by voting via more or less for example on DNs without relying on ANs. This selects DNs which the user especially likes or dislikes. Applying commands to DNs such as files or URLs changes not only the mag of each DN but changes the CS and mag in its neighborhood typically spreading through related ANs thereby changing the mag of other DNs in the neighborhood i.e. having similar qualities as the DNs that the user liked. A different point of view applied to DataSea by virtue of different connections and connection strengths changes the presentation of data as fundamentally as changing the database design in a relational database but much more easily. DataSea can be used to perform simple web history viewing data mining and can be used as the principal Desktop UI for a computer showing all of the computer resources. Viewing domains such as file systems web history or HTML documents and computer networks are obvious uses of DataSea and are early targets of DataSea. Applied to a web browser the text of links to the current URL can be retrieved and parsed into DataSea in effect pre digesting it for the user. The GUI Graphical User Interface of DataSea is important but the underlying structure of DataSea queries and input methods are curiously appropriate for voice and natural language interfacing. Since queries input and control of DataSea rely on simple words DataSea current voice recognition software can be used instead of text input and would significantly improve the uniqueness and general usability of DataSea. No other UI uses voice or is as appropriate for voice control. Since the results of many queries may be a short answer voice generation is an appropriate output method in addition to or instead of graphic output. For instance the query show John Smith and address is precise enough to generate one value significantly stronger than others and therefore amenable to a programmatic decision for selecting which results to submit to voice output. In this way voice can be a complete communications method opening the door to remote access via telephone or wireless device. Another opportunity involves selling server time for web searches giving away client software initially. A typical interaction might involve throwing a number of search terms asking for a display of abstraction categories or examples of URL s followed by the user judging prominent nodes repeating as the search narrows. DataSea s data structure and tools lend themselves naturally to data warehousing and mining each with an estimated worldwide budget in 1999 of nearly 2 billion. DataSea intrinsically provides data mining and warehouse support. DataSea supports any type of data without specifying in advance the fields or tables to use. This is good for arbitrary user input such as free form notes or machine generated input such as received data from automated test equipment. DataSea therefore is a completely flexible data warehouse. Data mining is supported by DataSea s ability to reorganize any data based on user defined point of views the ability to link any and all data and the ability to store the processing of data and applications into DataSea itself. DataSea can serve as the Desktop screen the principal interface to all system services independent of operating system. It can do this on demand without locking the user into a particular operating system. Most methods have three versions of arguments String s and Node n1 Node n2 . . . . If null then lastNode is used if String then matching nodes are looked for both pass one or more nodes to the third version which takes explicit Nodes. Custom programs can translate legacy formats into DataSea linked nodes e.g. to load information about a file system the names of files and directories are stored into a tree representation first then suffix and name can be used to create ANs then content can be analyzed e.g. by putting it through the Notes processor. A RDB Relational Database would be loaded by storing the names of databases tables and columns into ANs and then values into DNs and keys into links. All these would be linked appropriately e.g. table name linked to column names linked to all DNs having the values in those columns. A dictionary or synonym list can be loaded. The Type and Desc of links between synonyms or nodes with similar meaning are set. E.g. Type synonym Desc from Webster s 10Ed. The user need not know about the data structure such as database tables and their entity relationships in a relational database or the directory structure of a file system. Nor does the user need to parameterize and decide how to store data but may rather simply stuff it into DataSea. DataSea will parse the textual data and create links to representing abstract nodes. Abstract nodes are typically single words representing simple or complex concepts and are linked to data nodes related to them. These nodes typically are massively linked. DataSea is accessible from external programs via its API. More interestingly though Java code may be stored into a node fully integrating data and methods. The Java code can then act from within DataSea for instance modifying the rendering of objects or analyzing data and creating new nodes and links. The sequence of positioning and rendering flows through the network of nodes from the POV distally. Typically an application will start from one node specified by name pointing device or other means and will search the neighborhood of that node for certain relationships or values and types. For example invoking Phone Jim can find the nearest DN Jim then present the nearest DN which is linked to AN phone number . Thus commands like Phone emergency can work since emergency can be linked to 911 which can have a large default CS which allows it to dominate and Phone 123 Main St can work since the address 123 Main St can be linked to a phone number through a DN of a person s name. In addition to the DataSea commands such as show abs and sim new applications can be written to extend the base command set of DataSea. All nodes have the capacity to store a VRObject which contains position and rendering information. It includes a triplet of numbers describing the relative position of a child to its parent if the rendering mode of DataSea is set to VR mode . Typically computer applications use or set values at specific locations of memory and may or may not check their values by some means or rules or comparisons. DataSea looks for information by nearness a fuzzy metric and or characteristics of its links and or characteristics of nodes directly or indirectly linked and or their values. Besides looking for DNs which are linked to specific ANs an application in DataSea can query the distance or conceptual distance from a node to one or more values of values such as data values TimeStamps or other parameters . Decisions can be based on complex functions of environment checking. The visual tools of DataSea are based on a visual language which is completely different from today s standard GUI s and gives the user easier access to relevant data and inhibits irrelevant data. DataSea can visually present large amounts of data and the relationships amongst them emphasizing that which is relevant while keeping the larger context. The user sees exactly the data that is needed as well as related data a form of look ahead albeit at lower resolution. The data presentation changes as the user interacts with DataSea. Data moves smoothly from the background to the foreground bringing it to the users attention in response to the user. The gradual shift in visual states helps the user to understand what is happening as the query progresses. The scene begins with a sea of objects representing nodes. Ordering of this sea begins as a result of commands to set a POV or by changing the mode to VRmode on some or all nodes. Typically one sees the sea of data in the background with the POV in the foreground and a TimeLine along an edge such as the bottom. Nodes move and change their appearance with interactions. These interactions can be with the user or with programs inside DataSea or externally. The positions of nodes are changed by iterative calculations of forces on them thus they move visibly between positions rather than jumping suddenly. In this way changes in state and thus appearance can be followed by the user better than by sudden changes of appearance. Nodes are positioned dependent a set of pressures from sources each pressure from a source e.g. POV parent neighbors being a function of that source s preferred position or distance between the child and the source the child s mag dist etc. The optimum distance to point of view is proportional to dist f mag . Point of view is either a new temporary node set at a specific position on screen or is an existing node. The visual tools of DataSea are based on a visual language which is completely different from today s standard GUI s and gives the user easier access to relevant data and inhibits irrelevant data. DataSea can visually present large amounts of data and the relationships amongst them emphasizing that which is relevant while keeping the larger context. The user sees exactly the data that is needed as well as related data a form of look ahead albeit at lower resolution. The data presentation changes as the user interacts with DataSea. Data moves smoothly from the background to the foreground bringing it to the users attention in response to the user. The gradual shift in visual states helps the user to understand what is happening as the query progresses. For example compare the ease of understanding either of these two scenarios First watching five animated objects which represent five words in alphabetical order reverse their order representing reverse alphabetical ordering Second watching five words on a line change from ascending alphabetical order to descending. In the first case reversal is apparent. In the second the simple operation of reversal is far less apparent seeing the reversal requires re analyzing the words and then trying out one or more possible explanations. In DataSea nodes cluster and move individually and in groups in response to queries. Internal parameters inherent in each node and link change in response to queries. These internal parameters are mapped to visual behavior and appearances such as size position color and shape. These visual cues are used to enhance certain nodes or groups of nodes and their links. The internal parameters are changed by typically recursive commands that start at one node and spread through links to others. Commands adjust connection strength and magnitude of nodes based on their programmed algorithms and local node and link information such as node type and the distance from the point of view. The point of view distance parameters are associated with each node and are functions of the shortest path from that node to the point of view. Recursive commands are self terminating typically but not always acting distal to the point of view where the value of the next nodes distance is greater than or equal to the current distance and often but not always producing less effect further away from the point of view. A new query is begun by entering words similar to a web search or manipulating regions of the background with the mouse. One or more data nodes are directly hit increasing their magnitude and secondary nodes those distal to a primary and their links are affected exactly how depends on the spread mode of the operation. Nearness to the point of view is usually a function of link distance and magnitude but other methods are possible e.g. link distance alone which display data in a simple hierarchical set of levels . Details of nodes are normally suppressed but with the magnifier mode turned on any node under the cursor presents more information. Another mode is warp mode which acts like a large magnifying lens on a region of the screen. This is similar to hyperbolic viewing of networks of nodes. Which nodes are enhanced depends on the command and the spread mode which is the way in which it traverses the linked nodes. The simplest spread mode is radial this modifies the node at distance n 1 based on the strongest node directly connected to it of distance n in effect being influenced by the node which is on the strongest path back to the point of view. Another spread mode is sum which adds up all the contributions of nodes of distance n to directly connected nodes of distance n 1. In sum mode a single data node distal to a large number of nodes will sum all their contributions. This is especially useful in the Similarity and Abstractions operations. If a specific node is specified in the query it is enhanced by for instance growing in size and moving towards the point of view from the background blur of nodes. If an operation of an abstraction type is used the abstract nodes are enhanced. The relative positioning of higher or lower levels of abstraction depends on the specific command. If an operation of a similarity type is used data nodes predominate by approaching the point of view and by being enhanced. Rather than connecting the hits immediately and directly to the point of view abstract nodes in common are first drawn near the point of view. These more abstract nodes are then followed by more detailed ones receding back to the backdrop positioned to give the sense of their being pulled out of the DataSea. Qualities like time since an event or distance to one or more chosen abstract nodes can act as a secondary force or wind acting to influence the position of nodes along one of the 3 dimensions of the visualization. Data in DataSea is heavily linked without restrictions on what can be linked. DataSea solves the cobweb visual problem by establishing a point of view for the users queries. The problem of following links that are loops is solved by calculating on the fly the shortest number of links from the point of view to the nodes. This turns a series of self referencing loops into a temporary hierarchy based on the current point of view. The user can browse raw data in DataSea but meaningful structure comes from the interaction between the point of view and raw data. This is analogous to the quantum physics effect of forcing a wave function into a specific physical state by applying an observation to the wave function interaction with the user that forces data into its useful visible state. A point of view is one form of an abstract node. Once the user finishes a query the point of view that has been created can be absorbed into DataSea and used later a form of checkpoint used in calculations. Links can occur rather mindlessly for instance simply by association to part or all of an inputted document in a way which captures relationships for instance field definitions from legacy databases or semantic meaning from for example some level of natural language processing. Postprocessing inside DataSea creates abstract nodes. These represent abstractions of the data inside DataSea representing concepts or the results of analysis. A mature DataSea will contain a large proportion of these abstract nodes. Each event which links data within DataSea stores a link ID along with it. Thus any two nodes can be linked together more than once each link having a different ID to differentiate the context of their being linked. A single link ID can be used between many nodes as long as that particular subset of nodes has a meaningful context. This context is stored in an abstract node which linked of course to the subset with that link ID and contains the reason for the links. Data is user defined and customizable whatever the user puts into DataSea it merely needs to be in a computer representation. Data is held inside so called nodes which may be linked together. A data node can be a specific value text such as a web page or free form entry or an object representing something as complex as a virtual reality view of a manufacturing facility. Text in any language is broken up into words and stored. All of the different forms of data share identical mechanisms of storage linkage search presentation and access. The database contains highly linked data but differs in significant ways from RDBMS s relational database management systems including the ability to create links between any data and the elimination of structured tables. Rather than using pre defined fields to capture relationships DataSea uses nodes with appropriate links. As new data is introduced and linked to the existing nodes alternate paths are created between points. This allows data to be found which contains no keywords contained in the query relying on associations contained in the new data. A simple example would be loading a dictionary into DataSea there are few related concepts that are not linked through only even two or three definitions of either. Thus a user may enter a query containing no keywords of a document and be presented with that document albeit emphasized less than documents that contain more direct links to the query terms. AI or manual digestion of information and linkage to abstract concepts is of course possible as is done by those who compile databases for search engines today. The user need not know about the data structure such as database tables and their entity relationships in a relational database or the directory structure of a file system. Nor does the user need to parameterize and decide how to store data but may rather simply stuff it into DataSea. DataSea will parse the textual data and create links to representing abstract nodes. Abstract nodes are typically single words representing simple or complex concepts and are linked to data nodes related to them. These nodes typically are massively linked. DataSea is accessible from external programs via its API. More interestingly though Java code may be stored into a node fully integrating data and methods. The Java code can then act from within DataSea for instance modifying the rendering of objects or analyzing data and creating new nodes and links. A fully integrated application in DataSea uses the DataSea linkage and VR mechanisms to provide the functionality of typical window menu systems. The program of the application is stored in a DataSea application node. All nodes have the capacity to store a 3 D vector called a VR position . This is a triplet of numbers describing the relative position of a child to its parent if the rendering mode of DataSea is set to VR mode . Any child having non zero a VR position variable will position itself relative to the calling parent based on the VR position values. In a preferred implementation DataSea is a pure Java application. Once loaded user defined data nodes and links are used to visualize information from a range of sources in an interactive or programmatic way. Data node sources can be email web sites databases or whatever is required. is a block diagram of an embodiment of the invention. All data is contained in objects called nodes. Information describing the data is held in the data node. A complex data node may be broken into smaller ones. A data node has a set of standard fields describing itself and any number of links to other data nodes. The DataSea database is a highly linked structure of nodes. A link contains information describing itself and how it relates the linked data nodes. It therefore contains semantic information adding a new dimension to interactive or programmed processing of data. That is DataSea supports not just parametric searches which find the values at certain storage locations specified by parameters or content based analysis which find particular values and their relations anywhere in the database but the meaning of a collection of nodes. An example of this could be a link with the description located near relating a computer with a person s name. Processing of data occurs not only on values of certain parameters but on any value independent of what it is describing. For instance one may search for all information related to an individual s name without specifying which table and column of the database to search and in which tables and columns to look for foreign keys. Applications can run inside DataSea in fact these applications are themselves held inside a node. Current applications such as automatic report generators and data formatters know which pre defined data fields to place just where and how to order the values. This functionality is served by DataSea s mechanism of node and link descriptors which can act as the column names of RDBMS s. The DataSea link description however also provides semantic information about those relationships. Objects are positioned and rendered strongly dependent on their content and their links. That is features of the rendering of nodes and the relative positions of nodes depend on content and links. Thus DataSea is unique because the presentation is strongly dependent on the data itself. Below is a scenario of events with comparisons between two different application approaches The user routinely stores information and calls it up later when faced with a decision as to repair a new printer or buy an old one. This example shows the simplicity and time saved with DataSea. It compares Office Suite Internet Explorer saves the non overlapping history of URLs temporarily and relies on the user to bookmark special URLs and put them in the tree hierarchy defined by the user. Event The user gets a phone call and makes a note to himself that repairman Bob Smith says that printer A will cost 300 to repair and that it is in Joe Baker s office. Office Suite The user opens the call tracking program Tracker and fills in the fields prompted by the wizard including the note text Repairman Bob Smith called . . . . To store the location of Printer A in a company wide database the user invokes the database editing application DB Front End selects appropriate view e.g. Machine View searches for Printer A enters Joe Baker for the column Location . DataSea The text of the note is stuffed into DataSea and explicitly enters Printer A office Joe Baker . The information is parsed and time stamped automatically. Event The user now wonders if he should replace printer A with a new one. He remembers seeing a reference in a recent email for an HP printer and also an HP ad on the web but can t remember exactly where he filed this information. Office Suite User opens Outlook Express tries to recall the name of the email sender possibly keywords to search and sets the time range to search enlarged since an event 1 minute outside the range will be excluded Immediately he sees messages focussed on one keyword. User skims header and text to decide if this is the correct message. Then user opens Internet Explorer and browses the names in the History list trying to recall the context for each as he sees them or tries to recall the name of the document corresponding to the right URL. He then deduces which database stored procedure table or view to use opens the DB Front End application enters Joe Baker in the correct search field and sees Printer A in the Equipment column. He arranges the four windows from these applications for simultaneous viewing Outlook Explorer Tracker and DB Front End . DataSea User starts a point of view with the initial associative words Joe Baker Printer email and gives his guess of when this all occurred via mouse drag on the time line. He sees several concept nodes and some data nodes. He then judges these by emphasizing de emphasizing particular ones and sees email with appropriate links. He further judges them adds the word URL to the point of view which results in the appropriate URL and data being pulled forward. User marks timeline over the past week and says show printer and email and Hewlett Packard which shows an abstract node Printer linked to email message about printers and a web page of HP printers User says input John Smith telephone 848 1234 which creates a node holding the entire message and parses it into smaller data nodes. To demonstrate abstract nodes and learning have processed URLs from cat web search. See all 50 around the abstract nodes surrounding the point of view named show cat . User deselects URLs not related to technical descriptions the abstract nodes change bringing forward URLs with more technical information. Variation 1 Voice integration. Front end routines take either keyboard input or voice input submitting word strings from either to handler functions. Voice word go acts as keyboard Enter . DataSea can be used to visualize the DataSea program itself. Besides visualizing nodes which represent data for the user as described elsewhere in this document in so called dataset nodes the nodes that are visualized in DataSea can represent internal programming objects methods or elements of DataSea itself providing a sort of built in debugger . Code can be inserted into the program which will visualize each methods invocation and its modifications of user data. DataSea separates the two tasks of modifying the values of node variables and rendering of those nodes. Thus DataSea can redraw the entire scene not only after traversing the linked nodes and re calculating their internal parameters but the entire scene can be re drawn at any time during these calculations even once every time a dataset node variable such as mag is changed. Thus a self node can indicate to the user its own activity by redrawing the entire scene normally and then highlighting itself or drawing lines to a dataset node or its elements that it is operating on. For instance if a user commands DataSea to increase the variable mag of a node the method which does that e.g. spread can draw a line from the self node representing spread to the dataset node it is modifying. If the method spread recursively calls the method spread recursive insert a conditional call to touch after spread recursive a method and apparatus for creating nodes containing data linking the nodes into a network setting parameters of the nodes node variables and maintaining information specific to each node e.g. mag CS direction of the link polarization . Each node preferably has a name associated with which it can be searched from a master list a method and apparatus using context nodes to modulate link connection strength CS and establish context for groups of nodes. For example a method for associating a set of links and establishing a context node which can modulate the CS of those links thereby sensitizing or desensitizing them to further operations. The context node can also magnify the nodes linked by each link it modulates a method and apparatus for loading data from free form notes. For example a method of taking text input text from user or application or text resulting from voice translation and establishing a set of linked nodes therefrom by creating a new node for the full text called the full text node discarding selected words e.g. articles linking the full text node to individual nodes representing each remaining word in the full text creating new nodes as needed. For another example a method of converting tabular data i.e. text organized into rows and columns with column headings or RDMBS data with additional links for the keys of the RDBMS into a set of linked nodes in which each column heading is represented by an AN the column heading AN each cell of data is represented by a DN links are established between each column heading AN representing a particular column and those nodes corresponding to the cells in that column files from a computer file system or a set of files linked by HTML references into a set of linked nodes in which links from each node are established to terms found in the file content e.g. as is done in the parsing of notes. The procedure can filter the content looking for only certain tag values such as meta tags or heading values e.g. Title Here has Title Here as heading level 1 in HTML Another set of links can be made to ANs representing the suffix of files or such ANs can be used as ContextNodes for all links to those files. For HTML files links are to be established between nodes representing HTML files and other nodes representing HTML files that are referenced by the first HTML file. For another example a method of converting files from a computer file system in which links are established between DNs representing file directory with DNs representing files or sub directories in that directory a method and apparatus for defining a POV either a particular node or a new node linked to a particular node a method and apparatus for defining distance as a function of the number of links between nodes and the node type and hierarchy from the POV and determining distal and proximal directions in which once a POV is set and distances calculated from it a hierarchical tree is defined from what was an arbitrarily complex cross linked network of nodes. Thus if any node x has had its distance set by this routine one is guaranteed to find a path from that node x back to the POV by traveling on a path between nodes of ever decreasing distance values a method and apparatus for retrieving data which is linked into a network of nodes interacting with the user to better present the desired data a method for emphasizing nodes and paths by tracing backwards from a target node to a POV by following all links to nodes whereby the next node has magnitude less than that of the prior node. Emphasizing those nodes on the path s shows nodes between the target and POV. By traveling backwards from the target node to the POV there may be more than one node having a distance less than the target. This is fine and if all paths backwards with the requirement that they are consistently proximal are emphasized it is fine. For example with Bob being the POV and traveling backwards from the node representing January 1999 all nodes such as notes and events related to Bob will be emphasized a method for assigning position to each node which is dependent on the node s parameter values including distance CS and magnitude. Rather than setting the node at the calculated position immediately it moves there gradually thereby showing the transition between states. One way to do this is to calculate forces on a node which are related to the difference between the node s current position and an ideal calculated position. a Relations Mode Most suitable for narrow queries where we wish to see all the links between nodes in the target data set. Nodes fan out from their parent the angle dependent on the number of children their parent has their distance dependent either on mag or 1 mag or a Levels Mode Most suitable for broad queries where there are too many links between nodes in the target data set. Starting in the center of the screen fanning out to the left dependent on their distance from the POV ANs are rendered. Starting in the center and belonging to the right half of the screen are the DNs whose position moves further to the right the lower their mag a method and apparatus for visualizing data by appearance on a screen. For example a method of assigning visual emphasis color size to each node dependent on the nodes distance CS and magnitude. Examples of operations performed on nodes of the inventive set of linked nodes or on a sea of displayed representations of such nodes include ABS for characterizing and understanding the environment of nodes and their ANs from a target node traveling distally and upstream find the first AN and emphasize it. This abstracts the target node in terms of linked ANs. To abstract it at a higher level go from those ANs to directly linked ANs which are both distal and upstream. This can continue to arbitrary level until we run out of nodes realistically not very far a handful of levels XABS for emphasizing ANs from a group of nodes those ANs not having been recently visited by query operations emphasizing distally from these ANs will result in a relatively large number of DNs being modified. The user may find ANs which are obviously related or not related to their interest and thereby significantly change the presented data set. Since these ANs haven t been used recently we in effect triangulate the target data set from more vantage points. Determining categories which when evaluated by the user as good or bad have a large effect on narrowing the presented data set that is helping the user find the target data set SIM a method of emphasizing magnifying nodes based on their similarity to a chosen node without specifying values of any node using the sim command which emphasizes DNs linked to any or all of the ANs which are linked to the chosen node s POTMAG a method of modifying the variable Potentiation of a node and using that value to influence the degree of change to the variable mag from a subsequent operation. Thus one operation on the first set of nodes may call Node1.setPotentiationValue and a subsequent operation on the second set of nodes may set the value of Node1.mag based on Node1.getPotentiationValue This primes a set of nodes and can operate approximately as a soft or non binary AND operation. Another aspect of the invention is structuring of a set of linked nodes a network including application nodes sometimes referred to as applications . Applications are nodes containing code which get the information they operate on from traversing the network. E.g. an email node application is linked to or given a reference to the node Bob Smith and upon being invoked by the action function inherent in each node or otherwise searches the neighborhood of the Bob Smith node for a DN linked to an AN representing email address. If more than one is found the user is presented with the selection to choose from. Thus any node application can be applied to any node. One aspect of the invention is a method of accessing data wherein the data is structured as a set of linked nodes and each of the nodes includes at least one link to another one of the nodes. The method includes the steps of preliminary to displaying representations of the nodes on a screen in a screen space having N dimensions where N is an integer dividing a display space having dimension N 1 into an array of cells wherein the dimension of the display space includes a size dimension implementing a user interface which displays representations of at least some of the nodes on the screen having sizes determined by the cells to which said at least some of the nodes are linked wherein the user interface rapidly accesses individual ones or groups of the nodes in response to selection of at least one of said representations. The computer program listing appendix filed herewith is incorporated herein by reference. This appendix is a source code listing in the Java programming language of a computer program for programming a computer to implement an embodiment of the invention. In the listing which consists of parts labeled TL.java Timer.java ColorObj.java Link.java Mode.java Node.java Force.java GetURLInfo.java Input.java Populate.java GUI.java DataSea.java LinkObj.java VRObj.java and nsr.java the object gui of class GUI is the top level object and instantiates the object datasea of class DataSea and other objects .
184.639706
1,928
0.815141
eng_Latn
0.99989
f9095ea427bd9a1bb1914f2cfa656fdda5f2a165
25
md
Markdown
README.md
temp25/ws-chat
3cf49a107d24ac0d1b7a8497bb4523b0aeb041f9
[ "Apache-2.0" ]
null
null
null
README.md
temp25/ws-chat
3cf49a107d24ac0d1b7a8497bb4523b0aeb041f9
[ "Apache-2.0" ]
null
null
null
README.md
temp25/ws-chat
3cf49a107d24ac0d1b7a8497bb4523b0aeb041f9
[ "Apache-2.0" ]
null
null
null
# ws-chat Websocket Chat
8.333333
14
0.76
eng_Latn
0.589688
f90a2b36b9249770bb5b159e59c0c89f6608d3e0
3,130
md
Markdown
dynamicsax2012-technet/search-and-reserve-an-inventory-batch-with-certain-attributes.md
RobinARH/DynamicsAX2012-technet
d0d0ef979705b68e6a8406736612e9fc3c74c871
[ "CC-BY-4.0", "MIT" ]
null
null
null
dynamicsax2012-technet/search-and-reserve-an-inventory-batch-with-certain-attributes.md
RobinARH/DynamicsAX2012-technet
d0d0ef979705b68e6a8406736612e9fc3c74c871
[ "CC-BY-4.0", "MIT" ]
null
null
null
dynamicsax2012-technet/search-and-reserve-an-inventory-batch-with-certain-attributes.md
RobinARH/DynamicsAX2012-technet
d0d0ef979705b68e6a8406736612e9fc3c74c871
[ "CC-BY-4.0", "MIT" ]
null
null
null
--- title: Search and reserve an inventory batch with certain attributes TOCTitle: Search and reserve an inventory batch with certain attributes ms:assetid: dabc91cd-e135-4546-add5-ec9c2279a56e ms:mtpsurl: https://technet.microsoft.com/en-us/library/Hh328583(v=AX.60) ms:contentKeyID: 36688005 ms.date: 04/18/2014 mtps_version: v=AX.60 audience: Application User ms.search.region: Global --- # Search and reserve an inventory batch with certain attributes _**Applies To:** Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012_ Use this procedure to search for an inventory batch with certain attributes, and then reserve the inventory to a sales order. > [!NOTE] > <P>From the <STRONG>Batch attribute search</STRONG> form, you can create a template based on the search criteria that you set up in the form. For more information, see <A href="create-a-batch-attribute-search-template.md">Create a batch attribute search template</A>. To retrieve search criteria from a template, click <STRONG>Get template</STRONG> in the <STRONG>Batch attribute search</STRONG> form.</P> 1. Click **Sales and marketing** \> **Common** \> **Sales orders** \> **All sales orders**. 2. Double-click the sales order for which inventory is being reserved. The **Sales order** form is displayed. 3. On the **Sales order lines** FastTab, select the sales order line for the item to be reserved. > [!NOTE] > <P>The item you select must be batch controlled. An item is batch controlled if the batch number dimension is active on the item's tracking dimension group.</P> > <UL> > <LI> > <P>Click <STRONG>Product information management</STRONG> &gt; <STRONG>Setup</STRONG> &gt; <STRONG>Dimension groups</STRONG> &gt; <STRONG>Tracking dimension groups</STRONG>. Then select the <STRONG>Active</STRONG> check box for the <STRONG>Batch number</STRONG> line.</P></LI></UL> 4. Click **Inventory** and then select **Batch reservation**. 5. In the **Batch reservation** form, click **Batch attribute search**. The **Batch attribute search** form opens with default criteria for batch attributes by item. - To change the criteria to batch attributes by item and customer, click **Customer attributes**. - To refine the search, change the values in the **Attribute** and **Operator** fields. - To add a new line of search criteria, press CTRL+N and then enter the values. 6. Click **OK** to initiate the search. When the search is complete, the **Batch reservation** form opens again with the search results. 7. In the **Reservation** field, enter the quantity to be reserved to the sales order. For a catch weight item, use the **CW reservation** field. ## See also [About batch attributes](about-batch-attributes.md) [Batch attribute search (form)](https://technet.microsoft.com/en-us/library/hh242819\(v=ax.60\)) [Batch reservation (form)](https://technet.microsoft.com/en-us/library/hh208645\(v=ax.60\)) [Sales orders (form)](https://technet.microsoft.com/en-us/library/aa585863\(v=ax.60\))
46.029412
407
0.732907
eng_Latn
0.816531
f90a3992501b1877914d9fa453c0f9acdc2960de
819
md
Markdown
docs/framework/wcf/diagnostics/tracing/debugging-on-the-client.md
MoisesMlg/docs.es-es
4e8c9f518ab606048dd16b6c6a43a4fa7de4bcf5
[ "CC-BY-4.0", "MIT" ]
null
null
null
docs/framework/wcf/diagnostics/tracing/debugging-on-the-client.md
MoisesMlg/docs.es-es
4e8c9f518ab606048dd16b6c6a43a4fa7de4bcf5
[ "CC-BY-4.0", "MIT" ]
null
null
null
docs/framework/wcf/diagnostics/tracing/debugging-on-the-client.md
MoisesMlg/docs.es-es
4e8c9f518ab606048dd16b6c6a43a4fa7de4bcf5
[ "CC-BY-4.0", "MIT" ]
null
null
null
--- title: Depuración del cliente ms.date: 03/30/2017 ms.assetid: 56f9ad05-ea1b-4ef6-85f2-890f7ed71567 ms.openlocfilehash: 4fc647bcde3d9aed27a46298be8d863947ba0726 ms.sourcegitcommit: bc293b14af795e0e999e3304dd40c0222cf2ffe4 ms.translationtype: MT ms.contentlocale: es-ES ms.lasthandoff: 11/26/2020 ms.locfileid: "96243994" --- # <a name="debugging-on-the-client"></a>Depuración del cliente Para facilitar a los usuarios la escritura de aplicaciones cliente para el servicio WCF, puede Agregar el [\<serviceDebug>](../../../configure-apps/file-schema/wcf/servicedebug.md) comportamiento del servicio al archivo de configuración de su servicio. Este comportamiento se puede utilizar para publicar páginas de ayuda y devolver información de excepciones administrada en los detalles de errores SOAP devueltos al cliente.
54.6
426
0.814408
spa_Latn
0.890038
f90a46cc9908f808ea99e86fbc1856dae84c3ca0
3,636
md
Markdown
README.md
rkluzinski/brainfast
9df60d22e06148d3969dc90a5b76be6e9db64e30
[ "MIT" ]
null
null
null
README.md
rkluzinski/brainfast
9df60d22e06148d3969dc90a5b76be6e9db64e30
[ "MIT" ]
null
null
null
README.md
rkluzinski/brainfast
9df60d22e06148d3969dc90a5b76be6e9db64e30
[ "MIT" ]
null
null
null
# Brainfast Brainfast is a brainf\*ck interpreter capable of running programs very quickly. The brainf\*ck source is optimized and recompiled to native x86-64 machine code using asmjit. Brainf\*ck programs are allocated 65536 bytes of memory by default, but this can changed using a command line argument. ## Getting Started Building, testing and benchmarking brainfast. ### Prerequisites * An x86-64 Computer and a Linux OS. * Any C++ Compiler supported by CMake. * CMake version 3.1 or greater. * Python3.x (for tests and benchmarks). ### Installing Clone the brainfast github repository and move to the brainfast directory. ``` $ git clone https://github.com/rkluzinski/brainfast $ cd brainfast ``` Create the build directory and move to the build directory. ``` $ mkdir build $ cd build ``` Run CMake with the parent folder as the argument. ``` $ cmake .. ``` Run the Makefile generated by CMake. ``` $ make ``` The executable 'bf' should be created in the build directory. Running it with no arguments should give a usage message. ``` $ ./bf usage: ./bf [MEMORY_SIZE] filename ``` ## Running the tests and benchmarks. The tests and benchmarks can be run from the brainfast directory. ``` $ cd .. ``` The test program bitwidth.b is from rdebath's [brainf\*ck](https://github.com/rdebath/Brainfuck) repository. It can be run with Python3 and should output 'Hello World! 255'. ``` $ python3 test/ Running bitwidth.b: Hello World! 255 ``` The benchmarks are run in similar manner as the tests. The files used for benchmarking are from matslina's [brainf\*ck](https://github.com/matslina/bfoptimization) repository. Programs with lots of output to STDOUT will run faster in the benchmark because the output is being piped to a file and does not have to be displayed in the terminal. Shown below is output from the Brainfast benchmark on Ubuntu 18.04 with an AMD Ryzen 7 2700X CPU. ``` $ python3 benchmarks/ program real user sys ------------------------------------------------ awib-0.4 0.017 0.017 0.000 dbfi 0.646 0.646 0.000 factor 0.703 0.702 0.000 hanoi 0.056 0.052 0.004 long 0.229 0.221 0.008 mandelbrot 0.914 0.914 0.000 total 2.565 2.551 0.012 ``` ## Porting Brainfasts In its current state, Brainfast only runs on x86-64 Linux computers because the code generated by the compiler is specific to that platform. * It makes use of general registers r12-r14, not availible on x86-32. * The generated assembly adheres to the System V x86-64 calling conventions. For the program to run on x86-32 or Windows, these things would need to be changed. ## Built With * [AsmJit](https://github.com/asmjit/asmjit) - A remote assembler for C++ * [CMake](https://cmake.org/) - A build automation tool ## Authors * **Ryan Kluzinski** - *Initial work* - [rkluzinski](https://github.com/rkluzinski) ## License This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details ## Acknowledgments * http://www.hevanet.com/cristofd/brainfuck/ - A great introduction to brainf\*ck. * https://github.com/rdebath/Brainfuck - A very comprehensive test program. * https://github.com/matslina/bfoptimization - A collection of benchmarks. * http://calmerthanyouare.org/2015/01/07/optimizing-brainfuck.html - Various optimization strategies. * https://eli.thegreenplace.net/ - Other work in using JIT compilation with brainf\*ck. * http://www.nynaeve.net/?p=64 - Assembly optimization techniques.
31.076923
293
0.69802
eng_Latn
0.971746