text
stringlengths
2
1.04M
meta
dict
import random import sys from blitzem.model import Node, Size from blitzem.test.dummies import DummyDriver, DummyConn if sys.version_info < (2, 7): import unittest2 as unittest else: import unittest class TestNode(unittest.TestCase): def setUp(self): self.node = None self.conn = None self.driver = DummyDriver() def create_dummies(self, node_name="", node_exists=False): self.node = Node( name=node_name, tags=["tag1"], size=Size(ram=512)) self.conn = DummyConn(node_name, node_exists) def test_up(self): self.create_dummies("nodetocreate", node_exists=False) self.node.up(self.driver, self.conn) self.assertTrue(self.conn.deploy_called) def test_down(self): self.create_dummies("nodetodestroy", node_exists=True) self.node.down(self.driver, self.conn) self.assertTrue(self.conn.dummy_lib_cloud_node.destroy_called)
{ "content_hash": "af3416e5cf78241c6bf6d22d81931257", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 64, "avg_line_length": 25, "alnum_prop": 0.72, "repo_name": "rnorth/blitzemp", "id": "2827e89350959985b728aea5d648b8bd036b3418", "size": "875", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "blitzem/test/test_node.py", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Python", "bytes": "24040" } ], "symlink_target": "" }
<?xml version="1.0" ?><!DOCTYPE TS><TS language="pt_BR" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Bithire</source> <translation>Sobre o Bithire</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;Bithire&lt;/b&gt; version</source> <translation>&lt;b&gt;Bithire&lt;/b&gt; versao</translation> </message> <message> <location line="+41"/> <source>Copyright © 2009-2014 The Bitcoin developers Copyright © 2012-2014 The NovaCoin developers Copyright © 2014 The Bithire developers</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation>⏎ Este é um software experimental.⏎ ⏎ Distribuido sob a licença de software MIT/X11, veja o arquivo anexo COPYING ou http://www.opensource.org/licenses/mit-license.php.⏎ ⏎ Este produto inclui software desenvolvido pelo Projeto OpenSSL para uso no OpenSSL Toolkit (http://www.openssl.org/), software de criptografia escrito por Eric Young (eay@cryptsoft.com) e sofware UPnP escrito por Thomas Bernard.</translation> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>Livro de Endereços</translation> </message> <message> <location line="+22"/> <source>Double-click to edit address or label</source> <translation>Clique duas vezes para editar o endereço ou a etiqueta</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Criar um novo endereço</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Copie o endereço selecionado para a área de transferência do sistema</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation>&amp;Novo Endereço</translation> </message> <message> <location line="-46"/> <source>These are your Bithire addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation>Estes são os seus endereços Bithire para receber pagamentos. Você pode dar um diferente a cada remetente para que você possa acompanhar quem está pagando.</translation> </message> <message> <location line="+60"/> <source>&amp;Copy Address</source> <translation>&amp;Copiar Endereço</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation>Mostrar &amp;QR Code</translation> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a Bithire address</source> <translation>Assine a mensagem para provar que você possui um endereço Bithire</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Assinar &amp;Mensagem</translation> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation>Excluir os endereços selecionados da lista</translation> </message> <message> <location line="-14"/> <source>Verify a message to ensure it was signed with a specified Bithire address</source> <translation>Verifique a mensagem para garantir que ela foi assinada com um endereço Bithire específico</translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation>&amp;Verificar Mensagem</translation> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;Excluir</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+65"/> <source>Copy &amp;Label</source> <translation>Copiar &amp;Etiqueta</translation> </message> <message> <location line="+2"/> <source>&amp;Edit</source> <translation>&amp;Editar</translation> </message> <message> <location line="+250"/> <source>Export Address Book Data</source> <translation>Exportar Dados do Livro de Endereços</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Arquivo separado por vírgulas (*. csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>Erro ao exportar</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Não foi possível escrever no arquivo %1.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>Rótulo</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Endereço</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(Sem rótulo)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Janela da Frase de Segurança</translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Digite a frase de segurança</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Nova frase de segurança</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Repita a nova frase de segurança</translation> </message> <message> <location line="+33"/> <source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source> <translation>Serve para desativar o envio de dinheiro trivial quando conta do SO for comprometida. Não oferece segurança real.</translation> </message> <message> <location line="+3"/> <source>For staking only</source> <translation>Apenas para participação</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+35"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation>Digite a nova frase de seguraça da sua carteira. &lt;br/&gt; Por favor, use uma frase de &lt;b&gt;10 ou mais caracteres aleatórios,&lt;/b&gt; ou &lt;b&gt;oito ou mais palavras.&lt;/b&gt;</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>Criptografar carteira</translation> </message> <message> <location line="+7"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Esta operação precisa de sua frase de segurança para desbloquear a carteira.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Desbloquear carteira</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Esta operação precisa de sua frase de segurança para descriptografar a carteira.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Descriptografar carteira</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Alterar frase de segurança</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Digite a frase de segurança antiga e nova para a carteira.</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>Confirmar criptografia da carteira</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR COINS&lt;/b&gt;!</source> <translation>Aviso: Se você criptografar sua carteira e perder sua senha, você vai &lt;b&gt;PERDER TODAS AS SUAS MOEDAS&lt;/ b&gt;!</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Tem certeza de que deseja criptografar sua carteira?</translation> </message> <message> <location line="+15"/> <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>IMPORTANTE: Qualquer backup prévio que você tenha feito do seu arquivo wallet deve ser substituído pelo novo e encriptado arquivo wallet gerado. Por razões de segurança, qualquer backup do arquivo wallet não criptografado se tornará inútil assim que você começar a usar uma nova carteira criptografada.</translation> </message> <message> <location line="+103"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Cuidado: A tecla Caps Lock está ligada!</translation> </message> <message> <location line="-133"/> <location line="+60"/> <source>Wallet encrypted</source> <translation>Carteira criptografada</translation> </message> <message> <location line="-58"/> <source>Bithire will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source> <translation>Bithire vai fechar agora para concluir o processo de criptografia. Lembre-se que a criptografia de sua carteira não pode proteger totalmente suas moedas de serem roubados por malwares infectem seu computador.</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+44"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>A criptografia da carteira falhou</translation> </message> <message> <location line="-56"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>A criptografia da carteira falhou devido a um erro interno. Sua carteira não estava criptografada.</translation> </message> <message> <location line="+7"/> <location line="+50"/> <source>The supplied passphrases do not match.</source> <translation>A frase de segurança fornecida não confere.</translation> </message> <message> <location line="-38"/> <source>Wallet unlock failed</source> <translation>A abertura da carteira falhou</translation> </message> <message> <location line="+1"/> <location line="+12"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>A frase de segurança digitada para a descriptografia da carteira estava incorreta.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>A descriptografia da carteira falhou</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>A frase de segurança da carteira foi alterada com êxito.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+280"/> <source>Sign &amp;message...</source> <translation>&amp;Assinar Mensagem...</translation> </message> <message> <location line="+242"/> <source>Synchronizing with network...</source> <translation>Sincronizando com a rede...</translation> </message> <message> <location line="-308"/> <source>&amp;Overview</source> <translation>&amp;Visão geral</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>Mostrar visão geral da carteira</translation> </message> <message> <location line="+17"/> <source>&amp;Transactions</source> <translation>&amp;Transações</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Navegar pelo histórico de transações</translation> </message> <message> <location line="+5"/> <source>&amp;Address Book</source> <translation>&amp;Livro de Endereços</translation> </message> <message> <location line="+1"/> <source>Edit the list of stored addresses and labels</source> <translation>Edite a lista de endereços armazenados e rótulos</translation> </message> <message> <location line="-13"/> <source>&amp;Receive coins</source> <translation>&amp;Receber moedas</translation> </message> <message> <location line="+1"/> <source>Show the list of addresses for receiving payments</source> <translation>Mostrar a lista de endereços para o recebimento de pagamentos</translation> </message> <message> <location line="-7"/> <source>&amp;Send coins</source> <translation>&amp;Enviar moedas</translation> </message> <message> <location line="+35"/> <source>E&amp;xit</source> <translation>S&amp;air</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Sair da aplicação</translation> </message> <message> <location line="+4"/> <source>Show information about Bithire</source> <translation>Mostrar informações sobre o Bithire</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>Sobre &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Mostrar informações sobre o Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;Opções...</translation> </message> <message> <location line="+4"/> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Criptografar Carteira...</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>&amp;Backup Carteira...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;Mudar frase de segurança...</translation> </message> <message numerus="yes"> <location line="+250"/> <source>~%n block(s) remaining</source> <translation><numerusform>~%n bloco faltando</numerusform><numerusform>~%n blocos faltando</numerusform></translation> </message> <message> <location line="+6"/> <source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source> <translation>Baixados %1 de %2 blocos de histórico de transações (%3% completo).</translation> </message> <message> <location line="-247"/> <source>&amp;Export...</source> <translation>&amp;Exportar...</translation> </message> <message> <location line="-62"/> <source>Send coins to a Bithire address</source> <translation>Enviar moedas para um endereço Bithire</translation> </message> <message> <location line="+45"/> <source>Modify configuration options for Bithire</source> <translation>Modificar opções de configuração para Bithire</translation> </message> <message> <location line="+18"/> <source>Export the data in the current tab to a file</source> <translation>Exportar os dados da guia atual para um arquivo</translation> </message> <message> <location line="-14"/> <source>Encrypt or decrypt wallet</source> <translation>Cryptografar ou Decryptografar carteira</translation> </message> <message> <location line="+3"/> <source>Backup wallet to another location</source> <translation>Fazer cópia de segurança da carteira para uma outra localização</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Mudar a frase de segurança utilizada na criptografia da carteira</translation> </message> <message> <location line="+10"/> <source>&amp;Debug window</source> <translation>Janela de &amp;Depuração</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Abrir console de depuração e diagnóstico</translation> </message> <message> <location line="-5"/> <source>&amp;Verify message...</source> <translation>&amp;Verificar mensagem...</translation> </message> <message> <location line="-200"/> <source>Bithire</source> <translation>Bithire</translation> </message> <message> <location line="+0"/> <source>Wallet</source> <translation>Carteira</translation> </message> <message> <location line="+178"/> <source>&amp;About Bithire</source> <translation>Sobre o Bithire</translation> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>&amp;Exibir/Ocultar</translation> </message> <message> <location line="+9"/> <source>Unlock wallet</source> <translation>Desbloquear carteira</translation> </message> <message> <location line="+1"/> <source>&amp;Lock Wallet</source> <translation>&amp;Bloquear Carteira</translation> </message> <message> <location line="+1"/> <source>Lock wallet</source> <translation>Bloquear Carteira</translation> </message> <message> <location line="+34"/> <source>&amp;File</source> <translation>&amp;Arquivo</translation> </message> <message> <location line="+8"/> <source>&amp;Settings</source> <translation>&amp;Configurações</translation> </message> <message> <location line="+8"/> <source>&amp;Help</source> <translation>&amp;Ajuda</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>Barra de ferramentas</translation> </message> <message> <location line="+8"/> <source>Actions toolbar</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+9"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+0"/> <location line="+60"/> <source>Bithire client</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+70"/> <source>%n active connection(s) to Bithire network</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+40"/> <source>Downloaded %1 blocks of transaction history.</source> <translation type="unfinished"/> </message> <message> <location line="+413"/> <source>Staking.&lt;br&gt;Your weight is %1&lt;br&gt;Network weight is %2&lt;br&gt;Expected time to earn reward is %3</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Not staking because wallet is locked</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because wallet is offline</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because wallet is syncing</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because you don&apos;t have mature coins</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-403"/> <source>%n second(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="-284"/> <source>&amp;Unlock Wallet...</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+288"/> <source>%n minute(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Up to date</source> <translation>Atualizado</translation> </message> <message> <location line="+7"/> <source>Catching up...</source> <translation>Recuperando o atraso ...</translation> </message> <message> <location line="+10"/> <source>Last received block was generated %1.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Sent transaction</source> <translation>Transação enviada</translation> </message> <message> <location line="+1"/> <source>Incoming transaction</source> <translation>Transação recebida</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Data: %1 Quantidade: %2 Tipo: %3 Endereço: %4</translation> </message> <message> <location line="+100"/> <location line="+15"/> <source>URI handling</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <location line="+15"/> <source>URI can not be parsed! This can be caused by an invalid Bithire address or malformed URI parameters.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>Carteira está &lt;b&gt;criptografada&lt;/b&gt; e atualmente &lt;b&gt;desbloqueada&lt;/b&gt;</translation> </message> <message> <location line="+10"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>Carteira está &lt;b&gt;criptografada&lt;/b&gt; e atualmente &lt;b&gt;bloqueada&lt;/b&gt;</translation> </message> <message> <location line="+25"/> <source>Backup Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+76"/> <source>%n second(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n minute(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s)</source> <translation><numerusform>%n hora</numerusform><numerusform>%n horas</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation><numerusform>%n dia</numerusform><numerusform>%n dias</numerusform></translation> </message> <message> <location line="+18"/> <source>Not staking</source> <translation type="unfinished"/> </message> <message> <location filename="../bitcoin.cpp" line="+109"/> <source>A fatal error occurred. Bithire can no longer continue safely and will quit.</source> <translation type="unfinished"/> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+90"/> <source>Network Alert</source> <translation>Alerta da Rede</translation> </message> </context> <context> <name>CoinControlDialog</name> <message> <location filename="../forms/coincontroldialog.ui" line="+14"/> <source>Coin Control</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Quantity:</source> <translation>Quantidade:</translation> </message> <message> <location line="+32"/> <source>Bytes:</source> <translation>Bytes:</translation> </message> <message> <location line="+48"/> <source>Amount:</source> <translation>Quantia:</translation> </message> <message> <location line="+32"/> <source>Priority:</source> <translation>Prioridade:</translation> </message> <message> <location line="+48"/> <source>Fee:</source> <translation>Taxa:</translation> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation>Rendimento baixo:</translation> </message> <message> <location filename="../coincontroldialog.cpp" line="+551"/> <source>no</source> <translation>não</translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="+51"/> <source>After Fee:</source> <translation>Depois da taxa:</translation> </message> <message> <location line="+35"/> <source>Change:</source> <translation>trocar</translation> </message> <message> <location line="+69"/> <source>(un)select all</source> <translation>(de)selecionar tudo</translation> </message> <message> <location line="+13"/> <source>Tree mode</source> <translation>Modo árvore</translation> </message> <message> <location line="+16"/> <source>List mode</source> <translation>Modo lista</translation> </message> <message> <location line="+45"/> <source>Amount</source> <translation>Quantidade</translation> </message> <message> <location line="+5"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Address</source> <translation>Endereço</translation> </message> <message> <location line="+5"/> <source>Date</source> <translation>Data</translation> </message> <message> <location line="+5"/> <source>Confirmations</source> <translation>Confirmações</translation> </message> <message> <location line="+3"/> <source>Confirmed</source> <translation>Confirmado</translation> </message> <message> <location line="+5"/> <source>Priority</source> <translation>Prioridade</translation> </message> <message> <location filename="../coincontroldialog.cpp" line="-515"/> <source>Copy address</source> <translation>Copiar endereço</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Copiar etiqueta</translation> </message> <message> <location line="+1"/> <location line="+26"/> <source>Copy amount</source> <translation>Copiar quantia</translation> </message> <message> <location line="-25"/> <source>Copy transaction ID</source> <translation>Copiar ID da transação</translation> </message> <message> <location line="+24"/> <source>Copy quantity</source> <translation>Copiar quantidade</translation> </message> <message> <location line="+2"/> <source>Copy fee</source> <translation>Copiar taxa</translation> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation>Copia pós-taxa</translation> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation>Copiar bytes</translation> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation>Copia prioridade</translation> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation>Copia saída de pouco valor</translation> </message> <message> <location line="+1"/> <source>Copy change</source> <translation>Copia alteração</translation> </message> <message> <location line="+317"/> <source>highest</source> <translation>mais alta possível</translation> </message> <message> <location line="+1"/> <source>high</source> <translation>alta</translation> </message> <message> <location line="+1"/> <source>medium-high</source> <translation>média-alta</translation> </message> <message> <location line="+1"/> <source>medium</source> <translation>média</translation> </message> <message> <location line="+4"/> <source>low-medium</source> <translation>média-baixa</translation> </message> <message> <location line="+1"/> <source>low</source> <translation>baixa</translation> </message> <message> <location line="+1"/> <source>lowest</source> <translation>a mais baixa possível</translation> </message> <message> <location line="+155"/> <source>DUST</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>yes</source> <translation>sim</translation> </message> <message> <location line="+10"/> <source>This label turns red, if the transaction size is bigger than 10000 bytes. This means a fee of at least %1 per kb is required. Can vary +/- 1 Byte per input.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transactions with higher priority get more likely into a block. This label turns red, if the priority is smaller than &quot;medium&quot;. This means a fee of at least %1 per kb is required.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if any recipient receives an amount smaller than %1. This means a fee of at least %2 is required. Amounts below 0.546 times the minimum relay fee are shown as DUST.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if the change is smaller than %1. This means a fee of at least %2 is required.</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <location line="+66"/> <source>(no label)</source> <translation>(Sem rótulo)</translation> </message> <message> <location line="-9"/> <source>change from %1 (%2)</source> <translation>troco de %1 (%2)</translation> </message> <message> <location line="+1"/> <source>(change)</source> <translation>(troco)</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Editar Endereço</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Etiqueta</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;Endereço</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation type="unfinished"/> </message> <message> <location filename="../editaddressdialog.cpp" line="+20"/> <source>New receiving address</source> <translation>Novo endereço de recebimento</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Novo endereço de envio</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Editar endereço de recebimento</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Editar endereço de envio</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>O endereço digitado &quot;%1&quot; já se encontra no catálogo de endereços.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid Bithire address.</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>Não foi possível destravar a carteira.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>A geração de nova chave falhou.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+420"/> <location line="+12"/> <source>Bithire-Qt</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>version</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>UI options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation type="unfinished"/> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Opções</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>Principal</translation> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>Pagar taxa de &amp;transação</translation> </message> <message> <location line="+31"/> <source>Reserved amount does not participate in staking and is therefore spendable at any time.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Reserve</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Automatically start Bithire after logging in to the system.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Start Bithire on system login</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Detach databases at shutdown</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Network</source> <translation>Rede</translation> </message> <message> <location line="+6"/> <source>Automatically open the Bithire client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Mapear porta usando &amp;UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the Bithire network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>&amp;IP do proxy:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;Porta:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Porta do serviço de proxy (ex. 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>&amp;Versão do SOCKS:</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>Versão do proxy SOCKS (ex. 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Janela</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Mostrar apenas um ícone na bandeja ao minimizar a janela.</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Minimizar para a bandeja em vez da barra de tarefas.</translation> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation>Minimizar em vez de sair do aplicativo quando a janela for fechada. Quando esta opção é escolhida, o aplicativo só será fechado selecionando Sair no menu Arquivo.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>M&amp;inimizar ao sair</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>&amp;Mostrar</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>&amp;Língua da interface com usuário:</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting Bithire.</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Unidade usada para mostrar quantidades:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Escolha a unidade padrão de subdivisão para interface mostrar quando enviar bitcoins.</translation> </message> <message> <location line="+9"/> <source>Whether to show Bithire addresses in the transaction list or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>Mostrar en&amp;dereços na lista de transações</translation> </message> <message> <location line="+7"/> <source>Whether to show coin control features or not.</source> <translation>Mostrar ou não opções de controle da moeda.</translation> </message> <message> <location line="+3"/> <source>Display coin &amp;control features (experts only!)</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;OK</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;Cancelar</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation type="unfinished"/> </message> <message> <location filename="../optionsdialog.cpp" line="+55"/> <source>default</source> <translation>padrão</translation> </message> <message> <location line="+149"/> <location line="+9"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting Bithire.</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>O endereço proxy fornecido é inválido.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Formulário</translation> </message> <message> <location line="+33"/> <location line="+231"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bithire network after a connection is established, but this process has not completed yet.</source> <translation type="unfinished"/> </message> <message> <location line="-160"/> <source>Stake:</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation type="unfinished"/> </message> <message> <location line="-107"/> <source>Wallet</source> <translation>Carteira</translation> </message> <message> <location line="+49"/> <source>Spendable:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Your current spendable balance</source> <translation>Seu saldo atual spendable</translation> </message> <message> <location line="+71"/> <source>Immature:</source> <translation>Imaturo:</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>Saldo minerado que ainda não maturou</translation> </message> <message> <location line="+20"/> <source>Total:</source> <translation>Total:</translation> </message> <message> <location line="+16"/> <source>Your current total balance</source> <translation>Seu saldo total atual</translation> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Transações recentes&lt;/b&gt;</translation> </message> <message> <location line="-108"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>Total of coins that was staked, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location filename="../overviewpage.cpp" line="+113"/> <location line="+1"/> <source>out of sync</source> <translation>fora de sincronia</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation type="unfinished"/> </message> <message> <location line="+56"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Label:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Message:</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation type="unfinished"/> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation type="unfinished"/> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Nome do cliente</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+348"/> <source>N/A</source> <translation>N/A</translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation>Versão do cliente</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Informação</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>Usando OpenSSL versão</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Horário de inicialização</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Rede</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Número de conexões</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>Corrente de blocos</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Quantidade atual de blocos</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>Total estimado de blocos</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>Horário do último bloco</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Abrir</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Show the Bithire-Qt help message to get a list with possible Bithire command-line options.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;Console</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>Data do &apos;build&apos;</translation> </message> <message> <location line="-104"/> <source>Bithire - Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Bithire Core</source> <translation type="unfinished"/> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation>Arquivo de log de Depuração</translation> </message> <message> <location line="+7"/> <source>Open the Bithire debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"/> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>Limpar console</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-33"/> <source>Welcome to the Bithire RPC console.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>Use as setas para cima e para baixo para navegar pelo histórico, e &lt;b&gt;Ctrl-L&lt;/b&gt; para limpar a tela.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Digite &lt;b&gt;help&lt;/b&gt; para uma visão geral dos comandos disponíveis.</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+182"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>Enviar dinheiro</translation> </message> <message> <location line="+76"/> <source>Coin Control Features</source> <translation>Opções de Controle da Moeda</translation> </message> <message> <location line="+20"/> <source>Inputs...</source> <translation>Entradas...</translation> </message> <message> <location line="+7"/> <source>automatically selected</source> <translation>automaticamente selecionado</translation> </message> <message> <location line="+19"/> <source>Insufficient funds!</source> <translation>Saldo insuficiente!</translation> </message> <message> <location line="+77"/> <source>Quantity:</source> <translation>Quantidade:</translation> </message> <message> <location line="+22"/> <location line="+35"/> <source>0</source> <translation type="unfinished"/> </message> <message> <location line="-19"/> <source>Bytes:</source> <translation>Bytes:</translation> </message> <message> <location line="+51"/> <source>Amount:</source> <translation>Quantia:</translation> </message> <message> <location line="+22"/> <location line="+86"/> <location line="+86"/> <location line="+32"/> <source>0.00 HIRE</source> <translation type="unfinished"/> </message> <message> <location line="-191"/> <source>Priority:</source> <translation>Prioridade:</translation> </message> <message> <location line="+19"/> <source>medium</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Fee:</source> <translation>Taxa:</translation> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation>Rendimento baixo:</translation> </message> <message> <location line="+19"/> <source>no</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>After Fee:</source> <translation>Depois da taxa:</translation> </message> <message> <location line="+35"/> <source>Change</source> <translation type="unfinished"/> </message> <message> <location line="+50"/> <source>custom change address</source> <translation type="unfinished"/> </message> <message> <location line="+106"/> <source>Send to multiple recipients at once</source> <translation>Enviar para vários destinatários de uma só vez</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>Adicionar destinatário</translation> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>Limpar Tudo</translation> </message> <message> <location line="+28"/> <source>Balance:</source> <translation>Saldo:</translation> </message> <message> <location line="+16"/> <source>123.456 HIRE</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>Confirmar o envio</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>Enviar</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-173"/> <source>Enter a Bithire address (e.g. Gf3MqcdvirAVxWcRs2LWK5UMeW9tK3UT8F)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Copy quantity</source> <translation>Copiar quantidade</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Copiar quantia</translation> </message> <message> <location line="+1"/> <source>Copy fee</source> <translation>Copiar taxa</translation> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation>Copia pós-taxa</translation> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation>Copiar bytes</translation> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation>Copia prioridade</translation> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation>Copia saída de pouco valor</translation> </message> <message> <location line="+1"/> <source>Copy change</source> <translation>Copia alteração</translation> </message> <message> <location line="+86"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Confirmar envio de dinheiro</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source> and </source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The recipient address is not valid, please recheck.</source> <translation>O endereço do destinatário não é válido, favor verificar.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>A quantidade a ser paga precisa ser maior que 0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>A quantidade excede seu saldo.</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>O total excede seu saldo quando uma taxa de transação de %1 é incluída.</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Endereço duplicado: pode-se enviar para cada endereço apenas uma vez por transação.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+251"/> <source>WARNING: Invalid Bithire address</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>(no label)</source> <translation>(Sem rótulo)</translation> </message> <message> <location line="+4"/> <source>WARNING: unknown change address</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>Q&amp;uantidade:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>Pagar &amp;Para:</translation> </message> <message> <location line="+24"/> <location filename="../sendcoinsentry.cpp" line="+25"/> <source>Enter a label for this address to add it to your address book</source> <translation>Digite uma etiqueta para este endereço para adicioná-lo ao catálogo de endereços</translation> </message> <message> <location line="+9"/> <source>&amp;Label:</source> <translation>&amp;Etiqueta:</translation> </message> <message> <location line="+18"/> <source>The address to send the payment to (e.g. Gf3MqcdvirAVxWcRs2LWK5UMeW9tK3UT8F)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Choose address from address book</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation>Colar o endereço da área de transferência</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a Bithire address (e.g. Gf3MqcdvirAVxWcRs2LWK5UMeW9tK3UT8F)</source> <translation type="unfinished"/> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>Assinaturas - Assinar / Verificar uma mensagem</translation> </message> <message> <location line="+13"/> <location line="+124"/> <source>&amp;Sign Message</source> <translation>&amp;Assinar Mensagem</translation> </message> <message> <location line="-118"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation>Você pode assinar mensagens com seus endereços para provar que você é o dono deles. Seja cuidadoso para não assinar algo vago, pois ataques de pishing podem tentar te enganar para dar sua assinatura de identidade para eles. Apenas assine afirmações completamente detalhadas com as quais você concorda.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. Gf3MqcdvirAVxWcRs2LWK5UMeW9tK3UT8F)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+203"/> <source>Choose an address from the address book</source> <translation type="unfinished"/> </message> <message> <location line="-193"/> <location line="+203"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-193"/> <source>Paste address from clipboard</source> <translation>Colar o endereço da área de transferência</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation>Entre a mensagem que você quer assinar aqui</translation> </message> <message> <location line="+24"/> <source>Copy the current signature to the system clipboard</source> <translation>Copiar a assinatura para a área de transferência do sistema</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this Bithire address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all sign message fields</source> <translation>Limpar todos os campos de assinatura da mensagem</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>Limpar Tudo</translation> </message> <message> <location line="-87"/> <location line="+70"/> <source>&amp;Verify Message</source> <translation>&amp;Verificar Mensagem</translation> </message> <message> <location line="-64"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation>Forneça o endereço da assinatura, a mensagem (se assegure que você copiou quebras de linha, espaços, tabs, etc. exatamente) e a assinatura abaixo para verificar a mensagem. Cuidado para não ler mais na assinatura do que está escrito na mensagem propriamente, para evitar ser vítima de uma ataque do tipo &quot;man-in-the-middle&quot;.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. Gf3MqcdvirAVxWcRs2LWK5UMeW9tK3UT8F)</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified Bithire address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all verify message fields</source> <translation>Limpar todos os campos de assinatura da mensagem</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a Bithire address (e.g. Gf3MqcdvirAVxWcRs2LWK5UMeW9tK3UT8F)</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>Clique em &quot;Assinar Mensagem&quot; para gerar a assinatura</translation> </message> <message> <location line="+3"/> <source>Enter Bithire signature</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>O endereço fornecido é inválido.</translation> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation>Por favor, verifique o endereço e tente novamente.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>O endereço fornecido não se refere a uma chave.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>Destravamento da Carteira foi cancelado.</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>A chave privada para o endereço fornecido não está disponível.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>Assinatura da mensagem falhou.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>Mensagem assinada.</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>A assinatura não pode ser decodificada.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>Por favor, verifique a assinatura e tente novamente.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>A assinatura não corresponde ao &quot;resumo da mensagem&quot;.</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>Verificação da mensagem falhou.</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>Mensagem verificada.</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+19"/> <source>Open until %1</source> <translation>Aberto até %1</translation> </message> <message numerus="yes"> <location line="-2"/> <source>Open for %n block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+8"/> <source>conflicted</source> <translation>em conflito</translation> </message> <message> <location line="+2"/> <source>%1/offline</source> <translation>%1/offline</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/não confirmadas</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 confirmações</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>Status</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>, difundir atráves de %n nó</numerusform><numerusform>, difundir atráves de %n nós</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Data</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>Fonte</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>Gerados</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>De</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>Para</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>seu próprio endereço</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>etiqueta</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>Crédito</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>matura em mais %n bloco</numerusform><numerusform>matura em mais %n blocos</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>não aceito</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>Débito</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>Taxa de transação</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Valor líquido</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>Mensagem</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>Comentário</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>ID da transação</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 50 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>Informação de depuração</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Transação</translation> </message> <message> <location line="+5"/> <source>Inputs</source> <translation>Entradas</translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>Quantidade</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>verdadeiro</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>falso</translation> </message> <message> <location line="-211"/> <source>, has not been successfully broadcast yet</source> <translation>, ainda não foi propagada na rede com sucesso.</translation> </message> <message> <location line="+35"/> <source>unknown</source> <translation>desconhecido</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>Detalhes da transação</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Este painel mostra uma descrição detalhada da transação</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+226"/> <source>Date</source> <translation>Data</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Tipo</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Endereço</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Quantidade</translation> </message> <message> <location line="+60"/> <source>Open until %1</source> <translation>Aberto até %1</translation> </message> <message> <location line="+12"/> <source>Confirmed (%1 confirmations)</source> <translation>Confirmado (%1 confirmações)</translation> </message> <message numerus="yes"> <location line="-15"/> <source>Open for %n more block(s)</source> <translation><numerusform>Abrir para mais %n bloco</numerusform><numerusform>Abrir para mais %n blocos</numerusform></translation> </message> <message> <location line="+6"/> <source>Offline</source> <translation>Offline</translation> </message> <message> <location line="+3"/> <source>Unconfirmed</source> <translation>Não confirmado</translation> </message> <message> <location line="+3"/> <source>Confirming (%1 of %2 recommended confirmations)</source> <translation>Confirmando (%1 de %2 confirmações recomendadas)</translation> </message> <message> <location line="+6"/> <source>Conflicted</source> <translation>Conflitou</translation> </message> <message> <location line="+3"/> <source>Immature (%1 confirmations, will be available after %2)</source> <translation>Recém-criado (%1 confirmações, disponível somente após %2)</translation> </message> <message> <location line="+3"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>Este bloco não foi recebido por nenhum outro participante da rede e provavelmente não será aceito!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Gerado mas não aceito</translation> </message> <message> <location line="+42"/> <source>Received with</source> <translation>Recebido por</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Recebido de</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Enviado para</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Pagamento para você mesmo</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Minerado</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(n/a)</translation> </message> <message> <location line="+190"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Status da transação. Passe o mouse sobre este campo para mostrar o número de confirmações.</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Data e hora em que a transação foi recebida.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Tipo de transação.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>Endereço de destino da transação.</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Quantidade debitada ou creditada ao saldo.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+55"/> <location line="+16"/> <source>All</source> <translation>Todos</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>Hoje</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>Esta semana</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>Este mês</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Mês passado</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>Este ano</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Intervalo...</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>Recebido por</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Enviado para</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>Para você mesmo</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Minerado</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Outro</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Procure um endereço ou etiqueta</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Quantidade mínima</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Copiar endereço</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Copiar etiqueta</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Copiar quantia</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation>Copiar ID da transação</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Editar etiqueta</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Mostrar detalhes da transação</translation> </message> <message> <location line="+144"/> <source>Export Transaction Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Arquivo separado por vírgulas (*. csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Confirmado</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Data</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Tipo</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Etiqueta</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Endereço</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Quantidade</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> <message> <location line="+100"/> <source>Range:</source> <translation>Intervalo: </translation> </message> <message> <location line="+8"/> <source>to</source> <translation>para</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+206"/> <source>Sending...</source> <translation type="unfinished"/> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+33"/> <source>Bithire version</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Usage:</source> <translation>Uso:</translation> </message> <message> <location line="+1"/> <source>Send command to -server or bithired</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>List commands</source> <translation>Lista de comandos</translation> </message> <message> <location line="+1"/> <source>Get help for a command</source> <translation>Obtenha ajuda sobre um comando</translation> </message> <message> <location line="+2"/> <source>Options:</source> <translation>Opções:</translation> </message> <message> <location line="+2"/> <source>Specify configuration file (default: bithire.conf)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Specify pid file (default: bithired.pid)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify wallet file (within data directory)</source> <translation>Especifique o arquivo da carteira (dentro do diretório de dados)</translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Especificar diretório de dados</translation> </message> <message> <location line="+2"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Definir o tamanho do cache do banco de dados em megabytes (padrão: 25)</translation> </message> <message> <location line="+1"/> <source>Set database disk log size in megabytes (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Listen for connections on &lt;port&gt; (default: 15714 or testnet: 25714)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Manter no máximo &lt;n&gt; conexões aos peers (padrão: 125)</translation> </message> <message> <location line="+3"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Conectar a um nó para receber endereços de participantes, e desconectar.</translation> </message> <message> <location line="+1"/> <source>Specify your own public address</source> <translation>Especificar seu próprio endereço público</translation> </message> <message> <location line="+5"/> <source>Bind to given address. Use [host]:port notation for IPv6</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Stake your coins to support network and gain reward (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Limite para desconectar peers mal comportados (padrão: 100)</translation> </message> <message> <location line="+1"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Número de segundos para impedir que peers mal comportados reconectem (padrão: 86400)</translation> </message> <message> <location line="-44"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>Um erro ocorreu ao configurar a porta RPC %u para escuta em IPv4: %s</translation> </message> <message> <location line="+51"/> <source>Detach block and address databases. Increases shutdown time (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+109"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source> <translation type="unfinished"/> </message> <message> <location line="-87"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 15715 or testnet: 25715)</source> <translation type="unfinished"/> </message> <message> <location line="-11"/> <source>Accept command line and JSON-RPC commands</source> <translation>Aceitar linha de comando e comandos JSON-RPC</translation> </message> <message> <location line="+101"/> <source>Error: Transaction creation failed </source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>Error: Wallet locked, unable to create transaction </source> <translation type="unfinished"/> </message> <message> <location line="-8"/> <source>Importing blockchain data file.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Importing bootstrap blockchain data file.</source> <translation type="unfinished"/> </message> <message> <location line="-88"/> <source>Run in the background as a daemon and accept commands</source> <translation>Rodar em segundo plano como serviço e aceitar comandos</translation> </message> <message> <location line="+1"/> <source>Use the test network</source> <translation>Usar rede de teste</translation> </message> <message> <location line="-24"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Aceitar conexões externas (padrão: 1 se opções -proxy ou -connect não estiverem presentes)</translation> </message> <message> <location line="-38"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>Um erro ocorreu ao configurar a porta RPC %u para escuta em IPv6, voltando ao IPv4: %s</translation> </message> <message> <location line="+117"/> <source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source> <translation type="unfinished"/> </message> <message> <location line="-20"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Cuidado: valor de -paytxfee escolhido é muito alto! Este é o valor da taxa de transação que você irá pagar se enviar a transação.</translation> </message> <message> <location line="+61"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong Bithire will not work properly.</source> <translation type="unfinished"/> </message> <message> <location line="-31"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation>Cuidado: erro ao ler arquivo wallet.dat! Todas as chaves foram lidas corretamente, mas dados transações e do catálogo de endereços podem estar faltando ou estar incorretas.</translation> </message> <message> <location line="-18"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation>Aviso: wallet.dat corrompido, dados recuperados! Arquivo wallet.dat original salvo como wallet.{timestamp}.bak em %s; se seu saldo ou transações estiverem incorretos, você deve restauras o backup.</translation> </message> <message> <location line="-30"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>Tentar recuperar chaves privadas de um arquivo wallet.dat corrompido</translation> </message> <message> <location line="+4"/> <source>Block creation options:</source> <translation>Opções de criação de blocos:</translation> </message> <message> <location line="-62"/> <source>Connect only to the specified node(s)</source> <translation>Conectar apenas a nó(s) específico(s)</translation> </message> <message> <location line="+4"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>Descobrir os próprios endereços IP (padrão: 1 quando no modo listening e opção -externalip não estiver presente)</translation> </message> <message> <location line="+94"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Falha ao escutar em qualquer porta. Use -listen=0 se você quiser isso.</translation> </message> <message> <location line="-90"/> <source>Find peers using DNS lookup (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Sync checkpoints policy (default: strict)</source> <translation type="unfinished"/> </message> <message> <location line="+83"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Invalid amount for -reservebalance=&lt;amount&gt;</source> <translation type="unfinished"/> </message> <message> <location line="-82"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>Buffer máximo de recebimento por conexão, &lt;n&gt;*1000 bytes (padrão: 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>Buffer máximo de envio por conexão, &lt;n&gt;*1000 bytes (padrão: 1000)</translation> </message> <message> <location line="-16"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>Apenas conectar em nós na rede &lt;net&gt; (IPv4, IPv6, ou Tor)</translation> </message> <message> <location line="+28"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Prepend debug output with timestamp</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source> <translation>Opções SSL: (veja a Wiki do Bitcoin para instruções de configuração SSL)</translation> </message> <message> <location line="-74"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation type="unfinished"/> </message> <message> <location line="+41"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Mandar informação de trace/debug para o console em vez de para o arquivo debug.log</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Determinar tamanho mínimo de bloco em bytes (padrão: 0)</translation> </message> <message> <location line="-29"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Encolher arquivo debug.log ao iniciar o cliente (padrão 1 se opção -debug não estiver presente)</translation> </message> <message> <location line="-42"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>Especifique o tempo limite (timeout) da conexão em milissegundos (padrão: 5000) </translation> </message> <message> <location line="+109"/> <source>Unable to sign checkpoint, wrong checkpointkey? </source> <translation type="unfinished"/> </message> <message> <location line="-80"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Usar UPnP para mapear porta de escuta (padrão: 0)</translation> </message> <message> <location line="-1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Usar UPnP para mapear porta de escuta (padrão: 1 quando estiver escutando)</translation> </message> <message> <location line="-25"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <source>Username for JSON-RPC connections</source> <translation>Nome de usuário para conexões JSON-RPC</translation> </message> <message> <location line="+47"/> <source>Verifying database integrity...</source> <translation type="unfinished"/> </message> <message> <location line="+57"/> <source>WARNING: syncronized checkpoint violation detected, but skipped!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Cuidado: Esta versão está obsoleta, atualização exigida!</translation> </message> <message> <location line="-48"/> <source>wallet.dat corrupt, salvage failed</source> <translation>wallet.dat corrompido, recuperação falhou</translation> </message> <message> <location line="-54"/> <source>Password for JSON-RPC connections</source> <translation>Senha para conexões JSON-RPC</translation> </message> <message> <location line="-84"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=bithirerpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;Bithire Alert&quot; admin@foo.com </source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Find peers using internet relay chat (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Permitir conexões JSON-RPC de endereços IP específicos</translation> </message> <message> <location line="+1"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Enviar comando para nó rodando em &lt;ip&gt; (pardão: 127.0.0.1)</translation> </message> <message> <location line="+1"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Executar comando quando o melhor bloco mudar (%s no comando será substituído pelo hash do bloco)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>Executar comando quando uma transação da carteira mudar (%s no comando será substituído por TxID)</translation> </message> <message> <location line="+3"/> <source>Require a confirmations for change (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Upgrade wallet to latest format</source> <translation>Atualizar carteira para o formato mais recente</translation> </message> <message> <location line="+1"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Determinar tamanho do pool de endereços para &lt;n&gt; (padrão: 100)</translation> </message> <message> <location line="+1"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Re-escanear blocos procurando por transações perdidas da carteira</translation> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 2500, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-6, default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Imports blocks from external blk000?.dat file</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Usar OpenSSL (https) para conexões JSON-RPC</translation> </message> <message> <location line="+1"/> <source>Server certificate file (default: server.cert)</source> <translation>Arquivo de certificado do servidor (padrão: server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Chave privada do servidor (padrão: server.pem)</translation> </message> <message> <location line="+1"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation type="unfinished"/> </message> <message> <location line="+53"/> <source>Error: Wallet unlocked for staking only, unable to create transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source> <translation type="unfinished"/> </message> <message> <location line="-158"/> <source>This help message</source> <translation>Esta mensagem de ajuda</translation> </message> <message> <location line="+95"/> <source>Wallet %s resides outside data directory %s.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot obtain a lock on data directory %s. Bithire is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-98"/> <source>Bithire</source> <translation type="unfinished"/> </message> <message> <location line="+140"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Impossível vincular a %s neste computador (bind retornou erro %d, %s)</translation> </message> <message> <location line="-130"/> <source>Connect through socks proxy</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Permitir consultas DNS para -addnode, -seednode e -connect</translation> </message> <message> <location line="+122"/> <source>Loading addresses...</source> <translation>Carregando endereços...</translation> </message> <message> <location line="-15"/> <source>Error loading blkindex.dat</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Erro ao carregar wallet.dat: Carteira corrompida</translation> </message> <message> <location line="+4"/> <source>Error loading wallet.dat: Wallet requires newer version of Bithire</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Wallet needed to be rewritten: restart Bithire to complete</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading wallet.dat</source> <translation>Erro ao carregar wallet.dat</translation> </message> <message> <location line="-16"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Endereço -proxy inválido: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>Rede desconhecida especificada em -onlynet: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>Versão desconhecida do proxy -socks requisitada: %i</translation> </message> <message> <location line="+4"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>Impossível encontrar o endereço -bind: &apos;%s&apos;</translation> </message> <message> <location line="+2"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>Impossível encontrar endereço -externalip: &apos;%s&apos;</translation> </message> <message> <location line="-24"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Quantidade inválida para -paytxfee=&lt;quantidade&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+44"/> <source>Error: could not start node</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sending...</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Invalid amount</source> <translation>Quantidade inválida</translation> </message> <message> <location line="+1"/> <source>Insufficient funds</source> <translation>Saldo insuficiente</translation> </message> <message> <location line="-34"/> <source>Loading block index...</source> <translation>Carregando índice de blocos...</translation> </message> <message> <location line="-103"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Adicionar um nó com o qual se conectar e tentar manter a conexão ativa</translation> </message> <message> <location line="+122"/> <source>Unable to bind to %s on this computer. Bithire is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-97"/> <source>Fee per KB to add to transactions you send</source> <translation type="unfinished"/> </message> <message> <location line="+55"/> <source>Invalid amount for -mininput=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Loading wallet...</source> <translation>Carregando carteira...</translation> </message> <message> <location line="+8"/> <source>Cannot downgrade wallet</source> <translation>Não é possível fazer downgrade da carteira</translation> </message> <message> <location line="+1"/> <source>Cannot initialize keypool</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot write default address</source> <translation>Não foi possível escrever no endereço padrão</translation> </message> <message> <location line="+1"/> <source>Rescanning...</source> <translation>Re-escaneando...</translation> </message> <message> <location line="+5"/> <source>Done loading</source> <translation>Carregamento terminado</translation> </message> <message> <location line="-167"/> <source>To use the %s option</source> <translation>Para usar a opção %s</translation> </message> <message> <location line="+14"/> <source>Error</source> <translation>Erro</translation> </message> <message> <location line="+6"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>Você precisa especificar rpcpassword=&lt;senha&gt; no arquivo de configurações:⏎ %s⏎ Se o arquivo não existir, crie um com permissão de leitura apenas pelo dono</translation> </message> </context> </TS>
{ "content_hash": "f867828ef1cf6614534a04dc114a8ba4", "timestamp": "", "source": "github", "line_count": 3285, "max_line_length": 394, "avg_line_length": 36.56103500761035, "alnum_prop": 0.6135483709815741, "repo_name": "Bithire/Bithire", "id": "4801fa764da4cf05b91b8e99a70eb32a234515cd", "size": "120580", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/qt/locale/bitcoin_pt_BR.ts", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "51291" }, { "name": "C", "bytes": "34941" }, { "name": "C++", "bytes": "2659301" }, { "name": "CSS", "bytes": "1127" }, { "name": "HTML", "bytes": "50620" }, { "name": "Makefile", "bytes": "11388" }, { "name": "Objective-C", "bytes": "858" }, { "name": "Objective-C++", "bytes": "5844" }, { "name": "Python", "bytes": "3776" }, { "name": "QMake", "bytes": "13651" }, { "name": "Shell", "bytes": "8626" } ], "symlink_target": "" }
// <copyright file="IccParametricCurveTagDataEntry.cs" company="James Jackson-South"> // Copyright (c) James Jackson-South and contributors. // Licensed under the Apache License, Version 2.0. // </copyright> namespace ImageSharp { using System; /// <summary> /// The parametricCurveType describes a one-dimensional curve by /// specifying one of a predefined set of functions using the parameters. /// </summary> internal sealed class IccParametricCurveTagDataEntry : IccTagDataEntry, IEquatable<IccParametricCurveTagDataEntry> { /// <summary> /// Initializes a new instance of the <see cref="IccParametricCurveTagDataEntry"/> class. /// </summary> /// <param name="curve">The Curve</param> public IccParametricCurveTagDataEntry(IccParametricCurve curve) : this(curve, IccProfileTag.Unknown) { } /// <summary> /// Initializes a new instance of the <see cref="IccParametricCurveTagDataEntry"/> class. /// </summary> /// <param name="curve">The Curve</param> /// <param name="tagSignature">Tag Signature</param> public IccParametricCurveTagDataEntry(IccParametricCurve curve, IccProfileTag tagSignature) : base(IccTypeSignature.ParametricCurve, tagSignature) { this.Curve = curve; } /// <summary> /// Gets the Curve /// </summary> public IccParametricCurve Curve { get; } /// <inheritdoc/> public override bool Equals(IccTagDataEntry other) { var entry = other as IccParametricCurveTagDataEntry; return entry != null && this.Equals(entry); } /// <inheritdoc/> public bool Equals(IccParametricCurveTagDataEntry other) { if (ReferenceEquals(null, other)) { return false; } if (ReferenceEquals(this, other)) { return true; } return base.Equals(other) && this.Curve.Equals(other.Curve); } /// <inheritdoc/> public override bool Equals(object obj) { if (ReferenceEquals(null, obj)) { return false; } if (ReferenceEquals(this, obj)) { return true; } return obj is IccParametricCurveTagDataEntry && this.Equals((IccParametricCurveTagDataEntry)obj); } /// <inheritdoc /> public override int GetHashCode() { unchecked { return (base.GetHashCode() * 397) ^ (this.Curve != null ? this.Curve.GetHashCode() : 0); } } } }
{ "content_hash": "cf83f67baa26196f0522c4f4bee46f58", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 118, "avg_line_length": 31.179775280898877, "alnum_prop": 0.5686486486486486, "repo_name": "KelsonBall/KoreUI", "id": "4264c0b24da0129e6f547275916d3259f8b4f76c", "size": "2777", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/ImageSharp/ImageSharp/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccParametricCurveTagDataEntry.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "2941643" } ], "symlink_target": "" }
<?php declare(strict_types=1); namespace App\Entity; use App\Entity\Interfaces\SongInterface; use InvalidArgumentException; use NowPlaying\Result\CurrentSong; class Song implements SongInterface { use Traits\HasSongFields; public function __construct(?SongInterface $song = null) { if (null !== $song) { $this->setSong($song); } } public function __toString(): string { return 'Song ' . $this->song_id . ': ' . $this->artist . ' - ' . $this->title; } public static function getSongHash(Song|array|string|CurrentSong $songText): string { // Handle various input types. if ($songText instanceof self) { return self::getSongHash($songText->getText() ?? ''); } if ($songText instanceof CurrentSong) { return self::getSongHash($songText->text); } if (is_array($songText)) { return self::getSongHash($songText['text'] ?? ''); } if (!is_string($songText)) { throw new InvalidArgumentException( sprintf( '$songText parameter must be a string, array, or instance of %s or %s.', self::class, CurrentSong::class ) ); } $song_text = mb_substr($songText, 0, 150, 'UTF-8'); // Strip out characters that are likely to not be properly translated or relayed through the radio. $removeChars = [ ' ', '-', '"', '\'', "\n", "\t", "\r", ]; $song_text = str_replace($removeChars, '', $song_text); $hash_base = mb_strtolower($song_text, 'UTF-8'); return md5($hash_base); } public static function createFromApiSong(Api\Song $apiSong): self { $song = new self(); $song->setText($apiSong->text); $song->setTitle($apiSong->title); $song->setArtist($apiSong->artist); $song->updateSongId(); return $song; } public static function createFromNowPlayingSong(CurrentSong $currentSong): self { $song = new self(); $song->setText($currentSong->text); $song->setTitle($currentSong->title); $song->setArtist($currentSong->artist); $song->updateSongId(); return $song; } public static function createFromArray(array $songRow): self { $currentSong = new CurrentSong( $songRow['text'] ?? '', $songRow['title'] ?? '', $songRow['artist'] ?? '' ); return self::createFromNowPlayingSong($currentSong); } public static function createFromText(string $songText): self { $currentSong = new CurrentSong($songText); return self::createFromNowPlayingSong($currentSong); } public static function createOffline(): self { return self::createFromText('Stream Offline'); } }
{ "content_hash": "233545509a18744724a6e738dcdbfbe7", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 107, "avg_line_length": 27.207207207207208, "alnum_prop": 0.5466887417218543, "repo_name": "SlvrEagle23/AzuraCast", "id": "61aa0a556152446d36414ec96caa5a4fb4475c30", "size": "3020", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "src/Entity/Song.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "API Blueprint", "bytes": "13837" }, { "name": "ApacheConf", "bytes": "953" }, { "name": "CSS", "bytes": "299004" }, { "name": "HTML", "bytes": "123139" }, { "name": "JavaScript", "bytes": "60197" }, { "name": "PHP", "bytes": "680134" }, { "name": "Python", "bytes": "8476" }, { "name": "Shell", "bytes": "3547" } ], "symlink_target": "" }
<?php /* * This file is part of the takatost/wechat_open_platform. * * (c) takatost <takatost@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace WechatOP\OpenPlatform; use EasyWeChat\Core\AbstractAPI; class OpenPlatform extends AbstractAPI { const API_GET_COMPONENT_ACCESS_TOKEN = "https://api.weixin.qq.com/cgi-bin/component/api_component_token"; const API_GET_COMPONENT_PRE_AUTHCODE = "https://api.weixin.qq.com/cgi-bin/component/api_create_preauthcode"; const API_GET_AUTHORIZER_AUTH_INFO = "https://api.weixin.qq.com/cgi-bin/component/api_query_auth"; const API_GET_AUTHORIZER_BASE_INFO = "https://api.weixin.qq.com/cgi-bin/component/api_get_authorizer_info"; const API_GET_AUTHORIZER_ACCESSTOKEN = "https://api.weixin.qq.com/cgi-bin/component/api_authorizer_token"; const API_GET_AUTHORIZER_SETTING = "https://api.weixin.qq.com/cgi-bin/component/api_get_authorizer_option"; const API_SET_AUTHORIZER_SETTING = "https://api.weixin.qq.com/cgi-bin/component/api_set_authorizer_option"; /** * 获取第三方平台预授权码 * @return \EasyWeChat\Support\Collection */ public function getPreAuthCode() { $body = $this->parseJSON('json', [ self::API_GET_COMPONENT_PRE_AUTHCODE, [ 'component_appid' => $this->getAccessToken()->getAppId() ] ]); //处理内容,返回预授权码 return $body; } /** * 使用第三方平台预授权码换取公众号的授权信息 * @param $code * @return \EasyWeChat\Support\Collection */ public function getAuthorizerAuthInfo($code) { $body = $this->parseJSON('json', [ self::API_GET_AUTHORIZER_AUTH_INFO, [ 'component_appid' => $this->getAccessToken()->getAppId(), 'authorization_code' => $code, ] ]); return $body; } /** * 获取授权方的账户信息 * @param $authorizerAppId * @return \EasyWeChat\Support\Collection */ public function getAuthorizerBaseInfo($authorizerAppId) { $body = $this->parseJSON('json', [ self::API_GET_AUTHORIZER_BASE_INFO, [ 'component_appid' => $this->getAccessToken()->getAppId(), 'authorizer_appid' => $authorizerAppId, ] ]); return $body; } /** * 根据刷新令牌获取最新 OAuthToken * @param $authorizerAppId * @param $refreshToken * @return \EasyWeChat\Support\Collection */ public function getTokenByRefreshToken($authorizerAppId, $refreshToken) { $body = $this->parseJSON('json', [ self::API_GET_AUTHORIZER_ACCESSTOKEN, [ 'component_appid' => $this->getAccessToken()->getAppId(), 'authorizer_appid' => $authorizerAppId, 'authorizer_refresh_token' => $refreshToken ] ]); return $body; } /** * 获取授权方的选项设置信息 * @param $authorizerAppId * @param $optionName * @return \EasyWeChat\Support\Collection */ public function getAuthorizerSetting($authorizerAppId, $key) { $body = $this->parseJSON('json', [ self::API_GET_AUTHORIZER_SETTING, [ 'component_appid' => $this->getAccessToken()->getAppId(), 'authorizer_appid' => $authorizerAppId, 'option_name' => $key ] ]); return $body; } /** * 设置授权方的选项信息 * @param $authorizerAppId * @param $key * @param $value * @return \EasyWeChat\Support\Collection */ public function setAuthorizerSetting($authorizerAppId, $key, $value) { $body = $this->parseJSON('json', [ self::API_SET_AUTHORIZER_SETTING, [ 'component_appid' => $this->getAccessToken()->getAppId(), 'authorizer_appid' => $authorizerAppId, 'option_name' => $key, 'option_value' => $value ] ]); return $body; } }
{ "content_hash": "7433a69a8136563afdca44471802743d", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 115, "avg_line_length": 30.06474820143885, "alnum_prop": 0.5649676956209619, "repo_name": "takatost/wechat_open_platform", "id": "c798d695a91198547bf033abb143c79515d4f2e0", "size": "4349", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/OpenPlatform/OpenPlatform.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "52363" } ], "symlink_target": "" }
import React from 'react'; import cachedFetch from './cached-fetch'; export default class Comments extends React.Component { componentWillMount() { this.update(this.props); } componentWillReceiveProps(nextProps) { this.update(nextProps); } update(props) { const url = `/api/2.2/questions/${props.question}/comments?order=desc&sort=creation&site=stackoverflow&filter=!6JW86p(KK2A)N`; cachedFetch(url).use(data => { this.setState({ data }); }); } render() { const { data } = this.state || {}; return ( <div className="comments"> {data && data.items.map(item => ( <article className="comment" key={item.comment_id}> <div dangerouslySetInnerHTML={{ __html: item.body }} /> <h5 className="author"> <img src={item.owner.profile_image} /> {item.owner.display_name} </h5> <time>{new Date(item.creation_date).toLocaleDateString()}</time> </article> ))} </div> ); } }
{ "content_hash": "837261b81f68ac008cb9fdf22132dc05", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 128, "avg_line_length": 23.85, "alnum_prop": 0.6362683438155137, "repo_name": "GoogleChromeLabs/progressive-rendering-frameworks-samples", "id": "f5caf981aff9ae9158984a99685c3cef0182e1fb", "size": "1548", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "react-ssr-data/app/comments.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "3326" }, { "name": "JavaScript", "bytes": "3607" } ], "symlink_target": "" }
<Record> <Term>Sulfamethizole</Term> <SemanticType>Pharmacologic Substance</SemanticType> <SemanticType>Organic Chemical</SemanticType> <PrimarySemanticType>Pharmacologic Substance</PrimarySemanticType> <Synonym>Microsul</Synonym> <Synonym>Thiosulfil</Synonym> <Synonym>Proklar</Synonym> <Source>FDA Registry</Source> </Record>
{ "content_hash": "6efc8abc1484abec903786d403f1ea2d", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 66, "avg_line_length": 33.8, "alnum_prop": 0.7958579881656804, "repo_name": "detnavillus/modular-informatic-designs", "id": "c0dd92d739a81c1bea9701d207b87c5014555ef9", "size": "338", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pipeline/src/test/resources/thesaurus/fdarecords/sulfamethizole.xml", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "2069134" } ], "symlink_target": "" }
import { storiesOf } from '@storybook/html' storiesOf('update()', module).add( 'multiple options', () => ` <img src="image-2.jpg"> <div> <button id="update">Update options</button> </div> <script> const zoom = mediumZoom('img'); const button = document.querySelector('#update'); button.addEventListener('click', () => zoom.update({ margin: 100, background: 'yellow', scrollOffset: 0, })); </script> `, { notes: { markdown: `Click on the button the update the options and zoom again.`, }, } )
{ "content_hash": "aba4e72172c9042c9e290457e6f90abe", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 77, "avg_line_length": 21.214285714285715, "alnum_prop": 0.5589225589225589, "repo_name": "francoischalifour/medium-zoom", "id": "efc47af26b6205687e691492227f0a2505b210f5", "size": "594", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "stories/update.stories.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "6251" }, { "name": "HTML", "bytes": "6630" }, { "name": "JavaScript", "bytes": "97605" }, { "name": "Shell", "bytes": "227" } ], "symlink_target": "" }
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class Asset_Status_By_Period extends MY_Controller { public $path = "asset status by period"; function index() { $this->_view($this->path); } function detail($hash_id) { $this->_view($this->path.'/detail'); } function insert() { $this->_view($this->path.'/insert'); } function do_insert() { // } function update($hash_id) { $this->_view($this->path.'/update'); } function do_update() { // } function delete($hash_id) { // } }
{ "content_hash": "e25454b6c439ddb8d031876cbb7833a1", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 72, "avg_line_length": 16.2, "alnum_prop": 0.5714285714285714, "repo_name": "dannyerry/dannyerry.github.io", "id": "1c9eae9d20a8891900f89878771ea62b24a81375", "size": "567", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "application/controllers/asset/asset_status_by_period.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "247" }, { "name": "CSS", "bytes": "14680" }, { "name": "HTML", "bytes": "8223335" }, { "name": "JavaScript", "bytes": "56182" }, { "name": "PHP", "bytes": "687242" } ], "symlink_target": "" }
[![NPM version](https://badge.fury.io/js/artnet.svg)](http://badge.fury.io/js/artnet) This is a [Node.js](http://nodejs.org) module that can be used to send ArtDMX packages to an [Art-Net](http://en.wikipedia.org/wiki/Art-Net) node. ## Usage connect, set channel 1 to 255, disconnect. ```javascript var options = { host: '172.16.23.15' } var artnet = require('artnet')(options); // set channel 1 to 255 and disconnect afterwards. artnet.set(1, 255, function (err, res) { artnet.close(); }); ``` The set method can set multiple channels at once: Use an array to set subsequent channels... ```javascript // set channel 100 to 10, channel 101 to 20 and channel 102 to 30 artnet.set(100, [10, 20, 30]); ``` ...if you want to keep certain channels unchanged set them to null ```javascript // set channel 50 to 255 and channel 52 to 127 artnet.set(50, [255, null, 127]); ``` you can omit the channel, it defaults to 1 ```javascript // Set channel 1 to 255 and channel 2 to 127: artnet.set([255, 127]); ``` This lib throttles the maximum send rate to ~40Hz. Unchanged data is refreshed every ~4s. ## Options * host (Default ```"255.255.255.255"```) * port (Default ```6454```) * refresh (millisecond interval for sending unchanged data to the Art-Net node. Default ```4000```) * iface (optional string IP address - bind udp socket to specific network interface) ## Methods #### **set(** [ [ *uint15* **universe** , ] *uint9* **channel** , ] *uint8* **value** [ , *function(err, res)* **callback** ] **)** #### **set(** [ [ *uint15* **universe** , ] *uint9* **channel** , ] *array[uint8]* **values** [ , *function(err, res)* **callback** ] **)** Every parameter except the value(s) is optional. If you supply a universe you need to supply the channel also. Defaults: universe = 0, channel = 1 Callback is called with (error, response) params. If error and response are null data remained unchanged and therefore nothing has been sent. #### **close( )** Closes the connection and stops the send interval. # Further Reading * [Art-Net protocol specification](http://www.artisticlicence.com/WebSiteMaster/User%20Guides/art-net.pdf) # License The MIT License (MIT) Copyright (c) 2014, 2015 hobbyquaker 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. ## Credits Art-Net™ Designed by and Copyright [Artistic Licence Holdings Ltd](http://www.artisticlicence.com/).
{ "content_hash": "c890bf6cfab6d8d6f3c0fcff80a24942", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 146, "avg_line_length": 33.73, "alnum_prop": 0.7210198636228876, "repo_name": "johngingersoftwire/dmx", "id": "6c98d29362186c058fd1a8555b80f20175cef3df", "size": "3385", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "node_modules/artnet/README.md", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "5811" }, { "name": "JavaScript", "bytes": "6372" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <title>kmagine test</title> <meta name="viewport" content="width=640px, user-scalable=0" /> <script src="lib/jquery.min.js"></script> <script src="sample1.kscene"></script> <script src="../../kmagine.js"></script> <script src="main.js"></script> <style> *{ -webkit-touch-callout:none; -webkit-user-select:none; } </style> </head> <body> <div class=kmagine style="left:50%;top:0px;margin:0 0 0 -320px;width:640px;height:960px;position:absolute;overflow:hidden;background-color:#555;"> </div> </body> </html>
{ "content_hash": "09d5fa1916bc94419330f3f1fd003d41", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 146, "avg_line_length": 24.846153846153847, "alnum_prop": 0.6114551083591331, "repo_name": "mofukuma/kmagine.js", "id": "cf1f9eb290118c6c773067f4c33212f32dbfcfc9", "size": "646", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sample/test/index.html", "mode": "33188", "license": "mit", "language": [ { "name": "ActionScript", "bytes": "4602" }, { "name": "CSS", "bytes": "18190" }, { "name": "HTML", "bytes": "486200" }, { "name": "JavaScript", "bytes": "177010" }, { "name": "Objective-C", "bytes": "37477" } ], "symlink_target": "" }
package rtdc.core.model; import rtdc.core.exception.ValidationException; import rtdc.core.i18n.ResBundle; import rtdc.core.json.JSONObject; import rtdc.core.util.Stringifier; import java.util.Date; public class Action extends RootObject{ public enum Properties implements ObjectProperty<Action> { id, unit, status, personResponsible, roleResponsible, task, target, deadline, description, lastUpdate; } public enum Status { notStarted, inProgress, completed, failed; public static Stringifier<Status> getStringifier(){ return new Stringifier<Status>() { @Override public String toString(Action.Status status) { switch(status){ case completed: return ResBundle.get().completed(); case failed: return ResBundle.get().failed(); case inProgress: return ResBundle.get().inProgress(); case notStarted: return ResBundle.get().notStarted(); default: return status.name(); } } }; } } public enum Task { pushForDischarge, offServicingTo, holdFor; public static Stringifier<Task> getStringifier(){ return new Stringifier<Task>() { @Override public String toString(Task task) { switch(task){ case holdFor: return ResBundle.get().hold(); case offServicingTo: return ResBundle.get().offServicing(); case pushForDischarge: return ResBundle.get().pushForDischarge(); default: return task.name(); } } }; } } private int id; private Unit unit; private Status status; // Can never be null private User personResponsible; private String roleResponsible; private Task task; // This is the title private String target; private Date deadline; private String description; private Date lastUpdate; public Action(){} public Action(JSONObject object) { setId(object.optInt(Properties.id.name())); setUnit(new Unit(object.getJSONObject(Properties.unit.name()))); status = Status.valueOf(object.optString(Properties.status.name())); if(object.has(Properties.personResponsible.name())) setPersonResponsible(new User(object.getJSONObject(Properties.personResponsible.name()))); setRoleResponsible(object.optString(Properties.roleResponsible.name())); task = Task.valueOf(object.optString(Properties.task.name())); if(object.has(Properties.deadline.name())) setDeadline(new Date(object.getLong(Properties.deadline.name()))); setTarget(object.optString(Properties.target.name())); setDescription(object.optString(Properties.description.name())); setLastUpdate(new Date(object.getLong(Properties.lastUpdate.name()))); } @Override public ObjectProperty[] getProperties() { return Properties.values(); } @Override public String getType() { return "action"; } @Override public Object getValue(ObjectProperty property) { switch((Properties) property){ case id: return getId(); case unit: return getUnit(); case status: return getStatus(); case personResponsible: return getPersonResponsible(); case roleResponsible: return getRoleResponsible(); case task: return getTask(); case target: return getTarget(); case deadline: return getDeadline(); case description: return getDescription(); case lastUpdate: return getLastUpdate(); } return null; } public int getId() { return id; } public void setId(int id) { this.id = id; } public Unit getUnit() { return unit; } public void setUnit(Unit unit) { this.unit = unit; } public Status getStatus() { return status; } public void setStatus(Status status) { this.status = status; } public User getPersonResponsible() { return personResponsible; } public void setPersonResponsible(User personResponsible) { this.personResponsible = personResponsible; } public String getRoleResponsible() { return roleResponsible; } public void setRoleResponsible(String roleResponsible) { this.roleResponsible = roleResponsible; } public Task getTask() { return task; } public void setTask(Task task) { this.task = task; } public String getTarget() { return target; } public void setTarget(String target) { this.target = target; } public Date getDeadline() { return deadline; } public void setDeadline(Date deadline) { this.deadline = deadline; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public Date getLastUpdate(){ return lastUpdate; } public void setLastUpdate(Date lastUpdate){ this.lastUpdate = lastUpdate; } }
{ "content_hash": "4c0d7bed3d8c4064c4d8232efc251474", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 102, "avg_line_length": 26.926829268292682, "alnum_prop": 0.5938405797101449, "repo_name": "Bathlamos/RTDC", "id": "ae36e2e719c77913f2450d3a894116ec8ce17e5e", "size": "6743", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "core/src/main/java/rtdc/core/model/Action.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "184" }, { "name": "HTML", "bytes": "1239" }, { "name": "Java", "bytes": "836404" }, { "name": "Objective-C", "bytes": "557782" }, { "name": "Swift", "bytes": "17297" } ], "symlink_target": "" }
layout: page title: Tone Alpha Electronics Executive Retreat date: 2016-05-24 author: Nathan Leonard tags: weekly links, java status: published summary: Maecenas in nibh id massa tempus. banner: images/banner/people.jpg booking: startDate: 04/17/2016 endDate: 04/22/2016 ctyhocn: ORFSFHX groupCode: TAEER published: true --- Integer laoreet augue et nulla facilisis, in egestas tellus auctor. Ut rutrum turpis ac mi varius convallis. Nulla facilisi. Quisque mollis lacus metus, ut ultrices odio laoreet sit amet. Vestibulum suscipit sed eros vel placerat. Ut ultrices laoreet leo, in tempor augue consectetur at. Pellentesque volutpat, lectus et efficitur blandit, neque sem eleifend leo, vel consectetur tellus tortor ac augue. Morbi aliquam libero sem, in hendrerit ex tempus at. Integer vel orci eget diam condimentum feugiat. * Vestibulum condimentum ipsum ut ante finibus, euismod laoreet urna commodo * Donec eget tortor ut ligula porttitor lobortis * Quisque tristique sem finibus ipsum tempor elementum * Vestibulum pellentesque sem a turpis facilisis, eget finibus nunc dapibus. Nunc a facilisis neque. Fusce diam nulla, feugiat ut libero ut, finibus volutpat enim. Donec sit amet tristique tortor. Praesent non elit erat. Maecenas et eros sed ante lobortis tristique. Nam sed neque turpis. Praesent eu erat quis dui pellentesque interdum sed nec mauris. Maecenas quis mattis mauris, eget rutrum mauris. Vestibulum suscipit dictum magna, quis ultrices dui ultrices id. Fusce velit tellus, interdum ac orci eget, egestas molestie ligula. Curabitur imperdiet laoreet arcu eget lobortis. In elit enim, mattis ac libero at, dapibus ornare lacus. Sed dignissim pretium nunc tempor pharetra. Nullam consectetur ante eget laoreet feugiat. Sed varius quam id auctor aliquet. Morbi rutrum erat at augue pharetra, non sollicitudin felis rutrum. Etiam dictum arcu felis, at pretium sapien consectetur eget. Etiam lobortis augue non vehicula convallis. Donec vel lorem iaculis, venenatis libero non, feugiat augue.
{ "content_hash": "c9b8e85ead77d5881ea882a0308099c7", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 647, "avg_line_length": 84.25, "alnum_prop": 0.8100890207715133, "repo_name": "KlishGroup/prose-pogs", "id": "c9d2a2b353345b421d0289b9a8cabed6ea7ef463", "size": "2026", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "pogs/O/ORFSFHX/TAEER/index.md", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
package flynn.tim.ciphersolver; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; import android.view.Menu; import android.view.View; import android.view.inputmethod.InputMethodManager; import android.widget.Button; import android.widget.EditText; import com.github.mikephil.charting.animation.Easing; import com.github.mikephil.charting.charts.BarChart; import com.github.mikephil.charting.components.Legend; import com.github.mikephil.charting.components.XAxis; import com.github.mikephil.charting.components.YAxis; import com.github.mikephil.charting.data.BarData; import com.github.mikephil.charting.data.BarDataSet; import com.github.mikephil.charting.data.BarEntry; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; public class FrequencyActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_frequency); final FrequencyAnalysis fa = new FrequencyAnalysis(); final BarChart chart = (BarChart) findViewById(R.id.chart); final EditText userString = (android.widget.EditText) findViewById(R.id.editText5); final Button button2 = (Button) findViewById(R.id.button4); button2.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { InputMethodManager inputManager = (InputMethodManager) getSystemService(FrequencyActivity.this.INPUT_METHOD_SERVICE); inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); Legend legend = chart.getLegend(); legend.setEnabled(false); chart.setDescription(""); chart.setScaleYEnabled(false); chart.setDoubleTapToZoomEnabled(false); chart.setDrawHighlightArrow(true); chart.animateY(1000, Easing.EasingOption.Linear); YAxis leftAxis = chart.getAxisLeft(); leftAxis.setEnabled(false); YAxis rightAxis = chart.getAxisRight(); rightAxis.setEnabled(false); HashMap<Character,Integer> map = fa.analyze(userString.getText().toString().toUpperCase()); XAxis xaxis = chart.getXAxis(); xaxis.setLabelsToSkip(0); xaxis.setAvoidFirstLastClipping(true); xaxis.setSpaceBetweenLabels(10); List<BarEntry> entryList = new ArrayList<BarEntry>(); ArrayList<String> xVals = new ArrayList<String>(); Iterator it = map.entrySet().iterator(); int x = 0; while (it.hasNext()) { Map.Entry pair = (Map.Entry)it.next(); if(pair.getKey().toString().equals(" ")) { //xVals.add("{space}"); } else{ xVals.add(pair.getKey().toString()); BarEntry e = new BarEntry(Float.parseFloat(pair.getValue().toString()), x); entryList.add(e); x = x + 1; } it.remove(); // avoids a ConcurrentModificationException } //Create FrequencyPair list for alphabetical sorting List<FrequencyPair> fplist = new ArrayList<FrequencyPair>(); for(int i = 0; i < xVals.size(); i++) { fplist.add(new FrequencyPair(xVals.get(i), Math.round(entryList.get(i).getVal()))); } Collections.sort(fplist, new Comparator<FrequencyPair>() { @Override public int compare(FrequencyPair lhs, FrequencyPair rhs) { return lhs.getCharacter().compareTo(rhs.getCharacter()); } }); //Sorted lists List<String> alphaXVals = new ArrayList<String>(); List<BarEntry> alphaEntryList = new ArrayList<BarEntry>(); //Iterate and populate sorted lists for(int j = 0; j < fplist.size(); j++) { alphaXVals.add(fplist.get(j).getCharacter()); alphaEntryList.add(new BarEntry(fplist.get(j).getValue(),j)); } //Create BarDataSet using sorted list BarDataSet lds = new BarDataSet(alphaEntryList, "Frequency"); lds.setColors(new int[] {R.color.accent_material_light}, getApplicationContext()); BarData data = new BarData(alphaXVals, lds); //Set data to the chart chart.setData(data); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. //getMenuInflater().inflate(R.menu.menu_main, menu); return true; } }
{ "content_hash": "5c94d96df60d6e7e51bb36498ff0710e", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 107, "avg_line_length": 41.53543307086614, "alnum_prop": 0.5909004739336493, "repo_name": "tflynn93/CipherSolver", "id": "8af1fe17918ce1fab1e0bbc3b0c2fc27cb8d26f8", "size": "5275", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/flynn/tim/ciphersolver/FrequencyActivity.java", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "1514" }, { "name": "Java", "bytes": "52094" } ], "symlink_target": "" }
.class Lcom/android/server/PowerManagerService$2; .super Landroid/content/BroadcastReceiver; .source "PowerManagerService.java" # annotations .annotation system Ldalvik/annotation/EnclosingMethod; value = Lcom/android/server/PowerManagerService;->initInThread()V .end annotation .annotation system Ldalvik/annotation/InnerClass; accessFlags = 0x0 name = null .end annotation # instance fields .field final synthetic this$0:Lcom/android/server/PowerManagerService; # direct methods .method constructor <init>(Lcom/android/server/PowerManagerService;)V .locals 0 .parameter .prologue .line 889 iput-object p1, p0, Lcom/android/server/PowerManagerService$2;->this$0:Lcom/android/server/PowerManagerService; invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V return-void .end method # virtual methods .method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V .locals 2 .parameter "context" .parameter "intent" .prologue .line 892 iget-object v0, p0, Lcom/android/server/PowerManagerService$2;->this$0:Lcom/android/server/PowerManagerService; #getter for: Lcom/android/server/PowerManagerService;->mLocks:Lcom/android/server/PowerManagerService$LockList; invoke-static {v0}, Lcom/android/server/PowerManagerService;->access$500(Lcom/android/server/PowerManagerService;)Lcom/android/server/PowerManagerService$LockList; move-result-object v1 monitor-enter v1 .line 893 :try_start_0 iget-object v0, p0, Lcom/android/server/PowerManagerService$2;->this$0:Lcom/android/server/PowerManagerService; #calls: Lcom/android/server/PowerManagerService;->forceUserActivityLocked()V invoke-static {v0}, Lcom/android/server/PowerManagerService;->access$1800(Lcom/android/server/PowerManagerService;)V .line 894 monitor-exit v1 .line 895 return-void .line 894 :catchall_0 move-exception v0 monitor-exit v1 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 throw v0 .end method
{ "content_hash": "781d5d8589db191a097679459ae52921", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 167, "avg_line_length": 27.613333333333333, "alnum_prop": 0.7469821342346692, "repo_name": "baidurom/devices-g520", "id": "9e2aa29c4487f3883086332ba3d24d95865aff47", "size": "2071", "binary": false, "copies": "2", "ref": "refs/heads/coron-4.1", "path": "vendor/aosp/services.jar.out/smali/com/android/server/PowerManagerService$2.smali", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Makefile", "bytes": "12575" }, { "name": "Python", "bytes": "1261" }, { "name": "Shell", "bytes": "2159" } ], "symlink_target": "" }
module Bottom where x = undefined y = x `seq` "blah" main = do print (snd (x, y))
{ "content_hash": "5b90c41b0759bfe4bf0f7c299132aaaf", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 20, "avg_line_length": 14.166666666666666, "alnum_prop": 0.611764705882353, "repo_name": "dmvianna/strict", "id": "474479d38a78cd6ca2a79669afbc937dc17779fd", "size": "86", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Bottom.hs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Haskell", "bytes": "14708" } ], "symlink_target": "" }
#pragma once #include <memory> #include <vector> #include <functional> #include "TimePoint.h" namespace Wuild { class TcpEndPointPrivate; class TcpEndPoint { public: TcpEndPoint(); TcpEndPoint(int port, const std::string& host = std::string()); /// Set host and port information. No resolution performed until Resolve() call. void SetPoint(int port, const std::string& host = std::string()); /// Creates internal data for host and port. If resolution already made, true returned. bool Resolve(); /// Outputs host:port as string. std::string GetShortInfo() const; int GetPort() const { return m_port; } const std::string& GetHost() const { return m_host; } const std::string& GetIpString() const { return m_ip; } const TcpEndPointPrivate& GetImpl() const { return *m_impl; } private: std::shared_ptr<TcpEndPointPrivate> m_impl; //!< making possible to copy params. bool m_resolved = false; bool m_errorShown = false; int m_port = 0; std::string m_host; std::string m_ip; }; /// Parameters for tcp connection: client or server. /// Contains information about host, port and timeouts. struct TcpConnectionParams { TimePoint m_readTimeout = 0.0; //!< Scoket read timeout TimePoint m_connectTimeout = 1.0; //!< Connection timeout size_t m_recommendedRecieveBufferSize = 4 * 1024; //!< Buffer size is recommended for socket. If socket has lower size, buffer will be optionally increased (but not ought to) size_t m_recommendedSendBufferSize = 4 * 1024; TcpEndPoint m_endPoint; }; struct TcpListenerParams : public TcpConnectionParams { int m_pendingListenConnections = 128; //!< Maximum pending concurrent connections count bool m_reuseSockets = true; //!< Reuse socket on listen, if possible. Helpful if program terminates and run again shortly. bool m_skipFailedConnection = true; //!< Do not retry recreate listener on fail. std::vector<TcpEndPoint> m_whiteList; //!< This hosts are allowed to connect. If empty, any host is allowed. std::function<void()> m_connectionFailureCallback; bool Resolve(); void AddWhiteListPoint(int port, const std::string& host = std::string()); bool IsAccepted(const std::string& host, std::string& allowed); }; }
{ "content_hash": "2e52489a3ac313efe66db98e622cb435", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 193, "avg_line_length": 42.15873015873016, "alnum_prop": 0.6031626506024096, "repo_name": "mapron/Wuild", "id": "3a96db099a31138508f51b346b6a23c7bed69963", "size": "3316", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Platform/TcpConnectionParams.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "2399" }, { "name": "C++", "bytes": "514903" }, { "name": "CMake", "bytes": "6915" } ], "symlink_target": "" }
Oligowalk_object::Oligowalk_object(const char sequence[]) :RNA(sequence) { CommonConstructor(); } //Constructor - user provides a filename for existing file as a c string. Oligowalk_object::Oligowalk_object(const char filename[], const int type) :RNA(filename, type) { CommonConstructor(); } //Default Constructor - user provides nothing. Oligowalk_object::Oligowalk_object(const bool IsRNA) :RNA(IsRNA) { CommonConstructor(); } //Perform an OligoWalk calculation //usesub = 0 -> no suboptimal; 3 -> heuristic int Oligowalk_object::Oligowalk(const int oligo_length, const bool isDNA, const int option, const double oligo_concentration, const int usesub, const int start, const int stop ) { datatable *enthalpy; thermo *helixstack; int test=-1; char stackf[maxfil],datapath[maxfil]; int error; datatable *dnadata; //use a character array to turn off SHAPE: char shapefile='\0'; int i,j,k,l; Thermodynamics *ddata; rddata *hybriddata,*enthalpyhybrid; char *pointer; //Make sure this is the first (and only allowed call of OligoWalk) if (table!=NULL) return 101; length = oligo_length;//save oligo_length for use in the destructor and for error checking later if (!energyread) { //The thermodynamic data tables have not been read and need to be read now. if (ReadThermodynamic()!=0) return 5;//return non-zero if a problem occurs } //Read the enthalpy data from disk using the underlying thermodynamics class GetEnthalpyData function: enthalpy = GetEnthalpyTable(); //make sure that the thermodynamics parameters could be read from disk if (enthalpy==NULL) { return 5;//5 is the error code that indicates the thermodynamic parameters were not found } //Although prefiltering isn't used in this version of OligoWalk, it needs to be initialized and passed to function. //Note that the true indicates that empirical scores would be used a prefilter = new siPREFILTER(*GetDatatable(),*enthalpy,0,true,GetStructure()->GetSequenceLength() - oligo_length + 2,isDNA); //Allocate the tables needed for storing the results table = new int*[GetStructure()->GetSequenceLength() - oligo_length + 2]; for (i = 0; i < GetStructure()->GetSequenceLength() - oligo_length + 2; i++) { //DHM commented out these lines for now. They need to be restored later. //if (siRNA) table[i] = new int[7]; //else table[i] = new int[6]; table[i] = new int[6]; } //allocate memory of number of suboptimal structures numofsubstructures= new int*[GetStructure()->GetSequenceLength() - oligo_length +2]; for (i = 0; i < GetStructure()->GetSequenceLength() - oligo_length + 2; i++) { numofsubstructures[i]= new int [2]; numofsubstructures[i][0]=0; numofsubstructures[i][1]=0; } //Get the path information for location of data files from $DATAPATH, if available pointer = getenv("DATAPATH"); if (pointer!=NULL) { strcpy(datapath,pointer); strcat(datapath,"/"); } else strcpy(datapath,""); //Allocate helixstack: helixstack = new thermo(pointer); //Now read the DNA parameters if the oligos are DNA: if (isDNA) { ddata = new Thermodynamics(false);//allocate space for DNA parameters //set the temperature for the DNA parameters error = ddata->SetTemperature(GetTemperature()); //Check fo an error if (error!=0) { delete ddata; delete prefilter; delete helixstack; return error; } //Read the dna thermodynamic parameters error = ddata->ReadThermodynamic(); //Check fo an error if (error!=0) { delete ddata; delete prefilter; delete helixstack; return error; } //Read the hybrid data as well hybriddata = new rddata; strcpy(stackf,datapath); strcat (stackf,"stackdr.dat"); //Check for errors if (readrd (hybriddata,stackf)==0) { delete ddata; delete prefilter; delete helixstack; return 5; } if (GetTemperature()<310||GetTemperature()>311) { //The temperature is simgificantly different from 37 dgrees C, so read and use the enthalpy data. strcpy(stackf,datapath); //strcat(stackf,"/"); strcat (stackf,"stackdr.dh"); enthalpyhybrid = new rddata; //Check for errors if (readrd (enthalpyhybrid,stackf)==0) { delete ddata; delete prefilter; delete enthalpyhybrid; delete helixstack; return 5; } for (i=0;i<5;i++) { for (j=0;j<5;j++) { for (k=0;k<5;k++) { for (l=0;l<5;l++) { hybriddata->stack[i][j][k][l]=Tscale(GetTemperature(),hybriddata->stack[i][j][k][l],enthalpyhybrid->stack[i][j][k][l]); } } } } hybriddata->init=Tscale(GetTemperature(),hybriddata->init,enthalpyhybrid->init); delete enthalpyhybrid; } strcpy(helixstack->DH,datapath); //strcat(helixstack->DH,"\\"); strcat(helixstack->DH,"stackdr.dh"); strcpy(helixstack->DS,datapath); //strcat(helixstack->DS,"\\"); strcat(helixstack->DS,"stackdr.ds"); strcpy(helixstack->HELIX,datapath); //strcat(helixstack->HELIX,"\\"); strcat(helixstack->HELIX,"helixdr.dat"); dnadata = ddata->GetDatatable(); } else { dnadata = NULL; } if (helixstack->read()==0) { //This means an error occurred reading the helixstack parameters if (isDNA) delete ddata; delete prefilter; delete helixstack; return 5; } //For now, siRNA is off. //if (siRNA) { // //mask will store whether an oligo meets siRNA design criteria // mask = new bool [ct.numofbases - length + 2]; //} //else mask = NULL; //note that foldsize is temporarilly set to zero so that there is no folding size limit //note that distance is set to zero so that there is no maximum pairping distance //note that test is set to -1 so there is no testing //note that write is set to FALSE to turn off writing olig(isDNA, option, GetStructure(), oligo_length, oligo_concentration, table, numofsubstructures, *GetDatatable(), *dnadata, hybriddata,usesub,GetProgress(),helixstack, start,stop,prefilter, 0, 0, &shapefile,&test,false); //siRNA is off right now //if (oligoobject->siRNA) { // filterbysirna(&oligoobject->ct,oligoobject->table,oligoobject->length,&oligoobject->data,oligoobject->mask,oligoobject->asuf,oligoobject->tofe,oligoobject->fnnfe); //} //note that foldsize is temporarilly set to zero here. //report(oligoobject->outputfile, &oligoobject->ct, oligoobject->table, oligoobject->numofsubstructures, // oligoobject->length, oligoobject->isdna, oligoobject->c, oligoobject->usesub,oligoobject->start,oligoobject->stop,prefilter,0, // oligoobject->mask,oligoobject->asuf,oligoobject->tofe,oligoobject->fnnfe); //Clean up if this is DNA if (isDNA) { delete ddata; } delete helixstack; return 0; } // Get the breaking target DG for a given nucleotide. double Oligowalk_object::GetBreakTargetDG(const int index) { //Perform error checking: if (table==NULL) { //This means that OligoWalk() was not called successfully. ErrorCode = 100; return 0.0; } else if (index<1||index>GetStructure()->GetSequenceLength() - length + 1) { //This means an invalid index is being used ErrorCode = 3; return 0.0; } //note that the free eneergy changes are stored internally as integers, where they are multiplied by conversionfactor return (((double) table[index][2])/conversionfactor); } //Get the duplex DG for a given nucleotide. double Oligowalk_object::GetDuplexDG(const int index) { //Perform error checking: if (table==NULL) { //This means that OligoWalk() was not called successfully. ErrorCode = 100; return 0.0; } else if (index<1||index>GetStructure()->GetSequenceLength() - length + 1) { //This means an invalid index is being used ErrorCode = 3; return 0.0; } //note that the free eneergy changes are stored internally as integers, where they are multiplied by conversionfactor return (((double) table[index][1])/conversionfactor); } // Get the bimolecular oligo-oligo DG for a given nucleotide. double Oligowalk_object::GetOligoOligoDG(const int index) { //Perform error checking: if (table==NULL) { //This means that OligoWalk() was not called successfully. ErrorCode = 100; return 0.0; } else if (index<1||index>GetStructure()->GetSequenceLength() - length + 1) { //This means an invalid index is being used ErrorCode = 3; return 0.0; } //note that the free eneergy changes are stored internally as integers, where they are multiplied by conversionfactor return (((double) table[index][4])/conversionfactor); } //Get the oligo-self DG for a given nucleotide. double Oligowalk_object::GetOligoSelfDG(const int index) { //Perform error checking: if (table==NULL) { //This means that OligoWalk() was not called successfully. ErrorCode = 100; return 0.0; } else if (index<1||index>GetStructure()->GetSequenceLength() - length + 1) { //This means an invalid index is being used ErrorCode = 3; return 0.0; } //note that the free eneergy changes are stored internally as integers, where they are multiplied by conversionfactor return (((double) table[index][3])/conversionfactor); } //Get the overall DG for a given nucleotide. double Oligowalk_object::GetOverallDG(const int index) { //Perform error checking: if (table==NULL) { //This means that OligoWalk() was not called successfully. ErrorCode = 100; return 0.0; } else if (index<1||index>GetStructure()->GetSequenceLength() - length + 1) { //This means an invalid index is being used ErrorCode = 3; return 0.0; } //note that the free eneergy changes are stored internally as integers, where they are multiplied by conversionfactor return (((double) table[index][0])/conversionfactor); } // Get the Tm for a given nucleotide. double Oligowalk_object::GetTm(const int index) { //Perform error checking: if (table==NULL) { //This means that OligoWalk() was not called successfully. ErrorCode = 100; return 0.0; } else if (index<1||index>GetStructure()->GetSequenceLength() - length + 1) { //This means an invalid index is being used ErrorCode = 3; return 0.0; } //note that the Tm is stored as an integer, multiplied by 10. return (((double) table[index][5])/10); } //Write a report to disk using the OligoWalk data. int Oligowalk_object::WriteReport(const char outputfilename[], const int oligo_length, const bool isDNA, const int option, const double oligo_concentration, const int usesub, const int start, const int stop) { //Perform error checking: if (table==NULL) { //This means that OligoWalk() was not called successfully. return 100; } //The last three 0's indicate this is not siRNA design report(outputfilename, GetStructure(), table, numofsubstructures, oligo_length, isDNA, oligo_concentration, usesub,start,stop,prefilter,0, NULL,0,0,0,false); //No errors: return 0; } //Perform an OligoScreen calculation. int Oligowalk_object::OligoScreen(const char infilename[], const char outfilename[]) { rddata *hybriddata,*enthalpyhybrid; char *pointer; char stackf[maxfil]; int i,j,k,l; //Check that the inputfilename exists: FILE *check; //check that the file exists. if ((check = fopen(infilename, "r"))== NULL) { //the file is not found //fclose(check); return 1; } fclose(check); if (!energyread) { //The thermodynamic data tables have not been read and need to be read now. if (ReadThermodynamic()!=0) return 5;//return non-zero if a problem occurs } //Now read the RNA-DNA hybrid parameters, if necessary: if (!isrna) { //This is DNA oligos //Get the information from $DATAPATH, if available pointer = getenv("DATAPATH"); if (pointer!=NULL) { strcpy(stackf,pointer); strcat(stackf,"/"); } else strcpy(stackf,""); strcat(stackf,"stackdr.dat"); //check that the datafile exists: if ((check = fopen(stackf, "r")) == NULL) { return 5; } hybriddata = new rddata; readrd(hybriddata,stackf); if (GetTemperature()<310||GetTemperature()>311) { //The temperature has changed. //Read the enthalpy data into a rddata. //Get the information from $DATAPATH, if available pointer = getenv("DATAPATH"); if (pointer!=NULL) { strcpy(stackf,pointer); strcat(stackf,"/"); } else strcpy(stackf,""); strcat(stackf,"stackdr.dh"); //check that the datafile exists: if ((check = fopen(stackf, "r")) == NULL) { delete hybriddata; return 5; } enthalpyhybrid = new rddata; readrd(enthalpyhybrid,stackf); for (i=0;i<5;i++) { for (j=0;j<5;j++) { for (k=0;k<5;k++) { for (l=0;l<5;l++) { hybriddata->stack[i][j][k][l]=Tscale(GetTemperature(),hybriddata->stack[i][j][k][l],enthalpyhybrid->stack[i][j][k][l]); } } } } delete enthalpyhybrid; } } else { //This is RNA oligos hybriddata= NULL; } //call the backend function OligoScreenCalc(infilename, outfilename, data, hybriddata); //cleanup: if (!isrna) { delete hybriddata; } return 0; } //Return a c string that describes errors from GetErrorCode and other errors. char* Oligowalk_object::GetErrorMessage(const int error) { if (error==100) return "No OligoWalk data present. Perform an OligoWalk calculation first using a call to OligoWalk()\n"; if (error==101) return "OligoWalk has been performed. Only one OligoWalk calculation can be performed.\n"; //Return the base class's message if not recognized as an Oligowalk_object-specific error. else return RNA::GetErrorMessage(error); } //Destructor Oligowalk_object::~Oligowalk_object() { int i; if (table!=NULL) { //Table and numofsubstructures were allocated, so delete them for (i = 0; i < GetStructure()->GetSequenceLength() - length + 2; ++i) { delete[] table[i]; delete[] numofsubstructures[i]; } delete[] table; delete[] numofsubstructures; delete prefilter; } } //Common code for all constructors void Oligowalk_object::CommonConstructor() { table = NULL; numofsubstructures = NULL; }
{ "content_hash": "d3bc7c8dd41a6e3b1e5728a0c181c659", "timestamp": "", "source": "github", "line_count": 546, "max_line_length": 209, "avg_line_length": 25.565934065934066, "alnum_prop": 0.6931728633856293, "repo_name": "mayc2/PseudoKnot_research", "id": "29e38c4576880dab896d3ec439ab2b0d324ad426", "size": "14148", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "RNAstructure_Source/RNA_class/Oligowalk_object.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "810" }, { "name": "C", "bytes": "1499755" }, { "name": "C++", "bytes": "8143115" }, { "name": "CSS", "bytes": "14933" }, { "name": "Cuda", "bytes": "82897" }, { "name": "HTML", "bytes": "2012618" }, { "name": "Java", "bytes": "780775" }, { "name": "Makefile", "bytes": "81242" }, { "name": "Objective-C", "bytes": "27656" }, { "name": "Pascal", "bytes": "2708" }, { "name": "Perl", "bytes": "49578" }, { "name": "PostScript", "bytes": "12445951" }, { "name": "Python", "bytes": "247489" }, { "name": "Shell", "bytes": "313675" } ], "symlink_target": "" }
from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import descriptor_pb2 # @@protoc_insertion_point(imports) import column_pb2 import control_pb2 import query_pb2 DESCRIPTOR = _descriptor.FileDescriptor( name='main.proto', package='', serialized_pb='\n\nmain.proto\x1a\x0c\x63olumn.proto\x1a\rcontrol.proto\x1a\x0bquery.proto\"\xd3\x01\n\x10TransportMessage\x12$\n\x04type\x18\x01 \x02(\x0e\x32\x16.TransportMessage.Type\x12!\n\x0b\x64\x61taMessage\x18\x02 \x01(\x0b\x32\x0c.DataMessage\x12#\n\x0cqueryMessage\x18\x03 \x01(\x0b\x32\r.QueryMessage\x12\'\n\x0e\x63ontrolMessage\x18\x04 \x01(\x0b\x32\x0f.ControlMessage\"(\n\x04Type\x12\x08\n\x04\x44\x41TA\x10\x00\x12\t\n\x05QUERY\x10\x01\x12\x0b\n\x07\x43ONTROL\x10\x02\x42\x35\n#edu.washington.escience.myria.protoB\x0eTransportProto') _TRANSPORTMESSAGE_TYPE = _descriptor.EnumDescriptor( name='Type', full_name='TransportMessage.Type', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='DATA', index=0, number=0, options=None, type=None), _descriptor.EnumValueDescriptor( name='QUERY', index=1, number=1, options=None, type=None), _descriptor.EnumValueDescriptor( name='CONTROL', index=2, number=2, options=None, type=None), ], containing_type=None, options=None, serialized_start=228, serialized_end=268, ) _TRANSPORTMESSAGE = _descriptor.Descriptor( name='TransportMessage', full_name='TransportMessage', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='type', full_name='TransportMessage.type', index=0, number=1, type=14, cpp_type=8, label=2, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( name='dataMessage', full_name='TransportMessage.dataMessage', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( name='queryMessage', full_name='TransportMessage.queryMessage', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( name='controlMessage', full_name='TransportMessage.controlMessage', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), ], extensions=[ ], nested_types=[], enum_types=[ _TRANSPORTMESSAGE_TYPE, ], options=None, is_extendable=False, extension_ranges=[], serialized_start=57, serialized_end=268, ) _TRANSPORTMESSAGE.fields_by_name['type'].enum_type = _TRANSPORTMESSAGE_TYPE _TRANSPORTMESSAGE.fields_by_name['dataMessage'].message_type = column_pb2._DATAMESSAGE _TRANSPORTMESSAGE.fields_by_name['queryMessage'].message_type = query_pb2._QUERYMESSAGE _TRANSPORTMESSAGE.fields_by_name['controlMessage'].message_type = control_pb2._CONTROLMESSAGE _TRANSPORTMESSAGE_TYPE.containing_type = _TRANSPORTMESSAGE; DESCRIPTOR.message_types_by_name['TransportMessage'] = _TRANSPORTMESSAGE class TransportMessage(_message.Message): __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _TRANSPORTMESSAGE # @@protoc_insertion_point(class_scope:TransportMessage) DESCRIPTOR.has_options = True DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), '\n#edu.washington.escience.myria.protoB\016TransportProto') # @@protoc_insertion_point(module_scope)
{ "content_hash": "2c9da3314b457d8297ae31b54d72d09f", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 552, "avg_line_length": 37.171171171171174, "alnum_prop": 0.7297624818225885, "repo_name": "uwescience/myria", "id": "6e170fcede76a5e2dcaa4071bb527eef3337d2fd", "size": "4207", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "protobuf/python/main_pb2.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "D", "bytes": "721" }, { "name": "Java", "bytes": "2767713" }, { "name": "Protocol Buffer", "bytes": "4571" }, { "name": "Python", "bytes": "85775" }, { "name": "Shell", "bytes": "51997" } ], "symlink_target": "" }
%USING_HG2 Determine if the HG2 graphics pipeline is used % % tf = using_hg2(fig) % %IN: % fig - handle to the figure in question. % %OUT: % tf - boolean indicating whether the HG2 graphics pipeline is being used % (true) or not (false). function tf = using_hg2(fig) try %tf = ~graphicsversion(fig, 'handlegraphics'); tf = ~verLessThan('matlab','8.4.0'); catch tf = false; end
{ "content_hash": "8270a36a6fba2b20bbefd8230086b14a", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 75, "avg_line_length": 23.27777777777778, "alnum_prop": 0.6276849642004774, "repo_name": "orlandi/netcal", "id": "675580a9cfb565967875f585b8c84e0004c06d20", "size": "419", "binary": false, "copies": "1", "ref": "refs/heads/openBeta", "path": "external/exportfig/using_hg2.m", "mode": "33261", "license": "mit", "language": [ { "name": "Java", "bytes": "851" }, { "name": "Matlab", "bytes": "2665197" }, { "name": "Python", "bytes": "61701" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0" metadata-complete="false"> <display-name>Fedora-on-ModeShape</display-name> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring-test/generator.xml,classpath:spring-test/repo.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <servlet> <servlet-name>jersey-servlet</servlet-name> <servlet-class>com.sun.jersey.spi.spring.container.servlet.SpringServlet</servlet-class> <init-param> <param-name>com.sun.jersey.config.property.packages</param-name> <param-value>org.fcrepo.kernel.services, org.fcrepo.http,org.fcrepo.generator</param-value> </init-param> <init-param> <param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name> <param-value>true</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>jersey-servlet</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping> </web-app>
{ "content_hash": "79bf577ac26f3eafc4c716d11752a2d9", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 106, "avg_line_length": 35.55263157894737, "alnum_prop": 0.7098445595854922, "repo_name": "barmintor/fcrepo4", "id": "b686be57ca4d8d21479c4b71bc2c716d7784c10e", "size": "1351", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "fcrepo-generator-dc/src/test/resources/web.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "837" }, { "name": "Java", "bytes": "1971408" }, { "name": "JavaScript", "bytes": "6786" }, { "name": "XSLT", "bytes": "0" } ], "symlink_target": "" }
*For installation instructions regarding your specific platform also see the INSTALL.xxx file in this directory that matches your system.* --- README ============ ### slideToolkit: an assistive toolset for the histological quantification of whole slide images Hi, If you do not know where to start, this should be the right place. In this file we discuss what the slideToolkit does, and how to use it. Just keep on reading. A little introduction first. The demand for accurate and reproducible phenotyping of a disease trait increases with the rising number of biobanks and genome wide association studies. Detailed analysis of histology is a powerful way of phenotyping human tissues. Nonetheless, purely visual assessment of histological slides is time-consuming and liable to sampling variation and optical illusions and thereby observer variation, and external validation may be cumbersome. Therefore computerised quantification of digitized histological slides is often preferred as a more precise and reproducible, and sometimes more sensitive approach. Relatively few free toolkits are, however, available for fully digitized microscopic slides, usually known as whole slides images. In order to comply with this need, we developed the slideToolkit as a fast method to handle large quantities of low contrast whole slides images using advanced cell detecting algorithms. The slideToolkit has been developed for modern personal computers and high-performance clusters (HPCs) and is a set of scripts that requires other programs and libraries to run. Our goal is to provide a free, powerful and versatile collection of tools for automated feature analysis of whole slide images to create reproducible and meaningful phenotypic data sets. The paper were we introduce the slideToolkit can be found on [PlosONE](http://dx.plos.org/10.1371/journal.pone.0110289). Please cite to this paper when using the slideToolkit for your research. Good luck, Bas --- ### The slideToolkit workflow The slideToolkit is a collection of open-source scripts to handle each step from digital slide to the storage of your results. A common slideToolkit workflow consists of four consecutive steps. In the first step, “acquisition”, whole slide images are collected and converted to TIFF files. In the second step, “preparation”, all the required files are created and organized. The third step, “tiles”, creates multiple manageable tiles to count. The fourth step, “analysis”, is the actual tissue analysis and saves the results in a meaningful data set. A set of tools is designed for each step. Instructions on how to use each tool can be found running the `--help` flag (e.g. `slideConvert --help`). Here you can find a [graphical workflow](slideToolkit.workflow.tif?raw=true) for the slideToolkit. ##### Step 1 - acquisition Most slide scanners are, in addition to their own proprietary format, capable of storing the digital slides in pyramid TIFF files. The slideToolkit uses the Bio-Formats library to convert other microscopy formats (Bio-Formats supports over 120 different file formats, [openmicroscopy.org](www.openmicroscopy.org)) into the compatible pyramid TIFF format if needed. TIFF is a tag-based file format for raster images. A TIFF file can hold multiple images in a single file, this is known as a multi-layered TIFF. The term "Pyramid TIFF" is used to describe a multi-layered TIFF file that wraps a sequence of raster images that each represents the same image at increasing resolutions. The different layers contain, among others, the slide label and multiple enlargements of the tissue on the slide. Some slides do not have the proper filenames. Sometimes you want the filename to be exactly like the content of the barcode, sometimes you want all your slides to start with the project name (e.g. MyProject.original.slide.name.TIF). slideRename makes it easy to rename multiple slides at once. To read whole slide images, the open-source libTIFF libraries and the OpenSlide libraries are used. These libraries are also applied to extract metadata (e.g. scan time, magnification and image compression) of the scanned slides. Descriptive information about the slide is stored as metadata and contains, for example, pixels per micrometer, presence of different layers, and scan date. For image processing we use ImageMagick. ImageMagick is a command-line image manipulation tool that is fast, highly adjustable and capable of handling big pyramid TIFF files. The tools designed for step 1: - `slideConvert`, convert different file types of whole slide images to TIFF format. - `slideRename`, Rename virtual slides, this methods supports auto-renaming using barcodes. - `slideInfo`, fetch slide metadata (resolution, dates, magnification, etc). ##### Step 2 - preparation In the following steps multiple output files for each slide are created. For each digital slide, a staging directory is constructed in which the slide, and all output data concerning the slide are stored. Thumbnails contain a photo of the whole slide, including the label. This makes it easy to identify your slides. In digital image manipulation, a mask defines what part of the image will be analyzed and what part will be hidden. Usually a mask can be defined as black (hidden) or white (not hidden). The slideToolkit creates a mask and a miniature version of the whole slide image using convert (from the ImageMagick library). To create the maks: the image is blurred, this will remove dust and speckles. Now, the white background is identified using a fuzzy, non-stringent selection and then background is replaced with black. Settings for blur and fuzziness can be found and changed in the slideMask tool. Generated masks can be adjusted manually in an image editor of choice (such as the freely available GNU Image Manipulation Program; [GIMP](http://www.gimp.org)). Sometimes this is necessary to remove unwanted areas on the whole slide image (like marker stripes or air bubbles under the coverslip). The tools designed for step 2: - `slideDirectory`, create a staging directory per slide. - `slideThumb`, create slide thumbnail, including label (in *PNG* format). - `slideMacro`, create a scaled macro version from a slide (in *PNG* format). - `slideEntropyMasker`, create image masks form PNG-files. Note: As sometimes the former `slideMask` was unable to make proper masks, especially when the contrast between tissue and background is very low, we created `slideEntropyMasker`. ###### UPDATE THIS SECTION ##### ###### Installation instructions for `slideMaskEntropy.py`: `pip install numpy matplotlib scikit-image` ###### Usage of `slideMaskEntropy.py`: We assume that `slideMask` has been run, but all the *.mask.png are of bad quality. `for FILE in $(pwd)/*.macro.PNG ; do echo "* Processing [ "$FILE" ]..."; slideMaskEntropy.py "$FILE"; done` ###### ----------- ##### ##### Step 3 - tiles Image analysis of memory intensive, whole 20x representations of the digitized slides is currently impossible due to hardware and software limitations. The goal of this step is to create multiple smaller images (i.e. tiles) from the 20x whole slide image. An upscaled version of the mask is placed over the 20x whole slide image (in our example this is layer 3 of the multi layered TIFF). Image manipulation on 20x sized whole slide images requires large amounts of computer RAM. To make it possible for computers without sufficient RAM to handle these files, the slideToolkit uses a memory-mapped disk file of the program memory. Using disk mapped memory files (ImageMagick .mpc files), the slideToolkit can efficiently extract all tiles. Without a mask, a faster and more memory efficient method is used using the openslide library. The tools designed for step 3: - `slide2Tiles`, cut virtual slide into tiles. ##### Step 4 - analysis At this step, multiple tiles containing tissue data have been made. And now the different objects in this tissue can be identified. Although you can use any image analysis program from now on, we prefer [CellProfiler](http://www.cellprofiler.org). CellProfiler is designed to quantitatively measure phenotypes from thousands of images automatically without training in computer vision or programming. CellProfiler can run using a graphical user interface (GUI) or a command-line interface (CLI). Using the CellProfiler’s GUI, different algorithms for image analysis are available as individual modules that can be modified and placed in sequential order to form a pipeline. Such a pipeline can be used to identify and measure biological objects and features in images. Pipelines can be stored and reused in future projects. The CLI can be used to run the pipeline for actual image analysis. An illustrated example on how to create pipelines in CellProfiler is described by Vokes and Carpenter in their manuscript "[Using CellProfiler for Automatic Identification and Measurement of Biological Objects in Images](http://onlinelibrary.wiley.com/doi/10.1002/0471142727.mb1417s82/abstract)". CellProfiler is able to output its measurements in SQL/CSV format. Were the SQL file contains the structure of the data and the CSV file contains the actual measurements. With slideSQLheader you can extract the SQL structure and add it as a header row to the CSV file. CSV files are commenly used data files and can be imported in nearly every statistical program. The tools designed for step 4: - `slideJobsCellProfiler`, outputs a list of jobs for CellProfiler. - `slideSQLheader`, fetch table headers from CellProfiler SQL output for CSV file. --- ### Hardware The slideToolkit is developed for any *NIX based operating system. We tested the slideToolkit on a MacMini (2GHz i7 and 16 GB RAM) running OS X - Mavericks 10.9, and the same machine running Linux - Ubuntu 12.04. We also tested the slideToolkit on a high-performance cluster (HPC) running Linux - CentOS 6.5 (8x Intel(R) Xeon(R) CPU E5-2630 0 @ 2.30GHz, 38x Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz, 11x Intel(R) Xeon(R) CPU E5-2630 v2 @ 2.60GHz, all with 12 cores and 128 GB RAM per node). The slideToolkit depends heavily on the *NIX architecture. For this reason we have not planned to create installation instructions for Microsoft Windows. To get the slideToolkit running on Windows, or to create a portable slideToolkit installation, our advise is to run Linux Ubuntu 16.04 LTS within [VirtualBox](https://www.virtualbox.org) (or any other virtualisation software). --- ### Programs and libraries: A library is a collection of sources and that a computer program can use to add functionality. The libraries we use in this project are mainly open source. The license used for the different programs and libraries can be found on the accompanying websites. Some programs bring there own libraries, some depend on other libraries. This is a list of the programs and libraries the slideToolkit depends on. For example, the LibTIFF library makes it possible for ImageMagick and for tiffinfo to handle TIFF files correctly. The programs and libraries you need to run the slideToolkit: - [Bio-Formats Library](http://www.openmicroscopy.org/site/products/bio-formats) >= version 5 - [CellProfiler](http://cellprofiler.org) >= version 2 - [GNU Bash](https://www.gnu.org/software/bash/) >= version 3 - [GNU Parallel](https://www.gnu.org/software/parallel/) - [ImageMagick](http://www.imagemagick.org) >= version 6.8 - [LibTIFF](http://www.remotesensing.org/libtiff/), >= version 4 - [Openslide](http://openslide.org) >= version 3.4 - [Perl](http://www.perl.org) >= version 5 - [slideToolkit](https://github.com/swvanderlaan/slideToolkit) - [NDPItools](https://www.imnc.in2p3.fr/pagesperso/deroulers/software/ndpitools/), click the link at 'Mac OS 10.6 and later' on the right side; follow the installation instructions. *The latest stable version of these programs and libraries should be sufficient. There is one catch, the Lib TIFF library supports the TIFF64 (aka BigTIFF) format since version 4.* ### Installation instructions: Installation instructions for OS X and Linux can be found in this repo. *We are working on updates!* - [INSTALL - OS X 10.[8/9/10/11.[x]] - Mountain Lion/Mavericks/Yosemite/El Capitan/Sierra/High Sierra](INSTALL.OSX.md) *(Largely updated - mostly applicable to Ubuntu or CentOS6.6+ too)* - [INSTALL - Ubuntu 12.04 LTS - Precise Pangolin](INSTALL.Ubuntu.12.04.LTS-PrecisePangolin.md) *(CellProfiler instructions incomplete)* - [INSTALL - CentOS 7](INSTALL.CentOS7.md) *(In progress)* - *We have not planned to create installation instructions for Microsoft Windows. Try to run CentOS 6.6+ within [VirtualBox](https://www.virtualbox.org) instead.* *Finally a 'thank you' for the teams of ImageMagick, CellProfiler and all the other great software packages for there support and excellent software.*
{ "content_hash": "b4407dcd2c4b46c66b0abdcc21f6ee69", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 892, "avg_line_length": 93.4748201438849, "alnum_prop": 0.7781882552143462, "repo_name": "swvanderlaan/slideToolkit", "id": "9ed8f93a4c09888dfdb8186e87a7bc7f43e041cb", "size": "13011", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "guides/Readme.md", "mode": "33261", "license": "mit", "language": [ { "name": "C++", "bytes": "6053292" }, { "name": "Makefile", "bytes": "25128" }, { "name": "Python", "bytes": "2475" }, { "name": "R", "bytes": "249" }, { "name": "Shell", "bytes": "136685" } ], "symlink_target": "" }
#include "config.h" #include "system.h" #include "coretypes.h" #include "tm.h" #include "cpplib.h" #include "tree.h" #include "c-family/c-pragma.h" #include "diagnostic-core.h" #include "ggc.h" #include "tm_p.h" #ifndef streq #define streq(a,b) (strcmp (a, b) == 0) #endif static int pop_data_area (v850_data_area); static int push_data_area (v850_data_area); static void mark_current_function_as_interrupt (void); /* Push a data area onto the stack. */ static int push_data_area (v850_data_area data_area) { data_area_stack_element * elem; elem = (data_area_stack_element *) xmalloc (sizeof (* elem)); if (elem == NULL) return 0; elem->prev = data_area_stack; elem->data_area = data_area; data_area_stack = elem; return 1; } /* Remove a data area from the stack. */ static int pop_data_area (v850_data_area data_area) { if (data_area_stack == NULL) warning (OPT_Wpragmas, "#pragma GHS endXXXX found without " "previous startXXX"); else if (data_area != data_area_stack->data_area) warning (OPT_Wpragmas, "#pragma GHS endXXX does not match " "previous startXXX"); else { data_area_stack_element * elem; elem = data_area_stack; data_area_stack = data_area_stack->prev; free (elem); return 1; } return 0; } /* Set the machine specific 'interrupt' attribute on the current function. */ static void mark_current_function_as_interrupt (void) { tree name; if (current_function_decl == NULL_TREE) { warning (0, "cannot set interrupt attribute: no current function"); return; } name = get_identifier ("interrupt"); if (name == NULL_TREE || TREE_CODE (name) != IDENTIFIER_NODE) { warning (0, "cannot set interrupt attribute: no such identifier"); return; } decl_attributes (&current_function_decl, tree_cons (name, NULL_TREE, NULL_TREE), 0); } /* Support for GHS pragmata. */ void ghs_pragma_section (cpp_reader * pfile ATTRIBUTE_UNUSED) { int repeat = 0; /* #pragma ghs section [name = alias [, name = alias [, ...]]] */ do { tree x; enum cpp_ttype type; tree sect_ident; const char *sect, *alias; enum GHS_section_kind kind; type = pragma_lex (&x); if (type == CPP_EOF && !repeat) goto reset; else if (type == CPP_NAME) { sect_ident = x; sect = IDENTIFIER_POINTER (sect_ident); } else goto bad; repeat = 0; if (pragma_lex (&x) != CPP_EQ) goto bad; if (pragma_lex (&x) != CPP_NAME) goto bad; alias = IDENTIFIER_POINTER (x); type = pragma_lex (&x); if (type == CPP_COMMA) repeat = 1; else if (type != CPP_EOF) warning (OPT_Wpragmas, "junk at end of #pragma ghs section"); if (streq (sect, "data")) kind = GHS_SECTION_KIND_DATA; else if (streq (sect, "text")) kind = GHS_SECTION_KIND_TEXT; else if (streq (sect, "rodata")) kind = GHS_SECTION_KIND_RODATA; else if (streq (sect, "const")) kind = GHS_SECTION_KIND_RODATA; else if (streq (sect, "rosdata")) kind = GHS_SECTION_KIND_ROSDATA; else if (streq (sect, "rozdata")) kind = GHS_SECTION_KIND_ROZDATA; else if (streq (sect, "sdata")) kind = GHS_SECTION_KIND_SDATA; else if (streq (sect, "tdata")) kind = GHS_SECTION_KIND_TDATA; else if (streq (sect, "zdata")) kind = GHS_SECTION_KIND_ZDATA; /* According to GHS beta documentation, the following should not be allowed! */ else if (streq (sect, "bss")) kind = GHS_SECTION_KIND_BSS; else if (streq (sect, "zbss")) kind = GHS_SECTION_KIND_ZDATA; else { warning (0, "unrecognized section name %qE", sect_ident); return; } if (streq (alias, "default")) GHS_current_section_names [kind] = NULL; else GHS_current_section_names [kind] = build_string (strlen (alias) + 1, alias); } while (repeat); return; bad: warning (OPT_Wpragmas, "malformed #pragma ghs section"); return; reset: /* #pragma ghs section \n: Reset all section names back to their defaults. */ { int i; for (i = COUNT_OF_GHS_SECTION_KINDS; i--;) GHS_current_section_names [i] = NULL; } } void ghs_pragma_interrupt (cpp_reader * pfile ATTRIBUTE_UNUSED) { tree x; if (pragma_lex (&x) != CPP_EOF) warning (OPT_Wpragmas, "junk at end of #pragma ghs interrupt"); mark_current_function_as_interrupt (); } void ghs_pragma_starttda (cpp_reader * pfile ATTRIBUTE_UNUSED) { tree x; if (pragma_lex (&x) != CPP_EOF) warning (OPT_Wpragmas, "junk at end of #pragma ghs starttda"); push_data_area (DATA_AREA_TDA); } void ghs_pragma_startsda (cpp_reader * pfile ATTRIBUTE_UNUSED) { tree x; if (pragma_lex (&x) != CPP_EOF) warning (OPT_Wpragmas, "junk at end of #pragma ghs startsda"); push_data_area (DATA_AREA_SDA); } void ghs_pragma_startzda (cpp_reader * pfile ATTRIBUTE_UNUSED) { tree x; if (pragma_lex (&x) != CPP_EOF) warning (OPT_Wpragmas, "junk at end of #pragma ghs startzda"); push_data_area (DATA_AREA_ZDA); } void ghs_pragma_endtda (cpp_reader * pfile ATTRIBUTE_UNUSED) { tree x; if (pragma_lex (&x) != CPP_EOF) warning (OPT_Wpragmas, "junk at end of #pragma ghs endtda"); pop_data_area (DATA_AREA_TDA); } void ghs_pragma_endsda (cpp_reader * pfile ATTRIBUTE_UNUSED) { tree x; if (pragma_lex (&x) != CPP_EOF) warning (OPT_Wpragmas, "junk at end of #pragma ghs endsda"); pop_data_area (DATA_AREA_SDA); } void ghs_pragma_endzda (cpp_reader * pfile ATTRIBUTE_UNUSED) { tree x; if (pragma_lex (&x) != CPP_EOF) warning (OPT_Wpragmas, "junk at end of #pragma ghs endzda"); pop_data_area (DATA_AREA_ZDA); }
{ "content_hash": "7ad8852decd4ac008ff86c448db78c83", "timestamp": "", "source": "github", "line_count": 257, "max_line_length": 80, "avg_line_length": 22.607003891050585, "alnum_prop": 0.614974182444062, "repo_name": "the-linix-project/linix-kernel-source", "id": "db881cf4d9f106a0a0fd152f39056e83b5ee2830", "size": "6625", "binary": false, "copies": "32", "ref": "refs/heads/master", "path": "gccsrc/gcc-4.7.2/gcc/config/v850/v850-c.c", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Ada", "bytes": "38139979" }, { "name": "Assembly", "bytes": "3723477" }, { "name": "Awk", "bytes": "83739" }, { "name": "C", "bytes": "103607293" }, { "name": "C#", "bytes": "55726" }, { "name": "C++", "bytes": "38577421" }, { "name": "CLIPS", "bytes": "6933" }, { "name": "CSS", "bytes": "32588" }, { "name": "Emacs Lisp", "bytes": "13451" }, { "name": "FORTRAN", "bytes": "4294984" }, { "name": "GAP", "bytes": "13089" }, { "name": "Go", "bytes": "11277335" }, { "name": "Haskell", "bytes": "2415" }, { "name": "Java", "bytes": "45298678" }, { "name": "JavaScript", "bytes": "6265" }, { "name": "Matlab", "bytes": "56" }, { "name": "OCaml", "bytes": "148372" }, { "name": "Objective-C", "bytes": "995127" }, { "name": "Objective-C++", "bytes": "436045" }, { "name": "PHP", "bytes": "12361" }, { "name": "Pascal", "bytes": "40318" }, { "name": "Perl", "bytes": "358808" }, { "name": "Python", "bytes": "60178" }, { "name": "SAS", "bytes": "1711" }, { "name": "Scilab", "bytes": "258457" }, { "name": "Shell", "bytes": "2610907" }, { "name": "Tcl", "bytes": "17983" }, { "name": "TeX", "bytes": "1455571" }, { "name": "XSLT", "bytes": "156419" } ], "symlink_target": "" }
package org.gazbert.openidconnect.client.security; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; /** * Encapsulates Google user info. * * Example userinfo response payload: * * <pre> * { * "sub": "118412435170935916453", * "name": "Joze Myname", * "given_name": "Joze", * "family_name": "Myname", * "profile": "https://plus.google.com/+JozeMyname", * "picture": "https://lh3.googleusercontent.com/blabla/photo.jpg", * "email": "joze.myname@gmail.com", * "email_verified": true * } * </pre> * * @author gazbert * */ public class GoogleUserInfo { private final String id; private final String name; private final String givenName; private final String familyName; private final String profile; private final String picture; private final String email; private final boolean emailVerified; @JsonCreator public GoogleUserInfo(@JsonProperty("sub") String id, @JsonProperty("name") String name, @JsonProperty("given_name") String givenName, @JsonProperty("family_name") String familyName, @JsonProperty("profile") String profile, @JsonProperty("picture") String picture, @JsonProperty("email") String email, @JsonProperty("email_verified") boolean emailVerified) { this.id = id; this.name = name; this.givenName = givenName; this.familyName = familyName; this.profile = profile; this.picture = picture; this.email = email; this.emailVerified = emailVerified; } public String getId() { return id; } public String getName() { return name; } public String getGivenName() { return givenName; } public String getFamilyName() { return familyName; } public String getProfile() { return profile; } public String getPicture() { return picture; } public String getEmail() { return email; } public boolean getEmailVerified() { return emailVerified; } @Override public String toString() { return MoreObjects.toStringHelper(this) .add("id", id) .add("name", name) .add("givenName", givenName) .add("familyName", familyName) .add("profile", profile) .add("picture", picture) .add("email", email) .add("emailVerified", emailVerified) .toString(); } }
{ "content_hash": "ddf413eef368180085f53707f1056d85", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 82, "avg_line_length": 26.9126213592233, "alnum_prop": 0.5753968253968254, "repo_name": "gazbert/openid-connect-spring-client", "id": "34d1fcac9a2780c219afea9f108e4fd4ff94eb24", "size": "2772", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/org/gazbert/openidconnect/client/security/GoogleUserInfo.java", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "5006" }, { "name": "HTML", "bytes": "709" }, { "name": "Java", "bytes": "20600" }, { "name": "Shell", "bytes": "7058" } ], "symlink_target": "" }
Licenses ====================== CPML is Copyright (c) 2014 Colby Klein <shakesoda@gmail.com>. Code in vec3.lua is derived from hump.vector. (c) 2010-2013 Matthias Richter. MIT. Portions of mat4.lua are from LuaMatrix, (c) 2010 Michael Lutz. MIT. Code in simplex.lua is (c) 2011 Stefan Gustavson. MIT. Code in quat.lua is from Andrew Stacey and covered under the CC0 license. The MIT License (MIT) ====================== 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.
{ "content_hash": "6043c0ade73404862908901ece957b06", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 82, "avg_line_length": 45.28125, "alnum_prop": 0.7674258109040718, "repo_name": "Midiman/Verde", "id": "457f03f560c417300d839f708a014122f9f9fec3", "size": "1449", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "libs/dominatrix/thirdparty/cpml/LICENSE.md", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "6" }, { "name": "Lua", "bytes": "289632" }, { "name": "Shell", "bytes": "119" } ], "symlink_target": "" }
using UnrealBuildTool; using System.Collections.Generic; public class VertexColorSpreadTarget : TargetRules { public VertexColorSpreadTarget(TargetInfo Target) { Type = TargetType.Game; } // // TargetRules interface. // public override void SetupBinaries( TargetInfo Target, ref List<UEBuildBinaryConfiguration> OutBuildBinaryConfigurations, ref List<string> OutExtraModuleNames ) { OutExtraModuleNames.Add("VertexColorSpread"); } }
{ "content_hash": "4b543fde82091f3dec83d3dbd273aa1a", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 68, "avg_line_length": 19.869565217391305, "alnum_prop": 0.7789934354485777, "repo_name": "alanedwardes/UE4VertexColorSpread", "id": "09dee888e3f156c770e40fa290077a6f0effb0f2", "size": "519", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Source/VertexColorSpread.Target.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "163" }, { "name": "C#", "bytes": "1369" }, { "name": "C++", "bytes": "28054" } ], "symlink_target": "" }
<?php namespace NBOS\http; use NBOS\http\Curl; use NBOS; class Rest { protected $curl = null; protected $supported_formats = array( 'xml' => 'application/xml', 'json' => 'application/json', 'serialize' => 'application/vnd.php.serialized', 'php' => 'text/plain', 'csv' => 'text/csv' ); protected $auto_detect_formats = array( 'application/xml' => 'xml', 'text/xml' => 'xml', 'application/json' => 'json', 'text/json' => 'json', 'text/csv' => 'csv', 'application/csv' => 'csv', 'application/vnd.php.serialized' => 'serialize' ); protected $rest_server; protected $format; protected $mime_type; protected $http_auth = null; protected $http_user = null; protected $http_pass = null; protected $response_string; private $last_http_code = null; private $last_response = null; private $last_response_header = null; protected $http_headers = array(); const HTTP_OK = 200; const HTTP_BAD_REQUEST = 400; const HTTP_FORBIDDEN = 403; const HTTP_NOT_FOUND = 404; const HTTP_METHOD_NOT_ALLOWED = 405; const HTTP_INTERNAL_SERVER_ERROR = 500; function __construct($config = array()) { $this->curl = new Curl(); // If a URL was passed to the library empty($config) OR $this->initialize($config); } function __destruct() { $this->curl->set_defaults(); } public function initialize($config) { $this->rest_server = @$config['server']; if (substr($this->rest_server, -1, 1) != '/') { $this->rest_server .= '/'; } isset($config['http_auth']) && $this->http_auth = $config['http_auth']; isset($config['http_user']) && $this->http_user = $config['http_user']; isset($config['http_pass']) && $this->http_pass = $config['http_pass']; } public function get($uri, $params = array(), $format = NULL) { if ($params) { $uri .= '?'.(is_array($params) ? http_build_query($params) : $params); } return $this->_call('get', $uri, NULL, $format); } public function post($uri, $params = array(), $format = 'json') { return $this->_call('post', $uri, $params, $format); } public function put($uri, $params = array(), $format = 'json') { return $this->_call('put', $uri, $params, $format); } public function delete($uri, $params = array(), $format = 'json') { return $this->_call('delete', $uri, $params, $format); } public function api_key($key, $name = 'X-API-KEY') { $this->curl->http_header($name, $key); } public function language($lang) { if (is_array($lang)) { $lang = implode(', ', $lang); } $this->curl->http_header('Accept-Language', $lang); } protected function _call($method, $uri, $params = array(), $format = NULL) { if ($format !== NULL) { $this->format($format); } $this->_set_headers(); // Initialize cURL session $this->curl->create($uri); // If authentication is enabled use it if ($this->http_auth != '' && $this->http_user != '') { $this->curl->http_login($this->http_user, $this->http_pass, $this->http_auth); } // We still want the response even if there is an error code over 400 $this->curl->option('failonerror', FALSE); // Call the correct method with parameters $this->curl->{$method}($params); // Execute and return the response from the REST server $response = $this->curl->execute(); // Format $response = $this->_format_response($response); $this->last_http_code = isset($this->curl->last_info['http_code'])?$this->curl->last_info['http_code']:""; $this->last_response = $this->validateResponse($response); $this->last_response_header = !empty($this->curl->last_response_header)?$this->decodeHeaderInfo($this->curl->last_response_header):null; if($this->last_http_code != 200 && $this->last_response === null){ NBOS\core\ApiBase::setError("Server not responding!"); } return $this->last_response; } private function decodeHeaderInfo($header = ""){ $header = explode("\r\n", $header); if(!empty($header)){ foreach($header as $key => $val){ if(strpos($val, ":") !== false){ $val = explode(":", $val, 2); $header[$val[0]] = $val[1]; } } } return $header; } // If a type is passed in that is not supported, use it as a mime type public function format($format) { if (array_key_exists($format, $this->supported_formats)) { $this->format = $format; $this->mime_type = $this->supported_formats[$format]; }else{ $this->mime_type = $format; } $this->curl->format = $this->format; $this->curl->mime_type = $this->mime_type; return $this; } // Return HTTP status code public function status() { return $this->info('http_code'); } // Return curl info by specified key, or whole array public function info($key = null) { return $key === null ? $this->curl->info : @$this->curl->info[$key]; } // Set custom options public function option($code, $value) { $this->curl->option($code, $value); } protected function _set_headers() { //$this->curl->http_header('Accept: '.$this->mime_type); if(!empty($this->mime_type) && in_array($this->mime_type, $this->supported_formats) ){ $this->curl->http_header('Content-Type: '.$this->mime_type); }else if(!empty($this->mime_type) && $this->mime_type == "x-www-form-urlencoded"){ $this->mime_type = "json"; $this->format = "json"; $this->curl->http_header('Content-Type: application/x-www-form-urlencoded'); }else{ $this->mime_type = "json"; $this->format = "json"; $this->curl->http_header('Content-Type: multipart/form-data'); } if(!empty($this->http_headers)){ foreach($this->http_headers as $key => $val){ $this->curl->http_header($key.': '.$val); } } } protected function _format_response($response) { $this->response_string =& $response; // It is a supported format, so just run its formatting method if (array_key_exists($this->format, $this->supported_formats)) { return $this->{"_".$this->format}($response); } exit; // Find out what format the data was returned in $returned_mime = @$this->curl->info['content_type']; // If they sent through more than just mime, stip it off if (strpos($returned_mime, ';')) { list($returned_mime)=explode(';', $returned_mime); } $returned_mime = trim($returned_mime); if (array_key_exists($returned_mime, $this->auto_detect_formats)) { return $this->{'_'.$this->auto_detect_formats[$returned_mime]}($response); } return $response; } // Format XML for output protected function _xml($string) { return $string ? (array) simplexml_load_string($string, 'SimpleXMLElement', LIBXML_NOCDATA) : array(); } // Format HTML for output // This function is DODGY! Not perfect CSV support but works with my REST_Controller protected function _csv($string) { $data = array(); // Splits $rows = explode("\n", trim($string)); $headings = explode(',', array_shift($rows)); foreach( $rows as $row ) { // The substr removes " from start and end $data_fields = explode('","', trim(substr($row, 1, -1))); if (count($data_fields) == count($headings)) { $data[] = array_combine($headings, $data_fields); } } return $data; } // Encode as JSON protected function _json($string) { return json_decode(trim($string)); } // Encode as Serialized array protected function _serialize($string) { return unserialize(trim($string)); } // Encode raw PHP protected function _php($string) { $string = trim($string); $populated = array(); eval("\$populated = \"$string\";"); return $populated; } public function validateResponse($response){ NBOS\core\ApiBase::$error = null; NBOS\core\ApiBase::$message = null; if(isset($response->errors)){ NBOS\core\ApiBase::setErrors($response->errors); }else if(isset($response->error_description)){ NBOS\core\ApiBase::setError($response->error_description); }else if(isset($response->message)){ if($this->last_http_code == 200){ NBOS\core\ApiBase::setMessage($response->message); }else{ NBOS\core\ApiBase::setError($response->message); } } return $response; } public function getLastHttpCode(){ return $this->last_http_code; } public function getLastResponse(){ return $this->last_response; } public function getLastResponseHeader(){ return $this->last_response_header; } public function setHttpHeader($key, $val){ $this->http_headers[$key] = $val; } public function removeHttpHeader($key){ if(isset($this->http_headers[$key])){ unset($this->http_headers[$key]); } } public function emptyHttpHeader(){ $this->http_headers = array(); } }
{ "content_hash": "df1b79556951e64008bfc8f95cd6c1a0", "timestamp": "", "source": "github", "line_count": 351, "max_line_length": 138, "avg_line_length": 25.840455840455842, "alnum_prop": 0.5962513781697906, "repo_name": "nbostech/wavelabs-php-client-api", "id": "bf86168dd6ae81a9da1c36974d12a7e87cd7dfa4", "size": "9070", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/NBOS/http/Rest.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "PHP", "bytes": "41860" } ], "symlink_target": "" }
(function() { var Console = {}; if (window.console === "undefined") { ["log", "warn", "debug", "info", "error"].forEach(function(methodName) { Console[methodName] = function() { }; }); } else { Console = window.console; } Completed.module.add("Console", Console); }());
{ "content_hash": "2d14dd06c2c4150ff83674532054af44", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 80, "avg_line_length": 22.466666666666665, "alnum_prop": 0.5014836795252225, "repo_name": "EragonJ/Completed.js", "id": "54b289cece501d140bd27f96d189329a168acb3a", "size": "337", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Console.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "10857" }, { "name": "JavaScript", "bytes": "30670" } ], "symlink_target": "" }
layout: post title: "Hobgoblin Iron Shadow" date: 2017-09-10 tags: [medium, humanoid, cr2, volos-guide] --- **Medium humanoid (goblinoid), lawful evil** **Armor Class** 15 **Hit Points** 32 (5d8+10) **Speed** 40 ft. | STR | DEX | CON | INT | WIS | CHA | |:-----:|:-----:|:-----:|:-----:|:-----:|:-----:| | 14 (+2) | 16 (+3) | 15 (+2) | 14 (+2) | 15 (+2) | 11 (0) | **Skills** Acrobatics +5, Athletics +4, Stealth +5 **Senses** darkvision 60 ft. **Languages** Common, Goblin **Challenge** 2 (450 XP) ***Spellcasting.*** The hobgoblin is a 2nd-level spellcaster. Its spellcasting ability is Intelligence (spell save DC 12, +4 to hit with spell attacks). It has the following wizard spells prepared: Cantrips (at will): minor illusion, prestidigitation, true strike 1st level (3 slots): charm person, disguise self, expeditious retreat, silent image ***Unarmored Defense.*** While the hobgoblin is wearing no armor and wielding no shield, its AC includes its Wisdom modifier. **Actions** ***Multiattack.*** The hobgoblin makes four attacks, each of which can be an unarmed strike or a dart attack. It can also use Shadow Jaunt once, either before or after one of the attacks. ***Unarmed Strike.*** Melee Weapon Attack: +5 to hit, reach 5 it, one target. Hit: 5 (1d4+3) bludgeoning damage. ***Dart.*** Ranged Weapon Attack: +5 to hit, range 20/60 it, one target. Hit: 5 (1d4+3) piercing damage. ***Shadow Jaunt.*** The hobgoblin magically teleports, along with any equipment it is wearing or carrying, up to 30 feet to an unoccupied space it can see. Both the space it is leaving and its destination must be in dim light or darkness.
{ "content_hash": "396ac26a586609e008d413c8fef9d803", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 238, "avg_line_length": 38.02272727272727, "alnum_prop": 0.675433353257621, "repo_name": "whiplashomega/elthelas2", "id": "94c7245f752fd33e08b07c2e03dc433c8e7b4bc9", "size": "1677", "binary": false, "copies": "1", "ref": "refs/heads/3.x-dev", "path": "data/creaturebackup/hobgoblin-iron-shadow.markdown", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2037" }, { "name": "HTML", "bytes": "354" }, { "name": "JavaScript", "bytes": "761819" }, { "name": "PHP", "bytes": "6911" }, { "name": "Procfile", "bytes": "19" }, { "name": "SCSS", "bytes": "29752" }, { "name": "Vue", "bytes": "727797" } ], "symlink_target": "" }
using System; using System.Collections.ObjectModel; using VkNet.Utils; namespace VkNet.Model { /// <summary> /// Результат запроса Friends.FriendOnline /// </summary> [Serializable] public class FriendOnline { /// <summary> /// Online /// </summary> public ReadOnlyCollection<long> Online { get; set; } /// <summary> /// Online с мобильного телефона. /// </summary> public ReadOnlyCollection<long> MobileOnline { get; set; } /// <summary> /// Разобрать из json. /// </summary> /// <param name="response"> Ответ сервера. </param> /// <returns> </returns> public static FriendOnline FromJson(VkResponse response) { if (response.ContainsKey(key: "online")) { return new FriendOnline { MobileOnline = response[key: "online_mobile"].ToReadOnlyCollectionOf<long>(selector: x => x) , Online = response[key: "online"].ToReadOnlyCollectionOf<long>(selector: x => x) }; } return new FriendOnline { Online = response.ToReadOnlyCollectionOf<long>(selector: x => x) }; } } }
{ "content_hash": "168f71844fd1704f0d578eb3e38f02b8", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 98, "avg_line_length": 23.355555555555554, "alnum_prop": 0.6527117031398668, "repo_name": "Soniclev/vk", "id": "57493ba411486ff83f162dd2d40606f0165566ab", "size": "1109", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "VkNet/Model/FriendOnline.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "4244252" } ], "symlink_target": "" }
LilTrick ======== Mad Money Corporatin
{ "content_hash": "883ae92c5109c122620b5db0c2be7f32", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 20, "avg_line_length": 10, "alnum_prop": 0.65, "repo_name": "GrinderOfTheStreet/LilTrick", "id": "93149047e6e04e5ae2fd4bd0e87d49a7372ef77b", "size": "40", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
#include <srs_app_dvr.hpp> #ifdef SRS_AUTO_DVR #include <fcntl.h> #include <sstream> #include <algorithm> using namespace std; #include <srs_app_config.hpp> #include <srs_rtmp_stack.hpp> #include <srs_core_autofree.hpp> #include <srs_kernel_utility.hpp> #include <srs_app_http_hooks.hpp> #include <srs_kernel_codec.hpp> #include <srs_kernel_flv.hpp> #include <srs_kernel_file.hpp> #include <srs_rtmp_amf0.hpp> #include <srs_kernel_stream.hpp> #include <srs_protocol_json.hpp> #include <srs_app_utility.hpp> // update the flv duration and filesize every this interval in ms. #define SRS_DVR_UPDATE_DURATION_INTERVAL 60000 SrsFlvSegment::SrsFlvSegment(SrsDvrPlan* p) { req = NULL; jitter = NULL; plan = p; fs = new SrsFileWriter(); enc = new SrsFlvEncoder(); jitter_algorithm = SrsRtmpJitterAlgorithmOFF; path = ""; has_keyframe = false; duration = 0; starttime = -1; stream_starttime = 0; stream_previous_pkt_time = -1; stream_duration = 0; duration_offset = 0; filesize_offset = 0; _srs_config->subscribe(this); } SrsFlvSegment::~SrsFlvSegment() { _srs_config->unsubscribe(this); srs_freep(jitter); srs_freep(fs); srs_freep(enc); } int SrsFlvSegment::initialize(SrsRequest* r) { int ret = ERROR_SUCCESS; req = r; jitter_algorithm = (SrsRtmpJitterAlgorithm)_srs_config->get_dvr_time_jitter(req->vhost); return ret; } bool SrsFlvSegment::is_overflow(int64_t max_duration) { return duration >= max_duration; } int SrsFlvSegment::open(bool use_tmp_file) { int ret = ERROR_SUCCESS; // ignore when already open. if (fs->is_open()) { return ret; } path = generate_path(); bool fresh_flv_file = !srs_path_exists(path); // create dir first. std::string dir = path.substr(0, path.rfind("/")); if ((ret = srs_create_dir_recursively(dir)) != ERROR_SUCCESS) { srs_error("create dir=%s failed. ret=%d", dir.c_str(), ret); return ret; } srs_info("create dir=%s ok", dir.c_str()); // create jitter. if ((ret = create_jitter(!fresh_flv_file)) != ERROR_SUCCESS) { srs_error("create jitter failed, path=%s, fresh=%d. ret=%d", path.c_str(), fresh_flv_file, ret); return ret; } // generate the tmp flv path. if (!fresh_flv_file || !use_tmp_file) { // when path exists, always append to it. // so we must use the target flv path as output flv. tmp_flv_file = path; } else { // when path not exists, dvr to tmp file. tmp_flv_file = path + ".tmp"; } // open file writer, in append or create mode. if (!fresh_flv_file) { if ((ret = fs->open_append(tmp_flv_file)) != ERROR_SUCCESS) { srs_error("append file stream for file %s failed. ret=%d", path.c_str(), ret); return ret; } srs_trace("dvr: always append to when exists, file=%s.", path.c_str()); } else { if ((ret = fs->open(tmp_flv_file)) != ERROR_SUCCESS) { srs_error("open file stream for file %s failed. ret=%d", path.c_str(), ret); return ret; } } // initialize the encoder. if ((ret = enc->initialize(fs)) != ERROR_SUCCESS) { srs_error("initialize enc by fs for file %s failed. ret=%d", path.c_str(), ret); return ret; } // when exists, donot write flv header. if (fresh_flv_file) { // write the flv header to writer. if ((ret = enc->write_header()) != ERROR_SUCCESS) { srs_error("write flv header failed. ret=%d", ret); return ret; } } // update the duration and filesize offset. duration_offset = 0; filesize_offset = 0; srs_trace("dvr stream %s to file %s", req->stream.c_str(), path.c_str()); return ret; } int SrsFlvSegment::close() { int ret = ERROR_SUCCESS; // ignore when already closed. if (!fs->is_open()) { return ret; } // update duration and filesize. if ((ret = update_flv_metadata()) != ERROR_SUCCESS) { return ret; } fs->close(); // when tmp flv file exists, reap it. if (tmp_flv_file != path) { if (rename(tmp_flv_file.c_str(), path.c_str()) < 0) { ret = ERROR_SYSTEM_FILE_RENAME; srs_error("rename flv file failed, %s => %s. ret=%d", tmp_flv_file.c_str(), path.c_str(), ret); return ret; } } // TODO: FIXME: the http callback is async, which will trigger thread switch, // so the on_video maybe invoked during the http callback, and error. if ((ret = plan->on_reap_segment()) != ERROR_SUCCESS) { srs_error("dvr: notify plan to reap segment failed. ret=%d", ret); return ret; } return ret; } int SrsFlvSegment::write_metadata(SrsSharedPtrMessage* metadata) { int ret = ERROR_SUCCESS; if (duration_offset || filesize_offset) { return ret; } SrsStream stream; if ((ret = stream.initialize(metadata->payload, metadata->size)) != ERROR_SUCCESS) { return ret; } SrsAmf0Any* name = SrsAmf0Any::str(); SrsAutoFree(SrsAmf0Any, name); if ((ret = name->read(&stream)) != ERROR_SUCCESS) { return ret; } SrsAmf0Object* obj = SrsAmf0Any::object(); SrsAutoFree(SrsAmf0Object, obj); if ((ret = obj->read(&stream)) != ERROR_SUCCESS) { return ret; } // remove duration and filesize. obj->set("filesize", NULL); obj->set("duration", NULL); // add properties. obj->set("service", SrsAmf0Any::str(RTMP_SIG_SRS_SERVER)); obj->set("filesize", SrsAmf0Any::number(0)); obj->set("duration", SrsAmf0Any::number(0)); int size = name->total_size() + obj->total_size(); char* payload = new char[size]; SrsAutoFreeA(char, payload); // 11B flv header, 3B object EOF, 8B number value, 1B number flag. duration_offset = fs->tellg() + size + 11 - SrsAmf0Size::object_eof() - SrsAmf0Size::number(); // 2B string flag, 8B number value, 8B string 'duration', 1B number flag filesize_offset = duration_offset - SrsAmf0Size::utf8("duration") - SrsAmf0Size::number(); // convert metadata to bytes. if ((ret = stream.initialize(payload, size)) != ERROR_SUCCESS) { return ret; } if ((ret = name->write(&stream)) != ERROR_SUCCESS) { return ret; } if ((ret = obj->write(&stream)) != ERROR_SUCCESS) { return ret; } // to flv file. if ((ret = enc->write_metadata(18, payload, size)) != ERROR_SUCCESS) { return ret; } return ret; } int SrsFlvSegment::write_audio(SrsSharedPtrMessage* shared_audio) { int ret = ERROR_SUCCESS; SrsSharedPtrMessage* audio = shared_audio->copy(); SrsAutoFree(SrsSharedPtrMessage, audio); if ((jitter->correct(audio, jitter_algorithm)) != ERROR_SUCCESS) { return ret; } char* payload = audio->payload; int size = audio->size; int64_t timestamp = plan->filter_timestamp(audio->timestamp); if ((ret = enc->write_audio(timestamp, payload, size)) != ERROR_SUCCESS) { return ret; } if ((ret = on_update_duration(audio)) != ERROR_SUCCESS) { return ret; } return ret; } int SrsFlvSegment::write_video(SrsSharedPtrMessage* shared_video) { int ret = ERROR_SUCCESS; SrsSharedPtrMessage* video = shared_video->copy(); SrsAutoFree(SrsSharedPtrMessage, video); char* payload = video->payload; int size = video->size; bool is_sequence_header = SrsFlvCodec::video_is_sequence_header(payload, size); #ifdef SRS_AUTO_HTTP_CALLBACK bool is_key_frame = SrsFlvCodec::video_is_h264(payload, size) && SrsFlvCodec::video_is_keyframe(payload, size) && !is_sequence_header; if (is_key_frame) { has_keyframe = true; if ((ret = plan->on_video_keyframe()) != ERROR_SUCCESS) { return ret; } } srs_verbose("dvr video is key: %d", is_key_frame); #endif // accept the sequence header here. // when got no keyframe, ignore when should wait keyframe. if (!has_keyframe && !is_sequence_header) { bool wait_keyframe = _srs_config->get_dvr_wait_keyframe(req->vhost); if (wait_keyframe) { srs_info("dvr: ignore when wait keyframe."); return ret; } } if ((jitter->correct(video, jitter_algorithm)) != ERROR_SUCCESS) { return ret; } // update segment duration, session plan just update the duration, // the segment plan will reap segment if exceed, this video will write to next segment. if ((ret = on_update_duration(video)) != ERROR_SUCCESS) { return ret; } int32_t timestamp = (int32_t)plan->filter_timestamp(video->timestamp); if ((ret = enc->write_video(timestamp, payload, size)) != ERROR_SUCCESS) { return ret; } return ret; } int SrsFlvSegment::update_flv_metadata() { int ret = ERROR_SUCCESS; // no duration or filesize specified. if (!duration_offset || !filesize_offset) { return ret; } int64_t cur = fs->tellg(); // buffer to write the size. char* buf = new char[SrsAmf0Size::number()]; SrsAutoFreeA(char, buf); SrsStream stream; if ((ret = stream.initialize(buf, SrsAmf0Size::number())) != ERROR_SUCCESS) { return ret; } // filesize to buf. SrsAmf0Any* size = SrsAmf0Any::number((double)cur); SrsAutoFree(SrsAmf0Any, size); stream.skip(-1 * stream.pos()); if ((ret = size->write(&stream)) != ERROR_SUCCESS) { return ret; } // update the flesize. fs->lseek(filesize_offset); if ((ret = fs->write(buf, SrsAmf0Size::number(), NULL)) != ERROR_SUCCESS) { return ret; } // duration to buf SrsAmf0Any* dur = SrsAmf0Any::number((double)duration / 1000.0); SrsAutoFree(SrsAmf0Any, dur); stream.skip(-1 * stream.pos()); if ((ret = dur->write(&stream)) != ERROR_SUCCESS) { return ret; } // update the duration fs->lseek(duration_offset); if ((ret = fs->write(buf, SrsAmf0Size::number(), NULL)) != ERROR_SUCCESS) { return ret; } // reset the offset. fs->lseek(cur); return ret; } string SrsFlvSegment::get_path() { return path; } string SrsFlvSegment::generate_path() { // the path in config, for example, // /data/[vhost]/[app]/[stream]/[2006]/[01]/[02]/[15].[04].[05].[999].flv std::string path_config = _srs_config->get_dvr_path(req->vhost); // add [stream].[timestamp].flv as filename for dir if (path_config.find(".flv") != path_config.length() - 4) { path_config += "/[stream].[timestamp].flv"; } // the flv file path std::string flv_path = path_config; flv_path = srs_path_build_stream(flv_path, req->vhost, req->app, req->stream); flv_path = srs_path_build_timestamp(flv_path); return flv_path; } int SrsFlvSegment::create_jitter(bool loads_from_flv) { int ret = ERROR_SUCCESS; // when path exists, use exists jitter. if (!loads_from_flv) { // jitter when publish, ensure whole stream start from 0. srs_freep(jitter); jitter = new SrsRtmpJitter(); // fresh stream starting. starttime = -1; stream_previous_pkt_time = -1; stream_starttime = srs_update_system_time_ms(); stream_duration = 0; // fresh segment starting. has_keyframe = false; duration = 0; return ret; } // when jitter ok, do nothing. if (jitter) { return ret; } // always ensure the jitter crote. // for the first time, initialize jitter from exists file. jitter = new SrsRtmpJitter(); // TODO: FIXME: implements it. return ret; } int SrsFlvSegment::on_update_duration(SrsSharedPtrMessage* msg) { int ret = ERROR_SUCCESS; // we must assumpt that the stream timestamp is monotonically increase, // that is, always use time jitter to correct the timestamp. // except the time jitter is disabled in config. // set the segment starttime at first time if (starttime < 0) { starttime = msg->timestamp; } // no previous packet or timestamp overflow. if (stream_previous_pkt_time < 0 || stream_previous_pkt_time > msg->timestamp) { stream_previous_pkt_time = msg->timestamp; } // collect segment and stream duration, timestamp overflow is ok. duration += msg->timestamp - stream_previous_pkt_time; stream_duration += msg->timestamp - stream_previous_pkt_time; // update previous packet time stream_previous_pkt_time = msg->timestamp; return ret; } int SrsFlvSegment::on_reload_vhost_dvr(std::string /*vhost*/) { int ret = ERROR_SUCCESS; jitter_algorithm = (SrsRtmpJitterAlgorithm)_srs_config->get_dvr_time_jitter(req->vhost); return ret; } SrsDvrAsyncCallOnDvr::SrsDvrAsyncCallOnDvr(int c, SrsRequest* r, string p) { cid = c; req = r->copy(); path = p; } SrsDvrAsyncCallOnDvr::~SrsDvrAsyncCallOnDvr() { srs_freep(req); } int SrsDvrAsyncCallOnDvr::call() { int ret = ERROR_SUCCESS; #ifdef SRS_AUTO_HTTP_CALLBACK if (!_srs_config->get_vhost_http_hooks_enabled(req->vhost)) { return ret; } // the http hooks will cause context switch, // so we must copy all hooks for the on_connect may freed. // @see https://github.com/ossrs/srs/issues/475 vector<string> hooks; if (true) { SrsConfDirective* conf = _srs_config->get_vhost_on_dvr(req->vhost); if (!conf) { srs_info("ignore the empty http callback: on_dvr"); return ret; } hooks = conf->args; } for (int i = 0; i < (int)hooks.size(); i++) { std::string url = hooks.at(i); if ((ret = SrsHttpHooks::on_dvr(cid, url, req, path)) != ERROR_SUCCESS) { srs_error("hook client on_dvr failed. url=%s, ret=%d", url.c_str(), ret); return ret; } } #endif return ret; } string SrsDvrAsyncCallOnDvr::to_string() { std::stringstream ss; ss << "vhost=" << req->vhost << ", file=" << path; return ss.str(); } SrsDvrPlan::SrsDvrPlan() { req = NULL; dvr_enabled = false; segment = new SrsFlvSegment(this); async = new SrsAsyncCallWorker(); } SrsDvrPlan::~SrsDvrPlan() { srs_freep(segment); srs_freep(async); } int SrsDvrPlan::initialize(SrsRequest* r) { int ret = ERROR_SUCCESS; req = r; if ((ret = segment->initialize(r)) != ERROR_SUCCESS) { return ret; } if ((ret = async->start()) != ERROR_SUCCESS) { return ret; } return ret; } int SrsDvrPlan::on_video_keyframe() { return ERROR_SUCCESS; } int64_t SrsDvrPlan::filter_timestamp(int64_t timestamp) { return timestamp; } int SrsDvrPlan::on_meta_data(SrsSharedPtrMessage* shared_metadata) { int ret = ERROR_SUCCESS; if (!dvr_enabled) { return ret; } return segment->write_metadata(shared_metadata); } int SrsDvrPlan::on_audio(SrsSharedPtrMessage* shared_audio) { int ret = ERROR_SUCCESS; if (!dvr_enabled) { return ret; } if ((ret = segment->write_audio(shared_audio)) != ERROR_SUCCESS) { return ret; } return ret; } int SrsDvrPlan::on_video(SrsSharedPtrMessage* shared_video) { int ret = ERROR_SUCCESS; if (!dvr_enabled) { return ret; } if ((ret = segment->write_video(shared_video)) != ERROR_SUCCESS) { return ret; } return ret; } int SrsDvrPlan::on_reap_segment() { int ret = ERROR_SUCCESS; int cid = _srs_context->get_id(); if ((ret = async->execute(new SrsDvrAsyncCallOnDvr(cid, req, segment->get_path()))) != ERROR_SUCCESS) { return ret; } return ret; } SrsDvrPlan* SrsDvrPlan::create_plan(string vhost) { std::string plan = _srs_config->get_dvr_plan(vhost); if (srs_config_dvr_is_plan_segment(plan)) { return new SrsDvrSegmentPlan(); } else if (srs_config_dvr_is_plan_session(plan)) { return new SrsDvrSessionPlan(); } else if (srs_config_dvr_is_plan_append(plan)) { return new SrsDvrAppendPlan(); } else { srs_error("invalid dvr plan=%s, vhost=%s", plan.c_str(), vhost.c_str()); srs_assert(false); } } SrsDvrSessionPlan::SrsDvrSessionPlan() { } SrsDvrSessionPlan::~SrsDvrSessionPlan() { } int SrsDvrSessionPlan::on_publish() { int ret = ERROR_SUCCESS; // support multiple publish. if (dvr_enabled) { return ret; } if (!_srs_config->get_dvr_enabled(req->vhost)) { return ret; } if ((ret = segment->close()) != ERROR_SUCCESS) { return ret; } if ((ret = segment->open()) != ERROR_SUCCESS) { return ret; } dvr_enabled = true; return ret; } void SrsDvrSessionPlan::on_unpublish() { // support multiple publish. if (!dvr_enabled) { return; } // ignore error. int ret = segment->close(); if (ret != ERROR_SUCCESS) { srs_warn("ignore flv close error. ret=%d", ret); } dvr_enabled = false; } SrsDvrAppendPlan::SrsDvrAppendPlan() { last_update_time = 0; } SrsDvrAppendPlan::~SrsDvrAppendPlan() { } int SrsDvrAppendPlan::on_publish() { int ret = ERROR_SUCCESS; // support multiple publish. if (dvr_enabled) { return ret; } if (!_srs_config->get_dvr_enabled(req->vhost)) { return ret; } if ((ret = segment->open(false)) != ERROR_SUCCESS) { return ret; } dvr_enabled = true; return ret; } void SrsDvrAppendPlan::on_unpublish() { } int SrsDvrAppendPlan::on_audio(SrsSharedPtrMessage* shared_audio) { int ret = ERROR_SUCCESS; if ((ret = update_duration(shared_audio)) != ERROR_SUCCESS) { return ret; } if ((ret = SrsDvrPlan::on_audio(shared_audio)) != ERROR_SUCCESS) { return ret; } return ret; } int SrsDvrAppendPlan::on_video(SrsSharedPtrMessage* shared_video) { int ret = ERROR_SUCCESS; if ((ret = update_duration(shared_video)) != ERROR_SUCCESS) { return ret; } if ((ret = SrsDvrPlan::on_video(shared_video)) != ERROR_SUCCESS) { return ret; } return ret; } int SrsDvrAppendPlan::update_duration(SrsSharedPtrMessage* msg) { int ret = ERROR_SUCCESS; if (last_update_time <= 0) { last_update_time = msg->timestamp; return ret; } if (msg->timestamp < last_update_time) { last_update_time = msg->timestamp; return ret; } if (SRS_DVR_UPDATE_DURATION_INTERVAL > msg->timestamp - last_update_time) { return ret; } last_update_time = msg->timestamp; srs_assert(segment); if (!segment->update_flv_metadata()) { return ret; } return ret; } SrsDvrSegmentPlan::SrsDvrSegmentPlan() { segment_duration = -1; metadata = sh_video = sh_audio = NULL; } SrsDvrSegmentPlan::~SrsDvrSegmentPlan() { srs_freep(sh_video); srs_freep(sh_audio); srs_freep(metadata); } int SrsDvrSegmentPlan::initialize(SrsRequest* req) { int ret = ERROR_SUCCESS; if ((ret = SrsDvrPlan::initialize(req)) != ERROR_SUCCESS) { return ret; } segment_duration = _srs_config->get_dvr_duration(req->vhost); // to ms segment_duration *= 1000; return ret; } int SrsDvrSegmentPlan::on_publish() { int ret = ERROR_SUCCESS; // support multiple publish. if (dvr_enabled) { return ret; } if (!_srs_config->get_dvr_enabled(req->vhost)) { return ret; } if ((ret = segment->close()) != ERROR_SUCCESS) { return ret; } if ((ret = segment->open()) != ERROR_SUCCESS) { return ret; } dvr_enabled = true; return ret; } void SrsDvrSegmentPlan::on_unpublish() { } int SrsDvrSegmentPlan::on_meta_data(SrsSharedPtrMessage* shared_metadata) { int ret = ERROR_SUCCESS; srs_freep(metadata); metadata = shared_metadata->copy(); if ((ret = SrsDvrPlan::on_meta_data(shared_metadata)) != ERROR_SUCCESS) { return ret; } return ret; } int SrsDvrSegmentPlan::on_audio(SrsSharedPtrMessage* shared_audio) { int ret = ERROR_SUCCESS; if (SrsFlvCodec::audio_is_sequence_header(shared_audio->payload, shared_audio->size)) { srs_freep(sh_audio); sh_audio = shared_audio->copy(); } if ((ret = update_duration(shared_audio)) != ERROR_SUCCESS) { return ret; } if ((ret = SrsDvrPlan::on_audio(shared_audio)) != ERROR_SUCCESS) { return ret; } return ret; } int SrsDvrSegmentPlan::on_video(SrsSharedPtrMessage* shared_video) { int ret = ERROR_SUCCESS; if (SrsFlvCodec::video_is_sequence_header(shared_video->payload, shared_video->size)) { srs_freep(sh_video); sh_video = shared_video->copy(); } if ((ret = update_duration(shared_video)) != ERROR_SUCCESS) { return ret; } if ((ret = SrsDvrPlan::on_video(shared_video)) != ERROR_SUCCESS) { return ret; } return ret; } int SrsDvrSegmentPlan::update_duration(SrsSharedPtrMessage* msg) { int ret = ERROR_SUCCESS; srs_assert(segment); // ignore if duration ok. if (segment_duration <= 0 || !segment->is_overflow(segment_duration)) { return ret; } // when wait keyframe, ignore if no frame arrived. // @see https://github.com/ossrs/srs/issues/177 if (_srs_config->get_dvr_wait_keyframe(req->vhost)) { if (!msg->is_video()) { return ret; } char* payload = msg->payload; int size = msg->size; bool is_key_frame = SrsFlvCodec::video_is_h264(payload, size) && SrsFlvCodec::video_is_keyframe(payload, size) && !SrsFlvCodec::video_is_sequence_header(payload, size); if (!is_key_frame) { return ret; } } // reap segment if ((ret = segment->close()) != ERROR_SUCCESS) { return ret; } // open new flv file if ((ret = segment->open()) != ERROR_SUCCESS) { return ret; } // update sequence header if (metadata && (ret = SrsDvrPlan::on_meta_data(metadata)) != ERROR_SUCCESS) { return ret; } if (sh_video && (ret = SrsDvrPlan::on_video(sh_video)) != ERROR_SUCCESS) { return ret; } if (sh_audio && (ret = SrsDvrPlan::on_audio(sh_audio)) != ERROR_SUCCESS) { return ret; } return ret; } SrsDvr::SrsDvr() { source = NULL; plan = NULL; } SrsDvr::~SrsDvr() { srs_freep(plan); } int SrsDvr::initialize(SrsSource* s, SrsRequest* r) { int ret = ERROR_SUCCESS; source = s; srs_freep(plan); plan = SrsDvrPlan::create_plan(r->vhost); if ((ret = plan->initialize(r)) != ERROR_SUCCESS) { return ret; } if ((ret = source->on_dvr_request_sh()) != ERROR_SUCCESS) { return ret; } return ret; } int SrsDvr::on_publish(SrsRequest* /*r*/) { int ret = ERROR_SUCCESS; if ((ret = plan->on_publish()) != ERROR_SUCCESS) { return ret; } return ret; } void SrsDvr::on_unpublish() { plan->on_unpublish(); } // TODO: FIXME: source should use shared message instead. int SrsDvr::on_meta_data(SrsOnMetaDataPacket* m) { int ret = ERROR_SUCCESS; int size = 0; char* payload = NULL; if ((ret = m->encode(size, payload)) != ERROR_SUCCESS) { return ret; } SrsSharedPtrMessage metadata; if ((ret = metadata.create(NULL, payload, size)) != ERROR_SUCCESS) { return ret; } if ((ret = plan->on_meta_data(&metadata)) != ERROR_SUCCESS) { return ret; } return ret; } int SrsDvr::on_audio(SrsSharedPtrMessage* shared_audio) { return plan->on_audio(shared_audio); } int SrsDvr::on_video(SrsSharedPtrMessage* shared_video) { return plan->on_video(shared_video); } #endif
{ "content_hash": "eb53911d31f45257442762bd4e10ec2b", "timestamp": "", "source": "github", "line_count": 1032, "max_line_length": 107, "avg_line_length": 23.563953488372093, "alnum_prop": 0.592565178057406, "repo_name": "lewdon/srs", "id": "f0502738a8ca79df8cbefcd8916760a898874f63", "size": "25405", "binary": false, "copies": "4", "ref": "refs/heads/2.0release", "path": "trunk/src/app/srs_app_dvr.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "ActionScript", "bytes": "88146" }, { "name": "Assembly", "bytes": "3935" }, { "name": "C", "bytes": "191199" }, { "name": "C++", "bytes": "3292096" }, { "name": "CMake", "bytes": "3918" }, { "name": "HTML", "bytes": "104779" }, { "name": "JavaScript", "bytes": "75056" }, { "name": "Makefile", "bytes": "10029" }, { "name": "Python", "bytes": "37154" }, { "name": "QMake", "bytes": "704" }, { "name": "Shell", "bytes": "169361" } ], "symlink_target": "" }
using System.Net; using System.Net.Http; using FluentAssertions; using Microsoft.Azure.WebJobs; using Microsoft.Azure.WebJobs.Extensions.Timers; using Microsoft.Extensions.Logging; using Moq; using Xunit; using Yarm.FunctionApp.Tests.Fixtures; using Yarm.Functions; namespace Yarm.FunctionApp.Tests { /// <summary> /// This represents the test entity for the <see cref="GetArmTemplateDirectoriesTimerTrigger"/> class. /// </summary> public class GetArmTemplateDirectoriesTimerTriggerTests : FunctionTriggerTests, IClassFixture<FunctionTriggerFixture> { private readonly FunctionTriggerFixture _fixture; private readonly Mock<ILogger> _log; /// <summary> /// Initializes a new instance of the <see cref="GetArmTemplateDirectoriesTimerTriggerTests"/> class. /// </summary> /// <param name="fixture"><see cref="FunctionTriggerFixture"/> instance.</param> public GetArmTemplateDirectoriesTimerTriggerTests(FunctionTriggerFixture fixture) { this._fixture = fixture; this._log = fixture.Log; } /// <summary> /// Tests whether the method should return result or not. /// </summary> /// <param name="statusCode"><see cref="HttpStatusCode"/> value.</param> [Theory] [InlineData(HttpStatusCode.OK)] public async void Given_Instance_InvokeAsync_ShouldReturn_Response(HttpStatusCode statusCode) { this.Timer = new TimerInfo(new Mock<TimerSchedule>().Object, new ScheduleStatus()); var factory = this._fixture.GetFunctionFactory(out Mock<IGetArmTemplateDirectoriesTimerFunction> function); GetArmTemplateDirectoriesTimerTrigger.FunctionFactory = factory.Object; await GetArmTemplateDirectoriesTimerTrigger.Run(this.Timer, this._log.Object).ConfigureAwait(false); } } }
{ "content_hash": "4880dc3f26dd05f2a16dc219f32eecc9", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 121, "avg_line_length": 35.333333333333336, "alnum_prop": 0.6939203354297694, "repo_name": "aliencube/yarm", "id": "323b8ca9462f9937eab9511b9c760e151b710893", "size": "1910", "binary": false, "copies": "1", "ref": "refs/heads/dev", "path": "test/Yarm.FunctionApp.Tests/GetArmTemplateDirectoriesTimerTriggerTests.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "222217" }, { "name": "PowerShell", "bytes": "10043" } ], "symlink_target": "" }
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>FST - Jack Robinson</title> <meta name="description" content="Keep track of the statistics from Jack Robinson. Average heat score, heat wins, heat wins percentage, epic heats road to the final"> <meta name="author" content=""> <link rel="apple-touch-icon" sizes="57x57" href="/favicon/apple-icon-57x57.png"> <link rel="apple-touch-icon" sizes="60x60" href="/favicon/apple-icon-60x60.png"> <link rel="apple-touch-icon" sizes="72x72" href="/favicon/apple-icon-72x72.png"> <link rel="apple-touch-icon" sizes="76x76" href="/favicon/apple-icon-76x76.png"> <link rel="apple-touch-icon" sizes="114x114" href="/favicon/apple-icon-114x114.png"> <link rel="apple-touch-icon" sizes="120x120" href="/favicon/apple-icon-120x120.png"> <link rel="apple-touch-icon" sizes="144x144" href="/favicon/apple-icon-144x144.png"> <link rel="apple-touch-icon" sizes="152x152" href="/favicon/apple-icon-152x152.png"> <link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-icon-180x180.png"> <link rel="icon" type="image/png" sizes="192x192" href="/favicon/android-icon-192x192.png"> <link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="96x96" href="/favicon/favicon-96x96.png"> <link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png"> <link rel="manifest" href="/manifest.json"> <meta name="msapplication-TileColor" content="#ffffff"> <meta name="msapplication-TileImage" content="/ms-icon-144x144.png"> <meta name="theme-color" content="#ffffff"> <meta property="og:title" content="Fantasy Surfing tips"/> <meta property="og:image" content="https://fantasysurfingtips.com/img/just_waves.png"/> <meta property="og:description" content="See how great Jack Robinson is surfing this year"/> <!-- Bootstrap Core CSS - Uses Bootswatch Flatly Theme: https://bootswatch.com/flatly/ --> <link href="https://fantasysurfingtips.com/css/bootstrap.css" rel="stylesheet"> <!-- Custom CSS --> <link href="https://fantasysurfingtips.com/css/freelancer.css" rel="stylesheet"> <link href="https://cdn.datatables.net/plug-ins/1.10.7/integration/bootstrap/3/dataTables.bootstrap.css" rel="stylesheet" /> <!-- Custom Fonts --> <link href="https://fantasysurfingtips.com/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css"> <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css"> <script src="https://code.jquery.com/jquery-2.x-git.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-ujs/1.2.1/rails.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js"></script> <script src="https://www.w3schools.com/lib/w3data.js"></script> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <script> (adsbygoogle = window.adsbygoogle || []).push({ google_ad_client: "ca-pub-2675412311042802", enable_page_level_ads: true }); </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_GB/sdk.js#xfbml=1&version=v2.6"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <!-- Navigation --> <div w3-include-html="https://fantasysurfingtips.com/layout/header.html"></div> <!-- Header --> <div w3-include-html="https://fantasysurfingtips.com/layout/sponsor.html"></div> <section > <div class="container"> <div class="row"> <div class="col-sm-3 "> <div class="col-sm-2 "> </div> <div class="col-sm-8 "> <!-- <img src="http://fantasysurfingtips.com/img/surfers/jrob.png" class="img-responsive" alt=""> --> <h3 style="text-align:center;">Jack Robinson</h3> <a href="https://twitter.com/share" class="" data-via="fansurfingtips"><i class="fa fa-twitter"></i> Share on Twitter</i></a> <br/> <a class="fb-xfbml-parse-ignore" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Ffantasysurfingtips.com%2Fsurfers%2Fjrob&amp;src=sdkpreparse"><i class="fa fa-facebook"></i> Share on Facebook</a> </div> <div class="col-sm-2 "> </div> </div> <div class="col-sm-3 portfolio-item"> </div> <div class="col-sm-3 portfolio-item"> <h6 style="text-align:center;">Avg Heat Score (FST DATA)</h6> <h1 style="text-align:center;">11.12</h1> </div> </div> <hr/> <h4 style="text-align:center;" >Competitions</h4> <h4 style="text-align:center;" >Epic Battles</h4> <div class="row"> <div class="col-sm-6 "> <p style="text-align:center;">Surfed <b>2</b> heats against <a href="http://fantasysurfingtips.com/surfers/mqs/scou.html"> Samson Coulter</a> <br/> <b>won 2</b> and <b>lost 0</b></p> </div> <div class="col-sm-6 "> <p style="text-align:center;">Surfed <b>6</b> heats against <a href="http://fantasysurfingtips.com/surfers/mqs/fmcg.html"> Finn McGill</a> <br/> <b>won 0</b> and <b>lost 6</b></p> </div> </div> <hr/> <h4 style="text-align:center;" >Heat Stats (FST data)</h4> <div class="row"> <div class="col-sm-4 portfolio-item"> <h6 style="text-align:center;">Heats</h6> <h2 style="text-align:center;">113</h2> </div> <div class="col-sm-4 portfolio-item"> <h6 style="text-align:center;">Heat wins</h6> <h2 style="text-align:center;">29</h2> </div> <div class="col-sm-4 portfolio-item"> <h6 style="text-align:center;">HEAT WINS PERCENTAGE</h6> <h2 style="text-align:center;">25.66%</h2> </div> </div> <hr/> <h4 style="text-align:center;">Avg Heat Score progression</h4> <div id="avg_chart" style="height: 250px;"></div> <hr/> <h4 style="text-align:center;">Heat stats progression</h4> <div id="heat_chart" style="height: 250px;"></div> <hr/> <style type="text/css"> .heats-all{ z-index: 3; margin-left: 5px; cursor: pointer; } </style> <div class="container"> <div id="disqus_thread"></div> <script> /** * RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS. * LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/ var disqus_config = function () { this.page.url = "http://fantasysurfingtips.com/surfers/jrob"; // Replace PAGE_URL with your page's canonical URL variable this.page.identifier = '1076'; // Replace PAGE_IDENTIFIER with your page's unique identifier variable }; (function() { // DON'T EDIT BELOW THIS LINE var d = document, s = d.createElement('script'); s.src = '//fantasysurfingtips.disqus.com/embed.js'; s.setAttribute('data-timestamp', +new Date()); (d.head || d.body).appendChild(s); })(); </script> <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> </div> </section> <script type="text/javascript"> $('.heats-all').click(function(){ $('.heats-all-stat').css('display', 'none') $('#'+$(this).attr('id')+'-stat').css('display', 'block') }); $('.heats-2016').click(function(){ $('.heats-2016-stat').css('display', 'none') $('#'+$(this).attr('id')+'-stat').css('display', 'block') }); $('document').ready(function(){ new Morris.Line({ // ID of the element in which to draw the chart. element: 'avg_chart', // Chart data records -- each entry in this array corresponds to a point on // the chart. data: [], // The name of the data record attribute that contains x-values. xkey: 'year', // A list of names of data record attributes that contain y-values. ykeys: ['avg', 'avg_all'], // Labels for the ykeys -- will be displayed when you hover over the // chart. labels: ['Avg score in year', 'Avg score FST DATA'] }); new Morris.Bar({ // ID of the element in which to draw the chart. element: 'heat_chart', // Chart data records -- each entry in this array corresponds to a point on // the chart. data: [], // The name of the data record attribute that contains x-values. xkey: 'year', // A list of names of data record attributes that contain y-values. ykeys: ['heats', 'wins', 'percs'], // Labels for the ykeys -- will be displayed when you hover over the // chart. labels: ['Heats surfed', 'Heats won', 'Winning percentage'] }); }); </script> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script> <!-- Footer --> <div w3-include-html="https://fantasysurfingtips.com/layout/footer.html"></div> <script type="text/javascript"> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-74337819-1', 'auto'); // Replace with your property ID. ga('send', 'pageview'); </script> <script> w3IncludeHTML(); </script> <!-- jQuery --> <script src="https://fantasysurfingtips.com/js/jquery.js"></script> <script src="https://cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js"></script> <!-- Bootstrap Core JavaScript --> <script src="https://fantasysurfingtips.com/js/bootstrap.min.js"></script> <!-- Plugin JavaScript --> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script> <script src="https://fantasysurfingtips.com/js/classie.js"></script> <script src="https://fantasysurfingtips.com/js/cbpAnimatedHeader.js"></script> <!-- Contact Form JavaScript --> <script src="https://fantasysurfingtips.com/js/jqBootstrapValidation.js"></script> <script src="https://fantasysurfingtips.com/js/contact_me.js"></script> <!-- Custom Theme JavaScript --> <script src="https://fantasysurfingtips.com/js/freelancer.js"></script> <script type="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script> <script type="https://cdn.datatables.net/1.10.12/js/dataTables.bootstrap.min.js"></script> </body> </html>
{ "content_hash": "d1e2650a19391d4c7ab1f4df1252f0ba", "timestamp": "", "source": "github", "line_count": 296, "max_line_length": 295, "avg_line_length": 40.13175675675676, "alnum_prop": 0.6248842495159526, "repo_name": "chicofilho/fst", "id": "c887b1e43c4e62aa180194405fbd19d1223f61c9", "size": "11879", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "surfers/mqs/jrob.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "25157" }, { "name": "HTML", "bytes": "114679577" }, { "name": "JavaScript", "bytes": "43263" }, { "name": "PHP", "bytes": "1097" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <link rel="stylesheet" href="http://yui.yahooapis.com/3.8.0/build/cssgrids/cssgrids-min.css"> <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css"> <link rel="stylesheet" href="../assets/css/main.css" id="site_styles"> <link rel="shortcut icon" type="image/png" href="../assets/EaselJS_16x16.png"> <script src="http://yui.yahooapis.com/3.10.1/build/yui/yui-min.js"></script> <title>EaselJS v0.7.0 API Documentation : ColorMatrixFilter</title> </head> <body class="yui3-skin-sam"> <div id="doc"> <div id="hd" class="yui3-g header"> <div class="yui3-u-3-4"> <h1><a href="http://www.createjs.com/#!/EaselJS"><img src="http://createjs.com/resources/SuiteIcons/EaselJS/docs-icon-EaselJS.png" title="EaselJS"></a></h1> </div> <div class="yui3-u-1-4 version"> <em>API Documentation for: 0.7.0</em> </div> </div> <div id="bd" class="yui3-g"> <div class="yui3-u-1-4"> <div id="docs-sidebar" class="sidebar apidocs"> <div id="api-list"> <h2 class="off-left">APIs</h2> <div id="api-tabview" class="tabview"> <ul class="tabs"> <li><a href="#api-classes">Classes</a></li> </ul> <div id="api-tabview-filter"> <input type="search" id="api-filter" placeholder="Type to filter APIs"> </div> <div id="api-tabview-panel"> <ul id="api-classes" class="apis classes"> <li><a href="../classes/AlphaMapFilter.html">AlphaMapFilter</a></li> <li><a href="../classes/AlphaMaskFilter.html">AlphaMaskFilter</a></li> <li><a href="../classes/Bitmap.html">Bitmap</a></li> <li><a href="../classes/BitmapAnimation.html">BitmapAnimation</a></li> <li><a href="../classes/BitmapText.html">BitmapText</a></li> <li><a href="../classes/BlurFilter.html">BlurFilter</a></li> <li><a href="../classes/ButtonHelper.html">ButtonHelper</a></li> <li><a href="../classes/ColorFilter.html">ColorFilter</a></li> <li><a href="../classes/ColorMatrix.html">ColorMatrix</a></li> <li><a href="../classes/ColorMatrixFilter.html">ColorMatrixFilter</a></li> <li><a href="../classes/Command.html">Command</a></li> <li><a href="../classes/Container.html">Container</a></li> <li><a href="../classes/DisplayObject.html">DisplayObject</a></li> <li><a href="../classes/DOMElement.html">DOMElement</a></li> <li><a href="../classes/EaselJS.html">EaselJS</a></li> <li><a href="../classes/Event.html">Event</a></li> <li><a href="../classes/EventDispatcher.html">EventDispatcher</a></li> <li><a href="../classes/Filter.html">Filter</a></li> <li><a href="../classes/Graphics.html">Graphics</a></li> <li><a href="../classes/Matrix2D.html">Matrix2D</a></li> <li><a href="../classes/MouseEvent.html">MouseEvent</a></li> <li><a href="../classes/MovieClip.html">MovieClip</a></li> <li><a href="../classes/MovieClipPlugin.html">MovieClipPlugin</a></li> <li><a href="../classes/Point.html">Point</a></li> <li><a href="../classes/Rectangle.html">Rectangle</a></li> <li><a href="../classes/Shadow.html">Shadow</a></li> <li><a href="../classes/Shape.html">Shape</a></li> <li><a href="../classes/Sprite.html">Sprite</a></li> <li><a href="../classes/SpriteSheet.html">SpriteSheet</a></li> <li><a href="../classes/SpriteSheetBuilder.html">SpriteSheetBuilder</a></li> <li><a href="../classes/SpriteSheetUtils.html">SpriteSheetUtils</a></li> <li><a href="../classes/Stage.html">Stage</a></li> <li><a href="../classes/Text.html">Text</a></li> <li><a href="../classes/Ticker.html">Ticker</a></li> <li><a href="../classes/Touch.html">Touch</a></li> <li><a href="../classes/UID.html">UID</a></li> <li><a href="../classes/Utility Methods.html">Utility Methods</a></li> </ul> <ul id="api-modules" class="apis modules"> <li><a href="../modules/CreateJS.html">CreateJS</a></li> <li><a href="../modules/EaselJS.html">EaselJS</a></li> </ul> </div> </div> </div> </div> </div> <div class="yui3-u-3-4"> <div id="api-options"> Show: <label for="api-show-inherited"> <input type="checkbox" id="api-show-inherited" checked> Inherited </label> <label for="api-show-protected"> <input type="checkbox" id="api-show-protected"> Protected </label> <label for="api-show-private"> <input type="checkbox" id="api-show-private"> Private </label> <label for="api-show-deprecated"> <input type="checkbox" id="api-show-deprecated"> Deprecated </label> </div> <div class="apidocs"> <div id="docs-main"> <div class="content"> <h1>ColorMatrixFilter Class</h1> <div class="box meta"> <div class="extends"> Extends <a href="../classes/Filter.html" class="crosslink">Filter</a> </div> <div class="foundat"> Defined in: <a href="../files/.._src_easeljs_filters_ColorMatrixFilter.js.html#l39"><code>ColorMatrixFilter:39</code></a> </div> Module: <a href="../modules/EaselJS.html">EaselJS</a> </div> <div class="box intro"> <p>Allows you to carry out complex color operations such as modifying saturation, brightness, or inverting. See the <a href="../classes/ColorMatrix.html" class="crosslink">ColorMatrix</a> for more information on changing colors. For an easier color transform, consider the <a href="../classes/ColorFilter.html" class="crosslink">ColorFilter</a>.</p> <p><h4>Example</h4> This example creates a red circle, inverts its hue, and then saturates it to brighten it up.</p> <pre class="code prettyprint"><code> var shape = new createjs.Shape().set({x:100,y:100}); shape.graphics.beginFill("#ff0000").drawCircle(0,0,50); var matrix = new createjs.ColorMatrix().adjustHue(180).adjustSaturation(100); shape.filters = [ new createjs.ColorMatrixFilter(matrix) ]; shape.cache(-50, -50, 100, 100);</code></pre> <p>See <a href="../classes/Filter.html" class="crosslink">Filter</a> for an more information on applying filters.</p> </div> <div class="constructor"> <h2>Constructor</h2> <div id="method_ColorMatrixFilter" class="method item"> <h3 class="name"><code>ColorMatrixFilter</code></h3> <div class="args"> <span class="paren">(</span><ul class="args-list inline commas"> <li class="arg"> <code>matrix</code> </li> </ul><span class="paren">)</span> </div> <div class="meta"> <p> Defined in <a href="../files/.._src_easeljs_filters_ColorMatrixFilter.js.html#l39"><code>ColorMatrixFilter:39</code></a> </p> </div> <div class="description"> </div> <div class="params"> <h4>Parameters:</h4> <ul class="params-list"> <li class="param"> <code class="param-name">matrix</code> <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array" class="crosslink external" target="_blank">Array</a></span> <div class="param-description"> <p>A 4x5 matrix describing the color operation to perform. See also the <a href="../classes/ColorMatrix.html" class="crosslink">ColorMatrix</a> class.</p> </div> </li> </ul> </div> </div> </div> <div id="classdocs" class="tabview"> <ul class="api-class-tabs"> <li class="api-class-tab index"><a href="#index">Index</a></li> <li class="api-class-tab methods"><a href="#methods">Methods</a></li> </ul> <div> <div id="index" class="api-class-tabpanel index"> <h2 class="off-left">Item Index</h2> <div class="index-section methods"> <h3>Methods</h3> <ul class="index-list methods extends"> <li class="index-item method inherited"> <a href="#method_applyFilter">applyFilter</a> </li> <li class="index-item method inherited"> <a href="#method_clone">clone</a> </li> <li class="index-item method inherited"> <a href="#method_getBounds">getBounds</a> </li> <li class="index-item method protected inherited"> <a href="#method_initialize">initialize</a> </li> <li class="index-item method inherited"> <a href="#method_toString">toString</a> </li> </ul> </div> </div> <div id="methods" class="api-class-tabpanel"> <h2 class="off-left">Methods</h2> <div id="method_applyFilter" class="method item inherited"> <h3 class="name"><code>applyFilter</code></h3> <div class="args"> <span class="paren">(</span><ul class="args-list inline commas"> <li class="arg"> <code>ctx</code> </li> <li class="arg"> <code>x</code> </li> <li class="arg"> <code>y</code> </li> <li class="arg"> <code>width</code> </li> <li class="arg"> <code>height</code> </li> <li class="arg"> <code class="optional">[targetCtx]</code> </li> <li class="arg"> <code class="optional">[targetX]</code> </li> <li class="arg"> <code class="optional">[targetY]</code> </li> </ul><span class="paren">)</span> </div> <span class="returns-inline"> <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span> </span> <div class="meta"> <p>Inherited from <a href="../classes/Filter.html#method_applyFilter">Filter</a>: <a href="../files/.._src_easeljs_filters_Filter.js.html#l93"><code>applyFilter:93</code></a> </p> </div> <div class="description"> <p>Applies the filter to the specified context.</p> </div> <div class="params"> <h4>Parameters:</h4> <ul class="params-list"> <li class="param"> <code class="param-name">ctx</code> <span class="type">CanvasRenderingContext2D</span> <div class="param-description"> <p>The 2D context to use as the source.</p> </div> </li> <li class="param"> <code class="param-name">x</code> <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span> <div class="param-description"> <p>The x position to use for the source rect.</p> </div> </li> <li class="param"> <code class="param-name">y</code> <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span> <div class="param-description"> <p>The y position to use for the source rect.</p> </div> </li> <li class="param"> <code class="param-name">width</code> <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span> <div class="param-description"> <p>The width to use for the source rect.</p> </div> </li> <li class="param"> <code class="param-name">height</code> <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span> <div class="param-description"> <p>The height to use for the source rect.</p> </div> </li> <li class="param"> <code class="param-name optional">[targetCtx]</code> <span class="type">CanvasRenderingContext2D</span> <span class="flag optional" title="This parameter is optional.">optional</span> <div class="param-description"> <p>The 2D context to draw the result to. Defaults to the context passed to ctx.</p> </div> </li> <li class="param"> <code class="param-name optional">[targetX]</code> <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span> <span class="flag optional" title="This parameter is optional.">optional</span> <div class="param-description"> <p>The x position to draw the result to. Defaults to the value passed to x.</p> </div> </li> <li class="param"> <code class="param-name optional">[targetY]</code> <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span> <span class="flag optional" title="This parameter is optional.">optional</span> <div class="param-description"> <p>The y position to draw the result to. Defaults to the value passed to y.</p> </div> </li> </ul> </div> <div class="returns"> <h4>Returns:</h4> <div class="returns-description"> <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>: <p>If the filter was applied successfully.</p> </div> </div> </div> <div id="method_clone" class="method item"> <h3 class="name"><code>clone</code></h3> <span class="paren">()</span> <span class="returns-inline"> <span class="type"><a href="../classes/ColorMatrixFilter.html" class="crosslink">ColorMatrixFilter</a></span> </span> <div class="meta"> <p>Inherited from <a href="../classes/Filter.html#method_clone"> Filter </a> but overwritten in <a href="../files/.._src_easeljs_filters_ColorMatrixFilter.js.html#l121"><code>clone:121</code></a> </p> </div> <div class="description"> <p>Returns a clone of this ColorMatrixFilter instance.</p> </div> <div class="returns"> <h4>Returns:</h4> <div class="returns-description"> <span class="type"><a href="../classes/ColorMatrixFilter.html" class="crosslink">ColorMatrixFilter</a></span>: <p>A clone of the current ColorMatrixFilter instance.</p> </div> </div> </div> <div id="method_getBounds" class="method item inherited"> <h3 class="name"><code>getBounds</code></h3> <span class="paren">()</span> <span class="returns-inline"> <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span> </span> <div class="meta"> <p>Inherited from <a href="../classes/Filter.html#method_getBounds">Filter</a>: <a href="../files/.._src_easeljs_filters_Filter.js.html#l82"><code>getBounds:82</code></a> </p> </div> <div class="description"> <p>Returns a rectangle with values indicating the margins required to draw the filter or null. For example, a filter that will extend the drawing area 4 pixels to the left, and 7 pixels to the right (but no pixels up or down) would return a rectangle with (x=-4, y=0, width=11, height=0).</p> </div> <div class="returns"> <h4>Returns:</h4> <div class="returns-description"> <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>: <p>a rectangle object indicating the margins required to draw the filter or null if the filter does not effect bounds.</p> </div> </div> </div> <div id="method_initialize" class="method item protected"> <h3 class="name"><code>initialize</code></h3> <div class="args"> <span class="paren">(</span><ul class="args-list inline commas"> <li class="arg"> <code>matrix</code> </li> </ul><span class="paren">)</span> </div> <span class="flag protected">protected</span> <div class="meta"> <p>Inherited from <a href="../classes/Filter.html#method_initialize"> Filter </a> but overwritten in <a href="../files/.._src_easeljs_filters_ColorMatrixFilter.js.html#l74"><code>initialize:74</code></a> </p> </div> <div class="description"> </div> <div class="params"> <h4>Parameters:</h4> <ul class="params-list"> <li class="param"> <code class="param-name">matrix</code> <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array" class="crosslink external" target="_blank">Array</a></span> <div class="param-description"> <p>A 4x5 matrix describing the color operation to perform.</p> </div> </li> </ul> </div> </div> <div id="method_toString" class="method item inherited"> <h3 class="name"><code>toString</code></h3> <span class="paren">()</span> <span class="returns-inline"> <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span> </span> <div class="meta"> <p>Inherited from <a href="../classes/Filter.html#method_toString">Filter</a>: <a href="../files/.._src_easeljs_filters_Filter.js.html#l108"><code>toString:108</code></a> </p> </div> <div class="description"> <p>Returns a string representation of this object.</p> </div> <div class="returns"> <h4>Returns:</h4> <div class="returns-description"> <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>: <p>a string representation of the instance.</p> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <script src="../assets/vendor/prettify/prettify-min.js"></script> <script>prettyPrint();</script> <script src="../assets/js/yui-prettify.js"></script> <script src="../assets/../api.js"></script> <script src="../assets/js/api-filter.js"></script> <script src="../assets/js/api-list.js"></script> <script src="../assets/js/api-search.js"></script> <script src="../assets/js/apidocs.js"></script> </body> </html>
{ "content_hash": "8b8e65f18332fec8019848624ec48957", "timestamp": "", "source": "github", "line_count": 963, "max_line_length": 192, "avg_line_length": 26.995846313603323, "alnum_prop": 0.4315497942070239, "repo_name": "Koava/Shtacker", "id": "e4756abdc258e3805d4fb13b172cf54840717268", "size": "25997", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/EaselJS-release_v0.7.0/EaselJS-release_v0.7.0/docs/EaselJS_docs-0.7.0/classes/ColorMatrixFilter.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "59650" }, { "name": "JavaScript", "bytes": "1384383" }, { "name": "PowerShell", "bytes": "10100" }, { "name": "TypeScript", "bytes": "508050" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.6.0_36) on Mon Jan 04 20:30:30 CST 2016 --> <title>SerializerResolver$</title> <meta name="date" content="2016-01-04"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="SerializerResolver$"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</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="../../../../io/gearpump/streaming/task/SerializedMessageSerializer.html" title="class in io.gearpump.streaming.task"><span class="strong">PREV CLASS</span></a></li> <li><a href="../../../../io/gearpump/streaming/task/StartClock.html" title="class in io.gearpump.streaming.task"><span class="strong">NEXT CLASS</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?io/gearpump/streaming/task/SerializerResolver$.html" target="_top">FRAMES</a></li> <li><a href="SerializerResolver$.html" target="_top">NO FRAMES</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All 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> <div> <ul class="subNavList"> <li>SUMMARY:&nbsp;</li> <li>NESTED&nbsp;|&nbsp;</li> <li><a href="#field_summary">FIELD</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">CONSTR</a>&nbsp;|&nbsp;</li> <li><a href="#methods_inherited_from_class_java.lang.Object">METHOD</a></li> </ul> <ul class="subNavList"> <li>DETAIL:&nbsp;</li> <li><a href="#field_detail">FIELD</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">CONSTR</a>&nbsp;|&nbsp;</li> <li>METHOD</li> </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <p class="subTitle">io.gearpump.streaming.task</p> <h2 title="Class SerializerResolver$" class="title">Class SerializerResolver$</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>io.gearpump.streaming.task.SerializerResolver$</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public class <strong>SerializerResolver$</strong> extends java.lang.Object</pre> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== FIELD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="field_summary"> <!-- --> </a> <h3>Field Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> <caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../io/gearpump/streaming/task/SerializerResolver$.html" title="class in io.gearpump.streaming.task">SerializerResolver$</a></code></td> <td class="colLast"><code><strong><a href="../../../../io/gearpump/streaming/task/SerializerResolver$.html#MODULE$">MODULE$</a></strong></code> <div class="block">Static reference to the singleton instance of this Scala object.</div> </td> </tr> </table> </li> </ul> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../../io/gearpump/streaming/task/SerializerResolver$.html#SerializerResolver$()">SerializerResolver$</a></strong>()</code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"> <!-- --> </a> <h3>Method Summary</h3> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ FIELD DETAIL =========== --> <ul class="blockList"> <li class="blockList"><a name="field_detail"> <!-- --> </a> <h3>Field Detail</h3> <a name="MODULE$"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>MODULE$</h4> <pre>public static final&nbsp;<a href="../../../../io/gearpump/streaming/task/SerializerResolver$.html" title="class in io.gearpump.streaming.task">SerializerResolver$</a> MODULE$</pre> <div class="block">Static reference to the singleton instance of this Scala object.</div> </li> </ul> </li> </ul> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="SerializerResolver$()"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>SerializerResolver$</h4> <pre>public&nbsp;SerializerResolver$()</pre> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</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="../../../../io/gearpump/streaming/task/SerializedMessageSerializer.html" title="class in io.gearpump.streaming.task"><span class="strong">PREV CLASS</span></a></li> <li><a href="../../../../io/gearpump/streaming/task/StartClock.html" title="class in io.gearpump.streaming.task"><span class="strong">NEXT CLASS</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?io/gearpump/streaming/task/SerializerResolver$.html" target="_top">FRAMES</a></li> <li><a href="SerializerResolver$.html" target="_top">NO FRAMES</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All 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> <div> <ul class="subNavList"> <li>SUMMARY:&nbsp;</li> <li>NESTED&nbsp;|&nbsp;</li> <li><a href="#field_summary">FIELD</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">CONSTR</a>&nbsp;|&nbsp;</li> <li><a href="#methods_inherited_from_class_java.lang.Object">METHOD</a></li> </ul> <ul class="subNavList"> <li>DETAIL:&nbsp;</li> <li><a href="#field_detail">FIELD</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">CONSTR</a>&nbsp;|&nbsp;</li> <li>METHOD</li> </ul> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "content_hash": "082ab4631b9d793dd4fcb2053818fa94", "timestamp": "", "source": "github", "line_count": 265, "max_line_length": 187, "avg_line_length": 33.88301886792453, "alnum_prop": 0.6342577124401381, "repo_name": "gearpump/gearpump.github.io", "id": "b19eff401fc538d842b170746b7ef00fae773d43", "size": "8979", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "releases/0.7.3/api/java/io/gearpump/streaming/task/SerializerResolver$.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "386903" }, { "name": "HTML", "bytes": "236673589" }, { "name": "JavaScript", "bytes": "2196377" }, { "name": "Shell", "bytes": "213" } ], "symlink_target": "" }
/** * Created by yangyang on 2017/9/21. */ import {Map, List, Record} from 'immutable' import {createAction} from 'redux-actions' import { call, put, takeLatest } from 'redux-saga/effects' /**** Model ****/ const AppState = Record({ isRehydrated: undefined, // 是否已完成持久化数据恢复 }, 'AppState') /**** Constant ****/ const UPDATE_REHYDRATE = 'UPDATE_REHYDRATE' const UPDATE_REHYDRATE_SUCCESS = 'UPDATE_REHYDRATE_SUCCESS' /**** Action ****/ export const appStateAction = { updateRehydrate: createAction(UPDATE_REHYDRATE), } const updateRehydrateSuccess = createAction(UPDATE_REHYDRATE_SUCCESS) /**** Saga ****/ function* updateAppRehydrate(action) { let payload = action.payload try { yield put(updateRehydrateSuccess(payload)) } catch (error) { console.log('update App State error:', error) } } export const appStateSaga = [ takeLatest(UPDATE_REHYDRATE, updateAppRehydrate), ] /**** Reducer ****/ const initialState = AppState() export function appStateReducer(state = initialState, action) { switch(action.type) { case UPDATE_REHYDRATE_SUCCESS: return handleUpdateAppRehydrate(state, action) default: return state } } function handleUpdateAppRehydrate(state, action) { state = state.set('isRehydrated', action.payload.rehydrated) return state } /**** Selector ****/ function selectAppState(state) { let appState = state.APPSTATE return appState.toJS() } export const appStateSelector = { selectAppState, }
{ "content_hash": "5b1dd24fabd07ed47c3db5e23f8cf95a", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 69, "avg_line_length": 21.44927536231884, "alnum_prop": 0.7027027027027027, "repo_name": "simors/yjbAdmin", "id": "125e5b6b4c0fa3847dc27e1e83ff93f926356adf", "size": "1504", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/util/appstate/redux.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "7418" }, { "name": "HTML", "bytes": "257" }, { "name": "JavaScript", "bytes": "737112" } ], "symlink_target": "" }
"use strict"; var tap = require("tap"), test = tap.test, plan = tap.plan, path = require("path"), _ = require("underscore"); var argv = { platform: "android", buildType: "dev" }; var linter = require("../lib/fileset-linter").argv(argv), nodeModules = require("../lib/node-modules").argv(argv); var testPackageLocation = path.join(__dirname, "test-package"); var packages = nodeModules.module(testPackageLocation, { name: "kirin-build-test-package", kirin: { dependencies: ["underscore"] } }).collectAll(); var kirinBuildPackages = nodeModules.module(__dirname, { name: "kirin-build", kirin: { dependencies: ["underscore"] } }).collectAll(); packages = _.extend(kirinBuildPackages, packages); test("lint a single package with dry run", function (t) { argv.dryRun = true; var errors = linter._lintPackage(packages['kirin-build-test-package']); t.ok(!errors); argv.dryRun = false; t.end(); }); test("lint a single package", function (t) { var package_ = packages['kirin-build']; t.ok(package_); var errors = linter._lintPackage(package_, {}); // it's not empty because we've not told jshint we're using node. console.dir(errors); t.ok(!_.isEmpty(errors)); // now we're using the .jshintrc file. errors = linter._lintPackage(package_); t.ok(errors); t.end(); }); test("lint a single file", function (t) { var errors; errors = linter._lintFile(__filename); t.ok(errors); t.ok(!_.isEmpty(errors)); errors = linter._lintFile(__filename, {node: true}); t.ok(!errors); t.end(); }); test("lint a string", function (t) { var errors; errors = linter._lintString(["var a = 1;", "a = a + 1;"]); t.ok(_.isEmpty(errors)); errors = linter._lintString(["var a = 1;", "eval('a + 1');"]); t.equal(errors.length, 1); errors = linter._lintString(["b = 1"]); t.equal(errors.length, 1); t.end(); });
{ "content_hash": "17b4276dd9611b60d1ce67a0d205785a", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 75, "avg_line_length": 23.272727272727273, "alnum_prop": 0.58251953125, "repo_name": "KirinJS/kirin-build", "id": "a716c4ad80ae7d652d897ec2acbd3152b9994b71", "size": "2048", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/fileset-linter-test.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "JavaScript", "bytes": "131744" } ], "symlink_target": "" }
using System; using System.Diagnostics; using Alachisoft.NCache.Common.Stats; using System.Threading; using Alachisoft.NCache.Common.Util; using Alachisoft.NCache.Common.Logger; using System.Collections.Generic; using Alachisoft.NCache.Common.Enum; using Alachisoft.NCache.Common.Collections; using Alachisoft.NCache.Common.Caching; namespace Alachisoft.NCache.Caching.Statistics { /// <summary> /// Summary description for PerfStatsCollector. /// </summary> public class PerfStatsCollector : IDisposable, StatisticCounter { HPTime initTime; /// <summary> Instance name. </summary> private string _instanceName; /// <summary> Port number. </summary> private string _port; /// <summary> /// whether extended cache monitoring is enabled or not. /// </summary> private bool _enableExtendedMonitoring; /// <summary> performance counter for Cache item count. </summary> private PerformanceCounter _pcCount = null; /// <summary> performance counter for Cache item count. </summary> private PerformanceCounter _pcCachelastAccessCount = null; /// <summary> performance counter for Cache hits per second. </summary> private PerformanceCounter _pcHitsPerSec = null; /// <summary> performance counter for Cache misses per second. </summary> private PerformanceCounter _pcMissPerSec = null; private PerformanceCounter _pcHitsRatioSec = null; private PerformanceCounter _pcHitsRatioSecBase = null; /// <summary> performance counter for Cache get operations per second. </summary> private PerformanceCounter _pcGetPerSec = null; /// <summary> performance counter for Cache add operations per second. </summary> private PerformanceCounter _pcAddPerSec = null; /// <summary> performance counter for Cache update operations per second. </summary> private PerformanceCounter _pcUpdPerSec = null; /// <summary> performance counter for Cache remove operations per second. </summary> private PerformanceCounter _pcDelPerSec = null; /// <summary> performance counter for Cache evictions per second. </summary> private PerformanceCounter _pcEvictPerSec = null; /// <summary> performance counter for Cache expirations per second. </summary> private PerformanceCounter _pcExpiryPerSec = null; /// <summary> performance counter for State Txfr's per second. </summary> private PerformanceCounter _pcStateTxfrPerSec = null; /// <summary> performance counter for Data Balance per second for Partitioned and Partioned Replica. </summary> private PerformanceCounter _pcDataBalPerSec = null; /// <summary> performance counter for Mirror Queue size. </summary> private PerformanceCounter _pcMirrorQueueSize = null; private PerformanceCounter _pcSlidingIndexQueueSize = null; /// <summary> performance counter for Cache avg. per milli-second time of get operations. </summary> private PerformanceCounter _pcMsecPerGetAvg = null; /// <summary> performance counter for Cache avg. per milli-second time of add operations. </summary> private PerformanceCounter _pcMsecPerAddAvg = null; /// <summary> performance counter for Cache avg. per milli-second time of update operations. </summary> private PerformanceCounter _pcMsecPerUpdAvg = null; /// <summary> performance counter for Cache avg. per milli-second time of remove operations. </summary> private PerformanceCounter _pcMsecPerDelAvg = null; /// <summary> performance counter for Cache max. per milli-second time of get operations. </summary> private PerformanceCounter _pcMsecPerGetBase = null; /// <summary> performance counter for Cache max. per milli-second time of add operations. </summary> private PerformanceCounter _pcMsecPerAddBase = null; /// <summary> performance counter for Cache max. per milli-second time of update operations. </summary> private PerformanceCounter _pcMsecPerUpdBase = null; /// <summary> performance counter for Cache max. per milli-second time of remove operations. </summary> private PerformanceCounter _pcMsecPerDelBase = null; /// <summary> usage statistics for Cache per milli-second time of get operations. </summary> private UsageStats _usMsecPerGet = null; /// <summary> usage statistics for Cache per milli-second time of add operations. </summary> private UsageStats _usMsecPerAdd = null; /// <summary> usage statistics for Cache per milli-second time of update operations. </summary> private UsageStats _usMsecPerUpd = null; /// <summary> usage statistics for Cache per milli-second time of remove operations. </summary> private UsageStats _usMsecPerDel = null; /// <summary>performance counter for Size of the cache including store and all indices.. </summary> private PerformanceCounter _pcCacheSize = null; /// <summary> performance counter for Size of expiration indices define on cache. </summary> private PerformanceCounter _pcExpirationIndexSize = null; /// <summary> performance counter for Size of eviction indices define on cache. </summary> private PerformanceCounter _pcEvictionIndexSize = null; /// <summary> performance counter for Size of group and sub group indices.. </summary> #region Pub-Sub /// <summary> performance counter for number of messages in cache. </summary> private PerformanceCounter _pcMessageCount; /// <summary> performance counter for number of topics in cache. </summary> private PerformanceCounter _pcTopicCount; private PerformanceCounter _pcMessageStoreSize; private PerformanceCounter _pcMessagePublishPerSec; private PerformanceCounter _pcMessageDeliverPerSec; private PerformanceCounter _pcMessageExpiredPerSec; private Dictionary<string, PerformanceCounter> _pubsubCounterList; #endregion private ILogger _ncacheLog; /// <summary> Category name of counter performance data.</summary> /// private const string PC_CATEGORY = "NCache"; /// <summary> /// Constructor /// </summary> /// <param name="instanceName"></param> public PerfStatsCollector(string instanceName, bool inProc) { _instanceName = GetInstanceName(instanceName, 0, inProc); } /// <summary> /// Constructor /// </summary> /// <param name="instanceName"></param> /// <param name="port"></param> public PerfStatsCollector(string instanceName, int port, bool inProc) { _instanceName = GetInstanceName(instanceName, port, inProc); } /// <summary> /// Creates Instancename /// For outproc instanceName = CacheID /// For inProc instanceNAme = CacheID +"-" + ProcessID + ":" +port /// </summary> /// <param name="name"></param> /// <param name="port"></param> /// <param name="inProc"></param> /// <returns></returns> public string GetInstanceName(string instanceName, int port, bool inProc) { // This will not be replaced with ServiceConfiguration as this if for DEV only and loads from NCHOST config if (System.Configuration.ConfigurationSettings.AppSettings["InstanceNameText"] != null) instanceName = System.Configuration.ConfigurationSettings.AppSettings["InstanceNameText"] + "_" + instanceName; return !inProc ? instanceName : instanceName + " - " + Process.GetCurrentProcess().Id.ToString() + ":" + port.ToString(); } /// <summary> /// Returns true if the current user has the rights to read/write to performance counters /// under the category of object cache. /// </summary> public string InstanceName { get { return _instanceName; } set { _instanceName = value; } } /// <summary> /// Returns true if the current user has the rights to read/write to performance counters /// under the category of object cache. /// </summary> public bool UserHasAccessRights { get { try { PerformanceCounterPermission permissions = new PerformanceCounterPermission(PerformanceCounterPermissionAccess.Instrument, ".", PC_CATEGORY); permissions.Demand(); if (!PerformanceCounterCategory.Exists(PC_CATEGORY, ".")) { return false; } } catch (Exception e) { if (NCacheLog.IsInfoEnabled) NCacheLog.Info("PerfStatsCollector.UserHasAccessRights", e.Message); return false; } return true; } } #region / --- IDisposable --- / /// <summary> /// Performs application-defined tasks associated with freeing, releasing, or /// resetting unmanaged resources. /// </summary> public void Dispose() { lock (this) { if (_pcCount != null) { _pcCount.RemoveInstance(); _pcCount.Dispose(); _pcCount = null; } if (_pcCachelastAccessCount != null) { _pcCachelastAccessCount.RemoveInstance(); _pcCachelastAccessCount.Dispose(); _pcCachelastAccessCount = null; } if (_pcHitsPerSec != null) { _pcHitsPerSec.RemoveInstance(); _pcHitsPerSec.Dispose(); _pcHitsPerSec = null; } if (_pcMissPerSec != null) { _pcMissPerSec.RemoveInstance(); _pcMissPerSec.Dispose(); _pcMissPerSec = null; } if (_pcHitsRatioSec != null) { _pcHitsRatioSec.RemoveInstance(); _pcHitsRatioSec.Dispose(); _pcHitsRatioSec = null; } if (_pcHitsRatioSecBase != null) { _pcHitsRatioSecBase.RemoveInstance(); _pcHitsRatioSecBase.Dispose(); _pcHitsRatioSecBase = null; } if (_pcAddPerSec != null) { _pcAddPerSec.RemoveInstance(); _pcAddPerSec.Dispose(); _pcAddPerSec = null; } if (_pcGetPerSec != null) { _pcGetPerSec.RemoveInstance(); _pcGetPerSec.Dispose(); _pcGetPerSec = null; } if (_pcUpdPerSec != null) { _pcUpdPerSec.RemoveInstance(); _pcUpdPerSec.Dispose(); _pcUpdPerSec = null; } if (_pcDelPerSec != null) { _pcDelPerSec.RemoveInstance(); _pcDelPerSec.Dispose(); _pcDelPerSec = null; } if (_pcMsecPerAddAvg != null) { _pcMsecPerAddAvg.RemoveInstance(); _pcMsecPerAddAvg.Dispose(); _pcMsecPerAddAvg = null; } if (_pcMsecPerDelAvg != null) { _pcMsecPerDelAvg.RemoveInstance(); _pcMsecPerDelAvg.Dispose(); _pcMsecPerDelAvg = null; } if (_pcMsecPerGetAvg != null) { _pcMsecPerGetAvg.RemoveInstance(); _pcMsecPerGetAvg.Dispose(); _pcMsecPerGetAvg = null; } if (_pcMsecPerUpdAvg != null) { _pcMsecPerUpdAvg.RemoveInstance(); _pcMsecPerUpdAvg.Dispose(); _pcMsecPerUpdAvg = null; } if (_pcMsecPerAddBase != null) { _pcMsecPerAddBase.RemoveInstance(); _pcMsecPerAddBase.Dispose(); _pcMsecPerAddBase = null; } if (_pcMsecPerDelBase != null) { _pcMsecPerDelBase.RemoveInstance(); _pcMsecPerDelBase.Dispose(); _pcMsecPerDelBase = null; } if (_pcMsecPerGetBase != null) { _pcMsecPerGetBase.RemoveInstance(); _pcMsecPerGetBase.Dispose(); _pcMsecPerGetBase = null; } if (_pcMsecPerUpdBase != null) { _pcMsecPerUpdBase.RemoveInstance(); _pcMsecPerUpdBase.Dispose(); _pcMsecPerUpdBase = null; } if (_pcEvictPerSec != null) { _pcEvictPerSec.RemoveInstance(); _pcEvictPerSec.Dispose(); _pcEvictPerSec = null; } if (_pcExpiryPerSec != null) { _pcExpiryPerSec.RemoveInstance(); _pcExpiryPerSec.Dispose(); _pcExpiryPerSec = null; } if (_pcExpiryPerSec != null) { _pcExpiryPerSec.RemoveInstance(); _pcExpiryPerSec.Dispose(); _pcExpiryPerSec = null; } if (_pcStateTxfrPerSec != null) { _pcStateTxfrPerSec.RemoveInstance(); _pcStateTxfrPerSec.Dispose(); _pcStateTxfrPerSec = null; } if (_pcDataBalPerSec != null) { _pcDataBalPerSec.RemoveInstance(); _pcDataBalPerSec.Dispose(); _pcDataBalPerSec = null; } if (_pcMirrorQueueSize != null) { _pcMirrorQueueSize.RemoveInstance(); _pcMirrorQueueSize.Dispose(); _pcMirrorQueueSize = null; } if (_pcSlidingIndexQueueSize != null) { _pcSlidingIndexQueueSize.RemoveInstance(); _pcSlidingIndexQueueSize.Dispose(); _pcSlidingIndexQueueSize = null; } if (_pcCacheSize != null) { _pcCacheSize.RemoveInstance(); _pcCacheSize.Dispose(); _pcCacheSize = null; } if (_pcEvictionIndexSize != null) { _pcEvictionIndexSize.RemoveInstance(); _pcEvictionIndexSize.Dispose(); _pcEvictionIndexSize = null; } if (_pcExpirationIndexSize != null) { _pcExpirationIndexSize.RemoveInstance(); _pcExpirationIndexSize.Dispose(); _pcExpirationIndexSize = null; } if (_pubsubCounterList != null) { foreach (PerformanceCounter counter in _pubsubCounterList.Values) { if (counter != null) { counter.RemoveInstance(); counter.Dispose(); } } _pubsubCounterList.Clear(); _pubsubCounterList = null; } if (_pcMessageCount != null) { _pcMessageCount.RemoveInstance(); _pcMessageCount.Dispose(); _pcMessageCount = null; } if (_pcMessageDeliverPerSec != null) { _pcMessageDeliverPerSec.RemoveInstance(); _pcMessageDeliverPerSec.Dispose(); _pcMessageDeliverPerSec = null; } if (_pcMessageExpiredPerSec != null) { _pcMessageExpiredPerSec.RemoveInstance(); _pcMessageExpiredPerSec.Dispose(); _pcMessageExpiredPerSec = null; } if (_pcMessagePublishPerSec != null) { _pcMessagePublishPerSec.RemoveInstance(); _pcMessagePublishPerSec.Dispose(); _pcMessagePublishPerSec = null; } if (_pcMessageStoreSize != null) { _pcMessageStoreSize.RemoveInstance(); _pcMessageStoreSize.Dispose(); _pcMessageStoreSize = null; } if (_pcTopicCount != null) { _pcTopicCount.RemoveInstance(); _pcTopicCount.Dispose(); _pcTopicCount = null; } } } #endregion #region / --- Initialization --- / /// <summary> /// Initializes the counter instances and category. /// </summary> public void InitializePerfCounters(bool inproc, bool ModuleConfigured = false) { #if NETCORE if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Linux)) return; #endif try { if (!UserHasAccessRights) return; lock (this) { int ncounter = 1; string instname = _instanceName; if (inproc) { int processid = Process.GetCurrentProcess().Id; while (PerformanceCounterCategory.InstanceExists(instname, PC_CATEGORY)) { instname = _instanceName + ":" + ncounter.ToString() + " - " + processid.ToString() + _port; ncounter++; } _instanceName = instname; } _pcCount = new PerformanceCounter(PC_CATEGORY, CounterNames.Count, _instanceName, false); _pcCachelastAccessCount = new PerformanceCounter(PC_CATEGORY, CounterNames.CacheLastAccessCount, _instanceName, false); _pcHitsPerSec = new PerformanceCounter(PC_CATEGORY, CounterNames.HitsPerSec, _instanceName, false); _pcMissPerSec = new PerformanceCounter(PC_CATEGORY, CounterNames.MissPerSec, _instanceName, false); _pcHitsRatioSec = new PerformanceCounter(PC_CATEGORY, CounterNames.HitsRatioSec, _instanceName, false); _pcHitsRatioSecBase = new PerformanceCounter(PC_CATEGORY, CounterNames.HitsRatioSecBase, _instanceName, false); _pcAddPerSec = new PerformanceCounter(PC_CATEGORY, CounterNames.AddPerSec, _instanceName, false); _pcGetPerSec = new PerformanceCounter(PC_CATEGORY, CounterNames.GetPerSec, _instanceName, false); _pcUpdPerSec = new PerformanceCounter(PC_CATEGORY, CounterNames.UpdPerSec, _instanceName, false); _pcDelPerSec = new PerformanceCounter(PC_CATEGORY, CounterNames.DelPerSec, _instanceName, false); _pcEvictPerSec = new PerformanceCounter(PC_CATEGORY, CounterNames.EvictPerSec, _instanceName, false); _pcExpiryPerSec = new PerformanceCounter(PC_CATEGORY, CounterNames.ExpiryPerSec, _instanceName, false); _pcStateTxfrPerSec = new PerformanceCounter(PC_CATEGORY, CounterNames.StateTxfrPerSec, _instanceName, false); _pcDataBalPerSec = new PerformanceCounter(PC_CATEGORY, CounterNames.DataBalPerSec, _instanceName, false); _pcMsecPerGetAvg = new PerformanceCounter(PC_CATEGORY, CounterNames.MsecPerGetAvg, _instanceName, false); _pcMsecPerGetBase = new PerformanceCounter(PC_CATEGORY, CounterNames.MsecPerGetBase, _instanceName, false); _usMsecPerGet = new UsageStats(); _pcMsecPerAddAvg = new PerformanceCounter(PC_CATEGORY, CounterNames.MsecPerAddAvg, _instanceName, false); _pcMsecPerAddBase = new PerformanceCounter(PC_CATEGORY, CounterNames.MsecPerAddBase, _instanceName, false); _usMsecPerAdd = new UsageStats(); _pcMsecPerUpdAvg = new PerformanceCounter(PC_CATEGORY, CounterNames.MsecPerUpdAvg, _instanceName, false); _pcMsecPerUpdBase = new PerformanceCounter(PC_CATEGORY, CounterNames.MsecPerUpdBase, _instanceName, false); _usMsecPerUpd = new UsageStats(); _pcMsecPerDelAvg = new PerformanceCounter(PC_CATEGORY, CounterNames.MsecPerDelAvg, _instanceName, false); _pcMsecPerDelBase = new PerformanceCounter(PC_CATEGORY, CounterNames.MsecPerDelBase, _instanceName, false); _usMsecPerDel = new UsageStats(); _pcMirrorQueueSize = new PerformanceCounter(PC_CATEGORY, CounterNames.MirrorQueueSize, _instanceName, false); _pcSlidingIndexQueueSize = new PerformanceCounter(PC_CATEGORY, CounterNames.SlidingIndexQueueSize, _instanceName, false); _pcCacheSize = new PerformanceCounter(PC_CATEGORY, CounterNames.CacheSize, _instanceName, false); _pcCacheSize.RawValue = 0; _pcEvictionIndexSize = new PerformanceCounter(PC_CATEGORY, CounterNames.EvictionIndexSize, _instanceName, false); _pcExpirationIndexSize = new PerformanceCounter(PC_CATEGORY, CounterNames.ExpirationIndexSize, _instanceName, false); #region Pub_Sub _pubsubCounterList = new Dictionary<string, PerformanceCounter>(); _pcMessageCount = new PerformanceCounter(PC_CATEGORY, CounterNames.MessageCount, _instanceName, false); _pcTopicCount = new PerformanceCounter(PC_CATEGORY, CounterNames.TopicCount, _instanceName, false); _pcMessageStoreSize = new PerformanceCounter(PC_CATEGORY, CounterNames.MessageStoreSize, _instanceName, false); _pcMessagePublishPerSec = new PerformanceCounter(PC_CATEGORY, CounterNames.MessagePublishPerSec, _instanceName, false); _pcMessageDeliverPerSec = new PerformanceCounter(PC_CATEGORY, CounterNames.MessageDeliveryPerSec, _instanceName, false); _pcMessageExpiredPerSec = new PerformanceCounter(PC_CATEGORY, CounterNames.MessageExpiredPerSec, _instanceName, false); _pubsubCounterList.Add(CounterNames.MessageCount, _pcMessageCount); _pubsubCounterList.Add(CounterNames.TopicCount, _pcTopicCount); _pubsubCounterList.Add(CounterNames.MessageStoreSize, _pcMessageStoreSize); _pubsubCounterList.Add(CounterNames.MessagePublishPerSec, _pcMessagePublishPerSec); _pubsubCounterList.Add(CounterNames.MessageDeliveryPerSec, _pcMessageDeliverPerSec); _pubsubCounterList.Add(CounterNames.MessageExpiredPerSec, _pcMessageExpiredPerSec); foreach (var item in _pubsubCounterList.Values) { item.RawValue = 0; } #endregion _usMsecPerDel = new UsageStats(); } } catch (Exception e) { NCache.Common.AppUtil.LogEvent(e.ToString(), EventLogEntryType.Error); } } #endregion /// <summary> /// Increment the performance counter for Cache item count by one. /// </summary> public void IncrementCountStats(long count) { if (_pcCount != null) { lock (_pcCount) { _pcCount.RawValue = count; } } } /// <summary> /// Increment the performance counter for Cache item count by one. /// </summary> public void IncrementCacheLastAccessCountStats(long count) { if (_pcCachelastAccessCount != null) { lock (_pcCachelastAccessCount) { _pcCachelastAccessCount.RawValue = count; } } } /// <summary> /// Increment the performance counter for Cache item count by one. /// </summary> public void IncrementCountStatsBy(long count) { if (_pcCount != null) { _pcCount.IncrementBy(count); } } /// <summary> /// Increment the performance counter for Cache hits per second. /// </summary> public void IncrementHitsPerSecStats() { if (_pcHitsPerSec != null) _pcHitsPerSec.Increment(); } /// <summary> /// Increment the performance counter for Cache hits per second. /// </summary> public void IncrementByHitsPerSecStats(long value) { if (_pcHitsPerSec != null) _pcHitsPerSec.IncrementBy(value); } /// <summary> /// Increment the performance counter for Cache misses per second. /// </summary> public void IncrementMissPerSecStats() { if (_pcMissPerSec != null) _pcMissPerSec.Increment(); } /// <summary> /// Increment the performance counter for Cache misses per second. /// </summary> public void IncrementByMissPerSecStats(long value) { if (_pcMissPerSec != null) _pcMissPerSec.IncrementBy(value); } public void IncrementHitsRatioPerSecStats() { if (_pcHitsRatioSec != null) _pcHitsRatioSec.Increment(); } public void IncrementByHitsRatioPerSecStats(long value) { if (_pcHitsRatioSec != null) _pcHitsRatioSec.IncrementBy(value); } public void IncrementHitsRatioPerSecBaseStats() { if (_pcHitsRatioSecBase != null) _pcHitsRatioSecBase.Increment(); } public void IncrementByHitsRatioPerSecBaseStats(long value) { if (_pcHitsRatioSecBase != null) _pcHitsRatioSecBase.IncrementBy(value); } /// <summary> /// Increment the performance counter for Cache get operations per second. /// </summary> public void IncrementGetPerSecStats() { if (_pcHitsRatioSecBase != null) _pcGetPerSec.Increment(); } /// <summary> /// Increment the performance counter for Cache get operations per second. /// </summary> public void IncrementByGetPerSecStats(long value) { if (_pcHitsRatioSecBase != null) _pcGetPerSec.IncrementBy(value); } /// <summary> /// Increment the performance counter for Cache add operations per second. /// </summary> public void IncrementAddPerSecStats() { if (_pcAddPerSec != null) _pcAddPerSec.Increment(); } /// <summary> /// Increment the performance counter for Cache add operations per second. /// </summary> public void IncrementByAddPerSecStats(long value) { if (_pcAddPerSec != null) _pcAddPerSec.IncrementBy(value); } /// <summary> /// Increment the performance counter for Cache update operations per second. /// </summary> public void IncrementUpdPerSecStats() { if (_pcUpdPerSec != null) _pcUpdPerSec.Increment(); } /// <summary> /// Increment the performance counter for Cache update operations per second. /// </summary> public void IncrementByUpdPerSecStats(long value) { if (_pcUpdPerSec != null) _pcUpdPerSec.IncrementBy(value); } /// <summary> Increment the performance counter for Cache remove operations per second. </summary> public void IncrementDelPerSecStats() { if (_pcDelPerSec != null) _pcDelPerSec.Increment(); } /// <summary> Increment the performance counter for Cache remove operations per second. </summary> public void IncrementByDelPerSecStats(long value) { if (_pcDelPerSec != null) _pcDelPerSec.IncrementBy(value); } /// <summary> Increment the performance counter for Cache remove operations per second. </summary> public void IncrementDelPerSecStats(int value) { if (_pcDelPerSec != null) _pcDelPerSec.IncrementBy(value); } /// <summary> Increment the performance counter for Cache size. </summary> public void IncrementCacheSizeBy(long value) { if (_pcCacheSize != null) _pcCacheSize.IncrementBy(value); } /// <summary> Increment the performance counter for Cache size. </summary> public void IncrementCacheSize() { if (_pcCacheSize != null) _pcCacheSize.Increment(); } /// <summary> Set the performance counter for Cache size. </summary> public void SetCacheSize(long value) { if (_pcCacheSize != null) lock (_pcCacheSize) _pcCacheSize.RawValue = value; } public void SetEvictionIndexSize(long value) { if (_pcEvictionIndexSize != null) { lock (_pcEvictionIndexSize) { _pcEvictionIndexSize.RawValue = value; } } } public void IncrementEvictionIndexSizeBy(long value) { if (_pcEvictionIndexSize != null) _pcEvictionIndexSize.IncrementBy(value); } public void IncrementEvictionIndexSize() { if (_pcEvictionIndexSize != null) _pcEvictionIndexSize.Increment(); } public void SetExpirationIndexSize(long value) { if (_pcExpirationIndexSize != null) { lock (_pcExpirationIndexSize) { _pcExpirationIndexSize.RawValue = value; } } } /// <summary> Increment the performance counter for Cache evictions per second. </summary> public void IncrementEvictPerSecStats() { if (_pcEvictPerSec != null) _pcEvictPerSec.Increment(); } /// <summary> Increment the performance counter for Cache expirations per second. </summary> public void IncrementExpiryPerSecStats() { if (_pcExpiryPerSec != null) _pcExpiryPerSec.Increment(); } /// <summary> Increments the performance counter for Cache evictions per second by given value. </summary> public void IncrementEvictPerSecStatsBy(long value) { if (_pcEvictPerSec != null) _pcEvictPerSec.IncrementBy(value); } /// <summary> Increment the performance counter for Cache expirations per second by given value. </summary> public void IncrementExpiryPerSecStatsBy(long value) { if (_pcExpiryPerSec != null) _pcExpiryPerSec.IncrementBy(value); } /// <summary> /// Timestamps the start of sampling interval for Cache avg. and max. per mill-second time of /// fetch operations. /// </summary> public void MsecPerGetBeginSample() { if (_usMsecPerGet != null) _usMsecPerGet.BeginSample(); } /// <summary> /// Timestample and updates the counter for Cache avg. and max. per mill-second time of /// fetch operations. /// </summary> public void MsecPerGetEndSample() { if (_usMsecPerGet != null) { _usMsecPerGet.EndSample(); _pcMsecPerGetAvg.IncrementBy(_usMsecPerGet.Current * 1000000);// ts.Milliseconds); _pcMsecPerGetBase.Increment(); } } /// <summary> /// Timestamps the start of sampling interval for Cache avg. and max. per mill-second time of /// add operations. /// </summary> public void MsecPerAddBeginSample() { if (_usMsecPerAdd != null) _usMsecPerAdd.BeginSample(); } /// <summary> /// Timestample and updates the counter for Cache avg. and max. per mill-second time of /// add operations. /// </summary> public void MsecPerAddEndSample() { if (_usMsecPerAdd != null) { _usMsecPerAdd.EndSample(); _pcMsecPerAddAvg.IncrementBy(_usMsecPerAdd.Current * 1000000); //ts.Milliseconds); _pcMsecPerAddBase.Increment(); } } /// <summary> /// Timestamps the start of sampling interval for Cache avg. and max. per mill-second time of /// update operations. /// </summary> public void MsecPerUpdBeginSample() { if (_pcMsecPerUpdAvg != null) _usMsecPerUpd.BeginSample(); } /// <summary> /// Timestample and updates the counter for Cache avg. and max. per mill-second time of /// update operations. /// </summary> public void MsecPerUpdEndSample() { if (_pcMsecPerUpdAvg != null) { _usMsecPerUpd.EndSample(); _pcMsecPerUpdAvg.IncrementBy(_usMsecPerUpd.Current * 1000000);//ts.Milliseconds); _pcMsecPerUpdBase.Increment(); } } /// <summary> /// Timestamps the start of sampling interval for Cache avg. and max. per mill-second time of /// remove operations. /// </summary> public void MsecPerDelBeginSample() { if (_pcMsecPerDelAvg != null) _usMsecPerDel.BeginSample(); } /// <summary> /// Timestample and updates the counter for Cache avg. and max. per mill-second time of /// remove operations. /// </summary> public void MsecPerDelEndSample() { if (_pcMsecPerDelAvg != null) { _usMsecPerDel.EndSample(); _pcMsecPerDelAvg.IncrementBy(_usMsecPerDel.Current * 1000000); //ts.Milliseconds); _pcMsecPerDelBase.Increment(); } } /// <summary>Resets the State Transfer perfmon counter value</summary> public void ResetStateTransferPerfmonCounter() { if (_pcStateTxfrPerSec != null) lock (_pcStateTxfrPerSec) { _pcStateTxfrPerSec.RawValue = 0; } } /// <summary> Increment the performance counter for State Txfr's per second. </summary> public void IncrementStateTxfrPerSecStats() { if (_pcStateTxfrPerSec != null) _pcStateTxfrPerSec.Increment(); } /// <summary> Increment the performance counter for State Txfr's per second by given value. </summary> public void IncrementStateTxfrPerSecStatsBy(long value) { if (_pcStateTxfrPerSec != null) _pcStateTxfrPerSec.IncrementBy(value); } /// <summary> Increment the performance counter for Data Balance per second. </summary> public void IncrementDataBalPerSecStats() { if (_pcDataBalPerSec != null) _pcDataBalPerSec.Increment(); } /// <summary> Increment the performance counter for Data Balance per second by given value. </summary> public void IncrementDataBalPerSecStatsBy(long value) { if (_pcDataBalPerSec != null) _pcDataBalPerSec.IncrementBy(value); } /// <summary> /// Increment the performance counter for Mirror Queue size by one. /// </summary> public void IncrementMirrorQueueSizeStats(long count) { if (_pcMirrorQueueSize != null) { lock (_pcMirrorQueueSize) { _pcMirrorQueueSize.RawValue = count; } } } /// <summary> /// Increment the performance counter for SlidingIndex Queue size by one. /// </summary> public void IncrementSlidingIndexQueueSizeStats(long count) { if (_pcSlidingIndexQueueSize != null) { lock (_pcSlidingIndexQueueSize) { _pcSlidingIndexQueueSize.RawValue = count; } } } #region StatisticCounter Members public ILogger NCacheLog { get { return _ncacheLog; } set { _ncacheLog = value; } } #endregion #region PUB_SUB public void IncrementMsecPerMessagePublish(long count) { if (_pubsubCounterList != null && _pubsubCounterList.Count > 0 && _pubsubCounterList.ContainsKey(CounterNames.AvgPublishMessage)) { PerformanceCounter performanceCounter = _pubsubCounterList[CounterNames.AvgPublishMessage]; if (performanceCounter != null) { performanceCounter.IncrementBy(count * 1000000); _pubsubCounterList[CounterNames.AvgPublishMessageBase].Increment(); } } } public void SetPubSubCounter(long value, string counterType) { if (_pubsubCounterList != null && _pubsubCounterList.ContainsKey(counterType)) { PerformanceCounter performanceCounter = _pubsubCounterList[counterType]; if (performanceCounter != null) { lock (performanceCounter) { performanceCounter.RawValue = value; } } } } public void PubSubCounterSetter(string counterType, PerformanceOperator counterOperation) { if (_pubsubCounterList != null && _pubsubCounterList.Count > 0 && _pubsubCounterList.ContainsKey(counterType)) { PerformanceCounter performanceCounter = _pubsubCounterList[counterType]; if (performanceCounter != null) { switch (counterOperation) { case PerformanceOperator.Increment: performanceCounter.Increment(); break; case PerformanceOperator.Decrement: performanceCounter.Decrement(); break; } } } } public void IncrementMessagePublishedPerSec() { PubSubCounterSetter(CounterNames.MessagePublishPerSec, PerformanceOperator.Increment); } public void IncrementMessageDeliverPerSec(long value) { if (_pubsubCounterList != null && _pubsubCounterList.Count > 0 && _pubsubCounterList.ContainsKey(CounterNames.MessageDeliveryPerSec)) { PerformanceCounter performanceCounter = _pubsubCounterList[CounterNames.MessageDeliveryPerSec]; if (performanceCounter != null) { performanceCounter.IncrementBy(value); } } } public void IncrementMessageDeliverPerSec() { if (_pubsubCounterList != null && _pubsubCounterList.Count > 0 && _pubsubCounterList.ContainsKey(CounterNames.MessageDeliveryPerSec)) { PerformanceCounter performanceCounter = _pubsubCounterList[CounterNames.MessageDeliveryPerSec]; if (performanceCounter != null) { performanceCounter.Increment(); } } } public void IncrementMessageExpiredPerSec(long value) { if (_pubsubCounterList != null && _pubsubCounterList.Count > 0 && _pubsubCounterList.ContainsKey(CounterNames.MessageExpiredPerSec)) { PerformanceCounter performanceCounter = _pubsubCounterList[CounterNames.MessageExpiredPerSec]; if (performanceCounter != null) { performanceCounter.IncrementBy(value); } } } public double GetCounterValue(string counterName) { double value = 0.0; PerformanceCounter counter = null; switch (counterName) { case CounterNames.MirrorQueueSize: counter = _pcMirrorQueueSize; break; case CounterNames.SlidingIndexQueueSize: counter = _pcSlidingIndexQueueSize; break; case CounterNames.EvictionIndexSize: counter = _pcEvictionIndexSize; break; case CounterNames.ExpirationIndexSize: counter = _pcExpirationIndexSize; break; } if (counter != null) { lock (counter) { value = counter.NextValue(); } } return value; } #endregion } }
{ "content_hash": "818bcf33c09859f8241cba41d994e2f5", "timestamp": "", "source": "github", "line_count": 1058, "max_line_length": 145, "avg_line_length": 40.55198487712666, "alnum_prop": 0.5506246503822487, "repo_name": "Alachisoft/NCache", "id": "07187f9dfc8e072feda6bbd752c5e4d3797e37d1", "size": "43509", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Src/NCCache/Caching/Statistics/PerfStatsCollector.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "12283536" }, { "name": "CSS", "bytes": "707" }, { "name": "HTML", "bytes": "16825" }, { "name": "JavaScript", "bytes": "377" } ], "symlink_target": "" }
package solr import ( "errors" "fmt" "net/url" "time" ) type SolrHttpRetrier struct { solrCli SolrHTTP retries int exponentialBackoff time.Duration readTimeout time.Duration updateTimeout time.Duration } func NewSolrHttpRetrier(solrHttp SolrHTTP, retries int, exponentialBackoff time.Duration) SolrHTTP { solrRetrier := SolrHttpRetrier{solrCli: solrHttp, retries: retries, exponentialBackoff: exponentialBackoff} return &solrRetrier } func (s *SolrHttpRetrier) Select(nodeUris []string, opts ...func(url.Values)) (SolrResponse, error) { if len(nodeUris) == 0 { return SolrResponse{}, errors.New("[Solr HTTP Retrier]Length of nodes in solr is empty") } now := time.Now() var resp SolrResponse var err error backoff := s.exponentialBackoff for attempt := 0; attempt < s.retries; attempt++ { resp, err = s.solrCli.Select(nodeUris, opts...) if err == ErrNotFound { return resp, err } if err != nil { s.Logger().Debug(fmt.Sprintf("[Solr Http Retrier] Error Retrying %v ", err)) backoff = s.backoff(backoff) s.Logger().Debug(fmt.Sprintf("Sleeping attempt: %d, for time: %v running for: %v ", attempt, backoff, time.Since(now))) continue } if attempt > 0 { s.Logger().Debug(fmt.Sprintf("[Solr Http Retrier] healed after %d", attempt)) } break } return resp, err } func (s *SolrHttpRetrier) Update(nodeUris []string, jsonDocs bool, doc interface{}, opts ...func(url.Values)) error { if len(nodeUris) == 0 { return errors.New("[Solr HTTP Retrier]Length of nodes in solr is empty") } now := time.Now() var err error backoff := s.exponentialBackoff for attempt := 0; attempt < s.retries; attempt++ { uri := nodeUris[attempt%len(nodeUris)] err = s.solrCli.Update([]string{uri}, jsonDocs, doc, opts...) if err == ErrNotFound { return err } if err != nil { if minRFErr, ok := err.(SolrMinRFError); ok { s.Logger().Error(minRFErr) } else { s.Logger().Debug(fmt.Sprintf("[Solr Http Retrier] Error Retrying %v ", err)) } backoff = s.backoff(backoff) s.Logger().Debug(fmt.Sprintf("Sleeping attempt: %d, for time: %v running for: %v ", attempt, backoff, time.Since(now))) continue } if attempt > 0 { s.Logger().Debug(fmt.Sprintf("[Solr Http Retrier] Healed after attempt %d", attempt)) } break } return err } func (s *SolrHttpRetrier) Logger() Logger { return s.solrCli.Logger() } //exponential backoff of the backoffInterval and returns new backoffInterval func (s *SolrHttpRetrier) backoff(backoffInterval time.Duration) time.Duration { backoffInterval = backoffInterval * time.Duration(2) time.Sleep(backoffInterval) return backoffInterval }
{ "content_hash": "75386997bc45e4c5a1a3d1c7250e4392", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 122, "avg_line_length": 29.855555555555554, "alnum_prop": 0.6899888351321176, "repo_name": "sendgrid/go-solr", "id": "7a4edbc7e76c3e20a9b3c2141f9855c6c8860534", "size": "2687", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "solrHttpRetry.go", "mode": "33188", "license": "mit", "language": [ { "name": "Dockerfile", "bytes": "152" }, { "name": "Go", "bytes": "58088" }, { "name": "Java", "bytes": "3628" }, { "name": "Makefile", "bytes": "9" }, { "name": "Shell", "bytes": "2056" } ], "symlink_target": "" }
output = [$.app, 'use', $.passport.initialize()]
{ "content_hash": "b15d18e08522c8cefbe0af124ff8d18a", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 48, "avg_line_length": 49, "alnum_prop": 0.6122448979591837, "repo_name": "nodule/passport", "id": "0cf71756fbceebbfaaa8ed3ad23ca50c9336ee7c", "size": "49", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "nodes/initialize/node.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "1200" } ], "symlink_target": "" }
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.controller.maintenance; import com.yahoo.config.provision.ApplicationId; import com.yahoo.config.provision.NodeType; import com.yahoo.config.provision.zone.ZoneId; import com.yahoo.vespa.hosted.controller.api.integration.configserver.Node; import com.yahoo.vespa.hosted.controller.integration.NodeRepositoryMock; import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.Collections; import java.util.List; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; /** * @author smorgrav */ public class ChangeManagementAssessorTest { private final ChangeManagementAssessor changeManagementAssessor = new ChangeManagementAssessor(new NodeRepositoryMock()); @Test void empty_input_variations() { ZoneId zone = ZoneId.from("prod", "eu-trd"); List<String> hostNames = new ArrayList<>(); List<Node> allNodesInZone = new ArrayList<>(); // Both zone and hostnames are empty ChangeManagementAssessor.Assessment assessment = changeManagementAssessor.assessmentInner(hostNames, allNodesInZone, zone); assertEquals(0, assessment.getClusterAssessments().size()); } @Test void one_host_one_cluster_no_groups() { ZoneId zone = ZoneId.from("prod", "eu-trd"); List<String> hostNames = Collections.singletonList("host1"); List<Node> allNodesInZone = new ArrayList<>(); allNodesInZone.add(createNode("node1", "host1", "default", 0)); allNodesInZone.add(createNode("node2", "host1", "default", 0)); allNodesInZone.add(createNode("node3", "host1", "default", 0)); // Add an not impacted hosts allNodesInZone.add(createNode("node4", "host2", "default", 0)); // Add tenant hosts allNodesInZone.add(createHost("host1", NodeType.host)); allNodesInZone.add(createHost("host2", NodeType.host)); // Make Assessment List<ChangeManagementAssessor.ClusterAssessment> assessments = changeManagementAssessor.assessmentInner(hostNames, allNodesInZone, zone).getClusterAssessments(); // Assess the assessment :-o assertEquals(1, assessments.size()); assertEquals(3, assessments.get(0).clusterImpact); assertEquals(4, assessments.get(0).clusterSize); assertEquals(1, assessments.get(0).groupsImpact); assertEquals(1, assessments.get(0).groupsTotal); assertEquals("content:default", assessments.get(0).cluster); assertEquals("mytenant:myapp:default", assessments.get(0).app); assertEquals("prod.eu-trd", assessments.get(0).zone); } @Test void one_of_two_groups_in_one_of_two_clusters() { ZoneId zone = ZoneId.from("prod", "eu-trd"); List<String> hostNames = List.of("host1", "host2", "host5"); List<Node> allNodesInZone = new ArrayList<>(); // Two impacted nodes on host1 allNodesInZone.add(createNode("node1", "host1", "default", 0)); allNodesInZone.add(createNode("node2", "host1", "default", 0)); // One impacted nodes on host2 allNodesInZone.add(createNode("node3", "host2", "default", 0)); // Another group on hosts not impacted allNodesInZone.add(createNode("node4", "host3", "default", 1)); allNodesInZone.add(createNode("node5", "host3", "default", 1)); allNodesInZone.add(createNode("node6", "host3", "default", 1)); // Another cluster on hosts not impacted - this one also with three different groups (should all be ignored here) allNodesInZone.add(createNode("node4", "host4", "myman", 4)); allNodesInZone.add(createNode("node5", "host4", "myman", 5)); allNodesInZone.add(createNode("node6", "host4", "myman", 6)); // Add tenant hosts allNodesInZone.add(createHost("host1", NodeType.host)); allNodesInZone.add(createHost("host2", NodeType.host)); // Make Assessment ChangeManagementAssessor.Assessment assessment = changeManagementAssessor.assessmentInner(hostNames, allNodesInZone, zone); // Assess the assessment :-o List<ChangeManagementAssessor.ClusterAssessment> clusterAssessments = assessment.getClusterAssessments(); assertEquals(1, clusterAssessments.size()); //One cluster is impacted assertEquals(3, clusterAssessments.get(0).clusterImpact); assertEquals(6, clusterAssessments.get(0).clusterSize); assertEquals(1, clusterAssessments.get(0).groupsImpact); assertEquals(2, clusterAssessments.get(0).groupsTotal); assertEquals("content:default", clusterAssessments.get(0).cluster); assertEquals("mytenant:myapp:default", clusterAssessments.get(0).app); assertEquals("prod.eu-trd", clusterAssessments.get(0).zone); assertEquals("Impact not larger than upgrade policy", clusterAssessments.get(0).impact); List<ChangeManagementAssessor.HostAssessment> hostAssessments = assessment.getHostAssessments(); assertEquals(2, hostAssessments.size()); assertTrue(hostAssessments.stream().anyMatch(hostAssessment -> hostAssessment.hostName.equals("host1") && hostAssessment.switchName.equals("switch1") && hostAssessment.numberOfChildren == 2 && hostAssessment.numberOfProblematicChildren == 2 )); } @Test void two_config_nodes() { var zone = ZoneId.from("prod", "eu-trd"); var hostNames = List.of("config1", "config2"); var allNodesInZone = new ArrayList<Node>(); // Add config nodes and parents allNodesInZone.add(createNode("config1", "confighost1", "config", 0, NodeType.config)); allNodesInZone.add(createHost("confighost1", NodeType.confighost)); allNodesInZone.add(createNode("config2", "confighost2", "config", 0, NodeType.config)); allNodesInZone.add(createHost("confighost2", NodeType.confighost)); var assessment = changeManagementAssessor.assessmentInner(hostNames, allNodesInZone, zone).getClusterAssessments(); var configAssessment = assessment.get(0); assertEquals("Large impact. Consider reprovisioning one or more config servers", configAssessment.impact); assertEquals(2, configAssessment.clusterImpact); } @Test void one_of_three_proxy_nodes() { var zone = ZoneId.from("prod", "eu-trd"); var hostNames = List.of("routing1"); var allNodesInZone = new ArrayList<Node>(); // Add routing nodes and parents allNodesInZone.add(createNode("routing1", "parentrouting1", "routing", 0, NodeType.proxy)); allNodesInZone.add(createHost("parentrouting1", NodeType.proxyhost)); allNodesInZone.add(createNode("routing2", "parentrouting2", "routing", 0, NodeType.proxy)); allNodesInZone.add(createHost("parentrouting2", NodeType.proxyhost)); allNodesInZone.add(createNode("routing3", "parentrouting3", "routing", 0, NodeType.proxy)); allNodesInZone.add(createHost("parentrouting3", NodeType.proxyhost)); var assessment = changeManagementAssessor.assessmentInner(hostNames, allNodesInZone, zone).getClusterAssessments(); assertEquals("33% of routing nodes impacted. Consider reprovisioning if too many", assessment.get(0).impact); } private Node createNode(String nodename, String hostname, String clusterId, int group) { return createNode(nodename, hostname, clusterId, group, NodeType.tenant); } private Node createNode(String nodename, String hostname, String clusterId, int group, NodeType nodeType) { return Node.builder().hostname(nodename) .parentHostname(hostname) .state(Node.State.active) .owner(ApplicationId.from("mytenant", "myapp", "default")) .group(String.valueOf(group)) .clusterId(clusterId) .clusterType(Node.ClusterType.content) .type(nodeType) .build(); } private Node createHost(String hostname, NodeType nodeType) { return Node.builder() .hostname(hostname) .switchHostname("switch1") .state(Node.State.active) .owner(ApplicationId.from("mytenant", "myapp", "default")) .group(String.valueOf(0)) .clusterId(nodeType.name()) .clusterType(Node.ClusterType.content) .type(nodeType) .build(); } }
{ "content_hash": "0f31b9bdb8be86d38c1ffb4162901641", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 125, "avg_line_length": 46.91489361702128, "alnum_prop": 0.6645124716553288, "repo_name": "vespa-engine/vespa", "id": "084fd2437691484e3a15b6c2cd13234cf0507707", "size": "8820", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/ChangeManagementAssessorTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "8130" }, { "name": "C", "bytes": "60315" }, { "name": "C++", "bytes": "29580035" }, { "name": "CMake", "bytes": "593981" }, { "name": "Emacs Lisp", "bytes": "91" }, { "name": "GAP", "bytes": "3312" }, { "name": "Go", "bytes": "560664" }, { "name": "HTML", "bytes": "54520" }, { "name": "Java", "bytes": "40814190" }, { "name": "JavaScript", "bytes": "73436" }, { "name": "LLVM", "bytes": "6152" }, { "name": "Lex", "bytes": "11499" }, { "name": "Makefile", "bytes": "5553" }, { "name": "Objective-C", "bytes": "12369" }, { "name": "Perl", "bytes": "23134" }, { "name": "Python", "bytes": "52392" }, { "name": "Roff", "bytes": "17506" }, { "name": "Ruby", "bytes": "10690" }, { "name": "Shell", "bytes": "268737" }, { "name": "Yacc", "bytes": "14735" } ], "symlink_target": "" }
""" Single Server M/M/1 and M/G/1 """ from __future__ import print_function from __future__ import division from RndUtil import Random from pdb import set_trace from MscUtil import Params, Customer from numpy.random import shuffle from numpy import argsort, mean rand = Random() rand.set_seed(seed_val=1729) from time import time """ Why 1729? Well, it is a very interesting number. It is the smallest number expressible as the sum of two positive cubes in two different ways. """ class Simulation: def __init__(self, params=Params): "Initialize inital params" self.queue = list() self.params = params self.customers = list() self.t_arrive = self.generate_interarrival() self.t_depart = self.t_arrive self.num_in_system = len(self.queue) self.t_fin_1 = 0 self.t_fin_2 = 0 self.t_fin_3 = 0 self.clock = 0 self.num_arrive = 0 self.num_depart = 0 self.num_reject = 0 self.num_serviced = 0 self.total_wait = sum([c.get_wait_time() for c in self.customers]) def generate_interarrival(self): return rand.exponential(3*self.params.rho/(len(self.queue)+1e-32)) def generate_service_time(self): if self.params.distribution == "exp": return rand.exponential(self.params.mu) else: service_time = rand.bounded_pareto() return service_time def _server(self, c): self.num_serviced += 1 self.t_fin_1 = self.clock + c.service_time self.t_depart = self.t_fin_1 c.depart_time = self.t_depart c.system_time = self.t_depart - c.arrival_time c.wait_time = self.t_depart - c.arrival_time + c.service_time self.t_fin_1 = 0 return c def handle_arrive_event(self): self.num_arrive += 1 # Increment arrival c = Customer(id=self.num_arrive) c.arrival_time = self.clock c.service_time = self.generate_service_time() self.t_arrive = self.clock + self.generate_interarrival() self.queue.append(c) def handle_depart_event(self): if len(self.queue) > 0: if self.params.service_type == "FCFS": c = self.queue.pop(0) else: serv_times = [c.service_time for c in self.queue] sorted_serve_time = argsort(serv_times) c = self.queue.pop(sorted_serve_time[0]) c = self._server(c) self.customers.append(c) else: self.t_depart = self.t_arrive def advance_time(self): self.clock = min(self.t_arrive, self.t_depart) if self.t_arrive <= self.t_depart: self.handle_arrive_event() else: self.handle_depart_event() def run_simulation(self): while self.num_arrive < self.params.C: self.advance_time() return self
{ "content_hash": "b30dfc36df4b2f395bf89e94323de200", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 74, "avg_line_length": 29.3, "alnum_prop": 0.5935153583617747, "repo_name": "rahlk/CSC579__Computer_Performance_Modeling", "id": "d2556245dd95578e0b2b3830f21292c9b1dc8dc8", "size": "2930", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "simulation/proj3/Utils/SimUtil2.py", "mode": "33188", "license": "mit", "language": [ { "name": "Gnuplot", "bytes": "4300" }, { "name": "Makefile", "bytes": "837" }, { "name": "Python", "bytes": "62147" }, { "name": "Shell", "bytes": "348" } ], "symlink_target": "" }
<?php namespace Notadd\Foundation\Member; use InvalidArgumentException; use Notadd\Foundation\Member\Abstracts\Manager; use Notadd\Foundation\Routing\Traits\Helpers; /** * Class MemberManagement. */ class MemberManagement { use Helpers; /** * @var array */ protected $drivers = []; /** * @var string */ protected $default; /** * @var \Notadd\Foundation\Member\Abstracts\Manager */ protected $manager; /** * Create a member. * * @param array $data * @param bool $force * * @return \Notadd\Foundation\Member\Member */ public function create(array $data, $force = false) { return $this->manager->create($data, $force); } /** * Delete a member. * * @param array $data * @param bool $force * * @return \Notadd\Foundation\Member\Member */ public function delete(array $data, $force = false) { return $this->manager->delete($data, $force); } /** * Edit a member info. * * @param array $data * @param bool $force * * @return \Notadd\Foundation\Member\Member */ public function edit(array $data, $force = false) { return $this->manager->edit($data, $force); } /** * Find a member. * * @param $key * * @return \Notadd\Foundation\Member\Member */ public function find($key) { return $this->manager->find($key); } /** * Get manager instance. * * @return \Notadd\Foundation\Member\Abstracts\Manager */ public function manager() { return $this->manager; } /** * Register member manager instance. * * @param \Notadd\Foundation\Member\Abstracts\Manager $manager */ public function registerManager(Manager $manager) { if (is_object($this->manager)) { throw new InvalidArgumentException('Member Manager has been Registered!'); } if ($manager instanceof Manager) { $this->manager = $manager; $this->manager->init(); } else { throw new InvalidArgumentException('Member Manager must be instanceof ' . Manager::class . '!'); } } /** * Store a member info. * * @param array $data * @param bool $force * * @return \Notadd\Foundation\Member\Member */ public function store(array $data, $force = false) { return $this->manager->store($data, $force); } /** * Update a member info. * * @param array $data * @param bool $force * * @return \Notadd\Foundation\Member\Member */ public function update(array $data, $force = false) { return $this->manager->update($data, $force); } }
{ "content_hash": "cc8bded57b67607b88711d4fc9a2fc97", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 108, "avg_line_length": 21.081481481481482, "alnum_prop": 0.5520028109627547, "repo_name": "notadd/framework", "id": "1523bb1ca9e7ae62339059efe70e9e28becf0f4e", "size": "2997", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Member/MemberManagement.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "69010" }, { "name": "PHP", "bytes": "1132891" } ], "symlink_target": "" }
package org.hibernate.test.annotations.embeddables.nested; import java.util.Date; import javax.persistence.Column; import javax.persistence.Embeddable; /** * @author Thomas Vanstals * @author Steve Ebersole */ @Embeddable public class Investment { private MonetaryAmount amount; private String description; private Date date; public MonetaryAmount getAmount() { return amount; } public void setAmount(MonetaryAmount amount) { this.amount = amount; } @Column(length = 500) public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public Date getDate() { return date; } public void setDate(Date date) { this.date = date; } }
{ "content_hash": "e858d05d025a7dae00e7b516f619b444", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 58, "avg_line_length": 17.714285714285715, "alnum_prop": 0.739247311827957, "repo_name": "HerrB92/obp", "id": "32d25ee3d521f54c13cd5fee86522b6ab4226482", "size": "1785", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "OpenBeaconPackage/libraries/hibernate-release-4.2.7.SP1/project/hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/nested/Investment.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "181658" }, { "name": "Groovy", "bytes": "98685" }, { "name": "Java", "bytes": "34621856" }, { "name": "JavaScript", "bytes": "356255" }, { "name": "Shell", "bytes": "194" }, { "name": "XSLT", "bytes": "21372" } ], "symlink_target": "" }
<!DOCTYPE HTML> <html lang="en"> <head> <title>Test test test</title> <meta charset="utf-8"> <style type="text/css"> body { background-color: #000000; margin: 0px; overflow: hidden; } </style> </head> <body> <div align="center"> <canvas id="theCanvas"></canvas> </div> <audio autoplay loop preload src="ReadySteadyGo.mp3" type="audio/mpeg"></audio> <script type="text/javascript" src="scroller3.js"></script> <div align="center"> <a href="../index.html">BACK BACK BACK!</a> </div> </body> </html>
{ "content_hash": "50dc39d4615fac45647338cd452920f1", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 81, "avg_line_length": 18.433333333333334, "alnum_prop": 0.6075949367088608, "repo_name": "BitSavage/experiments", "id": "48621b6386b753c39a8ba3df69e9936f25781362", "size": "553", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "scroller3/scroller3.html", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "80380" } ], "symlink_target": "" }
package uk.gov.phe.erdst.sc.awag.upload.reason;
{ "content_hash": "f8904935208679db89e4d04e73babbb7", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 47, "avg_line_length": 47, "alnum_prop": 0.8085106382978723, "repo_name": "PublicHealthEngland/animal-welfare-assessment-grid", "id": "04540067450f1a94df65811ded7c83a9aef6026d", "size": "47", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "code/server/src/test/java/uk/gov/phe/erdst/sc/awag/upload/reason/package-info.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "72513" }, { "name": "HTML", "bytes": "107458" }, { "name": "Java", "bytes": "1033236" }, { "name": "JavaScript", "bytes": "480036" } ], "symlink_target": "" }
/* eslint-disable */ /// <reference path="jqwidgets.d.ts" /> import '../jqwidgets/jqxcore.js'; import '../jqwidgets/jqxdraw.js'; import '../jqwidgets/jqxgauge.js'; import { Component, Input, Output, EventEmitter, ElementRef, OnChanges, SimpleChanges } from '@angular/core'; declare let JQXLite: any; @Component({ selector: 'jqxGauge', template: '<div><ng-content></ng-content></div>' }) export class jqxGaugeComponent implements OnChanges { @Input('animationDuration') attrAnimationDuration: string | number; @Input('border') attrBorder: jqwidgets.GaugeBorder; @Input('caption') attrCaption: jqwidgets.GaugeCaption; @Input('cap') attrCap: jqwidgets.GaugeCap; @Input('colorScheme') attrColorScheme: string; @Input('disabled') attrDisabled: boolean; @Input('easing') attrEasing: string; @Input('endAngle') attrEndAngle: number | string; @Input('int64') attrInt64: boolean; @Input('labels') attrLabels: jqwidgets.GaugeLabels; @Input('min') attrMin: number; @Input('max') attrMax: number | string; @Input('pointer') attrPointer: jqwidgets.GaugePointer; @Input('radius') attrRadius: number | string; @Input('ranges') attrRanges: Array<jqwidgets.GaugeRanges>; @Input('startAngle') attrStartAngle: number | string; @Input('showRanges') attrShowRanges: boolean; @Input('styles') attrStyles: jqwidgets.GaugeStyle; @Input('ticksMajor') attrTicksMajor: jqwidgets.GaugeTicks; @Input('ticksMinor') attrTicksMinor: jqwidgets.GaugeTicks; @Input('ticksDistance') attrTicksDistance: string; @Input('value') attrValue: number; @Input('width') attrWidth: string | number; @Input('height') attrHeight: string | number; @Input('auto-create') autoCreate: boolean = true; properties: string[] = ['animationDuration','border','caption','cap','colorScheme','disabled','easing','endAngle','height','int64','labels','min','max','pointer','radius','ranges','startAngle','showRanges','styles','ticksMajor','ticksMinor','ticksDistance','value','width']; host: any; elementRef: ElementRef; widgetObject: jqwidgets.jqxGauge; constructor(containerElement: ElementRef) { this.elementRef = containerElement; } ngOnInit() { if (this.autoCreate) { this.createComponent(); } }; ngOnChanges(changes: SimpleChanges) { if (this.host) { for (let i = 0; i < this.properties.length; i++) { let attrName = 'attr' + this.properties[i].substring(0, 1).toUpperCase() + this.properties[i].substring(1); let areEqual: boolean = false; if (this[attrName] !== undefined) { if (typeof this[attrName] === 'object') { if (this[attrName] instanceof Array) { areEqual = this.arraysEqual(this[attrName], this.host.jqxGauge(this.properties[i])); } if (areEqual) { return false; } this.host.jqxGauge(this.properties[i], this[attrName]); continue; } if (this[attrName] !== this.host.jqxGauge(this.properties[i])) { this.host.jqxGauge(this.properties[i], this[attrName]); } } } } } arraysEqual(attrValue: any, hostValue: any): boolean { if ((attrValue && !hostValue) || (!attrValue && hostValue)) { return false; } if (attrValue.length != hostValue.length) { return false; } for (let i = 0; i < attrValue.length; i++) { if (attrValue[i] !== hostValue[i]) { return false; } } return true; } manageAttributes(): any { let options = {}; for (let i = 0; i < this.properties.length; i++) { let attrName = 'attr' + this.properties[i].substring(0, 1).toUpperCase() + this.properties[i].substring(1); if (this[attrName] !== undefined) { options[this.properties[i]] = this[attrName]; } } return options; } moveClasses(parentEl: HTMLElement, childEl: HTMLElement): void { let classes: any = parentEl.classList; if (classes.length > 0) { childEl.classList.add(...classes); } parentEl.className = ''; } moveStyles(parentEl: HTMLElement, childEl: HTMLElement): void { let style = parentEl.style.cssText; childEl.style.cssText = style parentEl.style.cssText = ''; } createComponent(options?: any): void { if (this.host) { return; } if (options) { JQXLite.extend(options, this.manageAttributes()); } else { options = this.manageAttributes(); } this.host = JQXLite(this.elementRef.nativeElement.firstChild); this.moveClasses(this.elementRef.nativeElement, this.host[0]); this.moveStyles(this.elementRef.nativeElement, this.host[0]); this.__wireEvents__(); this.widgetObject = jqwidgets.createInstance(this.host, 'jqxGauge', options); } createWidget(options?: any): void { this.createComponent(options); } __updateRect__() : void { if(this.host) this.host.css({ width: this.attrWidth, height: this.attrHeight }); } setOptions(options: any) : void { this.host.jqxGauge('setOptions', options); } // jqxGaugeComponent properties animationDuration(arg?: string | number): string | number { if (arg !== undefined) { this.host.jqxGauge('animationDuration', arg); } else { return this.host.jqxGauge('animationDuration'); } } border(arg?: jqwidgets.GaugeBorder): jqwidgets.GaugeBorder { if (arg !== undefined) { this.host.jqxGauge('border', arg); } else { return this.host.jqxGauge('border'); } } caption(arg?: jqwidgets.GaugeCaption): jqwidgets.GaugeCaption { if (arg !== undefined) { this.host.jqxGauge('caption', arg); } else { return this.host.jqxGauge('caption'); } } cap(arg?: jqwidgets.GaugeCap): jqwidgets.GaugeCap { if (arg !== undefined) { this.host.jqxGauge('cap', arg); } else { return this.host.jqxGauge('cap'); } } colorScheme(arg?: string): string { if (arg !== undefined) { this.host.jqxGauge('colorScheme', arg); } else { return this.host.jqxGauge('colorScheme'); } } disabled(arg?: boolean): boolean { if (arg !== undefined) { this.host.jqxGauge('disabled', arg); } else { return this.host.jqxGauge('disabled'); } } easing(arg?: string): string { if (arg !== undefined) { this.host.jqxGauge('easing', arg); } else { return this.host.jqxGauge('easing'); } } endAngle(arg?: number | string): number | string { if (arg !== undefined) { this.host.jqxGauge('endAngle', arg); } else { return this.host.jqxGauge('endAngle'); } } height(arg?: number | string): number | string { if (arg !== undefined) { this.host.jqxGauge('height', arg); } else { return this.host.jqxGauge('height'); } } int64(arg?: boolean): boolean { if (arg !== undefined) { this.host.jqxGauge('int64', arg); } else { return this.host.jqxGauge('int64'); } } labels(arg?: jqwidgets.GaugeLabels): jqwidgets.GaugeLabels { if (arg !== undefined) { this.host.jqxGauge('labels', arg); } else { return this.host.jqxGauge('labels'); } } min(arg?: number): number { if (arg !== undefined) { this.host.jqxGauge('min', arg); } else { return this.host.jqxGauge('min'); } } max(arg?: number | string): number | string { if (arg !== undefined) { this.host.jqxGauge('max', arg); } else { return this.host.jqxGauge('max'); } } pointer(arg?: jqwidgets.GaugePointer): jqwidgets.GaugePointer { if (arg !== undefined) { this.host.jqxGauge('pointer', arg); } else { return this.host.jqxGauge('pointer'); } } radius(arg?: number | string): number | string { if (arg !== undefined) { this.host.jqxGauge('radius', arg); } else { return this.host.jqxGauge('radius'); } } ranges(arg?: Array<jqwidgets.GaugeRanges>): Array<jqwidgets.GaugeRanges> { if (arg !== undefined) { this.host.jqxGauge('ranges', arg); } else { return this.host.jqxGauge('ranges'); } } startAngle(arg?: number | string): number | string { if (arg !== undefined) { this.host.jqxGauge('startAngle', arg); } else { return this.host.jqxGauge('startAngle'); } } showRanges(arg?: boolean): boolean { if (arg !== undefined) { this.host.jqxGauge('showRanges', arg); } else { return this.host.jqxGauge('showRanges'); } } styles(arg?: jqwidgets.GaugeStyle): jqwidgets.GaugeStyle { if (arg !== undefined) { this.host.jqxGauge('styles', arg); } else { return this.host.jqxGauge('styles'); } } ticksMajor(arg?: jqwidgets.GaugeTicks): jqwidgets.GaugeTicks { if (arg !== undefined) { this.host.jqxGauge('ticksMajor', arg); } else { return this.host.jqxGauge('ticksMajor'); } } ticksMinor(arg?: jqwidgets.GaugeTicks): jqwidgets.GaugeTicks { if (arg !== undefined) { this.host.jqxGauge('ticksMinor', arg); } else { return this.host.jqxGauge('ticksMinor'); } } ticksDistance(arg?: string): string { if (arg !== undefined) { this.host.jqxGauge('ticksDistance', arg); } else { return this.host.jqxGauge('ticksDistance'); } } value(arg?: number): number { if (arg !== undefined) { this.host.jqxGauge('value', arg); } else { return this.host.jqxGauge('value'); } } width(arg?: number | string): number | string { if (arg !== undefined) { this.host.jqxGauge('width', arg); } else { return this.host.jqxGauge('width'); } } // jqxGaugeComponent functions disable(): void { this.host.jqxGauge('disable'); } enable(): void { this.host.jqxGauge('enable'); } val(value?: number): any { if (value !== undefined) { return this.host.jqxGauge('val', value); } else { return this.host.jqxGauge('val'); } }; // jqxGaugeComponent events @Output() onValueChanging = new EventEmitter(); @Output() onValueChanged = new EventEmitter(); __wireEvents__(): void { this.host.on('valueChanging', (eventData: any) => { this.onValueChanging.emit(eventData); }); this.host.on('valueChanged', (eventData: any) => { this.onValueChanged.emit(eventData); }); } } //jqxGaugeComponent
{ "content_hash": "4541fceea73af98ceec6b42620fceadf", "timestamp": "", "source": "github", "line_count": 384, "max_line_length": 277, "avg_line_length": 28.908854166666668, "alnum_prop": 0.5767948833438429, "repo_name": "cdnjs/cdnjs", "id": "50ce142bc60a9204bc16be4234d0eb608072006d", "size": "11213", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ajax/libs/jqwidgets/9.1.6/jqwidgets-ts/angular_jqxgauge.ts", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <!-- http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <artifactId>openddr-classifier-examples</artifactId> <groupId>mobi.openddr.examples.classifier</groupId> <version>1.1.1-SNAPSHOT</version> </parent> <artifactId>openddr-flow</artifactId> <packaging>war</packaging> <name>OpenDDR Web Flow Example</name> <properties> <!-- Explicitly declaring the source encoding eliminates the following message: [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! --> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <!-- To set the jboss.home environment variable the Maven way, set the jboss.home property in an active profile in the Maven 2 settings.xml file --> <jboss.home>${env.JBOSS_HOME}</jboss.home> <jboss.domain>default</jboss.domain> <!-- The version of Weld extensions in use --> <weld.extensions.version>1.0.0-CR2</weld.extensions.version> </properties> <repositories> <!-- Several key Java EE APIs and RIs are missing from the Maven Central Repository --> <!-- The goal is to eventually eliminate the reliance on the JBoss repository --> <repository> <id>repository.jboss.org</id> <name>JBoss Repository</name> <url>http://repository.jboss.org/maven2</url> </repository> </repositories> <pluginRepositories> <!-- GlassFish repository required for embedded-glassfish plugin --> <pluginRepository> <id>glassfish</id> <name>GlassFish Maven 2 Repository</name> <url>http://download.java.net/maven/glassfish</url> </pluginRepository> </pluginRepositories> <dependencyManagement> <dependencies> <!-- Import scope will provide versions for dependencies below. --> <dependency> <groupId>org.jboss.weld</groupId> <artifactId>weld-extensions-bom</artifactId> <version>${weld.extensions.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <!-- CDI (JSR-299) --> <dependency> <groupId>javax.enterprise</groupId> <artifactId>cdi-api</artifactId> <scope>provided</scope> </dependency> <!-- Common annotations (e.g., @PostConstruct, @PreDestroy, @Generated, @Resource) --> <dependency> <groupId>javax.annotation</groupId> <artifactId>jsr250-api</artifactId> <scope>provided</scope> </dependency> <!-- Bean Validation (JSR-303) --> <dependency> <groupId>javax.validation</groupId> <artifactId>validation-api</artifactId> <scope>provided</scope> </dependency> <!-- Bean Validation Implementation --> <!-- Provides portable constraints such as @NotEmpty, @Email and @Url --> <!-- Hibernate Validator is the only JSR-303 implementation at the moment, so we can assume it's provided --> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>4.0.0.GA</version> <scope>provided</scope> </dependency> <!-- JSF --> <dependency> <groupId>javax.faces</groupId> <artifactId>jsf-api</artifactId> <scope>provided</scope> </dependency> <!-- Optional, but highly recommended. --> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>5.10</version> <scope>test</scope> <classifier>jdk15</classifier> </dependency> <!-- Needed on JBoss AS as EL is out of date --> <dependency> <groupId>org.glassfish.web</groupId> <artifactId>el-impl</artifactId> <scope>runtime</scope> <!-- FIXME this version should be in the Weld API BOM --> <version>2.1.2-b04</version> <exclusions> <exclusion> <groupId>javax.el</groupId> <artifactId>el-api</artifactId> </exclusion> </exclusions> </dependency> </dependencies> <build> <finalName>${artifactId}</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <!-- Eclipse plugin can force download of source and JavaDoc jars --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-eclipse-plugin</artifactId> <configuration> <wtpversion>2.0</wtpversion> <!-- <downloadSources>true</downloadSources> <downloadJavadocs>true</downloadJavadocs> --> </configuration> </plugin> <!-- Configure the JBoss AS Maven deploy plugin --> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>jboss-maven-plugin</artifactId> <configuration> <jbossHome>${jboss.home}</jbossHome> <serverName>${jboss.domain}</serverName> <fileNames> <fileName>${project.build.directory}/${build.finalName}.war</fileName> </fileNames> </configuration> </plugin> <!-- Configure the Embedded GlassFish Maven plugin --> <plugin> <groupId>org.glassfish</groupId> <artifactId>maven-embedded-glassfish-plugin</artifactId> <version>3.0</version> <configuration> <app>${project.build.directory}/${build.finalName}.war</app> <port>7070</port> <containerType>web</containerType> </configuration> </plugin> </plugins> </build> </project>
{ "content_hash": "f84cf9f423fa26b9ebdbc4a1af02709b", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 201, "avg_line_length": 40.017341040462426, "alnum_prop": 0.5854398382204247, "repo_name": "OpenDDRmobi/openddr-examples", "id": "e35815ee6a8eb2140189f07277c7f06f094e68e1", "size": "6923", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "java/classifier/flow/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "56331" }, { "name": "HTML", "bytes": "265140" }, { "name": "Java", "bytes": "115463" }, { "name": "JavaScript", "bytes": "12290" } ], "symlink_target": "" }
package org.openfact.exportimport.singlefile; import org.openfact.Config; import org.openfact.exportimport.ExportImportConfig; import org.openfact.exportimport.ImportProvider; import org.openfact.exportimport.ImportProviderFactory; import org.openfact.models.OpenfactSession; import org.openfact.models.OpenfactSessionFactory; import java.io.File; /** * @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a> */ public class SingleFileImportProviderFactory implements ImportProviderFactory { @Override public ImportProvider create(OpenfactSession session) { String fileName = ExportImportConfig.getFile(); return new SingleFileImportProvider(new File(fileName)); } @Override public void init(Config.Scope config) { } @Override public void postInit(OpenfactSessionFactory factory) { } @Override public void close() { } @Override public String getId() { return SingleFileExportProviderFactory.PROVIDER_ID; } }
{ "content_hash": "f8a6544c3e08cf661d36e3eea321196a", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 79, "avg_line_length": 24.11904761904762, "alnum_prop": 0.7443237907206318, "repo_name": "openfact/openfact-temp", "id": "4f4671ace31152a1871d6a2174250e89a1a73a15", "size": "1687", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "services/src/main/java/org/openfact/exportimport/singlefile/SingleFileImportProviderFactory.java", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "346479" }, { "name": "FreeMarker", "bytes": "68800" }, { "name": "HTML", "bytes": "555105" }, { "name": "Java", "bytes": "7445324" }, { "name": "JavaScript", "bytes": "775205" }, { "name": "Shell", "bytes": "1357" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using UnityEngine; public class BlackBoard { private Dictionary<string, bool> boolDictionary; private Dictionary<string, int> intDictionary; private Dictionary<string, Vector3> vector3Dictionary; private Dictionary<string, GameObject> gameObjectDictionary; public event Action DataChanged; public BlackBoard() { boolDictionary = new Dictionary<string, bool>(); intDictionary = new Dictionary<string, int>(); vector3Dictionary = new Dictionary<string, Vector3>(); gameObjectDictionary = new Dictionary<string, GameObject>(); } private void SetValue<T>(Dictionary<string, T> dict, string key, T value) { if (dict.ContainsKey(key)) { dict[key] = value; } else { dict.Add(key, value); } if (DataChanged != null) { DataChanged(); } } private bool GetValue<T>(Dictionary<string, T> dict, string key, out T value) { if (dict.ContainsKey(key)) { value = dict[key]; return true; } value = default(T); return false; } public void SetValue(string key, int value) { SetValue(intDictionary, key, value); } public void SetValue(string key, bool value) { SetValue(boolDictionary, key, value); } public void SetValue(string key, Vector3 value) { SetValue(vector3Dictionary, key, value); } public void SetValue(string key,GameObject value) { SetValue(gameObjectDictionary, key, value); } public bool GetValue(string key, out int value) { return GetValue(intDictionary, key, out value); } public bool GetValue(string key, out bool value) { return GetValue(boolDictionary, key, out value); } public bool GetValue(string key, out Vector3 value) { return GetValue(vector3Dictionary, key, out value); } public bool GetValue(string key,out GameObject value) { return GetValue(gameObjectDictionary, key, out value); } }
{ "content_hash": "3cfff2572b75a8de63bf676b1787692e", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 81, "avg_line_length": 24.48314606741573, "alnum_prop": 0.6117485084901331, "repo_name": "houshuai/BattleGround", "id": "a712e95a9464005a2e400c46485a1da21647f0a6", "size": "2181", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Assets/Scripts/BT/BlackBoard.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "48422" }, { "name": "Mask", "bytes": "8957" }, { "name": "ShaderLab", "bytes": "1999" } ], "symlink_target": "" }
<?xml version="1.0" ?><!DOCTYPE TS><TS language="zh_TW" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Trenchcoin</source> <translation>關於莱特幣</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;Trenchcoin&lt;/b&gt; version</source> <translation>&lt;b&gt;莱特幣&lt;/b&gt;版本</translation> </message> <message> <location line="+57"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation> 這是一套實驗性的軟體. 此軟體是依據 MIT/X11 軟體授權條款散布, 詳情請見附帶的 COPYING 檔案, 或是以下網站: http://www.opensource.org/licenses/mit-license.php. 此產品也包含了由 OpenSSL Project 所開發的 OpenSSL Toolkit (http://www.openssl.org/) 軟體, 由 Eric Young (eay@cryptsoft.com) 撰寫的加解密軟體, 以及由 Thomas Bernard 所撰寫的 UPnP 軟體.</translation> </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation>版權</translation> </message> <message> <location line="+0"/> <source>The Trenchcoin developers</source> <translation>莱特幣開發人員</translation> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>位址簿</translation> </message> <message> <location line="+19"/> <source>Double-click to edit address or label</source> <translation>點兩下來修改位址或標記</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>產生新位址</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>複製目前選取的位址到系統剪貼簿</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation>新增位址</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your Trenchcoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation>這些是你用來收款的莱特幣位址. 你可以提供不同的位址給不同的付款人, 來追蹤是誰支付給你.</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation>複製位址</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation>顯示 &amp;QR 條碼</translation> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a Trenchcoin address</source> <translation>簽署訊息是用來證明莱特幣位址是你的</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>訊息簽署</translation> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation>從列表中刪除目前選取的位址</translation> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation>將目前分頁的資料匯出存成檔案</translation> </message> <message> <location line="+3"/> <source>&amp;Export</source> <translation>匯出</translation> </message> <message> <location line="-44"/> <source>Verify a message to ensure it was signed with a specified Trenchcoin address</source> <translation>驗證訊息是用來確認訊息是用指定的莱特幣位址簽署的</translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation>訊息驗證</translation> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>刪除</translation> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your Trenchcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation>這是你用來付款的莱特幣位址. 在付錢之前, 務必要檢查金額和收款位址是否正確.</translation> </message> <message> <location line="+13"/> <source>Copy &amp;Label</source> <translation>複製標記</translation> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation>編輯</translation> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation>付錢</translation> </message> <message> <location line="+260"/> <source>Export Address Book Data</source> <translation>匯出位址簿資料</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>逗號區隔資料檔 (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>匯出失敗</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>無法寫入檔案 %1.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>標記</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>位址</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(沒有標記)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>密碼對話視窗</translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>輸入密碼</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>新的密碼</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>重複新密碼</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+33"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation>輸入錢包的新密碼.&lt;br/&gt;請用&lt;b&gt;10個以上的字元&lt;/b&gt;, 或是&lt;b&gt;8個以上的單字&lt;/b&gt;.</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>錢包加密</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>這個動作需要用你的錢包密碼來解鎖</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>錢包解鎖</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>這個動作需要用你的錢包密碼來解密</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>錢包解密</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>變更密碼</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>輸入錢包的新舊密碼.</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>錢包加密確認</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR TRENCHCOINS&lt;/b&gt;!</source> <translation>警告: 如果將錢包加密後忘記密碼, 你會&lt;b&gt;失去其中所有的莱特幣&lt;/b&gt;!</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>你確定要將錢包加密嗎?</translation> </message> <message> <location line="+15"/> <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>重要: 請改用新產生有加密的錢包檔, 來取代之前錢包檔的備份. 為了安全性的理由, 當你開始使用新的有加密的錢包時, 舊錢包的備份就不能再使用了.</translation> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>警告: 大寫字母鎖定作用中!</translation> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>錢包已加密</translation> </message> <message> <location line="-56"/> <source>Trenchcoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your trenchcoins from being stolen by malware infecting your computer.</source> <translation>莱特幣現在要關閉以完成加密程序. 請記住, 加密錢包無法完全防止入侵電腦的惡意程式偷取你的莱特幣.</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>錢包加密失敗</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>錢包加密因程式內部錯誤而失敗. 你的錢包還是沒有加密.</translation> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>提供的密碼不符.</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation>錢包解鎖失敗</translation> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>用來解密錢包的密碼輸入錯誤.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>錢包解密失敗</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>錢包密碼變更成功.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+233"/> <source>Sign &amp;message...</source> <translation>訊息簽署...</translation> </message> <message> <location line="+280"/> <source>Synchronizing with network...</source> <translation>網路同步中...</translation> </message> <message> <location line="-349"/> <source>&amp;Overview</source> <translation>總覽</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>顯示錢包一般總覽</translation> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation>交易</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>瀏覽交易紀錄</translation> </message> <message> <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation>編輯位址與標記的儲存列表</translation> </message> <message> <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation>顯示收款位址的列表</translation> </message> <message> <location line="+31"/> <source>E&amp;xit</source> <translation>結束</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>結束應用程式</translation> </message> <message> <location line="+4"/> <source>Show information about Trenchcoin</source> <translation>顯示莱特幣相關資訊</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>關於 &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>顯示有關於 Qt 的資訊</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>選項...</translation> </message> <message> <location line="+6"/> <source>&amp;Encrypt Wallet...</source> <translation>錢包加密...</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>錢包備份...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>密碼變更...</translation> </message> <message> <location line="+285"/> <source>Importing blocks from disk...</source> <translation>從磁碟匯入區塊中...</translation> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation>重建磁碟區塊索引中...</translation> </message> <message> <location line="-347"/> <source>Send coins to a Trenchcoin address</source> <translation>付錢到莱特幣位址</translation> </message> <message> <location line="+49"/> <source>Modify configuration options for Trenchcoin</source> <translation>修改莱特幣的設定選項</translation> </message> <message> <location line="+9"/> <source>Backup wallet to another location</source> <translation>將錢包備份到其它地方</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>變更錢包加密用的密碼</translation> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation>除錯視窗</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>開啓除錯與診斷主控台</translation> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation>驗證訊息...</translation> </message> <message> <location line="-165"/> <location line="+530"/> <source>Trenchcoin</source> <translation>莱特幣</translation> </message> <message> <location line="-530"/> <source>Wallet</source> <translation>錢包</translation> </message> <message> <location line="+101"/> <source>&amp;Send</source> <translation>付出</translation> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation>收受</translation> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation>位址</translation> </message> <message> <location line="+22"/> <source>&amp;About Trenchcoin</source> <translation>關於莱特幣</translation> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>顯示或隱藏</translation> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation>顯示或隱藏主視窗</translation> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation>將屬於你的錢包的密鑰加密</translation> </message> <message> <location line="+7"/> <source>Sign messages with your Trenchcoin addresses to prove you own them</source> <translation>用莱特幣位址簽署訊息來證明那是你的</translation> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified Trenchcoin addresses</source> <translation>驗證訊息來確認是用指定的莱特幣位址簽署的</translation> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation>檔案</translation> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation>設定</translation> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation>求助</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>分頁工具列</translation> </message> <message> <location line="+17"/> <location line="+10"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+47"/> <source>Trenchcoin client</source> <translation>莱特幣客戶端軟體</translation> </message> <message numerus="yes"> <location line="+141"/> <source>%n active connection(s) to Trenchcoin network</source> <translation><numerusform>與莱特幣網路有 %n 個連線在使用中</numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation>目前沒有區塊來源...</translation> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation>已處理了估計全部 %2 個中的 %1 個區塊的交易紀錄.</translation> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation>已處理了 %1 個區塊的交易紀錄.</translation> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation><numerusform>%n 個小時</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation><numerusform>%n 天</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation><numerusform>%n 個星期</numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation>落後 %1</translation> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation>最近收到的區塊是在 %1 之前生產出來.</translation> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation>會看不見在這之後的交易.</translation> </message> <message> <location line="+22"/> <source>Error</source> <translation>錯誤</translation> </message> <message> <location line="+3"/> <source>Warning</source> <translation>警告</translation> </message> <message> <location line="+3"/> <source>Information</source> <translation>資訊</translation> </message> <message> <location line="+70"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation>這筆交易的資料大小超過限制了. 你還是可以付出 %1 的費用來傳送, 這筆費用會付給處理你的交易的節點, 並幫助維持整個網路. 你願意支付這項費用嗎?</translation> </message> <message> <location line="-140"/> <source>Up to date</source> <translation>最新狀態</translation> </message> <message> <location line="+31"/> <source>Catching up...</source> <translation>進度追趕中...</translation> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation>確認交易手續費</translation> </message> <message> <location line="+8"/> <source>Sent transaction</source> <translation>付款交易</translation> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation>收款交易</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>日期: %1 金額: %2 類別: %3 位址: %4</translation> </message> <message> <location line="+33"/> <location line="+23"/> <source>URI handling</source> <translation>URI 處理</translation> </message> <message> <location line="-23"/> <location line="+23"/> <source>URI can not be parsed! This can be caused by an invalid Trenchcoin address or malformed URI parameters.</source> <translation>無法解析 URI! 也許莱特幣位址無效或 URI 參數有誤.</translation> </message> <message> <location line="+17"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>錢包&lt;b&gt;已加密&lt;/b&gt;並且正&lt;b&gt;解鎖中&lt;/b&gt;</translation> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>錢包&lt;b&gt;已加密&lt;/b&gt;並且正&lt;b&gt;上鎖中&lt;/b&gt;</translation> </message> <message> <location filename="../bitcoin.cpp" line="+111"/> <source>A fatal error occurred. Trenchcoin can no longer continue safely and will quit.</source> <translation>發生了致命的錯誤. 莱特幣程式無法再繼續安全執行, 只好結束.</translation> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+104"/> <source>Network Alert</source> <translation>網路警報</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>編輯位址</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>標記</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation>與這個位址簿項目關聯的標記</translation> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>位址</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation>與這個位址簿項目關聯的位址. 付款位址才能被更改.</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation>新收款位址</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>新增付款位址</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>編輯收款位址</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>編輯付款位址</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>輸入的位址&quot;%1&quot;已存在於位址簿中.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid Trenchcoin address.</source> <translation>輸入的位址 &quot;%1&quot; 並不是有效的莱特幣位址.</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>無法將錢包解鎖.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>新密鑰產生失敗.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>Trenchcoin-Qt</source> <translation>莱特幣-Qt</translation> </message> <message> <location line="-12"/> <source>version</source> <translation>版本</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>用法:</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation>命令列選項</translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation>使用界面選項</translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>設定語言, 比如說 &quot;de_DE&quot; (預設: 系統語系)</translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation>啓動時最小化 </translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation>顯示啓動畫面 (預設: 1)</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>選項</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>主要</translation> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source> <translation>非必要的交易手續費, 以 kB 為計費單位, 且有助於縮短你的交易處理時間. 大部份交易資料的大小是 1 kB.</translation> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>付交易手續費</translation> </message> <message> <location line="+31"/> <source>Automatically start Trenchcoin after logging in to the system.</source> <translation>在登入系統後自動啓動莱特幣.</translation> </message> <message> <location line="+3"/> <source>&amp;Start Trenchcoin on system login</source> <translation>系統登入時啟動莱特幣</translation> </message> <message> <location line="+35"/> <source>Reset all client options to default.</source> <translation>回復所有客戶端軟體選項成預設值.</translation> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation>選項回復</translation> </message> <message> <location line="+13"/> <source>&amp;Network</source> <translation>網路</translation> </message> <message> <location line="+6"/> <source>Automatically open the Trenchcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>自動在路由器上開啟 Trenchcoin 的客戶端通訊埠. 只有在你的路由器支援 UPnP 且開啟時才有作用.</translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>用 &amp;UPnP 設定通訊埠對應</translation> </message> <message> <location line="+7"/> <source>Connect to the Trenchcoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation>透過 SOCKS 代理伺服器連線至莱特幣網路 (比如說要透過 Tor 連線).</translation> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation>透過 SOCKS 代理伺服器連線:</translation> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>代理伺服器位址:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation>代理伺服器的網際網路位址 (比如說 127.0.0.1)</translation> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>通訊埠:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>代理伺服器的通訊埠 (比如說 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>SOCKS 協定版本:</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>代理伺服器的 SOCKS 協定版本 (比如說 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>視窗</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>最小化視窗後只在通知區域顯示圖示</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>最小化至通知區域而非工作列</translation> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation>當視窗關閉時將其最小化, 而非結束應用程式. 當勾選這個選項時, 應用程式只能用選單中的結束來停止執行.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>關閉時最小化</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>顯示</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>使用界面語言</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting Trenchcoin.</source> <translation>可以在這裡設定使用者介面的語言. 這個設定在莱特幣程式重啓後才會生效.</translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>金額顯示單位:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>選擇操作界面與付錢時預設顯示的細分單位.</translation> </message> <message> <location line="+9"/> <source>Whether to show Trenchcoin addresses in the transaction list or not.</source> <translation>是否要在交易列表中顯示莱特幣位址.</translation> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>在交易列表顯示位址</translation> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>好</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>取消</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation>套用</translation> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation>預設</translation> </message> <message> <location line="+130"/> <source>Confirm options reset</source> <translation>確認回復選項</translation> </message> <message> <location line="+1"/> <source>Some settings may require a client restart to take effect.</source> <translation>有些設定可能需要重新啓動客戶端軟體才會生效.</translation> </message> <message> <location line="+0"/> <source>Do you want to proceed?</source> <translation>你想要就做下去嗎?</translation> </message> <message> <location line="+42"/> <location line="+9"/> <source>Warning</source> <translation>警告</translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting Trenchcoin.</source> <translation>這個設定會在莱特幣程式重啓後生效.</translation> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>提供的代理伺服器位址無效</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>表單</translation> </message> <message> <location line="+50"/> <location line="+166"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Trenchcoin network after a connection is established, but this process has not completed yet.</source> <translation>顯示的資訊可能是過期的. 與莱特幣網路的連線建立後, 你的錢包會自動和網路同步, 但這個步驟還沒完成.</translation> </message> <message> <location line="-124"/> <source>Balance:</source> <translation>餘額:</translation> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation>未確認額:</translation> </message> <message> <location line="-78"/> <source>Wallet</source> <translation>錢包</translation> </message> <message> <location line="+107"/> <source>Immature:</source> <translation>未熟成</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>尚未熟成的開採金額</translation> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;最近交易&lt;/b&gt;</translation> </message> <message> <location line="-101"/> <source>Your current balance</source> <translation>目前餘額</translation> </message> <message> <location line="+29"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation>尚未確認之交易的總額, 不包含在目前餘額中</translation> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation>沒同步</translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start trenchcoin: click-to-pay handler</source> <translation>無法啟動 trenchcoin 隨按隨付處理器</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation>QR 條碼對話視窗</translation> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>付款單</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>金額:</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>標記:</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>訊息:</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>儲存為...</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation>將 URI 編碼成 QR 條碼失敗</translation> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation>輸入的金額無效, 請檢查看看.</translation> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>造出的網址太長了,請把標籤或訊息的文字縮短再試看看.</translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation>儲存 QR 條碼</translation> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>PNG 圖檔 (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>客戶端軟體名稱</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+339"/> <source>N/A</source> <translation>無</translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation>客戶端軟體版本</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>資訊</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>使用 OpenSSL 版本</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>啓動時間</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>網路</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>連線數</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation>位於測試網路</translation> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>區塊鎖鏈</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>目前區塊數</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>估計總區塊數</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>最近區塊時間</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>開啓</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation>命令列選項</translation> </message> <message> <location line="+7"/> <source>Show the Trenchcoin-Qt help message to get a list with possible Trenchcoin command-line options.</source> <translation>顯示莱特幣-Qt的求助訊息, 來取得可用的命令列選項列表.</translation> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation>顯示</translation> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>主控台</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>建置日期</translation> </message> <message> <location line="-104"/> <source>Trenchcoin - Debug window</source> <translation>莱特幣 - 除錯視窗</translation> </message> <message> <location line="+25"/> <source>Trenchcoin Core</source> <translation>莱特幣核心</translation> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation>除錯紀錄檔</translation> </message> <message> <location line="+7"/> <source>Open the Trenchcoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>從目前的資料目錄下開啓莱特幣的除錯紀錄檔. 當紀錄檔很大時可能要花好幾秒的時間.</translation> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>清主控台</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the Trenchcoin RPC console.</source> <translation>歡迎使用莱特幣 RPC 主控台.</translation> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>請用上下游標鍵來瀏覽歷史指令, 且可用 &lt;b&gt;Ctrl-L&lt;/b&gt; 來清理畫面.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>請打 &lt;b&gt;help&lt;/b&gt; 來看可用指令的簡介.</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+124"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>付錢</translation> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> <translation>一次付給多個人</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>加收款人</translation> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation>移除所有交易欄位</translation> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>全部清掉</translation> </message> <message> <location line="+22"/> <source>Balance:</source> <translation>餘額:</translation> </message> <message> <location line="+10"/> <source>123.456 BTC</source> <translation>123.456 BTC</translation> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>確認付款動作</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>付出</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-59"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation>&lt;b&gt;%1&lt;/b&gt; 給 %2 (%3)</translation> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>確認要付錢</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation>確定要付出 %1 嗎?</translation> </message> <message> <location line="+0"/> <source> and </source> <translation>和</translation> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation>無效的收款位址, 請再檢查看看.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>付款金額必須大於 0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>金額超過餘額了.</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>包含 %1 的交易手續費後, 總金額超過你的餘額了.</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>發現有重複的位址. 每個付款動作中, 只能付給個別的位址一次.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation>錯誤: 交易產生失敗!</translation> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>錯誤: 交易被拒絕. 有時候會發生這種錯誤, 是因為你錢包中的一些錢已經被花掉了. 比如說你複製了錢包檔 wallet.dat, 然後用複製的錢包花掉了錢, 你現在所用的原來的錢包中卻沒有該筆交易紀錄.</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation>表單</translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>金額:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>付給:</translation> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>付款的目標位址 (比如說 Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation>輸入一個標記給這個位址, 並加到位址簿中</translation> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation>標記:</translation> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation>從位址簿中選一個位址</translation> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation>從剪貼簿貼上位址</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation>去掉這個收款人</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a Trenchcoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>輸入莱特幣位址 (比如說 Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>簽章 - 簽署或驗證訊息</translation> </message> <message> <location line="+13"/> <source>&amp;Sign Message</source> <translation>訊息簽署</translation> </message> <message> <location line="+6"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation>你可以用自己的位址來簽署訊息, 以證明你對它的所有權. 但是請小心, 不要簽署語意含糊不清的內容, 因為釣魚式詐騙可能會用騙你簽署的手法來冒充是你. 只有在語句中的細節你都同意時才簽署.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>用來簽署訊息的位址 (比如說 Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+10"/> <location line="+213"/> <source>Choose an address from the address book</source> <translation>從位址簿選一個位址</translation> </message> <message> <location line="-203"/> <location line="+213"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-203"/> <source>Paste address from clipboard</source> <translation>從剪貼簿貼上位址</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation>在這裡輸入你想簽署的訊息</translation> </message> <message> <location line="+7"/> <source>Signature</source> <translation>簽章</translation> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation>複製目前的簽章到系統剪貼簿</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this Trenchcoin address</source> <translation>簽署訊息是用來證明這個莱特幣位址是你的</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>訊息簽署</translation> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation>重置所有訊息簽署欄位</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>全部清掉</translation> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation>訊息驗證</translation> </message> <message> <location line="+6"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation>請在下面輸入簽署的位址, 訊息(請確認完整複製了所包含的換行, 空格, 跳位符號等等), 與簽章, 以驗證該訊息. 請小心, 除了訊息內容外, 不要對簽章本身過度解讀, 以避免被用&quot;中間人攻擊法&quot;詐騙.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>簽署該訊息的位址 (比如說 Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified Trenchcoin address</source> <translation>驗證訊息是用來確認訊息是用指定的莱特幣位址簽署的</translation> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation>訊息驗證</translation> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation>重置所有訊息驗證欄位</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a Trenchcoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>輸入莱特幣位址 (比如說 Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>按&quot;訊息簽署&quot;來產生簽章</translation> </message> <message> <location line="+3"/> <source>Enter Trenchcoin signature</source> <translation>輸入莱特幣簽章</translation> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>輸入的位址無效.</translation> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation>請檢查位址是否正確後再試一次.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>輸入的位址沒有指到任何密鑰.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>錢包解鎖已取消.</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>沒有所輸入位址的密鑰.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>訊息簽署失敗.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>訊息已簽署.</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>無法將這個簽章解碼.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>請檢查簽章是否正確後再試一次.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>這個簽章與訊息的數位摘要不符.</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>訊息驗證失敗.</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>訊息已驗證.</translation> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+22"/> <source>The Trenchcoin developers</source> <translation>莱特幣開發人員</translation> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation>在 %1 前未定</translation> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation>%1/離線中</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/未確認</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>經確認 %1 次</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>狀態</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>, 已公告至 %n 個節點</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>日期</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>來源</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>生產出</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>來處</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>目的</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>自己的位址</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>標籤</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>入帳</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>將在 %n 個區塊產出後熟成</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>不被接受</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>出帳</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>交易手續費</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>淨額</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>訊息</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>附註</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>交易識別碼</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation>生產出來的錢要再等 120 個區塊熟成之後, 才能夠花用. 當你產出區塊時, 它會被公布到網路上, 以被串連至區塊鎖鏈. 如果串連失敗了, 它的狀態就會變成&quot;不被接受&quot;, 且不能被花用. 當你產出區塊的幾秒鐘內, 也有其他節點產出區塊的話, 有時候就會發生這種情形.</translation> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>除錯資訊</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>交易</translation> </message> <message> <location line="+3"/> <source>Inputs</source> <translation>輸入</translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>金額</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>是</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>否</translation> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>, 尚未成功公告出去</translation> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation><numerusform>在接下來 %n 個區塊產出前未定</numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation>未知</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>交易明細</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>此版面顯示交易的詳細說明</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+225"/> <source>Date</source> <translation>日期</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>種類</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>位址</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>金額</translation> </message> <message numerus="yes"> <location line="+57"/> <source>Open for %n more block(s)</source> <translation><numerusform>在接下來 %n 個區塊產出前未定</numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation>在 %1 前未定</translation> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation>離線中 (經確認 %1 次)</translation> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation>未確認 (經確認 %1 次, 應確認 %2 次)</translation> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation>已確認 (經確認 %1 次)</translation> </message> <message numerus="yes"> <location line="+8"/> <source>Mined balance will be available when it matures in %n more block(s)</source> <translation><numerusform>開採金額將可在 %n 個區塊熟成後可用</numerusform></translation> </message> <message> <location line="+5"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>沒有其他節點收到這個區塊, 也許它不被接受!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>生產出但不被接受</translation> </message> <message> <location line="+43"/> <source>Received with</source> <translation>收受於</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>收受自</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>付出至</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>付給自己</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>開採所得</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(不適用)</translation> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>交易狀態. 移動游標至欄位上方來顯示確認次數.</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>收到交易的日期與時間.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>交易的種類.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>交易的目標位址.</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>減去或加入至餘額的金額</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+52"/> <location line="+16"/> <source>All</source> <translation>全部</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>今天</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>這週</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>這個月</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>上個月</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>今年</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>指定範圍...</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>收受於</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>付出至</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>給自己</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>開採所得</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>其他</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>輸入位址或標記來搜尋</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>最小金額</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>複製位址</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>複製標記</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>複製金額</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation>複製交易識別碼</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>編輯標記</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>顯示交易明細</translation> </message> <message> <location line="+139"/> <source>Export Transaction Data</source> <translation>匯出交易資料</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>逗號分隔資料檔 (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>已確認</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>日期</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>種類</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>標記</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>位址</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>金額</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>識別碼</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>匯出失敗</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>無法寫入至 %1 檔案.</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>範圍:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>至</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+193"/> <source>Send Coins</source> <translation>付錢</translation> </message> </context> <context> <name>WalletView</name> <message> <location filename="../walletview.cpp" line="+42"/> <source>&amp;Export</source> <translation>匯出</translation> </message> <message> <location line="+1"/> <source>Export the data in the current tab to a file</source> <translation>將目前分頁的資料匯出存成檔案</translation> </message> <message> <location line="+193"/> <source>Backup Wallet</source> <translation>錢包備份</translation> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation>錢包資料檔 (*.dat)</translation> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation>備份失敗</translation> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation>儲存錢包資料到新的地方失敗</translation> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation>備份成功</translation> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation>錢包的資料已經成功儲存到新的地方了.</translation> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+94"/> <source>Trenchcoin version</source> <translation>莱特幣版本</translation> </message> <message> <location line="+102"/> <source>Usage:</source> <translation>用法:</translation> </message> <message> <location line="-29"/> <source>Send command to -server or trenchcoind</source> <translation>送指令給 -server 或 trenchcoind </translation> </message> <message> <location line="-23"/> <source>List commands</source> <translation>列出指令 </translation> </message> <message> <location line="-12"/> <source>Get help for a command</source> <translation>取得指令說明 </translation> </message> <message> <location line="+24"/> <source>Options:</source> <translation>選項: </translation> </message> <message> <location line="+24"/> <source>Specify configuration file (default: trenchcoin.conf)</source> <translation>指定設定檔 (預設: trenchcoin.conf) </translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: trenchcoind.pid)</source> <translation>指定行程識別碼檔案 (預設: trenchcoind.pid) </translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>指定資料目錄 </translation> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>設定資料庫快取大小為多少百萬位元組(MB, 預設: 25)</translation> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 1964 or testnet: 11964)</source> <translation>在通訊埠 &lt;port&gt; 聽候連線 (預設: 1964, 或若為測試網路: 11964)</translation> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>維持與節點連線數的上限為 &lt;n&gt; 個 (預設: 125)</translation> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>連線到某個節點以取得其它節點的位址, 然後斷線</translation> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation>指定自己公開的位址</translation> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>與亂搞的節點斷線的臨界值 (預設: 100)</translation> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>避免與亂搞的節點連線的秒數 (預設: 86400)</translation> </message> <message> <location line="-29"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>在 IPv4 網路上以通訊埠 %u 聽取 RPC 連線時發生錯誤: %s</translation> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 1963 or testnet: 11963)</source> <translation>在通訊埠 &lt;port&gt; 聽候 JSON-RPC 連線 (預設: 1963, 或若為測試網路: 11963)</translation> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation>接受命令列與 JSON-RPC 指令 </translation> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation>以背景程式執行並接受指令</translation> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation>使用測試網路 </translation> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>是否接受外來連線 (預設: 當沒有 -proxy 或 -connect 時預設為 1)</translation> </message> <message> <location line="-80"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=trenchcoinrpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;Trenchcoin Alert&quot; admin@foo.com </source> <translation>%s, 你必須要在以下設定檔中設定 RPC 密碼(rpcpassword): %s 建議你使用以下隨機產生的密碼: rpcuser=trenchcoinrpc rpcpassword=%s (你不用記住這個密碼) 使用者名稱(rpcuser)和密碼(rpcpassword)不可以相同! 如果設定檔還不存在, 請在新增時, 設定檔案權限為&quot;只有主人才能讀取&quot;. 也建議你設定警示通知, 發生問題時你才會被通知到; 比如說設定為: alertnotify=echo %%s | mail -s &quot;Trenchcoin Alert&quot; admin@foo.com </translation> </message> <message> <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>設定在 IPv6 網路的通訊埠 %u 上聽候 RPC 連線失敗, 退而改用 IPv4 網路: %s</translation> </message> <message> <location line="+3"/> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation>和指定的位址繫結, 並總是在該位址聽候連線. IPv6 請用 &quot;[主機]:通訊埠&quot; 這種格式</translation> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. Trenchcoin is probably already running.</source> <translation>無法鎖定資料目錄 %s. 也許莱特幣已經在執行了.</translation> </message> <message> <location line="+3"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>錯誤: 交易被拒絕了! 有時候會發生這種錯誤, 是因為你錢包中的一些錢已經被花掉了. 比如說你複製了錢包檔 wallet.dat, 然後用複製的錢包花掉了錢, 你現在所用的原來的錢包中卻沒有該筆交易紀錄.</translation> </message> <message> <location line="+4"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation>錯誤: 這筆交易需要至少 %s 的手續費! 因為它的金額太大, 或複雜度太高, 或是使用了最近才剛收到的款項.</translation> </message> <message> <location line="+3"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation>當收到相關警示時所要執行的指令 (指令中的 %s 會被取代為警示訊息)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>當錢包有交易改變時所要執行的指令 (指令中的 %s 會被取代為交易識別碼)</translation> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation>設定高優先權或低手續費的交易資料大小上限為多少位元組 (預設: 27000)</translation> </message> <message> <location line="+6"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation>這是尚未發表的測試版本 - 使用請自負風險 - 請不要用於開採或商業應用</translation> </message> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>警告: -paytxfee 設定了很高的金額! 這可是你交易付款所要付的手續費.</translation> </message> <message> <location line="+3"/> <source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source> <translation>警告: 顯示的交易可能不正確! 你可能需要升級, 或者需要等其它的節點升級.</translation> </message> <message> <location line="+3"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong Trenchcoin will not work properly.</source> <translation>警告: 請檢查電腦時間與日期是否正確! 莱特幣無法在時鐘不準的情況下正常運作.</translation> </message> <message> <location line="+3"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation>警告: 讀取錢包檔 wallet.dat 失敗了! 所有的密鑰都正確讀取了, 但是交易資料或位址簿資料可能會缺少或不正確.</translation> </message> <message> <location line="+3"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation>警告: 錢包檔 wallet.dat 壞掉, 但資料被拯救回來了! 原來的 wallet.dat 會改儲存在 %s, 檔名為 wallet.{timestamp}.bak. 如果餘額或交易資料有誤, 你應該要用備份資料復原回來.</translation> </message> <message> <location line="+14"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>嘗試從壞掉的錢包檔 wallet.dat 復原密鑰</translation> </message> <message> <location line="+2"/> <source>Block creation options:</source> <translation>區塊產生選項:</translation> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation>只連線至指定節點(可多個)</translation> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation>發現區塊資料庫壞掉了</translation> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>找出自己的網際網路位址 (預設: 當有聽候連線且沒有 -externalip 時為 1)</translation> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation>你要現在重建區塊資料庫嗎?</translation> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation>初始化區塊資料庫失敗</translation> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation>錢包資料庫環境 %s 初始化錯誤!</translation> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation>載入區塊資料庫失敗</translation> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation>打開區塊資料庫檔案失敗</translation> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation>錯誤: 磁碟空間很少!</translation> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation>錯誤: 錢包被上鎖了, 無法產生新的交易!</translation> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation>錯誤: 系統錯誤:</translation> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>在任意的通訊埠聽候失敗. 如果你想的話可以用 -listen=0.</translation> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation>讀取區塊資訊失敗</translation> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation>讀取區塊失敗</translation> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation>同步區塊索引失敗</translation> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation>寫入區塊索引失敗</translation> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation>寫入區塊資訊失敗</translation> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation>寫入區塊失敗</translation> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation>寫入檔案資訊失敗</translation> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation>寫入莱特幣資料庫失敗</translation> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation>寫入交易索引失敗</translation> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation>寫入回復資料失敗</translation> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation>是否允許在找節點時使用域名查詢 (預設: 當沒用 -connect 時為 1)</translation> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation>生產莱特幣 (預設值: 0)</translation> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation>啓動時檢查的區塊數 (預設: 288, 指定 0 表示全部)</translation> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation>區塊檢查的仔細程度 (0 至 4, 預設: 3)</translation> </message> <message> <location line="+19"/> <source>Not enough file descriptors available.</source> <translation>檔案描述器不足.</translation> </message> <message> <location line="+8"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation>從目前的區塊檔 blk000??.dat 重建鎖鏈索引</translation> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation>設定處理 RPC 服務請求的執行緒數目 (預設為 4)</translation> </message> <message> <location line="+26"/> <source>Verifying blocks...</source> <translation>驗證區塊資料中...</translation> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation>驗證錢包資料中...</translation> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation>從其它來源的 blk000??.dat 檔匯入區塊</translation> </message> <message> <location line="-76"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation>設定指令碼驗證的執行緒數目 (最多為 16, 若為 0 表示程式自動決定, 小於 0 表示保留不用的處理器核心數目, 預設為 0)</translation> </message> <message> <location line="+77"/> <source>Information</source> <translation>資訊</translation> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation>無效的 -tor 位址: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>設定 -minrelaytxfee=&lt;金額&gt; 的金額無效: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>設定 -mintxfee=&lt;amount&gt; 的金額無效: &apos;%s&apos;</translation> </message> <message> <location line="+8"/> <source>Maintain a full transaction index (default: 0)</source> <translation>維護全部交易的索引 (預設為 0)</translation> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>每個連線的接收緩衝區大小上限為 &lt;n&gt;*1000 個位元組 (預設: 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>每個連線的傳送緩衝區大小上限為 &lt;n&gt;*1000 位元組 (預設: 1000)</translation> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation>只接受與內建的檢查段點吻合的區塊鎖鏈 (預設: 1)</translation> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>只和 &lt;net&gt; 網路上的節點連線 (IPv4, IPv6, 或 Tor)</translation> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation>輸出額外的除錯資訊. 包含了其它所有的 -debug* 選項</translation> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation>輸出額外的網路除錯資訊</translation> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation>在除錯輸出內容前附加時間</translation> </message> <message> <location line="+5"/> <source>SSL options: (see the Trenchcoin Wiki for SSL setup instructions)</source> <translation>SSL 選項: (SSL 設定程序請見 Trenchcoin Wiki)</translation> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation>選擇 SOCKS 代理伺服器的協定版本(4 或 5, 預設: 5)</translation> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>在終端機顯示追蹤或除錯資訊, 而非寫到 debug.log 檔</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation>輸出追蹤或除錯資訊給除錯器</translation> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation>設定區塊大小上限為多少位元組 (預設: 250000)</translation> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>設定區塊大小下限為多少位元組 (預設: 0)</translation> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>客戶端軟體啓動時將 debug.log 檔縮小 (預設: 當沒有 -debug 時為 1)</translation> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation>簽署交易失敗</translation> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>指定連線在幾毫秒後逾時 (預設: 5000)</translation> </message> <message> <location line="+4"/> <source>System error: </source> <translation>系統錯誤:</translation> </message> <message> <location line="+4"/> <source>Transaction amount too small</source> <translation>交易金額太小</translation> </message> <message> <location line="+1"/> <source>Transaction amounts must be positive</source> <translation>交易金額必須是正的</translation> </message> <message> <location line="+1"/> <source>Transaction too large</source> <translation>交易位元量太大</translation> </message> <message> <location line="+7"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>是否使用通用即插即用(UPnP)協定來設定聽候連線的通訊埠 (預設: 0)</translation> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>是否使用通用即插即用(UPnP)協定來設定聽候連線的通訊埠 (預設: 當有聽候連線為 1)</translation> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation>透過代理伺服器來使用 Tor 隱藏服務 (預設: 同 -proxy)</translation> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation>JSON-RPC 連線使用者名稱</translation> </message> <message> <location line="+4"/> <source>Warning</source> <translation>警告</translation> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>警告: 這個版本已經被淘汰掉了, 必須要升級!</translation> </message> <message> <location line="+1"/> <source>You need to rebuild the databases using -reindex to change -txindex</source> <translation>改變 -txindex 參數後, 必須要用 -reindex 參數來重建資料庫</translation> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation>錢包檔 weallet.dat 壞掉了, 拯救失敗</translation> </message> <message> <location line="-50"/> <source>Password for JSON-RPC connections</source> <translation>JSON-RPC 連線密碼</translation> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>只允許從指定網路位址來的 JSON-RPC 連線</translation> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>送指令給在 &lt;ip&gt; 的節點 (預設: 127.0.0.1) </translation> </message> <message> <location line="-120"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>當最新區塊改變時所要執行的指令 (指令中的 %s 會被取代為區塊的雜湊值)</translation> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation>將錢包升級成最新的格式</translation> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>設定密鑰池大小為 &lt;n&gt; (預設: 100) </translation> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>重新掃描區塊鎖鏈, 以尋找錢包所遺漏的交易.</translation> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>於 JSON-RPC 連線使用 OpenSSL (https) </translation> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation>伺服器憑證檔 (預設: server.cert) </translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>伺服器密鑰檔 (預設: server.pem) </translation> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation>可以接受的加密法 (預設: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH) </translation> </message> <message> <location line="+165"/> <source>This help message</source> <translation>此協助訊息 </translation> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>無法和這台電腦上的 %s 繫結 (繫結回傳錯誤 %d, %s)</translation> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation>透過 SOCKS 代理伺服器連線</translation> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>允許對 -addnode, -seednode, -connect 的參數使用域名查詢 </translation> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation>載入位址中...</translation> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>載入檔案 wallet.dat 失敗: 錢包壞掉了</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of Trenchcoin</source> <translation>載入檔案 wallet.dat 失敗: 此錢包需要新版的 Trenchcoin</translation> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart Trenchcoin to complete</source> <translation>錢包需要重寫: 請重啟莱特幣來完成</translation> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation>載入檔案 wallet.dat 失敗</translation> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>無效的 -proxy 位址: &apos;%s&apos;</translation> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>在 -onlynet 指定了不明的網路別: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>在 -socks 指定了不明的代理協定版本: %i</translation> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>無法解析 -bind 位址: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>無法解析 -externalip 位址: &apos;%s&apos;</translation> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>設定 -paytxfee=&lt;金額&gt; 的金額無效: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation>無效的金額</translation> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation>累積金額不足</translation> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation>載入區塊索引中...</translation> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>加入一個要連線的節線, 並試著保持對它的連線暢通</translation> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. Trenchcoin is probably already running.</source> <translation>無法和這台電腦上的 %s 繫結. 也許莱特幣已經在執行了.</translation> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation>交易付款時每 KB 的交易手續費</translation> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation>載入錢包中...</translation> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation>無法將錢包格式降級</translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation>無法寫入預設位址</translation> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation>重新掃描中...</translation> </message> <message> <location line="-57"/> <source>Done loading</source> <translation>載入完成</translation> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation>為了要使用 %s 選項</translation> </message> <message> <location line="-74"/> <source>Error</source> <translation>錯誤</translation> </message> <message> <location line="-31"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>你必須在下列設定檔中設定 RPC 密碼(rpcpassword=&lt;password&gt;): %s 如果這個檔案還不存在, 請在新增時, 設定檔案權限為&quot;只有主人才能讀取&quot;.</translation> </message> </context> </TS>
{ "content_hash": "aa070ec698badd3b9331530598d0a80f", "timestamp": "", "source": "github", "line_count": 2955, "max_line_length": 395, "avg_line_length": 34.62707275803722, "alnum_prop": 0.6046734360798648, "repo_name": "safaricoin/trenchcoin", "id": "917e7bfb05f00f0c282c348957174785d96a7719", "size": "113515", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/qt/locale/bitcoin_zh_TW.ts", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
package com.bootdo.oa.service; import java.util.List; public interface WorkService { List listTodoWork(); }
{ "content_hash": "335bbb6afa637139617359b766ff2019", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 30, "avg_line_length": 16.285714285714285, "alnum_prop": 0.7456140350877193, "repo_name": "lcg0124/bootdo", "id": "f661ae83fcae9d96d39b34e10259047e8d388305", "size": "114", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "bootdo/src/main/java/com/bootdo/oa/service/WorkService.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "670332" }, { "name": "HTML", "bytes": "363078" }, { "name": "Java", "bytes": "402167" }, { "name": "JavaScript", "bytes": "5755197" } ], "symlink_target": "" }
<?php defined('BASEPATH') OR exit('No direct script access allowed'); /* |-------------------------------------------------------------------------- | Base Site URL |-------------------------------------------------------------------------- | | URL to your CodeIgniter root. Typically this will be your base URL, | WITH a trailing slash: | | http://example.com/ | | If this is not set then CodeIgniter will try guess the protocol, domain | and path to your installation. However, you should always configure this | explicitly and never rely on auto-guessing, especially in production | environments. | */ $config['base_url'] = ''; /* |-------------------------------------------------------------------------- | Index File |-------------------------------------------------------------------------- | | Typically this will be your index.php file, unless you've renamed it to | something else. If you are using mod_rewrite to remove the page set this | variable so that it is blank. | */ $config['index_page'] = ''; /* |-------------------------------------------------------------------------- | URI PROTOCOL |-------------------------------------------------------------------------- | | This item determines which server global should be used to retrieve the | URI string. The default setting of 'REQUEST_URI' works for most servers. | If your links do not seem to work, try one of the other delicious flavors: | | 'REQUEST_URI' Uses $_SERVER['REQUEST_URI'] | 'QUERY_STRING' Uses $_SERVER['QUERY_STRING'] | 'PATH_INFO' Uses $_SERVER['PATH_INFO'] | | WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded! */ $config['uri_protocol'] = 'REQUEST_URI'; /* |-------------------------------------------------------------------------- | URL suffix |-------------------------------------------------------------------------- | | This option allows you to add a suffix to all URLs generated by CodeIgniter. | For more information please see the user guide: | | http://codeigniter.com/user_guide/general/urls.html */ $config['url_suffix'] = ''; /* |-------------------------------------------------------------------------- | Default Language |-------------------------------------------------------------------------- | | This determines which set of language files should be used. Make sure | there is an available translation if you intend to use something other | than english. | */ $config['language'] = 'english'; /* |-------------------------------------------------------------------------- | Default Character Set |-------------------------------------------------------------------------- | | This determines which character set is used by default in various methods | that require a character set to be provided. | | See http://php.net/htmlspecialchars for a list of supported charsets. | */ $config['charset'] = 'UTF-8'; /* |-------------------------------------------------------------------------- | Enable/Disable System Hooks |-------------------------------------------------------------------------- | | If you would like to use the 'hooks' feature you must enable it by | setting this variable to TRUE (boolean). See the user guide for details. | */ $config['enable_hooks'] = FALSE; /* |-------------------------------------------------------------------------- | Class Extension Prefix |-------------------------------------------------------------------------- | | This item allows you to set the filename/classname prefix when extending | native libraries. For more information please see the user guide: | | http://codeigniter.com/user_guide/general/core_classes.html | http://codeigniter.com/user_guide/general/creating_libraries.html | */ $config['subclass_prefix'] = 'MY_'; /* |-------------------------------------------------------------------------- | Composer auto-loading |-------------------------------------------------------------------------- | | Enabling this setting will tell CodeIgniter to look for a Composer | package auto-loader script in application/vendor/autoload.php. | | $config['composer_autoload'] = TRUE; | | Or if you have your vendor/ directory located somewhere else, you | can opt to set a specific path as well: | | $config['composer_autoload'] = '/path/to/vendor/autoload.php'; | | For more information about Composer, please visit http://getcomposer.org/ | | Note: This will NOT disable or override the CodeIgniter-specific | autoloading (application/config/autoload.php) */ $config['composer_autoload'] = FALSE; /* |-------------------------------------------------------------------------- | Allowed URL Characters |-------------------------------------------------------------------------- | | This lets you specify which characters are permitted within your URLs. | When someone tries to submit a URL with disallowed characters they will | get a warning message. | | As a security measure you are STRONGLY encouraged to restrict URLs to | as few characters as possible. By default only these are allowed: a-z 0-9~%.:_- | | Leave blank to allow all characters -- but only if you are insane. | | The configured value is actually a regular expression character group | and it will be executed as: ! preg_match('/^[<permitted_uri_chars>]+$/i | | DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!! | */ $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-'; /* |-------------------------------------------------------------------------- | Enable Query Strings |-------------------------------------------------------------------------- | | By default CodeIgniter uses search-engine friendly segment based URLs: | example.com/who/what/where/ | | By default CodeIgniter enables access to the $_GET array. If for some | reason you would like to disable it, set 'allow_get_array' to FALSE. | | You can optionally enable standard query string based URLs: | example.com?who=me&what=something&where=here | | Options are: TRUE or FALSE (boolean) | | The other items let you set the query string 'words' that will | invoke your controllers and its functions: | example.com/index.php?c=controller&m=function | | Please note that some of the helpers won't work as expected when | this feature is enabled, since CodeIgniter is designed primarily to | use segment based URLs. | */ $config['allow_get_array'] = TRUE; $config['enable_query_strings'] = FALSE; $config['controller_trigger'] = 'c'; $config['function_trigger'] = 'm'; $config['directory_trigger'] = 'd'; /* |-------------------------------------------------------------------------- | Error Logging Threshold |-------------------------------------------------------------------------- | | If you have enabled error logging, you can set an error threshold to | determine what gets logged. Threshold options are: | You can enable error logging by setting a threshold over zero. The | threshold determines what gets logged. Threshold options are: | | 0 = Disables logging, Error logging TURNED OFF | 1 = Error Messages (including PHP errors) | 2 = Debug Messages | 3 = Informational Messages | 4 = All Messages | | You can also pass an array with threshold levels to show individual error types | | array(2) = Debug Messages, without Error Messages | | For a live site you'll usually only enable Errors (1) to be logged otherwise | your log files will fill up very fast. | */ $config['log_threshold'] = 0; /* |-------------------------------------------------------------------------- | Error Logging Directory Path |-------------------------------------------------------------------------- | | Leave this BLANK unless you would like to set something other than the default | application/logs/ directory. Use a full server path with trailing slash. | */ $config['log_path'] = ''; /* |-------------------------------------------------------------------------- | Log File Extension |-------------------------------------------------------------------------- | | The default filename extension for log files. The default 'php' allows for | protecting the log files via basic scripting, when they are to be stored | under a publicly accessible directory. | | Note: Leaving it blank will default to 'php'. | */ $config['log_file_extension'] = ''; /* |-------------------------------------------------------------------------- | Log File Permissions |-------------------------------------------------------------------------- | | The file system permissions to be applied on newly created log files. | | IMPORTANT: This MUST be an integer (no quotes) and you MUST use octal | integer notation (i.e. 0700, 0644, etc.) */ $config['log_file_permissions'] = 0644; /* |-------------------------------------------------------------------------- | Date Format for Logs |-------------------------------------------------------------------------- | | Each item that is logged has an associated date. You can use PHP date | codes to set your own date formatting | */ $config['log_date_format'] = 'Y-m-d H:i:s'; /* |-------------------------------------------------------------------------- | Error Views Directory Path |-------------------------------------------------------------------------- | | Leave this BLANK unless you would like to set something other than the default | application/views/errors/ directory. Use a full server path with trailing slash. | */ $config['error_views_path'] = ''; /* |-------------------------------------------------------------------------- | Cache Directory Path |-------------------------------------------------------------------------- | | Leave this BLANK unless you would like to set something other than the default | application/cache/ directory. Use a full server path with trailing slash. | */ $config['cache_path'] = ''; /* |-------------------------------------------------------------------------- | Cache Include Query String |-------------------------------------------------------------------------- | | Set this to TRUE if you want to use different cache files depending on the | URL query string. Please be aware this might result in numerous cache files. | */ $config['cache_query_string'] = FALSE; /* |-------------------------------------------------------------------------- | Encryption Key |-------------------------------------------------------------------------- | | If you use the Encryption class, you must set an encryption key. | See the user guide for more info. | | http://codeigniter.com/user_guide/libraries/encryption.html | */ $config['encryption_key'] = ''; /* |-------------------------------------------------------------------------- | Session Variables |-------------------------------------------------------------------------- | | 'sess_driver' | | The storage driver to use: files, database, redis, memcached | | 'sess_cookie_name' | | The session cookie name, must contain only [0-9a-z_-] characters | | 'sess_expiration' | | The number of SECONDS you want the session to last. | Setting to 0 (zero) means expire when the browser is closed. | | 'sess_save_path' | | The location to save sessions to, driver dependant. | | For the 'files' driver, it's a path to a writable directory. | WARNING: Only absolute paths are supported! | | For the 'database' driver, it's a table name. | Please read up the manual for the format with other session drivers. | | IMPORTANT: You are REQUIRED to set a valid save path! | | 'sess_match_ip' | | Whether to match the user's IP address when reading the session data. | | 'sess_time_to_update' | | How many seconds between CI regenerating the session ID. | | 'sess_regenerate_destroy' | | Whether to destroy session data associated with the old session ID | when auto-regenerating the session ID. When set to FALSE, the data | will be later deleted by the garbage collector. | | Other session cookie settings are shared with the rest of the application, | except for 'cookie_prefix' and 'cookie_httponly', which are ignored here. | */ $config['sess_driver'] = 'files'; $config['sess_cookie_name'] = 'ci_session'; $config['sess_expiration'] = 7200; $config['sess_save_path'] = NULL; $config['sess_match_ip'] = FALSE; $config['sess_time_to_update'] = 300; $config['sess_regenerate_destroy'] = FALSE; /* |-------------------------------------------------------------------------- | Cookie Related Variables |-------------------------------------------------------------------------- | | 'cookie_prefix' = Set a cookie name prefix if you need to avoid collisions | 'cookie_domain' = Set to .your-domain.com for site-wide cookies | 'cookie_path' = Typically will be a forward slash | 'cookie_secure' = Cookie will only be set if a secure HTTPS connection exists. | 'cookie_httponly' = Cookie will only be accessible via HTTP(S) (no javascript) | | Note: These settings (with the exception of 'cookie_prefix' and | 'cookie_httponly') will also affect sessions. | */ $config['cookie_prefix'] = ''; $config['cookie_domain'] = ''; $config['cookie_path'] = '/'; $config['cookie_secure'] = FALSE; $config['cookie_httponly'] = FALSE; /* |-------------------------------------------------------------------------- | Standardize newlines |-------------------------------------------------------------------------- | | Determines whether to standardize newline characters in input data, | meaning to replace \r\n, \r, \n occurences with the PHP_EOL value. | | This is particularly useful for portability between UNIX-based OSes, | (usually \n) and Windows (\r\n). | */ $config['standardize_newlines'] = FALSE; /* |-------------------------------------------------------------------------- | Global XSS Filtering |-------------------------------------------------------------------------- | | Determines whether the XSS filter is always active when GET, POST or | COOKIE data is encountered | | WARNING: This feature is DEPRECATED and currently available only | for backwards compatibility purposes! | */ $config['global_xss_filtering'] = FALSE; /* |-------------------------------------------------------------------------- | Cross Site Request Forgery |-------------------------------------------------------------------------- | Enables a CSRF cookie token to be set. When set to TRUE, token will be | checked on a submitted form. If you are accepting user data, it is strongly | recommended CSRF protection be enabled. | | 'csrf_token_name' = The token name | 'csrf_cookie_name' = The cookie name | 'csrf_expire' = The number in seconds the token should expire. | 'csrf_regenerate' = Regenerate token on every submission | 'csrf_exclude_uris' = Array of URIs which ignore CSRF checks */ $config['csrf_protection'] = FALSE; $config['csrf_token_name'] = 'csrf_test_name'; $config['csrf_cookie_name'] = 'csrf_cookie_name'; $config['csrf_expire'] = 7200; $config['csrf_regenerate'] = TRUE; $config['csrf_exclude_uris'] = array(); /* |-------------------------------------------------------------------------- | Output Compression |-------------------------------------------------------------------------- | | Enables Gzip output compression for faster page loads. When enabled, | the output class will test whether your server supports Gzip. | Even if it does, however, not all browsers support compression | so enable only if you are reasonably sure your visitors can handle it. | | Only used if zlib.output_compression is turned off in your php.ini. | Please do not use it together with httpd-level output compression. | | VERY IMPORTANT: If you are getting a blank page when compression is enabled it | means you are prematurely outputting something to your browser. It could | even be a line of whitespace at the end of one of your scripts. For | compression to work, nothing can be sent before the output buffer is called | by the output class. Do not 'echo' any values with compression enabled. | */ $config['compress_output'] = FALSE; /* |-------------------------------------------------------------------------- | Master Time Reference |-------------------------------------------------------------------------- | | Options are 'local' or any PHP supported timezone. This preference tells | the system whether to use your server's local time as the master 'now' | reference, or convert it to the configured one timezone. See the 'date | helper' page of the user guide for information regarding date handling. | */ $config['time_reference'] = 'local'; /* |-------------------------------------------------------------------------- | Rewrite PHP Short Tags |-------------------------------------------------------------------------- | | If your PHP installation does not have short tag support enabled CI | can rewrite the tags on-the-fly, enabling you to utilize that syntax | in your view files. Options are TRUE or FALSE (boolean) | */ $config['rewrite_short_tags'] = FALSE; /* |-------------------------------------------------------------------------- | Reverse Proxy IPs |-------------------------------------------------------------------------- | | If your server is behind a reverse proxy, you must whitelist the proxy | IP addresses from which CodeIgniter should trust headers such as | HTTP_X_FORWARDED_FOR and HTTP_CLIENT_IP in order to properly identify | the visitor's IP address. | | You can use both an array or a comma-separated list of proxy addresses, | as well as specifying whole subnets. Here are a few examples: | | Comma-separated: '10.0.1.200,192.168.5.0/24' | Array: array('10.0.1.200', '192.168.5.0/24') */ $config['proxy_ips'] = ''; $config['uri_protocol'] = "REQUEST_URI";
{ "content_hash": "aa19559300f8cb650411d63629307c51", "timestamp": "", "source": "github", "line_count": 501, "max_line_length": 83, "avg_line_length": 34.96207584830339, "alnum_prop": 0.540819821877141, "repo_name": "4uva4ek/shop.my", "id": "21b9ab58139dbb0998d67c9f67f2c5c9bd6a9bcb", "size": "17516", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/config/config.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "1421" }, { "name": "CSS", "bytes": "60964" }, { "name": "HTML", "bytes": "5633" }, { "name": "JavaScript", "bytes": "49500" }, { "name": "PHP", "bytes": "1775357" } ], "symlink_target": "" }
catstack ========
{ "content_hash": "18f51f1904e5f0d20fe9317623f11996", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 8, "avg_line_length": 9, "alnum_prop": 0.4444444444444444, "repo_name": "mattzee/catstack", "id": "5ae7d3be15023438aac074326a83dd0759c7a402", "size": "18", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
Rails.application.config.assets.precompile += %w(payments.js)
{ "content_hash": "b80953bfc5325ca97155dd117d9af067", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 61, "avg_line_length": 62, "alnum_prop": 0.7903225806451613, "repo_name": "laszpio/planner", "id": "0a3366aaed8136f9f6c9185746ac818aebd1531c", "size": "62", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "config/initializers/assets.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "10532" }, { "name": "Dockerfile", "bytes": "736" }, { "name": "HTML", "bytes": "5891" }, { "name": "Haml", "bytes": "211098" }, { "name": "JavaScript", "bytes": "5172" }, { "name": "Makefile", "bytes": "889" }, { "name": "Procfile", "bytes": "63" }, { "name": "Ruby", "bytes": "484108" }, { "name": "SCSS", "bytes": "53735" }, { "name": "Sass", "bytes": "1136" }, { "name": "Shell", "bytes": "1161" } ], "symlink_target": "" }
package org.apache.solr.client.solrj.util; import org.apache.solr.SolrTestCase; /** * @since solr 1.3 */ public class ClientUtilsTest extends SolrTestCase { public void testEscapeQuery() { assertEquals("nochange", ClientUtils.escapeQueryChars("nochange")); assertEquals("12345", ClientUtils.escapeQueryChars("12345")); assertEquals("with\\ space", ClientUtils.escapeQueryChars("with space")); assertEquals("h\\:ello\\!", ClientUtils.escapeQueryChars("h:ello!")); assertEquals("h\\~\\!", ClientUtils.escapeQueryChars("h~!")); } }
{ "content_hash": "78ea6368aee55655312abd7c986614df", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 77, "avg_line_length": 31.055555555555557, "alnum_prop": 0.7119856887298748, "repo_name": "apache/solr", "id": "d5997f5d85e0dac59c2217569650793436f9867b", "size": "1360", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "solr/solrj/src/test/org/apache/solr/client/solrj/util/ClientUtilsTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "AMPL", "bytes": "509" }, { "name": "Batchfile", "bytes": "91853" }, { "name": "CSS", "bytes": "234034" }, { "name": "Emacs Lisp", "bytes": "73" }, { "name": "HTML", "bytes": "326277" }, { "name": "Handlebars", "bytes": "7549" }, { "name": "Java", "bytes": "35849436" }, { "name": "JavaScript", "bytes": "17639" }, { "name": "Python", "bytes": "219385" }, { "name": "Shell", "bytes": "279599" }, { "name": "XSLT", "bytes": "35107" } ], "symlink_target": "" }
<?php namespace Plab\GlsUniboxDelivery\Api\Resource; use Plab\GlsUniboxDelivery\Api\Api; use Plab\GlsUniboxDelivery\Gls\Provider\Provider; /** * Class Resource * @package Plab\GlsUniboxDelivery\Api\Resource */ abstract class Resource { /** * @var Provider */ protected $provider; protected $body; abstract public function get(); abstract public function post(); abstract public function put(); abstract public function update(); abstract public function delete(); abstract public function head(); /** * Resource constructor. * @param Provider $provider */ public function __construct(Provider $provider) { $this->setProvider($provider); $this->body = file_get_contents('php://input'); } /** * @param Provider $provider */ public function setProvider(Provider $provider) { $this->provider = $provider; } /** * @return mixed * @throws \Exception */ public function bodyAsJson() { $json = json_decode($this->body); if (null === $json) { Api::httpError(406); } return $json; } public function result(string $type, $body) { if ('json' === $type) { header('Content-Type: application/json; charset=utf-8'); $body = json_encode($body); } echo $body; } }
{ "content_hash": "fbf9fb12a27921e956bcfb31fec25ba4", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 68, "avg_line_length": 21.028985507246375, "alnum_prop": 0.5678842177808407, "repo_name": "Power-LAB/gls-unibox-delivery", "id": "92e8ef32c08bcd3530c8689becc36f5ffbe80392", "size": "1666", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Api/Resource/Resource.php", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "12219" }, { "name": "Makefile", "bytes": "1033" }, { "name": "Nginx", "bytes": "3418" }, { "name": "PHP", "bytes": "96167" }, { "name": "Shell", "bytes": "83" } ], "symlink_target": "" }
from django.conf.urls import url from awx.api.views import ( CredentialList, CredentialActivityStreamList, CredentialDetail, CredentialAccessList, CredentialObjectRolesList, CredentialOwnerUsersList, CredentialOwnerTeamsList, CredentialCopy, ) urls = [ url(r'^$', CredentialList.as_view(), name='credential_list'), url(r'^(?P<pk>[0-9]+)/activity_stream/$', CredentialActivityStreamList.as_view(), name='credential_activity_stream_list'), url(r'^(?P<pk>[0-9]+)/$', CredentialDetail.as_view(), name='credential_detail'), url(r'^(?P<pk>[0-9]+)/access_list/$', CredentialAccessList.as_view(), name='credential_access_list'), url(r'^(?P<pk>[0-9]+)/object_roles/$', CredentialObjectRolesList.as_view(), name='credential_object_roles_list'), url(r'^(?P<pk>[0-9]+)/owner_users/$', CredentialOwnerUsersList.as_view(), name='credential_owner_users_list'), url(r'^(?P<pk>[0-9]+)/owner_teams/$', CredentialOwnerTeamsList.as_view(), name='credential_owner_teams_list'), url(r'^(?P<pk>[0-9]+)/copy/$', CredentialCopy.as_view(), name='credential_copy'), ] __all__ = ['urls']
{ "content_hash": "4fc29db737822c0b0c7021c958b74960", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 126, "avg_line_length": 43.38461538461539, "alnum_prop": 0.6737588652482269, "repo_name": "wwitzel3/awx", "id": "c444da90907dc1a868a426b8579d6a168cf5fc98", "size": "1187", "binary": false, "copies": "1", "ref": "refs/heads/devel", "path": "awx/api/urls/credential.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "303046" }, { "name": "Dockerfile", "bytes": "5713" }, { "name": "HTML", "bytes": "496559" }, { "name": "JavaScript", "bytes": "3513112" }, { "name": "Makefile", "bytes": "21133" }, { "name": "PowerShell", "bytes": "10176" }, { "name": "Python", "bytes": "3904288" }, { "name": "Shell", "bytes": "13833" } ], "symlink_target": "" }
from pyface.qt import QtCore, QtGui # Enthought library imports. from traits.api import Instance, List # Local imports. from dock_pane import AREA_MAP, INVERSE_AREA_MAP from main_window_layout import MainWindowLayout from pyface.tasks.i_task_window_backend import MTaskWindowBackend from pyface.tasks.task_layout import PaneItem, TaskLayout # Constants. CORNER_MAP = { 'top_left' : QtCore.Qt.TopLeftCorner, 'top_right' : QtCore.Qt.TopRightCorner, 'bottom_left' : QtCore.Qt.BottomLeftCorner, 'bottom_right' : QtCore.Qt.BottomRightCorner } class TaskWindowBackend(MTaskWindowBackend): """ The toolkit-specific implementation of a TaskWindowBackend. See the ITaskWindowBackend interface for API documentation. """ #### Private interface #################################################### _main_window_layout = Instance(MainWindowLayout) ########################################################################### # 'ITaskWindowBackend' interface. ########################################################################### def create_contents(self, parent): """ Create and return the TaskWindow's contents. """ QtGui.QApplication.instance().focusChanged.connect( self._focus_changed_signal) return QtGui.QStackedWidget(parent) def destroy(self): """ Destroy the backend. """ QtGui.QApplication.instance().focusChanged.disconnect( self._focus_changed_signal) # signal to layout we don't need it any more self._main_window_layout.control = None def hide_task(self, state): """ Assuming the specified TaskState is active, hide its controls. """ # Save the task's layout in case it is shown again later. self.window._active_state.layout = self.get_layout() # Now hide its controls. self.control.centralWidget().removeWidget(state.central_pane.control) for dock_pane in state.dock_panes: # Warning: The layout behavior is subtly different (and wrong!) if # the order of these two statement is switched. dock_pane.control.hide() self.control.removeDockWidget(dock_pane.control) def show_task(self, state): """ Assuming no task is currently active, show the controls of the specified TaskState. """ # Show the central pane. self.control.centralWidget().addWidget(state.central_pane.control) # Show the dock panes. self._layout_state(state) # OSX-specific: if there is only a single tool bar, it doesn't matter if # the user can drag it around or not. Therefore, we can combine it with # the title bar, which is idiomatic on the Mac. self.control.setUnifiedTitleAndToolBarOnMac( len(state.tool_bar_managers) <= 1) #### Methods for saving and restoring the layout ########################## def get_layout(self): """ Returns a TaskLayout for the current state of the window. """ # Extract the layout from the main window. layout = TaskLayout(id=self.window._active_state.task.id) self._main_window_layout.state = self.window._active_state self._main_window_layout.get_layout(layout) # Extract the window's corner configuration. for name, corner in CORNER_MAP.iteritems(): area = INVERSE_AREA_MAP[int(self.control.corner(corner))] setattr(layout, name + '_corner', area) return layout def set_layout(self, layout): """ Applies a TaskLayout (which should be suitable for the active task) to the window. """ self.window._active_state.layout = layout self._layout_state(self.window._active_state) ########################################################################### # Private interface. ########################################################################### def _layout_state(self, state): """ Layout the dock panes in the specified TaskState using its TaskLayout. """ # Assign the window's corners to the appropriate dock areas. for name, corner in CORNER_MAP.iteritems(): area = getattr(state.layout, name + '_corner') self.control.setCorner(corner, AREA_MAP[area]) # Add all panes in the TaskLayout. self._main_window_layout.state = state self._main_window_layout.set_layout(state.layout) # Add all panes not assigned an area by the TaskLayout. for dock_pane in state.dock_panes: if dock_pane.control not in self._main_window_layout.consumed: self.control.addDockWidget(AREA_MAP[dock_pane.dock_area], dock_pane.control) # By default, these panes are not visible. However, if a pane # has been explicitly set as visible, honor that setting. if dock_pane.visible: dock_pane.control.show() #### Trait initializers ################################################### def __main_window_layout_default(self): return TaskWindowLayout(control=self.control) #### Signal handlers ###################################################### def _focus_changed_signal(self, old, new): if self.window.active_task: panes = [ self.window.central_pane ] + self.window.dock_panes for pane in panes: if new and pane.control.isAncestorOf(new): pane.has_focus = True elif old and pane.control.isAncestorOf(old): pane.has_focus = False class TaskWindowLayout(MainWindowLayout): """ A MainWindowLayout for a TaskWindow. """ #### 'TaskWindowLayout' interface ######################################### consumed = List state = Instance('pyface.tasks.task_window.TaskState') ########################################################################### # 'MainWindowLayout' interface. ########################################################################### def set_layout(self, layout): """ Applies a DockLayout to the window. """ self.consumed = [] super(TaskWindowLayout, self).set_layout(layout) ########################################################################### # 'MainWindowLayout' abstract interface. ########################################################################### def _get_dock_widget(self, pane): """ Returns the QDockWidget associated with a PaneItem. """ for dock_pane in self.state.dock_panes: if dock_pane.id == pane.id: self.consumed.append(dock_pane.control) return dock_pane.control return None def _get_pane(self, dock_widget): """ Returns a PaneItem for a QDockWidget. """ for dock_pane in self.state.dock_panes: if dock_pane.control == dock_widget: return PaneItem(id=dock_pane.id) return None
{ "content_hash": "8de3b67e44361e621f5f38afbd85deaf", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 80, "avg_line_length": 39.21195652173913, "alnum_prop": 0.5503811503811504, "repo_name": "brett-patterson/pyface", "id": "01a1b0e16b6ecae93eac87e157c075553216cd59", "size": "7241", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pyface/ui/qt4/tasks/task_window_backend.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "648" }, { "name": "Python", "bytes": "2371056" } ], "symlink_target": "" }
package org.gedcomx.common; import org.testng.annotations.Test; import static org.testng.Assert.*; public class TextValueTest { @Test public void testDefaultCtor() throws Exception { TextValue literal = new TextValue(); literal.setLang("en-US"); literal.setValue("value"); assertEquals(literal.getLang(), "en-US"); assertEquals(literal.getValue(), "value"); } @Test public void testValueCtor() throws Exception { TextValue literal = new TextValue("value"); assertNull(literal.getLang()); assertEquals(literal.getValue(), "value"); } @Test public void testEqualsAndHash() throws Exception { TextValue literal1 = new TextValue("value"); literal1.setLang("lang"); TextValue literal2 = new TextValue("value"); literal2.setLang("lang"); TextValue literal3 = new TextValue("not-matching"); TextValue literal4 = new TextValue("not-matching"); literal4.setLang("lang"); assertTrue(literal1.equals(literal1)); assertFalse(literal1.equals(null)); assertTrue(literal1.equals(literal1)); assertTrue(literal1.equals(literal2)); assertEquals(literal1.hashCode(), literal2.hashCode()); assertFalse(literal1.equals(literal3)); assertFalse(literal1.equals(literal4)); assertTrue(literal1.toString().contains("value")); assertTrue(literal2.toString().contains("lang")); } }
{ "content_hash": "dcd2523bdab226189cb13665d3b2a0cd", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 59, "avg_line_length": 28.75, "alnum_prop": 0.7028985507246377, "repo_name": "brenthale/gedcomx-java", "id": "7f67b583e72d184cb2261b6319467e2b28148e85", "size": "1380", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "gedcomx-model/src/test/java/org/gedcomx/common/TextValueTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "17806" }, { "name": "HTML", "bytes": "11968" }, { "name": "Java", "bytes": "2205333" } ], "symlink_target": "" }
/** * @fileoverview Prevent direct mutation of this.state * @author David Petersen */ 'use strict'; // ------------------------------------------------------------------------------ // Requirements // ------------------------------------------------------------------------------ const RuleTester = require('eslint').RuleTester; const rule = require('../../../lib/rules/no-direct-mutation-state'); const parsers = require('../../helpers/parsers'); const parserOptions = { ecmaVersion: 2018, sourceType: 'module', ecmaFeatures: { jsx: true, }, }; // ------------------------------------------------------------------------------ // Tests // ------------------------------------------------------------------------------ const ruleTester = new RuleTester({ parserOptions }); ruleTester.run('no-direct-mutation-state', rule, { valid: parsers.all([ { code: ` var Hello = createReactClass({ render: function() { return <div>Hello {this.props.name}</div>; } }); `, }, { code: ` var Hello = createReactClass({ render: function() { var obj = {state: {}}; obj.state.name = "foo"; return <div>Hello {obj.state.name}</div>; } }); `, }, { code: ` var Hello = "foo"; module.exports = {}; `, }, { code: ` class Hello { getFoo() { this.state.foo = 'bar' return this.state.foo; } } `, }, { code: ` class Hello extends React.Component { constructor() { this.state.foo = "bar" } } `, }, { code: ` class Hello extends React.Component { constructor() { this.state.foo = 1; } } `, }, { code: ` class OneComponent extends Component { constructor() { super(); class AnotherComponent extends Component { constructor() { super(); } } this.state = {}; } } `, }, ]), invalid: parsers.all([ { code: ` var Hello = createReactClass({ render: function() { this.state.foo = "bar" return <div>Hello {this.props.name}</div>; } }); `, errors: [{ messageId: 'noDirectMutation' }], }, { code: ` var Hello = createReactClass({ render: function() { this.state.foo++; return <div>Hello {this.props.name}</div>; } }); `, errors: [{ messageId: 'noDirectMutation' }], }, { code: ` var Hello = createReactClass({ render: function() { this.state.person.name= "bar" return <div>Hello {this.props.name}</div>; } }); `, errors: [{ messageId: 'noDirectMutation' }], }, { code: ` var Hello = createReactClass({ render: function() { this.state.person.name.first = "bar" return <div>Hello</div>; } }); `, errors: [{ messageId: 'noDirectMutation' }], }, { code: ` var Hello = createReactClass({ render: function() { this.state.person.name.first = "bar" this.state.person.name.last = "baz" return <div>Hello</div>; } }); `, errors: [ { message: 'Do not mutate state directly. Use setState().', line: 4, column: 13, }, { message: 'Do not mutate state directly. Use setState().', line: 5, column: 13, }, ], }, { code: ` class Hello extends React.Component { constructor() { someFn() } someFn() { this.state.foo = "bar" } } `, errors: [{ messageId: 'noDirectMutation' }], }, { code: ` class Hello extends React.Component { constructor(props) { super(props) doSomethingAsync(() => { this.state = "bad"; }); } } `, errors: [{ messageId: 'noDirectMutation' }], }, { code: ` class Hello extends React.Component { componentWillMount() { this.state.foo = "bar" } } `, errors: [{ messageId: 'noDirectMutation' }], }, { code: ` class Hello extends React.Component { componentDidMount() { this.state.foo = "bar" } } `, errors: [{ messageId: 'noDirectMutation' }], }, { code: ` class Hello extends React.Component { componentWillReceiveProps() { this.state.foo = "bar" } } `, errors: [{ messageId: 'noDirectMutation' }], }, { code: ` class Hello extends React.Component { shouldComponentUpdate() { this.state.foo = "bar" } } `, errors: [{ messageId: 'noDirectMutation' }], }, { code: ` class Hello extends React.Component { componentWillUpdate() { this.state.foo = "bar" } } `, errors: [{ messageId: 'noDirectMutation' }], }, { code: ` class Hello extends React.Component { componentDidUpdate() { this.state.foo = "bar" } } `, errors: [{ messageId: 'noDirectMutation' }], }, { code: ` class Hello extends React.Component { componentWillUnmount() { this.state.foo = "bar" } } `, errors: [{ messageId: 'noDirectMutation' }], }, /** * Would be nice to prevent this too { code: ` var Hello = createReactClass({ render: function() { var that = this; that.state.person.name.first = "bar" return <div>Hello</div>; } }); `, errors: [{messageId: 'noDirectMutation'}] } */ ]), });
{ "content_hash": "37be6b21ab47711258622ccd8aeddeb0", "timestamp": "", "source": "github", "line_count": 282, "max_line_length": 81, "avg_line_length": 22.617021276595743, "alnum_prop": 0.41643148322358103, "repo_name": "yannickcr/eslint-plugin-react", "id": "fa9f7311887318c69c2eedd94dd0d8e71720dac3", "size": "6378", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/lib/rules/no-direct-mutation-state.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "2444005" } ], "symlink_target": "" }
package com.yue.demo.desktop; import java.util.Random; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Paint; import android.os.Handler; import android.service.wallpaper.WallpaperService; import android.view.MotionEvent; import android.view.SurfaceHolder; import com.yue.demo.R; public class LiveWallpaper extends WallpaperService { // 记录用户触碰点的位图 private Bitmap heart; // 实现WallpaperService必须实现的抽象方法 @Override public Engine onCreateEngine() { // TODO Auto-generated method stub heart = BitmapFactory.decodeResource(getResources(), R.drawable.heart); return new MyEngine(); } class MyEngine extends Engine { // 记录程序界面是否可见 private boolean mVisible; // 记录当前当前用户动作事件的发生位置 private float mTouchX = -1; private float mTouchY = -1; // 记录当前需要绘制的矩形的数量 private int count = 1; // 记录绘制第一个矩形所需坐标变换的X、Y坐标的偏移 private int originX = 50, originY = 50; // 定义画笔 private Paint mPaint = new Paint(); // 定义一个Handler Handler mHandler = new Handler(); // 定义一个周期性执行的任务 private final Runnable drawTarget = new Runnable() { public void run() { drawFrame(); } }; @Override public void onCreate(SurfaceHolder surfaceHolder) { // TODO Auto-generated method stub mPaint.setARGB(76, 0, 0, 255); mPaint.setAntiAlias(true); mPaint.setStyle(Paint.Style.FILL); setTouchEventsEnabled(true); super.onCreate(surfaceHolder); } @Override public void onDestroy() { super.onDestroy(); mHandler.removeCallbacks(drawTarget); } @Override public void onVisibilityChanged(boolean visible) { // TODO Auto-generated method stub mVisible = visible; if (visible) drawFrame(); else mHandler.removeCallbacks(drawTarget); super.onVisibilityChanged(visible); } @Override public void onTouchEvent(MotionEvent event) { // TODO Auto-generated method stub if (event.getAction() == MotionEvent.ACTION_MOVE) { mTouchX = event.getX(); mTouchY = event.getY(); } else { mTouchX = -1; mTouchY = -1; } super.onTouchEvent(event); } @Override public void onOffsetsChanged(float xOffset, float yOffset, float xOffsetStep, float yOffsetStep, int xPixelOffset, int yPixelOffset) { drawFrame(); } /** 定义绘制图形的工具方法 */ protected void drawFrame() { // 获取该壁纸的SurfaceHolder final SurfaceHolder holder = getSurfaceHolder(); Canvas c = null; try { // 对画布加锁 c = holder.lockCanvas(); if (c != null) { // 绘制背景色 c.drawColor(0xffffffff); // 在触碰点绘制心形 drawTouchPoint(c); // 设置画笔的透明度 mPaint.setAlpha(76); c.translate(originX, originY); // 采用循环绘制count个矩形 for (int i = 0; i < count; i++) // ① { c.translate(80, 0); c.scale(0.95f, 0.95f); c.rotate(20f); c.drawRect(0, 0, 150, 75, mPaint); } } } finally { if (c != null) holder.unlockCanvasAndPost(c); } mHandler.removeCallbacks(drawTarget); // 调度下一次重绘 if (mVisible) { count++; if (count >= 50) { Random rand = new Random(); count = 1; originX += (rand.nextInt(60) - 30); originY += (rand.nextInt(60) - 30); try { Thread.sleep(500); } catch (InterruptedException e) { e.printStackTrace(); } } // 指定0.1秒后重新执行mDrawCube一次 mHandler.postDelayed(drawTarget, 100); // ② } } // 在屏幕触碰点绘制圆圈 private void drawTouchPoint(Canvas c) { if (mTouchX >= 0 && mTouchY >= 0) { // 设置画笔的透明度 mPaint.setAlpha(255); c.drawBitmap(heart, mTouchX, mTouchY, mPaint); } } } }
{ "content_hash": "951c1fbe6655fd28edb4a85e81498e15", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 79, "avg_line_length": 30.14375, "alnum_prop": 0.4909807173958117, "repo_name": "moon2012/Android", "id": "025312dfe583f0a4485f0b9efb1955e102b4c567", "size": "5209", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "demo/src/main/java/com/yue/demo/desktop/LiveWallpaper.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "8887" }, { "name": "HTML", "bytes": "25864" }, { "name": "Java", "bytes": "2592977" }, { "name": "JavaScript", "bytes": "246256" }, { "name": "Makefile", "bytes": "1048" } ], "symlink_target": "" }
<?php /** * @author OnTheGo Systems */ class WPML_Canonicals { const CANONICAL_FOR_DUPLICATED_POST = 'duplicate'; const CANONICAL_FOR_NON_TRANSLATABLE_POST = 'non-translatable'; /** @var SitePress */ private $sitepress; /** @var WPML_Translations */ private $wpml_translations; /** * WPML_Canonicals constructor. * * @param SitePress $sitepress * @param WPML_Translations $wpml_translations */ public function __construct( SitePress $sitepress, WPML_Translations $wpml_translations = null ) { $this->sitepress = $sitepress; $this->wpml_translations = $wpml_translations; } /** * @param int $post_id * * @return bool|string * @throws \InvalidArgumentException */ private function must_filter_permalink( $post_id ) { $this->init_wpml_translations(); $post_element = new WPML_Post_Element( $post_id, $this->sitepress ); $must_handle_canonicals = $this->must_handle_a_canonical_url(); if ( $post_element->is_translatable() ) { if ( $must_handle_canonicals && $this->wpml_translations->is_a_duplicate_of( $post_element ) && $this->is_permalink_filter_from_rel_canonical() ) { return self::CANONICAL_FOR_DUPLICATED_POST; } } elseif ( $must_handle_canonicals ) { return self::CANONICAL_FOR_NON_TRANSLATABLE_POST; } return false; } /** * @param string $link * @param int $post_id * * @return null|string * @throws \InvalidArgumentException */ public function permalink_filter( $link, $post_id ) { switch ( $this->must_filter_permalink( $post_id ) ) { case self::CANONICAL_FOR_DUPLICATED_POST: $post_element = new WPML_Post_Element( $post_id, $this->sitepress ); return $this->get_canonical_of_duplicate( $post_element ); case self::CANONICAL_FOR_NON_TRANSLATABLE_POST: return $this->get_url_in_default_language_if_rel_canonical( $link ); default: return null; } } /** * @param string|bool $canonical_url * @param WP_Post $post * * @return string|bool * @throws \InvalidArgumentException */ public function get_canonical_url( $canonical_url, $post ) { if ( $post && $this->sitepress->get_wp_api()->is_front_end() ) { $post_element = new WPML_Post_Element( $post->ID, $this->sitepress ); if ( ! $post_element->is_translatable() ) { global $wpml_url_filters; $wpml_url_filters->remove_global_hooks(); $canonical_url = $this->sitepress->convert_url_string( $canonical_url, $this->sitepress->get_default_language() ); $wpml_url_filters->add_global_hooks(); } else { $this->init_wpml_translations(); if ( $this->wpml_translations->is_a_duplicate_of( $post_element ) ) { $canonical_url = (string) $this->get_canonical_of_duplicate( $post_element ); } } } return $canonical_url; } private function has_wp_get_canonical_url() { return $this->sitepress->get_wp_api()->function_exists( 'wp_get_canonical_url' ); } /** * @return bool */ private function is_permalink_filter_from_rel_canonical() { $back_trace_stack = $this->sitepress->get_wp_api()->get_backtrace( 20 ); $keywords = array( 'rel_canonical', 'canonical', 'generate_canonical' ); $result = false; if ( $back_trace_stack ) { foreach ( $back_trace_stack as $key => $value ) { foreach ( $keywords as $keyword ) { if ( 'function' === $key && $keyword === $value ) { $result = true; break 2; } } } } return $result; } /** * @param string $link * * @return bool|string */ private function get_url_in_default_language_if_rel_canonical( $link ) { if ( $this->is_permalink_filter_from_rel_canonical() ) { $default_language = $this->sitepress->get_default_language(); $link = (string) $this->sitepress->convert_url( $link, $default_language ); } return $link; } /** * @param WPML_Post_Element $post_element * * @return false|string */ private function get_canonical_of_duplicate( $post_element ) { $source_element = $post_element->get_source_element(); if ( $source_element ) { $source_element_id = $source_element->get_id(); $source_language_code = $source_element->get_language_code(); $current_language = $this->sitepress->get_current_language(); $this->sitepress->switch_lang( $source_language_code ); $new_link = get_permalink( $source_element_id ); $this->sitepress->switch_lang( $current_language ); } else { $new_link = get_permalink( $post_element->get_id() ); } return $new_link; } /** * @return bool */ private function must_handle_a_canonical_url() { return ! $this->has_wp_get_canonical_url() && $this->sitepress->get_wp_api()->is_front_end(); } function maybe_fix_nginx_redirection() { if ( isset( $_SERVER['SERVER_SOFTWARE'] ) && strpos( strtolower( $_SERVER['SERVER_SOFTWARE'] ), 'nginx' ) !== false ) { add_filter( 'redirect_canonical', array( $this, 'maybe_fix_nginx_redirection_callback' ) ); } } /** * @param string $redirect * * @return bool|string */ function maybe_fix_nginx_redirection_callback( $redirect ) { if ( is_front_page() ) { $redirect = false; } return $redirect; } private function init_wpml_translations() { if ( ! $this->wpml_translations ) { $this->wpml_translations = new WPML_Translations( $this->sitepress ); } } }
{ "content_hash": "c026aa8a070609c7b79ad9b809346e32", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 150, "avg_line_length": 28.329787234042552, "alnum_prop": 0.6385655276004506, "repo_name": "Kilbourne/biosphaera", "id": "35e68a8a00447d9125093293a1e32202a1c313f2", "size": "5326", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "web/app/plugins/sitepress-multilingual-cms/classes/canonicals/class-wpml-canonicals.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "223361" }, { "name": "HTML", "bytes": "40850" }, { "name": "JavaScript", "bytes": "44809" }, { "name": "PHP", "bytes": "173651" } ], "symlink_target": "" }
@interface SampleViewController : UIViewController { @private } @end
{ "content_hash": "5d95295aef3a9ed763f7d7cbccf3eeb0", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 52, "avg_line_length": 12.5, "alnum_prop": 0.7333333333333333, "repo_name": "OliverLetterer/UIImage-UITabBarStyle", "id": "6c9ca2f96d78a8232790c018e95cd43a4eb3ca9b", "size": "270", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "UIImageUITabBarStyleSampleApplication/UIImageUITabBarStyleSampleApplication/SampleViewController.h", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.prelude.query; import java.util.Iterator; import java.util.List; /** * Helper functions for Item * * @author Arne Bergene Fossaa */ public class ItemHelper { /** Traverse the query tree and return total number of terms */ int getNumTerms(Item rootNode) { int numTerms = 0; if (rootNode == null) { return 0; } else if (rootNode instanceof CompositeItem) { CompositeItem composite = (CompositeItem) rootNode; for (Iterator<Item> i = composite.getItemIterator(); i.hasNext();) { numTerms += getNumTerms(i.next()); } } else if (rootNode instanceof TermItem) { return 1; } else { return 0; } return numTerms; } public void getPositiveTerms(Item item, List<IndexedItem> terms) { if (item instanceof NotItem) { getPositiveTerms(((NotItem) item).getPositiveItem(), terms); } else if (item instanceof PhraseItem) { PhraseItem pItem = (PhraseItem)item; terms.add(pItem); } else if (item instanceof CompositeItem) { for (Iterator<Item> i = ((CompositeItem) item).getItemIterator(); i.hasNext();) { getPositiveTerms(i.next(), terms); } } else if (item instanceof TermItem) { terms.add((TermItem)item); } } }
{ "content_hash": "96558c687f9287cc77d7fb5581c932d4", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 104, "avg_line_length": 31.06122448979592, "alnum_prop": 0.588042049934297, "repo_name": "vespa-engine/vespa", "id": "3c50a87cbe6d273b608e6f1d34eb4894edfaf680", "size": "1522", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "container-search/src/main/java/com/yahoo/prelude/query/ItemHelper.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "8130" }, { "name": "C", "bytes": "60315" }, { "name": "C++", "bytes": "29580035" }, { "name": "CMake", "bytes": "593981" }, { "name": "Emacs Lisp", "bytes": "91" }, { "name": "GAP", "bytes": "3312" }, { "name": "Go", "bytes": "560664" }, { "name": "HTML", "bytes": "54520" }, { "name": "Java", "bytes": "40814190" }, { "name": "JavaScript", "bytes": "73436" }, { "name": "LLVM", "bytes": "6152" }, { "name": "Lex", "bytes": "11499" }, { "name": "Makefile", "bytes": "5553" }, { "name": "Objective-C", "bytes": "12369" }, { "name": "Perl", "bytes": "23134" }, { "name": "Python", "bytes": "52392" }, { "name": "Roff", "bytes": "17506" }, { "name": "Ruby", "bytes": "10690" }, { "name": "Shell", "bytes": "268737" }, { "name": "Yacc", "bytes": "14735" } ], "symlink_target": "" }
#include "hooks/hooks.H" #include <errno.h> #include <fcntl.h> #include <unistd.h> #include "libdft_api.h" #include "tagmap.h" #include "pin.H" #include "provlog.H" #include "dtracker.H" #include "osutils.H" /* tracks whether path existed before the execution of syscall */ static struct { std::string pathname; int existed_before_syscall; } exist_status; /* * open(2)/creat(2) handlers * * Signatures: * int open(const char *pathname, int flags); * int open(const char *pathname, int flags, mode_t mode); * int creat(const char *pathname, mode_t mode); */ #define DEF_SYSCALL_OPEN #include "hooks/syscall_args.h" template<> void pre_open_hook<libdft_tag_set_fdoff>(syscall_ctx_t *ctx) { /* Check the status of the pathname we are about to open/create. */ exist_status.pathname = std::string(_PATHNAME); exist_status.existed_before_syscall = path_exists(exist_status.pathname); //std::cerr << exist_status.pathname << std::endl; //std::cerr << exist_status.existed_before_syscall << std::endl; } template<> void post_open_hook<libdft_tag_set_fdoff>(syscall_ctx_t *ctx) { /* not successful; optimized branch */ if (unlikely(_FD < 0)) { LOG("ERROR " _CALL_LOG_STR + " (" + strerror(errno) + ")\n"); return; } /* Resolve fd to full pathname. Use this instead of syscall argument. */ const std::string fdn = fdname(_FD); if ( !in_dtracker_whitelist(fdn) && !path_isdir(fdn) ) { const PROVLOG::ufd_t ufd = PROVLOG::ufdmap[_FD]; fdset.insert(_FD); int created = ( exist_status.existed_before_syscall != 1 && (_FLAGS & O_CREAT) && exist_status.pathname == std::string(_PATHNAME) ); LOG("OK " _CALL_LOG_STR + "\n"); LOG("INFO mapped fd" + decstr(_FD) + ":ufd" + decstr(ufd) + "\n"); PROVLOG::open(ufd, fdn, _FLAGS, created); } else { LOG("INFO ignoring fd" + decstr(_FD) + " (" + fdn + ")\n"); } /* reset the exist_status */ exist_status.existed_before_syscall = 0; } #define UNDEF_SYSCALL_OPEN #include "hooks/syscall_args.h" /* * close(2) handler - updates watched fds * * Signature: int close(int fd); */ #define DEF_SYSCALL_CLOSE #include "hooks/syscall_args.h" template<> void post_close_hook<libdft_tag_set_fdoff>(syscall_ctx_t *ctx) { /* not successful; optimized branch */ if (unlikely(_RET_STATUS < 0)) { LOG("ERROR " _CALL_LOG_STR + " (" + strerror(errno) + ")\n"); return; } LOG("OK " _CALL_LOG_STR + "\n"); std::set<int>::iterator it = fdset.find(_FD); if (it == fdset.end()) return; const PROVLOG::ufd_t ufd = PROVLOG::ufdmap[_FD]; fdset.erase(it); PROVLOG::ufdmap.del(_FD); if (IS_STDFD(_FD)) stdcount[_FD] = 0; LOG("INFO removed mapping fd" + decstr(_FD) + ":ufd" + decstr(ufd) + "\n"); PROVLOG::close(ufd); } #define UNDEF_SYSCALL_CLOSE #include "hooks/syscall_args.h" /* vim: set noet ts=4 sts=4 sw=4 ai : */
{ "content_hash": "d4f9b8d1e10b3f00f240bd680b3fd85a", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 77, "avg_line_length": 26.59433962264151, "alnum_prop": 0.6491663710535651, "repo_name": "m000/dtracker", "id": "9d3e8faaefd83067c6dc2a4bacb409635cd0ab21", "size": "2819", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "hooks/libdft_tag_set_fdoff/openclose.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C++", "bytes": "51730" }, { "name": "Makefile", "bytes": "6032" }, { "name": "Python", "bytes": "18077" } ], "symlink_target": "" }
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Point3D")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Point3D")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("ce51657d-bf63-496d-a89c-e8ed8c7f1e76")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
{ "content_hash": "90654a9e1dcd530a1a60eb2f9a5ca6f6", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 84, "avg_line_length": 38.52777777777778, "alnum_prop": 0.7433309300648883, "repo_name": "YaneYosifov/TelerikAcademy", "id": "2dfa7411d19175ba1f15c1e83cca71d2f0c20ca4", "size": "1390", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "C# OOP/Homeworks/02.Defining-Classes-Part-2-Static-Members-Generics/Point3D/Properties/AssemblyInfo.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "104820" }, { "name": "Batchfile", "bytes": "524" }, { "name": "C#", "bytes": "1470931" }, { "name": "CSS", "bytes": "83613" }, { "name": "CoffeeScript", "bytes": "3700" }, { "name": "HTML", "bytes": "271804" }, { "name": "JavaScript", "bytes": "412546" }, { "name": "Python", "bytes": "111725" }, { "name": "Smalltalk", "bytes": "219384" }, { "name": "XSLT", "bytes": "3327" } ], "symlink_target": "" }
import { isFn, isArr } from './types' import { instOf } from './instanceof' import { BigData } from './big-data' const isArray = isArr const keyList = Object.keys const hasProp = Object.prototype.hasOwnProperty type Filter = (comparies: { a: any; b: any }, key: string) => boolean /* eslint-disable */ function equal(a: any, b: any, filter?: Filter) { // fast-deep-equal index.js 2.0.1 if (a === b) { return true } if (a && b && typeof a === 'object' && typeof b === 'object') { const bigDataA = BigData.isBigData(a) const bigDataB = BigData.isBigData(b) if (bigDataA !== bigDataB) { return false } if (bigDataA && bigDataB) { return BigData.compare(a, b) } const arrA = isArray(a) const arrB = isArray(b) let i: number let length: number let key: string | number if (arrA && arrB) { length = a.length if (length !== b.length) { return false } for (i = length; i-- !== 0; ) { if (!equal(a[i], b[i], filter)) { return false } } return true } if (arrA !== arrB) { return false } const momentA = a && a._isAMomentObject const momentB = b && b._isAMomentObject if (momentA !== momentB) return false if (momentA && momentB) return a.isSame(b) const immutableA = a && a.toJS const immutableB = b && b.toJS if (immutableA !== immutableB) return false if (immutableA) return a.is ? a.is(b) : a === b const dateA = instOf(a, 'Date') const dateB = instOf(b, 'Date') if (dateA !== dateB) { return false } if (dateA && dateB) { return a.getTime() === b.getTime() } const schemaA = a && a.toJSON const schemaB = b && b.toJSON if (schemaA !== schemaB) return false if (schemaA && schemaB) return equal(a.toJSON(), b.toJSON(), filter) const regexpA = instOf(a, 'RegExp') const regexpB = instOf(b, 'RegExp') if (regexpA !== regexpB) { return false } if (regexpA && regexpB) { return a.toString() === b.toString() } const urlA = instOf(a, 'URL') const urlB = instOf(b, 'URL') if (urlA && urlB) { return a.href === b.href } const keys = keyList(a) length = keys.length if (length !== keyList(b).length) { return false } for (i = length; i-- !== 0; ) { if (!hasProp.call(b, keys[i])) { return false } } // end fast-deep-equal // Custom handling for React for (i = length; i-- !== 0; ) { key = keys[i] if (key === '_owner' && a.$$typeof) { // React-specific: avoid traversing React elements' _owner. // _owner contains circular references // and is not needed when comparing the actual elements (and not their owners) // .$$typeof and ._store on just reasonable markers of a react element continue } else { if (isFn(filter)) { if (filter({ a: a[key], b: b[key] }, key)) { if (!equal(a[key], b[key], filter)) { return false } } } else { // all other properties should be traversed as usual if (!equal(a[key], b[key], filter)) { return false } } } } // fast-deep-equal index.js 2.0.1 return true } return a !== a && b !== b } // end fast-deep-equal export const isEqual = function exportedEqual(a: any, b: any, filter?: Filter) { try { return equal(a, b, filter) } catch (error) { if ( (error.message && error.message.match(/stack|recursion/i)) || error.number === -2146828260 ) { // warn on circular references, don't crash // browsers give this different errors name and messages: // chrome/safari: "RangeError", "Maximum call stack size exceeded" // firefox: "InternalError", too much recursion" // edge: "Error", "Out of stack space" console.warn( 'Warning: react-fast-compare does not handle circular references.', error.name, error.message ) return false } // some other error. we should definitely know about these throw error } }
{ "content_hash": "8d14b378fd6ca9b45f7e9ef58c5754a2", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 86, "avg_line_length": 27.01923076923077, "alnum_prop": 0.5537366548042705, "repo_name": "leomYili/my-learning-notes", "id": "3f5adbd1c26763fe62d3844b877b1b5c13fc5960", "size": "4215", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "react项目积累/formily/packages/shared/src/compare.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "24120" }, { "name": "EJS", "bytes": "342" }, { "name": "HTML", "bytes": "127187" }, { "name": "JavaScript", "bytes": "3833380" }, { "name": "SCSS", "bytes": "1408" }, { "name": "TypeScript", "bytes": "1260141" }, { "name": "Vue", "bytes": "21164" } ], "symlink_target": "" }
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <name>CELAR DB</name> <artifactId>celar-db</artifactId> <packaging>jar</packaging> <groupId>gr.ntua.cslab</groupId> <parent> <groupId>gr.ntua.cslab</groupId> <artifactId>celar-server</artifactId> <version>0.0.1-SNAPSHOT</version> </parent> <properties> <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.3.2</version> </dependency> <dependency> <groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId> <version>9.3-1101-jdbc41</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.11</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.14</version> </dependency> <dependency> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>2.6</version> </dependency> <dependency> <groupId>org.codehaus.mojo</groupId> <artifactId>properties-maven-plugin</artifactId> <version>1.0-alpha-2</version> <scope>runtime</scope> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>tosca-parser</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>celar-beans</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> <dependency> <groupId>org.json</groupId> <artifactId>json</artifactId> <version>20140107</version> </dependency> <dependency> <groupId>javax</groupId> <artifactId>javaee-web-api</artifactId> <version>6.0</version> <scope>provided</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.7</source> <target>1.7</target> <compilerArguments> <endorseddirs>${endorsed.dir}</endorseddirs> </compilerArguments> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.1.1</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.1</version> <executions> <execution> <phase>validate</phase> <goals> <goal>copy</goal> </goals> <configuration> <outputDirectory>${endorsed.dir}</outputDirectory> <silent>true</silent> <artifactItems> <artifactItem> <groupId>javax</groupId> <artifactId>javaee-endorsed-api</artifactId> <version>6.0</version> <type>jar</type> </artifactItem> </artifactItems> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>2.6</version> <executions> <execution> <goals> <goal>copy-resources</goal> </goals> <id>copy-resources</id> </execution> </executions> <configuration> <outputDirectory>${project.build.directory}/conf/</outputDirectory> </configuration> </plugin> </plugins> </build> </project>
{ "content_hash": "9fddd3b9627a0212e0fe85d80a2f8671", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 108, "avg_line_length": 37.09722222222222, "alnum_prop": 0.4876450767502808, "repo_name": "CELAR/celar-server", "id": "2832a8de0d1195522ed30a6c5fab64551132570d", "size": "5342", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "celar-db/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "311148" }, { "name": "Python", "bytes": "26529" }, { "name": "Shell", "bytes": "56828" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "cb734091c19094f7c1be21e6675f1d95", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "9a9e4cb573330216bc4ae5fab330db37941f12e4", "size": "178", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Scrophulariaceae/Lyperia/Lyperia amplexicaulis/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package multiverse.msgsys; class MessageTypes { public static MessageType MSG_TYPE_AGENT_HELLO = MessageType.intern("msgsys.AGENT_HELLO"); public static MessageType MSG_TYPE_HELLO_RESPONSE = MessageType.intern("msgsys.HELLO_RESPONSE"); public static MessageType MSG_TYPE_ALLOC_NAME = MessageType.intern("msgsys.ALLOC_NAME"); public static MessageType MSG_TYPE_ALLOC_NAME_RESPONSE = MessageType.intern("msgsys.ALLOC_NAME_RESPONSE"); public static MessageType MSG_TYPE_NEW_AGENT = MessageType.intern("msgsys.NEW_AGENT"); public static MessageType MSG_TYPE_AGENT_STATE = MessageType.intern("msgsys.AGENT_STATE"); public static MessageType MSG_TYPE_ADVERTISE = MessageType.intern("msgsys.ADVERTISE"); public static MessageType MSG_TYPE_SUBSCRIBE = MessageType.intern("msgsys.SUBSCRIBE"); public static MessageType MSG_TYPE_UNSUBSCRIBE = MessageType.intern("msgsys.UNSUBSCRIBE"); public static MessageType MSG_TYPE_FILTER_UPDATE = MessageType.intern("msgsys.FILTER_UPDATE"); public static MessageType MSG_TYPE_AWAIT_PLUGIN_DEPENDENTS = MessageType.intern("msgsys.AWAIT_PLUGIN_DEPENDENTS"); public static MessageType MSG_TYPE_PLUGIN_AVAILABLE = MessageType.intern("msgsys.PLUGIN_AVAILABLE"); public static MessageType MSG_TYPE_RESPONSE = MessageType.intern("msgsys.RESPONSE"); public static MessageType MSG_TYPE_BOOLEAN_RESPONSE = MessageType.intern("msgsys.BOOLEAN_RESPONSE"); public static MessageType MSG_TYPE_LONG_RESPONSE = MessageType.intern("msgsys.LONG_RESPONSE"); public static MessageType MSG_TYPE_INT_RESPONSE = MessageType.intern("msgsys.INT_RESPONSE"); public static MessageType MSG_TYPE_STRING_RESPONSE = MessageType.intern("msgsys.STRING_RESPONSE"); // Use in MessageTypeFilter to match all message types. // Not a valid message type. public static MessageType MSG_TYPE_ALL_TYPES = MessageType.intern("msgsys.all"); public static MessageCatalog catalog; public static void initializeCatalog() { if (catalog != null) return; catalog = MessageCatalog.addMsgCatalog("msgsysCatalog",5000,100); catalog.addMsgTypeTranslation(MSG_TYPE_AGENT_HELLO); catalog.addMsgTypeTranslation(MSG_TYPE_HELLO_RESPONSE); catalog.addMsgTypeTranslation(MSG_TYPE_ALLOC_NAME); catalog.addMsgTypeTranslation(MSG_TYPE_NEW_AGENT); catalog.addMsgTypeTranslation(MSG_TYPE_AGENT_STATE); catalog.addMsgTypeTranslation(MSG_TYPE_ADVERTISE); catalog.addMsgTypeTranslation(MSG_TYPE_SUBSCRIBE); catalog.addMsgTypeTranslation(MSG_TYPE_UNSUBSCRIBE); catalog.addMsgTypeTranslation(MSG_TYPE_FILTER_UPDATE); catalog.addMsgTypeTranslation(MSG_TYPE_AWAIT_PLUGIN_DEPENDENTS); catalog.addMsgTypeTranslation(MSG_TYPE_PLUGIN_AVAILABLE); firstMsgType = MSG_TYPE_AGENT_HELLO; lastMsgType = MSG_TYPE_FILTER_UPDATE; catalog.addMsgTypeTranslation(MSG_TYPE_RESPONSE); catalog.addMsgTypeTranslation(MSG_TYPE_BOOLEAN_RESPONSE); catalog.addMsgTypeTranslation(MSG_TYPE_LONG_RESPONSE); catalog.addMsgTypeTranslation(MSG_TYPE_INT_RESPONSE); catalog.addMsgTypeTranslation(MSG_TYPE_STRING_RESPONSE); catalog.addMsgTypeTranslation(MSG_TYPE_ALLOC_NAME_RESPONSE); } public static boolean isInternal(MessageType type) { Integer num = type.getMsgTypeNumber(); return (num >= firstMsgType.getMsgTypeNumber() && num <= lastMsgType.getMsgTypeNumber()); } private static MessageType firstMsgType; private static MessageType lastMsgType; }
{ "content_hash": "c5b4c5db67b8c4f6cd52cdca65b022c5", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 118, "avg_line_length": 51.65714285714286, "alnum_prop": 0.7428097345132744, "repo_name": "longde123/MultiversePlatform", "id": "a452db506f83dae3edde0d3c48056e7715037fcf", "size": "4907", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "server/src/multiverse/msgsys/MessageTypes.java", "mode": "33188", "license": "mit", "language": [ { "name": "Awk", "bytes": "1148" }, { "name": "Batchfile", "bytes": "56002" }, { "name": "C", "bytes": "2958956" }, { "name": "C#", "bytes": "11292123" }, { "name": "C++", "bytes": "428039" }, { "name": "CSS", "bytes": "107446" }, { "name": "Groff", "bytes": "3653" }, { "name": "HTML", "bytes": "767415" }, { "name": "Inno Setup", "bytes": "2093" }, { "name": "Java", "bytes": "4444010" }, { "name": "JavaScript", "bytes": "115349" }, { "name": "Makefile", "bytes": "35639" }, { "name": "Matlab", "bytes": "2076" }, { "name": "Objective-C", "bytes": "44581" }, { "name": "Perl", "bytes": "6299" }, { "name": "Python", "bytes": "4648545" }, { "name": "Scheme", "bytes": "48864" }, { "name": "Shell", "bytes": "880494" }, { "name": "XSLT", "bytes": "1834" } ], "symlink_target": "" }
package com.spotify.netty4.handler.codec.zmtp; import com.spotify.netty4.handler.codec.zmtp.VerifyingDecoder.ExpectedOutput; import org.junit.experimental.theories.DataPoints; import org.junit.experimental.theories.FromDataPoints; import org.junit.experimental.theories.Theories; import org.junit.experimental.theories.Theory; import org.junit.runner.RunWith; import java.util.List; import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufAllocator; import io.netty.buffer.UnpooledByteBufAllocator; import io.netty.channel.ChannelHandlerContext; import static com.spotify.netty4.handler.codec.zmtp.ZMTPWireFormats.wireFormat; import static java.util.Arrays.asList; import static org.mockito.Mockito.mock; /** * This test attempts to thoroughly exercise the {@link ZMTPFramingDecoder} by feeding it input * fragmented in every possible way using {@link Fragmenter}. Everything from whole un-fragmented * message parsing to each byte being fragmented in a separate buffer is tested. Generating all * possible message fragmentations takes some time, so running this test can typically take a few * minutes. */ @RunWith(Theories.class) public class ZMTPParserTest { private final static ByteBufAllocator ALLOC = new UnpooledByteBufAllocator(false); private final ChannelHandlerContext ctx = mock(ChannelHandlerContext.class); @DataPoints("frames") public static String[][] FRAMES = { {"1"}, {"2", ""}, {"3", "aa"}, {"4", "", "a"}, {"5", "", "a", "bb"}, {"6", "aa", "", "b", "cc"}, {"7", "", "a"}, {"8", "", "b", "cc"}, {"9", "aa", "", "b", "cc"}, }; @DataPoints("versions") public static final List<ZMTPVersion> VERSIONS = ZMTPVersion.supportedVersions(); @Theory public void testParse(@FromDataPoints("frames") final String[] frames, @FromDataPoints("versions") final ZMTPVersion version) throws Exception { final List<String> input = asList(frames); final ZMTPWireFormat wireFormat = wireFormat(version); final ZMTPMessage inputMessage = ZMTPMessage.fromUTF8(ALLOC, input); final ExpectedOutput expected = new ExpectedOutput(inputMessage); final ByteBuf serialized = inputMessage.write(ALLOC, version); final int serializedLength = serialized.readableBytes(); // Test parsing the whole message { final VerifyingDecoder verifier = new VerifyingDecoder(expected); final ZMTPFramingDecoder decoder = new ZMTPFramingDecoder(wireFormat, verifier); decoder.decode(ctx, serialized, null); verifier.assertFinished(); serialized.setIndex(0, serializedLength); } // Prepare for trivial message parsing test final ZMTPMessage trivial = ZMTPMessage.fromUTF8(ALLOC, "e", "", "a", "b", "c"); final ByteBuf trivialSerialized = trivial.write(ALLOC, version); final int trivialLength = trivialSerialized.readableBytes(); final ExpectedOutput trivialExpected = new ExpectedOutput(trivial); // Test parsing fragmented input final VerifyingDecoder verifier = new VerifyingDecoder(); final ZMTPFramingDecoder decoder = new ZMTPFramingDecoder(wireFormat, verifier); new Fragmenter(serialized.readableBytes()).fragment(new Fragmenter.Consumer() { @Override public void fragments(final int[] limits, final int count) throws Exception { verifier.expect(expected); serialized.setIndex(0, serializedLength); for (int i = 0; i < count; i++) { final int limit = limits[i]; serialized.writerIndex(limit); decoder.decode(ctx, serialized, null); } verifier.assertFinished(); // Verify that the parser can be reused to parse the same message serialized.setIndex(0, serializedLength); decoder.decode(ctx, serialized, null); verifier.assertFinished(); // Verify that the parser can be reused to parse a well-behaved message verifier.expect(trivialExpected); trivialSerialized.setIndex(0, trivialLength); decoder.decode(ctx, trivialSerialized, null); verifier.assertFinished(); } }); } }
{ "content_hash": "a80ed53c09276b45425c3febc2c69912", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 97, "avg_line_length": 37.7, "alnum_prop": 0.7053291536050157, "repo_name": "spotify/netty-zmtp", "id": "cf98a34af1332c387db6702f0ba88ca83338e9c9", "size": "4745", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/test/java/com/spotify/netty4/handler/codec/zmtp/ZMTPParserTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "226291" } ], "symlink_target": "" }
package chatty; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import static org.junit.Assert.*; /** * * @author tduva */ public class IrcTest { Irc irc; public IrcTest() { } @BeforeClass public static void setUpClass() { } @AfterClass public static void tearDownClass() { } @Before public void setUp() { irc = new Irc() { @Override public void debug(String line) { System.err.println(line); } @Override void onChannelMessage (String channel, String nick, String from, String text) { System.out.println("Channel Message: "+channel+" "+nick+" "+from+" "+text); } @Override void onChannelAction (String channel, String nick, String from, String text) { System.out.println("Action Message: "+channel+" "+nick+" "+from+" "+text); } }; } @After public void tearDown() { } // TODO add test methods here. // The methods must be annotated with annotation @Test. For example: // // @Test // public void hello() {} /** * This doesn't test if the messages are parsed correctly, but at least if * an unhandled exception occurs, which would stop the connection thread * completely. */ @Test public void received() { // MODE try { irc.received(":jtv MODE #lotsofs +o da00"); irc.received(":jtv MODE #lotsofs +o"); irc.received("jtv MODE #lotsofs +o da00"); irc.received("MODE #lotsofs +o da00"); irc.received(": MODE #lotsofs +o da00"); } catch (Exception ex) { fail("Exception: "+ex.toString()); } // PRIVMSG try { irc.received(":jtv!jtv@jtv.tmi.twitch.tv PRIVMSG #lotsofs :EMOTESET tduva [130,793,33]"); irc.received(":jtv!jtv@jtv.tmi.twitch.tv PRIVMSG #lotsofs :"); irc.received(":jtv!jtv@jtv.tmi.twitch.tv PRIVMSG #lotsofs"); irc.received(":jtv!jtvjtv.tmi.twitch.tv PRIVMSG #lotsofs :"); irc.received(":jtv!jtvjtv.tmi.twitch.tv PRIVMSG #lotsofs :test"); irc.received(":jtv!jtv@jtv.tmi.twitch.tv #lotsofs :test"); irc.received(":jtv!jtv@jtv.tmi.twitch.tv PRIVMSG #lotsofs :"+(char)1+"ACTION action"); irc.received(":jtv!jtv@jtv.tmi.twitch.tv PRIVMSG #lotsofs :"+(char)1+"ACTION"); } catch (Exception ex) { fail("Exception: "+ex.toString()); } // Short stuff try { irc.received(":"); irc.received(""); irc.received(" "); } catch (Exception ex) { fail("Exception: "+ex.toString()); } // JOIN/PART try { irc.received(":tduva!tduva@tduva.tmi.twitch.tv JOIN #lotsofs"); irc.received("tduva!tduva@tduva.tmi.twitch.tv JOIN #lotsofs"); irc.received(":tduva!tduva@tduva.tmi.twitch.tv JOIN"); irc.received(":tduvatduva@tduva.tmi.twitch.tv JOIN"); } catch (Exception ex) { fail("Exception: "+ex.toString()); } // PING try { irc.received("PING :tmi.twitch.tv"); irc.received("PING :"); irc.received("PING"); } catch (Exception ex) { fail("Exception: "+ex.toString()); } // NAMES try { irc.received(":tduva.tmi.twitch.tv 353 tduva = #lotsofs :krazyrasmus deenglow r4m80 adoms"); irc.received(":tduva.tmi.twitch.tv 353 tduva #lotsofs :krazyrasmus deenglow r4m80 adoms"); irc.received(":tduva.tmi.twitch.tv 353 tduva = #lotsofs : "); irc.received(":tduva.tmi.twitch.tv 353 tduva = #lotsofs"); irc.received(":tduva.tmi.twitch.tv 353 tduva #lotsofs :"); irc.received(":tduva.tmi.twitch.tv 353 tduva #lotsofs"); irc.received(":tduva.tmi.twitch.tv 366 tduva #lotsofs :End of /NAMES list"); irc.received(":tduva.tmi.twitch.tv 366 tduva :End of /NAMES list"); irc.received(":tduva.tmi.twitch.tv 366 tduva #lotsofs :"); irc.received(":tduva.tmi.twitch.tv 366 tduva #lotsofs"); } catch (Exception ex) { fail("Exception: "+ex.toString()); } // TAGS try { irc.received("@abc :tduva.tmi.twitch.tv 353 tduva = #lotsofs :krazyrasmus deenglow r4m80 adoms"); irc.received("@ :jtv!jtv@jtv.tmi.twitch.tv PRIVMSG #lotsofs :test"); irc.received("@:jtv!jtv@jtv.tmi.twitch.tv PRIVMSG #lotsofs :test"); irc.received("@tags:jtv!jtv@jtv.tmi.twitch.tv PRIVMSG #lotsofs :test"); irc.received("@tag=value;tag2=value2 :jtv!jtv@jtv.tmi.twitch.tv PRIVMSG #lotsofs :test"); irc.received("@tag=value;tag2=value2:jtv!jtv@jtv.tmi.twitch.tv PRIVMSG #lotsofs :test"); irc.received(" @tag=value;tag2=value2 :jtv!jtv@jtv.tmi.twitch.tv PRIVMSG #lotsofs :test"); } catch (Exception ex) { fail("Exception: "+ex.toString()); } } }
{ "content_hash": "1cbc3b1ba6844d2e72788bb09dff56f7", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 109, "avg_line_length": 36.77777777777778, "alnum_prop": 0.5538141993957704, "repo_name": "partouf/Chatty-Twitch-Client", "id": "3c18e529b396eee3fb8c00e40e1a8ebb076362f7", "size": "5296", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/chatty/IrcTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "2007" }, { "name": "HTML", "bytes": "238530" }, { "name": "Java", "bytes": "1740666" } ], "symlink_target": "" }
MEDIUM=$(/usr/sbin/system_profiler SPSerialATADataType | /usr/bin/awk '/Medium\ Type/ { print $3,$4 }') /bin/echo "<result>$MEDIUM</result>"
{ "content_hash": "5c8bded54fac21aa7e851fa04dd7ec02", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 103, "avg_line_length": 47.333333333333336, "alnum_prop": 0.6830985915492958, "repo_name": "laurendc/scripts", "id": "9b5af9d066d3eaa3da6a884bbb93b0ae071584b3", "size": "321", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "extension_attributes/ssdornot.sh", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Python", "bytes": "3615" }, { "name": "Shell", "bytes": "25415" } ], "symlink_target": "" }
// Copyright 2005, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Authors: wan@google.com (Zhanyong Wan) // // Low-level types and utilities for porting Google Test to various // platforms. They are subject to change without notice. DO NOT USE // THEM IN USER CODE. #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ // The user can define the following macros in the build script to // control Google Test's behavior. If the user doesn't define a macro // in this list, Google Test will define it. // // GTEST_HAS_CLONE - Define it to 1/0 to indicate that clone(2) // is/isn't available. // GTEST_HAS_GLOBAL_STRING - Define it to 1/0 to indicate that ::string // is/isn't available (some systems define // ::string, which is different to std::string). // GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string // is/isn't available (some systems define // ::wstring, which is different to std::wstring). // GTEST_HAS_PTHREAD - Define it to 1/0 to indicate that <pthread.h> // is/isn't available. // GTEST_HAS_RTTI - Define it to 1/0 to indicate that RTTI is/isn't // enabled. // GTEST_HAS_STD_STRING - Define it to 1/0 to indicate that // std::string does/doesn't work (Google Test can // be used where std::string is unavailable). // GTEST_HAS_STD_WSTRING - Define it to 1/0 to indicate that // std::wstring does/doesn't work (Google Test can // be used where std::wstring is unavailable). // GTEST_HAS_TR1_TUPLE 1 - Define it to 1/0 to indicate tr1::tuple // is/isn't available. // This header defines the following utilities: // // Macros indicating the current platform (defined to 1 if compiled on // the given platform; otherwise undefined): // GTEST_OS_CYGWIN - Cygwin // GTEST_OS_LINUX - Linux // GTEST_OS_MAC - Mac OS X // GTEST_OS_SOLARIS - Sun Solaris // GTEST_OS_SYMBIAN - Symbian // GTEST_OS_WINDOWS - Windows // GTEST_OS_ZOS - z/OS // // Among the platforms, Cygwin, Linux, Max OS X, and Windows have the // most stable support. Since core members of the Google Test project // don't have access to other platforms, support for them may be less // stable. If you notice any problems on your platform, please notify // googletestframework@googlegroups.com (patches for fixing them are // even more welcome!). // // Note that it is possible that none of the GTEST_OS_* macros are defined. // // Macros indicating available Google Test features (defined to 1 if // the corresponding feature is supported; otherwise undefined): // GTEST_HAS_COMBINE - the Combine() function (for value-parameterized // tests) // GTEST_HAS_DEATH_TEST - death tests // GTEST_HAS_PARAM_TEST - value-parameterized tests // GTEST_HAS_TYPED_TEST - typed tests // GTEST_HAS_TYPED_TEST_P - type-parameterized tests // GTEST_USES_POSIX_RE - enhanced POSIX regex is used. // GTEST_USES_SIMPLE_RE - our own simple regex is used; // the above two are mutually exclusive. // // Macros for basic C++ coding: // GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning. // GTEST_ATTRIBUTE_UNUSED_ - declares that a class' instances or a // variable don't have to be used. // GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=. // GTEST_MUST_USE_RESULT_ - declares that a function's result must be used. // // Synchronization: // Mutex, MutexLock, ThreadLocal, GetThreadCount() // - synchronization primitives. // GTEST_IS_THREADSAFE - defined to 1 to indicate that the above // synchronization primitives have real implementations // and Google Test is thread-safe; or 0 otherwise. // // Template meta programming: // is_pointer - as in TR1; needed on Symbian and IBM XL C/C++ only. // // Smart pointers: // scoped_ptr - as in TR2. // // Regular expressions: // RE - a simple regular expression class using the POSIX // Extended Regular Expression syntax. Not available on // Windows. // // Logging: // GTEST_LOG_() - logs messages at the specified severity level. // LogToStderr() - directs all log messages to stderr. // FlushInfoLog() - flushes informational log messages. // // Stderr capturing: // CaptureStderr() - starts capturing stderr. // GetCapturedStderr() - stops capturing stderr and returns the captured // string. // // Integer types: // TypeWithSize - maps an integer to a int type. // Int32, UInt32, Int64, UInt64, TimeInMillis // - integers of known sizes. // BiggestInt - the biggest signed integer type. // // Command-line utilities: // GTEST_FLAG() - references a flag. // GTEST_DECLARE_*() - declares a flag. // GTEST_DEFINE_*() - defines a flag. // GetArgvs() - returns the command line as a vector of strings. // // Environment variable utilities: // GetEnv() - gets the value of an environment variable. // BoolFromGTestEnv() - parses a bool environment variable. // Int32FromGTestEnv() - parses an Int32 environment variable. // StringFromGTestEnv() - parses a string environment variable. #include <stdlib.h> #include <stdio.h> #include <string.h> #include <sys/stat.h> #include <iostream> // NOLINT #define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com" #define GTEST_FLAG_PREFIX_ "gtest_" #define GTEST_FLAG_PREFIX_UPPER_ "GTEST_" #define GTEST_NAME_ "Google Test" #define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/" // Determines the version of gcc that is used to compile this. #ifdef __GNUC__ // 40302 means version 4.3.2. #define GTEST_GCC_VER_ \ (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__) #endif // __GNUC__ // Determines the platform on which Google Test is compiled. #ifdef __CYGWIN__ #define GTEST_OS_CYGWIN 1 #elif __SYMBIAN32__ #define GTEST_OS_SYMBIAN 1 #elif defined _WIN32 #define GTEST_OS_WINDOWS 1 #elif defined __APPLE__ #define GTEST_OS_MAC 1 #elif defined __linux__ #define GTEST_OS_LINUX 1 #elif defined __MVS__ #define GTEST_OS_ZOS 1 #elif defined(__sun) && defined(__SVR4) #define GTEST_OS_SOLARIS 1 #endif // __CYGWIN__ #if GTEST_OS_CYGWIN || GTEST_OS_LINUX || GTEST_OS_MAC // On some platforms, <regex.h> needs someone to define size_t, and // won't compile otherwise. We can #include it here as we already // included <stdlib.h>, which is guaranteed to define size_t through // <stddef.h>. #include <regex.h> // NOLINT #include <strings.h> // NOLINT #include <sys/types.h> // NOLINT #include <unistd.h> // NOLINT #define GTEST_USES_POSIX_RE 1 #elif GTEST_OS_WINDOWS #include <direct.h> // NOLINT #include <io.h> // NOLINT // <regex.h> is not available on Windows. Use our own simple regex // implementation instead. #define GTEST_USES_SIMPLE_RE 1 #else // <regex.h> may not be available on this platform. Use our own // simple regex implementation instead. #define GTEST_USES_SIMPLE_RE 1 #endif // GTEST_OS_CYGWIN || GTEST_OS_LINUX || GTEST_OS_MAC // Defines GTEST_HAS_EXCEPTIONS to 1 if exceptions are enabled, or 0 // otherwise. #ifdef _MSC_VER // Compiled by MSVC? // Assumes that exceptions are enabled by default. #ifndef _HAS_EXCEPTIONS // MSVC uses this macro to enable exceptions. #define _HAS_EXCEPTIONS 1 #endif // _HAS_EXCEPTIONS #define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS #else // The compiler is not MSVC. // gcc defines __EXCEPTIONS to 1 iff exceptions are enabled. For // other compilers, we assume exceptions are disabled to be // conservative. #if defined(__GNUC__) && __EXCEPTIONS #define GTEST_HAS_EXCEPTIONS 1 #else #define GTEST_HAS_EXCEPTIONS 0 #endif // defined(__GNUC__) && __EXCEPTIONS #endif // _MSC_VER // Determines whether ::std::string and ::string are available. #ifndef GTEST_HAS_STD_STRING // The user didn't tell us whether ::std::string is available, so we // need to figure it out. The only environment that we know // ::std::string is not available is MSVC 7.1 or lower with exceptions // disabled. #if defined(_MSC_VER) && (_MSC_VER < 1400) && !GTEST_HAS_EXCEPTIONS #define GTEST_HAS_STD_STRING 0 #else #define GTEST_HAS_STD_STRING 1 #endif #endif // GTEST_HAS_STD_STRING #ifndef GTEST_HAS_GLOBAL_STRING // The user didn't tell us whether ::string is available, so we need // to figure it out. #define GTEST_HAS_GLOBAL_STRING 0 #endif // GTEST_HAS_GLOBAL_STRING #ifndef GTEST_HAS_STD_WSTRING // The user didn't tell us whether ::std::wstring is available, so we need // to figure it out. // TODO(wan@google.com): uses autoconf to detect whether ::std::wstring // is available. #if GTEST_OS_CYGWIN || GTEST_OS_SOLARIS // Cygwin 1.5 and below doesn't support ::std::wstring. // Cygwin 1.7 might add wstring support; this should be updated when clear. // Solaris' libc++ doesn't support it either. #define GTEST_HAS_STD_WSTRING 0 #else #define GTEST_HAS_STD_WSTRING GTEST_HAS_STD_STRING #endif // GTEST_OS_CYGWIN || GTEST_OS_SOLARIS #endif // GTEST_HAS_STD_WSTRING #ifndef GTEST_HAS_GLOBAL_WSTRING // The user didn't tell us whether ::wstring is available, so we need // to figure it out. #define GTEST_HAS_GLOBAL_WSTRING \ (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING) #endif // GTEST_HAS_GLOBAL_WSTRING #if GTEST_HAS_STD_STRING || GTEST_HAS_GLOBAL_STRING || \ GTEST_HAS_STD_WSTRING || GTEST_HAS_GLOBAL_WSTRING #include <string> // NOLINT #endif // GTEST_HAS_STD_STRING || GTEST_HAS_GLOBAL_STRING || // GTEST_HAS_STD_WSTRING || GTEST_HAS_GLOBAL_WSTRING #if GTEST_HAS_STD_STRING #include <sstream> // NOLINT #else #include <strstream> // NOLINT #endif // GTEST_HAS_STD_STRING // Determines whether RTTI is available. #ifndef GTEST_HAS_RTTI // The user didn't tell us whether RTTI is enabled, so we need to // figure it out. #ifdef _MSC_VER #ifdef _CPPRTTI // MSVC defines this macro iff RTTI is enabled. #define GTEST_HAS_RTTI 1 #else #define GTEST_HAS_RTTI 0 #endif // _CPPRTTI #elif defined(__GNUC__) // Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled. #if GTEST_GCC_VER_ >= 40302 #ifdef __GXX_RTTI #define GTEST_HAS_RTTI 1 #else #define GTEST_HAS_RTTI 0 #endif // __GXX_RTTI #else // For gcc versions smaller than 4.3.2, we assume RTTI is enabled. #define GTEST_HAS_RTTI 1 #endif // GTEST_GCC_VER >= 40302 #else // Unknown compiler - assume RTTI is enabled. #define GTEST_HAS_RTTI 1 #endif // _MSC_VER #endif // GTEST_HAS_RTTI // Determines whether <pthread.h> is available. #ifndef GTEST_HAS_PTHREAD // The user didn't tell us, so we need to figure it out. #define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC) #endif // GTEST_HAS_PTHREAD // Determines whether tr1/tuple is available. If you have tr1/tuple // on your platform, define GTEST_HAS_TR1_TUPLE=1 for both the Google // Test project and your tests. If you would like Google Test to detect // tr1/tuple on your platform automatically, please open an issue // ticket at http://code.google.com/p/googletest. #ifndef GTEST_HAS_TR1_TUPLE // The user didn't tell us, so we need to figure it out. // GCC provides <tr1/tuple> since 4.0.0. #if defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000) #define GTEST_HAS_TR1_TUPLE 1 #else #define GTEST_HAS_TR1_TUPLE 0 #endif // __GNUC__ #endif // GTEST_HAS_TR1_TUPLE // To avoid conditional compilation everywhere, we make it // gtest-port.h's responsibility to #include the header implementing // tr1/tuple. #if GTEST_HAS_TR1_TUPLE #if defined(__GNUC__) // GCC implements tr1/tuple in the <tr1/tuple> header. This does not // conform to the TR1 spec, which requires the header to be <tuple>. #include <tr1/tuple> #else // If the compiler is not GCC, we assume the user is using a // spec-conforming TR1 implementation. #include <tuple> #endif // __GNUC__ #endif // GTEST_HAS_TR1_TUPLE // Determines whether clone(2) is supported. // Usually it will only be available on Linux, excluding // Linux on the Itanium architecture. // Also see http://linux.die.net/man/2/clone. #ifndef GTEST_HAS_CLONE // The user didn't tell us, so we need to figure it out. #if GTEST_OS_LINUX && !defined(__ia64__) #define GTEST_HAS_CLONE 1 #else #define GTEST_HAS_CLONE 0 #endif // GTEST_OS_LINUX && !defined(__ia64__) #endif // GTEST_HAS_CLONE // Determines whether to support death tests. // Google Test does not support death tests for VC 7.1 and earlier for // these reasons: // 1. std::vector does not build in VC 7.1 when exceptions are disabled. // 2. std::string does not build in VC 7.1 when exceptions are disabled // (this is covered by GTEST_HAS_STD_STRING guard). // 3. abort() in a VC 7.1 application compiled as GUI in debug config // pops up a dialog window that cannot be suppressed programmatically. #if GTEST_HAS_STD_STRING && (GTEST_OS_LINUX || \ GTEST_OS_MAC || \ GTEST_OS_CYGWIN || \ (GTEST_OS_WINDOWS && _MSC_VER >= 1400)) #define GTEST_HAS_DEATH_TEST 1 #include <vector> // NOLINT #endif // Determines whether to support value-parameterized tests. #if defined(__GNUC__) || (_MSC_VER >= 1400) // TODO(vladl@google.com): get the implementation rid of vector and list // to compile on MSVC 7.1. #define GTEST_HAS_PARAM_TEST 1 #endif // defined(__GNUC__) || (_MSC_VER >= 1400) // Determines whether to support type-driven tests. // Typed tests need <typeinfo> and variadic macros, which gcc and VC // 8.0+ support. #if defined(__GNUC__) || (_MSC_VER >= 1400) #define GTEST_HAS_TYPED_TEST 1 #define GTEST_HAS_TYPED_TEST_P 1 #endif // defined(__GNUC__) || (_MSC_VER >= 1400) // Determines whether to support Combine(). This only makes sense when // value-parameterized tests are enabled. #if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE #define GTEST_HAS_COMBINE 1 #endif // GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE // Determines whether the system compiler uses UTF-16 for encoding wide strings. #define GTEST_WIDE_STRING_USES_UTF16_ \ (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN) // Defines some utility macros. // The GNU compiler emits a warning if nested "if" statements are followed by // an "else" statement and braces are not used to explicitly disambiguate the // "else" binding. This leads to problems with code like: // // if (gate) // ASSERT_*(condition) << "Some message"; // // The "switch (0) case 0:" idiom is used to suppress this. #ifdef __INTEL_COMPILER #define GTEST_AMBIGUOUS_ELSE_BLOCKER_ #else #define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: // NOLINT #endif // Use this annotation at the end of a struct/class definition to // prevent the compiler from optimizing away instances that are never // used. This is useful when all interesting logic happens inside the // c'tor and / or d'tor. Example: // // struct Foo { // Foo() { ... } // } GTEST_ATTRIBUTE_UNUSED_; // // Also use it after a variable or parameter declaration to tell the // compiler the variable/parameter does not have to be used. #if defined(__GNUC__) && !defined(COMPILER_ICC) #define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused)) #else #define GTEST_ATTRIBUTE_UNUSED_ #endif // A macro to disallow the evil copy constructor and operator= functions // This should be used in the private: declarations for a class. #define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\ type(const type &);\ void operator=(const type &) // Tell the compiler to warn about unused return values for functions declared // with this macro. The macro should be used on function declarations // following the argument list: // // Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_; #if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC) #define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result)) #else #define GTEST_MUST_USE_RESULT_ #endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC namespace testing { class Message; namespace internal { class String; // std::strstream is deprecated. However, we have to use it on // Windows as std::stringstream won't compile on Windows when // exceptions are disabled. We use std::stringstream on other // platforms to avoid compiler warnings there. #if GTEST_HAS_STD_STRING typedef ::std::stringstream StrStream; #else typedef ::std::strstream StrStream; #endif // GTEST_HAS_STD_STRING // Defines scoped_ptr. // This implementation of scoped_ptr is PARTIAL - it only contains // enough stuff to satisfy Google Test's need. template <typename T> class scoped_ptr { public: explicit scoped_ptr(T* p = NULL) : ptr_(p) {} ~scoped_ptr() { reset(); } T& operator*() const { return *ptr_; } T* operator->() const { return ptr_; } T* get() const { return ptr_; } T* release() { T* const ptr = ptr_; ptr_ = NULL; return ptr; } void reset(T* p = NULL) { if (p != ptr_) { if (sizeof(T) > 0) { // Makes sure T is a complete type. delete ptr_; } ptr_ = p; } } private: T* ptr_; GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr); }; // Defines RE. // A simple C++ wrapper for <regex.h>. It uses the POSIX Enxtended // Regular Expression syntax. class RE { public: // Constructs an RE from a string. #if GTEST_HAS_STD_STRING RE(const ::std::string& regex) { Init(regex.c_str()); } // NOLINT #endif // GTEST_HAS_STD_STRING #if GTEST_HAS_GLOBAL_STRING RE(const ::string& regex) { Init(regex.c_str()); } // NOLINT #endif // GTEST_HAS_GLOBAL_STRING RE(const char* regex) { Init(regex); } // NOLINT ~RE(); // Returns the string representation of the regex. const char* pattern() const { return pattern_; } // FullMatch(str, re) returns true iff regular expression re matches // the entire str. // PartialMatch(str, re) returns true iff regular expression re // matches a substring of str (including str itself). // // TODO(wan@google.com): make FullMatch() and PartialMatch() work // when str contains NUL characters. #if GTEST_HAS_STD_STRING static bool FullMatch(const ::std::string& str, const RE& re) { return FullMatch(str.c_str(), re); } static bool PartialMatch(const ::std::string& str, const RE& re) { return PartialMatch(str.c_str(), re); } #endif // GTEST_HAS_STD_STRING #if GTEST_HAS_GLOBAL_STRING static bool FullMatch(const ::string& str, const RE& re) { return FullMatch(str.c_str(), re); } static bool PartialMatch(const ::string& str, const RE& re) { return PartialMatch(str.c_str(), re); } #endif // GTEST_HAS_GLOBAL_STRING static bool FullMatch(const char* str, const RE& re); static bool PartialMatch(const char* str, const RE& re); private: void Init(const char* regex); // We use a const char* instead of a string, as Google Test may be used // where string is not available. We also do not use Google Test's own // String type here, in order to simplify dependencies between the // files. const char* pattern_; bool is_valid_; #if GTEST_USES_POSIX_RE regex_t full_regex_; // For FullMatch(). regex_t partial_regex_; // For PartialMatch(). #else // GTEST_USES_SIMPLE_RE const char* full_pattern_; // For FullMatch(); #endif GTEST_DISALLOW_COPY_AND_ASSIGN_(RE); }; // Defines logging utilities: // GTEST_LOG_() - logs messages at the specified severity level. // LogToStderr() - directs all log messages to stderr. // FlushInfoLog() - flushes informational log messages. enum GTestLogSeverity { GTEST_INFO, GTEST_WARNING, GTEST_ERROR, GTEST_FATAL }; void GTestLog(GTestLogSeverity severity, const char* file, int line, const char* msg); #define GTEST_LOG_(severity, msg)\ ::testing::internal::GTestLog(\ ::testing::internal::GTEST_##severity, __FILE__, __LINE__, \ (::testing::Message() << (msg)).GetString().c_str()) inline void LogToStderr() {} inline void FlushInfoLog() { fflush(NULL); } // Defines the stderr capturer: // CaptureStderr - starts capturing stderr. // GetCapturedStderr - stops capturing stderr and returns the captured string. #if GTEST_HAS_STD_STRING void CaptureStderr(); ::std::string GetCapturedStderr(); #endif // GTEST_HAS_STD_STRING #if GTEST_HAS_DEATH_TEST // A copy of all command line arguments. Set by InitGoogleTest(). extern ::std::vector<String> g_argvs; // GTEST_HAS_DEATH_TEST implies we have ::std::string. const ::std::vector<String>& GetArgvs(); #endif // GTEST_HAS_DEATH_TEST // Defines synchronization primitives. // A dummy implementation of synchronization primitives (mutex, lock, // and thread-local variable). Necessary for compiling Google Test where // mutex is not supported - using Google Test in multiple threads is not // supported on such platforms. class Mutex { public: Mutex() {} explicit Mutex(int /*unused*/) {} void AssertHeld() const {} enum { NO_CONSTRUCTOR_NEEDED_FOR_STATIC_MUTEX = 0 }; }; // We cannot call it MutexLock directly as the ctor declaration would // conflict with a macro named MutexLock, which is defined on some // platforms. Hence the typedef trick below. class GTestMutexLock { public: explicit GTestMutexLock(Mutex*) {} // NOLINT }; typedef GTestMutexLock MutexLock; template <typename T> class ThreadLocal { public: ThreadLocal() : value_() {} explicit ThreadLocal(const T& value) : value_(value) {} T* pointer() { return &value_; } const T* pointer() const { return &value_; } const T& get() const { return value_; } void set(const T& value) { value_ = value; } private: T value_; }; // Returns the number of threads running in the process, or 0 to indicate that // we cannot detect it. size_t GetThreadCount(); // The above synchronization primitives have dummy implementations. // Therefore Google Test is not thread-safe. #define GTEST_IS_THREADSAFE 0 #if defined(__SYMBIAN32__) || defined(__IBMCPP__) // Passing non-POD classes through ellipsis (...) crashes the ARM // compiler. The Nokia Symbian and the IBM XL C/C++ compiler try to // instantiate a copy constructor for objects passed through ellipsis // (...), failing for uncopyable objects. We define this to indicate // the fact. #define GTEST_ELLIPSIS_NEEDS_COPY_ 1 // The Nokia Symbian and IBM XL C/C++ compilers cannot decide between // const T& and const T* in a function template. These compilers // _can_ decide between class template specializations for T and T*, // so a tr1::type_traits-like is_pointer works. #define GTEST_NEEDS_IS_POINTER_ 1 #endif // defined(__SYMBIAN32__) || defined(__IBMCPP__) template <bool bool_value> struct bool_constant { typedef bool_constant<bool_value> type; static const bool value = bool_value; }; template <bool bool_value> const bool bool_constant<bool_value>::value; typedef bool_constant<false> false_type; typedef bool_constant<true> true_type; template <typename T> struct is_pointer : public false_type {}; template <typename T> struct is_pointer<T*> : public true_type {}; #if GTEST_OS_WINDOWS #define GTEST_PATH_SEP_ "\\" // The biggest signed integer type the compiler supports. typedef __int64 BiggestInt; #else #define GTEST_PATH_SEP_ "/" typedef long long BiggestInt; // NOLINT #endif // GTEST_OS_WINDOWS // The testing::internal::posix namespace holds wrappers for common // POSIX functions. These wrappers hide the differences between // Windows/MSVC and POSIX systems. Since some compilers define these // standard functions as macros, the wrapper cannot have the same name // as the wrapped function. namespace posix { // Functions with a different name on Windows. #if GTEST_OS_WINDOWS typedef struct _stat StatStruct; inline int FileNo(FILE* file) { return _fileno(file); } inline int IsATTY(int fd) { return _isatty(fd); } inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); } inline int StrCaseCmp(const char* s1, const char* s2) { return _stricmp(s1, s2); } inline char* StrDup(const char* src) { return _strdup(src); } inline int RmDir(const char* dir) { return _rmdir(dir); } inline bool IsDir(const StatStruct& st) { return (_S_IFDIR & st.st_mode) != 0; } #else typedef struct stat StatStruct; inline int FileNo(FILE* file) { return fileno(file); } inline int IsATTY(int fd) { return isatty(fd); } inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); } inline int StrCaseCmp(const char* s1, const char* s2) { return strcasecmp(s1, s2); } inline char* StrDup(const char* src) { return ::strdup(src); } inline int RmDir(const char* dir) { return rmdir(dir); } inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); } #endif // GTEST_OS_WINDOWS // Functions deprecated by MSVC 8.0. #ifdef _MSC_VER // Temporarily disable warning 4996 (deprecated function). #pragma warning(push) #pragma warning(disable:4996) #endif inline const char* StrNCpy(char* dest, const char* src, size_t n) { return strncpy(dest, src, n); } inline int ChDir(const char* dir) { return chdir(dir); } inline FILE* FOpen(const char* path, const char* mode) { return fopen(path, mode); } inline FILE *FReopen(const char* path, const char* mode, FILE* stream) { return freopen(path, mode, stream); } inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); } inline int FClose(FILE* fp) { return fclose(fp); } inline int Read(int fd, void* buf, unsigned int count) { return static_cast<int>(read(fd, buf, count)); } inline int Write(int fd, const void* buf, unsigned int count) { return static_cast<int>(write(fd, buf, count)); } inline int Close(int fd) { return close(fd); } inline const char* StrError(int errnum) { return strerror(errnum); } inline const char* GetEnv(const char* name) { #ifdef _WIN32_WCE // We are on Windows CE, which has no environment variables. return NULL; #else return getenv(name); #endif } #ifdef _MSC_VER #pragma warning(pop) // Restores the warning state. #endif #ifdef _WIN32_WCE // Windows CE has no C library. The abort() function is used in // several places in Google Test. This implementation provides a reasonable // imitation of standard behaviour. void Abort(); #else inline void Abort() { abort(); } #endif // _WIN32_WCE } // namespace posix // The maximum number a BiggestInt can represent. This definition // works no matter BiggestInt is represented in one's complement or // two's complement. // // We cannot rely on numeric_limits in STL, as __int64 and long long // are not part of standard C++ and numeric_limits doesn't need to be // defined for them. const BiggestInt kMaxBiggestInt = ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1)); // This template class serves as a compile-time function from size to // type. It maps a size in bytes to a primitive type with that // size. e.g. // // TypeWithSize<4>::UInt // // is typedef-ed to be unsigned int (unsigned integer made up of 4 // bytes). // // Such functionality should belong to STL, but I cannot find it // there. // // Google Test uses this class in the implementation of floating-point // comparison. // // For now it only handles UInt (unsigned int) as that's all Google Test // needs. Other types can be easily added in the future if need // arises. template <size_t size> class TypeWithSize { public: // This prevents the user from using TypeWithSize<N> with incorrect // values of N. typedef void UInt; }; // The specialization for size 4. template <> class TypeWithSize<4> { public: // unsigned int has size 4 in both gcc and MSVC. // // As base/basictypes.h doesn't compile on Windows, we cannot use // uint32_t, uint64_t, and etc here. typedef int Int; typedef unsigned int UInt; }; // The specialization for size 8. template <> class TypeWithSize<8> { public: #if GTEST_OS_WINDOWS typedef __int64 Int; typedef unsigned __int64 UInt; #else typedef long long Int; // NOLINT typedef unsigned long long UInt; // NOLINT #endif // GTEST_OS_WINDOWS }; // Integer types of known sizes. typedef TypeWithSize<4>::Int Int32; typedef TypeWithSize<4>::UInt UInt32; typedef TypeWithSize<8>::Int Int64; typedef TypeWithSize<8>::UInt UInt64; typedef TypeWithSize<8>::Int TimeInMillis; // Represents time in milliseconds. // Utilities for command line flags and environment variables. // INTERNAL IMPLEMENTATION - DO NOT USE. // // GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition // is not satisfied. // Synopsys: // GTEST_CHECK_(boolean_condition); // or // GTEST_CHECK_(boolean_condition) << "Additional message"; // // This checks the condition and if the condition is not satisfied // it prints message about the condition violation, including the // condition itself, plus additional message streamed into it, if any, // and then it aborts the program. It aborts the program irrespective of // whether it is built in the debug mode or not. class GTestCheckProvider { public: GTestCheckProvider(const char* condition, const char* file, int line) { FormatFileLocation(file, line); ::std::cerr << " ERROR: Condition " << condition << " failed. "; } ~GTestCheckProvider() { ::std::cerr << ::std::endl; abort(); } void FormatFileLocation(const char* file, int line) { if (file == NULL) file = "unknown file"; if (line < 0) { ::std::cerr << file << ":"; } else { #if _MSC_VER ::std::cerr << file << "(" << line << "):"; #else ::std::cerr << file << ":" << line << ":"; #endif } } ::std::ostream& GetStream() { return ::std::cerr; } }; #define GTEST_CHECK_(condition) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (condition) \ ; \ else \ ::testing::internal::GTestCheckProvider(\ #condition, __FILE__, __LINE__).GetStream() // Macro for referencing flags. #define GTEST_FLAG(name) FLAGS_gtest_##name // Macros for declaring flags. #define GTEST_DECLARE_bool_(name) extern bool GTEST_FLAG(name) #define GTEST_DECLARE_int32_(name) \ extern ::testing::internal::Int32 GTEST_FLAG(name) #define GTEST_DECLARE_string_(name) \ extern ::testing::internal::String GTEST_FLAG(name) // Macros for defining flags. #define GTEST_DEFINE_bool_(name, default_val, doc) \ bool GTEST_FLAG(name) = (default_val) #define GTEST_DEFINE_int32_(name, default_val, doc) \ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val) #define GTEST_DEFINE_string_(name, default_val, doc) \ ::testing::internal::String GTEST_FLAG(name) = (default_val) // Parses 'str' for a 32-bit signed integer. If successful, writes the result // to *value and returns true; otherwise leaves *value unchanged and returns // false. // TODO(chandlerc): Find a better way to refactor flag and environment parsing // out of both gtest-port.cc and gtest.cc to avoid exporting this utility // function. bool ParseInt32(const Message& src_text, const char* str, Int32* value); // Parses a bool/Int32/string from the environment variable // corresponding to the given Google Test flag. bool BoolFromGTestEnv(const char* flag, bool default_val); Int32 Int32FromGTestEnv(const char* flag, Int32 default_val); const char* StringFromGTestEnv(const char* flag, const char* default_val); } // namespace internal } // namespace testing #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
{ "content_hash": "db64ec3735584282719fb2c862c10519", "timestamp": "", "source": "github", "line_count": 971, "max_line_length": 80, "avg_line_length": 34.25643666323378, "alnum_prop": 0.6879716201184499, "repo_name": "sergecodd/FireFox-OS", "id": "c3d34f6cf27d8660c10c6a70f9892c12837edf36", "size": "33263", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "B2G/gecko/ipc/chromium/src/testing/gtest/include/gtest/internal/gtest-port.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Ada", "bytes": "443" }, { "name": "ApacheConf", "bytes": "85" }, { "name": "Assembly", "bytes": "5123438" }, { "name": "Awk", "bytes": "46481" }, { "name": "Batchfile", "bytes": "56250" }, { "name": "C", "bytes": "101720951" }, { "name": "C#", "bytes": "38531" }, { "name": "C++", "bytes": "148896543" }, { "name": "CMake", "bytes": "23541" }, { "name": "CSS", "bytes": "2758664" }, { "name": "DIGITAL Command Language", "bytes": "56757" }, { "name": "Emacs Lisp", "bytes": "12694" }, { "name": "Erlang", "bytes": "889" }, { "name": "FLUX", "bytes": "34449" }, { "name": "GLSL", "bytes": "26344" }, { "name": "Gnuplot", "bytes": "710" }, { "name": "Groff", "bytes": "447012" }, { "name": "HTML", "bytes": "43343468" }, { "name": "IDL", "bytes": "1455122" }, { "name": "Java", "bytes": "43261012" }, { "name": "JavaScript", "bytes": "46646658" }, { "name": "Lex", "bytes": "38358" }, { "name": "Logos", "bytes": "21054" }, { "name": "Makefile", "bytes": "2733844" }, { "name": "Matlab", "bytes": "67316" }, { "name": "Max", "bytes": "3698" }, { "name": "NSIS", "bytes": "421625" }, { "name": "Objective-C", "bytes": "877657" }, { "name": "Objective-C++", "bytes": "737713" }, { "name": "PHP", "bytes": "17415" }, { "name": "Pascal", "bytes": "6780" }, { "name": "Perl", "bytes": "1153180" }, { "name": "Perl6", "bytes": "1255" }, { "name": "PostScript", "bytes": "1139" }, { "name": "PowerShell", "bytes": "8252" }, { "name": "Protocol Buffer", "bytes": "26553" }, { "name": "Python", "bytes": "8453201" }, { "name": "Ragel in Ruby Host", "bytes": "3481" }, { "name": "Ruby", "bytes": "5116" }, { "name": "Scilab", "bytes": "7" }, { "name": "Shell", "bytes": "3383832" }, { "name": "SourcePawn", "bytes": "23661" }, { "name": "TeX", "bytes": "879606" }, { "name": "WebIDL", "bytes": "1902" }, { "name": "XSLT", "bytes": "13134" }, { "name": "Yacc", "bytes": "112744" } ], "symlink_target": "" }
package com.asakusafw.dag.compiler.codegen; import static com.asakusafw.lang.compiler.model.description.Descriptions.*; import static org.hamcrest.Matchers.*; import static org.junit.Assert.*; import java.math.BigDecimal; import org.junit.Test; import com.asakusafw.dag.api.common.ValueSerDe; import com.asakusafw.dag.compiler.model.ClassData; import com.asakusafw.dag.runtime.testing.MockDataModel; import com.asakusafw.dag.runtime.testing.MockKeyValueModel; import com.asakusafw.lang.compiler.model.description.ClassDescription; import com.asakusafw.runtime.io.util.DataBuffer; /** * Test for {@link ValueSerDeGenerator}. */ @SuppressWarnings("deprecation") public class ValueSerDeGeneratorTest extends ClassGeneratorTestRoot { /** * simple case. */ @Test public void simple() { ClassDescription gen = ValueSerDeGenerator.get(context(), classOf(MockDataModel.class)); loading(cl -> { ValueSerDe object = (ValueSerDe) gen.resolve(cl).newInstance(); MockDataModel model = new MockDataModel(); model.getKeyOption().modify(100); model.getSortOption().modify(new BigDecimal("3.14")); model.getValueOption().modify("Hello, world!"); DataBuffer buffer = new DataBuffer(); object.serialize(model, buffer); MockDataModel copy = (MockDataModel) object.deserialize(buffer); assertThat(buffer.getReadRemaining(), is(0)); assertThat(copy, is(not(sameInstance(model)))); assertThat(copy.getKeyOption(), is(model.getKeyOption())); assertThat(copy.getSortOption(), is(model.getSortOption())); assertThat(copy.getValueOption(), is(model.getValueOption())); }); } /** * cache - equivalent. */ @Test public void cache() { ClassData a = ValueSerDeGenerator.generate(context(), typeOf(MockDataModel.class)); ClassData b = ValueSerDeGenerator.generate(context(), typeOf(MockDataModel.class)); assertThat(b, is(cacheOf(a))); } /** * cache w/ different types. */ @Test public void cache_diff_type() { ClassData a = ValueSerDeGenerator.generate(context(), typeOf(MockDataModel.class)); ClassData b = ValueSerDeGenerator.generate(context(), typeOf(MockKeyValueModel.class)); assertThat(b, is(not(cacheOf(a)))); } }
{ "content_hash": "615d7bc424852f5956b4085723c1342d", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 96, "avg_line_length": 34.44285714285714, "alnum_prop": 0.6735794276233927, "repo_name": "asakusafw/asakusafw-compiler", "id": "f78a32b4d9e6ebb0d8174a202351f5a3dab00dd0", "size": "3023", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "dag/compiler/codegen/src/test/java/com/asakusafw/dag/compiler/codegen/ValueSerDeGeneratorTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Groovy", "bytes": "67219" }, { "name": "Java", "bytes": "6520625" }, { "name": "Shell", "bytes": "1081" } ], "symlink_target": "" }
""" Functions for creating temporary LMDBs Used in test_views """ from __future__ import absolute_import import argparse import os import sys import time # Find the best implementation available try: from cStringIO import StringIO except ImportError: from StringIO import StringIO import lmdb import numpy as np import PIL.Image if __name__ == '__main__': dirname = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, os.path.join(dirname, '..', '..', '..', '..')) import digits.config # noqa # Import digits.config first to set the path to Caffe import caffe_pb2 # noqa IMAGE_SIZE = 10 TRAIN_IMAGE_COUNT = 100 VAL_IMAGE_COUNT = 250 def create_lmdbs(folder, image_width=None, image_height=None, image_count=None): """ Creates LMDBs for generic inference Returns the filename for a test image Creates these files in "folder": train_images/ train_labels/ val_images/ val_labels/ mean.binaryproto test.png """ if image_width is None: image_width = IMAGE_SIZE if image_height is None: image_height = IMAGE_SIZE if image_count is None: train_image_count = TRAIN_IMAGE_COUNT else: train_image_count = image_count val_image_count = VAL_IMAGE_COUNT # Used to calculate the gradients later yy, xx = np.mgrid[:image_height, :image_width].astype('float') for phase, image_count in [ ('train', train_image_count), ('val', val_image_count)]: image_db = lmdb.open(os.path.join(folder, '%s_images' % phase), map_async=True, max_dbs=0) label_db = lmdb.open(os.path.join(folder, '%s_labels' % phase), map_async=True, max_dbs=0) image_sum = np.zeros((image_height, image_width), 'float64') for i in xrange(image_count): xslope, yslope = np.random.random_sample(2) - 0.5 a = xslope * 255 / image_width b = yslope * 255 / image_height image = a * (xx - image_width / 2) + b * (yy - image_height / 2) + 127.5 image_sum += image image = image.astype('uint8') pil_img = PIL.Image.fromarray(image) # create image Datum image_datum = caffe_pb2.Datum() image_datum.height = image.shape[0] image_datum.width = image.shape[1] image_datum.channels = 1 s = StringIO() pil_img.save(s, format='PNG') image_datum.data = s.getvalue() image_datum.encoded = True _write_to_lmdb(image_db, str(i), image_datum.SerializeToString()) # create label Datum label_datum = caffe_pb2.Datum() label_datum.channels, label_datum.height, label_datum.width = 1, 1, 2 label_datum.float_data.extend(np.array([xslope, yslope]).flat) _write_to_lmdb(label_db, str(i), label_datum.SerializeToString()) # close databases image_db.close() label_db.close() # save mean mean_image = (image_sum / image_count).astype('uint8') _save_mean(mean_image, os.path.join(folder, '%s_mean.png' % phase)) _save_mean(mean_image, os.path.join(folder, '%s_mean.binaryproto' % phase)) # create test image # The network should be able to easily produce two numbers >1 xslope, yslope = 0.5, 0.5 a = xslope * 255 / image_width b = yslope * 255 / image_height test_image = a * (xx - image_width / 2) + b * (yy - image_height / 2) + 127.5 test_image = test_image.astype('uint8') pil_img = PIL.Image.fromarray(test_image) test_image_filename = os.path.join(folder, 'test.png') pil_img.save(test_image_filename) return test_image_filename def _write_to_lmdb(db, key, value): """ Write (key,value) to db """ success = False while not success: txn = db.begin(write=True) try: txn.put(key, value) txn.commit() success = True except lmdb.MapFullError: txn.abort() # double the map_size curr_limit = db.info()['map_size'] new_limit = curr_limit * 2 db.set_mapsize(new_limit) # double it def _save_mean(mean, filename): """ Saves mean to file Arguments: mean -- the mean as an np.ndarray filename -- the location to save the image """ if filename.endswith('.binaryproto'): blob = caffe_pb2.BlobProto() blob.num = 1 blob.channels = 1 blob.height, blob.width = mean.shape blob.data.extend(mean.astype(float).flat) with open(filename, 'wb') as outfile: outfile.write(blob.SerializeToString()) elif filename.endswith(('.jpg', '.jpeg', '.png')): image = PIL.Image.fromarray(mean) image.save(filename) else: raise ValueError('unrecognized file extension') if __name__ == '__main__': parser = argparse.ArgumentParser(description='Create-LMDB tool - DIGITS') # Positional arguments parser.add_argument('folder', help='Where to save the images' ) # Optional arguments parser.add_argument('-x', '--image_width', type=int, help='Width of the images') parser.add_argument('-y', '--image_height', type=int, help='Height of the images') parser.add_argument('-c', '--image_count', type=int, help='How many images') args = vars(parser.parse_args()) if os.path.exists(args['folder']): print 'ERROR: Folder already exists' sys.exit(1) else: os.makedirs(args['folder']) print 'Creating images at "%s" ...' % args['folder'] start_time = time.time() create_lmdbs(args['folder'], image_width=args['image_width'], image_height=args['image_height'], image_count=args['image_count'], ) print 'Done after %s seconds' % (time.time() - start_time,)
{ "content_hash": "0511f9e6051f38ac87360c3039c51313", "timestamp": "", "source": "github", "line_count": 209, "max_line_length": 84, "avg_line_length": 30.033492822966508, "alnum_prop": 0.563167118050024, "repo_name": "ethantang95/DIGITS", "id": "09f6385244b79bbc7836f945e260fad0546d7027", "size": "6369", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "digits/dataset/images/generic/test_lmdb_creator.py", "mode": "33261", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "4386" }, { "name": "HTML", "bytes": "2638345" }, { "name": "JavaScript", "bytes": "53917" }, { "name": "Lua", "bytes": "110602" }, { "name": "Makefile", "bytes": "113" }, { "name": "Protocol Buffer", "bytes": "1750" }, { "name": "Python", "bytes": "1230584" }, { "name": "Shell", "bytes": "13547" } ], "symlink_target": "" }
Cython based wrapper for [libhdfs3](https://github.com/PivotalRD/libhdfs3). ## Install Requirements are basically [`libhdfs3`](https://github.com/PivotalRD/libhdfs3) and [`cyavro`](https://github.com/PivotalRD/libhdfs3) both are available as conda packages: `conda install -c https://conda.anaconda.org/blaze https://conda.anaconda.org/mvn libhdfs3 cyavro` Then you should be able to: `pip install cyhdfs3` ## Basic usage ```python # Needed by libhdfs3 import os os.environ["LIBHDFS3_CONF"] = "/etc/hadoop/conf/hdfs-site.xml" import cyhdfs3 # Default host: localhost, port: 8020 client = cyhdfs3.HDFSClient() data = b'0' * 250 * 2 ** 20 data += b'1' * 250 * 2 ** 20 f = client.open('/tmp/temp', 'w') f.write(data) f.close() f = client.open('/tmp/iris.csv', 'r') print f.readline() print f.readline() print f.readline() print f.readline() print f.readline() f.close() ``` ## Development/Play environment ```bash # Docker container with conda and libhdfs3: Connect to remote HDFS docker build -t cyhdfs3 . docker run -it -v $(pwd):/cyhdfs3 -v $(pwd)/../cyavro:/cyavro cyhdfs3 # Docker container with conda, libhdfs3 and HDFS (Pseudo Distributed mode) docker build -t cyhdfs3.hdfs -f Dockerfile.hdfs . docker run -it -p 8020:8020 -p 50070:50070 -v $(pwd):/cyhdfs3 -v $(pwd)/../cyavro:/cyavro cyhdfs3.hdfs # Bash inside the container docker exec -it $(docker ps -q -l) bash ```
{ "content_hash": "41cd7c1be5a9e37e83b02be956a15495", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 108, "avg_line_length": 26.692307692307693, "alnum_prop": 0.7096541786743515, "repo_name": "danielfrg/libhdfs3.py", "id": "7eb3a35956bc2c5affd2050d9ad5f6c1ec9c27d4", "size": "1399", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Python", "bytes": "126190" }, { "name": "Shell", "bytes": "901" } ], "symlink_target": "" }
<HTML> <HEAD> <meta charset="UTF-8"> <title>TimeOfDayWord - biomedicus-core</title> <link rel="stylesheet" href="../../../style.css"> </HEAD> <BODY> <a href="../../index.html">biomedicus-core</a>&nbsp;/&nbsp;<a href="../index.html">edu.umn.biomedicus.time</a>&nbsp;/&nbsp;<a href="./index.html">TimeOfDayWord</a><br/> <br/> <h1>TimeOfDayWord</h1> <code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">TimeOfDayWord</span>&nbsp;<span class="symbol">:</span>&nbsp;<span class="identifier">Label</span></code> <h3>Constructors</h3> <table> <tbody> <tr> <td> <p><a href="-init-.html">&lt;init&gt;</a></p> </td> <td> <code><span class="identifier">TimeOfDayWord</span><span class="symbol">(</span><span class="identifier" id="edu.umn.biomedicus.time.TimeOfDayWord$<init>(edu.umn.nlpengine.TextRange)/textRange">textRange</span><span class="symbol">:</span>&nbsp;<span class="identifier">TextRange</span><span class="symbol">)</span></code><br/> <code><span class="identifier">TimeOfDayWord</span><span class="symbol">(</span><span class="identifier" id="edu.umn.biomedicus.time.TimeOfDayWord$<init>(kotlin.Int, kotlin.Int)/startIndex">startIndex</span><span class="symbol">:</span>&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html"><span class="identifier">Int</span></a><span class="symbol">, </span><span class="identifier" id="edu.umn.biomedicus.time.TimeOfDayWord$<init>(kotlin.Int, kotlin.Int)/endIndex">endIndex</span><span class="symbol">:</span>&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html"><span class="identifier">Int</span></a><span class="symbol">)</span></code></td> </tr> </tbody> </table> <h3>Properties</h3> <table> <tbody> <tr> <td> <p><a href="end-index.html">endIndex</a></p> </td> <td> <code><span class="keyword">val </span><span class="identifier">endIndex</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html"><span class="identifier">Int</span></a></code></td> </tr> <tr> <td> <p><a href="start-index.html">startIndex</a></p> </td> <td> <code><span class="keyword">val </span><span class="identifier">startIndex</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html"><span class="identifier">Int</span></a></code></td> </tr> </tbody> </table> </BODY> </HTML>
{ "content_hash": "f153aa232da872fd81d1ff9eab7a8689", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 705, "avg_line_length": 53.644444444444446, "alnum_prop": 0.6901408450704225, "repo_name": "NLPIE/BioMedICUS", "id": "99a45edfeb7237c71ac5dba1392b64ff469b94f7", "size": "2414", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/dokka/biomedicus-core/edu.umn.biomedicus.time/-time-of-day-word/index.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1158577" }, { "name": "Shell", "bytes": "1548" } ], "symlink_target": "" }
package com.interviews.ds.graph; // A Java program for Dijkstra's single source shortest path algorithm. // The program is for adjacency matrix representation of the graph class ShortestPath { // A utility function to find the vertex with minimum distance value, // from the set of vertices not yet included in shortest path tree static final int V = 9; // Driver method public static void main(String[] args) { /* Let us create the example graph discussed above */ int graph[][] = new int[][]{{0, 4, 0, 0, 0, 0, 0, 8, 0}, {4, 0, 8, 0, 0, 0, 0, 11, 0}, {0, 8, 0, 7, 0, 4, 0, 0, 2}, {0, 0, 7, 0, 9, 14, 0, 0, 0}, {0, 0, 0, 9, 0, 10, 0, 0, 0}, {0, 0, 4, 14, 10, 0, 2, 0, 0}, {0, 0, 0, 0, 0, 2, 0, 1, 6}, {8, 11, 0, 0, 0, 0, 1, 0, 7}, {0, 0, 2, 0, 0, 0, 6, 7, 0} }; ShortestPath t = new ShortestPath(); t.dijkstra(graph, 0); } int minDistance(int dist[], Boolean sptSet[]) { // Initialize min value int min = Integer.MAX_VALUE, min_index = -1; for (int v = 0; v < V; v++) if (sptSet[v] == false && dist[v] <= min) { min = dist[v]; min_index = v; } return min_index; } // A utility function to print the constructed distance array void printSolution(int dist[], int n) { System.out.println("Vertex Distance from Source"); for (int i = 0; i < V; i++) System.out.println(i + " \t\t " + dist[i]); } // Funtion that implements Dijkstra's single source shortest path // algorithm for a graph represented using adjacency matrix // representation void dijkstra(int graph[][], int src) { int dist[] = new int[V]; // The output array. dist[i] will hold // the shortest distance from src to i // sptSet[i] will true if vertex i is included in shortest // path tree or shortest distance from src to i is finalized Boolean sptSet[] = new Boolean[V]; // Initialize all distances as INFINITE and stpSet[] as false for (int i = 0; i < V; i++) { dist[i] = Integer.MAX_VALUE; sptSet[i] = false; } // Distance of source vertex from itself is always 0 dist[src] = 0; // Find shortest path for all vertices for (int count = 0; count < V - 1; count++) { // Pick the minimum distance vertex from the set of vertices // not yet processed. u is always equal to src in first // iteration. int u = minDistance(dist, sptSet); // Mark the picked vertex as processed sptSet[u] = true; // Update dist value of the adjacent vertices of the // picked vertex. for (int v = 0; v < V; v++) // Update dist[v] only if is not in sptSet, there is an // edge from u to v, and total weight of path from src to // v through u is smaller than current value of dist[v] if (!sptSet[v] && graph[u][v] != 0 && dist[u] != Integer.MAX_VALUE && dist[u] + graph[u][v] < dist[v]) dist[v] = dist[u] + graph[u][v]; } // print the constructed distance array printSolution(dist, V); } }
{ "content_hash": "5292143e34a648dfb0b1484350700ecb", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 73, "avg_line_length": 36.97872340425532, "alnum_prop": 0.516398158803222, "repo_name": "harishraj/epicode", "id": "bb809e038e43a0b5b58280035576c3989495c8d3", "size": "3476", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/interviews/ds/graph/ShortestPath.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "1255065" } ], "symlink_target": "" }
@interface CustomImagePickerController () <ImageFitlerProcessDelegate> @end @implementation CustomImagePickerController @synthesize customDelegate = _customDelegate; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } #pragma mark get/show the UIView we want - (UIView *)findView:(UIView *)aView withName:(NSString *)name { Class cl = [aView class]; NSString *desc = [cl description]; if ([name isEqualToString:desc]) return aView; for (NSUInteger i = 0; i < [aView.subviews count]; i++) { UIView *subView = [aView.subviews objectAtIndex:i]; subView = [self findView:subView withName:name]; if (subView) return subView; } return nil; } #pragma mark UINavigationControllerDelegate - (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated { float version = [[[UIDevice currentDevice] systemVersion] floatValue]; UIImage *backgroundImage = [UIImage imageNamed:@"bg_header.png"]; if (version >= 5.0) { [navigationController.navigationBar setBackgroundImage:backgroundImage forBarMetrics:UIBarMetricsDefault]; } else { [navigationController.navigationBar insertSubview:[[[UIImageView alloc] initWithImage:backgroundImage] autorelease] atIndex:1]; } if (self.sourceType == UIImagePickerControllerSourceTypeCamera) { UIImage *deviceImage = [UIImage imageNamed:@"camera_button_switch_camera.png"]; UIButton *deviceBtn = [UIButton buttonWithType:UIButtonTypeCustom]; [deviceBtn setBackgroundImage:deviceImage forState:UIControlStateNormal]; [deviceBtn addTarget:self action:@selector(swapFrontAndBackCameras:) forControlEvents:UIControlEventTouchUpInside]; [deviceBtn setFrame:CGRectMake(250, 20, deviceImage.size.width, deviceImage.size.height)]; UIView *PLCameraView = [self findView:viewController.view withName:@"PLCameraView"]; [PLCameraView addSubview:deviceBtn]; [self setShowsCameraControls:NO]; UIView *overlyView = [[UIView alloc] initWithFrame:CGRectMake(0, ScreenHeight - 34, 320, 44)]; [overlyView setBackgroundColor:[UIColor clearColor]]; UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom]; UIImage *backImage = [UIImage imageNamed:@"camera_cancel.png"]; [backBtn setImage:backImage forState:UIControlStateNormal]; [backBtn addTarget:self action:@selector(closeView) forControlEvents:UIControlEventTouchUpInside]; [backBtn setFrame:CGRectMake(8, 5, backImage.size.width, backImage.size.height)]; [overlyView addSubview:backBtn]; UIImage *camerImage = [UIImage imageNamed:@"camera_shoot.png"]; UIButton *cameraBtn = [[UIButton alloc] initWithFrame: CGRectMake(110, 5, camerImage.size.width, camerImage.size.height)]; [cameraBtn setImage:camerImage forState:UIControlStateNormal]; [cameraBtn addTarget:self action:@selector(takePicture) forControlEvents:UIControlEventTouchUpInside]; [overlyView addSubview:cameraBtn]; UIImage *photoImage = [UIImage imageNamed:@"camera_album.png"]; UIButton *photoBtn = [[UIButton alloc] initWithFrame:CGRectMake(260, 5, 70, 40)]; [photoBtn setImage:photoImage forState:UIControlStateNormal]; [photoBtn addTarget:self action:@selector(showPhoto) forControlEvents:UIControlEventTouchUpInside]; [overlyView addSubview:photoBtn]; self.cameraOverlayView = overlyView; } } - (void)viewDidLoad { [super viewDidLoad]; self.delegate = self; // Do any additional setup after loading the view. } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } - (void)dealloc { [super dealloc]; } #pragma mark - ButtonAction Methods - (IBAction)swapFrontAndBackCameras:(id)sender { if (self.cameraDevice == UIImagePickerControllerCameraDeviceRear) { self.cameraDevice = UIImagePickerControllerCameraDeviceFront; } else { self.cameraDevice = UIImagePickerControllerCameraDeviceRear; } } - (void)closeView { [self dismissModalViewControllerAnimated:YES]; } - (void)takePicture { [super takePicture]; } - (void)showPhoto { [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationFade]; [self setSourceType:UIImagePickerControllerSourceTypePhotoLibrary]; } #pragma mark Camera View Delegate Methods - (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage]; image = [[image clipImageWithScaleWithsize:CGSizeMake(320, 480)] retain]; [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackOpaque animated:YES]; if ([_customDelegate respondsToSelector:@selector(cameraPhoto:)]) { [_customDelegate cameraPhoto:image]; } ImageFilterProcessViewController *fitler = [[[ImageFilterProcessViewController alloc] init] autorelease]; [fitler setDelegate:self]; fitler.currentImage = image; // UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:fitler]; // nav.navigationBar.barTintColor = COLOR_MAIN_RED_DARK; // nav.navigationBar.translucent = NO; // nav.navigationBar.titleTextAttributes = @{ UITextAttributeTextColor:[UIColor whiteColor] }; // [self presentModalViewController:nav animated:YES]; [self pushViewController:fitler animated:YES]; } - (void)imageFitlerProcessDone:(UIImage *)image { if ([self.customDelegate respondsToSelector:@selector(pickedPhoto:)]) { [self.customDelegate pickedPhoto:image]; } } - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker { [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackOpaque animated:YES]; if (_isSingle) { [picker dismissModalViewControllerAnimated:YES]; } else { if (picker.sourceType == UIImagePickerControllerSourceTypePhotoLibrary) { self.sourceType = UIImagePickerControllerSourceTypeCamera; } else { [picker dismissModalViewControllerAnimated:YES]; } } } @end
{ "content_hash": "07d1837f0bebc4a4b778cf06570b5294", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 159, "avg_line_length": 37.50609756097561, "alnum_prop": 0.7779222890586897, "repo_name": "abcxo/XJoin", "id": "76bed712285646822724dad952e29a1f6f32e8b3", "size": "6438", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "CustomPickerAndFitler/CustomPickerAndFitler/CustomPickerAndFitler/CustomImagePickerController.m", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "10817" }, { "name": "HTML", "bytes": "4555" }, { "name": "Objective-C", "bytes": "1702800" }, { "name": "PHP", "bytes": "1364" }, { "name": "Ruby", "bytes": "526" } ], "symlink_target": "" }
DOUBTFUL #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "f908b933ccd47a9ad57911be08c5c58f", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.307692307692308, "alnum_prop": 0.6940298507462687, "repo_name": "mdoering/backbone", "id": "2d1eb1a65ef35ed8665bff5a798ef757a60bd5a0", "size": "185", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Panphalea/Panphalea commersonii/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
import {NDArrayMath} from '../math/math'; import {NDArray} from '../math/ndarray'; import * as util from '../util'; /** * The interface for input providers. */ export interface InputProvider { /** * Get the next input as a copy. This is important because the data might * get uploaded to the GPU and modify the original data. * @param math NDArrayMath */ getNextCopy(math: NDArrayMath): NDArray; /** * Dispose the input copy. * @param math NDArrayMath * @param copy The copy provided from getNextCopy */ disposeCopy(math: NDArrayMath, copy: NDArray): void; } /** * A common interface for shuffled input provider builders. This returns * InputProviders that are synchronized. * @hidden */ export interface ShuffledInputProviderBuilder { getInputProviders(): InputProvider[]; } /** * @hidden */ export abstract class InMemoryShuffledInputProviderBuilder implements ShuffledInputProviderBuilder { protected shuffledIndices: Uint32Array; protected numInputs: number; protected idx = 0; // Counter for how many times the current index has been called. Resets to 0 // when it reaches the number of inputs. protected inputCounter = 0; protected epoch = 0; /** * Constructs an `InMemoryShuffledInputProvider`. All of the inputs must be * in memory. * @param inputs All of the inputs, size: [number of inputs][number of * examples]. */ constructor(protected inputs: NDArray[][]) { this.shuffledIndices = util.createShuffledIndices(inputs[0].length); this.numInputs = inputs.length; // Make sure the number of examples in each input matches. const numExamples = this.inputs[0].length; for (let i = 0; i < this.numInputs; i++) { util.assert( this.inputs[i].length === numExamples, 'Number of examples must match across different inputs.'); } // Make sure the shapes within inputs all match. for (let i = 0; i < this.numInputs; i++) { const inputShape = this.inputs[i][0].shape; for (let j = 0; j < this.inputs[i].length; j++) { util.assertShapesMatch(inputShape, this.inputs[i][j].shape); } } } protected getCurrentExampleIndex(): number { const returnIdx = this.idx; this.inputCounter++; if (this.inputCounter >= this.numInputs) { this.idx++; this.inputCounter = 0; if (this.idx >= this.inputs[0].length) { this.idx = 0; this.epoch++; } } return returnIdx; } protected getNextInput(inputId: number): NDArray { const currentExampleIndex = this.getCurrentExampleIndex(); return this.inputs[inputId][this.shuffledIndices[currentExampleIndex]]; } getEpoch() { return this.epoch; } /** * Returns input providers which shuffle the inputs and stay in sync. */ getInputProviders(): InputProvider[] { const inputProviders: InputProvider[] = []; for (let i = 0; i < this.numInputs; i++) { inputProviders.push(this.getInputProvider(i)); } return inputProviders; } abstract getInputProvider(inputId: number): InputProvider; } /** * An in CPU memory ShuffledInputProviderBuilder that shuffles NDArrays on the * CPU and keeps them mutually in sync. */ export class InCPUMemoryShuffledInputProviderBuilder extends InMemoryShuffledInputProviderBuilder { getInputProvider(inputId: number) { const shuffledInputProvider = this; return { getNextCopy(math: NDArrayMath): NDArray { return NDArray.like(shuffledInputProvider.getNextInput(inputId)); }, disposeCopy(math: NDArrayMath, copy: NDArray) { copy.dispose(); } }; } } /** * An in GPU memory ShuffledInputProviderBuilder that shuffles NDArrays on the * GPU and keeps them mutually in sync. This is more performant than the CPU * version as textures will stay in memory, however this is more GPU memory * intensive as it keeps textures resident in GPU memory. */ export class InGPUMemoryShuffledInputProviderBuilder extends InMemoryShuffledInputProviderBuilder { getInputProvider(inputId: number) { const shuffledInputProvider = this; return { getNextCopy(math: NDArrayMath): NDArray { return math.clone(shuffledInputProvider.getNextInput(inputId)); }, disposeCopy(math: NDArrayMath, copy: NDArray) { copy.dispose(); } }; } }
{ "content_hash": "a2ebe6d044731f17e6d1d4ac32d95cc3", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 78, "avg_line_length": 28.128205128205128, "alnum_prop": 0.6820875113947129, "repo_name": "mnottheone/deeplearnjs", "id": "708b419adf8f53a209f5909f85dde6ca606f0097", "size": "5090", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/data/input_provider.ts", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "JavaScript", "bytes": "11584" }, { "name": "Python", "bytes": "11704" }, { "name": "Shell", "bytes": "6367" }, { "name": "TypeScript", "bytes": "1040519" } ], "symlink_target": "" }
import React, { PropTypes, Component } from 'react' import classes from './ContextMenu.scss' export default class ContextMenu extends Component { static propTypes = { event: PropTypes.object, position: PropTypes.shape({ x: PropTypes.number, y: PropTypes.number }), path: PropTypes.string, dismiss: PropTypes.func, onAddFileClick: PropTypes.func, onAddFolderClick: PropTypes.func, onFileDelete: PropTypes.func } state = { contextMenu: { display: 'none', top: '0px', left: '0px' } } componentDidMount () { this.setupRightClick() } setupRightClick = () => { this.setState({ contextMenu: { top: this.props.position.y, left: this.props.position.x } }) window.addEventListener('click', this.windowClick) } windowClick = () => { this.props.dismiss() window.removeEventListener('click', this.windowClick) } deleteClick = (e) => { e.preventDefault() this.props.onFileDelete(this.props.path) } render () { const { path, onAddFileClick, onAddFolderClick } = this.props const parent = path ? path.substring(0, path.lastIndexOf('/') + 1) : '/' // TODO: find a cleaner way to do this const menuLocation = { top: parseInt(this.state.contextMenu.top) - 63, // Subtract the height of the navbar left: this.state.contextMenu.left } return ( <ul style={menuLocation} className={classes['container']}> <li onClick={() => onAddFileClick(parent)}> Add new file </li> <li onClick={() => onAddFolderClick(parent)}> Add new folder </li> { path && <li onClick={this.deleteClick}> Delete </li> } </ul> ) } }
{ "content_hash": "752f90b4c906cfb63138f6e3e26d9dc9", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 90, "avg_line_length": 21.788235294117648, "alnum_prop": 0.5750539956803455, "repo_name": "prescottprue/devshare-site", "id": "78f1774d3edbec2dc9e4b2a65831854473bfd193", "size": "1852", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/routes/Projects/routes/Project/components/ContextMenu/ContextMenu.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "23747" }, { "name": "HTML", "bytes": "238" }, { "name": "JavaScript", "bytes": "163851" } ], "symlink_target": "" }
title: "Generated Code" layout: docs --- # Generated Code This page describes the code generated by ScalaPB and how to use it. ## Default Package Structure The generator will create a Scala file for each top-level message and enum in your proto file. Using multiple files results in a better incremental compilation performance. The Scala package of the generated files will be determined as follows: - If the `java_package` option is defined, then the Scala package will be `java_package.base_name` where `base_name` is the name of the proto file without the `.proto` extension. - If the `java_package` is undefined, but the file specifies a package name via the `package` keyword then the Scala package will be `package.base_name`. - If neither `java_package` nor `package` are specified, the Scala package will be just `base_name`. From version 0.4.2, there is a way to customize the package name by using [file-level options]({{site.baseurl}}/customizations.html). ## Messages Each message corresponds to a final case class and a companion object. Optional fields are wrapped in an `Option[]`, repeated fields are given as `Seq[]`, and required fields (which you should not use, see "Required is forever" in the [Language Guide](https://developers.google.com/protocol-buffers/docs/proto#simple) are normal members. Note that in proto3, scalar (non-message) fields are not wrapped in `Option`, For example, if your protocol buffer looks like this: ```protobuf message Person { optional string name = 1; optional int32 age = 2; // Address is a message defined somewhere else. repeated Address addresses = 3; } ``` ...then the compiler will generate code that looks like this: ```scala final case class Person( name: Option[String] = None, age: Option[Int] = None, addresses: Seq[Address] = Nil) extends GeneratedMessage { def toByteArray: Array[Byte] = { ... } // more stuff... } object Person extends GeneratedMessageCompanion[Person] { def parseFrom(bytes: Array[Byte]): Person = { ... } // more stuff... } ``` The case class contains various methods for serialization, and the companion object contains method for parsing. [See the source code for `GeneratedMessage` and `GeneratedMessageCompanion`](https://github.com/scalapb/ScalaPB/blob/master/scalapb-runtime/shared/src/main/scala/scalapb/GeneratedMessageCompanion.scala) to see what methods are available ### Building New Messages Create a new instance of a message by calling the constructor (as you normally would for a case class): ```scala val p1 = Person() val p2 = Person(name = Some("John")) ``` When constructing messages, it is advised to use named arguments Person(**name** = x, **age** = y) to ensure your code does not rely on the order of the fields in the protocol buffer definition. ### Updating Messages Messages are immutables: once you created a message instance it can not be changed. Messages are thread-safe: you can access the same message instance from multiple threads. When you want to modify a message, simply create a new one based on the original. You can use the `copy()` method Scala provides for all case classes, however ScalaPB provides additional methods to make it even easier. The first method is using a `withX()` method, where `X` is a name of a field. For example ```scala val p = Person().withName("John").withAge(29) ``` Note that when using the `withX()` method on an optional field, you do not need to provide the `Some()`. Another way to update a message is using the `update()` method: ```scala val p = Person().update( _.name := "John", _.age := 29 ) ``` The `update()` method takes "mutations" (like the assignments above), and applies them on the object. Using the `update()` method, as we will see below, usually results in a more concise code, especially when your fields are message types. ## Optional Fields Optional fields are wrapped inside an `Option`. The compiler will generate a `getX()` method that will return the option's value if it is set, or a default value for the field if it is unset (that is, if it is `None`) There are two ways to update an optional field using the `update()` method: ```scala val p = Person().update( // Pass the value directly: _.name := "John", // Use the optionalX prefix and pass an Option: _.optionalAge := Some(37) // ...or None ) ``` The first way sets the field with a value, the second way lets you pass an `Option[]` so it is possible to set the field to `None`. For each optional field `X`, the compiler also generates a `clearX()` method that returns a new instance of the message which is identical to the original one except that the field is assigned the value `None`. ## Required Fields Required fields have no default value in the generated constructor, so you must specify them when you instantiate a new message. Differences from optional fields: - The value of the field is not wrapped inside an `Option`. - There is no `getX` method (you can always use `.x`) - There is no `clearX` method (since that will result in an invalid message) - There is no `_.optionalX` lens for the `update()` method. ## Repeated Fields Repeated fields are provided as a `Seq[T]`. The compiler will generate the following methods: - `addFoo(f1, [f2, f3, ...]: Foo)`: returns a copy with the given elements added to the original list. - `addAllFoo(fs: Seq[Foo])`: returns a copy with the given sequence of elements added to the original list. - `withX(otherList)`: replace the sequence with another. - `clearX`: replace with the sequence with an empty one. Using `update()` is especially fun with repeated fields: ```scala val p = Person().update( // Override the addresses _.addressses := newListOfAddress, // Add one address: _.addressses :+= address1, // Add a list of addresses: _.addresses :++= Seq(address1, address2), // Modify an address in the list by index! _.addressses(1).street := "Townsend St.", // Modify all addresses: _.addresses.foreach(_.city := "San Francisco"), // Apply a transformation to all addresses (this is // just for showing off, it is not specific for // repeatables - it happens in the nested mutations) _.addresses.foreach(_.city.modify(_.trim)) ) ``` ## Oneof Fields Oneofs are great when you model a message that has multiple disjoint cases. An example use case would be: ```protobuf // Represent a payment by credit card message CreditCardPayment { optional string last4 = 1; optional int32 expiration_month = 2; optional int32 expiration_year = 3; } // Represent a payment by credit card message BankTransferPayment { optional string routing_number = 1; optional string account_number = 2; } // Represents an order placed by a customer: message Order { optional int amount = 1; optional string customer_id = 2; // How did we get paid? At most one option must be set. oneof payment_type { CreditCardPayment credit_card = 3; BankTransferPayment bank = 4; } } ``` The compiler will generate code that looks like this: ```scala final case class CreditCardPayment { ... } final case class BankTransfer { ... } case class Order(..., paymentType: Payment.PaymentType) { // Set the payment type to a specific case: def withCreditCard(v: CreditCardPayment): Order def withBank(v: BankTransferPayment): Order // Sets the entire payment type to a new value: def withPaymentType(v: PaymentType): Order // Sets the PaymentType to Empty def clearPaymentType: Order } object Order { sealed trait PaymentType { def isEmpty: Boolean def isDefined: Boolean def isCreditCard: Boolean def isBank: Boolean def creditCard: Option[CreditCardPayment] def bank: Option[BankTransferPayment] } case object Empty extends PaymentType case class CreditCard(v: CreditCardPayment) extends PaymentType case class Bank(v: CreditCardPayment) extends PaymentType } ``` This enables writing coding like this: ```scala val o1 = Order() .withCreditCard(CreditCardPayment(last4 = Some("4848"))) // which is equivalent to: val o2 = Order().update( _.creditCard.last4 := "4848") // This changes the payment type to a bank, so the credit card data is // not reachable any more through o3. val o3 = o1.update(_.bank.routingNumber := "333") if (o3.paymentType.isBank) { // Do something useful. } // Pattern matching: import Order.PaymentType o3.paymentType match { case PaymentType.CreditCard(cc) => // handle cc case PaymentType.Bank(b) => // handle b case PaymentType.Empty => // handle exceptional case... } // The one of values are available as Option too: val maybeRoutingNumber: Option[String] = o3.paymentType.bank.map { b => b.routingNumber } ``` ## Enumerations Enumerations are implemented using sealed traits that extend `GeneratedEnum`. This approach, rather than using Scala's standard Enumeration type, allows getting a warning from the Scala compiler when a pattern match is incomplete. For a definition like: ```protobuf enum Weather { SUNNY = 1; PARTLY_CLOUDY = 2; RAIN = 3; } message Forecast { optional Weather weather = 1; } ``` The compiler will generate: ```scala sealed trait Weather extends GeneratedEnum { def isSunny: Boolean def isPartlyCloudy: Boolean def isRain: Boolean } object Weather extends GeneratedEnumCompanion[Weather] { case object Sunny extends Weather { val value = 1 val name = "SUNNY" } // Similarly for the other enum values... case object PartlyCloudy extends Weather { ... } case object Rain extends Weather { ... } // In ScalaPB >= 0.5.x, this captures unknown value that are received // from the wire format. Earlier versions throw a MatchError when // this happens. case class Unrecognized(value: Int) extends Weather { ... } // And a list of all possible values: lazy val values = Seq(Sunny, PartlyCloudy, Rain) } case class Forecast(weather: Option[Weather]) { ... } ``` And we can write: ```scala val f = Forecard().update(_.weather := Weather.PartlyCloud) assert(f.weather == Some(Weather.PartlyCloudy) if (f.getWeather.isRain) { // take an umbrella } // Pattern matching: f.getWeather match { case Weather.Rain => case Weather.Sunny => case _ => } ``` ## ASCII Representation Each message case-class has `toProtoString` method that returns a string representation of the message in an ASCII format. The ASCII format can be parsed back by the `fromAscii()` method available on the companion object. That format is not officially documented, but at least the standard Python, Java and C++ implementations of protobuf attempt to generate (and be able to parse) compatible ASCII representations. ScalaPB's `toString()` and `fromAscii` follow the Java implementation. The format looks like this: ```protobuf int_field: 17 string_field: "foo" repeated_string_field: "foo" repeated_string_field: "bar" message_field { field1: "value1" color_enum: BLUE } ``` This format can be useful for debugging or for transient data processing, but beware of persisting these ASCII representations: unknown fields throw an exception, and unlike the binary format, the ASCII format is senstitive to renames. ## Java Conversions If you are dealing with legacy Java protocol buffer code, while still wanting to write new code using ScalaPB, it can be useful to generate converters to/from the Java protocol buffers. To do this, set `PB.targets in Compile` like this in your `build.sbt`: ```scala PB.targets in Compile := Seq( PB.gens.java -> (sourceManaged in Compile).value, scalapb.gen(javaConversions=true) -> (sourceManaged in Compile).value ) ``` This will result in the following changes: - The companion object for each message will have `fromJavaProto` and `toJavaProto` methods. - The companion object for enums will have `fromJavaValue` and `toJavaValue` methods.
{ "content_hash": "a263ac035b22a1d2f1ec04af7f3bcbae", "timestamp": "", "source": "github", "line_count": 422, "max_line_length": 154, "avg_line_length": 28.540284360189574, "alnum_prop": 0.7211889737628695, "repo_name": "dotty-staging/ScalaPB", "id": "ffd6c73603dd8e50ff33d28100f23b5b2e9b7b25", "size": "12048", "binary": false, "copies": "1", "ref": "refs/heads/dotty-community-build", "path": "docs/src/main/markdown/generated-code.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Scala", "bytes": "2162964" }, { "name": "Shell", "bytes": "3698" } ], "symlink_target": "" }
layout: post title: Alternate approach for Bundler cover: false date: 2016-02-04 10:18:00 tags: bundler subclass: 'post tag-bundler' categories: 'madki' navigation: True logo: 'assets/images/ghost.png' disqus: 'xyz.madki.alternate-approach-bundler' --- ## Problems with Bundler * global fields with package level visibility * use of generated classes all over the place * may be generates too much code and should make users write more (?) * `@State` is an entirely different problem that `Bundler` need not address * An activity using `Bundler` to get type-safety is not an implementation detail and ideally it should be. * Field defaults and resetting (what should be default value, should the field value be reset when a second value is injected) Right now calling classes make use of the generated `Bundler` class for starting activities. But ideally Bundler should be an implementation detail for the calling classes. A better approach would be to not generate the `bundlerActivity()` methods in `Bundler`. So a better version of `Bundler` though requiring more code would have the following features: * No global fields * calling classes shouldn't need to know the existence of `Bundler` * minimize the use of generated classes An approach similar to the super-awesome `AutoValue` library can be taken. Instead of getting the intent extras from fields they can be defined in an interface (or an abstract class ?) ```java public class DemoActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { Extras extras = DemoActivityExtras.get(this); // use id(-1) and name() methods of Extras } @Args interface Extras { @Key("some_key") int id(int defaultVal); @Required(false) @Nullable String name(); // extra helper methods can be added to know if a key was sent or not @Helper boolean hasName(); } public static DemoActivityExtras.Builder withId(int id) { return DemoActivityExtras.build(id); } } ``` A calling class (say `AnotherActivty`) can start the above `DemoActivity` as: ```java // code in AnotherActivity.class DemoActivity.withId(1).name("xyz").start(context); ``` The only problem with this is `DemoActivityExtras.Builder` which is a generated class is being exposed. Ideal case would be to go the full `AutoValue` way and require a Builder interface inside Extras. But how much code is too much and where lies the line. This version of `Bundler` is more sound that the current one but it definitely increased the code, and a little more code `Bundler` would become an implementation detail completely.
{ "content_hash": "2044cf238f32bf1314131f14663c2cb0", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 438, "avg_line_length": 39.333333333333336, "alnum_prop": 0.7650231124807396, "repo_name": "madki/blog", "id": "8b8839855d37b2097db9df01b24ce84c05737ba8", "size": "2600", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_posts/2016-02-04-alternate-appraoch-bundler.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "89403" }, { "name": "HTML", "bytes": "275008" }, { "name": "JavaScript", "bytes": "8848" }, { "name": "Ruby", "bytes": "13828" } ], "symlink_target": "" }
(function (){ angular.module('aanZeeDirectives.inputStepper', []) .directive('inputStepper', ['options', function (options) { return { restrict: 'AE', require: ['ngModel', '?^ngDisabled'], replace: true, templateUrl: options.viewPath + 'input-stepper/input-stepper.view.html', scope: { ngModel: '=', ngDisabled: '@?', label: '@?', value: '@?', minimum: '@?', maximum: '@?', step: '@?', disabled: '@?', classes: '@?', iconIncrease: '@?', iconDecrease: '@?' }, controller: ['$scope', '$element', function($scope, $element) { $scope.decrease = function(){ if ($scope.minimum){ if (($scope.ngModel - parseInt($scope.step, 10)) >= $scope.minimum){ $scope.ngModel -= parseInt($scope.step, 10); } } else { $scope.ngModel -= parseInt($scope.step, 10); } }; $scope.increase = function(){ if ($scope.maximum){ if (($scope.ngModel + parseInt($scope.step, 10)) <= $scope.maximum){ $scope.ngModel += parseInt($scope.step,10); } } else { $scope.ngModel += parseInt($scope.step,10); } }; }], link: function(scope, elem, attr) { scope.step = parseInt(attr.step, 10) || 1; scope.value = 0; scope.minimum = undefined; scope.maximum = undefined; scope.iconIncrease = '+'; scope.iconDecrease = '-'; scope.classes = { increaseButton: '', decreaseButton: '', input: '', label: '', wrapper: '' }; if (attr.max){ scope.maximum = parseInt(attr.max, 10); } if (attr.min){ scope.minimum = parseInt(attr.min, 10); } if (attr.value){ scope.value = parseInt(attr.value, 10); } if (!scope.ngModel){ scope.ngModel = scope.value || scope.minimum || 0; } if (attr.iconIncrease) { scope.iconIncrease = attr.iconIncrease; } if (attr.iconDecrease) { scope.iconDecrease = attr.iconDecrease; } // Add classes to classes object attr.classes = scope.$eval(attr.classes); if (attr.classes) { for (var classKey in scope.classes){ if (attr.classes[classKey]){ scope.classes[classKey] = attr.classes[classKey]; } } } var upKey = 38, downKey = 40; scope.validate = function(value){ scope.ngModel = parseInt(value, 10); if (value === undefined || value === null){ scope.ngModel = scope.minimum || 0; } if (scope.maximum && (value > scope.maximum)){ scope.ngModel = scope.maximum; } if (scope.minimum && (value < scope.minimum)){ scope.ngModel = scope.minimum; } }; scope.keyHandler = function($event){ $event.preventDefault(); if ($event.keyCode == upKey){ scope.increase(); } if ($event.keyCode == downKey){ scope.decrease(); } }; } }; }]); })();
{ "content_hash": "abe7d8ec2f4e238c1138c12539707fd7", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 92, "avg_line_length": 36.717948717948715, "alnum_prop": 0.37011173184357543, "repo_name": "AanZee/directives", "id": "92a30bc07b1e14ec94c02b650b47f7470cc465c3", "size": "4296", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/input-stepper/input-stepper.directive.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "1783" }, { "name": "JavaScript", "bytes": "14689" } ], "symlink_target": "" }
currentMenu: getting_started --- # Getting started ## Installation Using [Composer](https://getcomposer.org/): ```bash composer require simple-bus/symfony-bridge ``` Now enable the [CommandBusBundle](command_bus_bundle.md), the [EventBusBundle](event_bus_bundle) and/or the [DoctrineORMBridgeBundle](doctrine_orm_bridge_bundle.md).
{ "content_hash": "11a93235898bfa27d3190617e87dcdb8", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 107, "avg_line_length": 22.466666666666665, "alnum_prop": 0.7626112759643917, "repo_name": "xabbuh/SymfonyBridge", "id": "162fe2df71f5d82e5305a7e84b428c7237e9f0bf", "size": "341", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/getting_started.md", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "34551" } ], "symlink_target": "" }
 #include <aws/application-autoscaling/model/DescribeScalingActivitiesRequest.h> #include <aws/core/utils/json/JsonSerializer.h> #include <utility> using namespace Aws::ApplicationAutoScaling::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; DescribeScalingActivitiesRequest::DescribeScalingActivitiesRequest() : m_serviceNamespace(ServiceNamespace::NOT_SET), m_serviceNamespaceHasBeenSet(false), m_resourceIdHasBeenSet(false), m_scalableDimension(ScalableDimension::NOT_SET), m_scalableDimensionHasBeenSet(false), m_maxResults(0), m_maxResultsHasBeenSet(false), m_nextTokenHasBeenSet(false) { } Aws::String DescribeScalingActivitiesRequest::SerializePayload() const { JsonValue payload; if(m_serviceNamespaceHasBeenSet) { payload.WithString("ServiceNamespace", ServiceNamespaceMapper::GetNameForServiceNamespace(m_serviceNamespace)); } if(m_resourceIdHasBeenSet) { payload.WithString("ResourceId", m_resourceId); } if(m_scalableDimensionHasBeenSet) { payload.WithString("ScalableDimension", ScalableDimensionMapper::GetNameForScalableDimension(m_scalableDimension)); } if(m_maxResultsHasBeenSet) { payload.WithInteger("MaxResults", m_maxResults); } if(m_nextTokenHasBeenSet) { payload.WithString("NextToken", m_nextToken); } return payload.WriteReadable(); } Aws::Http::HeaderValueCollection DescribeScalingActivitiesRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AnyScaleFrontendService.DescribeScalingActivities")); return headers; }
{ "content_hash": "8d695ae6cd75ce12b3f3f9f37e7e9395", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 118, "avg_line_length": 24.130434782608695, "alnum_prop": 0.772972972972973, "repo_name": "chiaming0914/awe-cpp-sdk", "id": "076d9f4e7f7e12623644a06b2d20667073dd6c1d", "size": "2238", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "aws-cpp-sdk-application-autoscaling/source/model/DescribeScalingActivitiesRequest.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "2313" }, { "name": "C++", "bytes": "98158533" }, { "name": "CMake", "bytes": "437471" }, { "name": "HTML", "bytes": "4471" }, { "name": "Java", "bytes": "239297" }, { "name": "Python", "bytes": "72827" }, { "name": "Shell", "bytes": "2803" } ], "symlink_target": "" }
require 'test_helper' class EventsControllerTest < ActionDispatch::IntegrationTest before do @user = create :user sign_in @user choose_line 'dc' end describe 'index method' do before do get events_path end it 'should return success' do assert_response :success end end end
{ "content_hash": "d244d55ff3dc1ccca2d50e854af8b1bf", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 60, "avg_line_length": 17.05263157894737, "alnum_prop": 0.6666666666666666, "repo_name": "lomky/dcaf_case_management", "id": "91e64407976dfa1449bd14826e5139178049a842", "size": "324", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "test/controllers/events_controller_test.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "13868" }, { "name": "CoffeeScript", "bytes": "2888" }, { "name": "Dockerfile", "bytes": "1280" }, { "name": "HTML", "bytes": "92675" }, { "name": "JavaScript", "bytes": "25090" }, { "name": "Ruby", "bytes": "450746" }, { "name": "Shell", "bytes": "227" } ], "symlink_target": "" }
import React from 'react'; import {render} from 'react-dom'; import {hot} from 'react-hot-loader'; import Root from './Root'; const App = hot(module)(Root); render( <App />, document.getElementById('content'), );
{ "content_hash": "15728cbbfd09bae925afa4139c832211", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 39, "avg_line_length": 18.666666666666668, "alnum_prop": 0.6607142857142857, "repo_name": "tomvej/redux-starter", "id": "94c017cb9d704dfcc1e73d75356724ca0433e512", "size": "224", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/index.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "160" }, { "name": "JavaScript", "bytes": "4038" } ], "symlink_target": "" }
module Kookie module PureFTPD class Interface < Sinatra::Base get '/' do log_lines = File.readlines(ENV['LOG_PATH']).reverse[0, ENV['TAIL_LINES'].to_i].to_a @logs = LogParser.new(log_lines).parse haml :index end post '/users/create' do begin User.create(params[:username], params[:password]) flash[:success] = "An account with username <strong>#{params[:username]}</strong> has been created." rescue Sequel::UniqueConstraintViolation flash[:error] = "An account with the username <strong>#{params[:username]}</strong> already exists." end redirect '/' end get '/users/destroy/:username' do User.where(:User => params[:username]).destroy flash[:info] = "The account with username <strong>#{params[:username]}</strong> has been destroyed." redirect '/' end helpers do def strip_path_and_username_from(path, username) path.sub!(/#{ENV['REMOVE_PATH_PREFIX']}?\/#{username}\//i, '') end def suggest_password(length = 8) SecureRandom.hex(length) end def bytes_to_human_size(bytes) if bytes <= 0 return '-' end (bytes / (1024 * 1024)).round(2).to_s + ' MB' end def minutes_in_words(timestamp) minutes = ((Time.now.to_i - timestamp) / 60).round return nil if minutes < 0 case minutes when 0..4 then '< 5 minutes' when 5..14 then '< 15 minutes' when 15..29 then '< 30 minutes' when 30..59 then '> 30 minutes' when 60..119 then '> 1 hour' when 120..239 then '> 2 hours' when 240..479 then '> 4 hours' when 480..719 then '> 8 hours' when 720..1439 then '> 12 hours' when 1440..11519 then '> ' << pluralize((minutes/1440).floor, 'day') when 11520..43199 then '> ' << pluralize((minutes/11520).floor, 'week') when 43200..525599 then '> ' << pluralize((minutes/43200).floor, 'month') else '> ' << pluralize((minutes/525600).floor, 'year') end end def pluralize(amount, string_to_pluralize) if amount > 1 "#{amount} #{string_to_pluralize}s" else "#{amount} #{string_to_pluralize}" end end end use Rack::Auth::Basic do |username, password| username == ENV['USERNAME'] && password == ENV['PASSWORD'] end use Rack::Deflater register Sinatra::Flash enable :sessions end end end
{ "content_hash": "9502662de9bdf4b9df6c550b76c3c5cb", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 110, "avg_line_length": 30.91111111111111, "alnum_prop": 0.5201294033069734, "repo_name": "MrTin/pure-ftpd_interface", "id": "b56fc06d740fb07905e32284fd7e63becb27a3ec", "size": "2782", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "kookie/pure_ftpd/interface.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "5310" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.0" language="de_DE"> <context> <name>EnttecWing</name> <message> <location filename="enttecwing.cpp" line="113"/> <source>This plugin provides input support for Enttec Playback and Enttec Shortcut Wings.</source> <translation>Dieses Plugin bietet Eingangsunterstützung für Enttec Playback und Enttec Shortcut Wings.</translation> </message> <message> <location filename="enttecwing.cpp" line="130"/> <source>Unable to bind to UDP port %1:</source> <translation>Kann nicht mit dem UDP-Port %1: verbinden:</translation> </message> <message> <location filename="enttecwing.cpp" line="137"/> <source>Listening to UDP port %1.</source> <translation>Höre auf UDP-Port %1.</translation> </message> </context> <context> <name>PlaybackWing</name> <message> <location filename="playbackwing.cpp" line="182"/> <source>at</source> <translation>bei</translation> </message> </context> <context> <name>ProgramWing</name> <message> <location filename="programwing.cpp" line="154"/> <source>at</source> <translation>bei</translation> </message> </context> <context> <name>ShortcutWing</name> <message> <location filename="shortcutwing.cpp" line="103"/> <source>at</source> <translation>bei</translation> </message> </context> <context> <name>Wing</name> <message> <location filename="wing.cpp" line="63"/> <source>Firmware version %1</source> <translation>Firmware Version %1</translation> </message> <message> <location filename="wing.cpp" line="65"/> <source>Device is operating correctly.</source> <translation>Gerät ist funktionsfähig.</translation> </message> </context> </TS>
{ "content_hash": "bf6d385ec38c552f80c8301fc00ec47d", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 124, "avg_line_length": 32.3728813559322, "alnum_prop": 0.6335078534031413, "repo_name": "bjlupo/rcva_qlcplus", "id": "3ee3740789e0c8a37c0257cb942f70068b0e4cc4", "size": "1915", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "plugins/enttecwing/src/ENTTEC_Wing_de_DE.ts", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "AppleScript", "bytes": "3195" }, { "name": "C", "bytes": "222020" }, { "name": "C++", "bytes": "5061417" }, { "name": "CSS", "bytes": "10931" }, { "name": "HTML", "bytes": "386710" }, { "name": "JavaScript", "bytes": "98342" }, { "name": "NSIS", "bytes": "10666" }, { "name": "Objective-C", "bytes": "17578" }, { "name": "Prolog", "bytes": "3407" }, { "name": "QMake", "bytes": "139542" }, { "name": "Ruby", "bytes": "14636" }, { "name": "Shell", "bytes": "26474" } ], "symlink_target": "" }
class OrganizationsController < ApplicationController load_and_authorize_resource :organization def index @organizations = Organization.all end def conferences @current = @organization.conferences.upcoming.reorder(start_date: :asc) @antiquated = @organization.conferences.past render '/conferences/index' end end
{ "content_hash": "ecd75f72703bf5749181f488dcff948e", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 75, "avg_line_length": 26.23076923076923, "alnum_prop": 0.7624633431085044, "repo_name": "kormoc/osem", "id": "2ebbdeeb608079c10e83ead9f7fbb58aaabb6da2", "size": "341", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/controllers/organizations_controller.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "18503" }, { "name": "HTML", "bytes": "343953" }, { "name": "JavaScript", "bytes": "25528" }, { "name": "Ruby", "bytes": "1184573" }, { "name": "Shell", "bytes": "5289" } ], "symlink_target": "" }
"""Pyclewn 付属の Simple class(simple.py) を Node.js debugger 対応にしたもの. """ import os import sys import traceback import threading import functools import queue from . import (misc, debugger) try: from collections import OrderedDict except ImportError: from .misc import OrderedDict from .nodeclient import NodeClient from .nodeutils import (obj_to_print, obj_to_properties, BreakPoints, Scripts) # set the logging methods (critical, error, warning, info, debug) = misc.logmethods('nodedbg') Unused = critical Unused = error Unused = warning Unused = debug # ブレイクポイントの管理 # Debugger クラスはデバッグ対象が起動するマイにインスタンスが作成されるので、 # グローバルにした(んだけどいいのか?) bps = BreakPoints() # list of key mappings, used to build the .pyclewn_keys.simple file # key : (mapping, comment) MAPKEYS = { 'C-B': ('break ${fname}:${lnum}', 'set breakpoint at current line'), 'C-E': ('clear ${fname}:${lnum}', 'clear breakpoint at current line'), 'C-P': ('print ${text}', 'print value of selection at mouse position'), 'C-Z': ('interrupt', 'interrupt the execution of the target'), 'S-C': ('continue',), 'S-Q': ('quit',), 'S-S': ('step',), 'S-X': ('foldvar ${lnum}', 'expand/collapse a watched variable'), } # list of the nodedbg commands mapped to vim user commands C<command> NODEDBG_CMDS = { 'break': None, # file name completion 'continue': (), 'disable': (), 'enable': (), #'interrupt': (), 'print': (), 'quit': (), 'step': (), 'stepin': (), 'stepout': (), # TODO: レスポンスの整形にまだ対応できてないのでコメントアウト # 'backtrace': (), 'attach': (), 'dettach': () } class NodeTarget(threading.Thread): """Node.js debugger target in another thread.""" def __init__(self, daemon): """Constructor.""" threading.Thread.__init__(self) self.daemon = daemon self.bp_dict = {} self.bp_que = queue.Queue() self.closed = False self.running = False # do not print on stdout when running unittests self.testrun = functools.reduce(lambda x, y: x or (y == 'unittest'), [False] + list(sys.modules.keys())) self._client = NodeClient(self.handle_resp) self._client.connect_start() def close(self): """Close the target.""" self._client.dbg_disconnect() self._client.close_when_done() self.closed = True def add_bp(self, bp_id, name, lnum): """Add breakpoint.""" k = name + ':' + str(lnum) if k in self.bp_dict: pass else: self.bp_dict[k] = -1 # 重複しての追加がないようにダミーのキーを登録 self._client.dbg_setbp(name, lnum) return True def delete_bp(self, name, lnum): """Delete breakpoint.""" k = name + ':' + str(lnum) if k in self.bp_dict: bp_id = self.bp_dict[k] del self.bp_dict[k] self._client.dbg_clearbp(bp_id) return True def update_bp(self, bp_id, enabled): """Update breakpoint.""" self._client.dbg_changebp(bp_id, not enabled) return True def run_continue(self): """Start or continue the debuggee.""" #if self.running: # return False self.running = True self._client.dbg_continue() return True def step(self): """Do a single step.""" #if self.running: # return False self._client.dbg_continue('next', 1) return True def stepin(self): """Do a single stepin.""" self._client.dbg_continue('in', 1) return True def stepout(self): """Do a single stepin.""" self._client.dbg_continue('out', 1) return True def backtrace(self): """Print a value.""" if self.running: return False self._client.dbg_backtrace() return True def print(self, args): """Print a value.""" #if self.running: # return False self._client.dbg_evaluate(args) return True def scripts(self): """get loaded scripts list.""" self._client.dbg_scripts() return True def lookup(self, handles): self._client.lookup(handles) return True def frame(self): """get selected frame.""" self._client.dbg_frame() return True def scope(self, scopeNumber): """get scope on selected frame.""" self._client.dbg_scope(scopeNumber) return True def __repr__(self): """Return the target representation.""" return "Target: {'running': %s, 'closed': %s}" % (self.running, self.closed) def run(self): """Run the target.""" self._client.loop() item = {} item['type'] = 'close' self.bp_que.put(item) self.running = False def handle_resp(self, data): """client(node.js の debugger) からのレスポンスを処理する. """ try: if data['type'] == 'event': if data['event'] == 'break': item = {} item['type'] = 'break' item['name'] = data['body']['script']['name'] item['lnum'] =data['body']['sourceLine'] + 1 self.running = False self.bp_que.put(item) if data['event'] == 'exception': item = {} item['type'] = 'break' item['name'] = data['body']['script']['name'] item['lnum'] =data['body']['sourceLine'] + 1 self.running = False self.bp_que.put(item) item = {} item['type'] = 'print' item['text'] = data['body']['exception']['text'] self.bp_que.put(item) elif data['type'] == 'response': if data['command'] == 'disconnect': item = {} item['type'] = 'close' self.bp_que.put(item) elif data['command'] == 'setbreakpoint': item = {} item['type'] = 'setbreakpoint' name = data['body']['script_name'] lnum = data['body']['actual_locations'][0]['line'] + 1 bp_id = data['body']['breakpoint'] item['name'] = name item['lnum'] = lnum item['bp_id'] = bp_id self.bp_que.put(item) # target 側でもid を保持しておく. self.bp_dict[name + ':' + str(lnum)] = bp_id elif data['command'] == 'backtrace': print(data['body']['frames'][0]) item = {} item['type'] = 'print' item['text'] = '\n' for i in data['body']['frames']: item['text'] = item['text'] + i['text'] + '\n' self.bp_que.put(item) elif data['command'] == 'evaluate': item = {} item['type'] = 'print' if data['success']: item['text'] = obj_to_print(data) else: item['text'] = data['message'] self.bp_que.put(item) elif data['command'] == 'scripts': item = {} item['type'] = 'scripts' item['body'] = data['body'] self.bp_que.put(item) elif data['command'] == 'lookup': if data['success']: for body in data['body']: item = {} item['type'] = 'properties' item['handle'] =data['body'][body]['handle'] item['properties'] = obj_to_properties(data, data['body'][body], item['handle']) self.bp_que.put(item) elif data['command'] == 'frame': item = {} item['type'] = 'frame' if data['success']: item['scopes'] = data['body']['scopes'] self.bp_que.put(item) for scope in data['body']['scopes']: self.scope(scope['index']) else: self.bp_que.put(item) elif data['command'] == 'scope': item = {} item['type'] = 'scope' if data['success']: item['body'] = data['body'] self.bp_que.put(item) except: #traceback.print_tb(sys.exc_info()[2]) item = {} item['type'] = 'print' item['text'] = '\nException in nodedbg(handle_resp)\n' item['text'] = item['text'] + '%s\n%s\n\n' % sys.exc_info()[:2] item['text'] = item['text'] + traceback.format_exc() self.bp_que.put(item) return class NodeVar: """ Node var class.""" def __init__(self): """Constructor.""" self.dirty = True self.scopes = [] self.scope_lookup = OrderedDict() self.prev_scopes = [] def scopes_equal(self, scopes): """ 指定された scopes が、保持している scopes と同じか? ただし、ここでは厳密には区別できない(する方法が不明)ので、 deep equal ではない. """ ret = True if len(self.scopes) != len(scopes): ret = False else: for scope in scopes: if self.scopes[scope['index']]['type'] != scope['type']: ret = False return ret def set_scopes(self, scopes): if self.scopes_equal(scopes): # 前回と同じ scopes の可能性が高いので、 # 退避しておく. self.prev_scopes = self.scopes else: # 前回と異なる scopes の可能性が高いので、 # 退避していた情報は破棄. self.prev_scopes = [] self.scope_lookup = OrderedDict() self.scopes = [0] * len(scopes); for scope in scopes: lbl = '' expanded = False if scope['type'] == 0: lbl = 'Global' elif scope['type'] == 1: lbl = 'Local' expanded = True elif scope['type'] == 2: lbl = 'With' elif scope['type'] == 3: lbl = 'Closure' expanded = True elif scope['type'] == 4: lbl = 'Catch' item = { 'type': scope['type'], 'lbl': lbl, 'expanded': expanded, 'standby': True, 'properties': [] } self.scopes[scope['index']] = item if len(self.prev_scopes): # 退避しておいた情報から、一部の情報を復元する. index = 0 for scope in self.scopes: scope['expanded'] = self.prev_scopes[index]['expanded'] index = index + 1 self.dirty = True return def restore_prev_scopes(self): """ 退避していた scopes を戻す. 本来必要ない処理だが、scope が存在しないエラーからのリカバリー用. """ self.scopes = self.prev_scopes return def move_properties_array_to_ordered_dict(self, array_p, dict_p): for prop in array_p: item = {'name': prop['name']} if not ('value' in prop['value']): item['expanded'] = False item['properties'] = [] item['value'] = prop['value'] dict_p[item['name']] = item return def properties_equal(self, p1, p2): """ properties の比較. 個数と、それぞれの name と value/type で比較.""" ret = True if len(p1) != len(p2): ret = False else: for p in p1: if not (p in p2): ret = False else: if p1[p]['value']['type'] != p2[p]['value']['type']: ret = False return ret def set_scope_props(self, index, properties): self.scopes[index]['properties'] = OrderedDict(); self.move_properties_array_to_ordered_dict(properties, \ self.scopes[index]['properties'] ) if len(self.prev_scopes) > index: if self.properties_equal( \ self.scopes[index]['properties'], \ self.prev_scopes[index]['properties'] ): # 前回と同じ properties(scope) の可能性が高いので、 # 部分的に情報を復元する. # なお、復元された情報は value が古いままなので、 # このメソッドの呼び出し元で、 # get_lookup_list メソッドから lookup すべき handle 一覧を取得し # 再度 lookup を行う必要がある. for p in self.scopes[index]['properties']: cur = self.scopes[index]['properties'][p] prev = self.prev_scopes[index]['properties'][p] if 'expanded' in prev: cur['expanded'] = prev['expanded'] cur['properties'] = prev['properties'] self.scopes[index]['standby'] = False; self.dirty = True return def get_lookup_list(self): """Objectの展開などで lookup していた handle のリスト取得.""" ret = [] # ref が変わっているので、index と name から再取得. prev_lookup = self.scope_lookup # 有効なプロパティのみで作り替えるようにしていたが、 # 取得順番やエラーなどで一時的に存在しな場合もあるので、 # 無駄が多いが(重複したキーができる)、追加という形態にする. #self.scope_lookup = {} for handle in prev_lookup: tgt = self.get_tgt_item_from_names( \ prev_lookup[handle]['index'], \ prev_lookup[handle]['name'] \ ) if 'value' in tgt: self.scope_lookup[tgt['value']['ref']] = {\ 'index': prev_lookup[handle]['index'], \ 'name': prev_lookup[handle]['name'] } ret.append(tgt['value']['ref']) return ret def set_properties_from_handle(self, handle, properties): """ handle から対応する対象を取得し、 properties(handle からlookupしたオブジェクトのもの)をセットする""" tgt = self.get_tgt_item_from_names( \ self.scope_lookup[handle]['index'],\ self.scope_lookup[handle]['name'] ) tgt['properties'] = OrderedDict() self.move_properties_array_to_ordered_dict(properties, \ tgt['properties'] ) # 前回に同じオブジェクトがあった場合、展開状態を反映させる. prev_tgt = self.get_tgt_item_from_names( \ self.scope_lookup[handle]['index'],\ self.scope_lookup[handle]['name'], 'prev_scopes' ) if 'properties' in prev_tgt: for prop in tgt['properties']: if prop in prev_tgt['properties']: if 'expanded' in prev_tgt['properties'][prop]: tgt['properties'][prop]['properties'] = \ prev_tgt['properties'][prop]['properties'] tgt['properties'][prop]['expanded'] = \ prev_tgt['properties'][prop]['expanded'] self.dirty = True return def is_standby(self): ret = False for scope in self.scopes: if scope['standby']: ret = True return ret def get_tgl_lbl(self, item): ret = ' ' if 'expanded' in item: if item['expanded']: ret = '[-]' else: ret = '[+]' return ret def get_value_lbl(self, item): ret = '' if 'value' in item['value']: ret = item['value']['value'] else: if 'className' in item['value']: ret = '<%s>' % (item['value']['className']) else: ret = '<%s>' % (item['value']['type']) return ret def scope_var_str(self, properties, prev_properties, depth): varstr = '' for name in properties: var = properties[name] prev_var = {'properties':{}, 'value': {'type':''}} if name in prev_properties: prev_var = prev_properties[name] name = var['name'] value = self.get_value_lbl(var) hilite = '=' if 'value' in var['value']: if 'value' in prev_var['value']: if var['value']['value'] != prev_var['value']['value']: hilite = '*' else: hilite = '*' else: if not 'value' in prev_var['value']: if var['value']['type'] != prev_var['value']['type']: hilite = '*' else: hilite = '*' tgl_lbl = self.get_tgl_lbl(var) varstr += ' ' * depth + '%s %s ={%s} %s\n' % (tgl_lbl, name, hilite, value) if 'expanded' in var and var['expanded']: varstr = varstr + \ self.scope_var_str( \ var['properties'], \ prev_var['properties'], \ depth + 1 \ ) return varstr def __str__(self): varstr = '' index = 0 for scope in self.scopes: prev_scope = {'properties':{}} if len(self.prev_scopes) > index: prev_scope = self.prev_scopes[index] tgl_lbl = self.get_tgl_lbl(scope) if tgl_lbl: varstr = varstr + '%s %s\n' % (tgl_lbl, scope['lbl']) if scope['expanded']: varstr = varstr + \ self.scope_var_str( \ scope['properties'], \ prev_scope['properties'], \ 1 \ ) index = index + 1 self.dirty = False return varstr def get_tgt_item_from_names(self, index, name, type='scopes'): ret = {} if type =='scopes': ret = self.scopes[index] else: if len(self.prev_scopes) > index: ret = self.prev_scopes[index] for n in name: if'properties' in ret and n in ret['properties']: ret = ret['properties'][n] else: ret = {} break return ret def get_properties_lines(self, index, properties, pnames): lines = [] for name in properties: var = properties[name] line = { 'name': pnames + [var['name']], 'index': index } if 'expanded' in var: line['expanded'] = var['expanded'] lines.append(line) if 'expanded' in var and var['expanded']: rlines = self.get_properties_lines(index, var['properties'], \ line['name']) lines.extend(rlines) return lines def foldvar(self, lnum): ret = -1 lines = [] index = 0 for scope in self.scopes: line = { 'root': True, 'index': index } line['expanded'] = scope['expanded'] lines.append(line) if scope['expanded']: lines.extend(self.get_properties_lines(index, scope['properties'], [])) index = index + 1 line = lines[lnum-1] if 'root' in line: self.scopes[line['index']]['expanded'] = \ not self.scopes[line['index']]['expanded'] else: tgt = self.get_tgt_item_from_names(line['index'], line['name']) if 'expanded' in tgt: tgt['expanded'] = not tgt['expanded'] ret = tgt['value']['ref'] self.scope_lookup[ret] = { 'index': line['index'], 'name': line['name'] } return ret class NodeDbg(debugger.Debugger): def __init__(self, *args): """Constructor.""" debugger.Debugger.__init__(self, *args) self.pyclewn_cmds.update( { 'dbgvar': (), # 'delvar': (), 'sigint': (), 'symcompletion': (), }) self.cmds.update(NODEDBG_CMDS) self.mapkeys.update(MAPKEYS) self.bp_id = 0 self._bp_resp = {} self._bpgo_que =queue.Queue() self._scripts = Scripts() self.inferior = None self.varobj = NodeVar() def start(self): """Start the debugger.""" self.console_print('\n') self.print_prompt() # start the node.js debuggee if self.inferior is None: self.inferior = NodeTarget(self.options.daemon) self.inferior.start() self.inferior.scripts() self.timer(self.myjob, debugger.LOOP_TIMEOUT) def close(self): """Close the debugger.""" debugger.Debugger.close(self) # close the debuggee if self.inferior is not None: self.inferior.close() self.inferior = None def remove_all(self): debugger.Debugger.remove_all(self) self.bp_id = 0 # bps.remove_all() self._bp_resp = {} def move_frame(self, show): """Show the frame sign or hide it when show is False. The frame sign is displayed from the first line (lnum 1), to the first enabled breakpoint in the stepping buffer. """ self.inferior.frame(); if show: script_name = self._bp_resp['name'] if script_name is not None: if os.path.isabs(script_name): self.show_frame(self._bp_resp['name'], \ self._bp_resp['lnum']) else: self.console_print('Break in '+ script_name +'.\n') else: # hide frame self.show_frame() def myjob(self): if self.inferior is not None: bp_que = self.inferior.bp_que while not bp_que.empty(): item = bp_que.get() if item['type'] == 'close': self.console_print('Node.js debugger connection closed.\n') self.print_prompt() self.move_frame(False) self.inferior = None bps.standby_all() self.remove_all() self.closed = True elif item['type'] == 'setbreakpoint': self.add_bp(item['bp_id'], item['name'], item['lnum']) bps.add(item['bp_id'], item['name'], str(item['lnum'])) self.console_print('Breakpoint %d at file %s, line %d.\n' % \ (item['bp_id'], item['name'], item['lnum'])) elif item['type'] == 'break': self._bp_resp = item self.move_frame(True) elif item['type'] == 'print': self.console_print(item['text'] + '\n') self.print_prompt() elif item['type'] == 'properties': self.varobj.set_properties_from_handle(item['handle'], item['properties']) if self.varobj.is_standby() == False: self.update_dbgvarbuf(self.varobj.__str__, self.varobj.dirty) elif item['type'] == 'frame': if 'scopes' in item: self.varobj.set_scopes(item['scopes']) else: # FIXME: frame が存在しない'No framse)というエラーの対応. # エラーが発生しないようにできないか? self.inferior.frame(); elif item['type'] == 'scope': if 'body' in item: self.varobj.set_scope_props(item['body']['index'], \ item['body']['object']['properties']); if self.varobj.is_standby() == False: handles = self.varobj.get_lookup_list() self.inferior.lookup(handles) self.update_dbgvarbuf(self.varobj.__str__, self.varobj.dirty) else: # FIXME: scope が存在しないというエラー対応. # frame コマンドから取得した scope なので存在しないとい # うことはないと思うのだが、タイミング依存でなにかあるの # か? self.varobj.restore_prev_scopes() self.inferior.frame(); elif item['type'] == 'scripts': self._scripts.set_scripts(item['body']) bplist = bps.get_standby_bps(self._scripts) if len(bplist) > 0: for bp in bplist: bps.clear_standby(bp['name'], bp['lnum']) self.inferior.add_bp(bp['bp_id'], bp['name'], bp['lnum']) else: while not self._bpgo_que.empty(): fn = self._bpgo_que.get() fn() self._bpgo_que.task_done() bp_que.task_done() if self.closed == False: self.inferior.scripts() self.timer(self.myjob, debugger.LOOP_TIMEOUT + 0.1) #----------------------------------------------------------------------- # commands #----------------------------------------------------------------------- def pre_cmd(self, cmd, args): """The method called before each invocation of a 'cmd_xxx' method.""" if args: cmd = '%s %s' % (cmd, args) self.console_print('%s\n', cmd) # turn off all hilited variables def post_cmd(self, cmd, args): """The method called after each invocation of a 'cmd_xxx' method.""" unused = cmd unused = args # to preserve window order appearance, all the writing to the # console must be done before starting to handle the (clewn)_dbgvar # buffer when processing Cdbgvar # update the vim debugger variable buffer with the variables values #self.inferior.frame(); #self.update_dbgvarbuf(self.varobj.__str__, True) def default_cmd_processing(self, cmd, args): """Process any command whose cmd_xxx method does not exist.""" unused = cmd unused = args self.console_print('Command ignored.\n') self.print_prompt() def cmd_attach(self, cmd, args): """ Attach to Node.js debugger.""" unused = cmd if self.inferior is None: self.inferior = NodeTarget(self.options.daemon) self.inferior.start() else: self.console_print('The inferior progam was attached.\n') self.print_prompt() def cmd_dettach(self, cmd, args): """ Dettach from Node.js debugger.""" unused = cmd if self.inferior is None: self.console_print('The inferior progam was not attached.\n') else: self.inferior.close() self.print_prompt() def cmd_break(self, cmd, args): """Set a breakpoint at a specified line. The required argument of the vim user command is 'fname:lnum'. """ unused = cmd name, lnum = debugger.name_lnum(args) if name: self.bp_id += 1 # 実際の位置はセットしてみないとわからないので、 # ここでは追加の設定のみ行い、 # アノテーションはレスポンスを受け取ったときにセットする. # TODO: ロードされてないスクリプトの場合は、 # 実際にロードされるまでレスポンスがないので、 # アノテーションは表示されないので、なにか対応を. bps.add_standby(self.bp_id, name, lnum) self.inferior.scripts() else: self.console_print('Invalid arguments.\n') self.print_prompt() def cmd_clear(self, cmd, args): """ Clear breakpoint at a specified line. The required argument of the vim user command is 'fname:lnum'. """ unused = cmd result = 'Invalid arguments.\n' name, lnum = debugger.name_lnum(args) if name: bp_id = bps.get_bp_id(name, lnum) if bp_id is not None: bps.remove(name, lnum) self.delete_bp(bp_id) self.inferior.delete_bp(name, lnum) result = 'Clear Breakpoint %d at file %s, line %d.\n' % \ (bp_id, name, lnum) self.console_print(result) self.print_prompt() def set_bpstate(self, cmd, args, enable): """Change the state of one breakpoint.""" unused = cmd args = args.split() result = 'Invalid arguments.\n' # accept only one argument, for now if len(args) == 1: result = '"%s" not found.\n' % args[0] name, lnum = bps.get_name_lnum(args[0]) if name is not None: self.update_bp(args[0], not enable) self.inferior.update_bp(args[0], not enable) result = '' self.console_print(result) self.print_prompt() def cmd_disable(self, cmd, args): """Disable one breakpoint. The required argument of the vim user command is the breakpoint number. """ self.set_bpstate(cmd, args, False) def cmd_enable(self, cmd, args): """Enable one breakpoint. The required argument of the vim user command is the breakpoint number. """ self.set_bpstate(cmd, args, True) def cmd_step(self, *args): """Step program until it reaches a different source line.""" unused = args assert self.inferior is not None self.inferior.step() self.print_prompt() def cmd_stepin(self, *args): """Step into function.""" unused = args assert self.inferior is not None self.inferior.stepin() self.print_prompt() def cmd_stepout(self, *args): """Step out current function.""" unused = args assert self.inferior is not None self.inferior.stepout() self.print_prompt() def cmd_continue(self, *args): """Continue the program being debugged, also used to start the program.""" unused = args assert self.inferior is not None #if not self.inferior.run_continue(): # self.console_print('The inferior progam is running.\n') self._bpgo_que.put(self.inferior.run_continue) self.inferior.scripts() self.print_prompt() self.move_frame(False) def cmd_backtrace(self, *args): """Print backtrace.""" unused = args assert self.inferior is not None self.inferior.backtrace() self.print_prompt() def cmd_print(self, cmd, args): """Print a value.""" unused = cmd if args: self.inferior.print(args) else: self.console_print('Invalid arguments.\n') self.print_prompt() def cmd_foldvar(self, cmd, args): """Collapse/expand a variable from the debugger variable buffer.""" unused = cmd args = args.split() if len(args) != 1: self.console_print('Invalid arguments.') else: try: lnum = int(args[0]) ref = self.varobj.foldvar(lnum) if ref < 0: self.update_dbgvarbuf(self.varobj.__str__, True) else: self.inferior.lookup([ref]) except ValueError: self.console_print('Not a line number.') def cmd_quit(self, *args): """Quit the current nodedbg session.""" unused = args if self.inferior is not None: self.close() self.console_print('Netbeans connection closed.\n') self.console_flush() self.print_prompt() self.netbeans_detach() def cmd_sigint(self, *args): """Send a <C-C> character to the debugger (not implemented).""" unused = self unused = args self.console_print('Not implemented.\n') self.print_prompt() def cmd_symcompletion(self, *args): """Populate the break and clear commands with symbols completion (not implemented).""" unused = self unused = args self.console_print('Not implemented.\n') self.print_prompt()
{ "content_hash": "64b5cc25d3249d5b267accdb3d74815c", "timestamp": "", "source": "github", "line_count": 1019, "max_line_length": 94, "avg_line_length": 32.77526987242395, "alnum_prop": 0.4685310497634589, "repo_name": "hankei6km/pyclewn-nodedbg", "id": "f1efb73c67d65eb5d4c66b5073a91ebebeda14f7", "size": "35807", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clewn/nodedbg.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "48689" } ], "symlink_target": "" }
<!-- Copyright 2019 the original author or authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- Some generic Schematron stuff for PDQv3 and XCPD. @author Dmytro Rud --> <sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron"> <sch:ns uri="http://www.w3.org/2001/XMLSchema-instance" prefix="xsi" /> <sch:ns uri="urn:hl7-org:v3" prefix="hl7" /> <sch:pattern abstract="true" id="check-type"> <sch:rule context="$element"> <sch:assert test="not(.) or (resolve-QName(@xsi:type, .) = QName('urn:hl7-org:v3', '$type'))"> sub-element 'value' is constrained to data type $type </sch:assert> </sch:rule> </sch:pattern> </sch:schema>
{ "content_hash": "b2fd25d35bf47237a61e9c14b740991a", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 106, "avg_line_length": 43.75, "alnum_prop": 0.6718367346938775, "repo_name": "oehf/ipf", "id": "5ff7eed27a31b8c543ef624e4abf5add929189c1", "size": "1225", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "commons/ihe/hl7v3/src/main/resources/schematron/generic.sch.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "2381" }, { "name": "Groovy", "bytes": "1232218" }, { "name": "HTML", "bytes": "11417" }, { "name": "Java", "bytes": "6734450" }, { "name": "Kotlin", "bytes": "87953" }, { "name": "Shell", "bytes": "553" }, { "name": "XQuery", "bytes": "15044" }, { "name": "XSLT", "bytes": "567639" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.opengamma.strata</groupId> <artifactId>strata-parent</artifactId> <version>0.8.0-SNAPSHOT</version> <relativePath>..</relativePath> </parent> <artifactId>strata-source</artifactId> <packaging>jar</packaging> <name>Strata-Source</name> <description>Source, entity identifiers and links</description> <!-- ==================================================================== --> <dependencies> <!-- OpenGamma --> <dependency> <groupId>com.opengamma.strata</groupId> <artifactId>strata-collect</artifactId> </dependency> <!-- Third Party --> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> </dependency> <dependency> <groupId>org.joda</groupId> <artifactId>joda-beans</artifactId> </dependency> <dependency> <groupId>org.joda</groupId> <artifactId>joda-convert</artifactId> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </dependency> <!-- Testing --> <dependency> <groupId>com.opengamma.strata</groupId> <artifactId>strata-collect</artifactId> <type>test-jar</type> <scope>test</scope> </dependency> </dependencies> <!-- ==================================================================== --> <properties> <!-- Properties for maven-javadoc-plugin --> <windowtitle>OpenGamma Strata Source</windowtitle> <doctitle><![CDATA[<h1>OpenGamma Strata Source API</h1>]]></doctitle> </properties> </project>
{ "content_hash": "297ee471d78be7993064f0cc9bdba516", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 100, "avg_line_length": 32, "alnum_prop": 0.600635593220339, "repo_name": "nssales/Strata", "id": "43d7bc1411763eceedd9b941a8bd00de84299ad5", "size": "1888", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "modules/source/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "11428522" } ], "symlink_target": "" }
package com.amazonaws.services.importexport.model; import javax.annotation.Generated; /** * The JOBID was missing, not found, or not associated with the AWS account. */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class InvalidJobIdException extends com.amazonaws.services.importexport.model.AmazonImportExportException { private static final long serialVersionUID = 1L; /** * Constructs a new InvalidJobIdException with the specified error message. * * @param message * Describes the error encountered. */ public InvalidJobIdException(String message) { super(message); } }
{ "content_hash": "269c0494fbfb16f6a6a5aa0515e3f7aa", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 114, "avg_line_length": 28.47826086956522, "alnum_prop": 0.7236641221374046, "repo_name": "aws/aws-sdk-java", "id": "e3bf687d7c22f69b35bbbbb86bf32f96eb6dcec2", "size": "1235", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-java-sdk-importexport/src/main/java/com/amazonaws/services/importexport/model/InvalidJobIdException.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package org.artifactory.addon.plugin; import java.util.HashMap; import java.util.Map; public class ResponseCtx extends ResourceStreamCtx { public final static int UNSET_STATUS = -1; private int status = UNSET_STATUS; private String message; private Map<String, String> headers = new HashMap<>(); public int getStatus() { return status; } public String getMessage() { return message; } public Map<String, String> getHeaders() { return headers; } public void setStatus(int status) { this.status = status; } public void setMessage(String message) { this.message = message; } public void setHeaders(Map<String, String> headers) { this.headers = headers; } }
{ "content_hash": "f46b17025186cc47d8727943f3fd1929", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 58, "avg_line_length": 19.45, "alnum_prop": 0.6401028277634961, "repo_name": "alancnet/artifactory", "id": "3b81a31bb80f3698c6f1250e8fec1ea7ea0d6c24", "size": "1533", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "base/common/src/main/java/org/artifactory/addon/plugin/ResponseCtx.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "5927" }, { "name": "CSS", "bytes": "1527354" }, { "name": "Groovy", "bytes": "14386" }, { "name": "HTML", "bytes": "844850" }, { "name": "Java", "bytes": "13075494" }, { "name": "JavaScript", "bytes": "3810535" }, { "name": "Shell", "bytes": "42908" } ], "symlink_target": "" }