code
stringlengths
3
1.01M
repo_name
stringlengths
5
116
path
stringlengths
3
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
3
1.01M
--- layout: single title: "三维形体的表面积" date: 2018-06-11 21:30:00 +0800 categories: [Leetcode] tags: [Geometry, Array, Math, Matrix] permalink: /problems/surface-area-of-3d-shapes/ --- ## 892. 三维形体的表面积 (Easy) {% raw %} <p>给你一个 <code>n * n</code> 的网格 <code>grid</code> ,上面放置着一些 <code>1 x 1 x 1</code> 的正方体。</p> <p>每个值 <code>v = grid[i][j]</code> 表示 <code>v</code> 个正方体叠放在对应单元格 <code>(i, j)</code> 上。</p> <p>放置好正方体后,任何直接相邻的正方体都会互相粘在一起,形成一些不规则的三维形体。</p> <p>请你返回最终这些形体的总表面积。</p> <p><strong>注意:</strong>每个形体的底面也需要计入表面积中。</p> <p> </p> <ul> </ul> <p><strong>示例 1:</strong></p> <img alt="" src="https://assets.leetcode.com/uploads/2021/01/08/tmp-grid1.jpg" style="width: 82px; height: 82px;" /> <pre> <strong>输入:</strong>grid = [[2]] <strong>输出:</strong>10 </pre> <p><strong>示例 2:</strong></p> <img alt="" src="https://assets.leetcode.com/uploads/2021/01/08/tmp-grid2.jpg" style="width: 162px; height: 162px;" /> <pre> <strong>输入:</strong>grid = [[1,2],[3,4]] <strong>输出:</strong>34 </pre> <p><strong>示例 3:</strong></p> <img alt="" src="https://assets.leetcode.com/uploads/2021/01/08/tmp-grid3.jpg" style="width: 162px; height: 162px;" /> <pre> <strong>输入:</strong>grid = [[1,0],[0,2]] <strong>输出:</strong>16 </pre> <p><strong>示例 4:</strong></p> <img alt="" src="https://assets.leetcode.com/uploads/2021/01/08/tmp-grid4.jpg" style="width: 242px; height: 242px;" /> <pre> <strong>输入:</strong>grid = [[1,1,1],[1,0,1],[1,1,1]] <strong>输出:</strong>32 </pre> <p><strong>示例 5:</strong></p> <img alt="" src="https://assets.leetcode.com/uploads/2021/01/08/tmp-grid5.jpg" style="width: 242px; height: 242px;" /> <pre> <strong>输入:</strong>grid = [[2,2,2],[2,1,2],[2,2,2]] <strong>输出:</strong>46 </pre> <p> </p> <p><strong>提示:</strong></p> <ul> <li><code>n == grid.length</code></li> <li><code>n == grid[i].length</code></li> <li><code>1 <= n <= 50</code></li> <li><code>0 <= grid[i][j] <= 50</code></li> </ul> {% endraw %} ### 相关话题 [[几何](https://github.com/awesee/leetcode/tree/main/tag/geometry/README.md)] [[数组](https://github.com/awesee/leetcode/tree/main/tag/array/README.md)] [[数学](https://github.com/awesee/leetcode/tree/main/tag/math/README.md)] [[矩阵](https://github.com/awesee/leetcode/tree/main/tag/matrix/README.md)] --- ## [解法](https://github.com/awesee/leetcode/tree/main/problems/surface-area-of-3d-shapes)
openset/openset.github.io
leetcode/2018-06-11-surface-area-of-3d-shapes.md
Markdown
mit
2,751
<TS language="eu_ES" version="2.1"> <context> <name>AddressBookPage</name> <message> <source>Right-click to edit address or label</source> <translation>Eskuin-klika helbidea edo etiketa editatzeko</translation> </message> <message> <source>Create a new address</source> <translation>Sortu helbide berria</translation> </message> <message> <source>&amp;New</source> <translation>&amp;Berria</translation> </message> <message> <source>Copy the currently selected address to the system clipboard</source> <translation>Kopiatu hautatutako helbidea sistemaren arbelera</translation> </message> <message> <source>&amp;Copy</source> <translation>&amp;Kopiatu</translation> </message> <message> <source>C&amp;lose</source> <translation>&amp;Itxi</translation> </message> <message> <source>&amp;Copy Address</source> <translation>&amp;Kopiatu helbidea</translation> </message> <message> <source>Delete the currently selected address from the list</source> <translation>Ezabatu aukeratutako helbideak listatik</translation> </message> <message> <source>Export the data in the current tab to a file</source> <translation>Esportatu datuak uneko fitxategian</translation> </message> <message> <source>&amp;Export</source> <translation>&amp;Esportatu</translation> </message> <message> <source>&amp;Delete</source> <translation>&amp;Ezabatu</translation> </message> <message> <source>Choose the address to send coins to</source> <translation>Aukeratu helbidea txanponak bidaltzeko</translation> </message> <message> <source>Choose the address to receive coins with</source> <translation>Aukeratu helbidea txanponak jasotzeko</translation> </message> <message> <source>C&amp;hoose</source> <translation>&amp;Aukeratu</translation> </message> <message> <source>Sending addresses</source> <translation>Helbideak bidaltzen</translation> </message> <message> <source>Receiving addresses</source> <translation>Helbideak jasotzen</translation> </message> <message> <source>These are your VCoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation>Hauek dira zure VCoin helbideak dirua bidaltzeko. Beti egiaztatu diru-kantitatea eta jasotzeko helbidea bidali baino lehen.</translation> </message> <message> <source>These are your VCoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source> <translation>Hauek dira zure VCoin helbideak dirua jasotzeko. Gomendagarria da erabiltzea jasotzeko helbide berri bat operazio bakoitzeko.</translation> </message> <message> <source>Copy &amp;Label</source> <translation>Kopiatu &amp;Etiketa</translation> </message> <message> <source>&amp;Edit</source> <translation>&amp;Editatu</translation> </message> <message> <source>Export Address List</source> <translation>Esportatu helbide lista</translation> </message> <message> <source>Comma separated file (*.csv)</source> <translation>Komaz bereizitako artxiboa (*.csv)</translation> </message> <message> <source>Exporting Failed</source> <translation>Esportatua okerra</translation> </message> <message> <source>There was an error trying to save the address list to %1. Please try again.</source> <translation>Errakuntza bat egon da gordetzen %1 helbide listan. Mesedez, saiatu berriro.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <source>Label</source> <translation>Etiketa</translation> </message> <message> <source>Address</source> <translation>Helbidea</translation> </message> <message> <source>(no label)</source> <translation>(etiketarik ez)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <source>Passphrase Dialog</source> <translation>Pasahitza dialogoa</translation> </message> <message> <source>Enter passphrase</source> <translation>Sartu pasahitza</translation> </message> <message> <source>New passphrase</source> <translation>Pasahitz berria</translation> </message> <message> <source>Repeat new passphrase</source> <translation>Errepikatu pasahitz berria</translation> </message> <message> <source>Encrypt wallet</source> <translation>Enkriptatu zorroa</translation> </message> <message> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Eragiketa honek zorroaren pasahitza behar du zorroa desblokeatzeko.</translation> </message> <message> <source>Unlock wallet</source> <translation>Desblokeatu zorroa</translation> </message> <message> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Eragiketa honek zure zorroaren pasahitza behar du, zorroa desenkriptatzeko.</translation> </message> <message> <source>Decrypt wallet</source> <translation>Desenkriptatu zorroa</translation> </message> <message> <source>Change passphrase</source> <translation>Aldatu pasahitza</translation> </message> <message> <source>Confirm wallet encryption</source> <translation>Berretsi zorroaren enkriptazioa</translation> </message> <message> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR VCOINS&lt;/b&gt;!</source> <translation>Abisua: Zuk enkriptatzen baduzu zure diruzorroa eta zure pasahitza galtzen baduzu, &lt;b&gt;VCOIN GUZTIAK GALDUKO DITUZU&lt;/b&gt;!</translation> </message> <message> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Seguru zaude nahi duzula zure diruzorroa enkriptatu?</translation> </message> <message> <source>VCoin Core will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your vcoins from being stolen by malware infecting your computer.</source> <translation>VCoin Core orain itxiko da enkriptazio prozezua amaitzeko. Gogoratu enkriptatzean zure diruzorroa ez duzula guztiz babesten zure VCoinak lapurretatik infektatzen zure ordenagailua Malwareekin.</translation> </message> <message> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation>GARRANTZITSUA: Aurreko seguritate-kopiak ordeztuko dire berriekin, enkriptatutak. Segurtasun arrazoigaitik, aurreko kopiak ezin dira erabili hasiko zarenean zure diruzorro enkriptatu berriarekin.</translation> </message> <message> <source>Wallet encrypted</source> <translation>Zorroa enkriptatuta</translation> </message> <message> <source>Wallet encryption failed</source> <translation>Zorroaren enkriptazioak huts egin du</translation> </message> <message> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Zorroaren enkriptazioak huts egin du barne-errore baten ondorioz. Zure zorroa ez da enkriptatu.</translation> </message> <message> <source>The supplied passphrases do not match.</source> <translation>Eman dituzun pasahitzak ez datoz bat.</translation> </message> <message> <source>Wallet unlock failed</source> <translation>Zorroaren desblokeoak huts egin du</translation> </message> <message> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>Zorroa desenkriptatzeko sartutako pasahitza okerra da.</translation> </message> <message> <source>Wallet decryption failed</source> <translation>Zorroaren desenkriptazioak huts egin du</translation> </message> </context> <context> <name>BanTableModel</name> </context> <context> <name>VCoinGUI</name> <message> <source>Synchronizing with network...</source> <translation>Sarearekin sinkronizatzen...</translation> </message> <message> <source>&amp;Overview</source> <translation>&amp;Gainbegiratu</translation> </message> <message> <source>Show general overview of wallet</source> <translation>Ikusi zorroaren begirada orokorra</translation> </message> <message> <source>&amp;Transactions</source> <translation>&amp;Transakzioak</translation> </message> <message> <source>Browse transaction history</source> <translation>Ikusi transakzioen historia</translation> </message> <message> <source>E&amp;xit</source> <translation>Irten</translation> </message> <message> <source>Quit application</source> <translation>Irten aplikaziotik</translation> </message> <message> <source>About &amp;Qt</source> <translation>&amp;Qt-ari buruz</translation> </message> <message> <source>Show information about Qt</source> <translation>Erakutsi VCoin-i buruzko informazioa</translation> </message> <message> <source>&amp;Options...</source> <translation>&amp;Aukerak...</translation> </message> <message> <source>&amp;Receiving addresses...</source> <translation>Helbideak jasotzen</translation> </message> <message> <source>Change the passphrase used for wallet encryption</source> <translation>Aldatu zorroa enkriptatzeko erabilitako pasahitza</translation> </message> <message> <source>&amp;File</source> <translation>&amp;Artxiboa</translation> </message> <message> <source>&amp;Settings</source> <translation>&amp;Ezarpenak</translation> </message> <message> <source>&amp;Help</source> <translation>&amp;Laguntza</translation> </message> <message> <source>Tabs toolbar</source> <translation>Fitxen tresna-barra</translation> </message> <message> <source>Up to date</source> <translation>Egunean</translation> </message> <message> <source>Catching up...</source> <translation>Eguneratzen...</translation> </message> <message> <source>Sent transaction</source> <translation>Bidalitako transakzioa</translation> </message> <message> <source>Incoming transaction</source> <translation>Sarrerako transakzioa</translation> </message> <message> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>Zorroa &lt;b&gt;enkriptatuta&lt;/b&gt; eta &lt;b&gt;desblokeatuta&lt;/b&gt; dago une honetan</translation> </message> <message> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>Zorroa &lt;b&gt;enkriptatuta&lt;/b&gt; eta &lt;b&gt;blokeatuta&lt;/b&gt; dago une honetan</translation> </message> </context> <context> <name>ClientModel</name> </context> <context> <name>CoinControlDialog</name> <message> <source>Amount:</source> <translation>Kopurua</translation> </message> <message> <source>Amount</source> <translation>Kopurua</translation> </message> <message> <source>Date</source> <translation>Data</translation> </message> <message> <source>Copy address</source> <translation>Kopiatu helbidea</translation> </message> <message> <source>Copy label</source> <translation>Kopiatu etiketa</translation> </message> <message> <source>(no label)</source> <translation>(etiketarik ez)</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <source>Edit Address</source> <translation>Editatu helbidea</translation> </message> <message> <source>&amp;Label</source> <translation>&amp;Etiketa</translation> </message> <message> <source>&amp;Address</source> <translation>&amp;Helbidea</translation> </message> <message> <source>New receiving address</source> <translation>Jasotzeko helbide berria</translation> </message> <message> <source>New sending address</source> <translation>Bidaltzeko helbide berria</translation> </message> <message> <source>Edit receiving address</source> <translation>Editatu jasotzeko helbidea</translation> </message> <message> <source>Edit sending address</source> <translation>Editatu bidaltzeko helbidea</translation> </message> <message> <source>The entered address "%1" is already in the address book.</source> <translation>Sartu berri den helbidea, "%1", helbide-liburuan dago jadanik.</translation> </message> <message> <source>Could not unlock wallet.</source> <translation>Ezin desblokeatu zorroa.</translation> </message> <message> <source>New key generation failed.</source> <translation>Gako berriaren sorrerak huts egin du.</translation> </message> </context> <context> <name>FreespaceChecker</name> </context> <context> <name>HelpMessageDialog</name> </context> <context> <name>Intro</name> </context> <context> <name>OpenURIDialog</name> </context> <context> <name>OptionsDialog</name> <message> <source>Options</source> <translation>Aukerak</translation> </message> </context> <context> <name>OverviewPage</name> <message> <source>Form</source> <translation>Inprimakia</translation> </message> </context> <context> <name>PaymentServer</name> </context> <context> <name>PeerTableModel</name> </context> <context> <name>QObject</name> <message> <source>Amount</source> <translation>Kopurua</translation> </message> </context> <context> <name>QRImageWidget</name> </context> <context> <name>RPCConsole</name> </context> <context> <name>ReceiveCoinsDialog</name> <message> <source>&amp;Amount:</source> <translation>Kopurua</translation> </message> <message> <source>&amp;Label:</source> <translation>&amp;Etiketa:</translation> </message> <message> <source>&amp;Message:</source> <translation>Mezua</translation> </message> <message> <source>Copy label</source> <translation>Kopiatu etiketa</translation> </message> </context> <context> <name>ReceiveRequestDialog</name> <message> <source>Copy &amp;Address</source> <translation>&amp;Kopiatu helbidea</translation> </message> <message> <source>Address</source> <translation>Helbidea</translation> </message> <message> <source>Amount</source> <translation>Kopurua</translation> </message> <message> <source>Label</source> <translation>Etiketa</translation> </message> <message> <source>Message</source> <translation>Mezua</translation> </message> </context> <context> <name>RecentRequestsTableModel</name> <message> <source>Date</source> <translation>Data</translation> </message> <message> <source>Label</source> <translation>Etiketa</translation> </message> <message> <source>Message</source> <translation>Mezua</translation> </message> <message> <source>Amount</source> <translation>Kopurua</translation> </message> <message> <source>(no label)</source> <translation>(etiketarik ez)</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <source>Send Coins</source> <translation>Bidali txanponak</translation> </message> <message> <source>Amount:</source> <translation>Kopurua</translation> </message> <message> <source>Send to multiple recipients at once</source> <translation>Bidali hainbat jasotzaileri batera</translation> </message> <message> <source>Balance:</source> <translation>Saldoa:</translation> </message> <message> <source>Confirm the send action</source> <translation>Berretsi bidaltzeko ekintza</translation> </message> <message> <source>Confirm send coins</source> <translation>Berretsi txanponak bidaltzea</translation> </message> <message> <source>The amount to pay must be larger than 0.</source> <translation>Ordaintzeko kopurua 0 baino handiagoa izan behar du.</translation> </message> <message> <source>(no label)</source> <translation>(etiketarik ez)</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <source>A&amp;mount:</source> <translation>K&amp;opurua:</translation> </message> <message> <source>Pay &amp;To:</source> <translation>Ordaindu &amp;honi:</translation> </message> <message> <source>Enter a label for this address to add it to your address book</source> <translation>Sartu etiketa bat helbide honetarako, eta gehitu zure helbide-liburuan</translation> </message> <message> <source>&amp;Label:</source> <translation>&amp;Etiketa:</translation> </message> <message> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <source>Paste address from clipboard</source> <translation>Itsatsi helbidea arbeletik</translation> </message> <message> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <source>Message:</source> <translation>Mezua</translation> </message> <message> <source>Pay To:</source> <translation>Ordaindu honi:</translation> </message> </context> <context> <name>ShutdownWindow</name> </context> <context> <name>SignVerifyMessageDialog</name> <message> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <source>Paste address from clipboard</source> <translation>Itsatsi helbidea arbeletik</translation> </message> <message> <source>Alt+P</source> <translation>Alt+P</translation> </message> </context> <context> <name>SplashScreen</name> <message> <source>[testnet]</source> <translation>[testnet]</translation> </message> </context> <context> <name>TrafficGraphWidget</name> </context> <context> <name>TransactionDesc</name> <message> <source>Open until %1</source> <translation>Zabalik %1 arte</translation> </message> <message> <source>%1/unconfirmed</source> <translation>%1/konfirmatu gabe</translation> </message> <message> <source>%1 confirmations</source> <translation>%1 konfirmazioak</translation> </message> <message> <source>Date</source> <translation>Data</translation> </message> <message> <source>Message</source> <translation>Mezua</translation> </message> <message> <source>Transaction</source> <translation>Transakzioaren</translation> </message> <message> <source>Amount</source> <translation>Kopurua</translation> </message> <message> <source>, has not been successfully broadcast yet</source> <translation>, ez da arrakastaz emititu oraindik</translation> </message> <message> <source>unknown</source> <translation>ezezaguna</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <source>Transaction details</source> <translation>Transakzioaren xehetasunak</translation> </message> <message> <source>This pane shows a detailed description of the transaction</source> <translation>Panel honek transakzioaren deskribapen xehea erakusten du</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <source>Date</source> <translation>Data</translation> </message> <message> <source>Type</source> <translation>Mota</translation> </message> <message> <source>Open until %1</source> <translation>Zabalik %1 arte</translation> </message> <message> <source>Confirmed (%1 confirmations)</source> <translation>Konfirmatuta (%1 konfirmazio)</translation> </message> <message> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>Bloke hau ez du beste inongo nodorik jaso, eta seguruenik ez da onartuko!</translation> </message> <message> <source>Generated but not accepted</source> <translation>Sortua, baina ez onartua</translation> </message> <message> <source>Label</source> <translation>Etiketa</translation> </message> <message> <source>Received with</source> <translation>Jasota honekin: </translation> </message> <message> <source>Sent to</source> <translation>Hona bidalia: </translation> </message> <message> <source>Payment to yourself</source> <translation>Ordainketa zeure buruari</translation> </message> <message> <source>Mined</source> <translation>Bildua</translation> </message> <message> <source>(n/a)</source> <translation>(n/a)</translation> </message> <message> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Transakzioaren egoera. Pasatu sagua gainetik konfirmazio kopurua ikusteko.</translation> </message> <message> <source>Date and time that the transaction was received.</source> <translation>Transakzioa jasotako data eta ordua.</translation> </message> <message> <source>Type of transaction.</source> <translation>Transakzio mota.</translation> </message> <message> <source>Amount removed from or added to balance.</source> <translation>Saldoan kendu edo gehitutako kopurua.</translation> </message> </context> <context> <name>TransactionView</name> <message> <source>All</source> <translation>Denak</translation> </message> <message> <source>Today</source> <translation>Gaur</translation> </message> <message> <source>This week</source> <translation>Aste honetan</translation> </message> <message> <source>This month</source> <translation>Hil honetan</translation> </message> <message> <source>Last month</source> <translation>Azken hilean</translation> </message> <message> <source>This year</source> <translation>Aurten</translation> </message> <message> <source>Range...</source> <translation>Muga...</translation> </message> <message> <source>Received with</source> <translation>Jasota honekin: </translation> </message> <message> <source>Sent to</source> <translation>Hona bidalia: </translation> </message> <message> <source>To yourself</source> <translation>Zeure buruari</translation> </message> <message> <source>Mined</source> <translation>Bildua</translation> </message> <message> <source>Other</source> <translation>Beste</translation> </message> <message> <source>Enter address or label to search</source> <translation>Sartu bilatzeko helbide edo etiketa</translation> </message> <message> <source>Min amount</source> <translation>Kopuru minimoa</translation> </message> <message> <source>Copy address</source> <translation>Kopiatu helbidea</translation> </message> <message> <source>Copy label</source> <translation>Kopiatu etiketa</translation> </message> <message> <source>Exporting Failed</source> <translation>Esportatua okerra</translation> </message> <message> <source>Comma separated file (*.csv)</source> <translation>Komaz bereizitako artxiboa (*.csv)</translation> </message> <message> <source>Date</source> <translation>Data</translation> </message> <message> <source>Type</source> <translation>Mota</translation> </message> <message> <source>Label</source> <translation>Etiketa</translation> </message> <message> <source>Address</source> <translation>Helbidea</translation> </message> </context> <context> <name>UnitDisplayStatusBarControl</name> </context> <context> <name>WalletFrame</name> </context> <context> <name>WalletModel</name> <message> <source>Send Coins</source> <translation>Bidali txanponak</translation> </message> </context> <context> <name>WalletView</name> <message> <source>&amp;Export</source> <translation>&amp;Esportatu</translation> </message> <message> <source>Export the data in the current tab to a file</source> <translation>Esportatu datuak uneko fitxategian</translation> </message> </context> <context> <name>vcoin-core</name> <message> <source>Options:</source> <translation>Aukerak</translation> </message> <message> <source>This help message</source> <translation>Laguntza mezu hau</translation> </message> <message> <source>Rescanning...</source> <translation>Birbilatzen...</translation> </message> <message> <source>Done loading</source> <translation>Zamaketa amaitua</translation> </message> </context> </TS>
vcoin-project/v
src/qt/locale/vcoin_eu_ES.ts
TypeScript
mit
27,313
<html> <head> <title></title> </head> <body> <p>google-site-verification: google9e7bb18ac05f47f6.html</p> <script type="application/ld+json"> { "@context" : "http://schema.org", "@type" : "Organization", "name":"OurMine", "url":"https://ourmine.org", "recipeIngredient": [ ] } </script> </body> </html>
abodym/OurMineIo
src/client/google9e7bb18ac05f47f6.html
HTML
mit
328
<!DOCTYPE html> <html> <head> <title>Example</title> <style type="text/css"> .name { color: red; } .extended { color: green; } </style> </head> <body> <div class="example"></div> <script type="text/javascript" src="dist/r3ndr.min.js"></script> <script type="text/javascript"> var example = R('<div>Hello <span class="name"></span></div>').render({name: { text: 'Example'}}, { name: { text: function() { return '<span class="extended">Extended</span> ' + this.text; } } }); var div = document.createElement('div'); div.innerHTML = example; document.getElementsByClassName('example')[0].appendChild(div.firstChild); </script> </body> </html>
Zeetah/r3ndr
index.html
HTML
mit
742
- [2016-05-14 無題][2016-05-14] - [2016-05-13 無題][2016-05-13] - [2016-05-12 『ミスミソウ』をよんだ][2016-05-12] - [2016-05-11 bouzuya/simple-gist-client をつくった][2016-05-11] - [2016-05-10 redux-saga を TypeScript でつかえるかをためした][2016-05-10] - [2016-05-09 Kyoto.js #10 にさんかした][2016-05-09] - [2016-05-08 2016-W18 ふりかえり][2016-05-08] 今週の計画 ([2016-05-08][]) に対する結果は次のようになった。 - ☑ kyoto.js #10 について書く - ☑ redux-saga を TypeScript で動かした例について書く - ☐ 過去の slide を整理して公開する - ☑ peggie をつくりなおす - ☐ プログラミング in OCaml を読む 今週で新たに実施したことは少ない。peggie に関してもほとんどできていない。 来週は[京都 Clojure の集い 16.05](https://e6a302c89833f490f111a94ebc.doorkeeper.jp/events/42877) があるようなので、それに向けて、ひさしく触れていない Clojure を触る。Clojure は 2012 / 2013 年ごろに触っていたようだ。今年が 2016 年なので 3 年ぶりということだろうか。 blog を grep した範囲では大したことをしていないようだけど……。 今回はいまの主戦場である JavaScript に近づけるため ClojureScript を試す予定だ。Clojure に触れることはもうないと思っていたし、今後もそのつもりなので、あくまで今週限定で Clojure / ClojureScript を試そうと思う。 - ☐ Clojure / ClojureScript を試す [2016-05-08]: https://blog.bouzuya.net/2016/05/08/ [2016-05-09]: https://blog.bouzuya.net/2016/05/09/ [2016-05-10]: https://blog.bouzuya.net/2016/05/10/ [2016-05-11]: https://blog.bouzuya.net/2016/05/11/ [2016-05-12]: https://blog.bouzuya.net/2016/05/12/ [2016-05-13]: https://blog.bouzuya.net/2016/05/13/ [2016-05-14]: https://blog.bouzuya.net/2016/05/14/
bouzuya/blog.bouzuya.net
data/2016/05/2016-05-15.md
Markdown
mit
1,939
using System; using System.Collections.Generic; using System.Linq; using System.Reactive.Linq; using System.Windows.Input; using Avalonia.Controls.Generators; using Avalonia.Controls.Metadata; using Avalonia.Controls.Mixins; using Avalonia.Controls.Primitives; using Avalonia.Controls.Templates; using Avalonia.Data; using Avalonia.Input; using Avalonia.Interactivity; using Avalonia.LogicalTree; using Avalonia.VisualTree; #nullable enable namespace Avalonia.Controls { /// <summary> /// A menu item control. /// </summary> [PseudoClasses(":separator", ":icon", ":open", ":pressed", ":selected")] public class MenuItem : HeaderedSelectingItemsControl, IMenuItem, ISelectable, ICommandSource { /// <summary> /// Defines the <see cref="Command"/> property. /// </summary> public static readonly DirectProperty<MenuItem, ICommand?> CommandProperty = Button.CommandProperty.AddOwner<MenuItem>( menuItem => menuItem.Command, (menuItem, command) => menuItem.Command = command, enableDataValidation: true); /// <summary> /// Defines the <see cref="HotKey"/> property. /// </summary> public static readonly StyledProperty<KeyGesture?> HotKeyProperty = HotKeyManager.HotKeyProperty.AddOwner<MenuItem>(); /// <summary> /// Defines the <see cref="CommandParameter"/> property. /// </summary> public static readonly StyledProperty<object> CommandParameterProperty = Button.CommandParameterProperty.AddOwner<MenuItem>(); /// <summary> /// Defines the <see cref="Icon"/> property. /// </summary> public static readonly StyledProperty<object> IconProperty = AvaloniaProperty.Register<MenuItem, object>(nameof(Icon)); /// <summary> /// Defines the <see cref="InputGesture"/> property. /// </summary> public static readonly StyledProperty<KeyGesture> InputGestureProperty = AvaloniaProperty.Register<MenuItem, KeyGesture>(nameof(InputGesture)); /// <summary> /// Defines the <see cref="IsSelected"/> property. /// </summary> public static readonly StyledProperty<bool> IsSelectedProperty = ListBoxItem.IsSelectedProperty.AddOwner<MenuItem>(); /// <summary> /// Defines the <see cref="IsSubMenuOpen"/> property. /// </summary> public static readonly StyledProperty<bool> IsSubMenuOpenProperty = AvaloniaProperty.Register<MenuItem, bool>(nameof(IsSubMenuOpen)); /// <summary> /// Defines the <see cref="StaysOpenOnClick"/> property. /// </summary> public static readonly StyledProperty<bool> StaysOpenOnClickProperty = AvaloniaProperty.Register<MenuItem, bool>(nameof(StaysOpenOnClick)); /// <summary> /// Defines the <see cref="Click"/> event. /// </summary> public static readonly RoutedEvent<RoutedEventArgs> ClickEvent = RoutedEvent.Register<MenuItem, RoutedEventArgs>(nameof(Click), RoutingStrategies.Bubble); /// <summary> /// Defines the <see cref="PointerEnterItem"/> event. /// </summary> public static readonly RoutedEvent<PointerEventArgs> PointerEnterItemEvent = RoutedEvent.Register<InputElement, PointerEventArgs>(nameof(PointerEnterItem), RoutingStrategies.Bubble); /// <summary> /// Defines the <see cref="PointerLeaveItem"/> event. /// </summary> public static readonly RoutedEvent<PointerEventArgs> PointerLeaveItemEvent = RoutedEvent.Register<InputElement, PointerEventArgs>(nameof(PointerLeaveItem), RoutingStrategies.Bubble); /// <summary> /// Defines the <see cref="SubmenuOpened"/> event. /// </summary> public static readonly RoutedEvent<RoutedEventArgs> SubmenuOpenedEvent = RoutedEvent.Register<MenuItem, RoutedEventArgs>(nameof(SubmenuOpened), RoutingStrategies.Bubble); /// <summary> /// The default value for the <see cref="ItemsControl.ItemsPanel"/> property. /// </summary> private static readonly ITemplate<IPanel> DefaultPanel = new FuncTemplate<IPanel>(() => new StackPanel()); private ICommand? _command; private bool _commandCanExecute = true; private bool _commandBindingError; private Popup? _popup; private KeyGesture? _hotkey; private bool _isEmbeddedInMenu; /// <summary> /// Initializes static members of the <see cref="MenuItem"/> class. /// </summary> static MenuItem() { SelectableMixin.Attach<MenuItem>(IsSelectedProperty); PressedMixin.Attach<MenuItem>(); CommandProperty.Changed.Subscribe(CommandChanged); CommandParameterProperty.Changed.Subscribe(CommandParameterChanged); FocusableProperty.OverrideDefaultValue<MenuItem>(true); HeaderProperty.Changed.AddClassHandler<MenuItem>((x, e) => x.HeaderChanged(e)); IconProperty.Changed.AddClassHandler<MenuItem>((x, e) => x.IconChanged(e)); IsSelectedProperty.Changed.AddClassHandler<MenuItem>((x, e) => x.IsSelectedChanged(e)); ItemsPanelProperty.OverrideDefaultValue<MenuItem>(DefaultPanel); ClickEvent.AddClassHandler<MenuItem>((x, e) => x.OnClick(e)); SubmenuOpenedEvent.AddClassHandler<MenuItem>((x, e) => x.OnSubmenuOpened(e)); IsSubMenuOpenProperty.Changed.AddClassHandler<MenuItem>((x, e) => x.SubMenuOpenChanged(e)); } public MenuItem() { // HACK: This nasty but it's all WPF's fault. Grid uses an inherited attached // property to store SharedSizeGroup state, except property inheritance is done // down the logical tree. In this case, the control which is setting // Grid.IsSharedSizeScope="True" is not in the logical tree. Instead of fixing // the way Grid stores shared size state, the developers of WPF just created a // binding of the internal state of the visual parent to the menu item. We don't // have much choice but to do the same for now unless we want to refactor Grid, // which I honestly am not brave enough to do right now. Here's the same hack in // the WPF codebase: // // https://github.com/dotnet/wpf/blob/89537909bdf36bc918e88b37751add46a8980bb0/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/MenuItem.cs#L2126-L2141 // // In addition to the hack from WPF, we also make sure to return null when we have // no parent. If we don't do this, inheritance falls back to the logical tree, // causing the shared size scope in the parent MenuItem to be used, breaking // menu layout. var parentSharedSizeScope = this.GetObservable(VisualParentProperty) .SelectMany(x => { var parent = x as Control; return parent?.GetObservable(DefinitionBase.PrivateSharedSizeScopeProperty) ?? Observable.Return<DefinitionBase.SharedSizeScope?>(null); }); this.Bind(DefinitionBase.PrivateSharedSizeScopeProperty, parentSharedSizeScope); } /// <summary> /// Occurs when a <see cref="MenuItem"/> without a submenu is clicked. /// </summary> public event EventHandler<RoutedEventArgs> Click { add { AddHandler(ClickEvent, value); } remove { RemoveHandler(ClickEvent, value); } } /// <summary> /// Occurs when the pointer enters a menu item. /// </summary> /// <remarks> /// A bubbling version of the <see cref="InputElement.PointerEnter"/> event for menu items. /// </remarks> public event EventHandler<PointerEventArgs> PointerEnterItem { add { AddHandler(PointerEnterItemEvent, value); } remove { RemoveHandler(PointerEnterItemEvent, value); } } /// <summary> /// Raised when the pointer leaves a menu item. /// </summary> /// <remarks> /// A bubbling version of the <see cref="InputElement.PointerLeave"/> event for menu items. /// </remarks> public event EventHandler<PointerEventArgs> PointerLeaveItem { add { AddHandler(PointerLeaveItemEvent, value); } remove { RemoveHandler(PointerLeaveItemEvent, value); } } /// <summary> /// Occurs when a <see cref="MenuItem"/>'s submenu is opened. /// </summary> public event EventHandler<RoutedEventArgs> SubmenuOpened { add { AddHandler(SubmenuOpenedEvent, value); } remove { RemoveHandler(SubmenuOpenedEvent, value); } } /// <summary> /// Gets or sets the command associated with the menu item. /// </summary> public ICommand? Command { get { return _command; } set { SetAndRaise(CommandProperty, ref _command, value); } } /// <summary> /// Gets or sets an <see cref="KeyGesture"/> associated with this control /// </summary> public KeyGesture? HotKey { get { return GetValue(HotKeyProperty); } set { SetValue(HotKeyProperty, value); } } /// <summary> /// Gets or sets the parameter to pass to the <see cref="Command"/> property of a /// <see cref="MenuItem"/>. /// </summary> public object CommandParameter { get { return GetValue(CommandParameterProperty); } set { SetValue(CommandParameterProperty, value); } } /// <summary> /// Gets or sets the icon that appears in a <see cref="MenuItem"/>. /// </summary> public object Icon { get { return GetValue(IconProperty); } set { SetValue(IconProperty, value); } } /// <summary> /// Gets or sets the input gesture that will be displayed in the menu item. /// </summary> /// <remarks> /// Setting this property does not cause the input gesture to be handled by the menu item, /// it simply displays the gesture text in the menu. /// </remarks> public KeyGesture InputGesture { get { return GetValue(InputGestureProperty); } set { SetValue(InputGestureProperty, value); } } /// <summary> /// Gets or sets a value indicating whether the <see cref="MenuItem"/> is currently selected. /// </summary> public bool IsSelected { get { return GetValue(IsSelectedProperty); } set { SetValue(IsSelectedProperty, value); } } /// <summary> /// Gets or sets a value that indicates whether the submenu of the <see cref="MenuItem"/> is /// open. /// </summary> public bool IsSubMenuOpen { get { return GetValue(IsSubMenuOpenProperty); } set { SetValue(IsSubMenuOpenProperty, value); } } /// <summary> /// Gets or sets a value that indicates the submenu that this <see cref="MenuItem"/> is /// within should not close when this item is clicked. /// </summary> public bool StaysOpenOnClick { get { return GetValue(StaysOpenOnClickProperty); } set { SetValue(StaysOpenOnClickProperty, value); } } /// <summary> /// Gets or sets a value that indicates whether the <see cref="MenuItem"/> has a submenu. /// </summary> public bool HasSubMenu => !Classes.Contains(":empty"); /// <summary> /// Gets a value that indicates whether the <see cref="MenuItem"/> is a top-level main menu item. /// </summary> public bool IsTopLevel => Parent is Menu; /// <inheritdoc/> bool IMenuItem.IsPointerOverSubMenu => _popup?.IsPointerOverPopup ?? false; /// <inheritdoc/> IMenuElement? IMenuItem.Parent => Parent as IMenuElement; protected override bool IsEnabledCore => base.IsEnabledCore && _commandCanExecute; /// <inheritdoc/> bool IMenuElement.MoveSelection(NavigationDirection direction, bool wrap) => MoveSelection(direction, wrap); /// <inheritdoc/> IMenuItem? IMenuElement.SelectedItem { get { var index = SelectedIndex; return (index != -1) ? (IMenuItem)ItemContainerGenerator.ContainerFromIndex(index) : null; } set { SelectedIndex = ItemContainerGenerator.IndexFromContainer(value); } } /// <inheritdoc/> IEnumerable<IMenuItem> IMenuElement.SubItems { get { return ItemContainerGenerator.Containers .Select(x => x.ContainerControl) .OfType<IMenuItem>(); } } /// <summary> /// Opens the submenu. /// </summary> /// <remarks> /// This has the same effect as setting <see cref="IsSubMenuOpen"/> to true. /// </remarks> public void Open() => IsSubMenuOpen = true; /// <summary> /// Closes the submenu. /// </summary> /// <remarks> /// This has the same effect as setting <see cref="IsSubMenuOpen"/> to false. /// </remarks> public void Close() => IsSubMenuOpen = false; /// <inheritdoc/> void IMenuItem.RaiseClick() => RaiseEvent(new RoutedEventArgs(ClickEvent)); /// <inheritdoc/> protected override IItemContainerGenerator CreateItemContainerGenerator() { return new MenuItemContainerGenerator(this); } protected override void OnPointerReleased(PointerReleasedEventArgs e) { base.OnPointerReleased(e); if (!_isEmbeddedInMenu) { //Normally the Menu's IMenuInteractionHandler is sending the click events for us //However when the item is not embedded into a menu we need to send them ourselves. RaiseEvent(new RoutedEventArgs(ClickEvent)); } } protected override void OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs e) { if (_hotkey != null) // Control attached again, set Hotkey to create a hotkey manager for this control { HotKey = _hotkey; } base.OnAttachedToLogicalTree(e); if (Command != null) { Command.CanExecuteChanged += CanExecuteChanged; } TryUpdateCanExecute(); var parent = Parent; while (parent is MenuItem) { parent = parent.Parent; } _isEmbeddedInMenu = parent.FindLogicalAncestorOfType<IMenu>(true) != null; } protected override void OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs e) { // This will cause the hotkey manager to dispose the observer and the reference to this control if (HotKey != null) { _hotkey = HotKey; HotKey = null; } base.OnDetachedFromLogicalTree(e); if (Command != null) { Command.CanExecuteChanged -= CanExecuteChanged; } } /// <summary> /// Called when the <see cref="MenuItem"/> is clicked. /// </summary> /// <param name="e">The click event args.</param> protected virtual void OnClick(RoutedEventArgs e) { if (!e.Handled && Command?.CanExecute(CommandParameter) == true) { Command.Execute(CommandParameter); e.Handled = true; } } /// <inheritdoc/> protected override void OnGotFocus(GotFocusEventArgs e) { base.OnGotFocus(e); e.Handled = UpdateSelectionFromEventSource(e.Source, true); } /// <inheritdoc/> protected override void OnKeyDown(KeyEventArgs e) { // Don't handle here: let event bubble up to menu. } /// <inheritdoc/> protected override void OnPointerEnter(PointerEventArgs e) { base.OnPointerEnter(e); var point = e.GetCurrentPoint(null); RaiseEvent(new PointerEventArgs(PointerEnterItemEvent, this, e.Pointer, this.VisualRoot, point.Position, e.Timestamp, point.Properties, e.KeyModifiers)); } /// <inheritdoc/> protected override void OnPointerLeave(PointerEventArgs e) { base.OnPointerLeave(e); var point = e.GetCurrentPoint(null); RaiseEvent(new PointerEventArgs(PointerLeaveItemEvent, this, e.Pointer, this.VisualRoot, point.Position, e.Timestamp, point.Properties, e.KeyModifiers)); } /// <summary> /// Called when a submenu is opened on this MenuItem or a child MenuItem. /// </summary> /// <param name="e">The event args.</param> protected virtual void OnSubmenuOpened(RoutedEventArgs e) { var menuItem = e.Source as MenuItem; if (menuItem != null && menuItem.Parent == this) { foreach (var child in ((IMenuItem)this).SubItems) { if (child != menuItem && child.IsSubMenuOpen) { child.IsSubMenuOpen = false; } } } } /// <inheritdoc/> protected override void OnApplyTemplate(TemplateAppliedEventArgs e) { if (_popup != null) { _popup.Opened -= PopupOpened; _popup.Closed -= PopupClosed; _popup.DependencyResolver = null; } _popup = e.NameScope.Find<Popup>("PART_Popup"); if (_popup != null) { _popup.DependencyResolver = DependencyResolver.Instance; _popup.Opened += PopupOpened; _popup.Closed += PopupClosed; } } protected override void UpdateDataValidation<T>(AvaloniaProperty<T> property, BindingValue<T> value) { base.UpdateDataValidation(property, value); if (property == CommandProperty) { _commandBindingError = value.Type == BindingValueType.BindingError; if (_commandBindingError && _commandCanExecute) { _commandCanExecute = false; UpdateIsEffectivelyEnabled(); } } } /// <summary> /// Closes all submenus of the menu item. /// </summary> private void CloseSubmenus() { foreach (var child in ((IMenuItem)this).SubItems) { child.IsSubMenuOpen = false; } } /// <summary> /// Called when the <see cref="Command"/> property changes. /// </summary> /// <param name="e">The event args.</param> private static void CommandChanged(AvaloniaPropertyChangedEventArgs e) { if (e.Sender is MenuItem menuItem && ((ILogical)menuItem).IsAttachedToLogicalTree) { if (e.OldValue is ICommand oldCommand) { oldCommand.CanExecuteChanged -= menuItem.CanExecuteChanged; } if (e.NewValue is ICommand newCommand) { newCommand.CanExecuteChanged += menuItem.CanExecuteChanged; } menuItem.TryUpdateCanExecute(); } } /// <summary> /// Called when the <see cref="CommandParameter"/> property changes. /// </summary> /// <param name="e">The event args.</param> private static void CommandParameterChanged(AvaloniaPropertyChangedEventArgs e) { if (e.Sender is MenuItem menuItem) { menuItem.TryUpdateCanExecute(); } } /// <summary> /// Called when the <see cref="ICommand.CanExecuteChanged"/> event fires. /// </summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event args.</param> private void CanExecuteChanged(object sender, EventArgs e) { TryUpdateCanExecute(); } /// <summary> /// Tries to evaluate CanExecute value of a Command if menu is opened /// </summary> private void TryUpdateCanExecute() { if (Command == null) { _commandCanExecute = !_commandBindingError; UpdateIsEffectivelyEnabled(); return; } //Perf optimization - only raise CanExecute event if the menu is open if (!((ILogical)this).IsAttachedToLogicalTree || Parent is MenuItem { IsSubMenuOpen: false }) { return; } var canExecute = Command.CanExecute(CommandParameter); if (canExecute != _commandCanExecute) { _commandCanExecute = canExecute; UpdateIsEffectivelyEnabled(); } } /// <summary> /// Called when the <see cref="HeaderedSelectingItemsControl.Header"/> property changes. /// </summary> /// <param name="e">The property change event.</param> private void HeaderChanged(AvaloniaPropertyChangedEventArgs e) { if (e.NewValue is string newValue && newValue == "-") { PseudoClasses.Add(":separator"); Focusable = false; } else if (e.OldValue is string oldValue && oldValue == "-") { PseudoClasses.Remove(":separator"); Focusable = true; } } /// <summary> /// Called when the <see cref="Icon"/> property changes. /// </summary> /// <param name="e">The property change event.</param> private void IconChanged(AvaloniaPropertyChangedEventArgs e) { var oldValue = e.OldValue as ILogical; var newValue = e.NewValue as ILogical; if (oldValue != null) { LogicalChildren.Remove(oldValue); PseudoClasses.Remove(":icon"); } if (newValue != null) { LogicalChildren.Add(newValue); PseudoClasses.Add(":icon"); } } /// <summary> /// Called when the <see cref="IsSelected"/> property changes. /// </summary> /// <param name="e">The property change event.</param> private void IsSelectedChanged(AvaloniaPropertyChangedEventArgs e) { if ((bool)e.NewValue!) { Focus(); } } /// <summary> /// Called when the <see cref="IsSubMenuOpen"/> property changes. /// </summary> /// <param name="e">The property change event.</param> private void SubMenuOpenChanged(AvaloniaPropertyChangedEventArgs e) { var value = (bool)e.NewValue!; if (value) { foreach (var item in Items.OfType<MenuItem>()) { item.TryUpdateCanExecute(); } RaiseEvent(new RoutedEventArgs(SubmenuOpenedEvent)); IsSelected = true; PseudoClasses.Add(":open"); } else { CloseSubmenus(); SelectedIndex = -1; PseudoClasses.Remove(":open"); } } /// <summary> /// Called when the submenu's <see cref="Popup"/> is opened. /// </summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event args.</param> private void PopupOpened(object sender, EventArgs e) { var selected = SelectedIndex; if (selected != -1) { var container = ItemContainerGenerator.ContainerFromIndex(selected); container?.Focus(); } } /// <summary> /// Called when the submenu's <see cref="Popup"/> is closed. /// </summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event args.</param> private void PopupClosed(object sender, EventArgs e) { SelectedItem = null; } void ICommandSource.CanExecuteChanged(object sender, EventArgs e) => this.CanExecuteChanged(sender, e); /// <summary> /// A dependency resolver which returns a <see cref="MenuItemAccessKeyHandler"/>. /// </summary> private class DependencyResolver : IAvaloniaDependencyResolver { /// <summary> /// Gets the default instance of <see cref="DependencyResolver"/>. /// </summary> public static readonly DependencyResolver Instance = new DependencyResolver(); /// <summary> /// Gets a service of the specified type. /// </summary> /// <param name="serviceType">The service type.</param> /// <returns>A service of the requested type.</returns> public object? GetService(Type serviceType) { if (serviceType == typeof(IAccessKeyHandler)) { return new MenuItemAccessKeyHandler(); } else { return AvaloniaLocator.Current.GetService(serviceType); } } } } }
jkoritzinsky/Avalonia
src/Avalonia.Controls/MenuItem.cs
C#
mit
26,714
# ios-simulator [![NPM version][npm-image]][npm-url] [![build status][travis-image]][travis-url] [![Test coverage][coveralls-image]][coveralls-url] [![node version][node-image]][node-url] [![npm download][download-image]][download-url] [npm-image]: https://img.shields.io/npm/v/ios-simulator.svg?style=flat-square [npm-url]: https://npmjs.org/package/ios-simulator [travis-image]: https://img.shields.io/travis/macacajs/ios-simulator.svg?style=flat-square [travis-url]: https://travis-ci.org/macacajs/ios-simulator [coveralls-image]: https://img.shields.io/coveralls/macacajs/ios-simulator.svg?style=flat-square [coveralls-url]: https://coveralls.io/r/macacajs/ios-simulator?branch=master [node-image]: https://img.shields.io/badge/node.js-%3E=_0.10-green.svg?style=flat-square [node-url]: http://nodejs.org/download/ [download-image]: https://img.shields.io/npm/dm/ios-simulator.svg?style=flat-square [download-url]: https://npmjs.org/package/ios-simulator > iOS Simulator Node.js wrapper <!-- GITCONTRIBUTOR_START --> ## Contributors |[<img src="https://avatars1.githubusercontent.com/u/1011681?v=4" width="100px;"/><br/><sub><b>xudafeng</b></sub>](https://github.com/xudafeng)<br/>|[<img src="https://avatars1.githubusercontent.com/u/1044425?v=4" width="100px;"/><br/><sub><b>ziczhu</b></sub>](https://github.com/ziczhu)<br/>|[<img src="https://avatars1.githubusercontent.com/u/13992714?v=4" width="100px;"/><br/><sub><b>twink1e</b></sub>](https://github.com/twink1e)<br/>|[<img src="https://avatars3.githubusercontent.com/u/1209810?v=4" width="100px;"/><br/><sub><b>paradite</b></sub>](https://github.com/paradite)<br/>|[<img src="https://avatars0.githubusercontent.com/u/4576123?v=4" width="100px;"/><br/><sub><b>CodeToSurvive1</b></sub>](https://github.com/CodeToSurvive1)<br/>|[<img src="https://avatars0.githubusercontent.com/u/1210832?v=4" width="100px;"/><br/><sub><b>djhr</b></sub>](https://github.com/djhr)<br/> | :---: | :---: | :---: | :---: | :---: | :---: | This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto upated at `Sun Apr 19 2020 23:35:24 GMT+0800`. <!-- GITCONTRIBUTOR_END --> ## Installment ```bash $ npm i ios-simulator --save ``` ## Usage Enable Developer Mode: ```bash $ DevToolsSecurity -enable ``` ```bash $ npm i ios-simulator -g $ ios-simulator -n 'iPhone 6s' $ xcrun simctl shutdown `ios-simulator -n 'iPhone 6s'` $ open -a Simulator --args -CurrentDeviceUDID `ios-simulator -n 'iPhone 6s'` ``` ## License The MIT License (MIT)
xudafeng/ios-simulator
README.md
Markdown
mit
2,525
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;vertical-align:baseline;border:0;font:inherit;font-size:100%} article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block} body {width: 100%;line-height: 1} ul {list-style:none} blockquote, q {quotes:none} blockquote:before, blockquote:after, q:before, q:after {content: '';content: none} table {border-spacing: 0;border-collapse:collapse} header {width:100%;display:inline-block;background-color:#000;position:fixed;z-index:999} header nav ul li:hover{color:#FFF} header #logo {float:left;padding:10px;display: block; margin-top: 7px} header a {font-family:"Open Sans",sans-serif;font-weight:300;color:#7f8c8d;font-size:2em; text-decoration: none} nav a, header a, #logo a{font-size: 19px;color:#7f8c8d;text-decoration:none} nav a:hover, #logo a:hover{color:#FFF} header nav {float:right;padding-top:20px;padding-bottom: 20px;color:#fff;padding-right: 15px;font-family: "lato", "Sans-serif";font-weight:300} header nav ul {margin:0;padding-bottom: 0px;float:right;color:#7f8c8d;} header nav li {display:inline} header nav li + li {padding-left:4px} body{background-color:#fff;font-size: 13px;font-family:"Open Sans",sans-serif} #slides {display:none;display:block} #slides li {overflow: hidden;height:368px;border:3px solid red;} iframe{display:block;width:100%;height:400px} h1, h2, h3, p, li, th, td{font-family:"Open Sans",sans-serif} h1 {font-size:2.5em;font-weight:800;line-height:1.25em;} a {text-decoration:underline;color:#000;} a:hover{color:red;} .container{max-width:1110px;display:block; margin: 0 auto} .cf{clear:both} #totop{display:none} #enter{border-bottom:1px solid #ccc;margin-bottom:25px;padding:100px 0 25px 20px} #enter h1{padding-bottom:5px;text-align:left;} #enter h2{float:right;font-weight:300} #enter p{margin-bottom:15px;text-align:left;} p {font-size:1.125em;line-height:1.65em} #cor, #lic, #oli, #her, #cor3, #lic3, #oli3, #her3{display:none} #slides li {overflow:hidden;height:368px;border: 3px solid red} #thumbnails {margin-bottom:25px;} #thumbnails ul li{display:inline-block;padding:5px 40px;cursor:pointer} #thumbnails ul li img{border:3px solid transparent} #thumbnails ul{text-align:center} .table-data {text-align:center} .table-data th {background-color: #444;color: #fff;font-size: 1.6em;padding: 15px;width: 33.3%;} .table-data td {background-color: #e74c3c;color: #fff;font-family: sans-serif;font-size: 4em;padding: 15px;width: 33.3%;} #cor3 td {background-color: #27ae60} #lic3 td {background-color: #2980b9} #oli3 td {background-color: #e67e22} #her3 td {background-color: #7f8c8d} #thumbnails li#ng1 img{border:3px solid red} #more {padding:25px} #more h1{text-align:center} #more p{font-weight:400} #more p.ques{padding:5px 0px} #more p.ans{font-weight:300} #download{margin-top:10px;padding:25px;font-weight:300;background-color:#ecf0f1;} #download #button{border:1px solid;width:20%;padding:20px 30px;display:block;text-align:center;font-size:20px;cursor:pointer;float:right} #download #button:hover{color:#fff;background-color:#000} #disclaimer {width:70%;float:left;display:block} #disclaimer p{font-size:.85em;color:#666} #end{margin-top:10px;text-align:center;font-size:40px;font-weight:300;} p.instructions { color: #999; font-style: italic; text-align: center; } p.disclaimer { color: #999; font-size: .9em; text-align: right; } /* Clear Floated Elements */ /* http://sonspring.com/journal/clearing-floats */ .clear { clear: both; display: block; overflow: hidden; visibility: hidden; width: 0; height: 0; } /* http://www.yuiblog.com/blog/2010/09/27/clearfix-reloaded-overflowhidden-demystified */ .clearfix:before, .clearfix:after { content: '\0020'; display: block; overflow: hidden; visibility: hidden; width: 0; height: 0; } .clearfix:after { clear: both; }
codeforsanjose/OpenDSJ
css/style.css
CSS
mit
4,209
// Copyright (c) 2001-2019 Aspose Pty Ltd. All Rights Reserved. // // This file is part of Aspose.Words. The source code in this file // is only intended as a supplement to the documentation, and is provided // "as is", without warranty of any kind, either expressed or implied. ////////////////////////////////////////////////////////////////////////// package ApiExamples; // ********* THIS FILE IS AUTO PORTED ********* import org.testng.annotations.Test; import com.aspose.words.DigitalSignatureCollection; import com.aspose.words.DigitalSignatureUtil; import java.util.Iterator; import com.aspose.words.DigitalSignature; import com.aspose.ms.System.msConsole; @Test public class ExDigitalSignatureCollection extends ApiExampleBase { @Test public void iterator() { //ExStart //ExFor:DigitalSignatureCollection.GetEnumerator //ExSummary:Shows how to load and enumerate all digital signatures of a document. DigitalSignatureCollection digitalSignatures = DigitalSignatureUtil.loadSignatures(getMyDir() + "Document.DigitalSignature.docx"); Iterator<DigitalSignature> enumerator = digitalSignatures.iterator(); try /*JAVA: was using*/ { while (enumerator.hasNext()) { // Do something useful DigitalSignature ds = enumerator.next(); if (ds != null) msConsole.writeLine(ds.toString()); } } finally { if (enumerator != null) enumerator.close(); } //ExEnd } }
asposewords/Aspose_Words_Java
ApiExamples/JavaPorting/ExDigitalSignatureCollection.java
Java
mit
1,575
#!/usr/bin/env python import cv2 import cv2.cv as cv class Display: def setup(self, fullscreen): cv2.namedWindow('proj_0', cv2.WINDOW_OPENGL) if fullscreen: cv2.setWindowProperty('proj_0', cv2.WND_PROP_FULLSCREEN, cv.CV_WINDOW_FULLSCREEN) def draw(self, image): cv2.imshow('proj_0', image) cv2.waitKey(1)
light-swarm/lightswarm_render
scripts/display.py
Python
mit
385
// A '.tsx' file enables JSX support in the TypeScript compiler, // for more information see the following page on the TypeScript wiki: // https://github.com/Microsoft/TypeScript/wiki/JSX /// ../typings/es6-promise/es6-promise.d.ts var Adal = require('./adal.js'); // very important!!! if you put these locally then multiple versions of react get loaded and cause random errors var React = require('react'); var ReactDOM = require('react-dom'); var Office365_Adal = (function () { function Office365_Adal() { } Office365_Adal.launchWebAuth = function () { // redirectUri: 'ms-app://S-1-15-2-362237037-3722746685-439561638-2597901564-3613092599-1873846187-518014421' /* GET https://login.microsoftonline.com/common/oauth2/v2.0/authorize? response_type=code& client_id=32613fc5-e7ac-4894-ac94-fbc39c9f3e4a& redirect_uri=https:%2f%2foauthplay.azurewebsites.net%2f& scope=openid+offline_access+https:%2f%2foutlook.office.com%2fmail.read+https:%2f%2foutlook.office.com%2fcalendars.read+https:%2f%2foutlook.office.com%2fcontacts.read&state=f561be3f-e050-4251-bf32-9ae73fc7a6ce& prompt=login HTTP/1.1 */ var urlToGo = ''; var displayCallback = function (url) { urlToGo = url; }; var config = { tenant: 'trewin.onmicrosoft.com', clientId: 'fd79b0e0-38b3-42e7-97fd-2f42d47beb6f', cacheLocation: 'localStorage', instance: 'https://login.windows.net/', resource: 'https://outlook.office365.com', endpoints: { 'https://outlook.office.com/api/v1.0/me/folders/inbox/messages': 'https://outlook.office.com' } }; var authContext = new Adal.inject(config); // always logout for now authContext.logOut(); Office365_Adal.getUser(authContext).then(function (token) { console.log(token); authContext.acquireToken(config.resource, function (error, token) { if (error || !token) { console.log(error); return; } }); }); }; Office365_Adal.getUser = function (authContext) { var dummyAuthPage = 'default.html'; return new Promise(function (resolve, reject) { // If the user is cached, resolve the promise immediately. //var user = authContext.getCachedUser(); //if (user) { // resolve(user); // return; //} // The user was not cached. Open a popup window which // performs the OAuth login process, then signals // the result. authContext.config.redirectUri = window.location.href; var isCallback = authContext.isCallback(window.location.hash); authContext.handleWindowCallback(); if (isCallback && !authContext.getLoginError()) { window.location = authContext._getItem(authContext.CONSTANTS.STORAGE.LOGIN_REQUEST); } var user = authContext.getCachedUser(); if (user) { resolve(user); return; } else { authContext.login(); } }); }; return Office365_Adal; })(); module.exports = Office365_Adal; //// var officeURL = 'https://login.microsoftonline.com/trewin.onmicrosoft.com/oauth2/authorize?response_type=code&client_id='; ////var windowsLoginURL = 'https://login.microsoftonline.com/448cfd31-021b-4a3c-beb9-26d8ba169252/oauth2/v2.0/authorize?response_type=code&client_id='; //var windowsLoginURL = "https://login.windows.net/Common/oauth2/authorize?response_type=code&client_id="; //var clientID = 'fd79b0e0-38b3-42e7-97fd-2f42d47beb6f'; //var callbackURL = 'http://localhost:3030/oauth2Callback'; //// var callbackURL = 'ms-app://S-1-15-2-362237037-3722746685-439561638-2597901564-3613092599-1873846187-518014421'; //// var scope = 'https://outlook.office.com/Mail.Read'; //// var resource = "00000002-0000-0000-c000-000000000000"; //var resource = "https://outlook.office365.com"; //# sourceMappingURL=Office365_Adal.js.map
traceyt/inbox-crawler
client/DeClutter2/DeClutter2/src/Office365_Adal.js
JavaScript
mit
4,215
--- layout: post title: 【A2 Family】Vol.2 不想当明星的宅男可能并不存在 subtitle: 今天方方去了《鲁豫有约》。 language: zh cover: fog.jpg published: true categories: - a2 --- <!-- 今天是第一期,希望你们喜欢。 --> ![page01](/image/A2Family/VOL2/1.jpg) ![page02](/image/A2Family/VOL2/2.jpg)
applysquare/applysquare.github.io
_posts/2015-07-03-vol02.markdown
Markdown
mit
334
#pragma once #include <memory> namespace fas { /** * @brief Holds a shared inner executor, which can be copied */ template <class Executor> class ExecutorPtr { public: ExecutorPtr(std::shared_ptr<Executor> innerExecutor) : _innerExecutor(std::move(innerExecutor)) {} template <class Fn> void spawn(Fn&& fn) { _innerExecutor->spawn(std::forward<Fn>(fn)); } private: std::shared_ptr<Executor> _innerExecutor; }; } // namespace fass
decden/hotel
fas/executorptr.h
C
mit
464
require 'spec_helper' describe :Comment, :vcr do context "get_media_comments" do let(:comments) { Flickrie.get_media_comments(MEDIA_ID) } it "should have correct attributes" do comment = comments.first comment.id.should_not be_nil comment.author.nsid.should == USER_NSID comment.author.username.should == USER_USERNAME comment.author.icon_server.should be_a(String) comment.author.icon_farm.should be_a(Fixnum) comment.created_at.should be_a(Time) comment.permalink.should be_a(String) comment.content.should be_a(String) comment.to_s.should == comment.content comment.photo.id.should be_a(String) comment.video.id.should be_a(String) end end end
janko-m/flickrie
spec/flickrie/comment_spec.rb
Ruby
mit
741
<?php namespace spec\Genesis\API\Request\Financial\OnlineBankingPayments; use Genesis\API\Request\Financial\OnlineBankingPayments\Pse; use PhpSpec\ObjectBehavior; use spec\SharedExamples\Genesis\API\Request\Financial\AsyncAttributesExample; use spec\SharedExamples\Genesis\API\Request\Financial\PendingPaymentAttributesExamples; use spec\SharedExamples\Genesis\API\Request\RequestExamples; class PseSpec extends ObjectBehavior { use RequestExamples, AsyncAttributesExample, PendingPaymentAttributesExamples; public function it_is_initializable() { $this->shouldHaveType(Pse::class); } public function it_should_fail_when_country_not_co_param() { $this->setRequestParameters(); $this->setBillingCountry('BG'); $this->shouldThrow()->during('getDocument'); } public function it_should_fail_when_country_not_valid_param() { $this->setRequestParameters(); $this->setBillingCountry('BG'); $this->shouldThrow()->during('getDocument'); } protected function setRequestParameters() { $this->setDefaultRequestParameters(); $this->setConsumerReference('1234'); $this->setNationalId('1234'); $this->setCurrency('USD'); $this->setBillingCountry('CO'); } }
GenesisGateway/genesis_php
spec/Genesis/API/Request/Financial/OnlineBankingPayments/PseSpec.php
PHP
mit
1,298
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="de"> <head> <title>org.eclipse.emf.cdo.edit (CDO Model Repository Documentation)</title> <meta name="date" content=""> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="org.eclipse.emf.cdo.edit (CDO Model Repository Documentation)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li class="navBarCell1Rev">Package</li> <li>Class</li> <li><a href="package-use.html">Use</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/eclipse/emf/cdo/compare/package-summary.html">Prev&nbsp;Package</a></li> <li><a href="../../../../../org/eclipse/emf/cdo/eresource/package-summary.html">Next&nbsp;Package</a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/eclipse/emf/cdo/edit/package-summary.html" target="_top">Frames</a></li> <li><a href="package-summary.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h1 title="Package" class="title">Package&nbsp;org.eclipse.emf.cdo.edit</h1> <div class="docSummary"> <div class="block">Useful base classes that can be referenced from custom EMF generator models.</div> </div> <p>See:&nbsp;<a href="#package.description">Description</a></p> </div> <div class="contentContainer"> <ul class="blockList"> <li class="blockList"> <table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation"> <caption><span>Class Summary</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Class</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/eclipse/emf/cdo/edit/CDOEditPlugin.html" title="class in org.eclipse.emf.cdo.edit">CDOEditPlugin</a></td> <td class="colLast"> <div class="block">This is the central singleton for the Eresource edit plugin</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/eclipse/emf/cdo/edit/CDOEditPlugin.Implementation.html" title="class in org.eclipse.emf.cdo.edit">CDOEditPlugin.Implementation</a></td> <td class="colLast"> <div class="block">The actual implementation of the Eclipse <b>Plugin</b></div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/eclipse/emf/cdo/edit/CDOItemProviderAdapter.html" title="class in org.eclipse.emf.cdo.edit">CDOItemProviderAdapter</a></td> <td class="colLast"> <div class="block">Adds CDO-specific properties to <a href="http://download.eclipse.org/modeling/emf/emf/javadoc/2.11/org/eclipse/emf/ecore/EObject.html?is-external=true" title="class or interface in org.eclipse.emf.ecore"><code>objects</code></a>, such as <a href="../../../../../org/eclipse/emf/cdo/CDOObject.html#cdoID--"><code>ID</code></a>, <a href="../../../../../org/eclipse/emf/cdo/common/branch/CDOBranchVersion.html#getVersion--"><code>version</code></a> and <a href="../../../../../org/eclipse/emf/cdo/CDOObject.html#cdoState--"><code>state</code></a>.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/eclipse/emf/cdo/edit/CDOItemProviderAdapter.AdaptersDescriptor.html" title="class in org.eclipse.emf.cdo.edit">CDOItemProviderAdapter.AdaptersDescriptor</a></td> <td class="colLast">Deprecated <div class="block"><span class="deprecationComment">as of 4.4 not used any more.</span></div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/eclipse/emf/cdo/edit/CDOItemProviderAdapter.CDOPropertyDescriptor.html" title="class in org.eclipse.emf.cdo.edit">CDOItemProviderAdapter.CDOPropertyDescriptor</a></td> <td class="colLast"> <div class="block">Base abstract to add CDO debug information to PropertiesView.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/eclipse/emf/cdo/edit/CDOItemProviderAdapter.CDOPropertyDescriptor.DefaultLabelProvider.html" title="class in org.eclipse.emf.cdo.edit">CDOItemProviderAdapter.CDOPropertyDescriptor.DefaultLabelProvider</a></td> <td class="colLast">Deprecated <div class="block"><span class="deprecationComment">as of 4.4 not used any more.</span></div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/eclipse/emf/cdo/edit/CDOItemProviderAdapter.ChangeSubscriptionPoliciesDescriptor.html" title="class in org.eclipse.emf.cdo.edit">CDOItemProviderAdapter.ChangeSubscriptionPoliciesDescriptor</a></td> <td class="colLast">Deprecated <div class="block"><span class="deprecationComment">as of 4.4 not used any more.</span></div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/eclipse/emf/cdo/edit/CDOItemProviderAdapter.ContainerDescriptor.html" title="class in org.eclipse.emf.cdo.edit">CDOItemProviderAdapter.ContainerDescriptor</a></td> <td class="colLast">Deprecated <div class="block"><span class="deprecationComment">as of 4.4 not used any more.</span></div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/eclipse/emf/cdo/edit/CDOItemProviderAdapter.DirectResourceDescriptor.html" title="class in org.eclipse.emf.cdo.edit">CDOItemProviderAdapter.DirectResourceDescriptor</a></td> <td class="colLast">Deprecated <div class="block"><span class="deprecationComment">as of 4.4 not used any more.</span></div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/eclipse/emf/cdo/edit/CDOItemProviderAdapter.IDDescriptor.html" title="class in org.eclipse.emf.cdo.edit">CDOItemProviderAdapter.IDDescriptor</a></td> <td class="colLast">Deprecated <div class="block"><span class="deprecationComment">as of 4.4 not used any more.</span></div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/eclipse/emf/cdo/edit/CDOItemProviderAdapter.ReadLockedDescriptor.html" title="class in org.eclipse.emf.cdo.edit">CDOItemProviderAdapter.ReadLockedDescriptor</a></td> <td class="colLast">Deprecated <div class="block"><span class="deprecationComment">as of 4.4 not used any more.</span></div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/eclipse/emf/cdo/edit/CDOItemProviderAdapter.StateDescriptor.html" title="class in org.eclipse.emf.cdo.edit">CDOItemProviderAdapter.StateDescriptor</a></td> <td class="colLast">Deprecated <div class="block"><span class="deprecationComment">as of 4.4 not used any more.</span></div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/eclipse/emf/cdo/edit/CDOItemProviderAdapter.URIDescriptor.html" title="class in org.eclipse.emf.cdo.edit">CDOItemProviderAdapter.URIDescriptor</a></td> <td class="colLast">Deprecated <div class="block"><span class="deprecationComment">as of 4.4 not used any more.</span></div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/eclipse/emf/cdo/edit/CDOItemProviderAdapter.VersionDescriptor.html" title="class in org.eclipse.emf.cdo.edit">CDOItemProviderAdapter.VersionDescriptor</a></td> <td class="colLast">Deprecated <div class="block"><span class="deprecationComment">as of 4.4 not used any more.</span></div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/eclipse/emf/cdo/edit/CDOItemProviderAdapter.ViewDescriptor.html" title="class in org.eclipse.emf.cdo.edit">CDOItemProviderAdapter.ViewDescriptor</a></td> <td class="colLast">Deprecated <div class="block"><span class="deprecationComment">as of 4.4 not used any more.</span></div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../org/eclipse/emf/cdo/edit/CDOItemProviderAdapter.WriteLockedDescriptor.html" title="class in org.eclipse.emf.cdo.edit">CDOItemProviderAdapter.WriteLockedDescriptor</a></td> <td class="colLast">Deprecated <div class="block"><span class="deprecationComment">as of 4.4 not used any more.</span></div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../org/eclipse/emf/cdo/edit/CDOItemProviderAdapter.WriteOptionDescriptor.html" title="class in org.eclipse.emf.cdo.edit">CDOItemProviderAdapter.WriteOptionDescriptor</a></td> <td class="colLast">Deprecated <div class="block"><span class="deprecationComment">as of 4.4 not used any more.</span></div> </td> </tr> </tbody> </table> </li> </ul> <a name="package.description"> <!-- --> </a> <h2 title="Package org.eclipse.emf.cdo.edit Description">Package org.eclipse.emf.cdo.edit Description</h2> <div class="block">Useful base classes that can be referenced from custom EMF generator models.</div> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li class="navBarCell1Rev">Package</li> <li>Class</li> <li><a href="package-use.html">Use</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/eclipse/emf/cdo/compare/package-summary.html">Prev&nbsp;Package</a></li> <li><a href="../../../../../org/eclipse/emf/cdo/eresource/package-summary.html">Next&nbsp;Package</a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/eclipse/emf/cdo/edit/package-summary.html" target="_top">Frames</a></li> <li><a href="package-summary.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small><i>Copyright (c) 2011-2015 Eike Stepper (Berlin, Germany) and others.</i></small></p> </body> </html>
kribe48/wasp-mbse
WASP-turtlebot-DSL/.metadata/.plugins/org.eclipse.pde.core/Eclipse Application/org.eclipse.osgi/142/0/.cp/javadoc/org/eclipse/emf/cdo/edit/package-summary.html
HTML
mit
11,848
/* For more information, please see: http://software.sci.utah.edu The MIT License Copyright (c) 2015 Scientific Computing and Imaging Institute, University of Utah. 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. */ #ifndef Graphics_Graphics_Widgets_Widget_H #define Graphics_Graphics_Widgets_Widget_H #include <Graphics/Datatypes/GeometryImpl.h> #include <Core/GeometryPrimitives/Point.h> #include <Graphics/Widgets/share.h> namespace SCIRun { namespace Graphics { namespace Datatypes { class SCISHARE WidgetBase : public GeometryObjectSpire { public: WidgetBase(const Core::GeometryIDGenerator& idGenerator, const std::string& tag, bool isClippable); }; using WidgetHandle = SharedPointer<WidgetBase>; struct SCISHARE BoxPosition { Core::Geometry::Point center_, right_, down_, in_; void setPosition(const Core::Geometry::Point& center, const Core::Geometry::Point& right, const Core::Geometry::Point& down, const Core::Geometry::Point& in); void getPosition(Core::Geometry::Point& center, Core::Geometry::Point& right, Core::Geometry::Point& down, Core::Geometry::Point& in) const; }; class SCISHARE CompositeWidget : public WidgetBase { public: template <typename WidgetIter> CompositeWidget(const Core::GeometryIDGenerator& idGenerator, const std::string& tag, WidgetIter begin, WidgetIter end) : WidgetBase(idGenerator, tag, true), widgets_(begin, end) {} ~CompositeWidget(); void addToList(Core::Datatypes::GeometryBaseHandle handle, Core::Datatypes::GeomList& list) override; private: std::vector<WidgetHandle> widgets_; }; class SCISHARE WidgetFactory { public: static WidgetHandle createBox(const Core::GeometryIDGenerator& idGenerator, double scale, const BoxPosition& pos, const Core::Geometry::BBox& bbox); static WidgetHandle createSphere(const Core::GeometryIDGenerator& idGenerator, const std::string& name, double radius, const std::string& defaultColor, const Core::Geometry::Point& point, const Core::Geometry::BBox& bbox); template <typename WidgetIter> static WidgetHandle createComposite(const Core::GeometryIDGenerator& idGenerator, const std::string& tag, WidgetIter begin, WidgetIter end) { return boost::make_shared<CompositeWidget>(idGenerator, tag, begin, end); } }; } } } #endif
ajanson/SCIRun
src/Graphics/Widgets/Widget.h
C
mit
3,525
import * as gulp from 'gulp'; import * as gulpLoadPlugins from 'gulp-load-plugins'; import * as merge from 'merge-stream'; import { join/*, sep, relative*/ } from 'path'; import Config from '../../config'; import { makeTsProject, TemplateLocalsBuilder } from '../../utils'; import { TypeScriptTask } from '../typescript_task'; const plugins = <any>gulpLoadPlugins(); let typedBuildCounter = Config.TYPED_COMPILE_INTERVAL; // Always start with the typed build. /** * Executes the build process, transpiling the TypeScript files (except the spec and e2e-spec files) for the development * environment. */ export = class BuildServerDev extends TypeScriptTask { run() { const tsProject: any; const typings = gulp.src([ Config.TOOLS_DIR + '/manual_typings/**/*.d.ts' ]); const src = [ join(Config.APP_SERVER_SRC, '**/*.ts') ]; let projectFiles = gulp.src(src); let result: any; let isFullCompile = true; // Only do a typed build every X builds, otherwise do a typeless build to speed things up if (typedBuildCounter < Config.TYPED_COMPILE_INTERVAL) { isFullCompile = false; tsProject = makeTsProject({isolatedModules: true}); projectFiles = projectFiles.pipe(plugins.cached()); } else { tsProject = makeTsProject(); projectFiles = merge(typings, projectFiles); } result = projectFiles .pipe(plugins.plumber()) .pipe(plugins.sourcemaps.init()) .pipe(tsProject()) .on('error', () => { typedBuildCounter = Config.TYPED_COMPILE_INTERVAL; }); if (isFullCompile) { typedBuildCounter = 0; } else { typedBuildCounter++; } return result.js .pipe(plugins.sourcemaps.write()) // Use for debugging with Webstorm/IntelliJ // https://github.com/mgechev/angular2-seed/issues/1220 // .pipe(plugins.sourcemaps.write('.', { // includeContent: false, // sourceRoot: (file: any) => // relative(file.path, PROJECT_ROOT + '/' + APP_SRC).replace(sep, '/') + '/' + APP_SRC // })) .pipe(plugins.template(new TemplateLocalsBuilder().withStringifiedSystemConfigDev().build())) .pipe(gulp.dest(Config.APP_SERVER_DEST)); } };
vyakymenko/angular-seed-express
tools/tasks/seed/build.server.prod.ts
TypeScript
mit
2,342
# We borrow heavily from the kernel build setup, though we are simpler since # we don't have Kconfig tweaking settings on us. # The implicit make rules have it looking for RCS files, among other things. # We instead explicitly write all the rules we care about. # It's even quicker (saves ~200ms) to pass -r on the command line. MAKEFLAGS=-r # The source directory tree. srcdir := .. abs_srcdir := $(abspath $(srcdir)) # The name of the builddir. builddir_name ?= . # The V=1 flag on command line makes us verbosely print command lines. ifdef V quiet= else quiet=quiet_ endif # Specify BUILDTYPE=Release on the command line for a release build. BUILDTYPE ?= Release # Directory all our build output goes into. # Note that this must be two directories beneath src/ for unit tests to pass, # as they reach into the src/ directory for data with relative paths. builddir ?= $(builddir_name)/$(BUILDTYPE) abs_builddir := $(abspath $(builddir)) depsdir := $(builddir)/.deps # Object output directory. obj := $(builddir)/obj abs_obj := $(abspath $(obj)) # We build up a list of every single one of the targets so we can slurp in the # generated dependency rule Makefiles in one pass. all_deps := CC.target ?= $(CC) CFLAGS.target ?= $(CFLAGS) CXX.target ?= $(CXX) CXXFLAGS.target ?= $(CXXFLAGS) LINK.target ?= $(LINK) LDFLAGS.target ?= $(LDFLAGS) AR.target ?= $(AR) # C++ apps need to be linked with g++. # # Note: flock is used to seralize linking. Linking is a memory-intensive # process so running parallel links can often lead to thrashing. To disable # the serialization, override LINK via an envrionment variable as follows: # # export LINK=g++ # # This will allow make to invoke N linker processes as specified in -jN. LINK ?= ./gyp-mac-tool flock $(builddir)/linker.lock $(CXX.target) # TODO(evan): move all cross-compilation logic to gyp-time so we don't need # to replicate this environment fallback in make as well. CC.host ?= gcc CFLAGS.host ?= CXX.host ?= g++ CXXFLAGS.host ?= LINK.host ?= $(CXX.host) LDFLAGS.host ?= AR.host ?= ar # Define a dir function that can handle spaces. # http://www.gnu.org/software/make/manual/make.html#Syntax-of-Functions # "leading spaces cannot appear in the text of the first argument as written. # These characters can be put into the argument value by variable substitution." empty := space := $(empty) $(empty) # http://stackoverflow.com/questions/1189781/using-make-dir-or-notdir-on-a-path-with-spaces replace_spaces = $(subst $(space),?,$1) unreplace_spaces = $(subst ?,$(space),$1) dirx = $(call unreplace_spaces,$(dir $(call replace_spaces,$1))) # Flags to make gcc output dependency info. Note that you need to be # careful here to use the flags that ccache and distcc can understand. # We write to a dep file on the side first and then rename at the end # so we can't end up with a broken dep file. depfile = $(depsdir)/$(call replace_spaces,$@).d DEPFLAGS = -MMD -MF $(depfile).raw # We have to fixup the deps output in a few ways. # (1) the file output should mention the proper .o file. # ccache or distcc lose the path to the target, so we convert a rule of # the form: # foobar.o: DEP1 DEP2 # into # path/to/foobar.o: DEP1 DEP2 # (2) we want missing files not to cause us to fail to build. # We want to rewrite # foobar.o: DEP1 DEP2 \ # DEP3 # to # DEP1: # DEP2: # DEP3: # so if the files are missing, they're just considered phony rules. # We have to do some pretty insane escaping to get those backslashes # and dollar signs past make, the shell, and sed at the same time. # Doesn't work with spaces, but that's fine: .d files have spaces in # their names replaced with other characters. define fixup_dep # The depfile may not exist if the input file didn't have any #includes. touch $(depfile).raw # Fixup path as in (1). sed -e "s|^$(notdir $@)|$@|" $(depfile).raw >> $(depfile) # Add extra rules as in (2). # We remove slashes and replace spaces with new lines; # remove blank lines; # delete the first line and append a colon to the remaining lines. sed -e 's|\\||' -e 'y| |\n|' $(depfile).raw |\ grep -v '^$$' |\ sed -e 1d -e 's|$$|:|' \ >> $(depfile) rm $(depfile).raw endef # Command definitions: # - cmd_foo is the actual command to run; # - quiet_cmd_foo is the brief-output summary of the command. quiet_cmd_cc = CC($(TOOLSET)) $@ cmd_cc = $(CC.$(TOOLSET)) $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c -o $@ $< quiet_cmd_cxx = CXX($(TOOLSET)) $@ cmd_cxx = $(CXX.$(TOOLSET)) $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< quiet_cmd_objc = CXX($(TOOLSET)) $@ cmd_objc = $(CC.$(TOOLSET)) $(GYP_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $< quiet_cmd_objcxx = CXX($(TOOLSET)) $@ cmd_objcxx = $(CXX.$(TOOLSET)) $(GYP_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $< # Commands for precompiled header files. quiet_cmd_pch_c = CXX($(TOOLSET)) $@ cmd_pch_c = $(CC.$(TOOLSET)) $(GYP_PCH_CFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< quiet_cmd_pch_cc = CXX($(TOOLSET)) $@ cmd_pch_cc = $(CC.$(TOOLSET)) $(GYP_PCH_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< quiet_cmd_pch_m = CXX($(TOOLSET)) $@ cmd_pch_m = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $< quiet_cmd_pch_mm = CXX($(TOOLSET)) $@ cmd_pch_mm = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $< # gyp-mac-tool is written next to the root Makefile by gyp. # Use $(4) for the command, since $(2) and $(3) are used as flag by do_cmd # already. quiet_cmd_mac_tool = MACTOOL $(4) $< cmd_mac_tool = ./gyp-mac-tool $(4) $< "$@" quiet_cmd_mac_package_framework = PACKAGE FRAMEWORK $@ cmd_mac_package_framework = ./gyp-mac-tool package-framework "$@" $(4) quiet_cmd_infoplist = INFOPLIST $@ cmd_infoplist = $(CC.$(TOOLSET)) -E -P -Wno-trigraphs -x c $(INFOPLIST_DEFINES) "$<" -o "$@" quiet_cmd_touch = TOUCH $@ cmd_touch = touch $@ quiet_cmd_copy = COPY $@ # send stderr to /dev/null to ignore messages when linking directories. cmd_copy = rm -rf "$@" && cp -af "$<" "$@" quiet_cmd_alink = LIBTOOL-STATIC $@ cmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^) quiet_cmd_link = LINK($(TOOLSET)) $@ cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) quiet_cmd_solink = SOLINK($(TOOLSET)) $@ cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ cmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) # Define an escape_quotes function to escape single quotes. # This allows us to handle quotes properly as long as we always use # use single quotes and escape_quotes. escape_quotes = $(subst ','\'',$(1)) # This comment is here just to include a ' to unconfuse syntax highlighting. # Define an escape_vars function to escape '$' variable syntax. # This allows us to read/write command lines with shell variables (e.g. # $LD_LIBRARY_PATH), without triggering make substitution. escape_vars = $(subst $$,$$$$,$(1)) # Helper that expands to a shell command to echo a string exactly as it is in # make. This uses printf instead of echo because printf's behaviour with respect # to escape sequences is more portable than echo's across different shells # (e.g., dash, bash). exact_echo = printf '%s\n' '$(call escape_quotes,$(1))' # Helper to compare the command we're about to run against the command # we logged the last time we ran the command. Produces an empty # string (false) when the commands match. # Tricky point: Make has no string-equality test function. # The kernel uses the following, but it seems like it would have false # positives, where one string reordered its arguments. # arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \ # $(filter-out $(cmd_$@), $(cmd_$(1)))) # We instead substitute each for the empty string into the other, and # say they're equal if both substitutions produce the empty string. # .d files contain ? instead of spaces, take that into account. command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\ $(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1)))) # Helper that is non-empty when a prerequisite changes. # Normally make does this implicitly, but we force rules to always run # so we can check their command lines. # $? -- new prerequisites # $| -- order-only dependencies prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?)) # Helper that executes all postbuilds until one fails. define do_postbuilds @E=0;\ for p in $(POSTBUILDS); do\ eval $$p;\ E=$$?;\ if [ $$E -ne 0 ]; then\ break;\ fi;\ done;\ if [ $$E -ne 0 ]; then\ rm -rf "$@";\ exit $$E;\ fi endef # do_cmd: run a command via the above cmd_foo names, if necessary. # Should always run for a given target to handle command-line changes. # Second argument, if non-zero, makes it do asm/C/C++ dependency munging. # Third argument, if non-zero, makes it do POSTBUILDS processing. # Note: We intentionally do NOT call dirx for depfile, since it contains ? for # spaces already and dirx strips the ? characters. define do_cmd $(if $(or $(command_changed),$(prereq_changed)), @$(call exact_echo, $($(quiet)cmd_$(1))) @mkdir -p "$(call dirx,$@)" "$(dir $(depfile))" $(if $(findstring flock,$(word 2,$(cmd_$1))), @$(cmd_$(1)) @echo " $(quiet_cmd_$(1)): Finished", @$(cmd_$(1)) ) @$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile) @$(if $(2),$(fixup_dep)) $(if $(and $(3), $(POSTBUILDS)), $(call do_postbuilds) ) ) endef # Declare the "all" target first so it is the default, # even though we don't have the deps yet. .PHONY: all all: # make looks for ways to re-generate included makefiles, but in our case, we # don't have a direct way. Explicitly telling make that it has nothing to do # for them makes it go faster. %.d: ; # Use FORCE_DO_CMD to force a target to run. Should be coupled with # do_cmd. .PHONY: FORCE_DO_CMD FORCE_DO_CMD: TOOLSET := target # Suffix rules, putting all outputs into $(obj). $(obj).$(TOOLSET)/%.o: $(srcdir)/%.c FORCE_DO_CMD @$(call do_cmd,cc,1) $(obj).$(TOOLSET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD @$(call do_cmd,cxx,1) $(obj).$(TOOLSET)/%.o: $(srcdir)/%.cpp FORCE_DO_CMD @$(call do_cmd,cxx,1) $(obj).$(TOOLSET)/%.o: $(srcdir)/%.cxx FORCE_DO_CMD @$(call do_cmd,cxx,1) $(obj).$(TOOLSET)/%.o: $(srcdir)/%.m FORCE_DO_CMD @$(call do_cmd,objc,1) $(obj).$(TOOLSET)/%.o: $(srcdir)/%.mm FORCE_DO_CMD @$(call do_cmd,objcxx,1) $(obj).$(TOOLSET)/%.o: $(srcdir)/%.S FORCE_DO_CMD @$(call do_cmd,cc,1) $(obj).$(TOOLSET)/%.o: $(srcdir)/%.s FORCE_DO_CMD @$(call do_cmd,cc,1) # Try building from generated source, too. $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD @$(call do_cmd,cc,1) $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD @$(call do_cmd,cxx,1) $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cpp FORCE_DO_CMD @$(call do_cmd,cxx,1) $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cxx FORCE_DO_CMD @$(call do_cmd,cxx,1) $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.m FORCE_DO_CMD @$(call do_cmd,objc,1) $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.mm FORCE_DO_CMD @$(call do_cmd,objcxx,1) $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.S FORCE_DO_CMD @$(call do_cmd,cc,1) $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.s FORCE_DO_CMD @$(call do_cmd,cc,1) $(obj).$(TOOLSET)/%.o: $(obj)/%.c FORCE_DO_CMD @$(call do_cmd,cc,1) $(obj).$(TOOLSET)/%.o: $(obj)/%.cc FORCE_DO_CMD @$(call do_cmd,cxx,1) $(obj).$(TOOLSET)/%.o: $(obj)/%.cpp FORCE_DO_CMD @$(call do_cmd,cxx,1) $(obj).$(TOOLSET)/%.o: $(obj)/%.cxx FORCE_DO_CMD @$(call do_cmd,cxx,1) $(obj).$(TOOLSET)/%.o: $(obj)/%.m FORCE_DO_CMD @$(call do_cmd,objc,1) $(obj).$(TOOLSET)/%.o: $(obj)/%.mm FORCE_DO_CMD @$(call do_cmd,objcxx,1) $(obj).$(TOOLSET)/%.o: $(obj)/%.S FORCE_DO_CMD @$(call do_cmd,cc,1) $(obj).$(TOOLSET)/%.o: $(obj)/%.s FORCE_DO_CMD @$(call do_cmd,cc,1) ifeq ($(strip $(foreach prefix,$(NO_LOAD),\ $(findstring $(join ^,$(prefix)),\ $(join ^,bufferutil.target.mk)))),) include bufferutil.target.mk endif ifeq ($(strip $(foreach prefix,$(NO_LOAD),\ $(findstring $(join ^,$(prefix)),\ $(join ^,validation.target.mk)))),) include validation.target.mk endif quiet_cmd_regen_makefile = ACTION Regenerating $@ cmd_regen_makefile = cd $(srcdir); /usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/Users/pawan.kumar1/mynt-dev/nr-playground/reactRebound/node_modules/react-native/node_modules/ws/build/config.gypi -I/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/Users/pawan.kumar1/.node-gyp/0.10.33/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/pawan.kumar1/.node-gyp/0.10.33" "-Dmodule_root_dir=/Users/pawan.kumar1/mynt-dev/nr-playground/reactRebound/node_modules/react-native/node_modules/ws" binding.gyp Makefile: $(srcdir)/../../../../../../../../../usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp $(srcdir)/../../../../../../../.node-gyp/0.10.33/common.gypi $(call do_cmd,regen_makefile) # "all" is a concatenation of the "all" targets from all the included # sub-makefiles. This is just here to clarify. all: # Add in dependency-tracking rules. $(all_deps) is the list of every single # target in our tree. Only consider the ones with .d (dependency) info: d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d)) ifneq ($(d_files),) include $(d_files) endif
obipawan/react-native-rebound
node_modules/react-native/node_modules/ws/build/Makefile
Makefile
mit
13,864
package main import ( "github.com/coscms/webx" ) type MainAction struct { *webx.Action hello webx.Mapper `webx:"/(.*)"` } func (c *MainAction) Hello(world string) { c.Write("hello %v", world) } func main() { app1 := webx.NewApp("/") app1.AddAction(&MainAction{}) webx.AddApp(app1) app2 := webx.NewApp("/user/") app2.AddAction(&MainAction{}) webx.AddApp(app2) webx.Run("0.0.0.0:9999") }
coscms/webx
examples/multiapp.go
GO
mit
431
<div class="nav" role="navigation"> <ul> <li><a ui-sref="index" class="home">Home</a></li> <li><a ui-sref="badge.list" class="list">Badge List</a></li> </ul> </div> <div id="create-badge" class="content scaffold-create" role="main"> <h1>Create Badge</h1> <ul class="errors" role="alert" ng-if="vm.errors"> <li ng-repeat="error in vm.errors">{{error.message}}</li> </ul> <form name="saveBadge" ng-submit="vm.saveBadge()"> <fieldset class="form"> <ng-include src="'/fr/isima/zzoverflow/badge/form.html'"></ng-include> </fieldset> <fieldset class="buttons"> <input type="submit" name="create" class="save" value="Create" /> </fieldset> </form> </div>
theCmaker/ZZ3_grails_app
app/grails-app/assets/javascripts/fr/isima/zzoverflow/badge/templates/create.tpl.html
HTML
mit
756
export const ic_signal_wifi_0_bar = {"viewBox":"0 0 24 24","children":[{"name":"rect","attribs":{"fill":"none","height":"24","width":"24"},"children":[]},{"name":"path","attribs":{"d":"M12,6L12,6c3.33,0,6.49,1.08,9.08,3.07L12,18.17l-9.08-9.1C5.51,7.08,8.67,6,12,6 M12,4C7.31,4,3.07,5.9,0,8.98L12,21 L24,8.98C20.93,5.9,16.69,4,12,4L12,4z"},"children":[]}]};
wmira/react-icons-kit
src/md/ic_signal_wifi_0_bar.js
JavaScript
mit
356
// API // === module.exports.api = function(server<% if(mongo){ %>, schema<% } %>) { // Sample Rest Call server.get('/hello', function(req, res){ res.send('<h1>Hello World!</h1>'); }); }
SupremeTechnopriest/generator-stacked
app/templates/server/_API.js
JavaScript
mit
196
<?php header("Content-Type: application/json"); //Set header for outputing the JSON information require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/autoload.php'; $mysqli = Database::connection(); $sql = "SELECT COUNT(date_id) FROM `badminton_dates` WHERE confirmed = 1 AND DATE(begin_datetime) = CURDATE() "; $result = $mysqli->query($sql) or die ($mysqli->error); $row_confirmed = mysqli_fetch_row($result)[0]; $sql = "SELECT COUNT(*) FROM `badminton_dates` WHERE confirmed = 1 AND DATE(begin_datetime) = DATE_ADD(CURDATE(), INTERVAL 1 DAY) "; $result = $mysqli->query($sql) or die ($mysqli->error); $row_confirmed_tomorrow = mysqli_fetch_row($result)[0]; $sql = "SELECT COUNT(thread_id) FROM threads WHERE WEEKOFYEAR(date_play) = WEEKOFYEAR(CURDATE())"; $result = $mysqli->query($sql) or die ($mysqli->error); $row_threads_thisweek = mysqli_fetch_row($result)[0]; //Figure out which dates are not full $sql = "SELECT t1.max_attendants, t1.date_id, COALESCE(t2.attendees, 0), t1.max_attendants - t2.attendees as `space_available` FROM `badminton_dates` as t1 LEFT JOIN ( SELECT t1.date_id, COUNT(t1.join_id) as `attendees` FROM `joins` as t1 WHERE t1.status = 1 GROUP BY t1.date_id ) as t2 ON t2.date_id = t1.date_id WHERE t2.attendees != t1.max_attendants AND t1.confirmed = 1 AND DATE(begin_datetime) = CURDATE() "; $result = $mysqli->query($sql) or die ($mysqli->error); $total_space = 0; while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { $total_space += intval($row['space_available']); } $sql = "SELECT t1.max_attendants, t1.date_id, COALESCE(t2.attendees, 0), t1.max_attendants - t2.attendees as `space_available` FROM `badminton_dates` as t1 LEFT JOIN ( SELECT t1.date_id, COUNT(t1.join_id) as `attendees` FROM `joins` as t1 WHERE t1.status = 1 GROUP BY t1.date_id ) as t2 ON t2.date_id = t1.date_id WHERE t2.attendees != t1.max_attendants AND t1.confirmed = 1 AND DATE(begin_datetime) = DATE_ADD(CURDATE(), INTERVAL 1 DAY) "; $result = $mysqli->query($sql) or die ($mysqli->error); $total_space_tomorrow = 0; while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { $total_space_tomorrow += intval($row['space_available']); } $return_array = array( 'confirmed_bookings_today' => $row_confirmed, 'confirmed_bookings_tomorrow' => $row_confirmed_tomorrow, 'total_space_today' => $total_space, 'total_space_tomorrow' => $total_space_tomorrow, 'looking_to_play_this_week' => $row_threads_thisweek ); http_response_code(200); echo json_encode($return_array, JSON_PRETTY_PRINT);
jinalex/htn-scale
postRequests/index/getTopBar.php
PHP
mit
2,635
/** * angular-strap * @version v2.1.7 - 2015-10-19 * @link http://mgcrea.github.io/angular-strap * @author Olivier Louvignes (olivier@mg-crea.com) * @license MIT License, http://www.opensource.org/licenses/MIT */ "use strict";angular.module("mgcrea.ngStrap.alert").run(["$templateCache",function(t){t.put("alert/alert.tpl.html",'<div class="alert" ng-class="[type ? \'alert-\' + type : null]"><button type="button" class="close" ng-if="dismissable" ng-click="$hide()">&times;</button> <strong ng-bind="title"></strong>&nbsp;<span ng-bind-html="content"></span></div>')}]);
SynergyICTApps/angular-strap
dist/modules/alert.tpl.min.js
JavaScript
mit
578
using UnityEngine; using System; using System.Collections; using System.Collections.Generic; public class FB_Score { public string UserId; public string UserName; public string AppId; public string AppName; public int value; private Dictionary<FB_ProfileImageSize, Texture2D> profileImages = new Dictionary<FB_ProfileImageSize, Texture2D>(); public event Action<FB_Score> OnProfileImageLoaded = delegate {}; public string GetProfileUrl(FB_ProfileImageSize size) { return "https://graph.facebook.com/" + UserId + "/picture?type=" + size.ToString(); } public Texture2D GetProfileImage(FB_ProfileImageSize size) { if(profileImages.ContainsKey(size)) { return profileImages[size]; } else { return null; } } public void LoadProfileImage(FB_ProfileImageSize size) { if(GetProfileImage(size) != null) { Debug.LogWarning("Profile image already loaded, size: " + size); OnProfileImageLoaded(this); } switch(size) { case FB_ProfileImageSize.large: SA.Common.Util.Loader.LoadWebTexture(GetProfileUrl(size), OnLargeImageLoaded); break; case FB_ProfileImageSize.normal: SA.Common.Util.Loader.LoadWebTexture(GetProfileUrl(size), OnNormalImageLoaded); break; case FB_ProfileImageSize.small: SA.Common.Util.Loader.LoadWebTexture(GetProfileUrl(size), OnSmallImageLoaded); break; case FB_ProfileImageSize.square: SA.Common.Util.Loader.LoadWebTexture(GetProfileUrl(size), OnSquareImageLoaded); break; } Debug.Log("LOAD IMAGE URL: " + GetProfileUrl(size)); } //-------------------------------------- // EVENTS //-------------------------------------- private void OnSquareImageLoaded(Texture2D image) { if(this == null) {return;} if(image != null && !profileImages.ContainsKey(FB_ProfileImageSize.square)) { profileImages.Add(FB_ProfileImageSize.square, image); } OnProfileImageLoaded(this); } private void OnLargeImageLoaded(Texture2D image) { if(this == null) {return;} if(image != null && !profileImages.ContainsKey(FB_ProfileImageSize.large)) { profileImages.Add(FB_ProfileImageSize.large, image); } OnProfileImageLoaded(this); } private void OnNormalImageLoaded(Texture2D image) { if(this == null) {return;} if(image != null && !profileImages.ContainsKey(FB_ProfileImageSize.normal)) { profileImages.Add(FB_ProfileImageSize.normal, image); } OnProfileImageLoaded(this); } private void OnSmallImageLoaded(Texture2D image) { if(this == null) {return;} if(image != null && !profileImages.ContainsKey(FB_ProfileImageSize.small)) { profileImages.Add(FB_ProfileImageSize.small, image); } OnProfileImageLoaded(this); } }
KingOfFawns/Special_Course
Special Course/Assets/Plugins/StansAssets/Modules/AndroidNative/Scripts/Social/Facebook/Models/FB_Score.cs
C#
mit
2,692
module.exports = { dir: "" }
hitgeek/myReddit
lib/globals.js
JavaScript
mit
30
module Sinatra module Chiro module Parameters class Base attr_reader :options def initialize(opts={}) @options = opts end def name @options[:name] end def name_display @options[:name].to_s end def description @options[:description] end def comment nil end def type_description @options[:type_description] || @options[:type] end def type @options[:type] end def default @options[:default] end def optional @options[:optional] end end end end end
rjnienaber/sinatra-chiro
lib/sinatra/chiro/parameters/base.rb
Ruby
mit
718
class Picture attr_accessor :picture def initialize picture @picture = picture end def large_size @picture.url(:large) if @picture.exists? end def medium_size @picture.url(:medium) if @picture.exists? end def thumb_size @picture.url(:thumb) if @picture.exists? end end
uTeach/uteach-ws
app/src/picture.rb
Ruby
mit
306
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>chapar: Not compatible</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.13.0 / chapar - 8.11.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> chapar <small> 8.11.0 <span class="label label-info">Not compatible</span> </small> </h1> <p><em><script>document.write(moment("2021-04-16 16:56:55 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-04-16 16:56:55 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-gmp 3 Virtual package relying on a GMP lib system installation coq 8.13.0 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.11.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.11.1 Official release 4.11.1 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.1 A library manager for OCaml zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;palmskog@gmail.com&quot; homepage: &quot;https://github.com/coq-community/chapar&quot; dev-repo: &quot;git+https://github.com/coq-community/chapar.git&quot; bug-reports: &quot;https://github.com/coq-community/chapar/issues&quot; license: &quot;MIT&quot; synopsis: &quot;A framework for verification of causal consistency for distributed key-value stores and their clients in Coq&quot; description: &quot;&quot;&quot; A framework for modular verification of causal consistency for replicated key-value store implementations and their client programs in Coq. Includes proofs of the causal consistency of two key-value store implementations and a simple automatic model checker for the correctness of client programs.&quot;&quot;&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] depends: [ &quot;coq&quot; {&gt;= &quot;8.9&quot; &amp; &lt; &quot;8.12~&quot;} ] tags: [ &quot;category:Computer Science/Concurrent Systems and Protocols/Theory of concurrent systems&quot; &quot;keyword:causal consistency&quot; &quot;keyword:key-value stores&quot; &quot;keyword:distributed algorithms&quot; &quot;keyword:program verification&quot; &quot;logpath:Chapar&quot; &quot;date:2020-01-31&quot; ] authors: [ &quot;Mohsen Lesani&quot; &quot;Christian J. Bell&quot; &quot;Adam Chlipala&quot; ] url { src: &quot;https://github.com/coq-community/chapar/archive/v8.11.0.tar.gz&quot; checksum: &quot;sha512=35961eeece511cebbd8f370d416b6bf952f08cc8d9050554d7e2688d9ed90635652161cfc3b391a1272ac92d5d552c0a1f9008cc0cd56d31f858dbbf08dac914&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-chapar.8.11.0 coq.8.13.0</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.13.0). The following dependencies couldn&#39;t be met: - coq-chapar -&gt; coq &lt; 8.12~ -&gt; ocaml &lt; 4.10 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-chapar.8.11.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> <small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small> </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io
clean/Linux-x86_64-4.11.1-2.0.7/released/8.13.0/chapar/8.11.0.html
HTML
mit
7,448
<?php namespace Elliptic; use \Exception; use BN\BN; if (!function_exists("random_int")) { function random_int($a, $b) { return rand($a, $b); } } class Utils { public static function toArray($msg, $enc = false) { if( is_array($msg) ) return array_slice($msg, 0); if( !$msg ) return array(); if( !is_string($msg) ) throw new Exception("Not implemented"); if( !$enc ) return array_slice(unpack("C*", $msg), 0); if( $enc === "hex" ) return array_slice(unpack("C*", hex2bin($msg)), 0); return $msg; } public static function toHex($msg) { if( is_string($msg) ) return bin2hex($msg); if( !is_array($msg) ) throw new Exception("Not implemented"); $binary = call_user_func_array("pack", array_merge(["C*"], $msg)); return bin2hex($binary); } public static function toBin($msg, $enc = false) { if( is_array($msg) ) return call_user_func_array("pack", array_merge(["C*"], $msg)); if( $enc === "hex" ) return hex2bin($msg); return $msg; } public static function encode($arr, $enc) { if( $enc === "hex" ) return self::toHex($arr); return $arr; } // Represent num in a w-NAF form public static function getNAF($num, $w) { $naf = array(); $ws = 1 << ($w + 1); $k = clone($num); while( $k->cmpn(1) >= 0 ) { if( !$k->isOdd() ) array_push($naf, 0); else { $mod = $k->andln($ws - 1); $z = $mod; if( $mod > (($ws >> 1) - 1)) $z = ($ws >> 1) - $mod; $k->isubn($z); array_push($naf, $z); } // Optimization, shift by word if possible $shift = (!$k->isZero() && $k->andln($ws - 1) === 0) ? ($w + 1) : 1; for($i = 1; $i < $shift; $i++) array_push($naf, 0); $k->iushrn($shift); } return $naf; } // Represent k1, k2 in a Joint Sparse Form public static function getJSF($k1, $k2) { $jsf = array( array(), array() ); $k1 = $k1->_clone(); $k2 = $k2->_clone(); $d1 = 0; $d2 = 0; while( $k1->cmpn(-$d1) > 0 || $k2->cmpn(-$d2) > 0 ) { // First phase $m14 = ($k1->andln(3) + $d1) & 3; $m24 = ($k2->andln(3) + $d2) & 3; if( $m14 === 3 ) $m14 = -1; if( $m24 === 3 ) $m24 = -1; $u1 = 0; if( ($m14 & 1) !== 0 ) { $m8 = ($k1->andln(7) + $d1) & 7; $u1 = ( ($m8 === 3 || $m8 === 5) && $m24 === 2 ) ? -$m14 : $m14; } array_push($jsf[0], $u1); $u2 = 0; if( ($m24 & 1) !== 0 ) { $m8 = ($k2->andln(7) + $d2) & 7; $u2 = ( ($m8 === 3 || $m8 === 5) && $m14 === 2 ) ? -$m24 : $m24; } array_push($jsf[1], $u2); // Second phase if( (2 * $d1) === ($u1 + 1) ) $d1 = 1 - $d1; if( (2 * $d2) === ($u2 + 1) ) $d2 = 1 - $d2; $k1->iushrn(1); $k2->iushrn(1); } return $jsf; } public static function intFromLE($bytes) { return new BN($bytes, 'hex', 'le'); } public static function parseBytes($bytes) { if (is_string($bytes)) return self::toArray($bytes, 'hex'); return $bytes; } public static function randBytes($count) { $res = ""; for($i = 0; $i < $count; $i++) $res .= chr(random_int(0, 255)); return $res; } public static function optionAssert(&$array, $key, $value = false, $required = false) { if( isset($array[$key]) ) return; if( $required ) throw new Exception("Missing option " . $key); $array[$key] = $value; } } ?>
simplito/elliptic-php
lib/Utils.php
PHP
mit
4,220
const td = require("testdouble"); const proxyquire = require("proxyquire"); const expect = require("chai").expect; describe("configurationRepository.spec.js", () => { const cwd = "/home/pawel/workspace/logweb"; const configurationData = {any: "configuration value"}; let configurationRepository; let fsMock; let processCwdMock; let argvSliceMock; beforeEach(() => { fsMock = { readFileSync: td.function(), writeFile: td.function(), "@noCallThru": true }; processCwdMock = td.replace(process, "cwd"); argvSliceMock = td.replace(process.argv, "slice"); td.when(processCwdMock()).thenReturn(cwd); configurationRepository = proxyquire("./configurationRepository", {fs: fsMock}); }); afterEach(() => { td.reset(); }); describe("argv configuration", () => { const configFile = "config/custom-config.json"; beforeEach(() => { td.when(argvSliceMock(2)).thenReturn([configFile]); }); it("should load configuration from command argv", () => { // given td.when(fsMock.readFileSync(`${cwd}/${configFile}`, "utf8")).thenReturn(JSON.stringify(configurationData)); // expect expect(configurationRepository.loadConfiguration()).to.eql(configurationData); }); it("should save configuration file to argv parameter", done => { // given td.when( fsMock.writeFile( `${cwd}/${configFile}`, JSON.stringify(configurationData, null, 2), "utf8"), {ignoreExtraArgs: true} ).thenCallback(null); // when configurationRepository .saveConfiguration(configurationData) .then(() => done()); }); }); describe("default configuration location", () => { beforeEach(() => { td.when(argvSliceMock(2)).thenReturn([]); }); it("should load configuration from file named logweb.json in current working directory", () => { // given td.when(fsMock.readFileSync(`${cwd}/logweb.json`, "utf8")).thenReturn(JSON.stringify(configurationData)); // expect expect(configurationRepository.loadConfiguration()).to.eql(configurationData); }); it("should save configuration to file named logweb.json in current working directory", done => { // given td.when( fsMock.writeFile( `${cwd}/logweb.json`, JSON.stringify(configurationData, null, 2), "utf8"), {ignoreExtraArgs: true} ).thenCallback(null); // when configurationRepository .saveConfiguration(configurationData) .then(() => done()); }); }); });
pchudzik/logweb
backend/lib/configuration/configurationRepository.spec.js
JavaScript
mit
2,445
/** * Backbone Application File * @internal Obviously, I've dumped all the code into one file. This should probably be broken out into multiple * files and then concatenated and minified but as it's an example, it's all one lumpy file. * @package $.CpDialog.dialog */ /** * @type {Object} JavaScript namespace for our application. */ (function($){ $.CpDialog = { dialog: {} }; /** * Primary Modal Application Class */ $.CpDialog.dialog.View = Backbone.View.extend({ id: "cppress_dialog", events: { "click .cppress_dialog-close": "close", "click #btn-cancel": "close", "click #btn-ok": "save", "click .navigation-bar a": "doNothing" }, /** * Simple object to store any UI elements we need to use over the life of the application. */ ui: { nav: undefined, content: undefined }, /** * Container to store our compiled templates. Not strictly necessary in such a simple example * but might be useful in a larger one. */ coreTemplates: {}, content: null, button: null, sidebar: null, menu: false, title: 'CpPress dialog', /** * Instantiates the Template object and triggers load. */ initialize: function () { "use strict"; _.bindAll( this, 'render', 'close', 'save', 'doNothing' ); this.initialize_templates(); }, /** * Creates compiled implementations of the templates. These compiled versions are created using * the wp.template class supplied by WordPress in 'wp-util'. Each template name maps to the ID of a * script tag ( without the 'tmpl-' namespace ) created in template-data.php. */ initialize_templates: function () { this.coreTemplates.window = wp.template( "cppress-dialog-window" ); this.coreTemplates.backdrop = wp.template( "cppress-dialog-backdrop" ); this.coreTemplates.menuItem = wp.template( "cppress-dialog-menu-item" ); this.coreTemplates.menuItemSeperator = wp.template( "cppress-dialog-menu-item-separator" ); }, /** * Assembles the UI from loaded templates. * @internal Obviously, if the templates fail to load, our modal never launches. */ render: function () { "use strict"; // Build the base window and backdrop, attaching them to the $el. // Setting the tab index allows us to capture focus and redirect it in Application.preserveFocus }, renderWindow: function(args){ args || (args = {}); // Build the base window and backdrop, attaching them to the $el. // Setting the tab index allows us to capture focus and redirect it in Application.preserveFocus this.$el.attr( 'tabindex', '0' ); this.$el.append( this.coreTemplates.backdrop()); this.$el.append( this.coreTemplates.window({ title: this.title, button: this.button() })).hide().fadeIn(); this.ui.content = this.$( '.cppress_dialog-main article div.cp-panel-dialog' ) .append( this.content(args) ); this.trigger('content-loaded'); }, getFormValues: function(formSelector){ if(typeof formSelector === "undefined"){ formSelector = '.cp-form'; } var $form = this.$(formSelector); var data = {}, parts; $form.find('[name]').each(function(){ var $$ = $(this); var name = /([A-Za-z0-9_]+)\[(.*)\]/.exec( $$.attr('name') ); if(name === undefined){ return true; } if(name === null){ return true; } if($$.is(':disabled')){ return true; } // Create an array with the parts of the name if(typeof name[2] === 'undefined'){ parts = $$.attr('name'); }else{ parts = name[2].split(']['); parts.unshift( name[1] ); } parts = parts.map(function(e){ if( !isNaN(parseFloat(e)) && isFinite(e) ) { return parseInt(e); }else{ return e; } }); var sub = data; var fieldValue = null; var fieldType = ( typeof $$.attr('type') === 'string' ? $$.attr('type').toLowerCase() : false ); // First we need to get the value from the field if( fieldType === 'checkbox' ){ if ( $$.is(':checked') ) { fieldValue = $$.val() !== '' ? $$.val() : true; } else { fieldValue = null; } } else if( fieldType === 'radio' ){ if ( $$.is(':checked') ) { fieldValue = $$.val(); } else { //skip over unchecked radios return; } } else if( $$.prop('tagName') === 'TEXTAREA' && $$.hasClass('wp-editor-area') ){ // This is a TinyMCE editor, so we'll use the tinyMCE object to get the content var editor = null; if ( typeof tinyMCE !== 'undefined' ) { editor = tinyMCE.get( $$.attr('id') ); } if( editor !== null && typeof( editor.getContent ) === "function" && !editor.isHidden() ) { fieldValue = editor.getContent(); } else { fieldValue = $$.val(); } } else if ( $$.prop('tagName') === 'SELECT' ) { var selected = $$.find('option:selected'); if( selected.length === 1 ) { fieldValue = $$.find('option:selected').val(); }else if( selected.length > 1 ) { // This is a mutli-select field fieldValue = _.map( $$.find('option:selected'), function(n ,i){ return $(n).val(); }); } }else{ // This is a fallback that will work for most fields fieldValue = $$.val(); } // Now, we need to filter this value if necessary if( typeof $$.data('filter') !== 'undefined' ) { switch( $$.data('filter') ) { case 'json_parse': // Attempt to parse the JSON value of this field try { fieldValue = JSON.parse( fieldValue ); }catch(err) { fieldValue = ''; } break; } } // Now convert this into an array if(fieldValue !== null) { for (var i = 0; i < parts.length; i++) { if (i === parts.length - 1) { if( parts[i] === '' ) { // This needs to be an array sub.push(fieldValue); }else { sub[parts[i]] = fieldValue; } }else { if (typeof sub[parts[i]] === 'undefined') { if ( parts[i+1] === '' ) { sub[parts[i]] = []; }else { sub[parts[i]] = {}; } } sub = sub[parts[i]]; } } } }); return data; }, /** * Closes the modal and cleans up after the instance. * @param e {object} A jQuery-normalized event object. */ close: function ( e ) { "use strict"; e.preventDefault(); this.undelegateEvents(); $( document ).off( "focusin" ); $( "body" ).css( {"overflow": "auto"} ); this.remove(); this.trigger('dialog-close'); }, /** * Responds to the btn-ok.click event * @param e {object} A jQuery-normalized event object. * @todo You should make this your own. */ save: function ( e ) { "use strict"; this.closeModal( e ); }, /** * Ensures that events do nothing. * @param e {object} A jQuery-normalized event object. * @todo You should probably delete this and add your own handlers. */ doNothing: function ( e ) { "use strict"; e.preventDefault(); } } ); }(jQuery));
marcoski/cp-press
assets/js/cp-press-dialog.js
JavaScript
mit
7,697
require "octokit" require "base64" require "active_support/core_ext/object/with_options" class GithubApi SERVICES_TEAM_NAME = "Services" PREVIEW_MEDIA_TYPE = "application/vnd.github.moondragon-preview+json" def initialize(token = ENV["HOUND_GITHUB_TOKEN"]) @token = token end def client @client ||= Octokit::Client.new(access_token: @token, auto_paginate: true) end def repos user_repos + org_repos end def repo(repo_name) client.repository(repo_name) end def add_pull_request_comment(options) client.create_pull_request_comment( options[:commit].repo_name, options[:pull_request_number], options[:comment], options[:commit].sha, options[:filename], options[:patch_position] ) end def create_hook(full_repo_name, callback_endpoint) hook = client.create_hook( full_repo_name, "web", { url: callback_endpoint }, { events: ["pull_request"], active: true } ) if block_given? yield hook else hook end rescue Octokit::UnprocessableEntity => error if error.message.include? "Hook already exists" true else raise end end def remove_hook(full_github_name, hook_id) response = client.remove_hook(full_github_name, hook_id) if block_given? yield else response end end def pull_request_comments(full_repo_name, pull_request_number) repo_path = Octokit::Repository.path full_repo_name # client.pull_request_comments does not do auto-pagination. client.paginate "#{repo_path}/pulls/#{pull_request_number}/comments" end def pull_request_files(full_repo_name, number) client.pull_request_files(full_repo_name, number) end def file_contents(full_repo_name, filename, sha) client.contents(full_repo_name, path: filename, ref: sha) end def accept_pending_invitations pending_memberships = client.organization_memberships(state: "pending") pending_memberships.each do |pending_membership| client.update_organization_membership( pending_membership["organization"]["login"], state: "active" ) end end def create_pending_status(full_repo_name, sha, description) create_status( repo: full_repo_name, sha: sha, state: "pending", description: description ) end def create_success_status(full_repo_name, sha, description) create_status( repo: full_repo_name, sha: sha, state: "success", description: description ) end def add_collaborator(repo_name, username) client.add_collaborator(repo_name, username) end def user_teams client.user_teams end def repo_teams(repo_name) client.repository_teams(repo_name) end def org_teams(org_name) client.org_teams(org_name) end def create_team(team_name:, org_name:, repo_name:) team_options = { name: team_name, repo_names: [repo_name], permission: "push" } client.create_team(org_name, team_options) end def add_repo_to_team(team_id, repo_name) client.add_team_repository(team_id, repo_name) end def add_user_to_team(username, team_id) client.add_team_membership(team_id, username) end def update_team(team_id, options) client.update_team(team_id, options) end private def user_repos authorized_repos(client.repos) end def org_repos repos = orgs.flat_map do |org| client.org_repos(org[:login]) end authorized_repos(repos) end def orgs client.orgs end def authorized_repos(repos) repos.select { |repo| repo.permissions.admin } end def with_preview_client(&block) client.with_options(accept: PREVIEW_MEDIA_TYPE, &block) end def create_status(repo:, sha:, state:, description:) client.create_status( repo, sha, state, context: "hound", description: description ) rescue Octokit::NotFound # noop end end
degica/hound
lib/github_api.rb
Ruby
mit
3,990
#ifndef EXP_H #define EXP_H template<typename R> struct Exp : StaticInterface<Exp<R> >, UnaryOperation<R> { using UnaryOperation<R>::Right; using UnaryOperation<R>::Operation::Value; INLINE_MODE Exp(const R& right) : UnaryOperation<R> (right, exp(right.Value)) {} template<unsigned GradLevel, typename T>INLINE_MODE void Gradient(real gradData[], unsigned index, const unsigned baseCount, const T& gradient) const { Right. template Gradient<GradLevel> (gradData, index, baseCount, gradient * (*this)); } INLINE_MODE void Gradient(real gradData[], unsigned index, const unsigned baseCount, const real& gradient) const { Right.Gradient(gradData, index, baseCount, gradient * Value); } }; template<typename R>INLINE_MODE const Exp<R> exp(const StaticInterface<R>& right) { return Exp<R> (right.Self()); } #endif // EXP_H
eleks/ADEL
GCC/ADEL/Operations/Exp.h
C
mit
893
/* BLAKE2 reference source code package - reference C implementations Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at your option. The terms of these licenses can be found at: - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 - OpenSSL license : https://www.openssl.org/source/license.html - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 More information about the BLAKE2 hash function can be found at https://blake2.net. */ #include <stdint.h> #include <string.h> #include <stdio.h> #include "blake2s.h" #include "blake2-impl.h" static const uint32_t blake2s_IV[8] = { 0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL, 0x510E527FUL, 0x9B05688CUL, 0x1F83D9ABUL, 0x5BE0CD19UL }; static const uint8_t blake2s_sigma[10][16] = { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } , { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } , { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 } , { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 } , { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 } , { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } , { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 } , { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 } , { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 } , { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0 } , }; static void blake2s_set_lastnode( blake2s_state *S ) { S->f[1] = (uint32_t)-1; } /* Some helper functions, not necessarily useful */ static int blake2s_is_lastblock( const blake2s_state *S ) { return S->f[0] != 0; } static void blake2s_set_lastblock( blake2s_state *S ) { if( S->last_node ) blake2s_set_lastnode( S ); S->f[0] = (uint32_t)-1; } static void blake2s_increment_counter( blake2s_state *S, const uint32_t inc ) { S->t[0] += inc; S->t[1] += ( S->t[0] < inc ); } static void blake2s_init0( blake2s_state *S ) { size_t i; memset( S, 0, sizeof( blake2s_state ) ); for( i = 0; i < 8; ++i ) S->h[i] = blake2s_IV[i]; } /* init2 xors IV with input parameter block */ int blake2s_init_param( blake2s_state *S, const blake2s_param *P ) { const unsigned char *p = ( const unsigned char * )( P ); size_t i; blake2s_init0( S ); /* IV XOR ParamBlock */ for( i = 0; i < 8; ++i ) S->h[i] ^= load32( &p[i * 4] ); S->outlen = P->digest_length; return 0; } /* Sequential blake2s initialization */ int blake2s_init( blake2s_state *S, size_t outlen ) { blake2s_param P[1]; /* Move interval verification here? */ if ( ( !outlen ) || ( outlen > BLAKE2S_OUTBYTES ) ) return -1; P->digest_length = (uint8_t)outlen; P->key_length = 0; P->fanout = 1; P->depth = 1; store32( &P->leaf_length, 0 ); store32( &P->node_offset, 0 ); store16( &P->xof_length, 0 ); P->node_depth = 0; P->inner_length = 0; /* memset(P->reserved, 0, sizeof(P->reserved) ); */ memset( P->salt, 0, sizeof( P->salt ) ); memset( P->personal, 0, sizeof( P->personal ) ); return blake2s_init_param( S, P ); } int blake2s_init_key( blake2s_state *S, size_t outlen, const void *key, size_t keylen ) { blake2s_param P[1]; if ( ( !outlen ) || ( outlen > BLAKE2S_OUTBYTES ) ) return -1; if ( !key || !keylen || keylen > BLAKE2S_KEYBYTES ) return -1; P->digest_length = (uint8_t)outlen; P->key_length = (uint8_t)keylen; P->fanout = 1; P->depth = 1; store32( &P->leaf_length, 0 ); store32( &P->node_offset, 0 ); store16( &P->xof_length, 0 ); P->node_depth = 0; P->inner_length = 0; /* memset(P->reserved, 0, sizeof(P->reserved) ); */ memset( P->salt, 0, sizeof( P->salt ) ); memset( P->personal, 0, sizeof( P->personal ) ); if( blake2s_init_param( S, P ) < 0 ) return -1; { uint8_t block[BLAKE2S_BLOCKBYTES]; memset( block, 0, BLAKE2S_BLOCKBYTES ); memcpy( block, key, keylen ); blake2s_update( S, block, BLAKE2S_BLOCKBYTES ); secure_zero_memory( block, BLAKE2S_BLOCKBYTES ); /* Burn the key from stack */ } return 0; } #define G(r,i,a,b,c,d) \ do { \ a = a + b + m[blake2s_sigma[r][2*i+0]]; \ d = rotr32(d ^ a, 16); \ c = c + d; \ b = rotr32(b ^ c, 12); \ a = a + b + m[blake2s_sigma[r][2*i+1]]; \ d = rotr32(d ^ a, 8); \ c = c + d; \ b = rotr32(b ^ c, 7); \ } while(0) #define ROUND(r) \ do { \ G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \ G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \ G(r,2,v[ 2],v[ 6],v[10],v[14]); \ G(r,3,v[ 3],v[ 7],v[11],v[15]); \ G(r,4,v[ 0],v[ 5],v[10],v[15]); \ G(r,5,v[ 1],v[ 6],v[11],v[12]); \ G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \ G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \ } while(0) static void blake2s_compress( blake2s_state *S, const uint8_t in[BLAKE2S_BLOCKBYTES] ) { uint32_t m[16]; uint32_t v[16]; size_t i; for( i = 0; i < 16; ++i ) { m[i] = load32( in + i * sizeof( m[i] ) ); } for( i = 0; i < 8; ++i ) { v[i] = S->h[i]; } v[ 8] = blake2s_IV[0]; v[ 9] = blake2s_IV[1]; v[10] = blake2s_IV[2]; v[11] = blake2s_IV[3]; v[12] = S->t[0] ^ blake2s_IV[4]; v[13] = S->t[1] ^ blake2s_IV[5]; v[14] = S->f[0] ^ blake2s_IV[6]; v[15] = S->f[1] ^ blake2s_IV[7]; ROUND( 0 ); ROUND( 1 ); ROUND( 2 ); ROUND( 3 ); ROUND( 4 ); ROUND( 5 ); ROUND( 6 ); ROUND( 7 ); ROUND( 8 ); ROUND( 9 ); for( i = 0; i < 8; ++i ) { S->h[i] = S->h[i] ^ v[i] ^ v[i + 8]; } } #undef G #undef ROUND int blake2s_update( blake2s_state *S, const void *pin, size_t inlen ) { const unsigned char * in = (const unsigned char *)pin; if( inlen > 0 ) { size_t left = S->buflen; size_t fill = BLAKE2S_BLOCKBYTES - left; if( inlen > fill ) { S->buflen = 0; memcpy( S->buf + left, in, fill ); /* Fill buffer */ blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES ); blake2s_compress( S, S->buf ); /* Compress */ in += fill; inlen -= fill; while(inlen > BLAKE2S_BLOCKBYTES) { blake2s_increment_counter(S, BLAKE2S_BLOCKBYTES); blake2s_compress( S, in ); in += BLAKE2S_BLOCKBYTES; inlen -= BLAKE2S_BLOCKBYTES; } } memcpy( S->buf + S->buflen, in, inlen ); S->buflen += inlen; } return 0; } int blake2s_final( blake2s_state *S, void *out, size_t outlen ) { uint8_t buffer[BLAKE2S_OUTBYTES] = {0}; size_t i; if( out == NULL || outlen < S->outlen ) return -1; if( blake2s_is_lastblock( S ) ) return -1; blake2s_increment_counter( S, ( uint32_t )S->buflen ); blake2s_set_lastblock( S ); memset( S->buf + S->buflen, 0, BLAKE2S_BLOCKBYTES - S->buflen ); /* Padding */ blake2s_compress( S, S->buf ); for( i = 0; i < 8; ++i ) /* Output full hash to temp buffer */ store32( buffer + sizeof( S->h[i] ) * i, S->h[i] ); memcpy( out, buffer, outlen ); secure_zero_memory(buffer, sizeof(buffer)); return 0; } int blake2s( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ) { blake2s_state S[1]; /* Verify parameters */ if ( NULL == in && inlen > 0 ) return -1; if ( NULL == out ) return -1; if ( NULL == key && keylen > 0) return -1; if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1; if( keylen > BLAKE2S_KEYBYTES ) return -1; if( keylen > 0 ) { if( blake2s_init_key( S, outlen, key, keylen ) < 0 ) return -1; } else { if( blake2s_init( S, outlen ) < 0 ) return -1; } blake2s_update( S, ( const uint8_t * )in, inlen ); blake2s_final( S, out, outlen ); return 0; } #if defined(SUPERCOP) int crypto_hash( unsigned char *out, unsigned char *in, unsigned long long inlen ) { return blake2s( out, BLAKE2S_OUTBYTES, in, inlen, NULL, 0 ); } #endif #if defined(BLAKE2S_SELFTEST) #include <string.h> #include "blake2-kat.h" int main( void ) { uint8_t key[BLAKE2S_KEYBYTES]; uint8_t buf[BLAKE2_KAT_LENGTH]; size_t i, step; for( i = 0; i < BLAKE2S_KEYBYTES; ++i ) key[i] = ( uint8_t )i; for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) buf[i] = ( uint8_t )i; /* Test simple API */ for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) { uint8_t hash[BLAKE2S_OUTBYTES]; blake2s( hash, BLAKE2S_OUTBYTES, buf, i, key, BLAKE2S_KEYBYTES ); if( 0 != memcmp( hash, blake2s_keyed_kat[i], BLAKE2S_OUTBYTES ) ) { goto fail; } } /* Test streaming API */ for(step = 1; step < BLAKE2S_BLOCKBYTES; ++step) { for (i = 0; i < BLAKE2_KAT_LENGTH; ++i) { uint8_t hash[BLAKE2S_OUTBYTES]; blake2s_state S; uint8_t * p = buf; size_t mlen = i; int err = 0; if( (err = blake2s_init_key(&S, BLAKE2S_OUTBYTES, key, BLAKE2S_KEYBYTES)) < 0 ) { goto fail; } while (mlen >= step) { if ( (err = blake2s_update(&S, p, step)) < 0 ) { goto fail; } mlen -= step; p += step; } if ( (err = blake2s_update(&S, p, mlen)) < 0) { goto fail; } if ( (err = blake2s_final(&S, hash, BLAKE2S_OUTBYTES)) < 0) { goto fail; } if (0 != memcmp(hash, blake2s_keyed_kat[i], BLAKE2S_OUTBYTES)) { goto fail; } } } puts( "ok" ); return 0; fail: puts("error"); return -1; } #endif
globaltoken/globaltoken
src/crypto/algos/blake/blake2s-ref.c
C
mit
9,670
#install docker (skip if you have docker 1.3+ already) [ -e /usr/lib/apt/methods/https ] || { sudo apt-get update sudo apt-get install apt-transport-https } sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys \ 36A1D7869245C8950F966E92D8576A8BA88D21E9 sudo sh -c "echo deb https://get.docker.com/ubuntu docker main > \ /etc/apt/sources.list.d/docker.list" sudo apt-get update sudo apt-get -y install lxc-docker #install docker-compose sudo apt-get install -y python-pip sudo pip install docker-compose #/usr/bin/env bash DIR=$(cd $(dirname "$0"); pwd) KIPPO_UID=499:499 DIONAEA_UID=nobody:nogroup YML=https://raw.githubusercontent.com/g1eagle/E-Pot/master/docker-compose2.yml #donwload/update yml curl -q $YML > docker-compose.yml # Move SSH server from Port 22 to Port 66534 echo "Moving SSH server to port 65534" sudo sed -i 's:Port 22:Port 65534:g' /etc/ssh/sshd_config sudo service ssh reload # Directory setup echo "Putting files in $DIR/var" mkdir -p $DIR/var/kippo $DIR/var/dionaea $DIR/var/glastopf #Dionaea's directories mkdir -p $DIR/var/dionaea/wwwroot mkdir -p $DIR/var/dionaea/binaries mkdir -p $DIR/var/dionaea/log mkdir -p $DIR/var/dionaea/bistreams sudo chown -R $KIPPO_UID $DIR/var/kippo sudo chown -R $DIONAEA_UID $DIR/var/dionaea sudo chown -R $DIONAEA_UID $DIR/var/glastopf sudo docker-compose up -d
g1eagle/E-Pot
run.sh
Shell
mit
1,363
// // DropboxDownloadTaskDelegate.h // Pods // // Created by Михаил Мотыженков on 13.05.16. // // #import <Foundation/Foundation.h> @protocol DropboxDownloadTaskDelegate <NSObject> - (void)downloadTaskDidResumeWithOldTask:(NSURLSessionDownloadTask *)oldTask newTask:(NSURLSessionDownloadTask *)newTask session:(NSURLSession *)session; @end
zlib/ObjectiveDropbox
Pod/Classes/Http/DropboxDownloadTaskDelegate.h
C
mit
363
#http://stackoverflow.com/questions/1729824/an-efficient-way-to-transpose-a-file-in-bash awk ' { for (i=1; i<=NF; i++) { a[NR,i] = $i } } NF>p { p = NF } END { for(j=1; j<=p; j++) { str=a[1,j] for(i=2; i<=NR; i++){ str=str" "a[i,j]; } print str } }' $1
joesoftheart/Metagenomic
R_Script/transposetable.sh
Shell
mit
327
EmberApp.ModalDialogComponent = Ember.Component.extend({ actions: { close: function() { return this.sendAction('close'); }, save: function(){ return this.sendAction('close', 'save'); } } });
alexandrupirjol/ember-app
app/scripts/views/modal_component.js
JavaScript
mit
258
package com.ghusse.ci.violations.bbcloud.lib.client.model.v1; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import java.util.Locale; @JsonIgnoreProperties(ignoreUnknown = true) @JsonSerialize public class Comment { @JsonProperty("comment_id") @JsonInclude(JsonInclude.Include.NON_DEFAULT) private long id; @JsonProperty("content") private String content; @JsonProperty("filename") @JsonInclude(JsonInclude.Include.NON_DEFAULT) private String file; @JsonProperty("line_to") @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Integer lineTo; public Comment() { // This class is created with Jackson, from JSON // It needs a default constructor } public Comment(String content, String fileName, int lineNumber) { this.content = content; this.file = fileName; this.lineTo = lineNumber; } public Comment(String content) { this.content = content; } public String getContent() { return content; } public Integer getLineTo() { return lineTo; } public String getFile() { return file; } @Override public String toString(){ return String.format(Locale.ENGLISH, "%s id: %d, file: %s, line: %d, content: %s", super.toString(), this.id, this.file, this.lineTo, this.content); } }
ghusse/violations-comments-to-bitbucket-cloud-lib
src/main/java/com/ghusse/ci/violations/bbcloud/lib/client/model/v1/Comment.java
Java
mit
1,533
import React, { Fragment, FunctionComponent } from 'react'; import { styled } from '@storybook/theming'; import { window } from 'global'; import { FlexBar } from '../bar/bar'; import { Icons } from '../icon/icon'; import { IconButton } from '../bar/button'; interface ZoomProps { zoom: (val: number) => void; resetZoom: () => void; } interface EjectProps { storyId?: string; baseUrl?: string; } interface BarProps { border?: boolean; } export type ToolbarProps = BarProps & ZoomProps & EjectProps; const Zoom: FunctionComponent<ZoomProps> = ({ zoom, resetZoom }) => ( <> <IconButton key="zoomin" onClick={e => { e.preventDefault(); zoom(0.8); }} title="Zoom in" > <Icons icon="zoom" /> </IconButton> <IconButton key="zoomout" onClick={e => { e.preventDefault(); zoom(1.25); }} title="Zoom out" > <Icons icon="zoomout" /> </IconButton> <IconButton key="zoomreset" onClick={e => { e.preventDefault(); resetZoom(); }} title="Reset zoom" > <Icons icon="zoomreset" /> </IconButton> </> ); const Eject: FunctionComponent<EjectProps> = ({ baseUrl, storyId }) => ( <IconButton key="opener" onClick={() => window.open(`${baseUrl}?id=${storyId}`)} title="Open canvas in new tab" > <Icons icon="share" /> </IconButton> ); const Bar = styled(props => <FlexBar {...props} />)({ position: 'absolute', left: 0, right: 0, top: 0, transition: 'transform .2s linear', }); export const Toolbar: FunctionComponent<ToolbarProps> = ({ storyId, baseUrl, zoom, resetZoom, ...rest }) => ( <Bar {...rest}> <Fragment key="left"> <Zoom {...{ zoom, resetZoom }} /> </Fragment> <Fragment key="right">{storyId && <Eject {...{ storyId, baseUrl }} />}</Fragment> </Bar> );
storybooks/react-storybook
lib/components/src/blocks/Toolbar.tsx
TypeScript
mit
1,901
package com.backendless.utils; import com.backendless.Persistence; import com.backendless.commons.persistence.EntityDescription; import java.util.Collection; import java.util.Iterator; import java.util.Map; /** * Operations on a data entity represented by {@link java.util.Map} * (e.g. a serialized object). */ public final class MapEntityUtil { /** * Removes relations and {@code null} fields (except system ones) from {@code entityMap}. * System fields like "created", "updated", "__meta" etc. are not removed if {@code null}. * * @param entityMap entity object to clean up */ public static void removeNullsAndRelations( Map<String, Object> entityMap ) { Iterator<Map.Entry<String, Object>> entryIterator = entityMap.entrySet().iterator(); while( entryIterator.hasNext() ) { Map.Entry<String, Object> entry = entryIterator.next(); if( !isSystemField( entry ) ) { if( isNullField( entry ) || isRelationField( entry ) ) { entryIterator.remove(); } } } } private static boolean isNullField( Map.Entry<String, Object> entry ) { return entry.getValue() == null; } private static boolean isRelationField( Map.Entry<String, Object> entry ) { return entry.getValue() instanceof Map || entry.getValue() instanceof EntityDescription || entry.getValue() instanceof Collection || entry.getValue().getClass().isArray(); } private static boolean isSystemField( Map.Entry<String, Object> entry ) { return entry.getKey().equals( Persistence.DEFAULT_OBJECT_ID_FIELD ) || entry.getKey().equals( Persistence.DEFAULT_CREATED_FIELD ) || entry.getKey().equals( Persistence.DEFAULT_UPDATED_FIELD ) || entry.getKey().equals( Persistence.DEFAULT_META_FIELD ); } }
Backendless/Android-SDK
src/com/backendless/utils/MapEntityUtil.java
Java
mit
1,849
using UnityEngine; using System.Collections; public interface IExitHandler { void Exit (); }
amoad/amoad-unity-plugin
AMoAdUnityPluginDemo(Debug)/Assets/DemoScipts/IExitHandler.cs
C#
mit
101
# hexadb-sparql [![npm](http://img.shields.io/npm/v/hexadb-sparql.svg?style=flat)](https://npmjs.com/hexadb-sparql) [![npm downloads](http://img.shields.io/npm/dm/hexadb-sparql.svg?style=flat)](https://npmjs.com/hexadb-sparql) [![build status](http://img.shields.io/travis/jhermsmeier/node-hexadb-sparql.svg?style=flat)](https://travis-ci.org/jhermsmeier/node-hexadb-sparql) ## Install via [npm](https://npmjs.com) ```sh $ npm install hexadb-sparql ```
jhermsmeier/node-hexadb-sparql
README.md
Markdown
mit
455
import { Component } from '@angular/core'; import { PropInfo } from './prop-info'; @Component({ selector: 'prop-info', templateUrl: './prop-info.component.html' //styleUrls: ['./info.component.css'] }) export class PropInfoComponent { model = new PropInfo('', '', '', '', ''); }
jheckjr/real-estate-calculator
src/app/prop-info.component.ts
TypeScript
mit
290
#include "nv_core.h" #include "nv_ml.h" #include "nv_num.h" // k-means++ // Selecting class with minimum distance static int nv_kmeans_bmc(const nv_matrix_t *mat, int mk, const nv_matrix_t *vec, int vm) { int k; int min_k = -1; float min_dist = FLT_MAX; for (k = 0; k < mk; ++k) { float dist = nv_euclidean2(mat, k, vec, vm); if (dist < min_dist) { min_dist = dist; min_k = k; } } return min_k; } // Initial value selection of K-Means++ static void nv_kmeans_init(nv_matrix_t *means, int k, const nv_matrix_t *data) { int m, c; nv_matrix_t *min_dists = nv_matrix_alloc(1, data->m); int rnd = (int)((data->m - 1) * nv_rand()); float potential = 0.0f; int local_tries = 2 + (int)log(data->m); // First nv_vector_copy(means, 0, data, rnd); for (m = 0; m < data->m; ++m) { float dist = nv_euclidean2(means, 0, data, m); NV_MAT_V(min_dists, m, 0) = dist; potential += dist; } for (c = 1; c < k; ++c) { float min_potential = FLT_MAX; int best_index = -1; int i; for (i = 0; i < local_tries; ++i) { float new_potential; float rand_val = potential * nv_rand(); for (m = 0; m < data->m - 1; ++m) { if (rand_val <= NV_MAT_V(min_dists, m, 0)) { break; } else { rand_val -= NV_MAT_V(min_dists, m, 0); } } new_potential = 0.0f; for (i = 0; i < data->m; ++i) { new_potential += min( nv_euclidean2(data, m, data, i), NV_MAT_V(min_dists, i, 0) ); } if (new_potential < min_potential) { min_potential = new_potential; best_index = m; } } nv_vector_copy(means, c, data, best_index); for (m = 0; m < data->m; ++m) { NV_MAT_V(min_dists, m, 0) = min( nv_euclidean2(data, m, data, best_index), NV_MAT_V(min_dists, m, 0) ); } potential = min_potential; } nv_matrix_free(&min_dists); } // Initial value selection in the longest distance static void nv_kmeans_init_max(nv_matrix_t *means, int k, const nv_matrix_t *data) { int m, c; nv_matrix_t *min_dists = nv_matrix_alloc(1, data->m); int rnd = (int)((data->m - 1) * nv_rand()); // 1つ目 nv_vector_copy(means, 0, data, rnd); for (m = 0; m < data->m; ++m) { NV_MAT_V(min_dists, m, 0) = nv_euclidean2(means, 0, data, m); } // 最短距離クラスから一番遠い要素を選択 for (c = 1; c < k; ++c) { float max_dist = -FLT_MAX; int max_index = -1; for (m = 0; m < data->m; ++m) { float dist = min(nv_euclidean2(means, c - 1, data, m), NV_MAT_V(min_dists, m, 0)); if (dist > max_dist) { max_dist = dist; max_index = m; } NV_MAT_V(min_dists, m, 0) = dist; } nv_vector_copy(means, c, data, max_index); } nv_matrix_free(&min_dists); } // ランダム初期値選択 static void nv_kmeans_init_rand(nv_matrix_t *means, int k, const nv_matrix_t *data) { int c; for (c = 0; c < k; ++c) { int rnd = (int)((data->m - 1) * nv_rand()); nv_vector_copy(means, c, data, rnd); } } int nv_kmeans(nv_matrix_t *means, // k nv_matrix_t *count, // k nv_matrix_t *labels, // data->m const nv_matrix_t *data, const int k, const int max_epoch) { int m, n, c; int processing = 1; int converge, epoch; nv_matrix_t *old_labels = nv_matrix_alloc(1, data->m); nv_matrix_t *sum = nv_matrix_alloc(data->n, k); assert(means->n == data->n); assert(means->m >= k); assert(labels->m >= data->m); // 初期値選択 nv_kmeans_init(means, k, data); for (m = 0; m < old_labels->m; ++m) { NV_MAT_V(old_labels, m, 0) = -1.0f; } epoch = 0; do { nv_matrix_zero(count); nv_matrix_zero(sum); for (m = 0; m < data->m; ++m) { int label = nv_kmeans_bmc(means, k, data, m); // Label decision NV_MAT_V(labels, m, 0) = (float)label; // Count NV_MAT_V(count, label, 0) += 1.0f; // Vector sum for (n = 0; n < means->n; ++n) { NV_MAT_V(sum, label, n) += NV_MAT_V(data, m, n); } } ++epoch; // Termination determination converge = 1; for (m = 0; m < data->m; ++m) { if (NV_MAT_V(labels, m, 0) != NV_MAT_V(old_labels, m, 0)) { converge = 0; break; } } if (converge) { // Terminate processing = 0; } else { // Update labels nv_matrix_copy(old_labels, 0, labels, 0, old_labels->m); // Median calculation for (c = 0; c < k; ++c) { if (NV_MAT_V(count, c, 0) != 0.0f) { float factor = 1.0f / NV_MAT_V(count, c, 0); for (n = 0; n < means->n; ++n) { NV_MAT_V(means, c, n) = NV_MAT_V(sum, c, n) * factor; } } } // Check maximal trials if (max_epoch != 0 && epoch >= max_epoch) { // Terminate processing = 0; } } } while (processing); nv_matrix_free(&old_labels); nv_matrix_free(&sum); return k; }
projectgalateia/animeface
src/nv_kmeans.c
C
mit
4,870
using $saferootprojectname$.Tests.Domain.ScreenObjects; namespace $safeprojectname$.ScreenObjects { class ShellScreenObject : IShellScreenObject { public StructureHelper StructureHelper { get; set; } public ShellScreenObject(StructureHelper structureHelper) { StructureHelper = structureHelper; } public void Close() { var shell = StructureHelper.GetShell(); shell.Close(); } } }
LogoFX/tools
src/LogoFX.Tools.Templates/ProjectTemplates/Wizard/P21/ScreenObjects/ShellScreenObject.cs
C#
mit
499
<!DOCTYPE html><html><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>[問卦] 有沒有考績的八卦 - 看板 Gossiping - 批踢踢實業坊</title> <meta name="robots" content="all"> <meta name="keywords" content="Ptt BBS 批踢踢"> <meta name="description" content=" 又到了年底打考績的時間 考績通常分為自評與主管評 考績的結果會直接關係到升遷/加薪/獎金 小妹自認這半年工作很認真 "> <meta property="og:site_name" content="Ptt 批踢踢實業坊"> <meta property="og:title" content="[問卦] 有沒有考績的八卦"> <meta property="og:description" content=" 又到了年底打考績的時間 考績通常分為自評與主管評 考績的結果會直接關係到升遷/加薪/獎金 小妹自認這半年工作很認真 "> <link rel="stylesheet" type="text/css" href="//images.ptt.cc/v2.10/bbs-common.css"> <link rel="stylesheet" type="text/css" href="//images.ptt.cc/v2.10/bbs.css" media="screen"> <link rel="stylesheet" type="text/css" href="//images.ptt.cc/v2.10/pushstream.css" media="screen"> <link rel="stylesheet" type="text/css" href="//images.ptt.cc/v2.10/bbs-print.css" media="print"> <script type="text/javascript" async="" src="https://apis.google.com/js/plusone.js"></script><script id="facebook-jssdk" src="//connect.facebook.net/en_US/all.js#xfbml=1"></script><script type="text/javascript" async="" src="https://ssl.google-analytics.com/ga.js"></script><script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="//images.ptt.cc/v2.10/bbs.js"></script> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-32365737-1']); _gaq.push(['_setDomainName', 'ptt.cc']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </head> <body> <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <div id="topbar-container"> <div id="topbar" class="bbs-content"> <a id="logo" href="/">批踢踢實業坊</a> <span>›</span> <a class="board" href="/bbs/Gossiping/index.html"><span class="board-label">看板 </span>Gossiping</a> <a class="right small" href="/about.html">關於我們</a> <a class="right small" href="/contact.html">聯絡資訊</a> </div> </div> <div id="navigation-container"> <div id="navigation" class="bbs-content"> <a class="board" href="/bbs/Gossiping/index.html">返回看板</a> <div class="bar"></div> <div class="share"> <span>分享</span> <div class="fb-like" data-send="false" data-layout="button_count" data-width="90" data-show-faces="false" data-href="http://www.ptt.cc/bbs/Gossiping/M.1419062752.A.7AC.html"></div> <div class="g-plusone" data-size="medium"></div> <script type="text/javascript"> window.___gcfg = {lang: 'zh-TW'}; (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })(); </script> </div> </div> </div> <div id="main-container"> <div id="main-content" class="bbs-screen bbs-content"><div class="article-metaline"><span class="article-meta-tag">作者</span><span class="article-meta-value">YahooTaiwan (超級喜歡剛力彩芽)</span></div><div class="article-metaline-right"><span class="article-meta-tag">看板</span><span class="article-meta-value">Gossiping</span></div><div class="article-metaline"><span class="article-meta-tag">標題</span><span class="article-meta-value">[問卦] 有沒有考績的八卦</span></div><div class="article-metaline"><span class="article-meta-tag">時間</span><span class="article-meta-value">Sat Dec 20 16:05:50 2014</span></div> 又到了年底打考績的時間 考績通常分為自評與主管評 考績的結果會直接關係到升遷/加薪/獎金 小妹自認這半年工作很認真 不知道把自己打為最高分會不會很不要臉 有沒有考績的八卦? -- Sent from my Windows -- <span class="f2">※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 180.218.164.71 </span><span class="f2">※ 文章網址: <a href="http://www.ptt.cc/bbs/Gossiping/M.1419062752.A.7AC.html" target="_blank" rel="nofollow">http://www.ptt.cc/bbs/Gossiping/M.1419062752.A.7AC.html</a> </span><div class="push"><span class="hl push-tag">推 </span><span class="f3 hl push-userid">lpbrother</span><span class="f3 push-content">: 你可以打一千分</span><span class="push-ipdatetime"> 12/20 16:06 </span></div><div class="push"><span class="f1 hl push-tag">→ </span><span class="f3 hl push-userid">alanlin1283</span><span class="f3 push-content">: 我要考積!!!</span><span class="push-ipdatetime"> 12/20 16:06 </span></div><div class="push"><span class="f1 hl push-tag">→ </span><span class="f3 hl push-userid">sumade5566</span><span class="f3 push-content">: 21世紀</span><span class="push-ipdatetime"> 12/20 16:06 </span></div><div class="push"><span class="hl push-tag">推 </span><span class="f3 hl push-userid">tyrande</span><span class="f3 push-content">: 我喜歡以前的 香雞城..</span><span class="push-ipdatetime"> 12/20 16:06 </span></div><div class="push"><span class="hl push-tag">推 </span><span class="f3 hl push-userid">milkyway168</span><span class="f3 push-content">: 主管的棒子+屬下的兩個奶子=100分</span><span class="push-ipdatetime"> 12/20 16:06 </span></div><div class="push"><span class="hl push-tag">推 </span><span class="f3 hl push-userid">srwhite</span><span class="f3 push-content">: 點心文</span><span class="push-ipdatetime"> 12/20 16:06 </span></div><div class="push"><span class="f1 hl push-tag">→ </span><span class="f3 hl push-userid">lunhsuan</span><span class="f3 push-content">: 自評通常有做事打中上 沒做事就打剛好及格吧</span><span class="push-ipdatetime"> 12/20 16:07 </span></div><div class="push"><span class="f1 hl push-tag">→ </span><span class="f3 hl push-userid">KCKCLIN</span><span class="f3 push-content">: 有多少人認為考績公平正義的?XD更別說很多新人都要背考績</span><span class="push-ipdatetime"> 12/20 16:09 </span></div><div class="push"><span class="f1 hl push-tag">→ </span><span class="f3 hl push-userid">KCKCLIN</span><span class="f3 push-content">: 最差那個</span><span class="push-ipdatetime"> 12/20 16:09 </span></div><div class="push"><span class="f1 hl push-tag">→ </span><span class="f3 hl push-userid">amateuruser</span><span class="f3 push-content">: 烤鴨?</span><span class="push-ipdatetime"> 12/20 16:14 </span></div><div class="push"><span class="hl push-tag">推 </span><span class="f3 hl push-userid">mermaidhan</span><span class="f3 push-content">: 鴨鴨戰隊</span><span class="push-ipdatetime"> 12/20 16:16 </span></div></div> <div id="article-polling" data-pollurl="/poll/Gossiping/M.1419062752.A.7AC.html?cacheKey=2052-1349331986&amp;offset=1555&amp;offset-sig=75891295f02b92cd54e64347dcbb13c4ae1a27f9" data-longpollurl="/v1/longpoll?id=245ab41b752bd26c5909025134e26b2d75974882" data-offset="1555">推文自動更新已關閉</div> <div class="bbs-screen bbs-footer-message">本網站已依台灣網站內容分級規定處理。此區域為限制級,未滿十八歲者不得瀏覽。</div> </div> </body></html>
iultimatez/PTTScraper
result/M.1419062752.A.7AC.html
HTML
mit
7,908
<?xml version="1.0"?> <div id="new-items-list-container"><ul id="new-items-list" class="pure-menu-list"><li class="pure-menu-item item-block" data-author="Robb, J. D., 1950- author." data-title="Apprentice in death /" data-language="eng" data-arrivaldate="10/31/2016 02:58"><a property="url" href="http://miami-primo.hosted.exlibrisgroup.com/primo_library/libweb/action/dlSearch.do?institution=01UOML&amp;vid=uml&amp;tab=default_tab&amp;search_scope=default_scope&amp;indx=1&amp;bulkSize=10&amp;query=any,contains,01UOML_ALMA21294969500002976"><span class="item-title-text" property="name">Apprentice in death /</span></a><div class="item-info"><p class="item-author" property="author">Robb, J. D., 1950- author.</p><p class="item-description" property="description">Library - Richter Library, Location - gbpm, Call number - PS3568.O243 A87 2016</p><p class="item-language"><span property="inLanguage">eng</span><span>375 pages ;;24 cm</span><span>BOOK</span></p><p class="item-arrivaldate"> Arrival date: 10/31/2016 02:58</p></div></li></ul></div>
UMiamiLibraries/newitems-app
app/alma-rss-to-html/BestsellersNewAcq_new_books_list.html
HTML
mit
1,067
/* * This file is part of SpongeAPI, licensed under the MIT License (MIT). * * Copyright (c) SpongePowered <https://www.spongepowered.org> * Copyright (c) contributors * * 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. */ package org.spongepowered.api.event; /** * Represents a listener accepting {@link Event}s of a specified type. * * @param <T> The type of the event */ @FunctionalInterface public interface EventListener<T extends Event> { /** * Called when a {@link Event} registered to this listener is called. * * @param event The called event * @throws Exception If an error occurs */ void handle(T event) throws Exception; }
SpongePowered/SpongeAPI
src/main/java/org/spongepowered/api/event/EventListener.java
Java
mit
1,703
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>basic_seq_packet_socket::bind (2 of 2 overloads)</title> <link rel="stylesheet" href="../../../../boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.75.2"> <link rel="home" href="../../../../index.html" title="Asio"> <link rel="up" href="../bind.html" title="basic_seq_packet_socket::bind"> <link rel="prev" href="overload1.html" title="basic_seq_packet_socket::bind (1 of 2 overloads)"> <link rel="next" href="../broadcast.html" title="basic_seq_packet_socket::broadcast"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table cellpadding="2" width="100%"><tr><td valign="top"><img alt="asio C++ library" width="250" height="60" src="../../../../asio.png"></td></tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="overload1.html"><img src="../../../../prev.png" alt="Prev"></a><a accesskey="u" href="../bind.html"><img src="../../../../up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../home.png" alt="Home"></a><a accesskey="n" href="../broadcast.html"><img src="../../../../next.png" alt="Next"></a> </div> <div class="section"> <div class="titlepage"><div><div><h5 class="title"> <a name="asio.reference.basic_seq_packet_socket.bind.overload2"></a><a class="link" href="overload2.html" title="basic_seq_packet_socket::bind (2 of 2 overloads)">basic_seq_packet_socket::bind (2 of 2 overloads)</a> </h5></div></div></div> <p> <span class="emphasis"><em>Inherited from basic_socket.</em></span> </p> <p> Bind the socket to the given local endpoint. </p> <pre class="programlisting"><span class="identifier">asio</span><span class="special">::</span><span class="identifier">error_code</span> <span class="identifier">bind</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">endpoint_type</span> <span class="special">&amp;</span> <span class="identifier">endpoint</span><span class="special">,</span> <span class="identifier">asio</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&amp;</span> <span class="identifier">ec</span><span class="special">);</span> </pre> <p> This function binds the socket to the specified endpoint on the local machine. </p> <h6> <a name="asio.reference.basic_seq_packet_socket.bind.overload2.h0"></a> <span><a name="asio.reference.basic_seq_packet_socket.bind.overload2.parameters"></a></span><a class="link" href="overload2.html#asio.reference.basic_seq_packet_socket.bind.overload2.parameters">Parameters</a> </h6> <div class="variablelist"> <p class="title"><b></b></p> <dl> <dt><span class="term">endpoint</span></dt> <dd><p> An endpoint on the local machine to which the socket will be bound. </p></dd> <dt><span class="term">ec</span></dt> <dd><p> Set to indicate what error occurred, if any. </p></dd> </dl> </div> <h6> <a name="asio.reference.basic_seq_packet_socket.bind.overload2.h1"></a> <span><a name="asio.reference.basic_seq_packet_socket.bind.overload2.example"></a></span><a class="link" href="overload2.html#asio.reference.basic_seq_packet_socket.bind.overload2.example">Example</a> </h6> <pre class="programlisting"><span class="identifier">asio</span><span class="special">::</span><span class="identifier">ip</span><span class="special">::</span><span class="identifier">tcp</span><span class="special">::</span><span class="identifier">socket</span> <span class="identifier">socket</span><span class="special">(</span><span class="identifier">io_service</span><span class="special">);</span> <span class="identifier">socket</span><span class="special">.</span><span class="identifier">open</span><span class="special">(</span><span class="identifier">asio</span><span class="special">::</span><span class="identifier">ip</span><span class="special">::</span><span class="identifier">tcp</span><span class="special">::</span><span class="identifier">v4</span><span class="special">());</span> <span class="identifier">asio</span><span class="special">::</span><span class="identifier">error_code</span> <span class="identifier">ec</span><span class="special">;</span> <span class="identifier">socket</span><span class="special">.</span><span class="identifier">bind</span><span class="special">(</span><span class="identifier">asio</span><span class="special">::</span><span class="identifier">ip</span><span class="special">::</span><span class="identifier">tcp</span><span class="special">::</span><span class="identifier">endpoint</span><span class="special">(</span> <span class="identifier">asio</span><span class="special">::</span><span class="identifier">ip</span><span class="special">::</span><span class="identifier">tcp</span><span class="special">::</span><span class="identifier">v4</span><span class="special">(),</span> <span class="number">12345</span><span class="special">),</span> <span class="identifier">ec</span><span class="special">);</span> <span class="keyword">if</span> <span class="special">(</span><span class="identifier">ec</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// An error occurred.</span> <span class="special">}</span> </pre> </div> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <td align="left"></td> <td align="right"><div class="copyright-footer">Copyright &#169; 2003-2014 Christopher M. Kohlhoff<p> Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) </p> </div></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="overload1.html"><img src="../../../../prev.png" alt="Prev"></a><a accesskey="u" href="../bind.html"><img src="../../../../up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../home.png" alt="Home"></a><a accesskey="n" href="../broadcast.html"><img src="../../../../next.png" alt="Next"></a> </div> </body> </html>
dhh1128/intent
old/src/external/asio-1.10.2/doc/asio/reference/basic_seq_packet_socket/bind/overload2.html
HTML
mit
6,400
{ String.fromCodePoint(Infinity); }
stas-vilchik/bdd-ml
data/2609.js
JavaScript
mit
38
############################################################ # # # hprose # # # # Official WebSite: http://www.hprose.com/ # # http://www.hprose.org/ # # # ############################################################ ############################################################ # # # hprose/unixclient.rb # # # # hprose unix client for ruby # # # # LastModified: Apr 13, 2014 # # Author: Ma Bingyao <andot@hprose.com> # # # ############################################################ require "hprose/socketclient" require "socket" module Hprose class UnixClient < SocketClient protected def create_socket return UNIXSocket.new(@uri.path) end end # class UnixClient end # module Hprose
hprose/hprose-ruby
lib/hprose/unixclient.rb
Ruby
mit
1,323
'use strict'; function f1(a, b) { console.log('f1(' + a + ', ' + b + ')'); } f1(2, 3); f1.call(null, 2, 3); f1(...[2, 3]); f1.apply(null, [2, 3]);
wirtaw/Project
src/Functions/b-call-apply.js
JavaScript
mit
152
<?php declare(strict_types=1); /* * This file is part of the GeckoPackages. * * (c) GeckoPackages https://github.com/GeckoPackages * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace GeckoPackages\DiffOutputBuilder\Tests; use PHPUnit\Framework\TestCase; use SebastianBergmann\Diff\Differ; use SebastianBergmann\Diff\Output\DiffOutputBuilderInterface; /** * @author SpacePossum * * @coversNothing * * @internal */ abstract class AbstractDiffOutputBuilderTest extends TestCase { /** * @var string */ private $differClass; abstract public function provideOutputBuildingCases(): array; abstract public function provideSample(): array; abstract public function assertValidDiffFormat(string $diff); /** * @param string $expected * @param string $from * @param string $to * @param array $options * * @dataProvider provideOutputBuildingCases */ public function testOutputBuilding(string $expected, string $from, string $to, array $options) { $diff = $this->getDiffer($options)->diff($from, $to); $this->assertValidDiffFormat($diff); $this->assertSame($expected, $diff); } /** * @param string $expected * @param string $from * @param string $to * @param array $options * * @dataProvider provideSample */ public function testSample(string $expected, string $from, string $to, array $options) { $diff = $this->getDiffer($options)->diff($from, $to); $this->assertValidDiffFormat($diff); $this->assertSame($expected, $diff); } /** * Returns a new instance of a Differ with a new instance of the class (DiffOutputBuilderInterface) under test. * * @param array $options * * @return Differ */ protected function getDiffer(array $options = []): Differ { if (null === $this->differClass) { // map test class name (child) back to the Differ being tested. $childClass = \get_class($this); $differClass = 'GeckoPackages\DiffOutputBuilder\\'.\substr($childClass, \strrpos($childClass, '\\') + 1, -4); // basic tests: class must exist... $this->assertTrue(\class_exists($differClass)); // ...and must implement DiffOutputBuilderInterface $implements = \class_implements($differClass); $this->assertInternalType('array', $implements); $this->assertArrayHasKey(DiffOutputBuilderInterface::class, $implements); $this->differClass = $differClass; } return new Differ(new $this->differClass($options)); } }
GeckoPackages/GeckoDiffOutputBuilder
tests/DiffOutputBuilder/Tests/AbstractDiffOutputBuilderTest.php
PHP
mit
2,754
from typing import Iterable, Callable, Optional, Any, List, Iterator from dupescan.fs._fileentry import FileEntry from dupescan.fs._root import Root from dupescan.types import AnyPath FSPredicate = Callable[[FileEntry], bool] ErrorHandler = Callable[[EnvironmentError], Any] def catch_filter(inner_filter: FSPredicate, error_handler_func: ErrorHandler) -> FSPredicate: # If no filter function provided, return one that includes everything. In # this case it will never raise an error, so error_handler_func doesn't get # a look-in here if inner_filter is None: def always_true(*args, **kwargs): return True return always_true # Otherwise if the filter function throws an EnvironmentError, pass it to # the error_handler_func (if provided) and return false def wrapped_func(*args, **kwargs): try: return inner_filter(*args, **kwargs) except EnvironmentError as env_error: if error_handler_func is not None: error_handler_func(env_error) return False return wrapped_func def noerror(_): pass class Walker(object): def __init__( self, recursive: bool, dir_object_filter: Optional[FSPredicate]=None, file_object_filter: Optional[FSPredicate]=None, onerror: Optional[ErrorHandler]=None ): self._recursive = bool(recursive) self._onerror = noerror if onerror is None else onerror self._dir_filter = catch_filter(dir_object_filter, self._onerror) self._file_filter = catch_filter(file_object_filter, self._onerror) def __call__(self, paths: Iterable[AnyPath]) -> Iterator[FileEntry]: for root_index, root_path in enumerate(paths): root_spec = Root(root_path, root_index) try: root_obj = FileEntry.from_path(root_path, root_spec) except EnvironmentError as env_error: self._onerror(env_error) continue if root_obj.is_dir and self._dir_filter(root_obj): if self._recursive: yield from self._recurse_dir(root_obj) else: yield root_obj elif root_obj.is_file and self._file_filter(root_obj): yield root_obj def _recurse_dir(self, root_obj: FileEntry): dir_obj_q: List[FileEntry] = [ root_obj ] next_dirs: List[FileEntry] = [ ] while len(dir_obj_q) > 0: dir_obj = dir_obj_q.pop() next_dirs.clear() try: for child_obj in dir_obj.dir_content(): try: if ( child_obj.is_dir and not child_obj.is_symlink and self._dir_filter(child_obj) ): next_dirs.append(child_obj) elif ( child_obj.is_file and self._file_filter(child_obj) ): yield child_obj except EnvironmentError as query_error: self._onerror(query_error) except EnvironmentError as env_error: self._onerror(env_error) dir_obj_q.extend(reversed(next_dirs)) def flat_iterator( paths: Iterable[AnyPath], dir_object_filter: Optional[FSPredicate]=None, file_object_filter: Optional[FSPredicate]=None, onerror: Optional[ErrorHandler]=None ) -> Iterator[FileEntry]: return Walker(False, dir_object_filter, file_object_filter, onerror)(paths) def recurse_iterator( paths: Iterable[AnyPath], dir_object_filter: Optional[FSPredicate]=None, file_object_filter: Optional[FSPredicate]=None, onerror: Optional[ErrorHandler]=None ) -> Iterator[FileEntry]: return Walker(True, dir_object_filter, file_object_filter, onerror)(paths)
yellcorp/dupescan
dupescan/fs/_walker.py
Python
mit
4,089
<<<<<<< HEAD <div> <br/> <div class="col-sm-6"> <label>Employee Id</label> <md-select placeholder="Employee Id" [(ngModel)]='pay_id'><!--getData function should call "AllowanceTableInfo()"--> <md-option *ngFor="let emp of emps" [value]="emp.value" (click)="selectedValue(emp);passTheEmployeeId()" > <!--employee get function local variable should be emp--> {{ emps.emp_id}} </md-option> </md-select> </div> <div class="col-sm-6"> <label>Employee Name</label> </div> <br/><br/><br/> <div class="col-sm-12" style="margin-top: 100px;"> <div class="panel panel-default panel-table"> <div class="panel-heading"> <div class="row"> <div class="col col-xs-6"> <h3 class="panel-title">Manage Allowance</h3> </div> <div class="col col-xs-6 text-right"> <md-select placeholder="Allowance Name"> <md-option *ngFor="let allo of allos" [value]="allo.value" (click)="selectedValue(allo.allowance_id)">{{ allo.allowance_name}} </md-option> </md-select> <button type="button" class="btn btn-sm btn-primary btn-create" (click)="setAllAllowanceInfo()">Add Allowance</button> ======= <div class="container"> <div class="payroll-dynamic-page"> <div class="row"> <div class="col-md-10 col-md-offset-1"> <div class="panel panel-default panel-table"> <div class="panel-heading"> <div class="row"> <div class="col col-xs-6"> <h3 class="panel-title">Manage Allowances</h3> </div> <div class="col col-xs-6 text-right"> <button type="button" class="btn btn-sm btn-primary btn-create" routerLink="/add-allowance">Add Allowance</button> >>>>>>> origin/master </div> </div> </div> <div class="panel-body"> <table class="table table-striped table-bordered table-list"> <thead> <tr> <th><em class="fa fa-cog"></em></th> <th class="hidden-xs">Allowance ID</th> <<<<<<< HEAD <th>Allowance Type</th> ======= <th>Allowance Name</th> <th>Is_enability to EPF(Y/N)</th> >>>>>>> origin/master <th>Amount</th> </tr> </thead> <tbody> <<<<<<< HEAD <tr *ngFor="let d of empallowance"><!--should asign local variable all the server side object should asign to the local variable in servie file--> ======= <tr> >>>>>>> origin/master <td align="center"> <a class="btn btn-default"><em class="fa fa-pencil"></em></a> <a class="btn btn-danger"><em class="fa fa-trash"></em></a> </td> <<<<<<< HEAD <td class="hidden-xs">{{d.allowance_id}}</td> <td>{{d.allowance_name}}</td> <td>{{d.amount}}</td> ======= <td class="hidden-xs">1</td> <td>Living Allowance</td> <td>Yes</td> <td>Rs.23000</td> >>>>>>> origin/master </tr> </tbody> </table> </div> <<<<<<< HEAD </div> </div> <div class="col-sm-12" > <div class="pull-right" style="margin-block-start:50px"> <label>Total Allowance: </label>{{sum}}<br/> <button class="btn btn-info">Save</button> </div> </div> </div> ======= <div class="panel-footer"> <div class="row"> <div class="col col-xs-4">Page 1 of 5 </div> <div class="col col-xs-8"> <ul class="pagination hidden-xs pull-right"> <li><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">4</a></li> <li><a href="#">5</a></li> </ul> <ul class="pagination visible-xs pull-right"> <li><a href="#">�</a></li> <li><a href="#">�</a></li> </ul> </div> </div> </div> </div> </div> </div> </div> </div> >>>>>>> origin/master
sayanuIT/teds2
src/client/packages/payroll/manage-allowances/manage-allowance.component.html
HTML
mit
4,882
#!/usr/bin/env python import sys import os import subprocess import shutil import fix_rocks_network import json pxelinux_kernels_dir='/tftpboot/pxelinux/'; centos7_templates_dir='./centos7_ks' centos7_dir='/export/rocks/install/centos7/'; centos7_ks_scripts_dir=centos7_dir+'/scripts/'; centos7_pxeboot_dir=centos7_dir+'/images/pxeboot'; #Fix PXE boot bug def fix_pxe_bug(): shutil.copy('/usr/share/syslinux/chain.c32', pxelinux_kernels_dir); subprocess.call('rocks add bootaction action=os kernel="com32 chain.c32" args="hd0"', shell=True); def fix_install_action(): shutil.copy(centos7_pxeboot_dir+'/vmlinuz', pxelinux_kernels_dir+'/vmlinuz-centos7'); shutil.copy(centos7_pxeboot_dir+'/initrd.img', pxelinux_kernels_dir+'/initrd.img-centos7'); ks_host = fix_rocks_network.get_rocks_attr('Kickstart_PrivateKickstartHost'); ks_base_dir = fix_rocks_network.get_rocks_attr('Kickstart_PrivateKickstartBasedir'); subprocess.call('rocks add bootaction action=install kernel=vmlinuz-centos7 ramdisk=initrd.img-centos7 args="ksdevice=bootif ramdisk_size=16000 ks=http://'+ks_host+'/'+ks_base_dir+'/centos7/ks.cfg rhgb quiet console=tty0 console=ttyS0,115200n8"', shell=True); def setup_for_centos7(params): if(not os.path.isdir(centos7_dir)): sys.stderr.write('ERROR: the contents of a CentOS-7 iso must be unpacked in the directory: '+centos7_dir+'\n'); raise Exception('Missing directory containing CentOS-7 iso contents'); try: os.mkdir(centos7_ks_scripts_dir, 0755); except OSError: pass #PXE boot changes fix_pxe_bug(); fix_install_action(); #ssh public key shutil.rmtree(centos7_ks_scripts_dir+'/ssh_public_keys', ignore_errors=True); try: os.remove(centos7_ks_scripts_dir+'/ssh_public_keys'); except Exception: pass if('ssh_public_keys_file' in params): shutil.copy(params['ssh_public_keys_file'], centos7_ks_scripts_dir+'/ssh_public_keys'); #Get root password root_passwd='$6$CdGXnN6zABQ0Pc/7$lsUtU27wSxwpGNrLQq00Mzpwb27ujgkV5Trq8wlZrqOmrmFuX6q5X0hebNKKs5DSk8.fU3o.b6Z0ISOfNnpTl.'; sys.stderr.write('Enter the root password to be set for your cluster by kickstart\n'); pid = subprocess.Popen('grub-crypt --sha-512', shell=True, stdout=subprocess.PIPE); stdout_str = pid.communicate()[0]; if(pid.returncode == 0): root_passwd = stdout_str.strip(); else: sys.stderr.write('ERROR: could not obtain root password, using a random string. Re-run the program to set your root passwd\n'); #Copy disk.py file for partitioning shutil.copy(centos7_templates_dir+'/scripts/disk.py', centos7_ks_scripts_dir+'/disk.py'); #Create files from templates shutil.copy(centos7_templates_dir+'/ks_template.cfg', centos7_dir+'/ks.cfg'); shutil.copy(centos7_templates_dir+'/scripts/pre_install_template.sh', centos7_ks_scripts_dir+'/pre_install.sh'); shutil.copy(centos7_templates_dir+'/scripts/post_install_template.sh', centos7_ks_scripts_dir+'/post_install.sh'); ks_host = fix_rocks_network.get_rocks_attr('Kickstart_PrivateKickstartHost'); ks_base_dir = fix_rocks_network.get_rocks_attr('Kickstart_PrivateKickstartBasedir'); cmd = 'sed -i -e \'s/Kickstart_PrivateKickstartHost/'+ks_host+'/g\' -e \'s/Kickstart_PrivateKickstartBasedir/'+ks_base_dir+'/g\' '+centos7_ks_scripts_dir+'/post_install.sh '+centos7_ks_scripts_dir+'/pre_install.sh '+centos7_dir+'/ks.cfg'; status = subprocess.call(cmd, shell=True); if(status != 0): sys.stderr.write('ERROR: could not setup pre/post install scripts and kickstart file\n'); raise Exception('Could not setup pre/post install scripts and kickstart file'); if('timezone' in params): cmd = 'sed -i -e \'/^timezone/c\\\ntimezone '+params['timezone']+'\' '+centos7_dir+'/ks.cfg' status = subprocess.call(cmd, shell=True); if(status != 0): sys.stderr.write('ERROR: could not setup timezone in kickstart file\n'); raise Exception('Could not setup timezone in kickstart file'); with open(centos7_dir+'/ks.cfg', 'ab') as fptr: fptr.write('rootpw --iscrypted '+root_passwd+' \n'); fptr.close(); if __name__ == "__main__": params = {}; if(len(sys.argv) >= 2): with open(sys.argv[1], 'rb') as data_file: params = json.load(data_file); directory = os.path.dirname(sys.argv[0]); if(directory and directory != ''): os.chdir(directory); setup_for_centos7(params);
kgururaj/rocks-centos7
setup_for_centos7.py
Python
mit
4,371
package add import ( "errors" "fmt" "io" "log" "os" "path/filepath" "sort" "time" "github.com/fhs/gompd/mpd" "hawx.me/code/aoide/data" "hawx.me/code/aoide/song" ) func New(musicDir string, db *data.Database) *Adder { conn, err := mpd.Dial("tcp", ":6600") if err != nil { conn = nil } return &Adder{musicDir, db, conn} } type Adder struct { musicDir string db *data.Database client *mpd.Client } type addRecord struct { from, to string s data.Song } type byPath []addRecord func (a byPath) Len() int { return len(a) } func (a byPath) Less(i, j int) bool { return a[i].to < a[j].to } func (a byPath) Swap(i, j int) { a[i], a[j] = a[j], a[i] } func (a *Adder) Add(queue bool, paths ...string) (err error) { recs := []addRecord{} for _, path := range paths { s, err := song.Read(path) if err != nil { log.Println(err) continue } recs = append(recs, addRecord{ from: path, to: song.PathFor(a.musicDir, s), s: s, }) } sort.Sort(byPath(recs)) lastDir := "" for _, rec := range recs { thisDir := filepath.Dir(rec.to) if thisDir != lastDir { fmt.Println(thisDir) lastDir = thisDir } fmt.Println(" ", filepath.Base(rec.to)) } fmt.Print("Add? [yn] ") var response string _, err = fmt.Scanln(&response) if err != nil { log.Fatal(err) } if response == "y" || response == "Y" { log.Println("adding...") a.doAdd(queue, recs) } else { log.Println("skipping...") } return } func (a *Adder) doAdd(queue bool, recs []addRecord) error { var toQueue []string for _, rec := range recs { if err := os.MkdirAll(filepath.Dir(rec.to), 0755); err != nil { log.Printf("Could not add %s: %s\n", rec.from, err) continue } if err := copyFile(rec.from, rec.to); err != nil { log.Printf("Could not add %s: %s\n", rec.from, err) continue } s, err := song.Read(rec.to) if err != nil { log.Printf("Could not add %s to db: %s\n", rec.from, err) continue } if err := a.db.Insert(s); err != nil { log.Printf("Could not add %s to db: %s\n", rec.from, err) continue } if a.client != nil { p, _ := filepath.Rel(a.musicDir, rec.to) if _, err := a.client.Update(p); err != nil { log.Printf("Could not add %s to mpd: %s\n", rec.from, err) continue } if queue { toQueue = append(toQueue, p) } } } if len(toQueue) > 0 { time.Sleep(time.Second) // ugh for _, p := range toQueue { if err := a.client.Add(p); err != nil { log.Printf("Could not add %s to playlist: %s\n", p, err) continue } } } return nil } func copyFile(src, dst string) error { if _, err := os.Stat(dst); err == nil || os.IsExist(err) { return errors.New("destination already exists") } in, err := os.Open(src) if err != nil { return err } defer in.Close() out, err := os.Create(dst) if err != nil { return err } defer out.Close() if _, err = io.Copy(out, in); err != nil { return err } return out.Close() }
hawx/aoide
tools/add/adder.go
GO
mit
2,997
{% extends "base.html" %} {% load static %} {% load crispy_forms_filters %} {% block title %}Update Flow Cell Libraries{% endblock %} {% block content %} <h2>Update Flow Cell Libraries</h2> <form method="post"> {% crispy formset helper %} <div class="text-right mb-3"> <div class="btn-group" role="group"> <a role="button" class="btn btn-secondary" href="{% url 'flowcell_view' uuid=object.uuid %}"> <i class="fa fa-arrow-circle-left" aria-hidden="true"></i> Cancel </a> <button type="submit" name="submit_more" value="submit_more" class="btn btn-primary"> <i class="fa fa-plus" aria-hidden="true"></i> Save and add more </button> <button type="submit" name="submit" value="submit" class="btn btn-primary"> <i class="fa fa-check" aria-hidden="true"></i> Save </button> </div> </div> </form> {% endblock content %} {% block javascript %} {{ block.super }} <script type="text/javascript"> /* Convert from barcode <select> to barcode_set <select> id */ function barcodeToSet(barcodeId) { console.log('barcodeToSet(' + barcodeId + ')'); var num = barcodeId.slice(barcodeId.length - 1); console.log("num", num, typeof(num)); if (num != "2") num = ""; var name = barcodeId.slice(0, barcodeId.length - num.length); console.log('name ' + name + ", " + num.length); console.log('return ' + name + '_set' + num); return barcodeId.slice(0, barcodeId.length - num.length) + '_set' + num; } /* Convert from barcode_set <select> id to barcode <select> */ function barcodeSetToBarcode(barcodeId) { console.log('barcodeSetToBarcode(' + barcodeId + ')'); var num = barcodeId.slice(barcodeId.length - 1); if (num != "2") num = ""; console.log('num ' + num); console.log('return ' + barcodeId.substr(0, barcodeId.length - 4 - num.length) + num); return barcodeId.substr(0, barcodeId.length - 4 - num.length) + num; } /* Update barcode field for a given select barcode set field */ function barcodeSetUpdated(barcodeSetSelect) { var selectedValue = $(barcodeSetSelect).val(); var barcodeSelect = $('#' + barcodeSetToBarcode(barcodeSetSelect.attr('id'))); barcodeSelect.prop('disabled', !selectedValue); if (!selectedValue) { barcodeSelect.val(''); } else { barcodeSelect.find('option').each(function() { console.log($(this)); var dataSetId = $(this).attr('data-set-id'); console.log(dataSetId, barcodeSetSelect.val()); console.log(typeof(dataSetId), typeof(barcodeSetSelect.val())); console.log(dataSetId == barcodeSetSelect.val()); if (dataSetId == '' || dataSetId == barcodeSetSelect.val()) { $(this).show(); } else { $(this).hide(); } }); } } $(document).ready(function () { $('select.barcode-field, select.barcode-field2').each(function() { console.log('1', this); console.log('2', $(this).attr('id')); var barcodeSetId = '#' + barcodeToSet($(this).attr('id')); barcodeSetUpdated($(barcodeSetId)); }); $('select.barcode-set-field, select.barcode-set-field2').change( function() { barcodeSetUpdated($(this)); }); $('table thead tr th:last').after( '<th for="div_id_form-0-DELETE" class="control-label">Delete</th>'); }); </script> {% endblock %}
bihealth/flowcelltool
flowcelltool/flowcells/templates/flowcells/flowcell_updatelibraries.html
HTML
mit
3,745
module SaasRunner module Resource class Activation attr_reader :client, :response def initialize(client) @client = client end def create!(params = {}) @response = client.post('/activations', { activation: params }) @response.body end end end end
simpleweb/saasrunner-client-ruby
lib/saas_runner/resource/activation.rb
Ruby
mit
314
<?php namespace Moltin\Resources; use Moltin\Resource as Resource; class Carts extends Resource { public $uri = 'carts'; }
moltin/php-sdk
src/Resources/Carts.php
PHP
mit
131
<!DOCTYPE html> <head> <title>Larissa's DBC CULTURAL Blog</title> <meta charset="UTF-8"> <link rel="stylesheet" type="text/css" href="../stylesheets/blog-stylesheet.css"> </head> <main> <h1>Work It Out</h1> <h2>A guide to navigating and resolving conflict</h2> <h4>July 20, 2015</h4> <section> <p> (This blog post is currently being edited. Please check back soon!) </p> <p> </p> <p> </p> </section> </main>
MsLarissaaa/MsLarissaaa.github.io
blog/c8-conflict.html
HTML
mit
459
module DCM module Configuration VALID_CONNECTION_KEYS = [:endpoint, :user_agent, :method, :api_version].freeze VALID_OPTIONS_KEYS = [:access_key, :secret_key].freeze VALID_CONFIG_KEYS = VALID_CONNECTION_KEYS + VALID_OPTIONS_KEYS ENDPOINT = 'https://api.enstratus.com/api/enstratus' API_VERSION = '2014-11-24' METHOD = 'GET' USER_AGENT = "Dell Cloud Manager Ruby Client #{DCM::VERSION}".freeze ACCESS_KEY = nil SECRET_KEY = nil # Build accessor methods for every config option attr_accessor *VALID_CONFIG_KEYS # Make sure we have the default values set when we get 'extended' def self.extended(base) base.reset end def reset self.endpoint = ENDPOINT self.api_version = API_VERSION self.method = METHOD self.user_agent = USER_AGENT self.access_key = ACCESS_KEY self.secret_key = SECRET_KEY end def configure yield self end # Return the configuration values set in this module def options Hash[ *Configuration::VALID_CONFIG_KEYS.map { |key| [key, send(key)] }.flatten ] end end end
jbrien/rbdcm-api
lib/dcm/configuration.rb
Ruby
mit
1,159
package knot.data.buffers import java.nio.ByteOrder import java.nio.channels.WritableByteChannel object BufferOutput { def toArray(): BufferOutput = { toArray(8192) } def toArray(size: Int): BufferOutput = { new DefaultBufferOutput(OutputSink.toArray(size, ByteOrder.nativeOrder())) } def toChannel(channel: WritableByteChannel): BufferOutput = { toChannel(channel, 8192) } def toChannel(channel: WritableByteChannel, bufferSize: Int): BufferOutput = { new DefaultBufferOutput(OutputSink.toChannel(channel, bufferSize, ByteOrder.nativeOrder())) } } trait BufferOutput { def sink: OutputSink /** * bufer size * * @return buffer size */ def size: Long def order: ByteOrder /** * get next write index of this buffer. * * @return next write index. */ def writerIndex: Long def putByte(v: Byte): Unit def putBytes(src: Array[Byte], offset: Int, length: Int): Unit def putInt(v: Int): Unit def putShort(v: Short): Unit def putLong(v: Long): Unit def putFloat(v: Float): Unit def putDouble(v: Double): Unit /** * Flush this buffer. Call this before buffer read. */ def flush(): Unit def close(): Unit }
defvar/knot
knot-data/src/main/scala/knot/data/buffers/BufferOutput.scala
Scala
mit
1,219
<!DOCTYPE html> <!--[if IEMobile 7]><html class="iem7 no-js" lang="en" dir="ltr"><![endif]--> <!--[if lt IE 7]><html class="lt-ie9 lt-ie8 lt-ie7 no-js" lang="en" dir="ltr"><![endif]--> <!--[if (IE 7)&(!IEMobile)]><html class="lt-ie9 lt-ie8 no-js" lang="en" dir="ltr"><![endif]--> <!--[if IE 8]><html class="lt-ie9 no-js" lang="en" dir="ltr"><![endif]--> <!--[if (gt IE 8)|(gt IEMobile 7)]><!--> <html class="no-js not-oldie" lang="en" dir="ltr"> <!--<![endif]--> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="HandheldFriendly" content="true" /> <link rel="shortcut icon" href="https://www.epa.gov/sites/all/themes/epa/favicon.ico" type="image/vnd.microsoft.icon" /> <meta name="MobileOptimized" content="width" /> <meta http-equiv="cleartype" content="on" /> <meta http-equiv="ImageToolbar" content="false" /> <meta name="viewport" content="width=device-width" /> <meta name="version" content="20161218" /> <!--googleon: all--> <meta name="DC.description" content="" /> <meta name="DC.title" content="" /> <title> A Model of the Transformations of Metal and Metal Oxide Nanoparticles in Freshwater Sediments: Exploring Critical Uncertainties and the Role of Sediments in Nanoparticle Risk Assessment| Research Project Database | Grantee Research Project | ORD | US EPA</title> <!--googleoff: snippet--> <meta name="keywords" content="" /> <link rel="shortlink" href="" /> <link rel="canonical" href="" /> <meta name="DC.creator" content="" /> <meta name="DC.language" content="en" /> <meta name="DC.Subject.epachannel" content="" /> <meta name="DC.type" content="" /> <meta name="DC.date.created" content="" /> <meta name="DC.date.modified" content="2014-10-23" /> <!--googleoff: all--> <link type="text/css" rel="stylesheet" href="https://www.epa.gov/misc/ui/jquery.ui.autocomplete.css" media="all" /> <link type="text/css" rel="stylesheet" href="https://www.epa.gov/sites/all/themes/epa/css/lib/jquery.ui.theme.css" media="all" /> <link type="text/css" rel="stylesheet" href="https://www.epa.gov/sites/all/libraries/template2/s.css" media="all" /> <!--[if lt IE 9]><link type="text/css" rel="stylesheet" href="https://www.epa.gov/sites/all/themes/epa/css/ie.css" media="all" /><![endif]--> <link rel="alternate" type="application/atom+xml" title="EPA.gov All Press Releases" href="https://www.epa.gov/newsreleases/search/rss" /> <link rel="alternate" type="application/atom+xml" title="EPA.gov Headquarters Press Releases" href="https://www.epa.gov/newsreleases/search/rss/field_press_office/headquarters" /> <link rel="alternate" type="application/atom+xml" title="Greenversations, EPA's Blog" href="https://blog.epa.gov/blog/feed/" /> <!--[if lt IE 9]><script src="https://www.epa.gov/sites/all/themes/epa/js/html5.js"></script><![endif]--> <style type="text/css"> /*This style needed for highlight link. Please do not remove*/ .hlText { font-family: "Arial"; color: red; font-weight: bold; font-style: italic; background-color: yellow; } .tblClass { font-size:smaller; min-width: 10%; line-height: normal; } </style> </head> <!-- NOTE, figure out body classes! --> <body class="node-type-(web-area|page|document|webform) (microsite|resource-directory)" > <!-- Google Tag Manager --> <noscript> <iframe src="//www.googletagmanager.com/ns.html?id=GTM-L8ZB" height="0" width="0" style="display:none;visibility:hidden"></iframe> </noscript> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-L8ZB');</script> <!-- End Google Tag Manager --> <div class="skip-links"><a href="#main-content" class="skip-link element-invisible element-focusable">Jump to main content</a></div> <header class="masthead clearfix" role="banner"> <img class="site-logo" src="https://www.epa.gov/sites/all/themes/epa/logo.png" alt="" /> <hgroup class="site-name-and-slogan"> <h1 class="site-name"><a href="https://www.epa.gov/" title="Go to the home page" rel="home"><span>US EPA</span></a></h1> <div class="site-slogan">United States Environmental Protection Agency</div> </hgroup> <form class="epa-search" method="get" action="https://search.epa.gov/epasearch/epasearch"> <label class="element-hidden" for="search-box">Search</label> <input class="form-text" placeholder="Search EPA.gov" name="querytext" id="search-box" value=""/> <button class="epa-search-button" id="search-button" type="submit" title="Search">Search</button> <input type="hidden" name="fld" value="" /> <input type="hidden" name="areaname" value="" /> <input type="hidden" name="areacontacts" value="" /> <input type="hidden" name="areasearchurl" value="" /> <input type="hidden" name="typeofsearch" value="epa" /> <input type="hidden" name="result_template" value="2col.ftl" /> <input type="hidden" name="filter" value="sample4filt.hts" /> </form> </header> <section id="main-content" class="main-content clearfix" role="main"> <div class="region-preface clearfix"> <div id="block-pane-epa-web-area-connect" class="block block-pane contextual-links-region"> <ul class="menu utility-menu"> <li class="menu-item"><a href="https://www.epa.gov/research-grants/forms/contact-us-about-research-grants" class="menu-link contact-us">Contact Us</a></li> </ul> </div> </div> <div class="main-column clearfix"> <!--googleon: all--> <div class="panel-pane pane-node-content" > <div class="pane-content"> <div class="node node-page clearfix view-mode-full"> <div class="box multi related-info right clear-right" style="max-width:300px; font-size:14px;"><!--googleoff: index--> <!-- RFA Search start --> <h5 class="pane-title">Related Information</h5> <div class="pane-content"> <ul><li><a href="https://www.epa.gov/research-grants/">Research Grants</a></li> <li><a href="https://www.epa.gov/P3">P3: Student Design Competition</a></li> <li><a href="https://www.epa.gov/research-fellowships/">Research Fellowships</a></li> <li><a href="https://www.epa.gov/sbir/">Small Business Innovation Research (SBIR)</a></li> <li><a href="https://cfpub.epa.gov/ncer_abstracts/index.cfm/fuseaction/search.welcome">Grantee Research Project Results Search</a></li> </ul> </div> <!-- RFA Search End --><!--googleon: index--> </div> <a name="content"></a> <h2> A Model of the Transformations of Metal and Metal Oxide Nanoparticles in Freshwater Sediments: Exploring Critical Uncertainties and the Role of Sediments in Nanoparticle Risk Assessment</h2> <b>EPA Grant Number:</b> F13C20565<br /> <b>Title:</b> A Model of the Transformations of Metal and Metal Oxide Nanoparticles in Freshwater Sediments: Exploring Critical Uncertainties and the Role of Sediments in Nanoparticle Risk Assessment<br /> <b>Investigators:</b> <a href="https://cfpub.epa.gov/ncer_abstracts/index.cfm/fuseaction/display.investigatorInfo/investigator/14698"> Dale, Amy Lauren </a> <br /> <strong>Institution:</strong> <a href="https://cfpub.epa.gov/ncer_abstracts/index.cfm/fuseaction/display.institutionInfo/institution/4688"> <b>Carnegie Mellon University</b> </a> <br /> <strong>EPA Project Officer:</strong> <a href="https://cfpub.epa.gov/ncer_abstracts/index.cfm/fuseaction/display.investigatorInfo/investigator/7495"> Cobbs-Green, Gladys M. </a> <br /> <b>Project Period:</b> September 1, 2014 through September 1, 2016 <br /> <b>Project Amount:</b> $84,000 <br /> <b>RFA:</b> STAR Graduate Fellowships (2013) <a href="https://cfpub.epa.gov/ncer_abstracts/index.cfm/fuseaction/display.rfatext/rfa_id/574">RFA Text</a>&nbsp;|&nbsp; <a href="https://cfpub.epa.gov/ncer_abstracts/index.cfm/fuseaction/recipients.display/rfa_id/574">Recipients Lists</a> <br /> <b>Research Category:</b> <a href="https://cfpub.epa.gov/ncer_abstracts/index.cfm/fuseaction/display.researchCategory/rc_id/106">Academic Fellowships</a> , <a href="https://cfpub.epa.gov/ncer_abstracts/index.cfm/fuseaction/display.researchCategory/rc_id/905">Fellowship - Environmental Risk Assessment</a> <br /> <br> <h3>Objective:</h3> This research employs computer simulations to describe the movement and transformation of potentially toxic metal and metal oxide nanoparticles once they are released to the environment during the manufacture, use, or disposal of antibacterial consumer goods produced by the emerging nanotechnology industry. These simulations focus on the strong association of nanoparticles with suspended sediments and soils, which facilitates their accumulation in river and lake beds. The models are used to explore the effect that natural variability in environmental conditions—such as stream flow, temperature, oxygen availability and pH—has on the toxicity, bioavailability and persistence of metal and metal oxide nanoparticles and their reaction by-products in sediment beds and overlying surface waters. <p></p> <h3>Approach:</h3> This research focuses on the development of two mathematical models to investigate the fate of three highly reactive nanoparticles—zinc oxide, copper oxide and silver—in terrestrial and aquatic environments. The first model, which is highly detailed and small in scale, focuses on the chemical transformations that nanoparticles and their reaction by-products (metal ions) undergo in the river beds and lake beds where they are expected to accumulate once released to the environment. The second model, which links an adaptation of the Chesapeake Bay Program Phase 5 Watershed Model to the U.S. EPA’s water quality model WASP7, is a watershedscale simulation that is informed by the sediment model and is designed to describe the fate of nanoparticles released to the James River basin in Virginia. Features of the model include geospatial information on the location and discharges of all permitted sewage treatment plants in the watershed; hourly rainfall patterns over a 20-year period; daily estimates of stream flow; data on agricultural and urban land use in the watershed; and a detailed description of sediment transport on the land surface and in the river network. <p></p> <h3>Expected Results:</h3> <p> This work will predict the ultimate location, concentration and form of silver, zinc oxide and copper oxide nanoparticles released to surface waters and sediments. Predictions will indicate whether the nanoparticles will be present in toxic forms at high enough concentrations to be of concern. Overall nanoparticle mobility in the environment is expected to be low, and most environmental toxicity will likely be observed in the sediments or at the sediment-water interface. Nanoparticle risk will depend heavily on such site-specific factors as pH, oxygen availability and sulfide availability. Nanoparticle concentrations in the stream will depend heavily on stream flow due to the impact of flow on sediment transport. Uncertainty analysis will be used to determine which uncertainties in model inputs have the greatest effect on model predictions, which will help prioritize future research.</p> <p> <strong>Potential to Further Environmental/Human Health Protection </strong></p> <p> This research aims to advance the emerging field of nanoparticle fate and transport modeling by adapting modeling frameworks historically developed for &ldquo;conventional&rdquo; or non-nano pollutants, such as metal salts and pesticides. These models will be used to shed light on the environmental transformation, toxicity and bioavailability of reactive metal and metal oxide nanoparticles under a wide range of environmental conditions. Results will be used to inform public policy and risk management decision making for this emerging class of potential environmental pollutants.</p> <p></p> <h3>Supplemental Keywords:</h3> <i>metal contamination, nanomaterials, risk assessment</i> <p /> </div> </div> </div> <div id="block-epa-og-footer" class="block block-epa-og"> <p class="pagetop"><a href="#content">Top of Page</a></p> <!--googleoff: all--> <p id="epa-og-footer"> The perspectives, information and conclusions conveyed in research project abstracts, progress reports, final reports, journal abstracts and journal publications convey the viewpoints of the principal investigator and may not represent the views and policies of ORD and EPA. Conclusions drawn by the principal investigators have not been reviewed by the Agency. </p> </div> <!--googleoff: all--> </div> </section> <nav class="nav simple-nav simple-main-nav" role="navigation"> <div class="nav__inner"> <h2 class="element-invisible">Main menu</h2> <ul class="menu" role="menu"> <li class="menu-item" id="menu-learn" role="presentation"><a href="https://www.epa.gov/environmental-topics" title="Learn about EPA's environmental topics to help protect the environment in your home, workplace, and community and EPA&#039;s research mission is to conduct leading-edge research and foster the sound use of science and technology." class="menu-link" role="menuitem">Environmental Topics</a></li> <li class="menu-item" id="menu-lawsregs" role="presentation"><a href="https://www.epa.gov/laws-regulations" title="Laws written by Congress provide the authority for EPA to write regulations. Regulations explain the technical, operational, and legal details necessary to implement laws." class="menu-link" role="menuitem">Laws &amp; Regulations</a></li> <li class="menu-item" id="menu-about" role="presentation"><a href="https://www.epa.gov/aboutepa" title="Learn more about: our mission and what we do, how we are organized, and our history." class="menu-link" role="menuitem">About EPA</a></li> </ul> </div> </nav> <footer class="main-footer clearfix" role="contentinfo"> <div class="main-footer__inner"> <div class="region-footer"> <div class="block block-pane block-pane-epa-global-footer"> <div class="row cols-3"> <div class="col size-1of3"> <div class="col__title">Discover.</div> <ul class="menu"> <li><a href="https://www.epa.gov/accessibility">Accessibility</a></li> <li><a href="https://www.epa.gov/aboutepa/administrator-gina-mccarthy">EPA Administrator</a></li> <li><a href="https://www.epa.gov/planandbudget">Budget &amp; Performance</a></li> <li><a href="https://www.epa.gov/contracts">Contracting</a></li> <li><a href="https://www.epa.gov/home/grants-and-other-funding-opportunities">Grants</a></li> <li><a href="https://www.epa.gov/ocr/whistleblower-protections-epa-and-how-they-relate-non-disclosure-agreements-signed-epa-employees">No FEAR Act Data</a></li> <li><a href="https://www.epa.gov/home/privacy-and-security-notice">Privacy and Security</a></li> </ul> </div> <div class="col size-1of3"> <div class="col__title">Connect.</div> <ul class="menu"> <li><a href="https://www.data.gov/">Data.gov</a></li> <li><a href="https://www.epa.gov/office-inspector-general/about-epas-office-inspector-general">Inspector General</a></li> <li><a href="https://www.epa.gov/careers">Jobs</a></li> <li><a href="https://www.epa.gov/newsroom">Newsroom</a></li> <li><a href="https://www.whitehouse.gov/open">Open Government</a></li> <li><a href="http://www.regulations.gov/">Regulations.gov</a></li> <li><a href="https://www.epa.gov/newsroom/email-subscriptions">Subscribe</a></li> <li><a href="https://www.usa.gov/">USA.gov</a></li> <li><a href="https://www.whitehouse.gov/">White House</a></li> </ul> </div> <div class="col size-1of3"> <div class="col__title">Ask.</div> <ul class="menu"> <li><a href="https://www.epa.gov/home/forms/contact-us">Contact Us</a></li> <li><a href="https://www.epa.gov/home/epa-hotlines">Hotlines</a></li> <li><a href="https://www.epa.gov/foia">FOIA Requests</a></li> <li><a href="https://www.epa.gov/home/frequent-questions-specific-epa-programstopics">Frequent Questions</a></li> </ul> <div class="col__title">Follow.</div> <ul class="social-menu"> <li><a class="menu-link social-facebook" href="https://www.facebook.com/EPA">Facebook</a></li> <li><a class="menu-link social-twitter" href="https://twitter.com/epa">Twitter</a></li> <li><a class="menu-link social-youtube" href="https://www.youtube.com/user/USEPAgov">YouTube</a></li> <li><a class="menu-link social-flickr" href="https://www.flickr.com/photos/usepagov">Flickr</a></li> <li><a class="menu-link social-instagram" href="https://instagram.com/epagov">Instagram</a></li> </ul> <p class="last-updated">Last updated on Thursday, October 23, 2014</p> </div> </div> </div> </div> </div> </footer> <script src="https://www.epa.gov/sites/all/libraries/template2/jquery.js"></script> <script src="https://www.epa.gov/sites/all/libraries/template/js.js"></script> <script src="https://www.epa.gov/sites/all/modules/custom/epa_core/js/alert.js"></script> <script src="https://www.epa.gov/sites/all/modules/contrib/jquery_update/replace/ui/ui/minified/jquery.ui.core.min.js"></script> <script src="https://www.epa.gov/sites/all/modules/contrib/jquery_update/replace/ui/ui/minified/jquery.ui.widget.min.js"></script> <script src="https://www.epa.gov/sites/all/modules/contrib/jquery_update/replace/ui/ui/minified/jquery.ui.position.min.js"></script> <script src="https://www.epa.gov/sites/all/modules/contrib/jquery_update/replace/ui/ui/minified/jquery.ui.autocomplete.min.js"></script> <!--[if lt IE 9]><script src="https://www.epa.gov/sites/all/themes/epa/js/ie.js"></script><![endif]--> <!-- REMOVE if not using --> <script language=javascript> <!-- // Activate cloak // pressing enter will not default submit the first defined button but the programmed defined button function chkCDVal(cdVal) { var isErr = true; try{ var CDParts = cdVal.split(','); var st = CDParts[0]; var cd = CDParts[1]; var objRegExp = new RegExp('[0-9][0-9]'); if (!isNaN(st)) { isErr = false; } if (!objRegExp.test(cd) || (cd.length>3)){ isErr = false; } } catch(err){ isErr = false; } return isErr; } function checkCongDist(cdtxt) { //alert(cdtxt.value); if (!chkCDVal(cdtxt.value)) { alert('Congressional District MUST be in the following format: state, district; example: Virginia, 08'); return false; } else { return true; } } function fnTrapKD(btn, event) { var btn = getObject(btn); if (document.all) { if (event.keyCode == 13) { event.returnValue=false;event.cancel = true;btn.click(); } } else { if (event.which == 13) { event.returnValue=false;event.cancelBubble = true;btn.click(); } } } function CheckFilter() { if (document.searchform.presetTopic.options[document.searchform.presetTopic.selectedIndex].value == 'NA'){ alert('You must select a subtopic. \n This item is not selectable'); document.searchform.presetTopic.options[0].selected = true; } } function openHelpWindow(url,title,scrollable) { var win = window.open(url,"title",'width=300,height=220,left=320,top=150,resizable=1,scrollbars='+scrollable+',menubar=no,status=no'); win.focus(); } function openNewWindow(url,title,scrollable) { var win = window.open(url,"title",'width=300,height=220,left=320,top=150,resizable=1,scrollbars='+scrollable+',menubar=no,status=no'); } function openNewWindow(url,title) { var win = window.open(url,"title",'width=300,height=220,left=320,top=150,resizable=1,scrollbars=no,menubar=no,status=no'); } function openNewMapWindow(url,title) { var win = window.open(url,"title",'width=800,height=450,left=320,top=150,resizable=1,scrollbars=no,menubar=no,status=no'); } function openNoticeWindow(url,title) { var win = window.open(url,"title",'width=300,height=150,left=500,top=150,resizable=1,scrollbars=no,menubar=no,status=no'); } function openNewSearchWindow(site,subj) { title = 'window'; var win = window.open('https://cfpub.epa.gov/ncer_abstracts/index.cfm/fuseaction/display.pubsearch/site/' + site + '/redirect/' + subj,"title",'width=640,height=480,resizable=1,scrollbars=yes,menubar=yes,status=no'); } function autoCheck(name) { document.forms['thisForm'].elements[name].checked = true; } function alertUser() { var ok = alert("This search might take longer than expected. Please refrain from hitting the refresh or reload button on your browser. The search results will appear after the search is complete. Thank you."); } function closePopupWindow(redirectUrl) { opener.location = redirectUrl; opener.focus(); this.close(); } //--> </script> </body> </html>
1wheel/scraping
epa-grants/research/raw/10386.html
HTML
mit
22,808
<?php return [ 'success' => [ 'title' => 'Well done!', 'reason' => [ 'submitted_to_post' => 'Răspunsul a fost trimis cu succes la '.mb_strtolower(trans('chatter::intro.titles.discussion')).'.', 'updated_post' => 'Actualizarea lui '.mb_strtolower(trans('chatter::intro.titles.discussion')).' a fost făcută cu success.', 'destroy_post' => 'S-a șters cu succes răspunsul și '.mb_strtolower(trans('chatter::intro.titles.discussion')).'.', 'destroy_from_discussion' => 'A fost șters cu succes răspunsul de la '.mb_strtolower(trans('chatter::intro.titles.discussion')).'.', 'created_discussion' => 'A fost creat cu succes un nou '.mb_strtolower(trans('chatter::intro.titles.discussion')).'.', ], ], 'info' => [ 'title' => 'Atenție!', ], 'warning' => [ 'title' => 'Wuh Oh!', ], 'danger' => [ 'title' => 'Firar!', 'reason' => [ 'errors' => 'Te rog corectează următoarele erori:', 'prevent_spam' => 'Pentru a prevenii spam-ul, te rog permite :minutes între trimiterea de răspunsuri.', 'trouble' => 'Scuze, se pare că a apărut o problemă în trimiterea răspunsului tău.', 'update_post' => 'Nah ah ah... Nu am putut actualia răspunsul. Asigurați-vă că nu faceți nimic dubios.', 'destroy_post' => 'Nah ah ah... Nu am putut șterge răspunsul. Asigurați-vă că nu faceți nimic dubios.', 'create_discussion' => 'Hopa :( Se pare că este o problema în crearea '.mb_strtolower(trans('chatter::intro.titles.discussion')).'.', 'title_required' => 'Vă rugăm să scrieți un titlu', 'title_min' => 'Titlul trebuie să aibă cel puțin :min caractere.', 'title_max' => 'Titlul trebuie să aibă cel mult :max caractere.', 'content_required' => 'Vă rugăm să scrieți ceva conținut', 'content_min' => 'Conținutul trebuie să aibă cel puțin :min caractere', 'category_required' => 'Vă rugăm alegeți o categorie', ], ], ];
thedevdojo/chatter
src/Lang/ro/alert.php
PHP
mit
2,240
var Intersection; (function (Intersection) { class Result { constructor(success, distance, point) { this.success = success; this.distance = distance; this.point = point; } } Result.FAILED = new Result(false, 1000000); Intersection.Result = Result; class Point { constructor(hp, normal, material, object) { this.hp = hp; this.normal = normal; this.material = material; this.object = object; } } Intersection.Point = Point; })(Intersection = exports.Intersection || (exports.Intersection = {})); //# sourceMappingURL=scene-object.js.map
gsipos/Global-Illumination-Typescript
src/path-tracing/object/scene-object.js
JavaScript
mit
678
var fs = require("fs"), path = require("path"), url = require("url"), images = require("images"), ab_getPath = require("./abc-util-getPath").getPath, ab_extend = require("./abc-util-extend").extend, ab_checkMime = require("./abc-util-checkMime").checkMime, ab_getType = require("./abc-util-getType").getType, ab_model = require("./abc-opt"), ab_optOptions = ab_model.opt_options, ab_optTask = ab_model.opt_task, ab_optPreOpt = ab_model.opt_preOpt; var preOpt2IdPreOpt; /** * 修改预处理参数("{$now}" -> "{xxx@$now}")修改 * 如果不存在于 ab_optPreOpt 中,则不作处理 * * @param {string} srcStr : [] 源字符串 * @param {string|number} idname : [] id 名 * * @return {string} : [] 处理完的字符串 */ exports.preOpt2IdPreOpt = preOpt2IdPreOpt = function(srcStr, idName) { return srcStr.replace(/\{\$[^{}]+\}/g, function(str) { var __name = str .replace(/^\{\s*/, '') .replace(/\s*\}$/, ''), __isSupport = __name in ab_optPreOpt, __newStr = __isSupport ? "{" + idName + "@" + __name + "}" : str; return __newStr; }); }; /** * 生成单个完整的任务对象 * * @param {object} taskOpt : [] 从文本转换成的基本对象(结构与 ab_optOptions 一致) * @param {object} baseOpt : [ {} ] 公共参数对象(结构与 ab_optTask 一致) * * @return {object} : [] 处理完的 task 参数对象 */ exports.createTask = function(taskOpt, baseOpt) { // 退出 -> 参数类型错误 if (ab_getType(taskOpt) !== "object") { throw "ERROR: createTask: 第一个参数必须为对象(第二个参数选填)<- " + taskOpt; } var _taskOpt = ab_extend({}, ab_optTask, taskOpt), _baseOpt = baseOpt || {}, _baseOpt = ab_extend({}, ab_optOptions, baseOpt), _fold = _taskOpt.fold, _files = [], // 指定文件夹中的文件列表 _re_fName = /[^\/\\]+?$/, // 路径中,最末的文件名 _re_lastSep = /[\\\/]+?$/, _now = new Date();; // 去除完文件名后的最末的 "/" 或 "\" var __func_add0; _func_add0 = function(num) { return (num < 10 ? "0" : "") + num; }; // (内部变量)id、时间 _taskOpt._dateRaw = _now.getTime(); _taskOpt._dateNow = "" + _now.getFullYear() + _func_add0(_now.getMonth() + 1) + _func_add0(_now.getDate()) + _func_add0(_now.getHours()) + _func_add0(_now.getMinutes()) + _func_add0(_now.getSeconds()); _taskOpt._id = _taskOpt._dateRaw + Math.random() .toString(16) .replace(/^0\./, ""); // img 和 css 的路径值中的预处理变量进行处理(如 "{$now}" -> "{nnn:$now}") _taskOpt.img = preOpt2IdPreOpt(_taskOpt.img, _taskOpt._id); _taskOpt.css = preOpt2IdPreOpt(_taskOpt.css, _taskOpt._id); var _imgUrl = url.parse(_taskOpt.img), _imgSearch = _imgUrl.search || "", _cssUrl = url.parse(_taskOpt.css), _cssSearch = _cssUrl.search || ""; // 解码 search 部分 _taskOpt._imgSearch = decodeURIComponent(_imgSearch); _taskOpt._cssSearch = decodeURIComponent(_cssSearch); // 去除 search 部分 _taskOpt.img = _taskOpt.img.replace(/\?[^?]+$/, ""); _taskOpt.css = _taskOpt.css.replace(/\?[^?]+$/, ""); // 提取目录部分 _taskOpt.imgFold = _taskOpt.img.replace(_re_fName, '').replace(_re_lastSep, ''); _taskOpt.cssFold = _taskOpt.css.replace(_re_fName, '').replace(_re_lastSep, ''); // 退出 <- 仅支持 png 或 jpg 输出 if ( !_taskOpt.img.match(/\.(png|jpg)$/i) ) { throw "WARM: createTask: 仅支持 png 或 jpg 输出 <- " + _taskOpt.img; } // 退出 <- 目录不存在 if (ab_getPath(_fold).status !== 1) { throw "ERROR: createTask: 目录不存在或为外链 <- " + _fold; } _files = fs.readdirSync(_fold); // 退出 <- 指定文件夹不存在图片文件 if (!_files || _files.length === 0) { throw "ERROR: createTask: 指定文件夹不存在图片文件 <- " + _fold; } // 读取图片,并进行相关操作 for (var i = 0, len = _files.length; i < len; i++) { var __checkVal = _files[i].match(/\.(jpg|png|gif)$/i); // 不添加到操作列表中 <- 文件后缀不为 jpg/png/gif if (!__checkVal) { continue; } var __imgPath = path.join(_fold, _files[i]); // 不添加到操作列表中 <- 文件后缀与其文件 mime 类型不匹配 // (总处理时间增加大约 50ms) if (!ab_checkMime(__imgPath, __checkVal[0].replace(/^\./, ""))) { continue; } var __img = images(__imgPath); __imgW = __img.width(), __imgH = __img.height(), __name = _files[i] .replace(/\.(jpg|png|gif)$/i, ''), // 去掉后缀(.jpg | .png | .gif)的文件名 __cssOptStr = (/#/.test(__name)) ? __name.replace(/^[^#]*?#/, '') : '' , __cName = __name .replace(__cssOptStr, '') .replace(/^\d+[\s]*/g,'') .replace("#",'') .replace(/[ ]+/g, '_'); // 不添加到操作列表中 <- 文件名前缀为 # if (/^#/.test(__name)) { continue; } _taskOpt.filename.push(__name); _taskOpt.cssname.push(__cName); _taskOpt.cssOptStr.push(__cssOptStr); _taskOpt.images.push(__img); _taskOpt.imagesPath.push(__imgPath); _taskOpt.widths.push(__imgW); _taskOpt.heights.push(__imgH); _taskOpt.maxWidth = (__imgW > _taskOpt.maxWidth) ? __imgW : _taskOpt.maxWidth; _taskOpt.maxHeight = (__imgH > _taskOpt.maxHeight) ? __imgH : _taskOpt.maxHeight; _taskOpt.totalWidth += __imgW; _taskOpt.totalHeight += __imgH; // 子类操作参数继承基类操作参数 _taskOpt.opt = ab_extend({}, _baseOpt, _taskOpt.opt); } return _taskOpt; };
abensu/node-ab-ccss
src/abc-mod-createTask.js
JavaScript
mit
6,741
using System; using System.Collections.Generic; using Android.Content; using Android.Graphics; using Android.Views; using Avalonia.Android.Platform.Input; using Avalonia.Android.Platform.Specific; using Avalonia.Android.Platform.Specific.Helpers; using Avalonia.Controls.Platform.Surfaces; using Avalonia.Input; using Avalonia.Input.Raw; using Avalonia.Platform; using Avalonia.Rendering; namespace Avalonia.Android.Platform.SkiaPlatform { class TopLevelImpl : IAndroidView, ITopLevelImpl, IFramebufferPlatformSurface { private readonly AndroidKeyboardEventsHelper<TopLevelImpl> _keyboardHelper; private readonly AndroidTouchEventsHelper<TopLevelImpl> _touchHelper; private ViewImpl _view; public TopLevelImpl(Context context, bool placeOnTop = false) { _view = new ViewImpl(context, this, placeOnTop); _keyboardHelper = new AndroidKeyboardEventsHelper<TopLevelImpl>(this); _touchHelper = new AndroidTouchEventsHelper<TopLevelImpl>(this, () => InputRoot, p => GetAvaloniaPointFromEvent(p)); Surfaces = new object[] { this }; MaxClientSize = new Size(_view.Resources.DisplayMetrics.WidthPixels, _view.Resources.DisplayMetrics.HeightPixels); } private bool _handleEvents; public bool HandleEvents { get { return _handleEvents; } set { _handleEvents = value; _keyboardHelper.HandleEvents = _handleEvents; } } public virtual Point GetAvaloniaPointFromEvent(MotionEvent e) => new Point(e.GetX(), e.GetY()); public IInputRoot InputRoot { get; private set; } public virtual Size ClientSize { get { if (_view == null) return new Size(0, 0); return new Size(_view.Width, _view.Height); } set { } } public IMouseDevice MouseDevice => AndroidMouseDevice.Instance; public Action Closed { get; set; } public Action<RawInputEventArgs> Input { get; set; } public Size MaxClientSize { get; protected set; } public Action<Rect> Paint { get; set; } public Action<Size> Resized { get; set; } public Action<double> ScalingChanged { get; set; } public View View => _view; public IPlatformHandle Handle => _view; public IEnumerable<object> Surfaces { get; } public IRenderer CreateRenderer(IRenderRoot root) { return new ImmediateRenderer(root); } public virtual void Hide() { _view.Visibility = ViewStates.Invisible; } public void Invalidate(Rect rect) { if (_view.Holder?.Surface?.IsValid == true) _view.Invalidate(); } public Point PointToClient(PixelPoint point) { return point.ToPoint(1); } public PixelPoint PointToScreen(Point point) { return PixelPoint.FromPoint(point, 1); } public void SetCursor(IPlatformHandle cursor) { //still not implemented } public void SetInputRoot(IInputRoot inputRoot) { InputRoot = inputRoot; } public virtual void Show() { _view.Visibility = ViewStates.Visible; } public double RenderScaling => 1; void Draw() { Paint?.Invoke(new Rect(new Point(0, 0), ClientSize)); } public virtual void Dispose() { _view.Dispose(); _view = null; } protected virtual void OnResized(Size size) { Resized?.Invoke(size); } class ViewImpl : InvalidationAwareSurfaceView, ISurfaceHolderCallback { private readonly TopLevelImpl _tl; private Size _oldSize; public ViewImpl(Context context, TopLevelImpl tl, bool placeOnTop) : base(context) { _tl = tl; if (placeOnTop) SetZOrderOnTop(true); } protected override void Draw() { _tl.Draw(); } public override bool DispatchTouchEvent(MotionEvent e) { bool callBase; bool? result = _tl._touchHelper.DispatchTouchEvent(e, out callBase); bool baseResult = callBase ? base.DispatchTouchEvent(e) : false; return result != null ? result.Value : baseResult; } public override bool DispatchKeyEvent(KeyEvent e) { bool callBase; bool? res = _tl._keyboardHelper.DispatchKeyEvent(e, out callBase); bool baseResult = callBase ? base.DispatchKeyEvent(e) : false; return res != null ? res.Value : baseResult; } void ISurfaceHolderCallback.SurfaceChanged(ISurfaceHolder holder, Format format, int width, int height) { var newSize = new Size(width, height); if (newSize != _oldSize) { _oldSize = newSize; _tl.OnResized(newSize); } base.SurfaceChanged(holder, format, width, height); } } public IPopupImpl CreatePopup() => null; public Action LostFocus { get; set; } ILockedFramebuffer IFramebufferPlatformSurface.Lock()=>new AndroidFramebuffer(_view.Holder.Surface); } }
akrisiun/Perspex
src/Android/Avalonia.Android/Platform/SkiaPlatform/TopLevelImpl.cs
C#
mit
5,791
--- title: 'Comparison of 4 popular JavaScript MV* frameworks (part 2) - Developer Economics' author: azu layout: post itemUrl: 'http://www.developereconomics.com/comparison-4-popular-javascript-mv-frameworks-part-2/' editJSONPath: 'https://github.com/jser/jser.info/edit/gh-pages/data/2015/03/index.json' date: '2015-03-07T07:17:37+00:00' tags: - JavaScript - library --- Ember, Angular, Backbone, React比較。それぞれのデータを可視化してて面白い
sifue/technical-word-rules
test/fixtures/2015-03-07-comparison-of-4-popular-javascript-mv-frameworks-part-2-developer-economics.md
Markdown
mit
473
angular.module('ira.gobiernosLocales', ['ira.core']).config(['$stateProvider', function ($stateProvider) { $stateProvider .state('gobiernosLocales', { abstract: true, url: '/gobiernosLocales', template: '<ui-view/>' }); }]);
robertoraul/iraguh
public/components/gobiernosLocales/index.js
JavaScript
mit
280
<?php /** * The Template for displaying product archives, including the main shop page which is a post type archive. * * Override this template by copying it to yourtheme/woocommerce/archive-product.php * * @author WooThemes * @package WooCommerce/Templates * @version 2.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } global $zorka_data,$woocommerce_loop; $archive_layout = isset($_GET['layout']) ? $_GET['layout'] : '' ; $layouts = array('full-content','left-sidebar','right-sidebar'); if (!in_array($archive_layout,$layouts)) { $cat = get_queried_object(); if ($cat && property_exists( $cat, 'term_id' )) { $archive_layout = get_tax_meta( $cat,'zorka_custom_product_archive_layout'); } if (empty($archive_layout) || $archive_layout == 'none') { $archive_layout = $zorka_data['product-archive-layout']; } } $archive_product_columns = isset($_GET['columns']) ? $_GET['columns'] : ''; if (!in_array($archive_product_columns,array('2','3','4'))) { $archive_product_columns = isset($zorka_data['archive-product-columns']) ? $zorka_data['archive-product-columns'] : 3; } $class_col = 'col-md-12'; $woocommerce_loop['columns'] = $archive_product_columns; if ($archive_layout == 'left-sidebar' || $archive_layout == 'right-sidebar' ){ $class_col = 'col-md-9'; } if ($archive_layout == 'left-sidebar') { $class_col .= ' col-md-push-3'; } get_header(); ?> <?php get_template_part('archive-product','top') ?> <main role="main" class="site-content-product-archive"> <div class="container clearfix"> <div class="row clearfix"> <div class="<?php echo esc_attr($class_col); ?>"> <div class="product-wrapper clearfix"> <?php if ( have_posts() ) : ?> <div class="category-filter clearfix"> <?php /** * woocommerce_before_shop_loop hook * * @hooked woocommerce_result_count - 20 * @hooked woocommerce_catalog_ordering - 30 */ do_action( 'woocommerce_before_shop_loop' ); ?> </div> <?php woocommerce_product_loop_start(); ?> <?php while ( have_posts() ) : the_post(); ?> <?php wc_get_template_part( 'content', 'product' ); ?> <?php endwhile; // end of the loop. ?> <?php woocommerce_product_loop_end(); ?> <?php /** * woocommerce_after_shop_loop hook * * @hooked woocommerce_pagination - 10 */ do_action( 'woocommerce_after_shop_loop' ); ?> <?php elseif ( ! woocommerce_product_subcategories( array( 'before' => woocommerce_product_loop_start( false ), 'after' => woocommerce_product_loop_end( false ) ) ) ) : ?> <?php wc_get_template( 'loop/no-products-found.php' ); ?> <?php endif; ?> </div> </div> <?php if ($archive_layout == 'left-sidebar') { get_sidebar('shop-left'); } if ($archive_layout == 'right-sidebar') { get_sidebar('shop'); } ?> </div> </div> </main> <?php get_footer(); ?>
chris037/philux-zorka
woocommerce/archive-product.php
PHP
mit
3,682
version https://git-lfs.github.com/spec/v1 oid sha256:2c3b21c8a49c14ad439fc2110acb23f5c059f92e96b26b09dbe8761d4b912e09 size 21510
yogeshsaroya/new-cdnjs
ajax/libs/uikit/2.16.2/js/components/nestable.js
JavaScript
mit
130
# -*- coding: utf-8 -*- import logging from . import constants logger = logging.getLogger(constants.NAME)
dantezhu/yunbk
yunbk/log.py
Python
mit
109
require 'spec_helper' describe 'sublime_text_3' do it do should contain_package('SublimeText3').with({ :provider => 'appdmg', :source => 'http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%20Build%203047.dmg', }) end end
roc/puppet-sublime_text_3
spec/classes/sublimetext3.spec.rb
Ruby
mit
246
// Copyright (c) 2015 fjz13. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. #include "MedusaPreCompiled.h" #include "MedusaTextureAtlas.h" #include "TextureAtlasPage.h" #include "TextureAtlasRegion.h" MEDUSA_BEGIN; TextureAtlasPage* MedusaTextureAtlas::OnCreatePage(FileEntry& fileEntry, const FileIdRef& fileId, const IStream& stream) { HeapString outLine; List<HeapString> outValues; std::unique_ptr<TextureAtlasPage> page(new TextureAtlasPage(0,&fileEntry)); page->SetTexcoordUpSide(false); outLine.Clear(); RETURN_NULL_IF_FALSE(ReadLineToValues(stream, outLine, outValues)); FileId textureFileId = FileId::ParseFrom(outValues[0]); page->SetTextureFileId(textureFileId); Size2U pageSize; pageSize.Width = (uint)outValues[1].ToInt(); pageSize.Height = (uint)outValues[2].ToInt(); page->SetPageSize(pageSize); //ignore format,use real image format instead //outValues[3] //read filter if (outValues[4] == "NearestNeighbour") { page->SetMagFilter(GraphicsTextureMagFilter::Nearest); page->SetMinFilter(GraphicsTextureMinFilter::Nearest); } else// if (outLine == "Linear") { page->SetMagFilter(GraphicsTextureMagFilter::Linear); page->SetMinFilter(GraphicsTextureMinFilter::Linear); } page->SetFlipPVR(StringParser::StringTo<bool>(outValues[5])); page->SetPremultiplyAlpha(StringParser::StringTo<bool>(outValues[6])); //read regions TextureAtlasRegion* region = nullptr; do { region = CreateAtlasRegion(stream); if (region != nullptr) { page->AddRegion(region); } } while (region != nullptr); return page.release(); } TextureAtlasRegion* MedusaTextureAtlas::CreateAtlasRegion(const IStream& stream) { HeapString outLine; List<HeapString> outValues; //read source texture rect Rect2U sourceRect; Rect2U textureRect; outLine.Clear(); RETURN_NULL_IF_FALSE(ReadLineToValues(stream, outLine, outValues)); std::unique_ptr<TextureAtlasRegion> region(new TextureAtlasRegion()); region->SetName(outValues[0]); region->SetRotate(StringParser::StringTo<bool>(outValues[1])); sourceRect.Origin.X = StringParser::StringTo<uint>(outValues[2]); sourceRect.Origin.Y = StringParser::StringTo<uint>(outValues[3]); sourceRect.Size.Width = StringParser::StringTo<uint>(outValues[4]); sourceRect.Size.Height = StringParser::StringTo<uint>(outValues[5]); textureRect.Origin.X = StringParser::StringTo<uint>(outValues[6]); textureRect.Origin.Y = StringParser::StringTo<uint>(outValues[7]); textureRect.Size.Width = StringParser::StringTo<uint>(outValues[8]); textureRect.Size.Height = StringParser::StringTo<uint>(outValues[9]); region->SetSourceRect(sourceRect); region->SetTextureRect(textureRect); return region.release(); } MEDUSA_END;
fjz13/Medusa
Medusa/Medusa/Resource/TextureAtlas/MedusaTextureAtlas.cpp
C++
mit
2,790
'use strict'; module.exports = { id: 0x6E, type: 'MONEYN', name: 'MoneyN', dataLengthLength: 1 };
inodient/summer-mvc
node_modules/tedious/lib/data-types/moneyn.js
JavaScript
mit
106
<!-- GLOBAL VARIABLES --> <!-- TOTAL NUMBER OF JOURNAL ITEMS --> var totalJournalItems = 0; <!-- ARRAY OF JOURNAL TYPES FOR FILTER --> var journalFilterArr = new Array('All','Blood Glucose','Basal Profile','Temp Basal','Bolus','Food','Activity','Events'); <!-- ARRAY OF JOURNAL ITEM TYPES --> var journalTypeArr = new Array(); $(window).load(function(){ createJournalItemEvent(); <!-- CLICK FILTER ON JOURNAL PAGE --> $('#journalOverviewFilter').click(function(){ $('#journal').hide(0); $('#journalFilterList').show(0); $('.journalFilterSelected').unbind('click'); $('.journalFilterSelected').bind('click',function(){ toggleJournalFilterSelected(this); }); }); <!-- CLICK BACK ON JOURNAL FILTER PAGE --> $('#journalFilterBack').click(function(){ $('#journalFilterList').hide(0); $('#journal').show(0); }); <!-- CLICK OK ON JOURNAL FILTER PAGE --> $('#journalFilterOk').click(function(){ $('#journalFilterList').hide(0); resetJournal(); $('#journal').show(0); }); <!-- CLICK NEXT ON DOWN ARROW TO GO TO NEXT PAGE OF JOURNAL ITEMS --> $('#journalItemNavigationNext').click(function(){ if(journalPageIndex < journalPageCount){ journalPageIndex++; updateJournalNavigation(); var marginTop = (journalPageIndex*294)-294; $('#journalList').animate({"slide": "show", top:"-"+marginTop+"px"}, 1000); } }); <!-- CLICK NEXT ON UP ARROW TO GO TO PREVIOUS PAGE OF JOURNAL ITEMS --> $('#journalItemNavigationPrev').click(function(){ if(journalPageIndex > 1){ journalPageIndex--; updateJournalNavigation(); var marginTop = 294 - (journalPageIndex*294); $('#journalList').animate({"slide": "show", top:""+marginTop+"px"}, 1000); } }); <!-- CLICK HIDE ON JOURNAL POPUP --> $('#journalPopupHide').click(function(){ $('#journalPopup').hide(0); }); }); <!-- TOGGLE SELECTED JOURNAL ITEMS FOR FILTERING --> function toggleJournalFilterSelected(butWhichItem){ var journalFilterIndex = (butWhichItem.id).split('-')[1]; selectedJournalFilter = journalFilterArr[journalFilterIndex-1]; $('.journalFilterSelected').removeClass('journalFilterSelectedActive'); $('#journalFilterSelect-'+journalFilterIndex).addClass('journalFilterSelectedActive'); } <!-- CREATE EVENT JOURNAL ITEM --> function createJournalItemEvent(){ var journalIndex = totalJournalItems+1; var journalListItem = '<div class="journalItem" id="journalItem-'+journalIndex+'">'; journalListItem += '<div class="journalTypeIcon"><img src="Images/journal_icon_web.png" /></div>'; journalListItem += '<div class="left">'; journalListItem += '<div class="foodItemName white bold left" id="journalTitle-'+journalIndex+'">Server Update</div>'; journalListItem += '<div class="journalTime med white" id="journalTime-'+journalIndex+'">'+getCurrentTime()+'</div>'; journalListItem += '<div class="journalDate med white" id="journalDate-'+journalIndex+'">'+getTodaysDate()+'</div>'; journalListItem += '</div>'; journalListItem += '<div class="right"><div class="journalInfo" id="journalInfo-'+journalIndex+'"></div>'; journalListItem += '</div>'; $('#journalList').prepend(journalListItem); totalJournalItems++; journalTypeArr[journalIndex-1] = 'Events'; $('#journalInfo-'+journalIndex).bind('click',function(){ $('.popupInfo').hide(0); $('#journalPopupTitle').html(getLanguageString('BackUp_Completed')); $('#journalPopupDate').html($('#journalTime-'+journalIndex).html() + '&nbsp;&nbsp;&nbsp;' + $('#journalDate-'+journalIndex).html()); $('#journalPopup').show(0); }); } <!-- CREATE BLOOD GLUCOSE JOURNAL ITEM --> function createJournalItemBG(amount, note, wellbeing, diet, range){ var journalIndex = totalJournalItems+1; var journalListItem = '<div class="journalItem" id="journalItem-'+journalIndex+'">'; journalListItem += '<div class="journalTypeIcon"><img src="Images/journal_icon_bg.png" /></div>'; journalListItem += '<div class="left">'; journalListItem += '<div class="foodItemName purple bold left" id="journalTitle-'+journalIndex+'">'+amount+' mmol/l</div>'; journalListItem += '<div class="journalTime med white" id="journalTime-'+journalIndex+'">'+$('#bgResultsTime').html()+'</div>'; journalListItem += '<div class="journalDate med white" id="journalDate-'+journalIndex+'">'+$('#bgResultsDate').html()+'</div>'; journalListItem += '</div>'; journalListItem += '<div class="right"><div class="journalInfo" id="journalInfo-'+journalIndex+'"></div>'; journalListItem += '</div>'; $('#journalList').prepend(journalListItem); totalJournalItems++; journalTypeArr[journalIndex-1] = 'Blood Glucose'; $('#journalInfo-'+journalIndex).bind('click',function(){ $('.popupInfo').hide(0); $('#journalPopupTitle').html(getLanguageString('bloodGlucoseReading')); $('#journalPopupDate').html($('#journalTime-'+journalIndex).html() + '&nbsp;&nbsp;&nbsp;' + $('#journalDate-'+journalIndex).html()); $('#journalBGInfo').show(0); $('#journalBGAmount').html(amount); $('#journalBGRange').html(range); $('#journalBGWellbeing').html(wellbeing); $('#journalBGDiet').html(diet); $('#journalBGNote').html(note); $('#journalPopup').show(0); }); } <!-- CREATE BASAL PROFILE JOURNAL ITEM --> function createJournalItemBasalProfile(name, amount){ var journalIndex = totalJournalItems+1; var journalListItem = '<div class="journalItem" id="journalItem-'+journalIndex+'">'; journalListItem += '<div class="journalTypeIcon"><img src="Images/journal_icon_basal.png" /></div>'; journalListItem += '<div class="left">'; journalListItem += '<div class="foodItemName blue bold left" id="journalTitle-'+journalIndex+'">'+name+'</div>'; journalListItem += '<div class="journalTime med white" id="journalTime-'+journalIndex+'">'+getCurrentTime()+'</div>'; journalListItem += '<div class="journalDate med white" id="journalDate-'+journalIndex+'">'+getTodaysDate()+'</div>'; journalListItem += '</div>'; journalListItem += '<div class="right"><div class="journalInfo" id="journalInfo-'+journalIndex+'"></div>'; journalListItem += '</div>'; $('#journalList').prepend(journalListItem); totalJournalItems++; journalTypeArr[journalIndex-1] = 'Basal Profile'; $('#journalInfo-'+journalIndex).bind('click',function(){ $('.popupInfo').hide(0); $('#journalPopupTitle').html(getLanguageString('journalbasalProfile')); $('#journalPopupDate').html($('#journalTime-'+journalIndex).html() + '&nbsp;&nbsp;&nbsp;' + $('#journalDate-'+journalIndex).html()); $('#journalBasalInfo').show(0); $('#journalBasalName').html(name); $('#journalBasalAmount').html(amount); $('#journalPopup').show(0); }); } <!-- CREATE TEMPORARY BASAL JOURNAL ITEM --> function createJournalItemTempBasal(duration,adjust){ var journalIndex = totalJournalItems+1; var journalListItem = '<div class="journalItem" id="journalItem-'+journalIndex+'">'; journalListItem += '<div class="journalTypeIcon"><img src="Images/journal_icon_temp_basal.png" /></div>'; journalListItem += '<div class="left">'; journalListItem += '<div class="foodItemName blue bold left" id="journalTitle-'+journalIndex+'">Temporary Basal</div>'; journalListItem += '<div class="journalTime med white" id="journalTime-'+journalIndex+'">'+getCurrentTime()+'</div>'; journalListItem += '<div class="journalDate med white" id="journalDate-'+journalIndex+'">'+getTodaysDate()+'</div>'; journalListItem += '</div>'; journalListItem += '<div class="right"><div class="journalInfo" id="journalInfo-'+journalIndex+'"></div>'; journalListItem += '</div>'; $('#journalList').prepend(journalListItem); totalJournalItems++; journalTypeArr[journalIndex-1] = 'Temp Basal'; $('#journalInfo-'+journalIndex).bind('click',function(){ $('.popupInfo').hide(0); $('#journalPopupTitle').html(getLanguageString('tab/tempbasal')); $('#journalPopupDate').html($('#journalTime-'+journalIndex).html() + '&nbsp;&nbsp;&nbsp;' + $('#journalDate-'+journalIndex).html()); $('#journalTempBasalInfo').show(0); $('#journalTempBasalDuration').html(duration); $('#journalTempBasalAdjust').html(adjust); $('#journalPopup').show(0); }); } <!-- CREATE BOLUS JOURNAL ITEM --> function createJournalItemBolus(total,type,delivery,foodAmount,bgAmount){ var journalIndex = totalJournalItems+1; var journalListItem = '<div class="journalItem" id="journalItem-'+journalIndex+'">'; journalListItem += '<div class="journalTypeIcon"><img src="Images/journal_icon_bolus.png" /></div>'; journalListItem += '<div class="left">'; journalListItem += '<div class="foodItemName blue bold left" id="journalTitle-'+journalIndex+'">'+total+'u '+type+'</div>'; journalListItem += '<div class="journalTime med white" id="journalTime-'+journalIndex+'">'+getCurrentTime()+'</div>'; journalListItem += '<div class="journalDate med white" id="journalDate-'+journalIndex+'">'+getTodaysDate()+'</div>'; journalListItem += '</div>'; journalListItem += '<div class="right"><div class="journalInfo" id="journalInfo-'+journalIndex+'"></div>'; journalListItem += '</div>'; $('#journalList').prepend(journalListItem); totalJournalItems++; journalTypeArr[journalIndex-1] = 'Bolus'; $('#journalInfo-'+journalIndex).bind('click',function(){ $('.popupInfo').hide(0); $('#journalPopupTitle').html(getLanguageString('bolusStarted')); $('#journalPopupDate').html($('#journalTime-'+journalIndex).html() + '&nbsp;&nbsp;&nbsp;' + $('#journalDate-'+journalIndex).html()); $('#journalBolusInfo').show(0); $('#journalBolusTotal').html(''+total+''); $('#bolusDeliveryType').html(''+type+''); $('#journalBolusDelivery').html(''+delivery+''); $('#journalBolusFood').html(''+foodAmount+''); $('#journalBolusBG').html(''+bgAmount+''); $('#journalPopup').show(0); }); } <!-- CREATE FOOD JOURNAL ITEM --> function createJournalItemFood(count, total){ var journalIndex = totalJournalItems+1; var journalListItem = '<div class="journalItem" id="journalItem-'+journalIndex+'">'; journalListItem += '<div class="journalTypeIcon"><img src="Images/journal_icon_food.png" /></div>'; journalListItem += '<div class="left">'; journalListItem += '<div class="foodItemName yellow bold left" id="journalTitle-'+journalIndex+'">'+count + ' Item'; if(count > 1){ journalListItem += 's'; } journalListItem += ' = '+total+'g</div>'; journalListItem += '<div class="journalTime med white" id="journalTime-'+journalIndex+'">'+getCurrentTime()+'</div>'; journalListItem += '<div class="journalDate med white" id="journalDate-'+journalIndex+'">'+getTodaysDate()+'</div>'; journalListItem += '</div>'; journalListItem += '<div class="right"><div class="journalInfo" id="journalInfo-'+journalIndex+'"></div>'; journalListItem += '</div>'; $('#journalList').prepend(journalListItem); totalJournalItems++; journalTypeArr[journalIndex-1] = 'Food'; $('#journalInfo-'+journalIndex).bind('click',function(){ $('.popupInfo').hide(0); $('#journalPopupTitle').html(getLanguageString('journalfoodLogged')); $('#journalPopupDate').html($('#journalTime-'+journalIndex).html() + '&nbsp;&nbsp;&nbsp;' + $('#journalDate-'+journalIndex).html()); $('#journalFoodInfo').show(0); $('#journalFoodTotalCarbs').html(total); $('#journalFoodItems').html(count); $('#journalPopup').show(0); }); } <!-- CREATE ACTIVITY JOURNAL ITEM --> function createJournalItemActivity(type, duration, score){ var journalIndex = totalJournalItems+1; var journalListItem = '<div class="journalItem" id="journalItem-'+journalIndex+'">'; journalListItem += '<div class="journalTypeIcon"><img src="Images/journal_icon_activity.png" /></div>'; journalListItem += '<div class="left">'; journalListItem += '<div class="foodItemName orange bold left" id="journalTitle-'+journalIndex+'">'+type+'</div>'; journalListItem += '<div class="journalTime med white" id="journalTime-'+journalIndex+'">'+getCurrentTime()+'</div>'; journalListItem += '<div class="journalDate med white" id="journalDate-'+journalIndex+'">'+getTodaysDate()+'</div>'; journalListItem += '</div>'; journalListItem += '<div class="right"><div class="journalInfo" id="journalInfo-'+journalIndex+'"></div>'; journalListItem += '</div>'; $('#journalList').prepend(journalListItem); totalJournalItems++; journalTypeArr[journalIndex-1] = 'Activity'; var durationDisplay = ''; var durationArr = duration.split(":"); var durationHours = durationArr[0]; var durationMins = durationArr[1]; var durationSecs = durationArr[2]; if(durationHours == '00'){ if(durationMins == '00'){ durationDisplay = durationSecs+'sec'; }else{ durationDisplay = durationMins+'min:'+durationSecs+'sec'; } }else{ durationDisplay = durationHours + 'hr:'+durationMins+'min'; } $('#journalInfo-'+journalIndex).bind('click',function(){ $('.popupInfo').hide(0); $('#journalPopupTitle').html(getLanguageString('activityEvent')); $('#journalPopupDate').html($('#journalTime-'+journalIndex).html() + '&nbsp;&nbsp;&nbsp;' + $('#journalDate-'+journalIndex).html()); $('#journalActivityInfo').show(0); $('#journalActivityType').html(type); $('#journalActivityDuration').html(durationDisplay); $('#journalActivityScore').html(score); $('#journalPopup').show(0); }); } <!-- RESET JOURNAL PAGE --> function resetJournal(){ filterJournal(); journalPageIndex = 1; $('#journaList').css('top','0px'); updateJournalNavigation(); } <!-- UPDATE JOURNAL PAGINATION --> function updateJournalNavigation(){ if(journalPageCount > 1){ //DISPLAY PAGINATION $('#journalItemNavigation').show(0); var pageCountStr = ''; var pageIndexStr = ''; if(journalPageIndex < 10){ pageIndexStr = '0'+journalPageIndex; }else{ pageIndexStr = ''+journalPageIndex; } if(journalPageCount < 10){ pageCountStr = '0'+journalPageCount; }else{ pageCountStr = ''+ journalPageCount; } $('#journalItemNavigationPageNo').html(pageIndexStr+'/'+pageCountStr); }else{ $('#journalItemNavigation').hide(0); } } <!-- FILTER JOURNAL ITEMS --> function filterJournal(){ var journalFilterIndex; for(var i = 1; i <= 7; i++){ if($('#journalFilterSelect-'+i).hasClass('journalFilterSelectedActive')){ journalFilterIndex = i-1; break; } } var journalItemCount = 0; for(var i = 0; i < journalTypeArr.length; i++){ var journalIndex = i+1; if(journalTypeArr[i] != null){ if(journalFilterIndex == 0){ //ALL $('#journalItem-'+journalIndex).show(0); journalItemCount++; }else if(journalTypeArr[i] == journalFilterArr[journalFilterIndex]){ $('#journalItem-'+journalIndex).show(0); journalItemCount++; }else{ $('#journalItem-'+journalIndex).hide(0); } } } journalPageCount = Math.ceil(journalItemCount / 5); }
philglen/CellnovoSimulator
Scripts/journalFunctions.js
JavaScript
mit
14,747
<?php /* * This file is part of the Helthe Mandrill package. * * (c) Carl Alexander <carlalexander@helthe.co> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Helthe\Component\Mandrill\Tests\Message; use Helthe\Component\Mandrill\Message\Message; use Helthe\Component\Mandrill\Message\Recipient; use Helthe\Component\Mandrill\Message\Sender; class MessageTest extends \PHPUnit_Framework_TestCase { /** * @expectedException InvalidArgumentException */ public function testConstructorWithInvalidRecipients() { $message = new Message(null, 'foo@bar.com'); } /** * @expectedException InvalidArgumentException */ public function testConstructorWithInvalidRecipientsArray() { $message = new Message(array('foo@bar.com', null), 'foo@bar.com'); } /** * @expectedException InvalidArgumentException */ public function testConstructorWithInvalidSender() { $message = new Message('foo@bar.com', null); } public function testConstructorWithStrings() { $message = new Message('foo@bar.com', 'bar@foo.com'); $this->assertEquals(array(new Recipient('foo@bar.com')), $message->getRecipients()); $this->assertEquals(new Sender('bar@foo.com'), $message->getSender()); } public function testConstructorWithRecipientsArray() { $message = new Message(array('foo1@bar.com', 'foo2@bar.com'), 'bar@foo.com'); $this->assertEquals(array(new Recipient('foo1@bar.com'), new Recipient('foo2@bar.com')), $message->getRecipients()); $this->assertEquals(new Sender('bar@foo.com'), $message->getSender()); } public function testAddHeader() { $message = new Message('foo@bar.com', 'bar@foo.com'); $message->addHeader('foo', 'bar'); $this->assertSame(array('foo' => 'bar'), $message->getHeaders()); } public function testAddRecipient() { $message = new Message('foo1@bar.com', 'bar@foo.com'); $message->addRecipient('foo2@bar.com'); $this->assertEquals(array(new Recipient('foo1@bar.com'), new Recipient('foo2@bar.com')), $message->getRecipients()); } public function testSetHeaders() { $message = new Message('foo@bar.com', 'bar@foo.com'); $message->setHeaders(array('foo' => 'bar')); $this->assertSame(array('foo' => 'bar'), $message->getHeaders()); } public function testSetHtmlContent() { $message = new Message('foo@bar.com', 'bar@foo.com'); $message->setHtmlContent('html content'); $this->assertSame('html content', $message->getHtmlContent()); } public function testSetSender() { $message = new Message('foo@bar.com', 'bar@foo.com'); $sender = new Sender('new@foo.com'); $message = $message->setSender($sender); $this->assertSame($sender, $message->getSender()); } public function testSetSubject() { $message = new Message('foo@bar.com', 'bar@foo.com'); $message->setSubject('Foo Bar'); $this->assertSame('Foo Bar', $message->getSubject()); } public function testSetTextContent() { $message = new Message('foo@bar.com', 'bar@foo.com'); $message->setTextContent('text content'); $this->assertSame('text content', $message->getTextContent()); } public function testNormalize() { $normalizer = $this->getNormalizerMock(); $message = new Message('foo@bar.com', 'bar@foo.com'); $this->assertEquals(array( 'from_email' => 'bar@foo.com', 'from_name' => '', 'to' => array(array('email' => 'foo@bar.com', 'name' => '', 'type' => 'to')), 'headers' => array(), 'html' => null, 'text' => null, 'subject' => null ), $message->normalize($normalizer)); } /** * Get a mock of the Symfony normalizer. * * @return PHPUnit_Framework_MockObject_MockObject */ private function getNormalizerMock() { return $this->getMock('Symfony\Component\Serializer\Normalizer\NormalizerInterface'); } }
helthe/Mandrill
Tests/Message/MessageTest.php
PHP
mit
4,279
// Copyright (c) 2012 Ecma International. All rights reserved. // Ecma International makes this code available under the terms and conditions set // forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the // "Use Terms"). Any redistribution of this code must retain the above // copyright and this notice and otherwise comply with the Use Terms. /*--- es5id: 15.2.3.6-4-531-11 description: > Object.defineProperty will update [[Get]] and [[Set]] attributes of named accessor property 'P' successfully when [[Configurable]] attribute is true, 'A' is an Array object (8.12.9 step 11) includes: [propertyHelper.js] ---*/ var obj = []; obj.verifySetFunction = "data"; Object.defineProperty(obj, "prop", { get: function () { return obj.verifySetFunction; }, set: function (value) { obj.verifySetFunction = value; }, configurable: true }); obj.verifySetFunction1 = "data1"; var getFunc = function () { return obj.verifySetFunction1; }; var setFunc = function (value) { obj.verifySetFunction1 = value; }; Object.defineProperty(obj, "prop", { get: getFunc, set: setFunc }); verifyEqualTo(obj, "prop", getFunc()); verifyWritable(obj, "prop", "verifySetFunction1"); verifyNotEnumerable(obj, "prop"); verifyConfigurable(obj, "prop");
PiotrDabkowski/Js2Py
tests/test_cases/built-ins/Object/defineProperty/15.2.3.6-4-531-11.js
JavaScript
mit
1,318
require "spec_helper" require_relative "../../shared_examples/solver_shared_examples" module Robots describe "Best-first A*" do it_should_behave_like "a solver" do let(:solver) { Solvers::BestFirst.new(state, scorer: Solvers::Scorers::AStar.new(board, state)) } end end end
CodingZeal/robots
spec/robots/solvers/best_first_a_star_spec.rb
Ruby
mit
293
const mongoose = require('mongoose'); const Schema = mongoose.Schema; const schema = new Schema ({ patchId: { type: Schema.Types.ObjectId, ref: 'Patch' }, sequence: { type: Array, required: [true, 'Sequence array required.'] }, tempo: { type: Number, default: 120 } // key: { // type: String, // default: 'C' // } }); module.exports = mongoose.model('Sequence', schema);
Portamento-development/portamento-server
lib/models/sequence.js
JavaScript
mit
469
#region License // // Copyright (C) 2012 AGRC // 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. // #endregion using System.Collections.Generic; namespace WSUT.Upgrade.Soe.Models.Geometry { /// <summary> /// A model of the input points drawn on the map /// </summary> public class AreaOfInterest { /// <summary> /// Gets or sets the point collection. /// </summary> /// <value> The point collection representing a polygon. </value> public List<decimal> PointCollection { get; set; } public override string ToString() { return string.Join(", ", PointCollection); } } }
agrc/api.mapserv.utah.gov
WSUT.Upgrade.Soe/Models/Geometry/AreaOfInterest.cs
C#
mit
1,700
#!/usr/bin/env python # -*- coding: utf-8 -*- """Prints a summary of the contents of the IPHAS source catalogue. """ import os from astropy.io import fits from astropy import log import numpy as np import sys from dr2 import constants n_sources = 0 n_r20 = 0 n_reliable = 0 n_deblend = 0 n_reliable_deblend = 0 n_pair = 0 n_saturated = 0 n_brightNeighb = 0 path = os.path.join(constants.DESTINATION, 'concatenated', 'full') for filename in os.listdir(path): if filename.endswith('fits.gz'): print filename myfile = os.path.join(path, filename) log.info(myfile) f = fits.open(myfile) #n_sources += f[1].header['NAXIS2'] n_sources += f[1].data['ra'].size n_r20 += (f[1].data['r'] < 21).sum() n_reliable += f[1].data['reliable'].sum() n_reliable_deblend += (f[1].data['reliable'] & f[1].data['deblend']).sum() n_deblend += f[1].data['deblend'].sum() n_pair += (f[1].data['sourceID2'] != ' ').sum() n_saturated += f[1].data['saturated'].sum() n_brightNeighb += f[1].data['brightNeighb'].sum() print "{0} sources so far".format(n_sources) with open('summary.txt', 'w') as out: out.write("#Unique sources: {0}\n".format(n_sources)) out.write("#Sources r < 21: {0}\n".format(n_r20)) out.write("#Reliable sources: {0}\n".format(n_reliable)) out.write("#Deblend sources: {0}\n".format(n_deblend)) out.write("#Reliable+deblend: {0}\n".format(n_reliable_deblend)) out.write("#Paired sources: {0}\n".format(n_pair)) out.write("#Saturated sources: {0}\n".format(n_saturated)) out.write("#Bright neighb sources: {0}\n".format(n_brightNeighb))
barentsen/iphas-dr2
scripts/summary.py
Python
mit
1,682
"use strict"; //# sourceMappingURL=cli.js.map
ealbertos/dotfiles
vscode.symlink/extensions/ms-mssql.mssql-1.11.1/node_modules/ads-adal-library/dist/cli.js
JavaScript
mit
45
Then /^I should get a message "(.*?)"$/ do |arg1| @pipboy.output.should eq arg1 end
Trevoke/pipboy
features/step_definitions/messages_steps.rb
Ruby
mit
88
require "henson/ui" require "henson/friendly_errors" require "thor" module Henson class CLI < Thor include Thor::Actions def initialize(*) super the_shell = options["no-color"] ? Thor::Shell::Basic.new : shell Henson.ui = UI.new the_shell Henson.ui.quiet! if options[:quiet] Henson.ui.debug! if options[:debug] if ENV["HENSON_PUPPETFILE"] Henson.settings[:puppetfile] = ENV["HENSON_PUPPETFILE"] end end check_unknown_options! default_task :install desc "install", "Install the current Puppet module environment" long_desc <<-D Install will install all of the Puppet modules in the current configuration, making them available for use as long as your modulepath is configured correctly. D method_option "quiet", :type => :boolean, :banner => "Only output warnings and errors." method_option "debug", :type => :boolean, :banner => "Turn on verbose output." method_option "local", :type => :boolean, :banner => "Only check local cache source for modules." method_option "no-cache", :type => :boolean, :banner => "Do not update the existing Puppet module cache." method_option "clean", :type => :boolean, :banner => "Run henson clean automatically after install." method_option "path", :type => :string, :banner => "Path to install modules into." def install Installer.local! if options[:local] Installer.no_cache! if options[:"no-cache"] Installer.clean! if options[:clean] Henson.settings[:path] = options[:path] if options[:path] Installer.install! end end end
wfarr/henson
lib/henson/cli.rb
Ruby
mit
1,675
using System; [Flags] public enum SetMask { ApplyClamp = 0x1, Any = 0 }
virtuallynaked/virtually-naked
Viewer/src/figure/channels/SetMask.cs
C#
mit
76
<div class="container" data-ng-controller="HeaderController"> <div class="navbar-header"> <div class="row"> <div class="col-xs-6" data-ng-hide="authentication.user"> <a href="/#!/" class="navbar-brand"><img src="./modules/core/img/brand/logo.png"style="opacity: 0.8;width: 50%;" alt="logo"></a> </div> <div class="col-xs-6" data-ng-show="authentication.user"> <a href="/#!/activities" class="navbar-brand"><img src="./modules/core/img/brand/logo.png"style="opacity: 0.8;width: 50%;" alt="logo"></a> </div> <div class="col-xs-6"> <button class="navbar-toggle" type="button" data-ng-click="toggleCollapsibleMenu()"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> </div> </div> <nav class="collapse navbar-collapse" collapse="!isCollapsed" role="navigation"> <!-- <ul class="nav navbar-nav" data-ng-if="menu.shouldRender(authentication.user);"> <li data-ng-repeat="item in menu.items | orderBy: 'position'" data-ng-if="item.shouldRender(authentication.user);" ng-switch="item.menuItemType" ui-route="{{item.uiRoute}}" class="{{item.menuItemClass}}" ng-class="{active: ($uiRoute)}" dropdown="item.menuItemType === 'dropdown'"> <a ng-switch-when="dropdown" class="dropdown-toggle"> <span data-ng-bind="item.title"></span> <b class="caret"></b> </a> <ul ng-switch-when="dropdown" class="dropdown-menu"> <li data-ng-repeat="subitem in item.items | orderBy: 'position'" data-ng-if="subitem.shouldRender(authentication.user);" ui-route="{{subitem.uiRoute}}" ng-class="{active: $uiRoute}"> <a href="/#!/{{subitem.link}}" data-ng-bind="subitem.title"></a> </li> </ul> <a ng-switch-default href="/#!/{{item.link}}" data-ng-bind="item.title"></a> </li> </ul> --> <ul class="nav navbar-nav navbar-right" data-ng-hide="authentication.user"> <li ui-route="/signup" ng-class="{active: $uiRoute}"> <a href="/#!/signup">Sign Up</a> </li> <li class="divider-vertical"></li> <li ui-route="/signin" ng-class="{active: $uiRoute}"> <a href="/#!/signin">Sign In</a> </li> </ul> <ul class="nav navbar-nav navbar-right" data-ng-show="authentication.user"> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <span data-ng-bind="authentication.user.displayName"></span> <b class="caret"></b> </a> <ul class="dropdown-menu"> <li> <a href="/#!/settings/profile">Edit Profile</a> </li> <!-- <li> <a href="/#!/settings/accounts">Manage Social Accounts</a> </li> --> <li data-ng-show="authentication.user.provider === 'local'"> <a href="/#!/settings/password">Change Password</a> </li> <li class="divider"></li> <li> <a href="/auth/signout">Signout</a> </li> </ul> </li> </ul> </nav> </div>
hoeselm/kicklog
public/modules/core/views/header.client.view.html
HTML
mit
2,964
/** * */ package com.github.nnest.sparrow.rest.command.mixins.wrapper; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonUnwrapped; import com.github.nnest.sparrow.command.document.query.Example; import com.github.nnest.sparrow.command.document.query.ExampleType; import com.github.nnest.sparrow.command.document.query.compound.ConstantScore; /** * Constant score wrapper, see {@linkplain ConstantScore} * * @author brad.wu * @since 0.0.1 * @version 0.0.1 */ public class ConstantScoreWrapper extends AbstractChainQueryExampleWrapper { public ConstantScoreWrapper() { super(); } public ConstantScoreWrapper(ChainQueryExampleWrapper nextWrapper) { super(nextWrapper); } /** * (non-Javadoc) * * @see com.github.nnest.sparrow.rest.command.mixins.wrapper.QueryExampleWrapper#accept(com.github.nnest.sparrow.command.document.query.Example) */ @Override public boolean accept(Example example) { return example instanceof ConstantScore; } /** * (non-Javadoc) * * @see com.github.nnest.sparrow.rest.command.mixins.wrapper.AbstractQueryExampleWrapper#doWrap(com.github.nnest.sparrow.command.document.query.Example) */ @Override protected Example doWrap(Example example) { return new WrappedConstantScore((ConstantScore) example); } /** * wrapped constant score, only for {@linkplain ConstantScore} * * @author brad.wu * @since 0.0.1 * @version 0.0.1 */ public static class WrappedConstantScore implements Example { private ConstantScore query = null; private WrappedConstantScore(ConstantScore terms) { this.query = terms; } /** * @return the terms */ @JsonUnwrapped public ConstantScore getCompoundQuery() { return query; } /** * (non-Javadoc) * * @see com.github.nnest.sparrow.command.document.query.Example#getExampleType() */ @Override @JsonIgnore public ExampleType getExampleType() { return this.getCompoundQuery().getExampleType(); } } }
nnest/sparrow
sparrow-rest/src/main/java/com/github/nnest/sparrow/rest/command/mixins/wrapper/ConstantScoreWrapper.java
Java
mit
2,007
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Task 3 - Handlebars</title> <link rel="stylesheet" href="styles.css"> </head> <body> <div id="book-items-container"> </div> <div id="book-details-container"> </div> <script id="books-list-template" type='text/x-handlebars-template'> <ul class="books-list"> {{#books}} <li class="book-item"> <a href="#" data-id="{{id}}"> <strong class="book-title">{{title}}</strong><span class="author">by {{author}}</span> </a> </li> {{/books}} </ul> </script> <script id="book-details-template" type='text/x-handlebars-template'> <div class="book-details"> <h2 class="book-title"> {{title}} </h2> <p><span class="isbn">{{isbn}}</span></p> <p>Published on <span class="publish-date">{{publicationDate}}</span></p> <p class="description">{{description}}</p> </div> </script> <script src="handlebars.min.js"></script> <script src="scripts.js"></script> </body> </html>
ilievv/Telerik
Exam Preparation/JavaScript UI & DOM/Sample-Exam-2/task-3/task-files/index.html
HTML
mit
975
module Cardiac module CodecMethods DEFAULT_DECODERS = [:url_encoded, :xml, :json].freeze # Representation decoder selection and customization. def decoders(search,*rest,&handler) self.decoders_values += check_decoders(rest.unshift(search),handler) ; self end def reset_decoders(*rest,&handler) decoders_values.replace check_decoders(rest,handler) ; self end # Representation encoder selection and customization. def encoder(search, &handler) self.encoder_search_value = search.presence or raise ArgumentError self.encoder_handler_value = handler self end protected # Delegates mime type lookups to Representation::Codecs.mimes_for def lookup_type(search,options={}) ::Cardiac::Representation::Codecs.mimes_for(search,options) end def build_encoder(*previous) previous << encoder_handler_value if encoder_handler_value [encoder_search_value, previous] end # Builds a hash of decoder chains, keyed by symbol. # # In the decoder_values, zero or more symbols will precede each Proc in the chain, # specifying which decoder(s) it applies to. If no symbols precede the Proc, then it will # be applicable to ALL decoders, even subsequently specified ones. The order of # Proc objects in the chain are preserved, regardless of which decoders they are applicable to. # def build_decoders(base_decoders=DEFAULT_DECODERS, base_handler=nil) all_chain, decoders = [], {} decoders_values.each do |value| case value when Proc decoders.each_value{|chain| chain << value } all_chain << value when Symbol decoders[value] = all_chain.dup end end base_decoders.each{|decoder| decoders[decoder] = all_chain.dup } if decoders.empty? decoders end private def check_decoders(decoders,handler=nil) raise ArgumentError unless decoders.all?{|k| Symbol===k } decoders << handler if handler decoders end end end
joekhoobyar/cardiac
lib/cardiac/resource/codec_methods.rb
Ruby
mit
2,042
/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. */ package com.microsoft.azure.management.datafactory.v2018_06_01; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * A copy activity QuickBooks server source. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = QuickBooksSource.class) @JsonTypeName("QuickBooksSource") public class QuickBooksSource extends TabularSource { /** * A query to retrieve data from source. Type: string (or Expression with * resultType string). */ @JsonProperty(value = "query") private Object query; /** * Get a query to retrieve data from source. Type: string (or Expression with resultType string). * * @return the query value */ public Object query() { return this.query; } /** * Set a query to retrieve data from source. Type: string (or Expression with resultType string). * * @param query the query value to set * @return the QuickBooksSource object itself. */ public QuickBooksSource withQuery(Object query) { this.query = query; return this; } }
selvasingh/azure-sdk-for-java
sdk/datafactory/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/datafactory/v2018_06_01/QuickBooksSource.java
Java
mit
1,468
<!doctype html> <html class="no-js" lang=""> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Shoreline Lake - Intermediate Sailing</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Place favicon.ico and apple-touch-icon(s) in the root directory --> <link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png"> <link rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60.png"> <link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png"> <link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon-76x76.png"> <link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114x114.png"> <link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png"> <link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144.png"> <link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png"> <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180x180.png"> <link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32"> <link rel="icon" type="image/png" href="/android-chrome-192x192.png" sizes="192x192"> <link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96"> <link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16"> <link rel="manifest" href="/manifest.json"> <meta name="msapplication-TileColor" content="#da532c"> <meta name="msapplication-TileImage" content="/mstile-144x144.png"> <meta name="theme-color" content="#ffffff"> <link rel="stylesheet" href="css/main.css"> </head> <body id="inter-sail"> <div class="page-wrap"> <!--[if lt IE 8]> <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> <![endif]--> include "header.html" <section class="subbar"> <h2> <span><a href="sailing.html">sailing</a></span> intermediate sailing </h2> </section> <section class="body-content"> <!-- Push Wrapper --> <div class="mp-pusher" id="mp-pusher"> <!-- mp-menu --> include "nav.html" <!-- /mp-menu --> <section class="body-container"> <img src="../img/hero-img/inter-hero.jpg" alt="Intermediate Sailing"> <section class="main"> include "inter-sail-content.html" </section> <aside class="sidebar"> <ul> <li> <img src="../img/aside/sail-1.jpg" alt="The main boathouse"> </li> <li> <img src="../img/aside/sail-2.jpg" alt="Intermediate Sailing"> </li> </ul> </aside> </section> </div><!-- pusher --> </section> </div> <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="js/main.js"></script> <script>document.write('<script src="http://' + (location.host || 'localhost') .split(':')[0] + ':1337/livereload.js?snipver=1"></' + 'script>')</script> </body> </html>
natewscott/shoreline
intermediate_sailing.html
HTML
mit
3,426
function scoreS(p1, px, p2, e1, ex, e2) { var checksum1 = p1 + px + p2; var checksum2 = e1 + ex + e2; if (checksum1 > 0 && checksum2 > 0) { p1 = p1 / checksum1; px = px / checksum1; p2 = p2 / checksum1; e1 = e1 / checksum2; ex = ex / checksum2; e2 = e2 / checksum2; return 100 - 50 * ((e1 - p1) * (e1 - p1) + (ex - px) * (ex - px) + (e2 - p2) * (e2 - p2)); } else return 0; } //funzione di score T con ass. prob. (p1,px,p2) e risultato di verità (e1,ex,e2) function scoreT(p1, px, p2, e1, ex, e2) { var checksum1 = p1 + px + p2; var checksum2 = e1 + ex + e2; if (checksum1 > 0 && checksum2 > 0) { p1 = p1 / checksum1; px = px / checksum1; p2 = p2 / checksum1; e1 = e1 / checksum2; ex = ex / checksum2; e2 = e2 / checksum2; var v1 = e1 - p1, v2 = v1 + ex - px; return 100 - 50 * (v1 * v1 + v2 * v2); } else return 0; } function calcola_classifica_scoreS(array_giocatori, array_risultati) { var ret = []; var c, d, iniz_giocatori = 0, score_non_valido = 0; var temp = [], temp2 = [], tt = 0; var min_score, lista_score_mancanti = []; for (var week in array_risultati) { for (var partita in array_risultati[week]) { c = 0; d = 0; lista_score_mancanti = []; min_score = 100; for (var giocatore in array_giocatori) { if (iniz_giocatori == 0) { temp[c] = array_giocatori[giocatore]["name"]; temp2[c] = 0; } var p = []; if (array_giocatori[giocatore]["bets"] && array_giocatori[giocatore]["bets"][week] && array_giocatori[giocatore]["bets"][week][partita]) { p = array_giocatori[giocatore]["bets"][week][partita]; if (!isNaN(p[0]) && !isNaN(p[2]) && !isNaN(p[1])) { var e = []; p = array_giocatori[giocatore]["bets"][week][partita]; e = array_risultati[week][partita]; tt = scoreS(p[0] / 100, p[1] / 100, p[2] / 100, e[0], e[1], e[2]); if (tt <= min_score) { min_score = tt; } temp2[c] += tt; } else score_non_valido = 1; } else score_non_valido = 1; if (score_non_valido == 1) { lista_score_mancanti[d] = c; d++; score_non_valido = 0; } c++; } if (d > 0) for (var i = 0; i < d; i++) temp2[lista_score_mancanti[i]] += min_score; iniz_giocatori = 1; } } return toArray(temp, temp2, c); } //score tipo T function calcola_classifica_scoreT(array_giocatori, array_risultati) { var ret = []; var c, d, iniz_giocatori = 0, score_non_valido = 0; var temp = [], temp2 = [], tt = 0; var min_score, lista_score_mancanti = []; for (var week in array_risultati) { for (var partita in array_risultati[week]) { c = 0; d = 0; lista_score_mancanti = []; min_score = 100; for (var giocatore in array_giocatori) { if (iniz_giocatori == 0) { temp[c] = array_giocatori[giocatore]["name"]; temp2[c] = 0; } var p = []; if (array_giocatori[giocatore]["bets"] && array_giocatori[giocatore]["bets"][week] && array_giocatori[giocatore]["bets"][week][partita]) { p = array_giocatori[giocatore]["bets"][week][partita]; if (!isNaN(p[0]) && !isNaN(p[2]) && !isNaN(p[1])) { var e = []; p = array_giocatori[giocatore]["bets"][week][partita]; e = array_risultati[week][partita]; tt = scoreT(p[0] / 100, p[1] / 100, p[2] / 100, e[0], e[1], e[2]); if (tt <= min_score) { min_score = tt; } temp2[c] += tt; } else score_non_valido = 1; } else score_non_valido = 1; if (score_non_valido == 1) { lista_score_mancanti[d] = c; d++; score_non_valido = 0; } c++; } if (d > 0) for (var i = 0; i < d; i++) temp2[lista_score_mancanti[i]] += min_score; iniz_giocatori = 1; } } return toArray(temp, temp2, c); } function toArray(origin, origin2, count) { var ret = []; for (var i = 0; i < count; i++) ret.push({ name: origin[i], score: parseFloat(origin2[i].toFixed(2)) }); return ret.sort(function(a, b) { return a.score < b.score; }); } exports.calcola_classifica_scoreS = calcola_classifica_scoreS; exports.calcola_classifica_scoreT = calcola_classifica_scoreT;
fcannizzaro/dmi-exp
coffee/backend/util/rank_utils.js
JavaScript
mit
5,422
// Package bytefmt contains helper methods and constants for converting to and from a human-readable byte format. // // bytefmt.ByteSize(100.5*bytefmt.MEGABYTE) // "100.5M" // bytefmt.ByteSize(uint64(1024)) // "1K" // // https://github.com/cloudfoundry/bytefmt/blob/master/bytes.go package bytefmt import ( "errors" "strconv" "strings" "unicode" ) const ( BYTE = 1 << (10 * iota) KILOBYTE MEGABYTE GIGABYTE TERABYTE PETABYTE EXABYTE ) var invalidByteQuantityError = errors.New("byte quantity must be a positive integer with a unit of measurement like M, MB, MiB, G, GiB, or GB") // ByteSize returns a human-readable byte string of the form 10M, 12.5K, and so forth. The following units are available: // E: Exabyte // P: Petabyte // T: Terabyte // G: Gigabyte // M: Megabyte // K: Kilobyte // B: Byte // The unit that results in the smallest number greater than or equal to 1 is always chosen. func ByteSize(bytes uint64) string { unit := "" value := float64(bytes) switch { case bytes >= EXABYTE: unit = "E" value = value / EXABYTE case bytes >= PETABYTE: unit = "P" value = value / PETABYTE case bytes >= TERABYTE: unit = "T" value = value / TERABYTE case bytes >= GIGABYTE: unit = "G" value = value / GIGABYTE case bytes >= MEGABYTE: unit = "M" value = value / MEGABYTE case bytes >= KILOBYTE: unit = "K" value = value / KILOBYTE case bytes >= BYTE: unit = "B" case bytes == 0: return "0B" } result := strconv.FormatFloat(value, 'f', 1, 64) result = strings.TrimSuffix(result, ".0") return result + unit } // ToMegabytes parses a string formatted by ByteSize as megabytes. func ToMegabytes(s string) (uint64, error) { bytes, err := ToBytes(s) if err != nil { return 0, err } return bytes / MEGABYTE, nil } // ToBytes parses a string formatted by ByteSize as bytes. Note binary-prefixed and SI prefixed units both mean a base-2 units // KB = K = KiB = 1024 // MB = M = MiB = 1024 * K // GB = G = GiB = 1024 * M // TB = T = TiB = 1024 * G // PB = P = PiB = 1024 * T // EB = E = EiB = 1024 * P func ToBytes(s string) (uint64, error) { s = strings.TrimSpace(s) s = strings.ToUpper(s) i := strings.IndexFunc(s, unicode.IsLetter) if i == -1 { return 0, invalidByteQuantityError } bytesString, multiple := s[:i], s[i:] bytes, err := strconv.ParseFloat(bytesString, 64) if err != nil || bytes < 0 { return 0, invalidByteQuantityError } switch multiple { case "E", "EB", "EIB": return uint64(bytes * EXABYTE), nil case "P", "PB", "PIB": return uint64(bytes * PETABYTE), nil case "T", "TB", "TIB": return uint64(bytes * TERABYTE), nil case "G", "GB", "GIB": return uint64(bytes * GIGABYTE), nil case "M", "MB", "MIB": return uint64(bytes * MEGABYTE), nil case "K", "KB", "KIB": return uint64(bytes * KILOBYTE), nil case "B": return uint64(bytes), nil default: return 0, invalidByteQuantityError } }
xtrafrancyz/vk-proxy
bytefmt/bytefmt.go
GO
mit
2,905
# TODO implement a smoothing function perhaps # (Ie only accept frames within x distance of previous frame)
swirlingsand/self-driving-car-nanodegree-nd013
p4-CarND-Advanced-Lane-Lines/methods/laneDetection/qualityControl.py
Python
mit
109
\hypertarget{struct_i2_s___handle_type_def}{}\section{I2\+S\+\_\+\+Handle\+Type\+Def Struct Reference} \label{struct_i2_s___handle_type_def}\index{I2\+S\+\_\+\+Handle\+Type\+Def@{I2\+S\+\_\+\+Handle\+Type\+Def}} I2S handle Structure definition. {\ttfamily \#include $<$stm32f4xx\+\_\+hal\+\_\+i2s.\+h$>$} \subsection*{Public Attributes} \begin{DoxyCompactItemize} \item \hyperlink{struct_s_p_i___type_def}{S\+P\+I\+\_\+\+Type\+Def} $\ast$ {\bfseries Instance}\hypertarget{struct_i2_s___handle_type_def_a86f71902b413ffbf4a9b2a014fa328fd}{}\label{struct_i2_s___handle_type_def_a86f71902b413ffbf4a9b2a014fa328fd} \item \hyperlink{struct_i2_s___init_type_def}{I2\+S\+\_\+\+Init\+Type\+Def} {\bfseries Init}\hypertarget{struct_i2_s___handle_type_def_a94aee46e69e63586302022cee25e3fef}{}\label{struct_i2_s___handle_type_def_a94aee46e69e63586302022cee25e3fef} \item uint16\+\_\+t $\ast$ {\bfseries p\+Tx\+Buff\+Ptr}\hypertarget{struct_i2_s___handle_type_def_ac370d323d613caef9bea64b1f693e3a3}{}\label{struct_i2_s___handle_type_def_ac370d323d613caef9bea64b1f693e3a3} \item \hyperlink{core__sc300_8h_aec43007d9998a0a0e01faede4133d6be}{\+\_\+\+\_\+\+IO} uint16\+\_\+t {\bfseries Tx\+Xfer\+Size}\hypertarget{struct_i2_s___handle_type_def_a2ef37085c2e8e7c4e403691b839ea057}{}\label{struct_i2_s___handle_type_def_a2ef37085c2e8e7c4e403691b839ea057} \item \hyperlink{core__sc300_8h_aec43007d9998a0a0e01faede4133d6be}{\+\_\+\+\_\+\+IO} uint16\+\_\+t {\bfseries Tx\+Xfer\+Count}\hypertarget{struct_i2_s___handle_type_def_ae4c011efd61b97336cc6ad26a9c0f46c}{}\label{struct_i2_s___handle_type_def_ae4c011efd61b97336cc6ad26a9c0f46c} \item uint16\+\_\+t $\ast$ {\bfseries p\+Rx\+Buff\+Ptr}\hypertarget{struct_i2_s___handle_type_def_a4ed533f6151dffe421f5a4b993245143}{}\label{struct_i2_s___handle_type_def_a4ed533f6151dffe421f5a4b993245143} \item \hyperlink{core__sc300_8h_aec43007d9998a0a0e01faede4133d6be}{\+\_\+\+\_\+\+IO} uint16\+\_\+t {\bfseries Rx\+Xfer\+Size}\hypertarget{struct_i2_s___handle_type_def_a49bdf10088bb7ee85a49c11aa8cbcd2d}{}\label{struct_i2_s___handle_type_def_a49bdf10088bb7ee85a49c11aa8cbcd2d} \item \hyperlink{core__sc300_8h_aec43007d9998a0a0e01faede4133d6be}{\+\_\+\+\_\+\+IO} uint16\+\_\+t {\bfseries Rx\+Xfer\+Count}\hypertarget{struct_i2_s___handle_type_def_a2dc6aa868147b551301cb94e70fdfdec}{}\label{struct_i2_s___handle_type_def_a2dc6aa868147b551301cb94e70fdfdec} \item \hyperlink{group___d_m_a___exported___types_ga41b754a906b86bce54dc79938970138b}{D\+M\+A\+\_\+\+Handle\+Type\+Def} $\ast$ {\bfseries hdmatx}\hypertarget{struct_i2_s___handle_type_def_a2625e996e10078e85259a7a237e66039}{}\label{struct_i2_s___handle_type_def_a2625e996e10078e85259a7a237e66039} \item \hyperlink{group___d_m_a___exported___types_ga41b754a906b86bce54dc79938970138b}{D\+M\+A\+\_\+\+Handle\+Type\+Def} $\ast$ {\bfseries hdmarx}\hypertarget{struct_i2_s___handle_type_def_ad87c6860f139f3626244b388dab6baa2}{}\label{struct_i2_s___handle_type_def_ad87c6860f139f3626244b388dab6baa2} \item \hyperlink{core__sc300_8h_aec43007d9998a0a0e01faede4133d6be}{\+\_\+\+\_\+\+IO} \hyperlink{stm32f4xx__hal__def_8h_ab367482e943333a1299294eadaad284b}{H\+A\+L\+\_\+\+Lock\+Type\+Def} {\bfseries Lock}\hypertarget{struct_i2_s___handle_type_def_a32564bfb388cb9ae437cd95de0cc57ce}{}\label{struct_i2_s___handle_type_def_a32564bfb388cb9ae437cd95de0cc57ce} \item \hyperlink{core__sc300_8h_aec43007d9998a0a0e01faede4133d6be}{\+\_\+\+\_\+\+IO} \hyperlink{group___i2_s___exported___types_ga2588a0c71baf7cd6d2c1b9b11120bef0}{H\+A\+L\+\_\+\+I2\+S\+\_\+\+State\+Type\+Def} {\bfseries State}\hypertarget{struct_i2_s___handle_type_def_a9b051532810cae09a5ee43f69656197e}{}\label{struct_i2_s___handle_type_def_a9b051532810cae09a5ee43f69656197e} \item \hyperlink{core__sc300_8h_aec43007d9998a0a0e01faede4133d6be}{\+\_\+\+\_\+\+IO} uint32\+\_\+t {\bfseries Error\+Code}\hypertarget{struct_i2_s___handle_type_def_abcf71f0c8361bd2f4c4ce0d9270a8dc4}{}\label{struct_i2_s___handle_type_def_abcf71f0c8361bd2f4c4ce0d9270a8dc4} \end{DoxyCompactItemize} \subsection{Detailed Description} I2S handle Structure definition. The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize} \item Dynamixel-\/\+M\+X106/mbed/\+T\+A\+R\+G\+E\+T\+\_\+\+N\+U\+C\+L\+E\+O\+\_\+\+F446\+R\+E/\hyperlink{stm32f4xx__hal__i2s_8h}{stm32f4xx\+\_\+hal\+\_\+i2s.\+h}\end{DoxyCompactItemize}
team-diana/nucleo-dynamixel
docs/latex/struct_i2_s___handle_type_def.tex
TeX
mit
4,386