text
stringlengths
2
1.04M
meta
dict
namespace Azure.ResourceManager.KeyVault.Models { /// <summary> The create mode to indicate whether the resource is being created or is being recovered from a deleted resource. </summary> public enum ManagedHsmCreateMode { /// <summary> Create a new managed HSM pool. This is the default option. </summary> Default, /// <summary> Recover the managed HSM pool from a soft-deleted resource. </summary> Recover } }
{ "content_hash": "25cd03ee54bd7da4d77a83ffcb232803", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 141, "avg_line_length": 41.81818181818182, "alnum_prop": 0.6869565217391305, "repo_name": "Azure/azure-sdk-for-net", "id": "3796ebe6c48f48a523781b86ec594771ad6003b1", "size": "598", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmCreateMode.cs", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
using System; using System.Collections.Generic; using System.IO; using System.Threading.Tasks; namespace MimeDetective { public static partial class FileInfoExtensions { /// <summary> /// Read header of a file and depending on the information in the header /// return object FileType. /// Return null in case when the file type is not identified. /// Throws Application exception if the file can not be read or does not exist /// </summary> /// <param name="file">The FileInfo object.</param> /// <returns>FileType or null (for no match)</returns> public static FileType GetFileType(this FileInfo file) { using (ReadResult readResult = ReadResult.ReadFileHeader(file)) { return MimeAnalyzers.GetFileType(in readResult); } } /// <summary> /// Read header of a file and depending on the information in the header /// return object FileType. /// Return null in case when the file type is not identified. /// Throws Application exception if the file can not be read or does not exist /// </summary> /// <param name="file">The FileInfo object.</param> /// <returns>FileType or null (for no match)</returns> public static async Task<FileType> GetFileTypeAsync(this FileInfo file) { using (ReadResult readResult = await ReadResult.ReadFileHeaderAsync(file)) { return MimeAnalyzers.GetFileType(in readResult); } } /// <summary> /// Determines whether provided file belongs to one of the provided list of files /// </summary> /// <param name="file">The file.</param> /// <param name="requiredTypes">The required types.</param> /// <returns> /// <c>true</c> if file of the one of the provided types; otherwise, <c>false</c>. /// </returns> public static bool IsFileOfTypes(this FileInfo file, List<FileType> requiredTypes) { FileType currentType = file.GetFileType(); //TODO Write a test to check if this null check is correct if (currentType.Mime == null) return false; return requiredTypes.Contains(currentType); } /// <summary> /// Determines whether provided file belongs to one of the provided list of files, /// where list of files provided by string with Comma-Separated-Values of extensions /// </summary> /// <param name="file">The file.</param> /// <param name="requiredTypes">The required types.</param> /// <returns> /// <c>true</c> if file of the one of the provided types; otherwise, <c>false</c>. /// </returns> public static bool IsFileOfTypes(this FileInfo file, String CSV) { List<FileType> providedTypes = MimeTypes.GetFileTypesByExtensions(CSV); return file.IsFileOfTypes(providedTypes); } /// <summary> /// Determines whether the specified file is of provided type /// </summary> /// <param name="file">The file.</param> /// <param name="type">The FileType</param> /// <returns> /// <c>true</c> if the specified file is type; otherwise, <c>false</c>. /// </returns> public static bool IsType(this FileInfo file, FileType type) { FileType actualType = GetFileType(file); //TODO Write a test to check if this null check is correct if (actualType.Mime is null) return false; return (actualType.Equals(type)); } /// <summary> /// Checks if the file is executable file .exe /// </summary> /// <param name="fileInfo"></param> /// <returns> /// <c>true</c> if the specified file is type; otherwise, <c>false</c>. /// </returns> public static bool IsExe(this FileInfo fileInfo) => fileInfo.IsType(MimeTypes.DLL_EXE); /// <summary> /// Check if the file is Microsoft Installer. /// Beware, many Microsoft file types are starting with the same header. /// So use this one with caution. If you think the file is MSI, just need to confirm, use this method. /// But it could be MSWord or MSExcel, or Powerpoint... /// </summary> /// <param name="fileInfo"></param> /// <returns> /// <c>true</c> if the specified file is type; otherwise, <c>false</c>. /// </returns> public static bool IsMsi(this FileInfo fileInfo) { // MSI has a generic DOCFILE header. Also it matches PPT files return fileInfo.IsType(MimeTypes.PPT) || fileInfo.IsType(MimeTypes.MS_OFFICE); } } }
{ "content_hash": "37426691729761261c126e12829c57c0", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 110, "avg_line_length": 40.47933884297521, "alnum_prop": 0.5867701102490812, "repo_name": "clarkis117/Mime-Detective", "id": "8c16aa2884763e0c9e10d9e8f864c0cb0f7ad425", "size": "4900", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Mime-Detective/Extensions/FileInfo/FileInfoExtensions.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "152306" }, { "name": "PowerShell", "bytes": "1758" }, { "name": "Shell", "bytes": "348" } ], "symlink_target": "" }
package com.amazonaws.services.waf.model.waf_regional.transform; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.services.waf.model.*; import com.amazonaws.protocol.*; import com.amazonaws.annotation.SdkInternalApi; /** * ListLoggingConfigurationsRequestMarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class ListLoggingConfigurationsRequestMarshaller { private static final MarshallingInfo<String> NEXTMARKER_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("NextMarker").build(); private static final MarshallingInfo<Integer> LIMIT_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("Limit").build(); private static final ListLoggingConfigurationsRequestMarshaller instance = new ListLoggingConfigurationsRequestMarshaller(); public static ListLoggingConfigurationsRequestMarshaller getInstance() { return instance; } /** * Marshall the given parameter object. */ public void marshall(ListLoggingConfigurationsRequest listLoggingConfigurationsRequest, ProtocolMarshaller protocolMarshaller) { if (listLoggingConfigurationsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(listLoggingConfigurationsRequest.getNextMarker(), NEXTMARKER_BINDING); protocolMarshaller.marshall(listLoggingConfigurationsRequest.getLimit(), LIMIT_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
{ "content_hash": "076f0c72ede41af003701e56a70ebdf0", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 157, "avg_line_length": 39.340425531914896, "alnum_prop": 0.7577068685776095, "repo_name": "aws/aws-sdk-java", "id": "9173b0ee288d4c4af553c07b85693efde4d32ad0", "size": "2429", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-java-sdk-waf/src/main/java/com/amazonaws/services/waf/model/waf_regional/transform/ListLoggingConfigurationsRequestMarshaller.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <head> <title>PHPXRef 0.7.1 : Unnamed Project : Function Reference: _uri_string()</title> <link rel="stylesheet" href="../sample.css" type="text/css"> <link rel="stylesheet" href="../sample-print.css" type="text/css" media="print"> <style id="hilight" type="text/css"></style> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> </head> <body bgcolor="#ffffff" text="#000000" link="#801800" vlink="#300540" alink="#ffffff"> <table class="pagetitle" width="100%"> <tr> <td valign="top" class="pagetitle"> [ <a href="../index.html">Index</a> ] </td> <td align="right" class="pagetitle"> <h2 style="margin-bottom: 0px">PHP Cross Reference of Unnamed Project</h2> </td> </tr> </table> <!-- Generated by PHPXref 0.7.1 at Thu Oct 23 19:31:09 2014 --> <!-- PHPXref (c) 2000-2010 Gareth Watts - gareth@omnipotent.net --> <!-- http://phpxref.sourceforge.net/ --> <script src="../phpxref.js" type="text/javascript"></script> <script language="JavaScript" type="text/javascript"> <!-- ext='.html'; relbase='../'; subdir='_functions'; filename='index.html'; cookiekey='phpxref'; handleNavFrame(relbase, subdir, filename); logFunction('_uri_string'); // --> </script> <script language="JavaScript" type="text/javascript"> if (gwGetCookie('xrefnav')=='off') document.write('<p class="navlinks">[ <a href="javascript:navOn()">Show Explorer<\/a> ]<\/p>'); else document.write('<p class="navlinks">[ <a href="javascript:navOff()">Hide Explorer<\/a> ]<\/p>'); </script> <noscript> <p class="navlinks"> [ <a href="../nav.html" target="_top">Show Explorer</a> ] [ <a href="index.html" target="_top">Hide Navbar</a> ] </p> </noscript> [<a href="../index.html">Top level directory</a>]<br> <script language="JavaScript" type="text/javascript"> <!-- document.writeln('<table align="right" class="searchbox-link"><tr><td><a class="searchbox-link" href="javascript:void(0)" onMouseOver="showSearchBox()">Search</a><br>'); document.writeln('<table border="0" cellspacing="0" cellpadding="0" class="searchbox" id="searchbox">'); document.writeln('<tr><td class="searchbox-title">'); document.writeln('<a class="searchbox-title" href="javascript:showSearchPopup()">Search History +</a>'); document.writeln('<\/td><\/tr>'); document.writeln('<tr><td class="searchbox-body" id="searchbox-body">'); document.writeln('<form name="search" style="margin:0px; padding:0px" onSubmit=\'return jump()\'>'); document.writeln('<a class="searchbox-body" href="../_classes/index.html">Class<\/a>: '); document.writeln('<input type="text" size=10 value="" name="classname"><br>'); document.writeln('<a id="funcsearchlink" class="searchbox-body" href="../_functions/index.html">Function<\/a>: '); document.writeln('<input type="text" size=10 value="" name="funcname"><br>'); document.writeln('<a class="searchbox-body" href="../_variables/index.html">Variable<\/a>: '); document.writeln('<input type="text" size=10 value="" name="varname"><br>'); document.writeln('<a class="searchbox-body" href="../_constants/index.html">Constant<\/a>: '); document.writeln('<input type="text" size=10 value="" name="constname"><br>'); document.writeln('<a class="searchbox-body" href="../_tables/index.html">Table<\/a>: '); document.writeln('<input type="text" size=10 value="" name="tablename"><br>'); document.writeln('<input type="submit" class="searchbox-button" value="Search">'); document.writeln('<\/form>'); document.writeln('<\/td><\/tr><\/table>'); document.writeln('<\/td><\/tr><\/table>'); // --> </script> <div id="search-popup" class="searchpopup"><p id="searchpopup-title" class="searchpopup-title">title</p><div id="searchpopup-body" class="searchpopup-body">Body</div><p class="searchpopup-close"><a href="javascript:gwCloseActive()">[close]</a></p></div> <h3>Function and Method Cross Reference</h3> <h2><a href="index.html#_uri_string">_uri_string()</a></h2> <b>Defined at:</b><ul> <li><a href="../system/core/Config.php.html#_uri_string">/system/core/Config.php</a> -> <a onClick="logFunction('_uri_string', '/system/core/Config.php.source.html#l287')" href="../system/core/Config.php.source.html#l287"> line 287</a></li> </ul> <b>Referenced 3 times:</b><ul> <li><a href="../system/core/Config.php.html">/system/core/Config.php</a> -> <a href="../system/core/Config.php.source.html#l262"> line 262</a></li> <li><a href="../system/core/Config.php.html">/system/core/Config.php</a> -> <a href="../system/core/Config.php.source.html#l266"> line 266</a></li> <li><a href="../system/core/Config.php.html">/system/core/Config.php</a> -> <a href="../system/core/Config.php.source.html#l282"> line 282</a></li> </ul> <!-- A link to the phpxref site in your customized footer file is appreciated ;-) --> <br><hr> <table width="100%"> <tr><td>Generated: Thu Oct 23 19:31:09 2014</td> <td align="right"><i>Cross-referenced by <a href="http://phpxref.sourceforge.net/">PHPXref 0.7.1</a></i></td> </tr> </table> </body></html>
{ "content_hash": "e8e8be080b9da81c14f39c00cab3532a", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 253, "avg_line_length": 52.03061224489796, "alnum_prop": 0.664444008629143, "repo_name": "inputx/code-ref-doc", "id": "c9ebcf31d497135360c9b3db5f23e244057717b8", "size": "5099", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "codeigniter/_functions/_uri_string.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "17952" }, { "name": "JavaScript", "bytes": "255489" } ], "symlink_target": "" }
package companyA; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement( name = "emergencyContact") public class EmergencyContact { private String contactName; private String relation; private String emergencyPhoneNumber; /* no-args constructor */ public EmergencyContact() { } public EmergencyContact(String contactName, String relation, String emergencyPhoneNumber) { this.contactName = contactName; this.relation = relation; this.emergencyPhoneNumber = emergencyPhoneNumber; } @XmlElement public String getContactName() { return contactName; } @XmlElement public String getRelation() { return relation; } @XmlElement public String getEmergencyPhoneNumber() { return emergencyPhoneNumber; } private void setContactName(String name) { this.contactName = contactName; } private void setRelation(String relation) { this.relation = relation; } private void setEmergencyPhoneNumber(String phoneNumber) { this.emergencyPhoneNumber = emergencyPhoneNumber; } /* Utility method will accept emergencyContact as string along with a delimiter and populate an EmergencyContact accordingly. buildEmergencyContact("This Contact Name;Relationship;Contact Phone number", ";"); */ public EmergencyContact buildEmergencyContact(String emergencyContact, String delimiter) { String[] parts = emergencyContact.split(delimiter); EmergencyContact ec = new EmergencyContact(); if (parts.length == 3) { ec.setContactName(parts[0]); ec.setRelation(parts[1]); ec.setEmergencyPhoneNumber(parts[2]); } return ec; } @Override public String toString() { return "{ " + "contactName : " + contactName + ", relation : " + relation + ", emergencyPhoneNumber : " + emergencyPhoneNumber + " }"; } }
{ "content_hash": "0cfe98d6cd50b3f9f730ce88207267e8", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 126, "avg_line_length": 22.9875, "alnum_prop": 0.7400761283306144, "repo_name": "ethom7/TeamPrimrose", "id": "bf9c9d56c99ef834c46d8ecea840b70feefab4c9", "size": "1839", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "adminTool/src/main/java/companyA/EmergencyContact.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "6472" }, { "name": "HTML", "bytes": "109884" }, { "name": "Java", "bytes": "211445" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "f9121f6e358fe9d85a682408e8a2b3c6", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "8c1a671ee6f48026053b61a377ef2f1936735c4e", "size": "187", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Malpighiales/Euphorbiaceae/Euphorbia/Euphorbia serrata/ Syn. Tithymalus denticulatus/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
import urllib2 from t import T class P(T): def __init__(self): T.__init__(self) def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''): timeout=3 target_url = 'http://'+ip+':'+port result = {} result['result']=False vul_url = target_url + '/status?full=true' res=None try: res=urllib2.urlopen(vul_url,timeout=timeout) res_html = res.read() except: return result finally: if res is not None: res.close() if "Max processing time" in res_html: info = vul_url + " Jboss Information Disclosure" result['result']=True result['VerifyInfo'] = {} result['VerifyInfo']['type']='Jboss Information Disclosure' result['VerifyInfo']['URL'] =target_url result['VerifyInfo']['payload']=vul_url result['VerifyInfo']['result'] =info return result if __name__ == '__main__': print P().verify(ip='1.202.164.105',port='8080')
{ "content_hash": "ebd56274b5b4646f0cc6d102f7ebbf1f", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 93, "avg_line_length": 28.047619047619047, "alnum_prop": 0.48811544991511036, "repo_name": "nanshihui/PocCollect", "id": "2db5c4fa0f08238fcb5463feb5f1e2ecad410541", "size": "1193", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "middileware/jboss/jboss_info.py", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "630" }, { "name": "Python", "bytes": "245210" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "2f93d531cf7b3d2d3799aa65d578e033", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "7300357dfd46b11557510b60b669db5228d23a3d", "size": "183", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Eriachne/Eriachne mucronata/Eriachne mucronata mucronata/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
Todo App == [![Build Status](https://travis-ci.org/golmansax/todo-app-with-chk.svg?branch=master)](https://travis-ci.org/golmansax/todo-app-with-chk) A simple Todo app built with Rails and React. TODO: * create backend models * test coverage
{ "content_hash": "aed8626f9ec31c6f1ec7e12d0aec7994", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 137, "avg_line_length": 24.5, "alnum_prop": 0.7428571428571429, "repo_name": "golmansax/todo-app-with-chk", "id": "8f6f6939f9cbbad886be965c99c1f743849b2905", "size": "245", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "257" }, { "name": "HTML", "bytes": "4887" }, { "name": "JavaScript", "bytes": "5609" }, { "name": "Ruby", "bytes": "24588" } ], "symlink_target": "" }
package org.trello4j.model; import java.util.Date; /** * Model that represents a user action @ Trello. * <p/> * Example json: * <p/> * <code> * { * "id":"4f7f3809301cb98a5346bb50", * "idMemberCreator":"4f7d84acffdbe931585331bd", * "data":{ * "text":"Adn can you make the checklists appear in the order I want and not in alphabetical order...", * "board":{ * "name":"Trello Development", * "id":"4d5ea62fd76aa1136000000c" * }, * "card":{ * "name":"Assign people and due dates to specific checklist items.", * "id":"4f455a15dfe503f23316557f" * } * }, * "type":"commentCard", * "date":"2012-04-06T18:38:01.791Z", * "memberCreator":{ * "id":"4f7d84acffdbe931585331bd", * "username":"foobar", * "fullName":"Foo Bar", * "initials":"FB" * } * } * </code> * * @author joel */ public class Action extends TrelloObject { private String idMemberCreator; private String type; private Date date; private Member memberCreator; private Data data; public String getIdMemberCreator() { return idMemberCreator; } public void setIdMemberCreator(String idMemberCreator) { this.idMemberCreator = idMemberCreator; } public String getType() { return type; } public void setType(String type) { this.type = type; } public Date getDate() { return date; } public void setDate(Date date) { this.date = date; } public Member getMemberCreator() { return memberCreator; } public void setMemberCreator(Member memberCreator) { this.memberCreator = memberCreator; } public Data getData() { return data; } public void setData(Data data) { this.data = data; } public class Data { private String text; private Board board; private Card card; public String getText() { return text; } public void setText(String text) { this.text = text; } public Board getBoard() { return board; } public void setBoard(Board board) { this.board = board; } public Card getCard() { return card; } public void setCard(Card card) { this.card = card; } } public static class TYPE { public static final String CREATE_CARD = "createCard"; public static final String COMMENT_CARD = "commentCard"; public static final String UPDATE_CARD = "updateCard"; public static final String UPDATE_CARD_ID_LIST = "updateCard:idList"; public static final String UPDATE_CARD_CLOSED = "updateCard:closed"; public static final String UPDATE_CARD_DESC = "updateCard:desc"; public static final String UPDATE_CARD_NAME = "updateCard:name"; public static final String ADD_MEMBER_TO_CARD = "addMemberToCard"; public static final String REMOVE_MEMBER_FROM_CARD = "removeMemberFromCard"; public static final String UPDATE_CHECK_ITEM = "updateCheckItemStateOnCard"; public static final String ADD_ATTACHMENT = "addAttachmentToCard"; public static final String REMOVE_ATTACHMENT = "removeAttachmentFromCard"; public static final String ADD_CHECKLIST = "addChecklistToCard"; public static final String REMOVE_CHECKLIST = "removeChecklistFromCard"; public static final String CREATE_LIST = "createList"; public static final String UPDATE_LIST = "updateList"; public static final String CREATE_BOARD = "createBoard"; public static final String UPDATE_BOARD = "updateBoard"; public static final String ADD_MEMBER_TO_BOARD = "addMemberToBoard"; public static final String REMOVE_MEMBER_FROM_BOARD = "removeMemberFromBoard"; public static final String ADD_TO_ORGANIZATION_BOARD = "addToOrganizationBoard"; public static final String REMOVE_FROM_ORGANIZATION_BOARD = "removeFromOrganizationBoard"; public static final String CREATE_ORGANIZATION = "createOrganization"; public static final String UPDATE_ORGANIZATION = "updateOrganization"; } }
{ "content_hash": "dfa38c182b607ad99971bc18e6d31c8a", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 104, "avg_line_length": 28.482993197278912, "alnum_prop": 0.6429424408884643, "repo_name": "bytearrays/trello4j", "id": "e04b9d3feaf14eef886b54f6aefe69047bfebc88", "size": "4187", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/main/java/org/trello4j/model/Action.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "100155" } ], "symlink_target": "" }
require 'spec_helper' describe "TimeZones" do context "An instance of an embedded document" do before do @document = EDoc do key :name, String key :created_at, Time end end it "should preserve milliseconds" do doc = @document.new(:created_at => '2011-02-12 16:01:02.543Z') doc.created_at.should be_within(0.0000001).of(Time.parse('2011-02-12 16:01:02.543Z')) end it "should work without Time.zone" do Time.zone = nil doc = @document.new(:created_at => "2009-08-15 14:00:00") doc.created_at.should == Time.local(2009, 8, 15, 14, 0, 0).utc end it "should work with Time.zone set to the (default) UTC" do Time.zone = 'UTC' doc = @document.new(:created_at => "2009-08-15 14:00:00") doc.created_at.is_a?(ActiveSupport::TimeWithZone).should be_true doc.created_at.should == Time.utc(2009, 8, 15, 14) Time.zone = nil end it "should work with timezones that are not UTC" do Time.zone = 'Hawaii' doc = @document.new(:created_at => "2009-08-15 14:00:00") doc.created_at.is_a?(ActiveSupport::TimeWithZone).should be_true doc.created_at.should == Time.utc(2009, 8, 16) Time.zone = nil end end end
{ "content_hash": "219ec115fbc762ab3967ce26289ef74d", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 91, "avg_line_length": 28.545454545454547, "alnum_prop": 0.6186305732484076, "repo_name": "miyucy/mongomapper", "id": "0bc947554dc069c60a4c78ef27923612e7524ab5", "size": "1256", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "spec/unit/time_zones_spec.rb", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "5568919d0f38b97518c20cad5281511d", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "e927d8c159af41a188fc674e7bf9d51b98040ab7", "size": "193", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Celastrales/Celastraceae/Maytenus/Maytenus huillensis/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
bpulse-protobuf-java is the model interface which bpulse relies on in order to send messages with pulses to the collector, it is a mandatory dependency of [bpulse-sdk-java](https://github.com/bpulse/bpulse-sdk-java) or bpulse-java-client in order to compile it and send messages to the collector. # Requirements * Linux Packages (Linux only): * autoconf * libtool * [Apache Maven 3.x.x](https://maven.apache.org/download.cgi) * [JDK version 1.7+](http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html) ## Protocol Buffers 2.5.0 In order to build this project you need to install protoc on your machine, it is very important that you use specifically the *2.5.0* version otherwise the project might not compile. The instructions for each OS are the following: ### Windows Use the provided distribution in this repository under /protobuf/windows/protoc-2.5.0-win32.rar unpack it wherever you want. Edit your environment variables adding one that points to the unpackaged folder like **PROTOC_HOME** e.g. **PROTOC_HOME**=C:\software\protoc Then edit your **PATH** variable appending the new variable e.g. **PATH**=\[other_variables];%**PROTOC_HOME**% You can check if the installation was ok by opening a terminal and executing the following command: ``` protoc --version ``` You should see this output: ``` libprotoc 2.5.0 ``` ### Linux Use the provided distribution in this repository under /protobuf/linux/protobuf-2.5.0.tar.gz unpackit wherever you want. **Note:** At this point you should have installed the two linux packages mentioned above. Open a terminal and go to where you unpacked the file, then execute the following commands (one by one): ``` $ ./autogen.sh $ ./configure $ ./make $ ./make install ``` **Note:** The make install commad may require sudo After that, you can check if everything succeded by executin the command: ``` $ protoc --version ``` If you don't receive a message like: ``` libprotoc 2.5.0 ``` Then execute the following: ``` $ sudo ldconfig ``` And check again. ### OSX The easies way is to use homebrew package manager to install it, please take a look at [this post](http://stackoverflow.com/questions/21775151/installing-google-protocol-buffers-on-mac) # Build Once you checked out the sources, in a terminal go to the repo folder and type ``` $ mvn clean install ``` It's done!, now you can build the bpulse-sdk-java # Contact us You can reach the Developer Platform team at jtenganan@innova4j.com # License The Bpulse Protobuf Java is licensed under the Apache License 2.0. Details can be found in the LICENSE file.
{ "content_hash": "1bc07e2b91350fe32f28546cedbb856d", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 192, "avg_line_length": 27.34375, "alnum_prop": 0.7466666666666667, "repo_name": "bpulse/bpulse-protobuf-java", "id": "b7cf0d5b65f14d71e16b9813fb2fdbecaf965b4f", "size": "2649", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "2030" }, { "name": "Protocol Buffer", "bytes": "674" }, { "name": "Shell", "bytes": "341" } ], "symlink_target": "" }
angular.module('core.project', ['ngResource']);
{ "content_hash": "d5d3f715b44ed1f44f3ab370dac54a91", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 47, "avg_line_length": 47, "alnum_prop": 0.723404255319149, "repo_name": "gomowjames/angular-barrettj.co", "id": "896e30bfccb08a87da079f6b60d8224b9ce55481", "size": "47", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/core/project/project.module.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "16736" }, { "name": "HTML", "bytes": "24844" }, { "name": "JavaScript", "bytes": "9280" } ], "symlink_target": "" }
ITEM.name = "Seeds base" ITEM.model = "models/items/jewels/purses/big_purse.mdl" ITEM.width = 1 ITEM.height = 1 ITEM.desc = "Небольшой мешочек с зерном." ITEM.category = "Семена" ITEM.PlantModel = "models/aoc_trees/aoc_lowveg14.mdl" ITEM.BadGathering = {} ITEM.CommonGathering = {} ITEM.MasterGathering = {} ITEM.functions.use = { name = "Посадить", tip = "useTip", icon = "icon16/accept.png", onRun = function(item, client) local client = item.player local trace = client:GetEyeTraceNoCursor() local TextureBL = { "PLASTER/PLASTERWALL013C", "PLASTER/WALLPAPER001B", "PLASTER/WALLPAPER002A", "PLASTER/WALLPAPER002B", "PLASTER/WALLPAPER003A", "PLASTER/WALLPAPER003B", "PLASTER/WALLPAPER005A", } if (trace.HitPos:Distance( client:GetShootPos() ) <= 192) then if trace.MatType == 68 and !IsValid(trace.Entity) and !table.HasValue(TextureBL, trace.HitTexture) then local check = true for k, v in pairs(ents.FindInSphere(trace.HitPos, 10)) do if v:GetClass() == "nut_culture" or v:GetClass() == "nut_plant" then check = false end end if check then local seed = ents.Create("nut_culture") seed:SetPos(trace.HitPos + trace.HitNormal) seed.uid = item.uniqueID seed:setNetVar("grow", CurTime() + math.random(300, 600)) seed:setNetVar("spawn", CurTime()) seed:Spawn() seed:SetModel(item.PlantModel) client:notify("Вы успешно посадили семена") client:getChar():updateAttrib("frm", math.random(0.05, 0.1)) else client:notify("Нельзя сажать растения так близко друг к другу!") return false end else client:notify("Растения можно сажать только в подходящую почву.") return false end else client:notify("Вы не можете посадить растение так далеко!") return false end end, }
{ "content_hash": "073b048caceb2b40e518e33d2ccf04cc", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 106, "avg_line_length": 30.779661016949152, "alnum_prop": 0.6828193832599119, "repo_name": "xAleXXX007x/Witcher-RolePlay", "id": "884058f30f57d78a8cf03dea50f607a6555442f5", "size": "1991", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "witcherrp/plugins/farming/items/base/sh_seeds.lua", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
@interface NSView (IDPExtension) @property (nonatomic, strong) NSColor *backgroundViewColor; - (void)round; - (void)roundWithValue:(CGFloat)value; - (void)borderWidthValue:(CGFloat)value; - (void)borderViewColor:(NSColor *)color; - (NSImage *)imageFromView; - (NSImage *)imageRepresentation; @end
{ "content_hash": "8456e8fd1380f7c5fd9339af3c07219e", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 59, "avg_line_length": 25, "alnum_prop": 0.7566666666666667, "repo_name": "artemch/IDPCollectionView", "id": "7aaea283aa7a5daf0b91acf94b36500bd1a5e598", "size": "476", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/IDPKit/AppKit/src/NSView+IDPExtension.h", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "200778" }, { "name": "Ruby", "bytes": "498" } ], "symlink_target": "" }
/** * * SyncSnackbar * */ import React from 'react'; import Snackbar from 'material-ui/Snackbar'; import RaisedButton from 'material-ui/RaisedButton'; import styles from './styles.css'; const SyncSnackbar = ({syncSnackbar, closeSyncSnackbar}) => { return ( <div className={ styles.wrapper }> <Snackbar open={syncSnackbar} message="Fazendo sync..." autoHideDuration={4000} onRequestClose={closeSyncSnackbar} action="ok" onActionTouchTap={closeSyncSnackbar} /> </div> ); } export default SyncSnackbar;
{ "content_hash": "0cb82641a5e3833f5a2a2e7240c45154", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 61, "avg_line_length": 19.266666666666666, "alnum_prop": 0.6505190311418685, "repo_name": "GuiaLa/guiala-web-app", "id": "703003e3f51cf73b6c25eabfecdb548fcb6b3c24", "size": "578", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/components/SyncSnackbar/index.js", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "1526" }, { "name": "CSS", "bytes": "4009" }, { "name": "HTML", "bytes": "6556" }, { "name": "JavaScript", "bytes": "131067" } ], "symlink_target": "" }
from django import forms from django.forms import ModelMultipleChoiceField from django_summernote.widgets import SummernoteWidget, SummernoteInplaceWidget from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit, Layout, Field, Fieldset, Button, Div from crispy_forms.bootstrap import ( PrependedText, PrependedAppendedText, FormActions) from mptt.forms import TreeNodeChoiceField from posts.models import Post from categories.models import Category class PostForm(forms.ModelForm): category = TreeNodeChoiceField(queryset=Category.objects.all(), level_indicator='----',) def __init__(self, *args, **kwargs): super(PostForm, self).__init__(*args, **kwargs) self.fields['category'].label = "카테고리" self.fields['title'].label = "제목" self.fields['content'].label = "상세 리뷰" self.fields['product_url'].label = "구매 주소" self.helper = FormHelper() self.helper.form_method = 'POST' self.helper.label_class = 'control-label' self.helper.layout = Layout( Field('category', css_class='form-control col-lg-8', placeholder="제목을 입력해 주세요"), Field('title', css_class='form-control', placeholder="제목을 입력해 주세요"), Field('content', css_class='form-control', ), Field('product_url', css_class='form-control', placeholder="구매처의 주소를 붙여넣어 주세요"), FormActions(Submit('save', '저장하기', css_class='btn btn-primary'), Button('cancel', 'Cancel', css_class='btn btn-default') ), ) class Meta: model = Post widgets = { 'title': forms.TextInput(), 'content': SummernoteInplaceWidget( ), 'product_url': forms.TextInput(), } fields = ['category', 'title', 'content', 'product_url'] field_classes = { 'category': TreeNodeChoiceField, }
{ "content_hash": "4c6719b25a16239ca23cb3a0c3db7c7d", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 92, "avg_line_length": 42.08510638297872, "alnum_prop": 0.6122345803842265, "repo_name": "manducku/awesomepose", "id": "195dd62ea2896bd1a281c3d55dee09cef2bf7a79", "size": "2078", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "awesomepose/posts/forms/post.py", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "272237" }, { "name": "HTML", "bytes": "22205" }, { "name": "JavaScript", "bytes": "15280" }, { "name": "Makefile", "bytes": "239" }, { "name": "Python", "bytes": "35225" }, { "name": "Shell", "bytes": "122" } ], "symlink_target": "" }
describe Bali do it 'has a version number' do expect(Bali::VERSION).not_to be nil end context "DSL" do before(:each) do Bali.clear_rules end context "delegating way to obtain roles with roles_for" do it "doesn't throw error when defining delegation for querying roles" do expect do Bali.map_rules do roles_for My::Employee, :roles end end.to_not raise_error Bali::TRANSLATED_SUBTARGET_ROLES["My::Employee"].should == :roles end end context "when describing rules_for" do it "throws error when rules_for is used for other than a class" do expect do Bali.map_rules do rules_for "my string" do end end.to raise_error(Bali::DslError) end end it "does not throw an error when rules_for is used with a class" do expect do Bali.map_rules do rules_for My::String do end end.to_not raise_error end end it "should redefine rule if same operation is re-described" do expect(Bali::Integrator::RuleClass.all.size).to eq(0) Bali.map_rules do rules_for My::Transaction do role :general_user do |record| can :update, :delete can :delete, if: -> { record.is_settled? } end end end rc = Bali::Integrator::RuleClass.for(My::Transaction) expect(rc.rules_for(:general_user).get_rule(:can, :delete).has_decider?) .to eq(true) end it "does not allow subtarget definition other than using string, symbol, array and hash" do expect do Bali.map_rules do rules_for My::Transaction do role :general_user do can :print end end end end.to_not raise_error expect do Bali.map_rules do rules_for My::Transaction do role "finance user" do can :print end end end end.to_not raise_error expect do Bali.map_rules do rules_for My::Transaction do role [:general_user, "finance user"] do can :print end end end end.to_not raise_error expect do Bali.map_rules do rules_for My::Transaction do role :general_user, can: [:print] end end end.to_not raise_error expect do Bali.map_rules do rules_for My::Transaction do role :general_user, :finance_user, [:guess, nil], can: [:show] do can :print end end end end.to_not raise_error end context "when inheriting" do it "throws error when inheriting undefined rule class" do expect do Bali.map_rules do rules_for My::Transaction, inherits: My::SecuredTransaction do end end end.to raise_error(Bali::DslError) end it "does not throw an error when inheriting defined rule class" do expect do Bali.map_rules do rules_for My::Transaction do end rules_for My::SecuredTransaction do end end end.to_not raise_error end end end context "when describing each rules using role" do it "can define nil rule group" do expect(Bali::Integrator::RuleClass.all.size).to eq(0) Bali.map_rules do rules_for My::Transaction do role nil do can :view end end end Bali::Integrator::RuleClass.all.size.should == 1 Bali::Integrator::RuleClass.for(My::Transaction).class.should == Bali::RuleClass end it "disallows calling role outside of rules_for" do expect do Bali.map_rules do role :general_user, can: :show end.to raise_error(Bali::DslError) end expect do Bali.map_rules do rules_for My::Transaction do role :general_user do can :show end end end end.to_not raise_error end it "disallows calling can outside of role block" do expect do Bali.map_rules do can :show end end.to raise_error(Bali::DslError) expect do Bali.map_rules do rules_for My::Transaction do role :general_user do can :show end end end end.to_not raise_error end it "disallows calling cannot outside of role block" do expect do Bali.map_rules do cannot :show end end.to raise_error(Bali::DslError) expect do Bali.map_rules do rules_for My::Transaction do role :general_user do cannot :show end end end end.to_not raise_error end it "disallows calling can_all outside of role block" do expect do Bali.map_rules do can_all end end.to raise_error(Bali::DslError) expect do Bali.map_rules do rules_for My::Transaction do role :general_user do can_all end end end end.to_not raise_error end it "disallows calling cannot_all outside of role block" do expect do Bali.map_rules do cannot_all end end.to raise_error(Bali::DslError) expect do Bali.map_rules do rules_for My::Transaction do role :general_user do cannot_all end end end end.to_not raise_error end end # context role context "others" do it "disallow calling others outside of rules_for" do expect do Bali.map_rules do others can: :show end.to raise_error(Bali::DslError) end expect do Bali.map_rules do rules_for My::Transaction do others do can :show end end end end.to_not raise_error end it "disallows calling can outside of others block" do expect do Bali.map_rules do can :show end end.to raise_error(Bali::DslError) expect do Bali.map_rules do rules_for My::Transaction do others do can :show end end end end.to_not raise_error end it "disallows calling cannot outside of others block" do expect do Bali.map_rules do cannot :show end end.to raise_error(Bali::DslError) expect do Bali.map_rules do rules_for My::Transaction do others do cannot :show end end end end.to_not raise_error end it "disallows calling can_all outside of role block" do expect do Bali.map_rules do can_all end end.to raise_error(Bali::DslError) expect do Bali.map_rules do rules_for My::Transaction do others do can_all end end end end.to_not raise_error end it "disallows calling cannot_all outside of role block" do expect do Bali.map_rules do cannot_all end end.to raise_error(Bali::DslError) expect do Bali.map_rules do rules_for My::Transaction do others do cannot_all end end end end.to_not raise_error end end # context others it "allows definition of rules per subtarget" do expect(Bali::Integrator::RuleClass.all.size).to eq(0) Bali.map_rules do rules_for My::Transaction do role :general_user, can: :show role :finance_user do can :update, :delete, :edit can :delete, if: proc { |record| record.is_settled? } end end end Bali::Integrator::RuleClass.all.size.should == 1 Bali::Integrator::RuleClass.for(My::Transaction).class.should == Bali::RuleClass end context "shortcut notation" do it "raises error when notation does not have hash" do expect do Bali.map_rules do rules_for My::Transaction do role :user end end end.to raise_error(Bali::DslError) end it "does not raise an error when properly defined with a hash" do expect do Bali.map_rules do rules_for My::Transaction do role :user, can: :edit, cannot: [:delete, :refund] end end end.to_not raise_error rule_group = Bali::Integrator::RuleGroup.for(My::Transaction, :user) expect(rule_group.get_rule(:can, :edit)).to_not be_nil expect(rule_group.get_rule(:cannot, :delete)).to_not be_nil expect(rule_group.get_rule(:cannot, :refund)).to_not be_nil end end it "allows definition of rules per multiple subtarget" do expect(Bali::Integrator::RuleClass.all.size).to eq(0) Bali.map_rules do rules_for My::Transaction do role(:general_user, :finance_user, can: [:show]) role :general_user, :finance_user do can :print end role :finance_user do can :delete, if: proc { |record| record.is_settled? } end end end Bali::Integrator::RuleClass.all.size.should == 1 Bali::Integrator::RuleClass.for(My::Transaction).class.should == Bali::RuleClass rule_group_gu = Bali::Integrator::RuleGroup.for(My::Transaction, :general_user) rule_group_fu = Bali::Integrator::RuleGroup.for(My::Transaction, :finance_user) rule_group_gu.get_rule(:can, :show).class.should == Bali::Rule rule_group_gu.get_rule(:can, :print).class.should == Bali::Rule rule_group_fu.get_rule(:can, :show).class.should == Bali::Rule rule_group_gu.get_rule(:can, :print).class.should == Bali::Rule rule_group_fu.get_rule(:can, :delete).class.should == Bali::Rule rule_group_gu.get_rule(:can, :delete).class.should == NilClass end it "does not allow role without rules_for" do expect do Bali.map_rules do role :general_user, can: [:print] end end.to raise_error(Bali::DslError) end context "when having if-decider" do before do Bali.map_rules do rules_for My::Transaction do role :finance_user do can :delete, if: proc { |record| record.is_settled? } cannot :payout, if: proc { |record| !record.is_settled? } end end end end let(:txn) { My::Transaction.new } context "deleting" do context "unsettled transaction" do before { txn.is_settled = false } context "when finance user" do it "returns false to can?" do txn.can?(:finance_user, :delete).should be_falsey end it "returns true to cannot?" do txn.cannot?(:finance_user, :delete).should be_truthy end end # when finance user end # unsettled transaction context "settled transaction" do before { txn.is_settled = true } it("returns true to can?") { txn.can?(:finance_user, :delete).should be_truthy } it("returns false to cannot?") { txn.cannot?(:finance_user, :delete).should be_falsey } end end # deleting context "payout" do context "unsettled transaction" do before { txn.is_settled = false } context "when finance user" do it "returns false to can?" do txn.can?(:finance_user, :payout).should be_falsey end it "returns true to cannot?" do txn.cannot?(:finance_user, :payout).should be_truthy end end # when finance user end # unsettled transaction context "settled transaction" do before { txn.is_settled = true } it("returns true to can?") { txn.can?(:finance_user, :payout).should be_truthy } it("returns false to cannot?") { txn.cannot?(:finance_user, :payout).should be_falsey } end end # payout end context "when having unless-decider" do before do Bali.map_rules do rules_for My::Transaction do role :finance_user do cannot :delete, unless: proc { |record| record.is_settled? } can :payout, unless: proc { |record| !record.is_settled? } end end end end let(:txn) { My::Transaction.new } context "deleting" do context "unsettled transaction" do before { txn.is_settled = false } it("returns false to can?") { txn.can?(:finance_user, :delete).should be_falsey } it("returns true to cannot?") { txn.cannot?(:finance_user, :delete).should be_truthy } end context "settled transaction" do before { txn.is_settled = true } it("returns true to can?") { txn.can?(:finance_user, :delete).should be_truthy } it("returns false to cannot?") { txn.cannot?(:finance_user, :delete).should be_falsey } end end context "payout" do context "unsettled transaction" do before { txn.is_settled = false } it("returns false to can?") { txn.can?(:finance_user, :payout).should be_falsey } it("returns true to cannot?") { txn.cannot?(:finance_user, :payout).should be_truthy } end context "settled transaction" do before { txn.is_settled = true } it("returns true to can?") { txn.can?(:finance_user, :payout).should be_truthy } it("returns false to cannot?") { txn.cannot?(:finance_user, :payout).should be_falsey } end end end # when having unless decider (fine-grained test) it "allows unless-decider to be executed in context" do expect(Bali::Integrator::RuleClass.all.size).to eq(0) Bali.map_rules do rules_for My::Transaction do role :finance_user do cannot :chargeback, unless: proc { |record| record.is_settled? } end end end txn = My::Transaction.new txn.is_settled = false txn.cannot?(:finance_user, :chargeback).should be_truthy txn.can?(:finance_user, :chargeback).should be_falsey txn.is_settled = true txn.cannot?(:finance_user, :chargeback).should be_falsey txn.can?(:finance_user, :chargeback).should be_truthy # reverse meaning of the above, should return the same Bali.clear_rules Bali.map_rules do rules_for My::Transaction do role :finance_user do can :chargeback, if: proc { |record| record.is_settled? } end end end txn = My::Transaction.new txn.is_settled = false # txn.cannot?(:finance_user, :chargeback).should be_truthy # txn.can?(:finance_user, :chargeback).should be_falsey txn.is_settled = true txn.cannot?(:finance_user, :chargeback).should be_falsey txn.can?(:finance_user, :chargeback).should be_truthy end it "should allow rule group to be defined" do Bali.map_rules do rules_for My::Transaction do role :general_user, can: :show end end Bali::Integrator::RuleClass.all.size.should == 1 rc = Bali::Integrator::RuleClass.for(My::Transaction) rc.class.should == Bali::RuleClass rc.rules_for(:general_user).class.should == Bali::RuleGroup rc.rules_for(:general_user).get_rule(:can, :show).class.should == Bali::Rule expect(Bali::Integrator::RuleClass.for(My::Transaction)).to_not be_nil Bali.map_rules do rules_for My::Transaction do role :general_user, can: :show end end Bali::Integrator::RuleClass.all.size.should == 1 rc = Bali::Integrator::RuleClass.for(My::Transaction) rc.class.should == Bali::RuleClass rc.rules_for(:general_user).class.should == Bali::RuleGroup rc.rules_for(:general_user).get_rule(:can, :show).class.should == Bali::Rule Bali::Integrator::RuleClass.for(My::Transaction).should == rc end it "should redefine rule class if Bali.map_rules is called" do expect(Bali::Integrator::RuleClass.all.size).to eq(0) Bali.map_rules do rules_for My::Transaction do role :general_user, can: [:update, :delete, :edit] end end expect(Bali::Integrator::RuleClass.all.size).to eq(1) expect(Bali::Integrator::RuleClass.for(My::Transaction) .rules_for(:general_user) .rules.size).to eq(3) Bali.map_rules do rules_for My::Transaction do role :general_user, can: :show role :finance_user, can: [:update, :delete, :edit] end end expect(Bali::Integrator::RuleClass.all.size).to eq(1) rc = Bali::Integrator::RuleClass.for(My::Transaction) expect(rc.rules_for(:general_user).rules.size).to eq(1) expect(rc.rules_for(:finance_user).rules.size).to eq(3) end context "when with others" do it "can define others block" do expect do Bali.map_rules do rules_for My::Transaction do role :admin_user do can_all end others do cannot_all can :read end end end # map rules end.to_not raise_error rc = Bali::Integrator::RuleClass.for(My::Transaction) expect(rc.rules_for("__*__").get_rule(:can, :read)).to_not be_nil end it "can define others by passing array to it" do expect do Bali.map_rules do rules_for My::Transaction do role :admin_user do can_all end others can: [:view] end # rules for end # map rules end.to_not raise_error end end end # main module context DSL end
{ "content_hash": "2fef16bf5d0606d744bddde847ff2bbd", "timestamp": "", "source": "github", "line_count": 629, "max_line_length": 97, "avg_line_length": 30.171701112877585, "alnum_prop": 0.5476867952365897, "repo_name": "saveav/bali", "id": "1db93ba9c0588b1d4d88d155002246194bdccafe", "size": "18978", "binary": false, "copies": "1", "ref": "refs/heads/release", "path": "spec/dsl_spec.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "113037" }, { "name": "Shell", "bytes": "115" } ], "symlink_target": "" }
title: Lines subtitle: with GTA Ps layout: default modal-id: 6 date: 2014-07-15 img: ANline.jpg thumbnail: ANline-thumb.jpg alt: image-alt project-date: August 2018 client: Kurocon category: Lines description: Lineup at 5am with vetran Canadian linecon survivors of AN14,AN15 and AN16 for Kurocon. ---
{ "content_hash": "0a67a8a6a2dab6b28fe3ba5043846eb6", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 100, "avg_line_length": 21.642857142857142, "alnum_prop": 0.7788778877887789, "repo_name": "KUROC0N/KUROC0N.github.io", "id": "e46375a05554d152c8d22d88f5aac22ce2d2c256", "size": "307", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_posts/2014-07-13-project-6.markdown", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "17957" }, { "name": "HTML", "bytes": "22250" }, { "name": "JavaScript", "bytes": "42756" }, { "name": "PHP", "bytes": "1092" }, { "name": "Ruby", "bytes": "715" } ], "symlink_target": "" }
export * from './logging.module'; export * from './logging.types'; export * from './logging.logger'; export * from './logging.service';
{ "content_hash": "456283e9986b0c7efa6f9b28300b183e", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 34, "avg_line_length": 34, "alnum_prop": 0.6764705882352942, "repo_name": "better-js-logging/angular-logger2", "id": "ea1dbb374ea896882914b9276df2be11e062978f", "size": "136", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "dist-commonjs/index.d.ts", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "JavaScript", "bytes": "3023" }, { "name": "TypeScript", "bytes": "10485" } ], "symlink_target": "" }
/* * Trevor Pence * ITSE-1430 * 10/9/2017 */ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace MovieLib { public class Movie : IValidatableObject { public string Title { set { _title = value; } get { return _title ?? ""; } } public string Description { set { _description = value; } get { return _description ?? ""; } } public decimal Length { get; set; } public bool IsOwned { get; set; } public int Id { get; set; } public IEnumerable<ValidationResult> Validate( ValidationContext validationContext ) { if (String.IsNullOrEmpty(_title)) yield return new ValidationResult("title cannot be null or empty.", new[] { nameof(Title) }); if (Length < 0) yield return new ValidationResult("Length cannot be less than 0", new[] { nameof(Length) }); } private string _title; private string _description; } }
{ "content_hash": "cbe60eec4f5b1c20692c7f2503e07c41", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 109, "avg_line_length": 26, "alnum_prop": 0.5641025641025641, "repo_name": "TrevorPence/ITSE1430", "id": "473618873e209d662abb6708131337caf0c791f5", "size": "1094", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Labs/Lab 3/MovieLib/Movie.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "99" }, { "name": "C#", "bytes": "130587" }, { "name": "CSS", "bytes": "560" }, { "name": "JavaScript", "bytes": "242588" } ], "symlink_target": "" }
package pubsub.transport; import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; import java.util.HashMap; import java.util.Map; import pubsub.PubSubID; import pubsub.messages.net.transport.DataMessage; /** * * @author John Gasparis */ public class FileInfo { private RandomAccessFile raf; private long fileSize; private int dataChunkSize; private int totalChunks; private PubSubID sid; private PubSubID rid; private static final int DEFAULT_SIZE = 256; private int lowestChunkNum = Integer.MAX_VALUE; private Map<Integer, DataMessage> dataCache; public FileInfo(File file, int chunkSize, PubSubID sid, PubSubID rid) throws IOException { this.raf = new RandomAccessFile(file, "r"); this.dataChunkSize = chunkSize; this.fileSize = raf.length(); this.totalChunks = (int) (fileSize / chunkSize); if (raf.length() % chunkSize != 0) { totalChunks++; } this.dataCache = new HashMap<Integer, DataMessage>(DEFAULT_SIZE, (float) 1.0); this.sid = sid; this.rid = rid; } public DataMessage getNextDataMessage(int chunkNum, long timestamp) throws IOException { DataMessage message = dataCache.get(chunkNum); if (message != null) { return message; } else { long position = chunkNum * dataChunkSize; raf.seek(position); int frameLen = (int) Math.min(fileSize - position, dataChunkSize); byte[] frame = new byte[frameLen]; raf.read(frame); message = new DataMessage(sid, rid, chunkNum, frame, timestamp); if (dataCache.size() == DEFAULT_SIZE) { dataCache.remove(lowestChunkNum); } dataCache.put(chunkNum, message); if (chunkNum < lowestChunkNum) { lowestChunkNum = chunkNum; } return message; } } public int getTotalChunks() { return this.totalChunks; } public int getDataChunkSize() { return this.dataChunkSize; } public void close() throws IOException { this.raf.close(); } }
{ "content_hash": "80193918280552f8a078060b85b663f1", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 94, "avg_line_length": 27, "alnum_prop": 0.6160794941282746, "repo_name": "yannakisg/pubsub", "id": "0b620d62b1122933cbd6db7445127a117ba70120", "size": "2214", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "PubSub-transport/src/pubsub/transport/FileInfo.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1420" }, { "name": "Java", "bytes": "1125662" }, { "name": "Shell", "bytes": "1025" } ], "symlink_target": "" }
layout: "post" title: "Travel" date: "2017-07-28 21:11" author: Brian Proctor reviewed: 31st July 2017 review: 31st July 2018 --- > Information on INR testing aboad from anticoagulation europe. <a href="https://issuu.com/anticoagulation/docs/inr_abroad_table_2015_1bd22b93ad466c">link</a> > Information on travel related thrombus can be found from the British Society of Haematology <a href="http://www.b-s-h.org.uk/guidelines/guidelines/travel-related-venous-thrombosis/" target="blank">guidelines link</a>. ### Patient information on avoiding DVT when travelling. #### Helping you to avoid a DVT **IMPORTANT: The following suggestions apply for any long journey, such as coach, train or car, and also when sitting for any lengthy period.** - Keep your legs and feet active - every half hour, bend and straighten them to keep the blood circulating - Press down on the balls of your feet, then raise the heels to help increase the blood flow in your legs - Don't cross your legs - Exercise your chest and upper body frequently - Do deep breathing exercises to help improve circulation - Walk up and down the aisles frequently - If you are on a long flight, which has refuelling stops, take the opportunity to leave the plane and walk about - Drink plenty of water - preferably a glass every hour - Avoid alcohol - or, if you must, take only small amounts. Alcohol will cause dehydration and sleepiness - Avoid sleeping pills - they will cause you to be immobile for long periods - Try not to sleep for too long in a cramped position - move about as much as possible, and stretch out - Make sure you have had plenty of rest before you make a lengthy journey, so that you are not too tired
{ "content_hash": "e71f2471deec078e075cb08dfcc5b5d3", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 219, "avg_line_length": 60.42857142857143, "alnum_prop": 0.7730496453900709, "repo_name": "anticoagBHSCT/clinic", "id": "335e4fb1c396ea1261a186808f6daa7cea63ae5b", "size": "1696", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_posts/2017/2017-07-28-travel-related-thrombus.markdown", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "51402" }, { "name": "HTML", "bytes": "61064" }, { "name": "Java", "bytes": "305368" }, { "name": "JavaScript", "bytes": "946" }, { "name": "Ruby", "bytes": "1938" } ], "symlink_target": "" }
const Blueprints = require('../blueprints'); class ServiceBlueprint extends Blueprints { constructor (blueprint, entityName, options) { super(blueprint, entityName, options); this.type = 'service'; this.files = [ '__name__.service.ts' ]; if (this.project.clea.spec && this.project.clea.spec.service) { this.files.push('__name__.service.spec.ts'); } } beforeInstall () { return this.registerModuleTemplateData(); } afterInstall () { return this.classStyleAfterInstall({ entityName: `${this.templateData.camelizedName}Service` }); } } module.exports = ServiceBlueprint;
{ "content_hash": "ec57cf29fe9d644682d634c9e8272bae", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 67, "avg_line_length": 21.4, "alnum_prop": 0.6542056074766355, "repo_name": "groupe-sii/clea-cli", "id": "82dae780a972ecf2680af8d89fefe9d18fb45841", "size": "642", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/blueprints/service/index.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "586" }, { "name": "HTML", "bytes": "1477" }, { "name": "JavaScript", "bytes": "129761" }, { "name": "TypeScript", "bytes": "10523" } ], "symlink_target": "" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.9.1"/> <title>ovs all: test-json Namespace Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtreedata.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { init_search(); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">ovs all </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.9.1 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Related&#160;Pages</span></a></li> <li class="current"><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="namespaces.html"><span>Namespace&#160;List</span></a></li> <li><a href="namespacemembers.html"><span>Namespace&#160;Members</span></a></li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('namespacetest-json.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">test-json Namespace Reference</div> </div> </div><!--header--> <div class="contents"> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> <tr class="memitem:a8120eeab54fc835d5ce917b9766539b2"><td class="memItemLeft" align="right" valign="top">def&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacetest-json.html#a8120eeab54fc835d5ce917b9766539b2">print_json</a> (<a class="el" href="structjson.html">json</a>)</td></tr> <tr class="separator:a8120eeab54fc835d5ce917b9766539b2"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2b2abe6001bd58cc89fa416742f0eb10"><td class="memItemLeft" align="right" valign="top">def&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacetest-json.html#a2b2abe6001bd58cc89fa416742f0eb10">parse_multiple</a> (<a class="el" href="structstream.html">stream</a>)</td></tr> <tr class="separator:a2b2abe6001bd58cc89fa416742f0eb10"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aa7a81131a51ad2251408a50d93bc43fb"><td class="memItemLeft" align="right" valign="top">def&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacetest-json.html#aa7a81131a51ad2251408a50d93bc43fb">main</a> (argv)</td></tr> <tr class="separator:aa7a81131a51ad2251408a50d93bc43fb"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <h2 class="groupheader">Function Documentation</h2> <a class="anchor" id="aa7a81131a51ad2251408a50d93bc43fb"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">def <a class="el" href="structtest.html">test</a>-json.main </td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname"><em>argv</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <div class="fragment"><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;<span class="keyword">def </span><a class="code" href="namespacetest-json.html#aa7a81131a51ad2251408a50d93bc43fb">main</a>(argv):</div> <div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; argv0 = argv[0]</div> <div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;</div> <div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; <span class="comment"># Make stdout and stderr UTF-8, even if they are redirected to a file.</span></div> <div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; sys.stdout = codecs.getwriter(<span class="stringliteral">&quot;utf-8&quot;</span>)(sys.stdout)</div> <div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; sys.stderr = codecs.getwriter(<span class="stringliteral">&quot;utf-8&quot;</span>)(sys.stderr)</div> <div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;</div> <div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <span class="keywordflow">try</span>:</div> <div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; options, args = getopt.gnu_getopt(argv[1:], <span class="stringliteral">&#39;&#39;</span>, [<span class="stringliteral">&#39;multiple&#39;</span>])</div> <div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <span class="keywordflow">except</span> getopt.GetoptError, geo:</div> <div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; sys.stderr.write(<span class="stringliteral">&quot;%s: %s\n&quot;</span> % (argv0, geo.msg))</div> <div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; sys.exit(1)</div> <div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;</div> <div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; multiple = <span class="keyword">False</span></div> <div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <span class="keywordflow">for</span> key, value <span class="keywordflow">in</span> options:</div> <div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="keywordflow">if</span> key == <span class="stringliteral">&#39;--multiple&#39;</span>:</div> <div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; multiple = <span class="keyword">True</span></div> <div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <span class="keywordflow">else</span>:</div> <div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; sys.stderr.write(<span class="stringliteral">&quot;%s: unhandled option %s\n&quot;</span> % (argv0, key))</div> <div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; sys.exit(1)</div> <div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;</div> <div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="keywordflow">if</span> len(args) != 1:</div> <div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; sys.stderr.write(<span class="stringliteral">&quot;usage: %s [--multiple] INPUT.json\n&quot;</span> % argv0)</div> <div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; sys.exit(1)</div> <div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;</div> <div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; input_file = args[0]</div> <div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <span class="keywordflow">if</span> input_file == <span class="stringliteral">&quot;-&quot;</span>:</div> <div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; stream = sys.stdin</div> <div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="keywordflow">else</span>:</div> <div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; stream = open(input_file, <span class="stringliteral">&quot;</span><span class="stringliteral">r&quot;)</span></div> <div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;<span class="stringliteral"></span></div> <div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;<span class="stringliteral"> </span><span class="keywordflow">if</span> multiple:</div> <div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; ok = <a class="code" href="test-json_8c.html#aae68460de163b3fe807731b3a4a15fcb">parse_multiple</a>(stream)</div> <div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <span class="keywordflow">else</span>:</div> <div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; ok = <a class="code" href="ovsdb-client_8c.html#a9337c955ff0f3549130ac574fef785e5">print_json</a>(<a class="code" href="namespaceovs_1_1json.html#a9d08cde8a71dc3e8fb9679e235c18811">ovs.json.from_stream</a>(stream))</div> <div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;</div> <div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="keywordflow">if</span> <span class="keywordflow">not</span> ok:</div> <div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; sys.exit(1)</div> <div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160;</div> <div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160;</div> <div class="ttc" id="namespaceovs_1_1json_html_a9d08cde8a71dc3e8fb9679e235c18811"><div class="ttname"><a href="namespaceovs_1_1json.html#a9d08cde8a71dc3e8fb9679e235c18811">ovs.json.from_stream</a></div><div class="ttdeci">def from_stream(stream)</div><div class="ttdef"><b>Definition:</b> json.py:126</div></div> <div class="ttc" id="test-json_8c_html_aae68460de163b3fe807731b3a4a15fcb"><div class="ttname"><a href="test-json_8c.html#aae68460de163b3fe807731b3a4a15fcb">parse_multiple</a></div><div class="ttdeci">static bool parse_multiple(FILE *stream)</div><div class="ttdef"><b>Definition:</b> test-json.c:69</div></div> <div class="ttc" id="ovsdb-client_8c_html_a9337c955ff0f3549130ac574fef785e5"><div class="ttname"><a href="ovsdb-client_8c.html#a9337c955ff0f3549130ac574fef785e5">print_json</a></div><div class="ttdeci">static void print_json(struct json *json)</div><div class="ttdef"><b>Definition:</b> ovsdb-client.c:335</div></div> <div class="ttc" id="namespacetest-json_html_aa7a81131a51ad2251408a50d93bc43fb"><div class="ttname"><a href="namespacetest-json.html#aa7a81131a51ad2251408a50d93bc43fb">test-json.main</a></div><div class="ttdeci">def main(argv)</div><div class="ttdef"><b>Definition:</b> test-json.py:55</div></div> </div><!-- fragment --> </div> </div> <a class="anchor" id="a2b2abe6001bd58cc89fa416742f0eb10"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">def <a class="el" href="structtest.html">test</a>-json.parse_multiple </td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname"><em>stream</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <div class="fragment"><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="keyword">def </span><a class="code" href="test-json_8c.html#aae68460de163b3fe807731b3a4a15fcb">parse_multiple</a>(stream):</div> <div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160; buf = stream.read(4096)</div> <div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; ok = <span class="keyword">True</span></div> <div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; parser = <span class="keywordtype">None</span></div> <div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; <span class="keywordflow">while</span> len(buf):</div> <div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; <span class="keywordflow">if</span> parser <span class="keywordflow">is</span> <span class="keywordtype">None</span> <span class="keywordflow">and</span> buf[0] <span class="keywordflow">in</span> <span class="stringliteral">&quot; \t\r\n&quot;</span>:</div> <div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; buf = buf[1:]</div> <div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; <span class="keywordflow">else</span>:</div> <div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; <span class="keywordflow">if</span> parser <span class="keywordflow">is</span> <span class="keywordtype">None</span>:</div> <div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; parser = <a class="code" href="classovs_1_1json_1_1Parser.html">ovs.json.Parser</a>()</div> <div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; n = parser.feed(buf)</div> <div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; buf = buf[n:]</div> <div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; <span class="keywordflow">if</span> len(buf):</div> <div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; <span class="keywordflow">if</span> <span class="keywordflow">not</span> <a class="code" href="ovsdb-client_8c.html#a9337c955ff0f3549130ac574fef785e5">print_json</a>(parser.finish()):</div> <div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; ok = <span class="keyword">False</span></div> <div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; parser = <span class="keywordtype">None</span></div> <div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; <span class="keywordflow">if</span> len(buf) == 0:</div> <div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; buf = stream.read(4096)</div> <div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; <span class="keywordflow">if</span> parser <span class="keywordflow">and</span> <span class="keywordflow">not</span> <a class="code" href="ovsdb-client_8c.html#a9337c955ff0f3549130ac574fef785e5">print_json</a>(parser.finish()):</div> <div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; ok = <span class="keyword">False</span></div> <div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <span class="keywordflow">return</span> ok</div> <div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;</div> <div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;</div> <div class="ttc" id="classovs_1_1json_1_1Parser_html"><div class="ttname"><a href="classovs_1_1json_1_1Parser.html">ovs.json.Parser</a></div><div class="ttdef"><b>Definition:</b> json.py:155</div></div> <div class="ttc" id="test-json_8c_html_aae68460de163b3fe807731b3a4a15fcb"><div class="ttname"><a href="test-json_8c.html#aae68460de163b3fe807731b3a4a15fcb">parse_multiple</a></div><div class="ttdeci">static bool parse_multiple(FILE *stream)</div><div class="ttdef"><b>Definition:</b> test-json.c:69</div></div> <div class="ttc" id="ovsdb-client_8c_html_a9337c955ff0f3549130ac574fef785e5"><div class="ttname"><a href="ovsdb-client_8c.html#a9337c955ff0f3549130ac574fef785e5">print_json</a></div><div class="ttdeci">static void print_json(struct json *json)</div><div class="ttdef"><b>Definition:</b> ovsdb-client.c:335</div></div> </div><!-- fragment --> </div> </div> <a class="anchor" id="a8120eeab54fc835d5ce917b9766539b2"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">def <a class="el" href="structtest.html">test</a>-json.print_json </td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname"><em>json</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <div class="fragment"><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="keyword">def </span><a class="code" href="ovsdb-client_8c.html#a9337c955ff0f3549130ac574fef785e5">print_json</a>(json):</div> <div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160; <span class="keywordflow">if</span> <a class="code" href="datapath_2flow_8h.html#ab22aaab04f806700def00f32823fcb9e">type</a>(json) <span class="keywordflow">in</span> [str, unicode]:</div> <div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot;error: %s&quot;</span> % json</div> <div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; <span class="keywordflow">return</span> <span class="keyword">False</span></div> <div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; <span class="keywordflow">else</span>:</div> <div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; <a class="code" href="namespaceovs_1_1json.html#a28f0449dced244dd3752276e77bb5053">ovs.json.to_stream</a>(json, sys.stdout)</div> <div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; sys.stdout.write(<span class="stringliteral">&quot;\n&quot;</span>)</div> <div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; <span class="keywordflow">return</span> <span class="keyword">True</span></div> <div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;</div> <div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;</div> <div class="ttc" id="namespaceovs_1_1json_html_a28f0449dced244dd3752276e77bb5053"><div class="ttname"><a href="namespaceovs_1_1json.html#a28f0449dced244dd3752276e77bb5053">ovs.json.to_stream</a></div><div class="ttdeci">def to_stream</div><div class="ttdef"><b>Definition:</b> json.py:106</div></div> <div class="ttc" id="ovsdb-client_8c_html_a9337c955ff0f3549130ac574fef785e5"><div class="ttname"><a href="ovsdb-client_8c.html#a9337c955ff0f3549130ac574fef785e5">print_json</a></div><div class="ttdeci">static void print_json(struct json *json)</div><div class="ttdef"><b>Definition:</b> ovsdb-client.c:335</div></div> <div class="ttc" id="datapath_2flow_8h_html_ab22aaab04f806700def00f32823fcb9e"><div class="ttname"><a href="datapath_2flow_8h.html#ab22aaab04f806700def00f32823fcb9e">type</a></div><div class="ttdeci">__be16 type</div><div class="ttdef"><b>Definition:</b> flow.h:117</div></div> </div><!-- fragment --> </div> </div> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><a class="el" href="namespacetest-json.html">test-json</a></li> <li class="footer">Generated on Wed Sep 9 2015 19:08:09 for ovs all by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li> </ul> </div> </body> </html>
{ "content_hash": "c3d0b28304f9aae50cfc9693e19686e5", "timestamp": "", "source": "github", "line_count": 267, "max_line_length": 344, "avg_line_length": 82.38951310861424, "alnum_prop": 0.6513773979452677, "repo_name": "vladn-ma/vladn-ovs-doc", "id": "73338c89ac73db95536e6825b161de1c3224632e", "size": "21998", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doxygen/ovs_all/html/namespacetest-json.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "203339" }, { "name": "CSS", "bytes": "33151" }, { "name": "HTML", "bytes": "185529619" }, { "name": "JavaScript", "bytes": "6744200" } ], "symlink_target": "" }
'use strict'; /** * @class * Initializes a new instance of the ClusterListResult class. * @constructor * Cluster list results * * @member {string} [nextLink] The URL to use for getting the next set of * results. * */ class ClusterListResult extends Array { constructor() { super(); } /** * Defines the metadata of ClusterListResult * * @returns {object} metadata of ClusterListResult * */ mapper() { return { required: false, serializedName: 'ClusterListResult', type: { name: 'Composite', className: 'ClusterListResult', modelProperties: { value: { required: false, serializedName: '', type: { name: 'Sequence', element: { required: false, serializedName: 'ClusterElementType', type: { name: 'Composite', className: 'Cluster' } } } }, nextLink: { required: false, serializedName: 'nextLink', type: { name: 'String' } } } } }; } } module.exports = ClusterListResult;
{ "content_hash": "4c2181f8b41ba056de2fd81df79a79d0", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 73, "avg_line_length": 20.612903225806452, "alnum_prop": 0.48043818466353677, "repo_name": "begoldsm/azure-sdk-for-node", "id": "5064ff5012c5eecc97245d2343c57c05e548e1ee", "size": "1595", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "lib/services/serviceFabricManagement/lib/models/clusterListResult.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "661" }, { "name": "JavaScript", "bytes": "28255805" }, { "name": "Shell", "bytes": "437" } ], "symlink_target": "" }
package fm.last.moji.impl; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; import java.util.concurrent.locks.Lock; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import fm.last.moji.tracker.Destination; import fm.last.moji.tracker.Tracker; import fm.last.moji.tracker.TrackerFactory; @RunWith(MockitoJUnitRunner.class) public class FileUploadOutputStreamTest { private static final String KEY = "key"; private static final String DOMAIN = "domain"; @Mock private TrackerFactory mockTrackerFactory; @Mock private HttpConnectionFactory mockHttpFactory; @Mock private Destination mockDestination; @Mock private HttpURLConnection mockHttpConnection; @Mock private OutputStream mockOutputStream; @Mock private InputStream mockInputStream; @Mock private Tracker mockTracker; @Mock private Lock mockWriteLock; private FileUploadOutputStream stream; @Before public void setUp() throws IOException { URL url = new URL("http://www.last.fm/"); when(mockDestination.getPath()).thenReturn(url); when(mockHttpFactory.newConnection(url)).thenReturn(mockHttpConnection); when(mockHttpConnection.getInputStream()).thenReturn(mockInputStream); when(mockHttpConnection.getOutputStream()).thenReturn(mockOutputStream); when(mockHttpConnection.getResponseMessage()).thenReturn("message"); when(mockHttpConnection.getResponseCode()).thenReturn(HttpURLConnection.HTTP_OK); when(mockTrackerFactory.getTracker()).thenReturn(mockTracker); stream = new FileUploadOutputStream(mockTrackerFactory, mockHttpFactory, KEY, DOMAIN, mockDestination, mockWriteLock); } @Test public void httpConnectionSetUp() throws IOException { verify(mockHttpConnection).setRequestMethod("PUT"); verify(mockHttpConnection).setChunkedStreamingMode(4096); verify(mockHttpConnection).setDoOutput(true); } @Test public void everyThingCloses() throws IOException { stream.write(1); stream.close(); verify(mockOutputStream).flush(); verify(mockOutputStream).close(); verify(mockHttpConnection).disconnect(); verify(mockTracker).createClose(KEY, DOMAIN, mockDestination, 1); verify(mockTracker).close(); verify(mockWriteLock).unlock(); } @Test public void everyThingClosesEvenOnFail() throws IOException { doThrow(new RuntimeException()).when(mockOutputStream).flush(); doThrow(new RuntimeException()).when(mockOutputStream).close(); when(mockHttpConnection.getResponseCode()).thenReturn(HttpURLConnection.HTTP_INTERNAL_ERROR); doThrow(new RuntimeException()).when(mockInputStream).close(); doThrow(new RuntimeException()).when(mockHttpConnection).disconnect(); doThrow(new RuntimeException()).when(mockTracker).createClose(KEY, DOMAIN, mockDestination, 1); try { stream.write(1); stream.close(); } catch (Exception e) { } verify(mockOutputStream).flush(); verify(mockOutputStream).close(); verify(mockHttpConnection).disconnect(); verify(mockTracker).createClose(KEY, DOMAIN, mockDestination, -1); verify(mockTracker).close(); verify(mockWriteLock).unlock(); } @Test public void writeIntDelegates() throws IOException { stream.write(1); verify(mockOutputStream).write(1); } @Test public void writeByteArrayDelegates() throws IOException { byte[] b = new byte[4]; stream.write(b); verify(mockOutputStream).write(b); } @Test public void writeByteArrayWithOffsetDelegates() throws IOException { byte[] b = new byte[4]; stream.write(b, 2, 4); verify(mockOutputStream).write(b, 2, 4); } @Test public void flushDelegates() throws IOException { stream.flush(); verify(mockOutputStream).flush(); } @Test public void countOnWrite() throws IOException { byte[] b = new byte[] { 1, 2, 3, 4, 5 }; stream.write(b); stream.flush(); stream.close(); verify(mockTracker).createClose(KEY, DOMAIN, mockDestination, 5); } }
{ "content_hash": "3e6989ced8b86118c98226937031c693", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 106, "avg_line_length": 30.53900709219858, "alnum_prop": 0.7398978169995355, "repo_name": "kazabubu/moji", "id": "87b9b01b35c7ea3755f1da4d125078fbb63a66de", "size": "4905", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/test/java/fm/last/moji/impl/FileUploadOutputStreamTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "291017" }, { "name": "Shell", "bytes": "1630" } ], "symlink_target": "" }
<div ng-controller="FeedSearchCtrl"> <div modal="feedSearchModal" close="close()" options="{dialogClass: 'modal feed-search-dialog'}"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" ng-click="close()">&times;</button> <h4> <input ng-model="filter" class="filter-input" ui-keydown="{'up': 'focusPrevious($event)', 'down': 'focusNext($event)', 'enter': 'openFocused()' }" placeholder="{{'feedsearch.hint' | translate}}" focus="feedSearchModal" /> </h4> <small>{{ 'feedsearch.help' | translate }}</small> </div> <div class="modal-body"> <strong>{{ 'feedsearch.result_prefix' | translate }}</strong> <span ng-repeat="feed in (filtered = (CategoryService.feeds | filter:{name: filter} | limitTo:40))"> <span ng-class="{block: filter, focus: focus.id == feed.id}" class="feed-link"> <a class="pointer" ng-click="goToFeed(feed.id)"> <favicon url="feed.iconUrl" /> &nbsp;{{feed.name}} </a> <span ng-show="!filter && !$last">&bull;</span> </span> </span> </div> </div> </div> </div> </div>
{ "content_hash": "7fb3970dd5ff959dfe135117572a11fc", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 128, "avg_line_length": 52.15151515151515, "alnum_prop": 0.40790238233585124, "repo_name": "Athou/commafeed", "id": "da9bafab8762b9b6d642029cef077121ecb8a42a", "size": "1721", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/app/templates/_feedsearch.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "5120" }, { "name": "HTML", "bytes": "99962" }, { "name": "Java", "bytes": "359075" }, { "name": "JavaScript", "bytes": "329802" }, { "name": "SCSS", "bytes": "60960" }, { "name": "Shell", "bytes": "59" } ], "symlink_target": "" }
import React from 'react'; import {StyleSheet, Text, View } from 'react-native'; export default class SkillScreen extends React.Component { render() { return ( <View> <Text> Cooking skill screen for Serve </Text> </View> ); } } //Use FlatList to list different levels of cooking skill
{ "content_hash": "d4c02f43393c0ccbd78a36e27129970a", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 58, "avg_line_length": 22.785714285714285, "alnum_prop": 0.6551724137931034, "repo_name": "timmykuo/Serve", "id": "31faf80289636d57256e3f60dd6cb2f86402188d", "size": "319", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/components/SetUp/SkillScreen.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "9603" } ], "symlink_target": "" }
<?xml version="1.0" ?><!DOCTYPE TS><TS language="pt_BR" version="2.1"> <context> <name>AboutDialog</name> <message> <source>About Richcoin Core</source> <translation>Sobre o Richcoin Core</translation> </message> <message> <source>&lt;b&gt;Richcoin Core&lt;/b&gt; version</source> <translation>versão do &lt;b&gt;Richcoin Core&lt;/b&gt;</translation> </message> <message> <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> <message> <source>Copyright</source> <translation>Copyright</translation> </message> <message> <source>The Bitcoin and Richcoin Core developers</source> <translation>Programadores do Richcoin Core</translation> </message> <message> <source>(%1-bit)</source> <translation>(%1-bit)</translation> </message> </context> <context> <name>AddressBookPage</name> <message> <source>Double-click to edit address or label</source> <translation>Duplo-clique para editar o endereço ou o rótulo</translation> </message> <message> <source>Create a new address</source> <translation>Criar um novo endereço</translation> </message> <message> <source>&amp;New</source> <translation>&amp;Novo</translation> </message> <message> <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> <source>&amp;Copy</source> <translation>&amp;Copiar</translation> </message> <message> <source>C&amp;lose</source> <translation>&amp;Fechar</translation> </message> <message> <source>&amp;Copy Address</source> <translation>&amp;Copiar Endereço</translation> </message> <message> <source>Delete the currently selected address from the list</source> <translation>Excluir os endereços selecionados da lista</translation> </message> <message> <source>Export the data in the current tab to a file</source> <translation>Exportar os dados na aba atual para um arquivo</translation> </message> <message> <source>&amp;Export</source> <translation>&amp;Exportar</translation> </message> <message> <source>&amp;Delete</source> <translation>&amp;Excluir</translation> </message> <message> <source>Choose the address to send coins to</source> <translation>Escolha o endereço para enviar moedas</translation> </message> <message> <source>Choose the address to receive coins with</source> <translation>Escolha o endereço para receber moedas</translation> </message> <message> <source>C&amp;hoose</source> <translation>Escol&amp;ha</translation> </message> <message> <source>Sending addresses</source> <translation>Enviando endereços</translation> </message> <message> <source>Receiving addresses</source> <translation>Recebendo endereços</translation> </message> <message> <source>These are your Richcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation>Estes são os seus endereços Richcoin para receber pagamentos. Você pode querer enviar um endereço diferente para cada remetente, para acompanhar quem está pagando.</translation> </message> <message> <source>These are your Richcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source> <translation>Estes são os seus endereços Richcoin para receber pagamentos. Recomenda-se a utilização de um novo endereço de recebimento para cada transação.</translation> </message> <message> <source>Copy &amp;Label</source> <translation>Copiar &amp;Rótulo</translation> </message> <message> <source>&amp;Edit</source> <translation>&amp;Editar</translation> </message> <message> <source>Export Address List</source> <translation>Exportar lista de endereços</translation> </message> <message> <source>Comma separated file (*.csv)</source> <translation>Arquivo separado por vírgulas (*. csv)</translation> </message> <message> <source>Exporting Failed</source> <translation>Exportação Falhou</translation> </message> <message> <source>There was an error trying to save the address list to %1.</source> <translation>Ocorreu um erro ao tentar salvar a lista de endereço em %1.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <source>Label</source> <translation>Rótulo</translation> </message> <message> <source>Address</source> <translation>Endereço</translation> </message> <message> <source>(no label)</source> <translation>(Sem rótulo)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <source>Passphrase Dialog</source> <translation>Janela da Frase de Segurança</translation> </message> <message> <source>Enter passphrase</source> <translation>Digite a frase de segurança</translation> </message> <message> <source>New passphrase</source> <translation>Nova frase de segurança</translation> </message> <message> <source>Repeat new passphrase</source> <translation>Repita a nova frase de segurança</translation> </message> <message> <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> <source>Encrypt wallet</source> <translation>Criptografar carteira</translation> </message> <message> <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> <source>Unlock wallet</source> <translation>Desbloquear carteira</translation> </message> <message> <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> <source>Decrypt wallet</source> <translation>Descriptografar carteira</translation> </message> <message> <source>Change passphrase</source> <translation>Alterar frase de segurança</translation> </message> <message> <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> <source>Confirm wallet encryption</source> <translation>Confirmar criptografia da carteira</translation> </message> <message> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR RICHCOINS&lt;/b&gt;!</source> <translation>Atenção: Se você criptografar sua carteira e perder sua senha, você vai &lt;b&gt;perder todos os seus RICHCOINS!&lt;/b&gt;</translation> </message> <message> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Tem certeza de que deseja criptografar sua carteira?</translation> </message> <message> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation>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> <source>Warning: The Caps Lock key is on!</source> <translation>Atenção: A tecla Caps Lock está ligada!</translation> </message> <message> <source>Wallet encrypted</source> <translation>Carteira criptografada</translation> </message> <message> <source>Richcoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your richcoins from being stolen by malware infecting your computer.</source> <translation>O Richcoin irá fechar agora para finalizar o processo de encriptação. Lembre-se de que encriptar sua carteira não protege totalmente suas richcoins de serem roubadas por malwares que tenham infectado o seu computador.</translation> </message> <message> <source>Wallet encryption failed</source> <translation>A criptografia da carteira falhou</translation> </message> <message> <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> <source>The supplied passphrases do not match.</source> <translation>A frase de segurança fornecida não confere.</translation> </message> <message> <source>Wallet unlock failed</source> <translation>O desbloqueio da carteira falhou</translation> </message> <message> <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> <source>Wallet decryption failed</source> <translation>A descriptografia da carteira falhou</translation> </message> <message> <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> <source>Sign &amp;message...</source> <translation>&amp;Assinar Mensagem...</translation> </message> <message> <source>Synchronizing with network...</source> <translation>Sincronizando com a rede...</translation> </message> <message> <source>&amp;Overview</source> <translation>&amp;Visão geral</translation> </message> <message> <source>Node</source> <translation>Nó</translation> </message> <message> <source>Show general overview of wallet</source> <translation>Mostrar visão geral da carteira</translation> </message> <message> <source>&amp;Transactions</source> <translation>&amp;Transações</translation> </message> <message> <source>Browse transaction history</source> <translation>Navegar pelo histórico de transações</translation> </message> <message> <source>E&amp;xit</source> <translation>S&amp;air</translation> </message> <message> <source>Quit application</source> <translation>Sair da aplicação</translation> </message> <message> <source>Show information about Richcoin</source> <translation>Mostrar informação sobre Richcoin</translation> </message> <message> <source>About &amp;Qt</source> <translation>Sobre &amp;Qt</translation> </message> <message> <source>Show information about Qt</source> <translation>Mostrar informações sobre o Qt</translation> </message> <message> <source>&amp;Options...</source> <translation>&amp;Opções...</translation> </message> <message> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Criptografar Carteira...</translation> </message> <message> <source>&amp;Backup Wallet...</source> <translation>&amp;Backup Carteira...</translation> </message> <message> <source>&amp;Change Passphrase...</source> <translation>&amp;Mudar frase de segurança...</translation> </message> <message> <source>&amp;Sending addresses...</source> <translation>Enviando endereço&amp;s...</translation> </message> <message> <source>&amp;Receiving addresses...</source> <translation>&amp;Receber endereços...</translation> </message> <message> <source>Open &amp;URI...</source> <translation>Abrir &amp;URI...</translation> </message> <message> <source>Importing blocks from disk...</source> <translation>Importando blocos do disco...</translation> </message> <message> <source>Reindexing blocks on disk...</source> <translation>Reindexando blocos no disco...</translation> </message> <message> <source>Send coins to a Richcoin address</source> <translation>Enviar moedas para um endereço bitcoin</translation> </message> <message> <source>Modify configuration options for Richcoin</source> <translation>Modificar opções de configuração para bitcoin</translation> </message> <message> <source>Backup wallet to another location</source> <translation>Fazer cópia de segurança da carteira para uma outra localização</translation> </message> <message> <source>Change the passphrase used for wallet encryption</source> <translation>Mudar a frase de segurança utilizada na criptografia da carteira</translation> </message> <message> <source>&amp;Debug window</source> <translation>Janela de &amp;Depuração</translation> </message> <message> <source>Open debugging and diagnostic console</source> <translation>Abrir console de depuração e diagnóstico</translation> </message> <message> <source>&amp;Verify message...</source> <translation>&amp;Verificar mensagem...</translation> </message> <message> <source>Richcoin</source> <translation>Richcoin</translation> </message> <message> <source>Wallet</source> <translation>Carteira</translation> </message> <message> <source>&amp;Send</source> <translation>&amp;Enviar</translation> </message> <message> <source>&amp;Receive</source> <translation>&amp;Receber</translation> </message> <message> <source>&amp;Show / Hide</source> <translation>&amp;Exibir/Ocultar</translation> </message> <message> <source>Show or hide the main Window</source> <translation>Mostrar ou esconder a Janela Principal.</translation> </message> <message> <source>Encrypt the private keys that belong to your wallet</source> <translation>Criptografar as chaves privadas que pertencem à sua carteira</translation> </message> <message> <source>Sign messages with your Richcoin addresses to prove you own them</source> <translation>Assine mensagems com seus endereços Richcoin para provar que você é dono deles</translation> </message> <message> <source>Verify messages to ensure they were signed with specified Richcoin addresses</source> <translation>Verificar mensagens para se assegurar que elas foram assinadas pelo dono de Endereços Richcoin específicos</translation> </message> <message> <source>&amp;File</source> <translation>&amp;Arquivo</translation> </message> <message> <source>&amp;Settings</source> <translation>&amp;Configurações</translation> </message> <message> <source>&amp;Help</source> <translation>&amp;Ajuda</translation> </message> <message> <source>Tabs toolbar</source> <translation>Barra de ferramentas</translation> </message> <message> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <source>Richcoin Core</source> <translation>Núcleo Richcoin</translation> </message> <message> <source>Request payments (generates QR codes and richcoin: URIs)</source> <translation>Solicitações de pagamentos (gera códigos QR e richcoin: URIs)</translation> </message> <message> <source>&amp;About Richcoin Core</source> <translation>&amp;A respeito do Richcoin Core</translation> </message> <message> <source>Show the list of used sending addresses and labels</source> <translation>Mostrar a lista de endereços de envio e rótulos usados</translation> </message> <message> <source>Show the list of used receiving addresses and labels</source> <translation>Mostrar a lista de endereços de recebimento usados ​​e rótulos</translation> </message> <message> <source>Open a richcoin: URI or payment request</source> <translation>Abrir um richcoin: URI ou cobrança</translation> </message> <message> <source>&amp;Command-line options</source> <translation>Opções de linha de &amp;comando</translation> </message> <message> <source>Show the Richcoin Core help message to get a list with possible Richcoin command-line options</source> <translation>Mostra a mensagem de ajuda do Richcoin Core para pegar a lista com os comandos possíveis</translation> </message> <message> <source>Richcoin client</source> <translation>Cliente Richcoin</translation> </message> <message numerus="yes"> <source>%n active connection(s) to Richcoin network</source> <translation><numerusform>%n conexão ativa na rede Richcoin</numerusform><numerusform>%n conexões ativas na rede Richcoin</numerusform></translation> </message> <message> <source>No block source available...</source> <translation>Nenhum servidor disponível...</translation> </message> <message> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation>Processado %1 de %2 blocos (estimado) de histórico de transações.</translation> </message> <message> <source>Processed %1 blocks of transaction history.</source> <translation>Processado %1 blocos do histórico de transações.</translation> </message> <message numerus="yes"> <source>%n hour(s)</source> <translation><numerusform>%n hora</numerusform><numerusform>%n horas</numerusform></translation> </message> <message numerus="yes"> <source>%n day(s)</source> <translation><numerusform>%n dia</numerusform><numerusform>%n dias</numerusform></translation> </message> <message numerus="yes"> <source>%n week(s)</source> <translation><numerusform>%n semana</numerusform><numerusform>%n semanas</numerusform></translation> </message> <message> <source>%1 and %2</source> <translation>%1 e %2</translation> </message> <message numerus="yes"> <source>%n year(s)</source> <translation><numerusform>%n ano</numerusform><numerusform>%n anos</numerusform></translation> </message> <message> <source>%1 behind</source> <translation>%1 atrás</translation> </message> <message> <source>Last received block was generated %1 ago.</source> <translation>Último bloco recebido foi gerado %1 atrás.</translation> </message> <message> <source>Transactions after this will not yet be visible.</source> <translation>Transações após isso ainda não estão visíveis.</translation> </message> <message> <source>Error</source> <translation>Erro</translation> </message> <message> <source>Warning</source> <translation>Atenção</translation> </message> <message> <source>Information</source> <translation>Informação</translation> </message> <message> <source>Up to date</source> <translation>Atualizado</translation> </message> <message> <source>Catching up...</source> <translation>Recuperando o atraso ...</translation> </message> <message> <source>Sent transaction</source> <translation>Transação enviada</translation> </message> <message> <source>Incoming transaction</source> <translation>Transação recebida</translation> </message> <message> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Data: %1 Quantidade: %2 Tipo: %3 Endereço: %4</translation> </message> <message> <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> <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> <source>A fatal error occurred. Richcoin can no longer continue safely and will quit.</source> <translation>Um erro fatal ocorreu. Richcoin não pode continuar em segurança e irá fechar.</translation> </message> </context> <context> <name>ClientModel</name> <message> <source>Network Alert</source> <translation>Alerta da Rede</translation> </message> </context> <context> <name>CoinControlDialog</name> <message> <source>Coin Control Address Selection</source> <translation>Coin Control Address Selection</translation> </message> <message> <source>Quantity:</source> <translation>Quantidade:</translation> </message> <message> <source>Bytes:</source> <translation>Bytes:</translation> </message> <message> <source>Amount:</source> <translation>Quantia:</translation> </message> <message> <source>Priority:</source> <translation>Prioridade:</translation> </message> <message> <source>Fee:</source> <translation>Taxa:</translation> </message> <message> <source>Low Output:</source> <translation>Rendimento baixo:</translation> </message> <message> <source>After Fee:</source> <translation>Depois da taxa:</translation> </message> <message> <source>Change:</source> <translation>trocar</translation> </message> <message> <source>(un)select all</source> <translation>(de)selecionar tudo</translation> </message> <message> <source>Tree mode</source> <translation>Modo árvore</translation> </message> <message> <source>List mode</source> <translation>Modo lista</translation> </message> <message> <source>Amount</source> <translation>Quantidade</translation> </message> <message> <source>Address</source> <translation>Endereço</translation> </message> <message> <source>Date</source> <translation>Data</translation> </message> <message> <source>Confirmations</source> <translation>Confirmações</translation> </message> <message> <source>Confirmed</source> <translation>Confirmado</translation> </message> <message> <source>Priority</source> <translation>Prioridade</translation> </message> <message> <source>Copy address</source> <translation>Copiar endereço</translation> </message> <message> <source>Copy label</source> <translation>Copiar rótulo</translation> </message> <message> <source>Copy amount</source> <translation>Copiar quantia</translation> </message> <message> <source>Copy transaction ID</source> <translation>Copiar ID da transação</translation> </message> <message> <source>Lock unspent</source> <translation>Travar não gasto</translation> </message> <message> <source>Unlock unspent</source> <translation>Destravar não gasto</translation> </message> <message> <source>Copy quantity</source> <translation>Copiar quantidade</translation> </message> <message> <source>Copy fee</source> <translation>Copiar taxa</translation> </message> <message> <source>Copy after fee</source> <translation>Copia pós-taxa</translation> </message> <message> <source>Copy bytes</source> <translation>Copiar bytes</translation> </message> <message> <source>Copy priority</source> <translation>Copia prioridade</translation> </message> <message> <source>Copy low output</source> <translation>Copia saída de pouco valor</translation> </message> <message> <source>Copy change</source> <translation>Copia alteração</translation> </message> <message> <source>highest</source> <translation>mais alta possível</translation> </message> <message> <source>higher</source> <translation>muito alta</translation> </message> <message> <source>high</source> <translation>alta</translation> </message> <message> <source>medium-high</source> <translation>média-alta</translation> </message> <message> <source>medium</source> <translation>média</translation> </message> <message> <source>low-medium</source> <translation>média-baixa</translation> </message> <message> <source>low</source> <translation>baixa</translation> </message> <message> <source>lower</source> <translation>muito baixa</translation> </message> <message> <source>lowest</source> <translation>a mais baixa possível</translation> </message> <message> <source>(%1 locked)</source> <translation>(%1 travado)</translation> </message> <message> <source>none</source> <translation>nenhum</translation> </message> <message> <source>Dust</source> <translation>Sujeira</translation> </message> <message> <source>yes</source> <translation>sim</translation> </message> <message> <source>no</source> <translation>não</translation> </message> <message> <source>This label turns red, if the transaction size is greater than 1000 bytes.</source> <translation>Esse marcador fica vermelho se a transação ultrapassar 1000 bytes.</translation> </message> <message> <source>This means a fee of at least %1 per kB is required.</source> <translation>Isso significa que uma taxa de pelo menos %1 por kB é necessária.</translation> </message> <message> <source>Can vary +/- 1 byte per input.</source> <translation>Pode variar +/- 1 byte por entrada.</translation> </message> <message> <source>Transactions with higher priority are more likely to get included into a block.</source> <translation>Transações de alta prioridade são mais propensas a serem incluídas em um bloco.</translation> </message> <message> <source>This label turns red, if the priority is smaller than &quot;medium&quot;.</source> <translation>Esse marcador fica vermelho se a prioridade for menor que &quot;média&quot;.</translation> </message> <message> <source>This label turns red, if any recipient receives an amount smaller than %1.</source> <translation>Esse marcador fica vermelho se qualquer destinatário receber uma quantia menor que %1</translation> </message> <message> <source>This means a fee of at least %1 is required.</source> <translation>Isso significa que uma taxa de pelo menos %1 é necessária.</translation> </message> <message> <source>Amounts below 0.546 times the minimum relay fee are shown as dust.</source> <translation>Quantias abaixo de 0,546 multiplicado pela taxa mínima é mostrada como sujeira.</translation> </message> <message> <source>This label turns red, if the change is smaller than %1.</source> <translation>Esse marcador fica vermelho se o troco for menor que %1.</translation> </message> <message> <source>(no label)</source> <translation>(Sem rótulo)</translation> </message> <message> <source>change from %1 (%2)</source> <translation>troco de %1 (%2)</translation> </message> <message> <source>(change)</source> <translation>(troco)</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <source>Edit Address</source> <translation>Editar Endereço</translation> </message> <message> <source>&amp;Label</source> <translation>&amp;Rótulo</translation> </message> <message> <source>The label associated with this address list entry</source> <translation>O rótulo associado a esta entrada na lista de endereços</translation> </message> <message> <source>The address associated with this address list entry. This can only be modified for sending addresses.</source> <translation>O endereço associado a esta lista de endereços de entrada. Isso só pode ser modificado para o envio de endereços.</translation> </message> <message> <source>&amp;Address</source> <translation>&amp;Endereço</translation> </message> <message> <source>New receiving address</source> <translation>Novo endereço de recebimento</translation> </message> <message> <source>New sending address</source> <translation>Novo endereço de envio</translation> </message> <message> <source>Edit receiving address</source> <translation>Editar endereço de recebimento</translation> </message> <message> <source>Edit sending address</source> <translation>Editar endereço de envio</translation> </message> <message> <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> <source>The entered address &quot;%1&quot; is not a valid Richcoin address.</source> <translation>O endereço digitado &quot;%1&quot; não é um endereço Richcoin válido.</translation> </message> <message> <source>Could not unlock wallet.</source> <translation>Não foi possível desbloquear a carteira.</translation> </message> <message> <source>New key generation failed.</source> <translation>A geração de nova chave falhou.</translation> </message> </context> <context> <name>FreespaceChecker</name> <message> <source>A new data directory will be created.</source> <translation>Um novo diretório de dados será criado.</translation> </message> <message> <source>name</source> <translation>nome</translation> </message> <message> <source>Directory already exists. Add %1 if you intend to create a new directory here.</source> <translation>O diretório já existe. Adicione %1 se você pretende criar um novo diretório aqui.</translation> </message> <message> <source>Path already exists, and is not a directory.</source> <translation>Esta pasta já existe, e não é um diretório.</translation> </message> <message> <source>Cannot create data directory here.</source> <translation>Não é possível criar um diretório de dados aqui.</translation> </message> </context> <context> <name>HelpMessageDialog</name> <message> <source>Richcoin Core - Command-line options</source> <translation>Richcoin Core - Opções de linha de comando</translation> </message> <message> <source>Richcoin Core</source> <translation>Núcleo Richcoin</translation> </message> <message> <source>version</source> <translation>versão</translation> </message> <message> <source>Usage:</source> <translation>Uso:</translation> </message> <message> <source>command-line options</source> <translation>opções da linha de comando</translation> </message> <message> <source>UI options</source> <translation>opções da UI</translation> </message> <message> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>Escolher língua, por exemplo &quot;de_DE&quot; (padrão: localização do sistema)</translation> </message> <message> <source>Start minimized</source> <translation>Inicializar minimizado</translation> </message> <message> <source>Set SSL root certificates for payment request (default: -system-)</source> <translation>Define certificados SSL root para requisição de pagamento (padrão: -system-)</translation> </message> <message> <source>Show splash screen on startup (default: 1)</source> <translation>Mostrar tela inicial ao ligar (padrão: 1)</translation> </message> <message> <source>Choose data directory on startup (default: 0)</source> <translation>Escolha o diretório de dados na inicialização (padrão: 0)</translation> </message> </context> <context> <name>Intro</name> <message> <source>Welcome</source> <translation>Bem-vindo</translation> </message> <message> <source>Welcome to Richcoin Core.</source> <translation>Bem vindo ao Richcoin Core.</translation> </message> <message> <source>As this is the first time the program is launched, you can choose where Richcoin Core will store its data.</source> <translation>A primeira vez que o programa é aberto você pode escolher onde o Richcoin Core vai guardar os dados.</translation> </message> <message> <source>Richcoin Core will download and store a copy of the Richcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory.</source> <translation>Richcoin Core vai fazer download e guardar uma cópia da longa e única cadeia de blocos do Bitcoin: Blockchain. Pelo menos %1 GB de dados serão armazenados nesse diretório e isso aumentará ao longo do tempo. Sua carteira também será armazenada nesse diretório.</translation> </message> <message> <source>Use the default data directory</source> <translation>Use o diretório de dados padrão</translation> </message> <message> <source>Use a custom data directory:</source> <translation>Use um diretório de dados personalizado:</translation> </message> <message> <source>Richcoin</source> <translation>Richcoin</translation> </message> <message> <source>Error: Specified data directory &quot;%1&quot; can not be created.</source> <translation>Erro: dados especificados diretório &quot;% 1&quot; não pode ser criado.</translation> </message> <message> <source>Error</source> <translation>Erro</translation> </message> <message> <source>GB of free space available</source> <translation>GB de espaço disponível</translation> </message> <message> <source>(of %1GB needed)</source> <translation>(Mais de 1GB necessário)</translation> </message> </context> <context> <name>OpenURIDialog</name> <message> <source>Open URI</source> <translation>Abrir URI</translation> </message> <message> <source>Open payment request from URI or file</source> <translation>Cobrança aberta de URI ou arquivo</translation> </message> <message> <source>URI:</source> <translation>URI:</translation> </message> <message> <source>Select payment request file</source> <translation>Selecione o arquivo de cobrança</translation> </message> <message> <source>Select payment request file to open</source> <translation>Selecione o arquivo de cobrança para ser aberto</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <source>Options</source> <translation>Opções</translation> </message> <message> <source>&amp;Main</source> <translation>Principal</translation> </message> <message> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source> <translation>Taxa de transação opcional por kB que ajuda a garantir que suas transações sejam processadas rapidamente. A maioria das transações são de 1 kB.</translation> </message> <message> <source>Pay transaction &amp;fee</source> <translation>Pagar taxa de &amp;transação</translation> </message> <message> <source>Automatically start Richcoin after logging in to the system.</source> <translation>Iniciar Richcoin automaticamente após se logar no sistema.</translation> </message> <message> <source>&amp;Start Richcoin on system login</source> <translation>Iniciar Richcoin no login do sistema</translation> </message> <message> <source>Size of &amp;database cache</source> <translation>Tamanho do banco de &amp;dados do cache</translation> </message> <message> <source>MB</source> <translation>MB</translation> </message> <message> <source>Number of script &amp;verification threads</source> <translation>Número de threads do script de &amp;verificação</translation> </message> <message> <source>Connect to the Richcoin network through a SOCKS proxy.</source> <translation>Conectado na rede do Richcoin através de proxy SOCKS.</translation> </message> <message> <source>&amp;Connect through SOCKS proxy (default proxy):</source> <translation>&amp;Conectado via proxy SOCKS (padrão proxy):</translation> </message> <message> <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source> <translation>Endereço de IP do proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</translation> </message> <message> <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source> <translation type="unfinished"/> </message> <message> <source>Third party transaction URLs</source> <translation type="unfinished"/> </message> <message> <source>Active command-line options that override above options:</source> <translation>Ativa as opções de linha de comando que sobrescreve as opções acima:</translation> </message> <message> <source>Reset all client options to default.</source> <translation>Redefinir todas as opções do cliente para opções padrão.</translation> </message> <message> <source>&amp;Reset Options</source> <translation>&amp;Redefinir opções</translation> </message> <message> <source>&amp;Network</source> <translation>Rede</translation> </message> <message> <source>(0 = auto, &lt;0 = leave that many cores free)</source> <translation>(0 = automático, &lt;0 = número de cores deixados livres)</translation> </message> <message> <source>W&amp;allet</source> <translation>C&amp;arteira</translation> </message> <message> <source>Expert</source> <translation>Avançado</translation> </message> <message> <source>Enable coin &amp;control features</source> <translation>Habilitar opções de &amp;controle de moedas</translation> </message> <message> <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source> <translation>Se você desabilitar o gasto de um troco não confirmado, o troco da transação não poderá ser utilizado até a transação ter pelo menos uma confirmação. Isso também afeta seu saldo computado.</translation> </message> <message> <source>&amp;Spend unconfirmed change</source> <translation>Ga&amp;star mudança não confirmada</translation> </message> <message> <source>Automatically open the Richcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>Abrir as portas do cliente Richcoin automaticamente no roteador. Isto só funcionará se seu roteador suportar UPnP e esta função estiver habilitada.</translation> </message> <message> <source>Map port using &amp;UPnP</source> <translation>Mapear porta usando &amp;UPnP</translation> </message> <message> <source>Proxy &amp;IP:</source> <translation>&amp;IP do proxy:</translation> </message> <message> <source>&amp;Port:</source> <translation>&amp;Porta:</translation> </message> <message> <source>Port of the proxy (e.g. 9050)</source> <translation>Porta do serviço de proxy (ex. 9050)</translation> </message> <message> <source>SOCKS &amp;Version:</source> <translation>&amp;Versão do SOCKS:</translation> </message> <message> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>Versão do proxy SOCKS (ex. 5)</translation> </message> <message> <source>&amp;Window</source> <translation>&amp;Janela</translation> </message> <message> <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> <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> <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> <source>M&amp;inimize on close</source> <translation>M&amp;inimizar ao sair</translation> </message> <message> <source>&amp;Display</source> <translation>&amp;Mostrar</translation> </message> <message> <source>User Interface &amp;language:</source> <translation>&amp;Língua da interface com usuário:</translation> </message> <message> <source>The user interface language can be set here. This setting will take effect after restarting Richcoin.</source> <translation>A língua da interface com usuário pode ser escolhida aqui. Esta configuração só surtirá efeito após reiniciar o Richcoin.</translation> </message> <message> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Unidade usada para mostrar quantidades:</translation> </message> <message> <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 richcoins.</translation> </message> <message> <source>Whether to show Richcoin addresses in the transaction list or not.</source> <translation>Mostrar ou não endereços Richcoin na lista de transações.</translation> </message> <message> <source>&amp;Display addresses in transaction list</source> <translation>Mostrar en&amp;dereços na lista de transações</translation> </message> <message> <source>Whether to show coin control features or not.</source> <translation>Mostrar ou não opções de controle da moeda.</translation> </message> <message> <source>&amp;OK</source> <translation>&amp;OK</translation> </message> <message> <source>&amp;Cancel</source> <translation>&amp;Cancelar</translation> </message> <message> <source>default</source> <translation>padrão</translation> </message> <message> <source>none</source> <translation>nenhum</translation> </message> <message> <source>Confirm options reset</source> <translation>Confirmar redefinição de opções</translation> </message> <message> <source>Client restart required to activate changes.</source> <translation>Reinicialização do aplicativo necessária para efetivar alterações.</translation> </message> <message> <source>Client will be shutdown, do you want to proceed?</source> <translation>O aplicativo vai desligar, deseja continuar?</translation> </message> <message> <source>This change would require a client restart.</source> <translation>Essa mudança requer uma reinicialização do aplicativo.</translation> </message> <message> <source>The supplied proxy address is invalid.</source> <translation>O endereço proxy fornecido é inválido.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <source>Form</source> <translation>Formulário</translation> </message> <message> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Richcoin network after a connection is established, but this process has not completed yet.</source> <translation>A informação mostrada pode estar desatualizada. Sua carteira sincroniza automaticamente com a rede Richcoin depois que a conexão é estabelecida, mas este processo pode não estar completo ainda.</translation> </message> <message> <source>Wallet</source> <translation>Carteira</translation> </message> <message> <source>Available:</source> <translation>Disponível:</translation> </message> <message> <source>Your current spendable balance</source> <translation>Seu saldo atual spendable</translation> </message> <message> <source>Pending:</source> <translation>Pendente:</translation> </message> <message> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source> <translation>Total de transações que ainda têm de ser confirmados, e ainda não contam para o equilíbrio spendable</translation> </message> <message> <source>Immature:</source> <translation>Imaturo:</translation> </message> <message> <source>Mined balance that has not yet matured</source> <translation>Saldo minerado que ainda não maturou</translation> </message> <message> <source>Total:</source> <translation>Total:</translation> </message> <message> <source>Your current total balance</source> <translation>Seu saldo total atual</translation> </message> <message> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Transações recentes&lt;/b&gt;</translation> </message> <message> <source>out of sync</source> <translation>fora de sincronia</translation> </message> </context> <context> <name>PaymentServer</name> <message> <source>URI handling</source> <translation>Manipulação de URI</translation> </message> <message> <source>URI can not be parsed! This can be caused by an invalid Richcoin address or malformed URI parameters.</source> <translation>URI não pode ser decodificado! Isso pode ter sido causado por um endereço Richcoin inválido ou por parâmetros URI malformados.</translation> </message> <message> <source>Requested payment amount of %1 is too small (considered dust).</source> <translation>Valor do pagamento solicitado de 1% é muito pequeno (Considerado poeira).</translation> </message> <message> <source>Payment request error</source> <translation>Erro no pedido de pagamento</translation> </message> <message> <source>Cannot start richcoin: click-to-pay handler</source> <translation>Não foi possível iniciar richcoin: manipulador clique-para-pagar</translation> </message> <message> <source>Net manager warning</source> <translation>Gerenciador de rede problemático</translation> </message> <message> <source>Your active proxy doesn&apos;t support SOCKS5, which is required for payment requests via proxy.</source> <translation>Seu proxy ativo não suporta SOCKS5, que é obrigatório para cobranças via proxy.</translation> </message> <message> <source>Payment request fetch URL is invalid: %1</source> <translation>URL de cobrança é inválida: %1</translation> </message> <message> <source>Payment request file handling</source> <translation>Manipulação de arquivo de cobrança</translation> </message> <message> <source>Payment request file can not be read or processed! This can be caused by an invalid payment request file.</source> <translation>Arquivo de cobrança não pôde ser lido ou processado! Isso pode ter sido causado por um arquivo de cobrança inválido.</translation> </message> <message> <source>Unverified payment requests to custom payment scripts are unsupported.</source> <translation>Cobrança não verificada para scripts de pagamento personalizados não é suportado.</translation> </message> <message> <source>Refund from %1</source> <translation>Reembolso de 1%</translation> </message> <message> <source>Error communicating with %1: %2</source> <translation>Erro na comunicação com% 1:% 2</translation> </message> <message> <source>Payment request can not be parsed or processed!</source> <translation>Cobrança não pôde ser processada!</translation> </message> <message> <source>Bad response from server %1</source> <translation>Resposta ruim do servidor% 1</translation> </message> <message> <source>Payment acknowledged</source> <translation>Pagamento reconhecido</translation> </message> <message> <source>Network request error</source> <translation>Erro de solicitação de rede</translation> </message> </context> <context> <name>QObject</name> <message> <source>Richcoin</source> <translation>Richcoin</translation> </message> <message> <source>Error: Specified data directory &quot;%1&quot; does not exist.</source> <translation>Erro: diretório de dados especificado &quot;% 1&quot; não existe.</translation> </message> <message> <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source> <translation>Erro: Não foi possível interpretar arquivo de configuração: %1. Utilize apenas a sintaxe chave=valor.</translation> </message> <message> <source>Error: Invalid combination of -regtest and -testnet.</source> <translation>Erro: Combinação inválida de-regtest e testnet.</translation> </message> <message> <source>Richcoin Core didn&apos;t yet exit safely...</source> <translation type="unfinished"/> </message> <message> <source>Enter a Richcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation>Digite um endereço Richcoin (exemplo: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> </message> </context> <context> <name>QRImageWidget</name> <message> <source>&amp;Save Image...</source> <translation>&amp;Salvar imagem</translation> </message> <message> <source>&amp;Copy Image</source> <translation>&amp;Copiar Imagem</translation> </message> <message> <source>Save QR Code</source> <translation>Salvar código QR</translation> </message> <message> <source>PNG Image (*.png)</source> <translation>PNG Imagem (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <source>Client name</source> <translation>Nome do cliente</translation> </message> <message> <source>N/A</source> <translation>N/A</translation> </message> <message> <source>Client version</source> <translation>Versão do cliente</translation> </message> <message> <source>&amp;Information</source> <translation>&amp;Informação</translation> </message> <message> <source>Debug window</source> <translation>Janela de debug</translation> </message> <message> <source>General</source> <translation>Geral</translation> </message> <message> <source>Using OpenSSL version</source> <translation>Usando OpenSSL versão</translation> </message> <message> <source>Startup time</source> <translation>Horário de inicialização</translation> </message> <message> <source>Network</source> <translation>Rede</translation> </message> <message> <source>Name</source> <translation>Nome</translation> </message> <message> <source>Number of connections</source> <translation>Número de conexões</translation> </message> <message> <source>Block chain</source> <translation>Corrente de blocos</translation> </message> <message> <source>Current number of blocks</source> <translation>Quantidade atual de blocos</translation> </message> <message> <source>Estimated total blocks</source> <translation>Total estimado de blocos</translation> </message> <message> <source>Last block time</source> <translation>Horário do último bloco</translation> </message> <message> <source>&amp;Open</source> <translation>&amp;Abrir</translation> </message> <message> <source>&amp;Console</source> <translation>&amp;Console</translation> </message> <message> <source>&amp;Network Traffic</source> <translation>Tráfico de Rede</translation> </message> <message> <source>&amp;Clear</source> <translation>&amp;Limpar</translation> </message> <message> <source>Totals</source> <translation>Totais</translation> </message> <message> <source>In:</source> <translation>Entrada:</translation> </message> <message> <source>Out:</source> <translation>Saída:</translation> </message> <message> <source>Build date</source> <translation>Data do &apos;build&apos;</translation> </message> <message> <source>Debug log file</source> <translation>Arquivo de log de Depuração</translation> </message> <message> <source>Open the Richcoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>Abrir o arquivo de log de depuração do Richcoin do diretório atual de dados. Isso pode levar alguns segundos para arquivos de log grandes.</translation> </message> <message> <source>Clear console</source> <translation>Limpar console</translation> </message> <message> <source>Welcome to the Richcoin RPC console.</source> <translation>Bem-vindo ao console Richcoin RPC.</translation> </message> <message> <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> <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> <message> <source>%1 B</source> <translation>1% B</translation> </message> <message> <source>%1 KB</source> <translation>1% KB</translation> </message> <message> <source>%1 MB</source> <translation>%1 MB</translation> </message> <message> <source>%1 GB</source> <translation>%1 GB</translation> </message> <message> <source>%1 m</source> <translation>%1 m</translation> </message> <message> <source>%1 h</source> <translation>%1 h</translation> </message> <message> <source>%1 h %2 m</source> <translation>%1 h %2 m</translation> </message> </context> <context> <name>ReceiveCoinsDialog</name> <message> <source>&amp;Amount:</source> <translation>Qu&amp;antia:</translation> </message> <message> <source>&amp;Label:</source> <translation>&amp;Rótulo:</translation> </message> <message> <source>&amp;Message:</source> <translation>&amp;Mensagem</translation> </message> <message> <source>Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before.</source> <translation>Reutilize um dos endereços de recebimento anteriormente utilizados. Reutilizar um endereço implica em problemas com segurança e privacidade. Não reutilize a menos que esteja refazendo uma cobrança já feita anteriormente.</translation> </message> <message> <source>R&amp;euse an existing receiving address (not recommended)</source> <translation>R&amp;eutilize um endereço de recebimento (não recomendado)</translation> </message> <message> <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Richcoin network.</source> <translation>Uma mensagem opcional que será anexada na cobrança e será mostrada quando ela for aberta. Nota: A mensagem não será enviada com o pagamento pela rede Richcoin.</translation> </message> <message> <source>An optional label to associate with the new receiving address.</source> <translation>Um marcador opcional para associar ao novo endereço de recebimento.</translation> </message> <message> <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source> <translation>Use esse formulário para fazer cobranças. Todos os campos são &lt;b&gt;opcionais&lt;/b&gt;.</translation> </message> <message> <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source> <translation>Uma quantia opcional para cobrar. Deixe vazio ou em branco se o pagador puder especificar a quantia.</translation> </message> <message> <source>Clear all fields of the form.</source> <translation>Limpa todos os campos do formulário.</translation> </message> <message> <source>Clear</source> <translation>Limpar</translation> </message> <message> <source>Requested payments history</source> <translation>Histórico de cobranças</translation> </message> <message> <source>&amp;Request payment</source> <translation>&amp;Requisitar Pagamento</translation> </message> <message> <source>Show the selected request (does the same as double clicking an entry)</source> <translation>Mostra a cobrança selecionada (o mesmo que clicar duas vezes em um registro)</translation> </message> <message> <source>Show</source> <translation>Mostrar</translation> </message> <message> <source>Remove the selected entries from the list</source> <translation>Remove o registro selecionado da lista</translation> </message> <message> <source>Remove</source> <translation>Remover</translation> </message> <message> <source>Copy label</source> <translation>Copiar rótulo</translation> </message> <message> <source>Copy message</source> <translation>Copiar mensagem</translation> </message> <message> <source>Copy amount</source> <translation>Copiar quantia</translation> </message> </context> <context> <name>ReceiveRequestDialog</name> <message> <source>QR Code</source> <translation>Código QR</translation> </message> <message> <source>Copy &amp;URI</source> <translation>Copiar &amp;URI</translation> </message> <message> <source>Copy &amp;Address</source> <translation>&amp;Copiar Endereço</translation> </message> <message> <source>&amp;Save Image...</source> <translation>&amp;Salvar Imagem...</translation> </message> <message> <source>Request payment to %1</source> <translation>Requisitar pagamento para %1</translation> </message> <message> <source>Payment information</source> <translation>Informação de pagamento</translation> </message> <message> <source>URI</source> <translation>URI</translation> </message> <message> <source>Address</source> <translation>Endereço</translation> </message> <message> <source>Amount</source> <translation>Quantidade</translation> </message> <message> <source>Label</source> <translation>Rótulo</translation> </message> <message> <source>Message</source> <translation>Mensagem</translation> </message> <message> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>URI resultante muito longa. Tente reduzir o texto do rótulo ou da mensagem.</translation> </message> <message> <source>Error encoding URI into QR Code.</source> <translation>Erro ao codigicar o URI em código QR</translation> </message> </context> <context> <name>RecentRequestsTableModel</name> <message> <source>Date</source> <translation>Data</translation> </message> <message> <source>Label</source> <translation>Rótulo</translation> </message> <message> <source>Message</source> <translation>Mensagem</translation> </message> <message> <source>Amount</source> <translation>Quantidade</translation> </message> <message> <source>(no label)</source> <translation>(Sem rótulo)</translation> </message> <message> <source>(no message)</source> <translation>(sem mensagem)</translation> </message> <message> <source>(no amount)</source> <translation>(sem quantia especificada)</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <source>Send Coins</source> <translation>Enviar dinheiro</translation> </message> <message> <source>Coin Control Features</source> <translation>Opções de Controle da Moeda</translation> </message> <message> <source>Inputs...</source> <translation>Entradas...</translation> </message> <message> <source>automatically selected</source> <translation>automaticamente selecionado</translation> </message> <message> <source>Insufficient funds!</source> <translation>Saldo insuficiente!</translation> </message> <message> <source>Quantity:</source> <translation>Quantidade:</translation> </message> <message> <source>Bytes:</source> <translation>Bytes:</translation> </message> <message> <source>Amount:</source> <translation>Quantia:</translation> </message> <message> <source>Priority:</source> <translation>Prioridade:</translation> </message> <message> <source>Fee:</source> <translation>Taxa:</translation> </message> <message> <source>Low Output:</source> <translation>Rendimento baixo:</translation> </message> <message> <source>After Fee:</source> <translation>Depois da taxa:</translation> </message> <message> <source>Change:</source> <translation>trocar</translation> </message> <message> <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source> <translation>Se isso estiver ativo e o endereço de troco estiver vazio ou inválido, o troco será enviado a um novo endereço gerado na hora.</translation> </message> <message> <source>Custom change address</source> <translation>Endereço específico de troco</translation> </message> <message> <source>Send to multiple recipients at once</source> <translation>Enviar para vários destinatários de uma só vez</translation> </message> <message> <source>Add &amp;Recipient</source> <translation>Adicionar destinatário</translation> </message> <message> <source>Clear all fields of the form.</source> <translation>Limpar todos os campos do formulário.</translation> </message> <message> <source>Clear &amp;All</source> <translation>Limpar Tudo</translation> </message> <message> <source>Balance:</source> <translation>Saldo:</translation> </message> <message> <source>Confirm the send action</source> <translation>Confirmar o envio</translation> </message> <message> <source>S&amp;end</source> <translation>Enviar</translation> </message> <message> <source>Confirm send coins</source> <translation>Confirmar envio de dinheiro</translation> </message> <message> <source>%1 to %2</source> <translation>%1 para %2</translation> </message> <message> <source>Copy quantity</source> <translation>Copiar quantidade</translation> </message> <message> <source>Copy amount</source> <translation>Copiar quantia</translation> </message> <message> <source>Copy fee</source> <translation>Copiar taxa</translation> </message> <message> <source>Copy after fee</source> <translation>Copia pós-taxa</translation> </message> <message> <source>Copy bytes</source> <translation>Copiar bytes</translation> </message> <message> <source>Copy priority</source> <translation>Copia prioridade</translation> </message> <message> <source>Copy low output</source> <translation>Copia saída de pouco valor</translation> </message> <message> <source>Copy change</source> <translation>Copia alteração</translation> </message> <message> <source>Total Amount %1 (= %2)</source> <translation>Quantidade Total %1 (= %2)</translation> </message> <message> <source>or</source> <translation>ou</translation> </message> <message> <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> <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> <source>The amount exceeds your balance.</source> <translation>A quantidade excede seu saldo.</translation> </message> <message> <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> <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> <source>Transaction creation failed!</source> <translation>A criação de transação falhou!</translation> </message> <message> <source>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>A transação foi rejeitada! Isso pode acontecer se alguns richcoins na sua carteira já foram gastos em outro local, por exemplo se você tiver uma cópia do wallet.dat e os richcoins tiverem sido gastos na cópia mas não marcados como gastos aqui ainda.</translation> </message> <message> <source>Warning: Invalid Richcoin address</source> <translation>Atenção: endereço de Richcoin inválido</translation> </message> <message> <source>(no label)</source> <translation>(Sem rótulo)</translation> </message> <message> <source>Warning: Unknown change address</source> <translation>Atenção: endereço de troco desconhecido</translation> </message> <message> <source>Are you sure you want to send?</source> <translation>Tem certeza que quer enviar?</translation> </message> <message> <source>added as transaction fee</source> <translation>Adicionado como taxa de transação</translation> </message> <message> <source>Payment request expired</source> <translation>Pedido de pagamento expirado</translation> </message> <message> <source>Invalid payment address %1</source> <translation>Endereço de pagamento inválido %1</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <source>A&amp;mount:</source> <translation>Q&amp;uantidade:</translation> </message> <message> <source>Pay &amp;To:</source> <translation>Pagar &amp;Para:</translation> </message> <message> <source>The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation>O endereço para onde enviar o pagamento (ex. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> </message> <message> <source>Enter a label for this address to add it to your address book</source> <translation>Digite um rótulo para este endereço para adicioná-lo ao catálogo de endereços</translation> </message> <message> <source>&amp;Label:</source> <translation>&amp;Rótulo:</translation> </message> <message> <source>Choose previously used address</source> <translation>Escolher endereço usado anteriormente</translation> </message> <message> <source>This is a normal payment.</source> <translation>Este é um pagamento normal.</translation> </message> <message> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <source>Paste address from clipboard</source> <translation>Colar o endereço da área de transferência</translation> </message> <message> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <source>Remove this entry</source> <translation>Remover esta entrada</translation> </message> <message> <source>Message:</source> <translation>Mensagem:</translation> </message> <message> <source>This is a verified payment request.</source> <translation>Essa é cobrança verificada.</translation> </message> <message> <source>Enter a label for this address to add it to the list of used addresses</source> <translation>Digite um rótulo para este endereço para adicioná-lo no catálogo</translation> </message> <message> <source>A message that was attached to the richcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Richcoin network.</source> <translation>A mensagem que foi anexada ao richcoin: URI na qual será gravada na transação para sua referência. Nota: Essa mensagem não será gravada publicamente na rede Richcoin.</translation> </message> <message> <source>This is an unverified payment request.</source> <translation>Essa é uma cobrança não verificada.</translation> </message> <message> <source>Pay To:</source> <translation>Pague Para:</translation> </message> <message> <source>Memo:</source> <translation>Memorizar:</translation> </message> </context> <context> <name>ShutdownWindow</name> <message> <source>Richcoin Core is shutting down...</source> <translation>Richcoin Core está desligando...</translation> </message> <message> <source>Do not shut down the computer until this window disappears.</source> <translation>Não desligue o computador até esta janela desaparece.</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <source>Signatures - Sign / Verify a Message</source> <translation>Assinaturas - Assinar / Verificar uma mensagem</translation> </message> <message> <source>&amp;Sign Message</source> <translation>&amp;Assinar Mensagem</translation> </message> <message> <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> <source>The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation>Endereço a ser usado para assinar a mensagem (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> </message> <message> <source>Choose previously used address</source> <translation>Escolha um endereço usado anteriormente</translation> </message> <message> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <source>Paste address from clipboard</source> <translation>Colar o endereço da área de transferência</translation> </message> <message> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <source>Enter the message you want to sign here</source> <translation>Entre a mensagem que você quer assinar aqui</translation> </message> <message> <source>Signature</source> <translation>Assinatura</translation> </message> <message> <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> <source>Sign the message to prove you own this Richcoin address</source> <translation>Assinar mensagem para provar que você é dono deste endereço Richcoin</translation> </message> <message> <source>Sign &amp;Message</source> <translation>Assinar &amp;Mensagem</translation> </message> <message> <source>Reset all sign message fields</source> <translation>Limpar todos os campos de assinatura da mensagem</translation> </message> <message> <source>Clear &amp;All</source> <translation>Limpar Tudo</translation> </message> <message> <source>&amp;Verify Message</source> <translation>&amp;Verificar Mensagem</translation> </message> <message> <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> <source>The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation>O endereço usado para assinar a mensagem (ex. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> </message> <message> <source>Verify the message to ensure it was signed with the specified Richcoin address</source> <translation>Verificar mensagem para se assegurar que ela foi assinada pelo dono de um endereço Richcoin específico.</translation> </message> <message> <source>Verify &amp;Message</source> <translation>Verificar %Mensagem</translation> </message> <message> <source>Reset all verify message fields</source> <translation>Limpar todos os campos de assinatura da mensagem</translation> </message> <message> <source>Enter a Richcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation>Digite um endereço Richcoin (exemplo: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> </message> <message> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>Clique em &quot;Assinar Mensagem&quot; para gerar a assinatura</translation> </message> <message> <source>The entered address is invalid.</source> <translation>O endereço fornecido é inválido.</translation> </message> <message> <source>Please check the address and try again.</source> <translation>Por favor, verifique o endereço e tente novamente.</translation> </message> <message> <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> <source>Wallet unlock was cancelled.</source> <translation>Desbloqueamento da Carteira foi cancelado.</translation> </message> <message> <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> <source>Message signing failed.</source> <translation>Assinatura da mensagem falhou.</translation> </message> <message> <source>Message signed.</source> <translation>Mensagem assinada.</translation> </message> <message> <source>The signature could not be decoded.</source> <translation>A assinatura não pode ser decodificada.</translation> </message> <message> <source>Please check the signature and try again.</source> <translation>Por favor, verifique a assinatura e tente novamente.</translation> </message> <message> <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> <source>Message verification failed.</source> <translation>Verificação da mensagem falhou.</translation> </message> <message> <source>Message verified.</source> <translation>Mensagem verificada.</translation> </message> </context> <context> <name>SplashScreen</name> <message> <source>Richcoin Core</source> <translation>Núcleo Richcoin</translation> </message> <message> <source>The Bitcoin and Richcoin Core developers</source> <translation>Programadores do Richcoin Core</translation> </message> <message> <source>[testnet]</source> <translation>[testnet]</translation> </message> </context> <context> <name>TrafficGraphWidget</name> <message> <source>KB/s</source> <translation>KB/s</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <source>Open until %1</source> <translation>Aberto até %1</translation> </message> <message> <source>conflicted</source> <translation>em conflito</translation> </message> <message> <source>%1/offline</source> <translation>%1/offline</translation> </message> <message> <source>%1/unconfirmed</source> <translation>%1/não confirmadas</translation> </message> <message> <source>%1 confirmations</source> <translation>%1 confirmações</translation> </message> <message> <source>Status</source> <translation>Status</translation> </message> <message numerus="yes"> <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> <source>Date</source> <translation>Data</translation> </message> <message> <source>Source</source> <translation>Fonte</translation> </message> <message> <source>Generated</source> <translation>Gerados</translation> </message> <message> <source>From</source> <translation>De</translation> </message> <message> <source>To</source> <translation>Para</translation> </message> <message> <source>own address</source> <translation>seu próprio endereço</translation> </message> <message> <source>label</source> <translation>rótulo</translation> </message> <message> <source>Credit</source> <translation>Crédito</translation> </message> <message numerus="yes"> <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> <source>not accepted</source> <translation>não aceito</translation> </message> <message> <source>Debit</source> <translation>Débito</translation> </message> <message> <source>Transaction fee</source> <translation>Taxa de transação</translation> </message> <message> <source>Net amount</source> <translation>Valor líquido</translation> </message> <message> <source>Message</source> <translation>Mensagem</translation> </message> <message> <source>Comment</source> <translation>Comentário</translation> </message> <message> <source>Transaction ID</source> <translation>ID da transação</translation> </message> <message> <source>Merchant</source> <translation>Mercador</translation> </message> <message> <source>Generated coins must mature %1 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>Bitcoins recém minerados precisam aguardar %1 blocos antes de serem gastos. Quando o bloco foi gerado, ele foi disseminado pela rede para ser adicionado à cadeia de blocos: blockchain. Se ele falhar em ser inserido na cadeia, seu estado será modificado para &quot;não aceito&quot; e ele não poderá ser gasto. Isso pode acontecer eventualmente quando blocos são gerados quase que simultaneamente.</translation> </message> <message> <source>Debug information</source> <translation>Informação de depuração</translation> </message> <message> <source>Transaction</source> <translation>Transação</translation> </message> <message> <source>Inputs</source> <translation>Entradas</translation> </message> <message> <source>Amount</source> <translation>Quantidade</translation> </message> <message> <source>true</source> <translation>verdadeiro</translation> </message> <message> <source>false</source> <translation>falso</translation> </message> <message> <source>, has not been successfully broadcast yet</source> <translation>, ainda não foi propagada na rede com sucesso.</translation> </message> <message numerus="yes"> <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> <source>unknown</source> <translation>desconhecido</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <source>Transaction details</source> <translation>Detalhes da transação</translation> </message> <message> <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> <source>Date</source> <translation>Data</translation> </message> <message> <source>Type</source> <translation>Tipo</translation> </message> <message> <source>Address</source> <translation>Endereço</translation> </message> <message> <source>Amount</source> <translation>Quantidade</translation> </message> <message> <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 numerus="yes"> <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> <source>Open until %1</source> <translation>Aberto até %1</translation> </message> <message> <source>Confirmed (%1 confirmations)</source> <translation>Confirmado (%1 confirmações)</translation> </message> <message> <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> <source>Generated but not accepted</source> <translation>Gerado mas não aceito</translation> </message> <message> <source>Offline</source> <translation>Offline</translation> </message> <message> <source>Unconfirmed</source> <translation>Não confirmado</translation> </message> <message> <source>Confirming (%1 of %2 recommended confirmations)</source> <translation>Confirmando (%1 de %2 confirmações recomendadas)</translation> </message> <message> <source>Conflicted</source> <translation>Conflitou</translation> </message> <message> <source>Received with</source> <translation>Recebido por</translation> </message> <message> <source>Received from</source> <translation>Recebido de</translation> </message> <message> <source>Sent to</source> <translation>Enviado para</translation> </message> <message> <source>Payment to yourself</source> <translation>Pagamento para você mesmo</translation> </message> <message> <source>Mined</source> <translation>Minerado</translation> </message> <message> <source>(n/a)</source> <translation>(n/a)</translation> </message> <message> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Status da transação. Passe o mouse sobre este campo para mostrar o número de confirmações.</translation> </message> <message> <source>Date and time that the transaction was received.</source> <translation>Data e hora em que a transação foi recebida.</translation> </message> <message> <source>Type of transaction.</source> <translation>Tipo de transação.</translation> </message> <message> <source>Destination address of transaction.</source> <translation>Endereço de destino da transação.</translation> </message> <message> <source>Amount removed from or added to balance.</source> <translation>Quantidade debitada ou creditada ao saldo.</translation> </message> </context> <context> <name>TransactionView</name> <message> <source>All</source> <translation>Todos</translation> </message> <message> <source>Today</source> <translation>Hoje</translation> </message> <message> <source>This week</source> <translation>Esta semana</translation> </message> <message> <source>This month</source> <translation>Este mês</translation> </message> <message> <source>Last month</source> <translation>Mês passado</translation> </message> <message> <source>This year</source> <translation>Este ano</translation> </message> <message> <source>Range...</source> <translation>Intervalo...</translation> </message> <message> <source>Received with</source> <translation>Recebido por</translation> </message> <message> <source>Sent to</source> <translation>Enviado para</translation> </message> <message> <source>To yourself</source> <translation>Para você mesmo</translation> </message> <message> <source>Mined</source> <translation>Minerado</translation> </message> <message> <source>Other</source> <translation>Outro</translation> </message> <message> <source>Enter address or label to search</source> <translation>Procure um endereço ou rótulo</translation> </message> <message> <source>Min amount</source> <translation>Quantidade mínima</translation> </message> <message> <source>Copy address</source> <translation>Copiar endereço</translation> </message> <message> <source>Copy label</source> <translation>Copiar rótulo</translation> </message> <message> <source>Copy amount</source> <translation>Copiar quantia</translation> </message> <message> <source>Copy transaction ID</source> <translation>Copiar ID da transação</translation> </message> <message> <source>Edit label</source> <translation>Editar rótulo</translation> </message> <message> <source>Show transaction details</source> <translation>Mostrar detalhes da transação</translation> </message> <message> <source>Export Transaction History</source> <translation>Exportar Histórico de Transação</translation> </message> <message> <source>Exporting Failed</source> <translation>Exportação Falhou</translation> </message> <message> <source>There was an error trying to save the transaction history to %1.</source> <translation>Ocorreu um erro ao tentar salvar o histórico de transação em %1.</translation> </message> <message> <source>Exporting Successful</source> <translation>Exportação feita com sucesso</translation> </message> <message> <source>The transaction history was successfully saved to %1.</source> <translation>O histórico de transação foi gravado com sucesso em %1.</translation> </message> <message> <source>Comma separated file (*.csv)</source> <translation>Arquivo separado por vírgulas (*. csv)</translation> </message> <message> <source>Confirmed</source> <translation>Confirmado</translation> </message> <message> <source>Date</source> <translation>Data</translation> </message> <message> <source>Type</source> <translation>Tipo</translation> </message> <message> <source>Label</source> <translation>Rótulo</translation> </message> <message> <source>Address</source> <translation>Endereço</translation> </message> <message> <source>Amount</source> <translation>Quantidade</translation> </message> <message> <source>ID</source> <translation>ID</translation> </message> <message> <source>Range:</source> <translation>Intervalo: </translation> </message> <message> <source>to</source> <translation>para</translation> </message> </context> <context> <name>WalletFrame</name> <message> <source>No wallet has been loaded.</source> <translation>Nenhuma carteira foi carregada.</translation> </message> </context> <context> <name>WalletModel</name> <message> <source>Send Coins</source> <translation>Send Coins</translation> </message> </context> <context> <name>WalletView</name> <message> <source>&amp;Export</source> <translation>&amp;Exportar</translation> </message> <message> <source>Export the data in the current tab to a file</source> <translation>Exportar os dados na aba atual para um arquivo</translation> </message> <message> <source>Backup Wallet</source> <translation>Fazer cópia de segurança da Carteira</translation> </message> <message> <source>Wallet Data (*.dat)</source> <translation>Dados da Carteira (*.dat)</translation> </message> <message> <source>Backup Failed</source> <translation>Cópia de segurança Falhou</translation> </message> <message> <source>There was an error trying to save the wallet data to %1.</source> <translation>Ocorreu um erro ao tentar salvar os dados da carteira em %1.</translation> </message> <message> <source>The wallet data was successfully saved to %1.</source> <translation>Os dados da carteira foram salvos com sucesso em %1.</translation> </message> <message> <source>Backup Successful</source> <translation>Backup feito com sucesso</translation> </message> </context> <context> <name>bitcoin-core</name> <message> <source>Usage:</source> <translation>Uso:</translation> </message> <message> <source>List commands</source> <translation>Lista de comandos</translation> </message> <message> <source>Get help for a command</source> <translation>Obtenha ajuda sobre um comando</translation> </message> <message> <source>Options:</source> <translation>Opções:</translation> </message> <message> <source>Specify configuration file (default: richcoin.conf)</source> <translation>Especifique um arquivo de configurações (padrão: richcoin.conf)</translation> </message> <message> <source>Specify pid file (default: richcoind.pid)</source> <translation>Especifique um arquivo de pid (padrão: richcoind.pid)</translation> </message> <message> <source>Specify data directory</source> <translation>Especificar diretório de dados</translation> </message> <message> <source>Listen for connections on &lt;port&gt; (default: 10888 or testnet: 20888)</source> <translation>Procurar por conexões em &lt;port&gt; (padrão: 10888 ou testnet:20888)</translation> </message> <message> <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> <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> <source>Specify your own public address</source> <translation>Especificar seu próprio endereço público</translation> </message> <message> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Limite para desconectar peers mal comportados (padrão: 100)</translation> </message> <message> <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> <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> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 10889 or testnet: 20889)</source> <translation>Escutar conexões JSON-RPC na porta &lt;porta&gt; (padrão: 10889 ou testnet: 20889)</translation> </message> <message> <source>Accept command line and JSON-RPC commands</source> <translation>Aceitar linha de comando e comandos JSON-RPC</translation> </message> <message> <source>Richcoin Core RPC client version</source> <translation>Versão do cliente Richcoin Core RPC</translation> </message> <message> <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> <source>Use the test network</source> <translation>Usar rede de teste</translation> </message> <message> <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> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=richcoinrpc 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;Richcoin Alert&quot; admin@foo.com </source> <translation>%s, você deve especificar uma senha rpcpassword no arquivo de configuração:⏎ %s⏎ É recomendado que você use a seguinte senha aleatória:⏎ rpcuser=richcoinrpc⏎ rpcpassword=%s⏎ (você não precisa lembrar esta senha)⏎ O nome de usuário e a senha NÃO PODEM ser os mesmos.⏎ Se o arquivo não existir, crie um com permissão de leitura apenas para o dono.⏎ É recomendado também definir um alertnotify para que você seja notificado de problemas;⏎ por exemplo: alertnotify=echo %%s | mail -s &quot;Richcoin Alert&quot; admin@foo.com⏎ </translation> </message> <message> <source>Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH)</source> <translation>Codificadores aceitos (padrão: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH)</translation> </message> <message> <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> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation>Vincular ao endereço fornecido e sempre escutar nele. Use a notação [host]:port para IPv6</translation> </message> <message> <source>Continuously rate-limit free transactions to &lt;n&gt;*1000 bytes per minute (default:15)</source> <translation>Restringe a taxa de transações gratuitas para &lt;n&gt;*1000 bytes por minuto (padrão:15)</translation> </message> <message> <source>Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development.</source> <translation>Entre em modo de teste de regressão, que utiliza uma cadeia especial em que os blocos podem ser resolvido imediatamente. Este destina-se a ferramentas de teste de regressão e de desenvolvimento de aplicativos.</translation> </message> <message> <source>Enter regression test mode, which uses a special chain in which blocks can be solved instantly.</source> <translation>Entra no modo de teste de regressão, que usa uma cadeia especial onde os blocos podem ser resolvidos instantaneamente.</translation> </message> <message> <source>Error: Listening for incoming connections failed (listen returned error %d)</source> <translation>Erro: Falha ao tentar aguardar conexões de entrada (erro retornado %d)</translation> </message> <message> <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>Erro: A transação foi rejeitada. Isso pode acontecer se alguns dos richcoins de sua carteira já haviam sido gastos, por exemplo se você usou uma cópia do arquivo wallet.dat e alguns richcoins foram gastos na cópia mas não foram marcados como gastos aqui.</translation> </message> <message> <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>Erro: Esta transação requer uma taxa de transação de pelo menos %s, por causa sua quantidade, complexidade ou uso de dinheiro recebido recentemente.</translation> </message> <message> <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> <source>Fees smaller than this are considered zero fee (for transaction creation) (default:</source> <translation>Taxas menores que esta são consideradas taxa zero (para criação da transação) (padrão:</translation> </message> <message> <source>Flush database activity from memory pool to disk log every &lt;n&gt; megabytes (default: 100)</source> <translation>Descarrega a atividade do banco de dados da memória para log em disco a cada &lt;n&gt; megabytes (padrão: 100)</translation> </message> <message> <source>How thorough the block verification of -checkblocks is (0-4, default: 3)</source> <translation>Quão completa a verificação de blocos do -checkblocks é (0-4, padrão: 3)</translation> </message> <message> <source>In this mode -genproclimit controls how many blocks are generated immediately.</source> <translation>Neste modo -genproclimit controla quantos blocos são gerados imediatamente.</translation> </message> <message> <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source> <translation>Define o número de threads de verificação de script (%u a %d, 0 = automático, &lt;0 = número de cores deixados livres, padrão: %d)</translation> </message> <message> <source>Set the processor limit for when generation is on (-1 = unlimited, default: -1)</source> <translation>Define o limite de processador para quando geração está ativa (-1 = ilimitada, padrão: -1)</translation> </message> <message> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation>Este pode ser um build de teste pré-lançamento - use por sua conta e risco - não use para mineração ou aplicações de comércio.</translation> </message> <message> <source>Unable to bind to %s on this computer. Richcoin Core is probably already running.</source> <translation>Impossível ouvir em %s neste computador. Richcoin Core já está sendo executado provavelmente.</translation> </message> <message> <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy)</source> <translation>Use proxy SOCKS5 separado para alcançar nós via Tor hidden services (padrão: -proxy)</translation> </message> <message> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Atenção: 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> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong Richcoin will not work properly.</source> <translation>Atenção: Por favor, verifique que a data e hora do seu computador estão corretas! Se o seu relógio estiver errado, o Richcoin não irá funcionar corretamente.</translation> </message> <message> <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source> <translation>Atenção: A rede não parecem concordar plenamente! Alguns mineiros parecem estar enfrentando problemas.</translation> </message> <message> <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source> <translation>Atenção: Nós não parecemos concordar plenamente com nossos colegas! Você pode precisar atualizar ou outros nós podem precisar atualizar.</translation> </message> <message> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation>Atenção: erro ao ler arquivo wallet.dat! Todas as chaves foram lidas corretamente, mas dados de transações e do catálogo de endereços podem estar faltando ou incorretos.</translation> </message> <message> <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>Atenção: 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 restaurar o backup.</translation> </message> <message> <source>(default: 1)</source> <translation>(padrão: 1)</translation> </message> <message> <source>(default: wallet.dat)</source> <translation>(padrão: wallet.dat)</translation> </message> <message> <source>&lt;category&gt; can be:</source> <translation>&lt;category&gt; pode ser:</translation> </message> <message> <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> <source>Richcoin Core Daemon</source> <translation>Richcoin Core Daemon</translation> </message> <message> <source>Block creation options:</source> <translation>Opções de criação de blocos:</translation> </message> <message> <source>Clear list of wallet transactions (diagnostic tool; implies -rescan)</source> <translation>Limpa a lista de transações da carteira (ferramenta de diagnóstico; implica -rescan)</translation> </message> <message> <source>Connect only to the specified node(s)</source> <translation>Conectar apenas a nó(s) específico(s)</translation> </message> <message> <source>Connect through SOCKS proxy</source> <translation>Conecta através de proxy SOCKS</translation> </message> <message> <source>Connect to JSON-RPC on &lt;port&gt; (default: 10889 or testnet: 20889)</source> <translation>Conectar-se ao JSON-RPC em &lt;port&gt; (padrão: 10889 or testnet: 20889)</translation> </message> <message> <source>Connection options:</source> <translation>Opções de conexão:</translation> </message> <message> <source>Corrupted block database detected</source> <translation>Detectado Banco de dados de blocos corrompido</translation> </message> <message> <source>Debugging/Testing options:</source> <translation>Opções de Debug/Teste:</translation> </message> <message> <source>Disable safemode, override a real safe mode event (default: 0)</source> <translation>Desabilita modo seguro, sobrepõe um evento de modo seguro real (padrão: 0)</translation> </message> <message> <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> <source>Do not load the wallet and disable wallet RPC calls</source> <translation>Não carrega a carteira e desabilita as chamadas RPC para a carteira</translation> </message> <message> <source>Do you want to rebuild the block database now?</source> <translation>Você quer reconstruir o banco de dados de blocos agora?</translation> </message> <message> <source>Error initializing block database</source> <translation>Erro ao inicializar banco de dados de blocos</translation> </message> <message> <source>Error initializing wallet database environment %s!</source> <translation>Erro ao inicializar ambiente de banco de dados de carteira %s!</translation> </message> <message> <source>Error loading block database</source> <translation>Erro ao carregar banco de dados de blocos</translation> </message> <message> <source>Error opening block database</source> <translation>Erro ao abrir banco de dados de blocos</translation> </message> <message> <source>Error: Disk space is low!</source> <translation>Erro: Espaço em disco insuficiente!</translation> </message> <message> <source>Error: Wallet locked, unable to create transaction!</source> <translation>Erro: Carteira bloqueada, impossível criar transação!</translation> </message> <message> <source>Error: system error: </source> <translation>Erro: erro de sistema</translation> </message> <message> <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> <source>Failed to read block info</source> <translation>Falha ao ler informação de bloco</translation> </message> <message> <source>Failed to read block</source> <translation>Falha ao ler bloco</translation> </message> <message> <source>Failed to sync block index</source> <translation>Falha ao sincronizar índice de blocos</translation> </message> <message> <source>Failed to write block index</source> <translation>Falha ao escrever índice de blocos</translation> </message> <message> <source>Failed to write block info</source> <translation>Falha ao escrever informações de bloco</translation> </message> <message> <source>Failed to write block</source> <translation>Falha ao escrever bloco</translation> </message> <message> <source>Failed to write file info</source> <translation>Falha ao escrever informções de arquivo</translation> </message> <message> <source>Failed to write to coin database</source> <translation>Falha ao escrever banco de dados de moedas</translation> </message> <message> <source>Failed to write transaction index</source> <translation>Falha ao escrever índice de transações</translation> </message> <message> <source>Failed to write undo data</source> <translation>Falha ao escrever dados para desfazer ações</translation> </message> <message> <source>Fee per kB to add to transactions you send</source> <translation>Taxa por kB para adicionar às transações que você envia</translation> </message> <message> <source>Fees smaller than this are considered zero fee (for relaying) (default:</source> <translation>Taxas menores que esta são consideradas taxa zero (para relay) (padrão:</translation> </message> <message> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation>Procurar pares usando consulta de DNS (padrão: 1 a menos que a opção -connect esteja presente)</translation> </message> <message> <source>Force safe mode (default: 0)</source> <translation>Força modo seguro (padrão: 0)</translation> </message> <message> <source>Generate coins (default: 0)</source> <translation>Gerar moedas (padrão: 0)</translation> </message> <message> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation>Quantos blocos checar ao inicializar (padrão: 288, 0 = todos)</translation> </message> <message> <source>If &lt;category&gt; is not supplied, output all debugging information.</source> <translation>Se &lt;category&gt; não for informada, logar toda informação de debug.</translation> </message> <message> <source>Importing...</source> <translation>Importando...</translation> </message> <message> <source>Incorrect or no genesis block found. Wrong datadir for network?</source> <translation>Bloco gênese incorreto ou não encontrado. Datadir errado para a rede?</translation> </message> <message> <source>Invalid -onion address: &apos;%s&apos;</source> <translation>Endereço -onion inválido: &apos;%s&apos;</translation> </message> <message> <source>Not enough file descriptors available.</source> <translation>Decriptadores de arquivos disponíveis insuficientes.</translation> </message> <message> <source>Prepend debug output with timestamp (default: 1)</source> <translation>Adiciona timestamp como prefixo no debug (padrão: 1)</translation> </message> <message> <source>RPC client options:</source> <translation>Opções de cliente RPC:</translation> </message> <message> <source>Rebuild block chain index from current blk000??.dat files</source> <translation>Reconstruir índice de blockchain a partir dos arquivos atuais blk000??.dat</translation> </message> <message> <source>Select SOCKS version for -proxy (4 or 5, default: 5)</source> <translation>Seleciona versão SOCKS para -proxy (4 ou 5, padrão: 5)</translation> </message> <message> <source>Set database cache size in megabytes (%d to %d, default: %d)</source> <translation>Define o tamanho do cache do banco de dados em megabytes (%d para %d, padrão: %d)</translation> </message> <message> <source>Set maximum block size in bytes (default: %d)</source> <translation>Define o tamanho máximo de cada bloco em bytes (padrão: %d)</translation> </message> <message> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation>Defina o número de threads de chamadas RPC (padrão: 4)</translation> </message> <message> <source>Specify wallet file (within data directory)</source> <translation>Especifique o arquivo da carteira (dentro do diretório de dados)</translation> </message> <message> <source>Spend unconfirmed change when sending transactions (default: 1)</source> <translation>Permite gastar troco não confirmado ao criar transações (padrão: 1)</translation> </message> <message> <source>This is intended for regression testing tools and app development.</source> <translation>Isso é usado para testes de regressão e ferramentas de desenvolvimento.</translation> </message> <message> <source>Usage (deprecated, use richcoin-cli):</source> <translation>Exemplo de uso (obsoleto, use richcoin-cli):</translation> </message> <message> <source>Verifying blocks...</source> <translation>Verificando blocos...</translation> </message> <message> <source>Verifying wallet...</source> <translation>Verificando carteira...</translation> </message> <message> <source>Wait for RPC server to start</source> <translation>Aguarde um servidor RPC para iniciar</translation> </message> <message> <source>Wallet %s resides outside data directory %s</source> <translation>Carteira de% s reside fora de dados do diretório% s</translation> </message> <message> <source>Wallet options:</source> <translation>Opções da Carteira:</translation> </message> <message> <source>Warning: Deprecated argument -debugnet ignored, use -debug=net</source> <translation>Atenção: Parâmetro obsoleto -debugnet foi ignorado, use -debug=net</translation> </message> <message> <source>You need to rebuild the database using -reindex to change -txindex</source> <translation>Você precisa reconstruir o banco de dados utilizando-reindexar a mudar-txindex</translation> </message> <message> <source>Imports blocks from external blk000??.dat file</source> <translation>Importar blocos de um arquivo externo blk000??.dat</translation> </message> <message> <source>Cannot obtain a lock on data directory %s. Richcoin Core is probably already running.</source> <translation>Não foi possível obter proteção exclusiva ao diretório de dados %s. Richcoin Core já está sendo executado provavelmente.</translation> </message> <message> <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source> <translation>Executa o comando quando um alerta relevante é recebido ou vemos um longo garfo (% s em cmd é substituída pela mensagem)</translation> </message> <message> <source>Output debugging information (default: 0, supplying &lt;category&gt; is optional)</source> <translation>Informação de saída de debug (padrão: 0, definir &lt;category&gt; é opcional)</translation> </message> <message> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: %d)</source> <translation>Define o tamanho máximo de alta-prioridade por taxa baixa nas transações em bytes (padrão: %d)</translation> </message> <message> <source>Information</source> <translation>Informação</translation> </message> <message> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Quantidade inválida para -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Inválido montante for-mintxfee = &lt;amount&gt;: &apos;% s&apos;</translation> </message> <message> <source>Limit size of signature cache to &lt;n&gt; entries (default: 50000)</source> <translation>Limita tamanho do cache de assinaturas em &lt;n&gt; entradas (padrão: 50000)</translation> </message> <message> <source>Log transaction priority and fee per kB when mining blocks (default: 0)</source> <translation>Registra log da prioridade de transação e taxa por kB quando minerando blocos (padrão: 0)</translation> </message> <message> <source>Maintain a full transaction index (default: 0)</source> <translation>Manter índice completo de transações (padrão: 0)</translation> </message> <message> <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> <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> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation>Apenas aceitar cadeia de blocos correspondente a marcas de verificação internas (padrão: 1)</translation> </message> <message> <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> <source>Print block on startup, if found in block index</source> <translation>Imprime bloco ao iniciar, se encontrado no índice de blocos</translation> </message> <message> <source>Print block tree on startup (default: 0)</source> <translation>Imprime árvore de blocos ao iniciar (padrão: 0)</translation> </message> <message> <source>RPC SSL options: (see the Richcoin Wiki for SSL setup instructions)</source> <translation>Opções RPC SSL: (veja o Richcoin Wiki para instruções de configuração SSL)</translation> </message> <message> <source>RPC server options:</source> <translation>Opções do servidor RPC:</translation> </message> <message> <source>Randomly drop 1 of every &lt;n&gt; network messages</source> <translation>Aleatoriamente descarta 1 em cada &lt;n&gt; mensagens da rede</translation> </message> <message> <source>Randomly fuzz 1 of every &lt;n&gt; network messages</source> <translation>Aleatoriamente embaralha 1 em cada &lt;n&gt; mensagens da rede</translation> </message> <message> <source>Run a thread to flush wallet periodically (default: 1)</source> <translation>Executa uma thread para limpar a carteira periodicamente (padrão: 1)</translation> </message> <message> <source>SSL options: (see the Richcoin Wiki for SSL setup instructions)</source> <translation>Opções SSL: (veja a Wiki do Richcoin para instruções de configuração SSL)</translation> </message> <message> <source>Send command to Richcoin Core</source> <translation>Enviar comando ao Richcoin Core</translation> </message> <message> <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> <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> <source>Sets the DB_PRIVATE flag in the wallet db environment (default: 1)</source> <translation>Define a flag DB_PRIVATE no ambiente de banco de dados da carteira (padrão: 1)</translation> </message> <message> <source>Show all debugging options (usage: --help -help-debug)</source> <translation>Exibir todas opções de debug (uso: --help -help-debug)</translation> </message> <message> <source>Show benchmark information (default: 0)</source> <translation>Exibir informação de benchmark (padrão: 0)</translation> </message> <message> <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> <source>Signing transaction failed</source> <translation>Assinatura de transação falhou</translation> </message> <message> <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> <source>Start Richcoin Core Daemon</source> <translation>Inicializar serviço Richcoin Core</translation> </message> <message> <source>System error: </source> <translation>Erro de sistema:</translation> </message> <message> <source>Transaction amount too small</source> <translation>Quantidade da transação muito pequena.</translation> </message> <message> <source>Transaction amounts must be positive</source> <translation>As quantidades das transações devem ser positivas.</translation> </message> <message> <source>Transaction too large</source> <translation>Transação muito larga</translation> </message> <message> <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> <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> <source>Username for JSON-RPC connections</source> <translation>Nome de usuário para conexões JSON-RPC</translation> </message> <message> <source>Warning</source> <translation>Atenção</translation> </message> <message> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Atenção: Esta versão está obsoleta, atualização exigida!</translation> </message> <message> <source>Zapping all transactions from wallet...</source> <translation>Aniquilando todas as transações da carteira...</translation> </message> <message> <source>on startup</source> <translation>ao iniciar</translation> </message> <message> <source>version</source> <translation>versão</translation> </message> <message> <source>wallet.dat corrupt, salvage failed</source> <translation>wallet.dat corrompido, recuperação falhou</translation> </message> <message> <source>Password for JSON-RPC connections</source> <translation>Senha para conexões JSON-RPC</translation> </message> <message> <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> <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; (padrão: 127.0.0.1)</translation> </message> <message> <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> <source>Upgrade wallet to latest format</source> <translation>Atualizar carteira para o formato mais recente</translation> </message> <message> <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> <source>Rescan the block chain for missing wallet transactions</source> <translation>Re-escanear blocos procurando por transações perdidas da carteira</translation> </message> <message> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Usar OpenSSL (https) para conexões JSON-RPC</translation> </message> <message> <source>Server certificate file (default: server.cert)</source> <translation>Arquivo de certificado do servidor (padrão: server.cert)</translation> </message> <message> <source>Server private key (default: server.pem)</source> <translation>Chave privada do servidor (padrão: server.pem)</translation> </message> <message> <source>This help message</source> <translation>Esta mensagem de ajuda</translation> </message> <message> <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> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Permitir consultas DNS para -addnode, -seednode e -connect</translation> </message> <message> <source>Loading addresses...</source> <translation>Carregando endereços...</translation> </message> <message> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Erro ao carregar wallet.dat: Carteira corrompida</translation> </message> <message> <source>Error loading wallet.dat: Wallet requires newer version of Richcoin</source> <translation>Erro ao carregar wallet.dat: Carteira requer uma versão mais nova do Richcoin</translation> </message> <message> <source>Wallet needed to be rewritten: restart Richcoin to complete</source> <translation>A Carteira precisou ser reescrita: reinicie o Richcoin para completar</translation> </message> <message> <source>Error loading wallet.dat</source> <translation>Erro ao carregar wallet.dat</translation> </message> <message> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Endereço -proxy inválido: &apos;%s&apos;</translation> </message> <message> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>Rede desconhecida especificada em -onlynet: &apos;%s&apos;</translation> </message> <message> <source>Unknown -socks proxy version requested: %i</source> <translation>Versão desconhecida do proxy -socks requisitada: %i</translation> </message> <message> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>Impossível encontrar o endereço -bind: &apos;%s&apos;</translation> </message> <message> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>Impossível encontrar endereço -externalip: &apos;%s&apos;</translation> </message> <message> <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> <source>Invalid amount</source> <translation>Quantidade inválida</translation> </message> <message> <source>Insufficient funds</source> <translation>Saldo insuficiente</translation> </message> <message> <source>Loading block index...</source> <translation>Carregando índice de blocos...</translation> </message> <message> <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> <source>Loading wallet...</source> <translation>Carregando carteira...</translation> </message> <message> <source>Cannot downgrade wallet</source> <translation>Não é possível fazer downgrade da carteira</translation> </message> <message> <source>Cannot write default address</source> <translation>Não foi possível escrever no endereço padrão</translation> </message> <message> <source>Rescanning...</source> <translation>Re-escaneando...</translation> </message> <message> <source>Done loading</source> <translation>Carregamento terminado</translation> </message> <message> <source>To use the %s option</source> <translation>Para usar a opção %s</translation> </message> <message> <source>Error</source> <translation>Erro</translation> </message> <message> <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": "572344afb68e356c5494df7a0f31b840", "timestamp": "", "source": "github", "line_count": 3388, "max_line_length": 430, "avg_line_length": 41.048701298701296, "alnum_prop": 0.6637089873663472, "repo_name": "Richcoin-Project/RichCoin", "id": "5e81e115144401d24136afa797e5d44f8e95b3e5", "size": "140215", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/qt/locale/bitcoin_pt_BR.ts", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "721773" }, { "name": "C++", "bytes": "3194070" }, { "name": "CSS", "bytes": "1127" }, { "name": "Groff", "bytes": "18145" }, { "name": "HTML", "bytes": "50620" }, { "name": "Makefile", "bytes": "8732" }, { "name": "Objective-C", "bytes": "1052" }, { "name": "Objective-C++", "bytes": "6330" }, { "name": "Protocol Buffer", "bytes": "2308" }, { "name": "Python", "bytes": "110325" }, { "name": "QMake", "bytes": "2019" }, { "name": "Shell", "bytes": "46769" } ], "symlink_target": "" }
package com.satikey.tools.supervisord; import java.io.Serializable; //{'name': 'process name', //'group': 'group name', //'description': 'pid 18806, uptime 0:03:12' //'start': 1200361776, //'stop': 0, //'now': 1200361812, //'state': 1, //'statename': 'RUNNING', //'spawnerr': '', //'exitstatus': 0, //'logfile': '/path/to/stdout-log', # deprecated, b/c only //'stdout_logfile': '/path/to/stdout-log', //'stderr_logfile': '/path/to/stderr-log', //'pid': 1} /** * @author Lei Duan(satifanie@gmail.com) . * @see http://supervisord.org/api.html#supervisor.rpcinterface.SupervisorNamespaceRPCInterface.getProcessInfo */ public class Process implements Serializable { private static final long serialVersionUID = -3585545987673007624L; private String name; private String group; private String description; private String start; private String stop; private String now; private String status; private String stateName; private String spawnerr; private int exitStatus; private String logFile; private String stdoutFile; private String stderrFile; private int pid; public Process(String processName) { this.name = processName; } public Process(String processName, String groupName) { this(processName); this.group = groupName; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getGroup() { return group; } public void setGroup(String group) { this.group = group; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getStart() { return start; } public void setStart(String start) { this.start = start; } public String getStop() { return stop; } public void setStop(String stop) { this.stop = stop; } public String getNow() { return now; } public void setNow(String now) { this.now = now; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getStateName() { return stateName; } public void setStateName(String stateName) { this.stateName = stateName; } public String getSpawnerr() { return spawnerr; } public void setSpawnerr(String spawnerr) { this.spawnerr = spawnerr; } public int getExitStatus() { return exitStatus; } public void setExitStatus(int exitStatus) { this.exitStatus = exitStatus; } public String getLogFile() { return logFile; } public void setLogFile(String logFile) { this.logFile = logFile; } public String getStdoutFile() { return stdoutFile; } public void setStdoutFile(String stdoutFile) { this.stdoutFile = stdoutFile; } public String getStderrFile() { return stderrFile; } public void setStderrFile(String stderrFile) { this.stderrFile = stderrFile; } public int getPid() { return pid; } public void setPid(int pid) { this.pid = pid; } }
{ "content_hash": "ecfdaff941572e5cf73af8cbd85fe858", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 110, "avg_line_length": 21.40740740740741, "alnum_prop": 0.600634371395617, "repo_name": "satifanie/supervisord4j", "id": "9b99e8ebb1dba6c240c46a2e195100137f300f7b", "size": "3468", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/satikey/tools/supervisord/Process.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "82348" } ], "symlink_target": "" }
/*-*-linux-c-*-*/ /* Copyright (C) 2008 Cezary Jackiewicz <cezary.jackiewicz (at) gmail.com> based on MSI driver Copyright (C) 2006 Lennart Poettering <mzxreary (at) 0pointer (dot) de> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* * compal-laptop.c - Compal laptop support. * * This driver exports a few files in /sys/devices/platform/compal-laptop/: * wake_up_XXX Whether or not we listen to such wake up events (rw) * * In addition to these platform device attributes the driver * registers itself in the Linux backlight control, power_supply, rfkill * and hwmon subsystem and is available to userspace under: * * /sys/class/backlight/compal-laptop/ * /sys/class/power_supply/compal-laptop/ * /sys/class/rfkill/rfkillX/ * /sys/class/hwmon/hwmonX/ * * Notes on the power_supply battery interface: * - the "minimum" design voltage is *the* design voltage * - the ambient temperature is the average battery temperature * and the value is an educated guess (see commented code below) * * * This driver might work on other laptops produced by Compal. If you * want to try it you can pass force=1 as argument to the module which * will force it to load even when the DMI data doesn't identify the * laptop as compatible. * * Lots of data available at: * http://service1.marasst.com/Compal/JHL90_91/Service%20Manual/ * JHL90%20service%20manual-Final-0725.pdf * * * * Support for the Compal JHL90 added by Roald Frederickx * (roald.frederickx@gmail.com): * Driver got large revision. Added functionalities: backlight * power, wake_on_XXX, a hwmon and power_supply interface. * * In case this gets merged into the kernel source: I want to dedicate this * to Kasper Meerts, the awesome guy who showed me Linux and C! */ /* NOTE: currently the wake_on_XXX, hwmon and power_supply interfaces are * only enabled on a JHL90 board until it is verified that they work on the * other boards too. See the extra_features variable. */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/acpi.h> #include <linux/dmi.h> #include <linux/backlight.h> #include <linux/platform_device.h> #include <linux/rfkill.h> #include <linux/hwmon.h> #include <linux/hwmon-sysfs.h> #include <linux/power_supply.h> #include <linux/fb.h> /* ======= */ /* Defines */ /* ======= */ #define DRIVER_NAME "compal-laptop" #define DRIVER_VERSION "0.2.7" #define BACKLIGHT_LEVEL_ADDR 0xB9 #define BACKLIGHT_LEVEL_MAX 7 #define BACKLIGHT_STATE_ADDR 0x59 #define BACKLIGHT_STATE_ON_DATA 0xE1 #define BACKLIGHT_STATE_OFF_DATA 0xE2 #define WAKE_UP_ADDR 0xA4 #define WAKE_UP_PME (1 << 0) #define WAKE_UP_MODEM (1 << 1) #define WAKE_UP_LAN (1 << 2) #define WAKE_UP_WLAN (1 << 4) #define WAKE_UP_KEY (1 << 6) #define WAKE_UP_MOUSE (1 << 7) #define WIRELESS_ADDR 0xBB #define WIRELESS_WLAN (1 << 0) #define WIRELESS_BT (1 << 1) #define WIRELESS_WLAN_EXISTS (1 << 2) #define WIRELESS_BT_EXISTS (1 << 3) #define WIRELESS_KILLSWITCH (1 << 4) #define PWM_ADDRESS 0x46 #define PWM_DISABLE_ADDR 0x59 #define PWM_DISABLE_DATA 0xA5 #define PWM_ENABLE_ADDR 0x59 #define PWM_ENABLE_DATA 0xA8 #define FAN_ADDRESS 0x46 #define FAN_DATA 0x81 #define FAN_FULL_ON_CMD 0x59 /* Doesn't seem to work. Just */ #define FAN_FULL_ON_ENABLE 0x76 /* force the pwm signal to its */ #define FAN_FULL_ON_DISABLE 0x77 /* maximum value instead */ #define TEMP_CPU 0xB0 #define TEMP_CPU_LOCAL 0xB1 #define TEMP_CPU_DTS 0xB5 #define TEMP_NORTHBRIDGE 0xB6 #define TEMP_VGA 0xB4 #define TEMP_SKIN 0xB2 #define BAT_MANUFACTURER_NAME_ADDR 0x10 #define BAT_MANUFACTURER_NAME_LEN 9 #define BAT_MODEL_NAME_ADDR 0x19 #define BAT_MODEL_NAME_LEN 6 #define BAT_SERIAL_NUMBER_ADDR 0xC4 #define BAT_SERIAL_NUMBER_LEN 5 #define BAT_CHARGE_NOW 0xC2 #define BAT_CHARGE_DESIGN 0xCA #define BAT_VOLTAGE_NOW 0xC6 #define BAT_VOLTAGE_DESIGN 0xC8 #define BAT_CURRENT_NOW 0xD0 #define BAT_CURRENT_AVG 0xD2 #define BAT_POWER 0xD4 #define BAT_CAPACITY 0xCE #define BAT_TEMP 0xD6 #define BAT_TEMP_AVG 0xD7 #define BAT_STATUS0 0xC1 #define BAT_STATUS1 0xF0 #define BAT_STATUS2 0xF1 #define BAT_STOP_CHARGE1 0xF2 #define BAT_STOP_CHARGE2 0xF3 #define BAT_S0_DISCHARGE (1 << 0) #define BAT_S0_DISCHRG_CRITICAL (1 << 2) #define BAT_S0_LOW (1 << 3) #define BAT_S0_CHARGING (1 << 1) #define BAT_S0_AC (1 << 7) #define BAT_S1_EXISTS (1 << 0) #define BAT_S1_FULL (1 << 1) #define BAT_S1_EMPTY (1 << 2) #define BAT_S1_LiION_OR_NiMH (1 << 7) #define BAT_S2_LOW_LOW (1 << 0) #define BAT_STOP_CHRG1_BAD_CELL (1 << 1) #define BAT_STOP_CHRG1_COMM_FAIL (1 << 2) #define BAT_STOP_CHRG1_OVERVOLTAGE (1 << 6) #define BAT_STOP_CHRG1_OVERTEMPERATURE (1 << 7) /* ======= */ /* Structs */ /* ======= */ struct compal_data{ /* Fan control */ struct device *hwmon_dev; int pwm_enable; /* 0:full on, 1:set by pwm1, 2:control by moterboard */ unsigned char curr_pwm; /* Power supply */ struct power_supply psy; struct power_supply_info psy_info; char bat_model_name[BAT_MODEL_NAME_LEN + 1]; char bat_manufacturer_name[BAT_MANUFACTURER_NAME_LEN + 1]; char bat_serial_number[BAT_SERIAL_NUMBER_LEN + 1]; }; /* =============== */ /* General globals */ /* =============== */ static int force; module_param(force, bool, 0); MODULE_PARM_DESC(force, "Force driver load, ignore DMI data"); /* Support for the wake_on_XXX, hwmon and power_supply interface. Currently * only gets enabled on a JHL90 board. Might work with the others too */ static bool extra_features; /* Nasty stuff. For some reason the fan control is very un-linear. I've * come up with these values by looping through the possible inputs and * watching the output of address 0x4F (do an ec_transaction writing 0x33 * into 0x4F and read a few bytes from the output, like so: * u8 writeData = 0x33; * ec_transaction(0x4F, &writeData, 1, buffer, 32); * That address is labeled "fan1 table information" in the service manual. * It should be clear which value in 'buffer' changes). This seems to be * related to fan speed. It isn't a proper 'realtime' fan speed value * though, because physically stopping or speeding up the fan doesn't * change it. It might be the average voltage or current of the pwm output. * Nevertheless, it is more fine-grained than the actual RPM reading */ static const unsigned char pwm_lookup_table[256] = { 0, 0, 0, 1, 1, 1, 2, 253, 254, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 86, 86, 9, 9, 9, 10, 10, 10, 11, 92, 92, 12, 12, 95, 13, 66, 66, 14, 14, 98, 15, 15, 15, 16, 16, 67, 17, 17, 72, 18, 70, 75, 19, 90, 90, 73, 73, 73, 21, 21, 91, 91, 91, 96, 23, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 141, 141, 238, 223, 192, 139, 139, 139, 139, 139, 142, 142, 142, 142, 142, 78, 78, 78, 78, 78, 76, 76, 76, 76, 76, 79, 79, 79, 79, 79, 79, 79, 20, 20, 20, 20, 20, 22, 22, 22, 22, 22, 24, 24, 24, 24, 24, 24, 219, 219, 219, 219, 219, 219, 219, 219, 27, 27, 188, 188, 28, 28, 28, 29, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 31, 31, 31, 31, 31, 32, 32, 32, 41, 33, 33, 33, 33, 33, 252, 252, 34, 34, 34, 43, 35, 35, 35, 36, 36, 38, 206, 206, 206, 206, 206, 206, 206, 206, 206, 37, 37, 37, 46, 46, 47, 47, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 48, 48, 48, 48, 48, 40, 40, 40, 49, 42, 42, 42, 42, 42, 42, 42, 42, 44, 189, 189, 189, 189, 54, 54, 45, 45, 45, 45, 45, 45, 45, 45, 251, 191, 199, 199, 199, 199, 199, 215, 215, 215, 215, 187, 187, 187, 187, 187, 193, 50 }; /* ========================= */ /* Hardware access functions */ /* ========================= */ /* General access */ static u8 ec_read_u8(u8 addr) { u8 value; ec_read(addr, &value); return value; } static s8 ec_read_s8(u8 addr) { return (s8)ec_read_u8(addr); } static u16 ec_read_u16(u8 addr) { int hi, lo; lo = ec_read_u8(addr); hi = ec_read_u8(addr + 1); return (hi << 8) + lo; } static s16 ec_read_s16(u8 addr) { return (s16) ec_read_u16(addr); } static void ec_read_sequence(u8 addr, u8 *buf, int len) { int i; for (i = 0; i < len; i++) ec_read(addr + i, buf + i); } /* Backlight access */ static int set_backlight_level(int level) { if (level < 0 || level > BACKLIGHT_LEVEL_MAX) return -EINVAL; ec_write(BACKLIGHT_LEVEL_ADDR, level); return 0; } static int get_backlight_level(void) { return (int) ec_read_u8(BACKLIGHT_LEVEL_ADDR); } static void set_backlight_state(bool on) { u8 data = on ? BACKLIGHT_STATE_ON_DATA : BACKLIGHT_STATE_OFF_DATA; ec_transaction(BACKLIGHT_STATE_ADDR, &data, 1, NULL, 0); } /* Fan control access */ static void pwm_enable_control(void) { unsigned char writeData = PWM_ENABLE_DATA; ec_transaction(PWM_ENABLE_ADDR, &writeData, 1, NULL, 0); } static void pwm_disable_control(void) { unsigned char writeData = PWM_DISABLE_DATA; ec_transaction(PWM_DISABLE_ADDR, &writeData, 1, NULL, 0); } static void set_pwm(int pwm) { ec_transaction(PWM_ADDRESS, &pwm_lookup_table[pwm], 1, NULL, 0); } static int get_fan_rpm(void) { u8 value, data = FAN_DATA; ec_transaction(FAN_ADDRESS, &data, 1, &value, 1); return 100 * (int)value; } /* =================== */ /* Interface functions */ /* =================== */ /* Backlight interface */ static int bl_get_brightness(struct backlight_device *b) { return get_backlight_level(); } static int bl_update_status(struct backlight_device *b) { int ret = set_backlight_level(b->props.brightness); if (ret) return ret; set_backlight_state((b->props.power == FB_BLANK_UNBLANK) && !(b->props.state & BL_CORE_SUSPENDED) && !(b->props.state & BL_CORE_FBBLANK)); return 0; } static const struct backlight_ops compalbl_ops = { .get_brightness = bl_get_brightness, .update_status = bl_update_status, }; /* Wireless interface */ static int compal_rfkill_set(void *data, bool blocked) { unsigned long radio = (unsigned long) data; u8 result = ec_read_u8(WIRELESS_ADDR); u8 value; if (!blocked) value = (u8) (result | radio); else value = (u8) (result & ~radio); ec_write(WIRELESS_ADDR, value); return 0; } static void compal_rfkill_poll(struct rfkill *rfkill, void *data) { u8 result = ec_read_u8(WIRELESS_ADDR); bool hw_blocked = !(result & WIRELESS_KILLSWITCH); rfkill_set_hw_state(rfkill, hw_blocked); } static const struct rfkill_ops compal_rfkill_ops = { .poll = compal_rfkill_poll, .set_block = compal_rfkill_set, }; /* Wake_up interface */ #define SIMPLE_MASKED_STORE_SHOW(NAME, ADDR, MASK) \ static ssize_t NAME##_show(struct device *dev, \ struct device_attribute *attr, char *buf) \ { \ return sprintf(buf, "%d\n", ((ec_read_u8(ADDR) & MASK) != 0)); \ } \ static ssize_t NAME##_store(struct device *dev, \ struct device_attribute *attr, const char *buf, size_t count) \ { \ int state; \ u8 old_val = ec_read_u8(ADDR); \ if (sscanf(buf, "%d", &state) != 1 || (state < 0 || state > 1)) \ return -EINVAL; \ ec_write(ADDR, state ? (old_val | MASK) : (old_val & ~MASK)); \ return count; \ } SIMPLE_MASKED_STORE_SHOW(wake_up_pme, WAKE_UP_ADDR, WAKE_UP_PME) SIMPLE_MASKED_STORE_SHOW(wake_up_modem, WAKE_UP_ADDR, WAKE_UP_MODEM) SIMPLE_MASKED_STORE_SHOW(wake_up_lan, WAKE_UP_ADDR, WAKE_UP_LAN) SIMPLE_MASKED_STORE_SHOW(wake_up_wlan, WAKE_UP_ADDR, WAKE_UP_WLAN) SIMPLE_MASKED_STORE_SHOW(wake_up_key, WAKE_UP_ADDR, WAKE_UP_KEY) SIMPLE_MASKED_STORE_SHOW(wake_up_mouse, WAKE_UP_ADDR, WAKE_UP_MOUSE) /* General hwmon interface */ static ssize_t hwmon_name_show(struct device *dev, struct device_attribute *attr, char *buf) { return sprintf(buf, "%s\n", DRIVER_NAME); } /* Fan control interface */ static ssize_t pwm_enable_show(struct device *dev, struct device_attribute *attr, char *buf) { struct compal_data *data = dev_get_drvdata(dev); return sprintf(buf, "%d\n", data->pwm_enable); } static ssize_t pwm_enable_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct compal_data *data = dev_get_drvdata(dev); long val; int err; err = strict_strtol(buf, 10, &val); if (err) return err; if (val < 0) return -EINVAL; data->pwm_enable = val; switch (val) { case 0: /* Full speed */ pwm_enable_control(); set_pwm(255); break; case 1: /* As set by pwm1 */ pwm_enable_control(); set_pwm(data->curr_pwm); break; default: /* Control by motherboard */ pwm_disable_control(); break; } return count; } static ssize_t pwm_show(struct device *dev, struct device_attribute *attr, char *buf) { struct compal_data *data = dev_get_drvdata(dev); return sprintf(buf, "%hhu\n", data->curr_pwm); } static ssize_t pwm_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct compal_data *data = dev_get_drvdata(dev); long val; int err; err = strict_strtol(buf, 10, &val); if (err) return err; if (val < 0 || val > 255) return -EINVAL; data->curr_pwm = val; if (data->pwm_enable != 1) return count; set_pwm(val); return count; } static ssize_t fan_show(struct device *dev, struct device_attribute *attr, char *buf) { return sprintf(buf, "%d\n", get_fan_rpm()); } /* Temperature interface */ #define TEMPERATURE_SHOW_TEMP_AND_LABEL(POSTFIX, ADDRESS, LABEL) \ static ssize_t temp_##POSTFIX(struct device *dev, \ struct device_attribute *attr, char *buf) \ { \ return sprintf(buf, "%d\n", 1000 * (int)ec_read_s8(ADDRESS)); \ } \ static ssize_t label_##POSTFIX(struct device *dev, \ struct device_attribute *attr, char *buf) \ { \ return sprintf(buf, "%s\n", LABEL); \ } /* Labels as in service guide */ TEMPERATURE_SHOW_TEMP_AND_LABEL(cpu, TEMP_CPU, "CPU_TEMP"); TEMPERATURE_SHOW_TEMP_AND_LABEL(cpu_local, TEMP_CPU_LOCAL, "CPU_TEMP_LOCAL"); TEMPERATURE_SHOW_TEMP_AND_LABEL(cpu_DTS, TEMP_CPU_DTS, "CPU_DTS"); TEMPERATURE_SHOW_TEMP_AND_LABEL(northbridge,TEMP_NORTHBRIDGE,"NorthBridge"); TEMPERATURE_SHOW_TEMP_AND_LABEL(vga, TEMP_VGA, "VGA_TEMP"); TEMPERATURE_SHOW_TEMP_AND_LABEL(SKIN, TEMP_SKIN, "SKIN_TEMP90"); /* Power supply interface */ static int bat_status(void) { u8 status0 = ec_read_u8(BAT_STATUS0); u8 status1 = ec_read_u8(BAT_STATUS1); if (status0 & BAT_S0_CHARGING) return POWER_SUPPLY_STATUS_CHARGING; if (status0 & BAT_S0_DISCHARGE) return POWER_SUPPLY_STATUS_DISCHARGING; if (status1 & BAT_S1_FULL) return POWER_SUPPLY_STATUS_FULL; return POWER_SUPPLY_STATUS_NOT_CHARGING; } static int bat_health(void) { u8 status = ec_read_u8(BAT_STOP_CHARGE1); if (status & BAT_STOP_CHRG1_OVERTEMPERATURE) return POWER_SUPPLY_HEALTH_OVERHEAT; if (status & BAT_STOP_CHRG1_OVERVOLTAGE) return POWER_SUPPLY_HEALTH_OVERVOLTAGE; if (status & BAT_STOP_CHRG1_BAD_CELL) return POWER_SUPPLY_HEALTH_DEAD; if (status & BAT_STOP_CHRG1_COMM_FAIL) return POWER_SUPPLY_HEALTH_UNKNOWN; return POWER_SUPPLY_HEALTH_GOOD; } static int bat_is_present(void) { u8 status = ec_read_u8(BAT_STATUS2); return ((status & BAT_S1_EXISTS) != 0); } static int bat_technology(void) { u8 status = ec_read_u8(BAT_STATUS1); if (status & BAT_S1_LiION_OR_NiMH) return POWER_SUPPLY_TECHNOLOGY_LION; return POWER_SUPPLY_TECHNOLOGY_NiMH; } static int bat_capacity_level(void) { u8 status0 = ec_read_u8(BAT_STATUS0); u8 status1 = ec_read_u8(BAT_STATUS1); u8 status2 = ec_read_u8(BAT_STATUS2); if (status0 & BAT_S0_DISCHRG_CRITICAL || status1 & BAT_S1_EMPTY || status2 & BAT_S2_LOW_LOW) return POWER_SUPPLY_CAPACITY_LEVEL_CRITICAL; if (status0 & BAT_S0_LOW) return POWER_SUPPLY_CAPACITY_LEVEL_LOW; if (status1 & BAT_S1_FULL) return POWER_SUPPLY_CAPACITY_LEVEL_FULL; return POWER_SUPPLY_CAPACITY_LEVEL_NORMAL; } static int bat_get_property(struct power_supply *psy, enum power_supply_property psp, union power_supply_propval *val) { struct compal_data *data; data = container_of(psy, struct compal_data, psy); switch (psp) { case POWER_SUPPLY_PROP_STATUS: val->intval = bat_status(); break; case POWER_SUPPLY_PROP_HEALTH: val->intval = bat_health(); break; case POWER_SUPPLY_PROP_PRESENT: val->intval = bat_is_present(); break; case POWER_SUPPLY_PROP_TECHNOLOGY: val->intval = bat_technology(); break; case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN: /* THE design voltage... */ val->intval = ec_read_u16(BAT_VOLTAGE_DESIGN) * 1000; break; case POWER_SUPPLY_PROP_VOLTAGE_NOW: val->intval = ec_read_u16(BAT_VOLTAGE_NOW) * 1000; break; case POWER_SUPPLY_PROP_CURRENT_NOW: val->intval = ec_read_s16(BAT_CURRENT_NOW) * 1000; break; case POWER_SUPPLY_PROP_CURRENT_AVG: val->intval = ec_read_s16(BAT_CURRENT_AVG) * 1000; break; case POWER_SUPPLY_PROP_POWER_NOW: val->intval = ec_read_u8(BAT_POWER) * 1000000; break; case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN: val->intval = ec_read_u16(BAT_CHARGE_DESIGN) * 1000; break; case POWER_SUPPLY_PROP_CHARGE_NOW: val->intval = ec_read_u16(BAT_CHARGE_NOW) * 1000; break; case POWER_SUPPLY_PROP_CAPACITY: val->intval = ec_read_u8(BAT_CAPACITY); break; case POWER_SUPPLY_PROP_CAPACITY_LEVEL: val->intval = bat_capacity_level(); break; /* It smees that BAT_TEMP_AVG is a (2's complement?) value showing * the number of degrees, whereas BAT_TEMP is somewhat more * complicated. It looks like this is a negative nember with a * 100/256 divider and an offset of 222. Both were determined * experimentally by comparing BAT_TEMP and BAT_TEMP_AVG. */ case POWER_SUPPLY_PROP_TEMP: val->intval = ((222 - (int)ec_read_u8(BAT_TEMP)) * 1000) >> 8; break; case POWER_SUPPLY_PROP_TEMP_AMBIENT: /* Ambient, Avg, ... same thing */ val->intval = ec_read_s8(BAT_TEMP_AVG) * 10; break; /* Neither the model name nor manufacturer name work for me. */ case POWER_SUPPLY_PROP_MODEL_NAME: val->strval = data->bat_model_name; break; case POWER_SUPPLY_PROP_MANUFACTURER: val->strval = data->bat_manufacturer_name; break; case POWER_SUPPLY_PROP_SERIAL_NUMBER: val->strval = data->bat_serial_number; break; default: break; } return 0; } /* ============== */ /* Driver Globals */ /* ============== */ static DEVICE_ATTR(wake_up_pme, 0644, wake_up_pme_show, wake_up_pme_store); static DEVICE_ATTR(wake_up_modem, 0644, wake_up_modem_show, wake_up_modem_store); static DEVICE_ATTR(wake_up_lan, 0644, wake_up_lan_show, wake_up_lan_store); static DEVICE_ATTR(wake_up_wlan, 0644, wake_up_wlan_show, wake_up_wlan_store); static DEVICE_ATTR(wake_up_key, 0644, wake_up_key_show, wake_up_key_store); static DEVICE_ATTR(wake_up_mouse, 0644, wake_up_mouse_show, wake_up_mouse_store); static SENSOR_DEVICE_ATTR(name, S_IRUGO, hwmon_name_show, NULL, 1); static SENSOR_DEVICE_ATTR(fan1_input, S_IRUGO, fan_show, NULL, 1); static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, temp_cpu, NULL, 1); static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO, temp_cpu_local, NULL, 1); static SENSOR_DEVICE_ATTR(temp3_input, S_IRUGO, temp_cpu_DTS, NULL, 1); static SENSOR_DEVICE_ATTR(temp4_input, S_IRUGO, temp_northbridge, NULL, 1); static SENSOR_DEVICE_ATTR(temp5_input, S_IRUGO, temp_vga, NULL, 1); static SENSOR_DEVICE_ATTR(temp6_input, S_IRUGO, temp_SKIN, NULL, 1); static SENSOR_DEVICE_ATTR(temp1_label, S_IRUGO, label_cpu, NULL, 1); static SENSOR_DEVICE_ATTR(temp2_label, S_IRUGO, label_cpu_local, NULL, 1); static SENSOR_DEVICE_ATTR(temp3_label, S_IRUGO, label_cpu_DTS, NULL, 1); static SENSOR_DEVICE_ATTR(temp4_label, S_IRUGO, label_northbridge, NULL, 1); static SENSOR_DEVICE_ATTR(temp5_label, S_IRUGO, label_vga, NULL, 1); static SENSOR_DEVICE_ATTR(temp6_label, S_IRUGO, label_SKIN, NULL, 1); static SENSOR_DEVICE_ATTR(pwm1, S_IRUGO | S_IWUSR, pwm_show, pwm_store, 1); static SENSOR_DEVICE_ATTR(pwm1_enable, S_IRUGO | S_IWUSR, pwm_enable_show, pwm_enable_store, 0); static struct attribute *compal_attributes[] = { &dev_attr_wake_up_pme.attr, &dev_attr_wake_up_modem.attr, &dev_attr_wake_up_lan.attr, &dev_attr_wake_up_wlan.attr, &dev_attr_wake_up_key.attr, &dev_attr_wake_up_mouse.attr, /* Maybe put the sensor-stuff in a separate hwmon-driver? That way, * the hwmon sysfs won't be cluttered with the above files. */ &sensor_dev_attr_name.dev_attr.attr, &sensor_dev_attr_pwm1_enable.dev_attr.attr, &sensor_dev_attr_pwm1.dev_attr.attr, &sensor_dev_attr_fan1_input.dev_attr.attr, &sensor_dev_attr_temp1_input.dev_attr.attr, &sensor_dev_attr_temp2_input.dev_attr.attr, &sensor_dev_attr_temp3_input.dev_attr.attr, &sensor_dev_attr_temp4_input.dev_attr.attr, &sensor_dev_attr_temp5_input.dev_attr.attr, &sensor_dev_attr_temp6_input.dev_attr.attr, &sensor_dev_attr_temp1_label.dev_attr.attr, &sensor_dev_attr_temp2_label.dev_attr.attr, &sensor_dev_attr_temp3_label.dev_attr.attr, &sensor_dev_attr_temp4_label.dev_attr.attr, &sensor_dev_attr_temp5_label.dev_attr.attr, &sensor_dev_attr_temp6_label.dev_attr.attr, NULL }; static struct attribute_group compal_attribute_group = { .attrs = compal_attributes }; static int __devinit compal_probe(struct platform_device *); static int __devexit compal_remove(struct platform_device *); static struct platform_driver compal_driver = { .driver = { .name = DRIVER_NAME, .owner = THIS_MODULE, }, .probe = compal_probe, .remove = __devexit_p(compal_remove) }; static enum power_supply_property compal_bat_properties[] = { POWER_SUPPLY_PROP_STATUS, POWER_SUPPLY_PROP_HEALTH, POWER_SUPPLY_PROP_PRESENT, POWER_SUPPLY_PROP_TECHNOLOGY, POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN, POWER_SUPPLY_PROP_VOLTAGE_NOW, POWER_SUPPLY_PROP_CURRENT_NOW, POWER_SUPPLY_PROP_CURRENT_AVG, POWER_SUPPLY_PROP_POWER_NOW, POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN, POWER_SUPPLY_PROP_CHARGE_NOW, POWER_SUPPLY_PROP_CAPACITY, POWER_SUPPLY_PROP_CAPACITY_LEVEL, POWER_SUPPLY_PROP_TEMP, POWER_SUPPLY_PROP_TEMP_AMBIENT, POWER_SUPPLY_PROP_MODEL_NAME, POWER_SUPPLY_PROP_MANUFACTURER, POWER_SUPPLY_PROP_SERIAL_NUMBER, }; static struct backlight_device *compalbl_device; static struct platform_device *compal_device; static struct rfkill *wifi_rfkill; static struct rfkill *bt_rfkill; /* =================================== */ /* Initialization & clean-up functions */ /* =================================== */ static int dmi_check_cb(const struct dmi_system_id *id) { pr_info("Identified laptop model '%s'\n", id->ident); extra_features = false; return 1; } static int dmi_check_cb_extra(const struct dmi_system_id *id) { pr_info("Identified laptop model '%s', enabling extra features\n", id->ident); extra_features = true; return 1; } static struct dmi_system_id __initdata compal_dmi_table[] = { { .ident = "FL90/IFL90", .matches = { DMI_MATCH(DMI_BOARD_NAME, "IFL90"), DMI_MATCH(DMI_BOARD_VERSION, "IFT00"), }, .callback = dmi_check_cb }, { .ident = "FL90/IFL90", .matches = { DMI_MATCH(DMI_BOARD_NAME, "IFL90"), DMI_MATCH(DMI_BOARD_VERSION, "REFERENCE"), }, .callback = dmi_check_cb }, { .ident = "FL91/IFL91", .matches = { DMI_MATCH(DMI_BOARD_NAME, "IFL91"), DMI_MATCH(DMI_BOARD_VERSION, "IFT00"), }, .callback = dmi_check_cb }, { .ident = "FL92/JFL92", .matches = { DMI_MATCH(DMI_BOARD_NAME, "JFL92"), DMI_MATCH(DMI_BOARD_VERSION, "IFT00"), }, .callback = dmi_check_cb }, { .ident = "FT00/IFT00", .matches = { DMI_MATCH(DMI_BOARD_NAME, "IFT00"), DMI_MATCH(DMI_BOARD_VERSION, "IFT00"), }, .callback = dmi_check_cb }, { .ident = "Dell Mini 9", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 910"), }, .callback = dmi_check_cb }, { .ident = "Dell Mini 10", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1010"), }, .callback = dmi_check_cb }, { .ident = "Dell Mini 10v", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1011"), }, .callback = dmi_check_cb }, { .ident = "Dell Mini 1012", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1012"), }, .callback = dmi_check_cb }, { .ident = "Dell Inspiron 11z", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1110"), }, .callback = dmi_check_cb }, { .ident = "Dell Mini 12", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1210"), }, .callback = dmi_check_cb }, { .ident = "JHL90", .matches = { DMI_MATCH(DMI_BOARD_NAME, "JHL90"), DMI_MATCH(DMI_BOARD_VERSION, "REFERENCE"), }, .callback = dmi_check_cb_extra }, { .ident = "KHLB2", .matches = { DMI_MATCH(DMI_BOARD_NAME, "KHLB2"), DMI_MATCH(DMI_BOARD_VERSION, "REFERENCE"), }, .callback = dmi_check_cb_extra }, { } }; static void initialize_power_supply_data(struct compal_data *data) { data->psy.name = DRIVER_NAME; data->psy.type = POWER_SUPPLY_TYPE_BATTERY; data->psy.properties = compal_bat_properties; data->psy.num_properties = ARRAY_SIZE(compal_bat_properties); data->psy.get_property = bat_get_property; ec_read_sequence(BAT_MANUFACTURER_NAME_ADDR, data->bat_manufacturer_name, BAT_MANUFACTURER_NAME_LEN); data->bat_manufacturer_name[BAT_MANUFACTURER_NAME_LEN] = 0; ec_read_sequence(BAT_MODEL_NAME_ADDR, data->bat_model_name, BAT_MODEL_NAME_LEN); data->bat_model_name[BAT_MODEL_NAME_LEN] = 0; scnprintf(data->bat_serial_number, BAT_SERIAL_NUMBER_LEN + 1, "%d", ec_read_u16(BAT_SERIAL_NUMBER_ADDR)); } static void initialize_fan_control_data(struct compal_data *data) { data->pwm_enable = 2; /* Keep motherboard in control for now */ data->curr_pwm = 255; /* Try not to cause a CPU_on_fire exception if we take over... */ } static int setup_rfkill(void) { int ret; wifi_rfkill = rfkill_alloc("compal-wifi", &compal_device->dev, RFKILL_TYPE_WLAN, &compal_rfkill_ops, (void *) WIRELESS_WLAN); if (!wifi_rfkill) return -ENOMEM; ret = rfkill_register(wifi_rfkill); if (ret) goto err_wifi; bt_rfkill = rfkill_alloc("compal-bluetooth", &compal_device->dev, RFKILL_TYPE_BLUETOOTH, &compal_rfkill_ops, (void *) WIRELESS_BT); if (!bt_rfkill) { ret = -ENOMEM; goto err_allocate_bt; } ret = rfkill_register(bt_rfkill); if (ret) goto err_register_bt; return 0; err_register_bt: rfkill_destroy(bt_rfkill); err_allocate_bt: rfkill_unregister(wifi_rfkill); err_wifi: rfkill_destroy(wifi_rfkill); return ret; } static int __init compal_init(void) { int ret; if (acpi_disabled) { pr_err("ACPI needs to be enabled for this driver to work!\n"); return -ENODEV; } if (!force && !dmi_check_system(compal_dmi_table)) { pr_err("Motherboard not recognized (You could try the module's force-parameter)\n"); return -ENODEV; } if (!acpi_video_backlight_support()) { struct backlight_properties props; memset(&props, 0, sizeof(struct backlight_properties)); props.type = BACKLIGHT_PLATFORM; props.max_brightness = BACKLIGHT_LEVEL_MAX; compalbl_device = backlight_device_register(DRIVER_NAME, NULL, NULL, &compalbl_ops, &props); if (IS_ERR(compalbl_device)) return PTR_ERR(compalbl_device); } ret = platform_driver_register(&compal_driver); if (ret) goto err_backlight; compal_device = platform_device_alloc(DRIVER_NAME, -1); if (!compal_device) { ret = -ENOMEM; goto err_platform_driver; } ret = platform_device_add(compal_device); /* This calls compal_probe */ if (ret) goto err_platform_device; ret = setup_rfkill(); if (ret) goto err_rfkill; pr_info("Driver " DRIVER_VERSION " successfully loaded\n"); return 0; err_rfkill: platform_device_del(compal_device); err_platform_device: platform_device_put(compal_device); err_platform_driver: platform_driver_unregister(&compal_driver); err_backlight: backlight_device_unregister(compalbl_device); return ret; } static int __devinit compal_probe(struct platform_device *pdev) { int err; struct compal_data *data; if (!extra_features) return 0; /* Fan control */ data = kzalloc(sizeof(struct compal_data), GFP_KERNEL); if (!data) return -ENOMEM; initialize_fan_control_data(data); err = sysfs_create_group(&pdev->dev.kobj, &compal_attribute_group); if (err) { kfree(data); return err; } data->hwmon_dev = hwmon_device_register(&pdev->dev); if (IS_ERR(data->hwmon_dev)) { err = PTR_ERR(data->hwmon_dev); sysfs_remove_group(&pdev->dev.kobj, &compal_attribute_group); kfree(data); return err; } /* Power supply */ initialize_power_supply_data(data); power_supply_register(&compal_device->dev, &data->psy); platform_set_drvdata(pdev, data); return 0; } static void __exit compal_cleanup(void) { platform_device_unregister(compal_device); platform_driver_unregister(&compal_driver); backlight_device_unregister(compalbl_device); rfkill_unregister(wifi_rfkill); rfkill_unregister(bt_rfkill); rfkill_destroy(wifi_rfkill); rfkill_destroy(bt_rfkill); pr_info("Driver unloaded\n"); } static int __devexit compal_remove(struct platform_device *pdev) { struct compal_data *data; if (!extra_features) return 0; pr_info("Unloading: resetting fan control to motherboard\n"); pwm_disable_control(); data = platform_get_drvdata(pdev); hwmon_device_unregister(data->hwmon_dev); power_supply_unregister(&data->psy); platform_set_drvdata(pdev, NULL); kfree(data); sysfs_remove_group(&pdev->dev.kobj, &compal_attribute_group); return 0; } module_init(compal_init); module_exit(compal_cleanup); MODULE_AUTHOR("Cezary Jackiewicz"); MODULE_AUTHOR("Roald Frederickx (roald.frederickx@gmail.com)"); MODULE_DESCRIPTION("Compal Laptop Support"); MODULE_VERSION(DRIVER_VERSION); MODULE_LICENSE("GPL"); MODULE_ALIAS("dmi:*:rnIFL90:rvrIFT00:*"); MODULE_ALIAS("dmi:*:rnIFL90:rvrREFERENCE:*"); MODULE_ALIAS("dmi:*:rnIFL91:rvrIFT00:*"); MODULE_ALIAS("dmi:*:rnJFL92:rvrIFT00:*"); MODULE_ALIAS("dmi:*:rnIFT00:rvrIFT00:*"); MODULE_ALIAS("dmi:*:rnJHL90:rvrREFERENCE:*"); MODULE_ALIAS("dmi:*:svnDellInc.:pnInspiron910:*"); MODULE_ALIAS("dmi:*:svnDellInc.:pnInspiron1010:*"); MODULE_ALIAS("dmi:*:svnDellInc.:pnInspiron1011:*"); MODULE_ALIAS("dmi:*:svnDellInc.:pnInspiron1012:*"); MODULE_ALIAS("dmi:*:svnDellInc.:pnInspiron1110:*"); MODULE_ALIAS("dmi:*:svnDellInc.:pnInspiron1210:*");
{ "content_hash": "261887b666410f222c7f672b022eed8a", "timestamp": "", "source": "github", "line_count": 1112, "max_line_length": 86, "avg_line_length": 27.922661870503596, "alnum_prop": 0.6786151368760064, "repo_name": "WhiteBearSolutions/WBSAirback", "id": "8877b836d27cf4bde02014d9a37763a3672bb4a0", "size": "31050", "binary": false, "copies": "2925", "ref": "refs/heads/master", "path": "packages/wbsairback-kernel-image/wbsairback-kernel-image-3.2.43/drivers/platform/x86/compal-laptop.c", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "4780982" } ], "symlink_target": "" }
package org.kaazing.nuklei.tcp.internal.writer; import java.nio.channels.SocketChannel; import uk.co.real_logic.agrona.concurrent.ringbuffer.RingBuffer; public class WriterState { private final long streamId; private final SocketChannel channel; private final RingBuffer streamBuffer; public WriterState( RingBuffer streamBuffer, long streamId, SocketChannel channel) { this.streamId = streamId; this.channel = channel; this.streamBuffer = streamBuffer; } public long streamId() { return this.streamId; } public SocketChannel channel() { return channel; } public RingBuffer streamBuffer() { return streamBuffer; } @Override public String toString() { return String.format("[streamId=%d, channel=%s]", streamId(), channel()); } }
{ "content_hash": "040a35b5e138c1da9b3d3b19a1e1c518", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 81, "avg_line_length": 19.88888888888889, "alnum_prop": 0.6446927374301676, "repo_name": "cmebarrow/nuklei", "id": "d5bd04afa890dd7861d5b64e7c4eb33bb0c72f45", "size": "1522", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "tcp/src/main/java/org/kaazing/nuklei/tcp/internal/writer/WriterState.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "580138" } ], "symlink_target": "" }
[Atom package](https://atom.io/packages/fixmyjs) > Automagically fix JSHint lint warnings using [fixmyjs](https://github.com/jshint/fixmyjs) <img src="https://cloud.githubusercontent.com/assets/170270/4474662/ceab387a-4962-11e4-99ab-17dd5c44847c.gif" width="399"> *Issues with the output should be reported on the fixmyjs [issue tracker](https://github.com/jshint/fixmyjs/issues).* ## Install ```sh $ apm install fixmyjs ``` Or Settings → Packages → Search for `fixmyjs` ## Usage Open the Command Palette, and type `fixmyjs`. Can also be run on just a selection. For example the code in a `<script>` tag. ## Legacy mode By default, this plugin uses the FixMyJS `legacy` mode. This option uses the last stable version of the module which uses JSHint to detect errors in your code and fix them. It does not include all of the fixes the current version of FixMyJS exposes, but does do a much better job of preserving source formatting. Legacy mode can be disabled in the Settings. ## License MIT © [Sindre Sorhus](http://sindresorhus.com)
{ "content_hash": "5ecd4d4cbc60ccb633dd2da70729e5b1", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 184, "avg_line_length": 30.114285714285714, "alnum_prop": 0.7533206831119544, "repo_name": "goatslacker/atom-fixmyjs", "id": "5760fa54d8f6afd418ff83c18164e20a21159634", "size": "1070", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "readme.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "1910" } ], "symlink_target": "" }
using System.Globalization; using Xunit; namespace System.Tests { public static partial class DateTimeOffsetTests { [Fact] public static void ToString_ParseSpan_RoundtripsSuccessfully() { DateTimeOffset expected = DateTimeOffset.MaxValue; string expectedString = expected.ToString(); Assert.Equal(expectedString, DateTimeOffset.Parse(expectedString.AsReadOnlySpan()).ToString()); Assert.Equal(expectedString, DateTimeOffset.Parse(expectedString.AsReadOnlySpan(), null).ToString()); Assert.Equal(expectedString, DateTimeOffset.Parse(expectedString.AsReadOnlySpan(), null, DateTimeStyles.None).ToString()); Assert.True(DateTimeOffset.TryParse(expectedString.AsReadOnlySpan(), out DateTimeOffset actual)); Assert.Equal(expectedString, actual.ToString()); Assert.True(DateTimeOffset.TryParse(expectedString.AsReadOnlySpan(), null, DateTimeStyles.None, out actual)); Assert.Equal(expectedString, actual.ToString()); } [Fact] public static void ToString_ParseExactSpan_RoundtripsSuccessfully() { DateTimeOffset expected = DateTimeOffset.MaxValue; string expectedString = expected.ToString("u"); Assert.Equal(expectedString, DateTimeOffset.ParseExact(expectedString, "u", null, DateTimeStyles.None).ToString("u")); Assert.Equal(expectedString, DateTimeOffset.ParseExact(expectedString, new[] { "u" }, null, DateTimeStyles.None).ToString("u")); Assert.True(DateTimeOffset.TryParseExact(expectedString, "u", null, DateTimeStyles.None, out DateTimeOffset actual)); Assert.Equal(expectedString, actual.ToString("u")); Assert.True(DateTimeOffset.TryParseExact(expectedString, new[] { "u" }, null, DateTimeStyles.None, out actual)); Assert.Equal(expectedString, actual.ToString("u")); } [Fact] public static void TryFormat_ToString_EqualResults() { DateTimeOffset expected = DateTimeOffset.MaxValue; string expectedString = expected.ToString(); // Just the right amount of space, succeeds Span<char> actual = new char[expectedString.Length]; Assert.True(expected.TryFormat(actual, out int charsWritten)); Assert.Equal(expectedString.Length, charsWritten); Assert.Equal<char>(expectedString.ToCharArray(), actual.ToArray()); // Too little space, fails actual = new char[expectedString.Length - 1]; Assert.False(expected.TryFormat(actual, out charsWritten)); Assert.Equal(0, charsWritten); // More than enough space, succeeds actual = new char[expectedString.Length + 1]; Assert.True(expected.TryFormat(actual, out charsWritten)); Assert.Equal(expectedString.Length, charsWritten); Assert.Equal<char>(expectedString.ToCharArray(), actual.Slice(0, expectedString.Length).ToArray()); Assert.Equal(0, actual[actual.Length - 1]); } } }
{ "content_hash": "3909ea558f7fb2a56292d457f77973e0", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 140, "avg_line_length": 49.109375, "alnum_prop": 0.6659242761692651, "repo_name": "fgreinacher/corefx", "id": "5d3e9ac360d7da2ab83cd4133239736fdd749f68", "size": "3347", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/System.Runtime/tests/System/DateTimeOffsetTests.netcoreapp.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "1555" }, { "name": "C", "bytes": "25748" }, { "name": "C#", "bytes": "91179997" }, { "name": "C++", "bytes": "55067" }, { "name": "CMake", "bytes": "3078" }, { "name": "Shell", "bytes": "21031" }, { "name": "Smalltalk", "bytes": "8024" }, { "name": "Visual Basic", "bytes": "827616" } ], "symlink_target": "" }
tuples ===== base ---- tuples are sequences, like lists, but they are immutable, like strings functionlally, they are used to represent fixed collections of items they are coded in parentheses, and they support arbitrary types, arbirtrary nesting, and the usual sequence operations methods - index(i) - return the element by the index - count(element) - return the quantity of the element
{ "content_hash": "742f9caabe03d3cca1d72434962fa138", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 58, "avg_line_length": 21.94736842105263, "alnum_prop": 0.7290167865707434, "repo_name": "ordinary-developer/lin_education", "id": "4335c684d8f69365043acd986da4fa65b8e8dd0b", "size": "417", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "books/techno/python/learning_python_5_ed_m_lutz/synopses/part_2-TYPES_AND_OPERATIONS/ch_4-introducing_to_python_object_types/06_tuples.md", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace XrmFramework.DefinitionManager.Properties { using System; /// <summary> /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("XrmFramework.DefinitionManager.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } } }
{ "content_hash": "b45daa7f4eefb60c1882edfb918be71a", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 196, "avg_line_length": 44.82539682539682, "alnum_prop": 0.6179178470254958, "repo_name": "cgoconseils/XrmFramework", "id": "8dba213b1cc6ab2fa086cb6ed401e5b761b216ba", "size": "2826", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/XrmFramework.DefinitionManager/Properties/Resources.Designer.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "4750930" }, { "name": "PowerShell", "bytes": "8009" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_29) on Mon Nov 26 17:22:14 MSK 2012 --> <TITLE> Uses of Class org.apache.poi.hpbf.dev.PLCDumper (POI API Documentation) </TITLE> <META NAME="date" CONTENT="2012-11-26"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.poi.hpbf.dev.PLCDumper (POI API Documentation)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../org/apache/poi/hpbf/dev/PLCDumper.html" title="class in org.apache.poi.hpbf.dev"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?org/apache/poi/hpbf/dev/\class-usePLCDumper.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="PLCDumper.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Class<br>org.apache.poi.hpbf.dev.PLCDumper</B></H2> </CENTER> No usage of org.apache.poi.hpbf.dev.PLCDumper <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../org/apache/poi/hpbf/dev/PLCDumper.html" title="class in org.apache.poi.hpbf.dev"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?org/apache/poi/hpbf/dev/\class-usePLCDumper.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="PLCDumper.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> <i>Copyright 2012 The Apache Software Foundation or its licensors, as applicable.</i> </BODY> </HTML>
{ "content_hash": "f3ea212637a57da80318e2d753241649", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 216, "avg_line_length": 42.31292517006803, "alnum_prop": 0.5905144694533762, "repo_name": "HRKN2245/CameraSunmoku", "id": "024f0d3b67533a694b574f672efb4e5d4d833748", "size": "6220", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "ExtractSample/poi-3.9/docs/apidocs/org/apache/poi/hpbf/dev/class-use/PLCDumper.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "16091" }, { "name": "Java", "bytes": "126912" } ], "symlink_target": "" }
package org.destinationsol.game.input; import com.badlogic.gdx.math.Vector2; import org.destinationsol.Const; import org.destinationsol.common.SolMath; import org.destinationsol.game.SolGame; import org.destinationsol.game.planet.Planet; public class BigObjAvoider { public static final float MAX_DIST_LEN = 2 * (Const.MAX_GROUND_HEIGHT + Const.ATM_HEIGHT); private Vector2 myProj; public BigObjAvoider() { myProj = new Vector2(); } public float avoid(SolGame game, Vector2 from, Vector2 dest, float toDestAngle) { float toDestLen = from.dst(dest); if (toDestLen > MAX_DIST_LEN) toDestLen = MAX_DIST_LEN; float res = toDestAngle; Planet p = game.getPlanetMan().getNearestPlanet(from); Vector2 pPos = p.getPos(); float pRad = p.getFullHeight(); if (dest.dst(pPos) < pRad) pRad = p.getGroundHeight(); myProj.set(pPos); myProj.sub(from); SolMath.rotate(myProj, -toDestAngle); if (0 < myProj.x && myProj.x < toDestLen) { if (SolMath.abs(myProj.y) < pRad) { toDestLen = myProj.x; res = toDestAngle + 45 * SolMath.toInt(myProj.y < 0); } } Vector2 sunPos = p.getSys().getPos(); float sunRad = Const.SUN_RADIUS; myProj.set(sunPos); myProj.sub(from); SolMath.rotate(myProj, -toDestAngle); if (0 < myProj.x && myProj.x < toDestLen) { if (SolMath.abs(myProj.y) < sunRad) { res = toDestAngle + 45 * SolMath.toInt(myProj.y < 0); } } return res; } }
{ "content_hash": "094eb82e59182f4c27179a8f15b70ce3", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 92, "avg_line_length": 30.3265306122449, "alnum_prop": 0.6588156123822342, "repo_name": "askneller/DestinationSol", "id": "525f3ffc563977be4e9a4aa9b3193eca4384a895", "size": "2077", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "main/src/org/destinationsol/game/input/BigObjAvoider.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "53536" }, { "name": "Groff", "bytes": "1326972" }, { "name": "HTML", "bytes": "3820" }, { "name": "Java", "bytes": "968564" }, { "name": "OpenEdge ABL", "bytes": "32696" }, { "name": "Shell", "bytes": "12683" } ], "symlink_target": "" }
Spree::Product.class_eval do # Product.variants.delete has_many :ingredients, through: :product_ingredients, :class_name => "Dish::Ingredient" has_many :product_ingredients, :class_name => "Dish::ProductIngredient", foreign_key: 'product_id' belongs_to :difficulty, :class_name => "Dish::Difficulty", foreign_key: 'difficulty_id' has_many :whatneeds, through: :product_whatneeds, :class_name => "Dish::Whatneed" has_many :product_whatneeds, :class_name => "Dish::ProductWhatneed", foreign_key: 'product_id' has_many :nutritions, through: :product_nutritions, :class_name => "Dish::Nutrition" has_many :product_nutritions, :class_name => "Dish::ProductNutrition", foreign_key: 'product_id' has_many :howtocooks, :class_name => "Dish::Howtocook" belongs_to :expert, :class_name => "Bm::Expert", foreign_key: 'bm_expert_id' has_many :date_deliveries, :class_name => "Dish::DateDelivery" belongs_to :dish_type, :class_name => "Dish::DishType" accepts_nested_attributes_for :product_nutritions, allow_destroy: true, reject_if: lambda { |pp| pp[:nutrition_name].blank? } def self.product_of_date(date) Spree::Product.select("spree_products.*, date_deliveries.delivery_date").joins(:date_deliveries).where(:date_deliveries => {:delivery_date => date }).uniq.order(:dish_type_id) end def copy_data_whatneed(product) array = Dish::ProductWhatneed.where(product_id: product.id) array.each do |w| tam = Dish::ProductWhatneed.new tam.product_id = self.id tam.whatneed_id = w.whatneed_id tam.save! end end def copy_data_nutrition(product) array = Dish::ProductNutrition.where(product_id: product.id) array.each do |w| tam = Dish::ProductNutrition.new tam.product_id = self.id tam.nutrition_id = w.nutrition_id tam.quantity = w.quantity tam.unit = w.unit tam.save! end end def copy_data_howtocook(product) product.howtocooks.each do |w| tam = Dish::Howtocook.new tam.position = w.position tam.title = w.title tam.content = w.content tam.product_id = self.id tam.save! end end end
{ "content_hash": "93d167d8a0d433debc671faf3a7fe3ca", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 177, "avg_line_length": 34.47540983606557, "alnum_prop": 0.6956728483119353, "repo_name": "Bvnkame/spree_dishes", "id": "67246143d2dd071b36bdf94d5799679a1e09c923", "size": "2103", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/models/spree/spree_product_decorator.rb", "mode": "33261", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "305" }, { "name": "JavaScript", "bytes": "299" }, { "name": "Ruby", "bytes": "33807" } ], "symlink_target": "" }
// Copyright 2018 The Nomulus Authors. All Rights Reserved. // // 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. package google.registry.ui.server.registrar; import static com.google.common.base.Preconditions.checkState; import static google.registry.config.RegistryEnvironment.PRODUCTION; import static google.registry.ui.server.SoyTemplateUtils.CSS_RENAMING_MAP_SUPPLIER; import static javax.servlet.http.HttpServletResponse.SC_FORBIDDEN; import com.google.common.base.Ascii; import com.google.common.base.Supplier; import com.google.common.collect.ImmutableMap; import com.google.common.flogger.FluentLogger; import com.google.template.soy.tofu.SoyTofu; import google.registry.config.RegistryEnvironment; import google.registry.model.OteAccountBuilder; import google.registry.request.Action; import google.registry.request.Action.Method; import google.registry.request.Parameter; import google.registry.request.auth.Auth; import google.registry.request.auth.AuthenticatedRegistrarAccessor; import google.registry.ui.server.SendEmailUtils; import google.registry.ui.server.SoyTemplateUtils; import google.registry.ui.soy.registrar.OteSetupConsoleSoyInfo; import google.registry.util.StringGenerator; import java.util.HashMap; import java.util.Optional; import javax.inject.Inject; import javax.inject.Named; /** * Action that serves OT&amp;E setup web page. * * <p>This Action does 2 things: - for GET, just returns the form that asks for the clientId and * email. - for POST, receives the clientId and email and generates the OTE entities. * * <p>TODO(b/120201577): once we can have 2 different Actions with the same path (different * Methods), separate this class to 2 Actions. */ @Action( service = Action.Service.DEFAULT, path = ConsoleOteSetupAction.PATH, method = {Method.POST, Method.GET}, auth = Auth.AUTH_PUBLIC) public final class ConsoleOteSetupAction extends HtmlAction { public static final String PATH = "/registrar-ote-setup"; private static final int PASSWORD_LENGTH = 16; private static final FluentLogger logger = FluentLogger.forEnclosingClass(); private static final Supplier<SoyTofu> TOFU_SUPPLIER = SoyTemplateUtils.createTofuSupplier( google.registry.ui.soy.registrar.AnalyticsSoyInfo.getInstance(), google.registry.ui.soy.registrar.ConsoleSoyInfo.getInstance(), google.registry.ui.soy.registrar.ConsoleUtilsSoyInfo.getInstance(), google.registry.ui.soy.registrar.FormsSoyInfo.getInstance(), google.registry.ui.soy.registrar.OteSetupConsoleSoyInfo.getInstance()); @Inject AuthenticatedRegistrarAccessor registrarAccessor; @Inject SendEmailUtils sendEmailUtils; @Inject @Named("base58StringGenerator") StringGenerator passwordGenerator; @Inject @Parameter("clientId") Optional<String> clientId; @Inject @Parameter("email") Optional<String> email; @Inject @Parameter("password") Optional<String> optionalPassword; @Inject ConsoleOteSetupAction() {} @Override public void runAfterLogin(HashMap<String, Object> data) { checkState( !RegistryEnvironment.get().equals(PRODUCTION), "Can't create OT&E in prod"); if (!registrarAccessor.isAdmin()) { response.setStatus(SC_FORBIDDEN); response.setPayload( TOFU_SUPPLIER .get() .newRenderer(OteSetupConsoleSoyInfo.WHOAREYOU) .setCssRenamingMap(CSS_RENAMING_MAP_SUPPLIER.get()) .setData(data) .render()); return; } switch (method) { case POST: runPost(data); return; case GET: runGet(data); return; default: return; } } @Override public String getPath() { return PATH; } private void runPost(HashMap<String, Object> data) { try { checkState(clientId.isPresent() && email.isPresent(), "Must supply clientId and email"); data.put("baseClientId", clientId.get()); data.put("contactEmail", email.get()); String password = optionalPassword.orElse(passwordGenerator.createString(PASSWORD_LENGTH)); ImmutableMap<String, String> clientIdToTld = OteAccountBuilder.forRegistrarId(clientId.get()) .addContact(email.get()) .setPassword(password) .buildAndPersist(); sendExternalUpdates(clientIdToTld); data.put("clientIdToTld", clientIdToTld); data.put("password", password); response.setPayload( TOFU_SUPPLIER .get() .newRenderer(OteSetupConsoleSoyInfo.RESULT_SUCCESS) .setCssRenamingMap(CSS_RENAMING_MAP_SUPPLIER.get()) .setData(data) .render()); } catch (Throwable e) { logger.atWarning().withCause(e).log( "Failed to setup OT&E. clientId: %s, email: %s", clientId.get(), email.get()); data.put("errorMessage", e.getMessage()); response.setPayload( TOFU_SUPPLIER .get() .newRenderer(OteSetupConsoleSoyInfo.FORM_PAGE) .setCssRenamingMap(CSS_RENAMING_MAP_SUPPLIER.get()) .setData(data) .render()); } } private void runGet(HashMap<String, Object> data) { // set the values to pre-fill, if given data.put("baseClientId", clientId.orElse(null)); data.put("contactEmail", email.orElse(null)); response.setPayload( TOFU_SUPPLIER .get() .newRenderer(OteSetupConsoleSoyInfo.FORM_PAGE) .setCssRenamingMap(CSS_RENAMING_MAP_SUPPLIER.get()) .setData(data) .render()); } private void sendExternalUpdates(ImmutableMap<String, String> clientIdToTld) { if (!sendEmailUtils.hasRecipients()) { return; } String environment = Ascii.toLowerCase(String.valueOf(RegistryEnvironment.get())); StringBuilder builder = new StringBuilder(); builder.append( String.format( "The following entities were created in %s by %s:\n", environment, registrarAccessor.userIdForLogging())); clientIdToTld.forEach( (clientId, tld) -> builder.append( String.format(" Registrar %s with access to TLD %s\n", clientId, tld))); builder.append(String.format("Gave user %s web access to these Registrars\n", email.get())); sendEmailUtils.sendEmail( String.format("OT&E for registrar %s created in %s", clientId.get(), environment), builder.toString()); } }
{ "content_hash": "1cef211eea770bc885ffbb9104ca2af3", "timestamp": "", "source": "github", "line_count": 198, "max_line_length": 97, "avg_line_length": 35.535353535353536, "alnum_prop": 0.6917282546901649, "repo_name": "google/nomulus", "id": "a92dd02c812458156b884fa87a46a7bbb9d92458", "size": "7036", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "core/src/main/java/google/registry/ui/server/registrar/ConsoleOteSetupAction.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "131290" }, { "name": "Closure Templates", "bytes": "134645" }, { "name": "Dockerfile", "bytes": "6083" }, { "name": "HCL", "bytes": "17069" }, { "name": "HTML", "bytes": "1001828" }, { "name": "Java", "bytes": "10507061" }, { "name": "JavaScript", "bytes": "185672" }, { "name": "Kotlin", "bytes": "4233" }, { "name": "Python", "bytes": "122903" }, { "name": "Shell", "bytes": "30918" }, { "name": "Standard ML", "bytes": "968" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> <channel> <title>Mma on Coding with Data</title> <link>/categories/mma/</link> <description>Recent content in Mma on Coding with Data</description> <generator>Hugo -- gohugo.io</generator> <language>en-us</language> <lastBuildDate>Sun, 19 Apr 2020 23:15:14 -0500</lastBuildDate> <atom:link href="/categories/mma/index.xml" rel="self" type="application/rss+xml" /> <item> <title>UFC Stats: Understanding striking performance</title> <link>/blog/2020/2020-04-15-striking/</link> <pubDate>Sun, 19 Apr 2020 23:15:14 -0500</pubDate> <guid>/blog/2020/2020-04-15-striking/</guid> <description>A brief history of the Ultimate Fighter The first UFC event was held over a quarter century ago on November 12th 1993 in Denver, CO. The concept was to pit different martial arts and fighting styles against each other to see which one is truly superior. The event was the brainchild of Rorion Gracie, member of the legendary Brazilian jiu-jitsu (BJJ) family. In the late eighties and early nineties Rorion produced and appeared on several VHS tapes demonstrating the power of jiu jitsu over judo, karate, sambo and other martial arts.</description> </item> </channel> </rss>
{ "content_hash": "59e1e227f57fc90be8857b8d5cc58081", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 567, "avg_line_length": 57.166666666666664, "alnum_prop": 0.7091836734693877, "repo_name": "mtoto/mtoto.github.io", "id": "e72747ce67def21ef5ed547571bbea43b3ffe27a", "size": "1372", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "categories/mma/index.xml", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "122821" }, { "name": "HTML", "bytes": "785698" }, { "name": "JavaScript", "bytes": "233653" }, { "name": "Python", "bytes": "7497" }, { "name": "R", "bytes": "6208" } ], "symlink_target": "" }
<div class="social-icons"> <ul class="text-left"> <li><a href="{{ site.author.github }}" target="_blank"><i class="fa fa-github"></i></a></li> <li><a href="{{ site.author.twitter }}" target="_blank"><i class="fa fa-twitter"></i></a></li> <li><a href="{{ site.author.linkedin }}" target="_blank"><i class="fa fa-linkedin"></i></a></li> <li><a href="{{ site.author.email }}" target="_blank"><i class="fa fa-envelope"></i></a></li> </ul> </div>
{ "content_hash": "297982fbdc87ff8aa345be335e0efbfd", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 100, "avg_line_length": 57.75, "alnum_prop": 0.5670995670995671, "repo_name": "RomainSabathe/RomainSabathe.github.io", "id": "1c5043d06fff4c492351e67c90870282204bfcec", "size": "462", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_includes/social-icons.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "23433" }, { "name": "HTML", "bytes": "10575" }, { "name": "Ruby", "bytes": "2973" } ], "symlink_target": "" }
#include "xmlstdpardialog.h" #include <climits> #include <QColorDialog> #include <QFileDialog> MeshLabXMLStdDialog::MeshLabXMLStdDialog(QWidget *p ) :QDockWidget(QString("Plugin"), p),isfilterexecuting(false),env(),showHelp(false) { curmask = 0; qf = NULL; stdParFrame=NULL; clearValues(); } MeshLabXMLStdDialog::~MeshLabXMLStdDialog() { } void MeshLabXMLStdDialog::clearValues() { //curAction = NULL; curModel = NULL; curmfc = NULL; curmwi = NULL; } void MeshLabXMLStdDialog::createFrame() { if(qf) delete qf; QFrame *newqf= new QFrame(this); setWidget(newqf); qf = newqf; } void MeshLabXMLStdDialog::loadFrameContent( ) { assert(qf); qf->hide(); QLabel *ql; QGridLayout *gridLayout = new QGridLayout(qf); qf->setLayout(gridLayout); QString fname(curmfc->act->text()); setWindowTitle(fname); ql = new QLabel("<i>"+curmfc->xmlInfo->filterHelp(fname)+"</i>",qf); ql->setTextFormat(Qt::RichText); ql->setWordWrap(true); gridLayout->addWidget(ql,0,0,1,2,Qt::AlignTop); // this widgets spans over two columns. stdParFrame = new XMLStdParFrame(this,curgla); //connect(stdParFrame,SIGNAL(frameEvaluateExpression(const Expression&,Value**)),this,SIGNAL(dialogEvaluateExpression(const Expression&,Value**)),Qt::DirectConnection); MLXMLPluginInfo::XMLMapList mplist = curmfc->xmlInfo->filterParametersExtendedInfo(fname); EnvWrap wrap(env); stdParFrame->loadFrameContent(mplist,wrap); gridLayout->addWidget(stdParFrame,1,0,1,2); //int buttonRow = 2; // the row where the line of buttons start helpButton = new QPushButton("Help", qf); //helpButton->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Minimum); closeButton = new QPushButton("Close", qf); //closeButton->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Minimum); applyButton = new QPushButton("Apply", qf); //applyButton->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Minimum); defaultButton = new QPushButton("Default", qf); //defaultButton->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Minimum); applyButton->setFocus(); bool onlyimportant = true; connect(this->parentWidget(),SIGNAL(filterExecuted()),this,SLOT(postFilterExecution())); #ifdef Q_OS_MAC // Hack needed on mac for correct sizes of button in the bottom of the dialog. helpButton->setMinimumSize(100, 25); closeButton->setMinimumSize(100,25); applyButton->setMinimumSize(100,25); defaultButton->setMinimumSize(100, 25); #endif QString postCond = curmfc->xmlInfo->filterAttribute(fname,MLXMLElNames::filterPostCond); QStringList postCondList = postCond.split(QRegExp("\\W+"), QString::SkipEmptyParts); curmask = MeshLabFilterInterface::convertStringListToMeshElementEnum(postCondList); if(isPreviewable()) { previewCB = new QCheckBox("Preview", qf); previewCB->setCheckState(Qt::Unchecked); gridLayout->addWidget(previewCB, gridLayout->rowCount(),0,Qt::AlignBottom); connect(previewCB,SIGNAL(toggled(bool)),this,SLOT( togglePreview() )); //buttonRow++; } connect(helpButton,SIGNAL(clicked()),this,SLOT(toggleHelp())); connect(closeButton,SIGNAL(clicked()),this,SLOT(closeClick())); connect(defaultButton,SIGNAL(clicked()),this,SLOT(resetExpressions())); connect(applyButton,SIGNAL(clicked()),this,SLOT(applyClick())); foreach(MLXMLPluginInfo::XMLMap mp,mplist) { bool important = (mp[MLXMLElNames::paramIsImportant] == QString("true")); onlyimportant &= important; } if (!onlyimportant) { ExpandButtonWidget* exp = new ExpandButtonWidget(qf); connect(exp,SIGNAL(expandView(bool)),this,SLOT(extendedView(bool))); gridLayout->addWidget(exp,gridLayout->rowCount(),0,1,2,Qt::AlignJustify); } int firstButLine = gridLayout->rowCount(); gridLayout->addWidget(helpButton, firstButLine,1,Qt::AlignBottom); gridLayout->addWidget(defaultButton,firstButLine,0,Qt::AlignBottom); int secButLine = gridLayout->rowCount(); gridLayout->addWidget(closeButton, secButLine,0,Qt::AlignBottom); gridLayout->addWidget(applyButton, secButLine,1,Qt::AlignBottom); qf->showNormal(); qf->adjustSize(); //set the minimum size so it will shrink down to the right size after the help is toggled //this->setMinimumSize(qf->sizeHint()); this->showNormal(); this->adjustSize(); //setSizePolicy(QSizePolicy::Minimum,QSizePolicy::MinimumExpanding); } bool MeshLabXMLStdDialog::showAutoDialog(MeshLabXMLFilterContainer& mfc,PluginManager& pm,MeshDocument * md, MainWindowInterface *mwi, QWidget *gla/*=0*/ ) { /*if (mfc.filterInterface == NULL) return false;*/ curMeshDoc = md; if (curMeshDoc == NULL) return false; env.loadMLScriptEnv(*curMeshDoc,pm); if (mfc.xmlInfo == NULL) return false; if (mfc.act == NULL) return false; validcache = false; //curAction=mfc.act; curmfc=&mfc; curmwi=mwi; curParMap.clear(); //prevParMap.clear(); curModel = md->mm(); curgla=gla; QString fname = mfc.act->text(); //mfi->initParameterSet(action, *mdp, curParSet); MLXMLPluginInfo::XMLMapList mplist = mfc.xmlInfo->filterParametersExtendedInfo(fname); curParMap = mplist; //curmask = mfc->xmlInfo->filterAttribute(mfc->act->text(),QString("postCond")); if(curParMap.isEmpty() && !isPreviewable()) return false; QTime tt; tt.start(); createFrame(); loadFrameContent(); curMeshDoc->Log.Logf(GLLogStream::SYSTEM,"GUI created in %i msec",tt.elapsed()); //QString postCond = mfc.xmlInfo->filterAttribute(fname,MLXMLElNames::filterPostCond); //QStringList postCondList = postCond.split(QRegExp("\\W+"), QString::SkipEmptyParts); //curmask = MeshLabFilterInterface::convertStringListToMeshElementEnum(postCondList); if(isPreviewable()) { meshState.create(curmask, curModel); connect(stdParFrame,SIGNAL(parameterChanged()), this, SLOT(applyDynamic())); } connect(curMeshDoc, SIGNAL(currentMeshChanged(int)),this, SLOT(changeCurrentMesh(int))); raise(); activateWindow(); return true; } void MeshLabXMLStdDialog::applyClick() { //env.pushContext(); if ((isfilterexecuting) && (curmfc->xmlInfo->filterAttribute(curmfc->act->text(),MLXMLElNames::filterIsInterruptible) == "true")) { emit filterInterrupt(true); return; } assert(curParMap.size() == stdParFrame->xmlfieldwidgets.size()); for(int ii = 0;ii < curParMap.size();++ii) { XMLMeshLabWidget* wid = stdParFrame->xmlfieldwidgets[ii]; QString exp = wid->getWidgetExpression(); env.insertExpressionBinding(curParMap[ii][MLXMLElNames::paramName],exp); } ////int mask = 0;//curParSet.getDynamicFloatMask(); if(curmask) meshState.apply(curModel); //applyContext = env.currentContext()->toString(); ////PreView Caching: if the apply parameters are the same to those used in the preview mode ////we don't need to reapply the filter to the mesh //bool isEqual = (applyContext == previewContext); //if ((isEqual) && (validcache)) // meshCacheState.apply(curModel); //else //{ QString nm = curmfc->act->text(); EnvWrap* wrap = new EnvWrap(env); startFilterExecution(); curmwi->executeFilter(curmfc,*wrap,false); /*}*/ //env.popContext(); if(curmask) meshState.create(curmask, curModel); if(this->curgla) this->curgla->update(); } void MeshLabXMLStdDialog::closeClick() { if(curmask != MeshModel::MM_UNKNOWN) meshState.apply(curModel); curmask = MeshModel::MM_UNKNOWN; // Perform the update only if there is Valid GLarea. if(this->curgla) this->curgla->update(); close(); } void MeshLabXMLStdDialog::toggleHelp() { showHelp = !showHelp; stdParFrame->toggleHelp(showHelp); qf->updateGeometry(); qf->adjustSize(); this->updateGeometry(); this->adjustSize(); } void MeshLabXMLStdDialog::extendedView(bool ext) { stdParFrame->extendedView(ext,showHelp); qf->updateGeometry(); qf->adjustSize(); this->updateGeometry(); this->adjustSize(); } void MeshLabXMLStdDialog::togglePreview() { if(previewCB->isChecked()) { applyDynamic(); } else meshState.apply(curModel); curgla->update(); } void MeshLabXMLStdDialog::applyDynamic() { if(!previewCB->isChecked()) return; //QAction *q = curAction; env.pushContext(); assert(curParMap.size() == stdParFrame->xmlfieldwidgets.size()); for(int ii = 0;ii < curParMap.size();++ii) { XMLMeshLabWidget* wid = stdParFrame->xmlfieldwidgets[ii]; QString exp = wid->getWidgetExpression(); env.insertExpressionBinding(curParMap[ii][MLXMLElNames::paramName],exp); //delete exp; } //two different executions give the identical result if the two contexts (with the filter's parameters inside) are identical previewContext = env.currentContext()->toString(); meshState.apply(curModel); EnvWrap envir(env); curmwi->executeFilter(this->curmfc, envir, true); env.pushContext(); meshCacheState.create(curmask,curModel); validcache = true; if(this->curgla) this->curgla->update(); } void MeshLabXMLStdDialog::changeCurrentMesh( int meshInd ) { if(isPreviewable() && (curModel) && (curModel->id() != meshInd)) { meshState.apply(curModel); curModel=curMeshDoc->getMesh(meshInd); meshState.create(curmask, curModel); applyDynamic(); } } //void MeshLabXMLStdDialog::closeEvent( QCloseEvent * event ) //{ // //} bool MeshLabXMLStdDialog::isPreviewable() const { return ((curmask != MeshModel::MM_UNKNOWN) && (curmask != MeshModel::MM_NONE) && !(curmask & MeshModel::MM_VERTNUMBER) && !(curmask & MeshModel::MM_FACENUMBER) && !(curmask & MeshModel::MM_FACENORMAL) && !(curmask & MeshModel::MM_FACECOLOR)); } void MeshLabXMLStdDialog::resetExpressions() { QString fname(curmfc->act->text()); MLXMLPluginInfo::XMLMapList mplist = curmfc->xmlInfo->filterParametersExtendedInfo(fname); EnvWrap envir(env); stdParFrame->resetExpressions(mplist); } void MeshLabXMLStdDialog::closeEvent( QCloseEvent * /*event*/ ) { closeClick(); } void MeshLabXMLStdDialog::resetPointers() { curMeshDoc = NULL; curgla = NULL; curModel = NULL; } void MeshLabXMLStdDialog::postFilterExecution() { setDialogStateRelativeToFilterExecution(false); } void MeshLabXMLStdDialog::startFilterExecution() { setDialogStateRelativeToFilterExecution(true); } void MeshLabXMLStdDialog::setDialogStateRelativeToFilterExecution( const bool isfilterinexecution ) { isfilterexecuting = isfilterinexecution; if (curmfc == NULL) return; QString inter = curmfc->xmlInfo->filterAttribute(curmfc->act->text(),MLXMLElNames::filterIsInterruptible); if (inter == "true") { applyButton->setEnabled(true); //during filter execution Stop label should appear, otherwise the apply button is in the usual apply state applyButton->setText(MeshLabXMLStdDialog::applyButtonLabel(!isfilterinexecution)); } else { applyButton->setText(MeshLabXMLStdDialog::applyButtonLabel(true)); applyButton->setEnabled(!isfilterexecuting); } stdParFrame->setEnabled(!isfilterexecuting); } QString MeshLabXMLStdDialog::applyButtonLabel( const bool applystate ) { if (applystate) return QString("Apply"); else return QString("Stop"); return QString(); } XMLStdParFrame::XMLStdParFrame( QWidget *p,QWidget *gla/*=0*/ ) :QFrame(p),extended(false) { curr_gla=gla; //vLayout = new QGridLayout(); //vLayout->setAlignment(Qt::AlignTop); //setLayout(vLayout); //connect(p,SIGNAL(expandView(bool)),this,SLOT(expandView(bool))); //updateFrameContent(parMap,false); //this->setMinimumWidth(vLayout->sizeHint().width()); //this->showNormal(); //this->adjustSize(); } XMLStdParFrame::~XMLStdParFrame() { } void XMLStdParFrame::loadFrameContent(const MLXMLPluginInfo::XMLMapList& parMap,EnvWrap& envir) { MeshLabXMLStdDialog* dialog = qobject_cast<MeshLabXMLStdDialog*>(parent()); if (dialog == NULL) throw MeshLabException("An XMLStdParFrame has not a MeshLabXMLStdDialog's parent"); QGridLayout* glay = new QGridLayout(); int ii = 0; for(MLXMLPluginInfo::XMLMapList::const_iterator it = parMap.constBegin();it != parMap.constEnd();++it) { XMLMeshLabWidget* widg = XMLMeshLabWidgetFactory::create(*it,envir,dialog->curMeshDoc,this); if (widg == NULL) return; xmlfieldwidgets.push_back(widg); helpList.push_back(widg->helpLabel()); widg->addWidgetToGridLayout(glay,ii); ++ii; } setLayout(glay); //showNormal(); updateGeometry(); adjustSize(); } void XMLStdParFrame::toggleHelp(bool help) { for(int i = 0; i < helpList.count(); i++) helpList.at(i)->setVisible(help && xmlfieldwidgets[i]->isVisible()) ; updateGeometry(); adjustSize(); } void XMLStdParFrame::extendedView(bool ext,bool help) { for(int i = 0; i < xmlfieldwidgets.count(); i++) xmlfieldwidgets[i]->setVisibility(ext || xmlfieldwidgets[i]->isImportant); if (help) toggleHelp(help); updateGeometry(); adjustSize(); } void XMLStdParFrame::resetExpressions(const MLXMLPluginInfo::XMLMapList& mplist) { for(int i = 0; i < xmlfieldwidgets.count(); i++) xmlfieldwidgets[i]->set(mplist[i][MLXMLElNames::paramDefExpr]); } XMLMeshLabWidget::XMLMeshLabWidget(const MLXMLPluginInfo::XMLMap& mp,EnvWrap& envir,QWidget* parent ) :QWidget(parent),env(envir) { //WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //It's not nice at all doing the connection for an external object! The connect should be called in XMLStdParFrame::loadFrameContent but in this way //we must break the construction of the widget in two steps because otherwise in the constructor (called by XMLMeshLabWidgetFactory::create) the emit is invoked //before the connection! //connect(this,SIGNAL(widgetEvaluateExpression(const Expression&,Value**)),parent,SIGNAL(frameEvaluateExpression(const Expression&,Value**)),Qt::DirectConnection); isImportant = env.evalBool(mp[MLXMLElNames::paramIsImportant]); setVisible(isImportant); helpLab = new QLabel("<small>"+ mp[MLXMLElNames::paramHelpTag] +"</small>",this); helpLab->setTextFormat(Qt::RichText); helpLab->setWordWrap(true); helpLab->setVisible(false); helpLab->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred); helpLab->setMinimumWidth(250); helpLab->setMaximumWidth(QWIDGETSIZE_MAX); //gridLay = qobject_cast<QGridLayout*>(parent->layout()); //assert(gridLay != 0); //row = gridLay->rowCount(); ////WARNING!!!!!!!!!!!!!!!!!! HORRIBLE PATCH FOR THE BOOL WIDGET PROBLEM //if ((row == 1) && (mp[MLXMLElNames::guiType] == MLXMLElNames::checkBoxTag)) //{ // QLabel* lb = new QLabel("",this); // gridLay->addWidget(lb); // gridLay->addWidget(helpLab,row+1,3,1,1,Qt::AlignTop); //} /////////////////////////////////////////////////////////////////////////// //else // gridLay->addWidget(helpLab,row,3,1,1,Qt::AlignTop); } void XMLMeshLabWidget::setVisibility( const bool vis ) { helpLabel()->setVisible(helpLabel()->isVisible() && vis); updateVisibility(vis); setVisible(vis); } void XMLMeshLabWidget::addWidgetToGridLayout( QGridLayout* lay,const int r ) { if (lay != NULL) lay->addWidget(helpLab,r,2,1,1); } //void XMLMeshLabWidget::reset() //{ // this->set(map[MLXMLElNames::paramDefExpr]); //} XMLCheckBoxWidget::XMLCheckBoxWidget( const MLXMLPluginInfo::XMLMap& xmlWidgetTag,EnvWrap& envir,QWidget* parent ) :XMLMeshLabWidget(xmlWidgetTag,envir,parent) { cb = new QCheckBox(xmlWidgetTag[MLXMLElNames::guiLabel],this); cb->setToolTip(xmlWidgetTag[MLXMLElNames::paramHelpTag]); bool defVal = env.evalBool(xmlWidgetTag[MLXMLElNames::paramDefExpr]); cb->setChecked(defVal); //cb->setVisible(isImportant); ////gridlay->addWidget(this,i,0,1,1,Qt::AlignTop); ////int row = gridLay->rowCount() -1 ; ////WARNING!!!!!!!!!!!!!!!!!! HORRIBLE PATCH FOR THE BOOL WIDGET PROBLEM //if (row == 1) // gridLay->addWidget(cb,row + 1,0,1,2,Qt::AlignTop); /////////////////////////////////////////////////////////////////////////// //else // gridLay->addWidget(cb,row,0,1,2,Qt::AlignTop); setVisibility(isImportant); //cb->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); connect(cb,SIGNAL(stateChanged(int)),parent,SIGNAL(parameterChanged())); } XMLCheckBoxWidget::~XMLCheckBoxWidget() { } void XMLCheckBoxWidget::set( const QString& nwExpStr ) { cb->setChecked(env.evalBool(nwExpStr)); } void XMLCheckBoxWidget::updateVisibility( const bool vis ) { setVisibility(vis); } QString XMLCheckBoxWidget::getWidgetExpression() { QString state; if (cb->isChecked()) state = QString("true"); else state = QString("false"); return state; } void XMLCheckBoxWidget::setVisibility( const bool vis ) { cb->setVisible(vis); } void XMLCheckBoxWidget::addWidgetToGridLayout( QGridLayout* lay,const int r ) { if (lay !=NULL) lay->addWidget(cb,r,0,1,2); XMLMeshLabWidget::addWidgetToGridLayout(lay,r); } XMLMeshLabWidget* XMLMeshLabWidgetFactory::create(const MLXMLPluginInfo::XMLMap& widgetTable,EnvWrap& env,MeshDocument* md,QWidget* parent) { QString guiType = widgetTable[MLXMLElNames::guiType]; if (guiType == MLXMLElNames::editTag) return new XMLEditWidget(widgetTable,env,parent); if (guiType == MLXMLElNames::checkBoxTag) return new XMLCheckBoxWidget(widgetTable,env,parent); if (guiType == MLXMLElNames::absPercTag) return new XMLAbsWidget(widgetTable,env,parent); if (guiType == MLXMLElNames::vec3WidgetTag) return new XMLVec3Widget(widgetTable,env,parent); if (guiType == MLXMLElNames::colorWidgetTag) return new XMLColorWidget(widgetTable,env,parent); if (guiType == MLXMLElNames::sliderWidgetTag) return new XMLSliderWidget(widgetTable,env,parent); if (guiType == MLXMLElNames::enumWidgetTag) return new XMLEnumWidget(widgetTable,env,parent); if (guiType == MLXMLElNames::meshWidgetTag) return new XMLMeshWidget(md,widgetTable,env,parent); if (guiType == MLXMLElNames::shotWidgetTag) return new XMLShotWidget(widgetTable,env,parent); return NULL; } XMLEditWidget::XMLEditWidget(const MLXMLPluginInfo::XMLMap& xmlWidgetTag,EnvWrap& envir,QWidget* parent) :XMLMeshLabWidget(xmlWidgetTag,envir,parent) { fieldDesc = new QLabel(xmlWidgetTag[MLXMLElNames::guiLabel],this); lineEdit = new QLineEdit(this); //int row = gridLay->rowCount() -1; fieldDesc->setToolTip(xmlWidgetTag[MLXMLElNames::paramHelpTag]); lineEdit->setText(xmlWidgetTag[MLXMLElNames::paramDefExpr]); //gridLay->addWidget(fieldDesc,row,0,Qt::AlignTop); //gridLay->addWidget(lineEdit,row,1,Qt::AlignTop); connect(lineEdit,SIGNAL(editingFinished()),parent,SIGNAL(parameterChanged())); connect(lineEdit,SIGNAL(selectionChanged()),this,SLOT(tooltipEvaluation())); setVisibility(isImportant); } XMLEditWidget::~XMLEditWidget() { } void XMLEditWidget::set( const QString& nwExpStr ) { lineEdit->setText(nwExpStr); } void XMLEditWidget::updateVisibility( const bool vis ) { setVisibility(vis); } void XMLEditWidget::tooltipEvaluation() { try { QString exp = lineEdit->selectedText(); QString res = env.evalString(exp); lineEdit->setToolTip(res); } catch (MeshLabException& /*e*/) { //WARNING!!! it's needed otherwise there is a stack overflow due to the Qt selection mechanism! return; } } QString XMLEditWidget::getWidgetExpression() { return this->lineEdit->text(); } void XMLEditWidget::setVisibility( const bool vis ) { fieldDesc->setVisible(vis); this->lineEdit->setVisible(vis); } void XMLEditWidget::addWidgetToGridLayout( QGridLayout* lay,const int r ) { if (lay !=NULL) { lay->addWidget(fieldDesc,r,0); lay->addWidget(lineEdit,r,1); } XMLMeshLabWidget::addWidgetToGridLayout(lay,r); } XMLAbsWidget::XMLAbsWidget(const MLXMLPluginInfo::XMLMap& xmlWidgetTag, EnvWrap& envir,QWidget* parent ) :XMLMeshLabWidget(xmlWidgetTag,envir,parent) { m_min = env.evalFloat(xmlWidgetTag[MLXMLElNames::guiMinExpr]); m_max = env.evalFloat(xmlWidgetTag[MLXMLElNames::guiMaxExpr]); fieldDesc = new QLabel(xmlWidgetTag[MLXMLElNames::guiLabel] + " (abs and %)",this); fieldDesc->setToolTip(xmlWidgetTag[MLXMLElNames::paramHelpTag]); absSB = new QDoubleSpinBox(this); percSB = new QDoubleSpinBox(this); absSB->setMinimum(m_min-(m_max-m_min)); absSB->setMaximum(m_max*2); absSB->setAlignment(Qt::AlignRight); int decimals= 7-ceil(log10(fabs(m_max-m_min)) ) ; //qDebug("range is (%f %f) %f ",m_max,m_min,fabs(m_max-m_min)); //qDebug("log range is %f ",log10(fabs(m_max-m_min))); absSB->setDecimals(decimals); absSB->setSingleStep((m_max-m_min)/100.0); float initVal = env.evalFloat(xmlWidgetTag[MLXMLElNames::paramDefExpr]); absSB->setValue(initVal); percSB->setMinimum(-200); percSB->setMaximum(200); percSB->setAlignment(Qt::AlignRight); percSB->setSingleStep(0.5); percSB->setValue((100*(initVal - m_min))/(m_max - m_min)); percSB->setDecimals(3); absLab=new QLabel("<i> <small> world unit</small></i>",this); percLab=new QLabel("<i> <small> perc on"+QString("(%1 .. %2)").arg(m_min).arg(m_max)+"</small></i>",this); //gridLay->addWidget(fieldDesc,row,0,Qt::AlignLeft); glay = new QGridLayout(); glay->addWidget(absLab,0,0,Qt::AlignHCenter); glay->addWidget(percLab,0,1,Qt::AlignHCenter); glay->addWidget(absSB,1,0,Qt::AlignTop); glay->addWidget(percSB,1,1,Qt::AlignTop); //gridLay->addLayout(lay,row,1,1,2,Qt::AlignTop); connect(absSB,SIGNAL(valueChanged(double)),this,SLOT(on_absSB_valueChanged(double))); connect(percSB,SIGNAL(valueChanged(double)),this,SLOT(on_percSB_valueChanged(double))); connect(this,SIGNAL(dialogParamChanged()),parent,SIGNAL(parameterChanged())); setVisibility(isImportant); } XMLAbsWidget::~XMLAbsWidget() { } void XMLAbsWidget::set( const QString& nwExpStr ) { absSB->setValue(env.evalFloat(nwExpStr)); } void XMLAbsWidget::updateVisibility( const bool vis ) { setVisibility(vis); } QString XMLAbsWidget::getWidgetExpression() { return QString::number(absSB->value()); } void XMLAbsWidget::on_absSB_valueChanged(double newv) { percSB->setValue((100*(newv - m_min))/(m_max - m_min)); emit dialogParamChanged(); } void XMLAbsWidget::on_percSB_valueChanged(double newv) { absSB->setValue((m_max - m_min)*0.01*newv + m_min); emit dialogParamChanged(); } void XMLAbsWidget::setVisibility( const bool vis ) { this->absLab->setVisible(vis); this->percLab->setVisible(vis); this->fieldDesc->setVisible(vis); this->absSB->setVisible(vis); this->percSB->setVisible(vis); } void XMLAbsWidget::addWidgetToGridLayout( QGridLayout* lay,const int r ) { if (lay != NULL) { lay->addWidget(fieldDesc,r,0,Qt::AlignLeft); lay->addLayout(glay,r,1,Qt::AlignTop); } XMLMeshLabWidget::addWidgetToGridLayout(lay,r); } XMLVec3Widget::XMLVec3Widget(const MLXMLPluginInfo::XMLMap& xmlWidgetTag,EnvWrap& envir,QWidget* p) :XMLMeshLabWidget(xmlWidgetTag,envir,p) { XMLStdParFrame* par = qobject_cast<XMLStdParFrame*>(p); if (par != NULL) { curr_gla = par->curr_gla; paramName = xmlWidgetTag[MLXMLElNames::paramName]; //int row = gridLay->rowCount() - 1; descLab = new QLabel( xmlWidgetTag[MLXMLElNames::guiLabel],this); descLab->setToolTip(xmlWidgetTag[MLXMLElNames::paramHelpTag]); //gridLay->addWidget(descLab,row,0,Qt::AlignTop); hlay = new QHBoxLayout(); for(int i =0;i<3;++i) { coordSB[i]= new QLineEdit(this); QFont baseFont=coordSB[i]->font(); if(baseFont.pixelSize() != -1) baseFont.setPixelSize(baseFont.pixelSize()*3/4); else baseFont.setPointSize(baseFont.pointSize()*3/4); coordSB[i]->setFont(baseFont); //coordSB[i]->setMinimumWidth(coordSB[i]->sizeHint().width()/4); coordSB[i]->setMinimumWidth(0); coordSB[i]->setMaximumWidth(coordSB[i]->sizeHint().width()/2); //coordSB[i]->setSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Fixed); coordSB[i]->setValidator(new QDoubleValidator(this)); coordSB[i]->setAlignment(Qt::AlignRight); //this->addWidget(coordSB[i],1,Qt::AlignHCenter); coordSB[i]->setSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Preferred); hlay->addWidget(coordSB[i]); } vcg::Point3f def = envir.evalVec3(xmlWidgetTag[MLXMLElNames::paramDefExpr]); this->setPoint(paramName,def); if(curr_gla) // if we have a connection to the current glarea we can setup the additional button for getting the current view direction. { getPoint3Button = new QPushButton("Get",this); getPoint3Button->setMaximumWidth(getPoint3Button->sizeHint().width()/2); getPoint3Button->setFlat(true); getPoint3Button->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Preferred); hlay->addWidget(getPoint3Button); QStringList names; names << "View Dir"; names << "View Pos"; names << "Surf. Pos"; names << "Camera Pos"; getPoint3Combo = new QComboBox(this); getPoint3Combo->addItems(names); //getPoint3Combo->setMinimumWidth(getPoint3Combo->sizeHint().width()); //this->addWidget(getPoint3Combo,0,Qt::AlignHCenter); hlay->addWidget(getPoint3Combo); connect(getPoint3Button,SIGNAL(clicked()),this,SLOT(getPoint())); connect(getPoint3Combo,SIGNAL(currentIndexChanged(int)),this,SLOT(getPoint())); connect(curr_gla,SIGNAL(transmitViewDir(QString,vcg::Point3f)),this,SLOT(setPoint(QString,vcg::Point3f))); connect(curr_gla,SIGNAL(transmitShot(QString,vcg::Shotf)),this,SLOT(setShot(QString,vcg::Shotf))); connect(curr_gla,SIGNAL(transmitSurfacePos(QString,vcg::Point3f)),this,SLOT(setPoint(QString,vcg::Point3f))); connect(this,SIGNAL(askViewDir(QString)),curr_gla,SLOT(sendViewDir(QString))); connect(this,SIGNAL(askViewPos(QString)),curr_gla,SLOT(sendMeshShot(QString))); connect(this,SIGNAL(askSurfacePos(QString)),curr_gla,SLOT(sendSurfacePos(QString))); connect(this,SIGNAL(askCameraPos(QString)),curr_gla,SLOT(sendCameraPos(QString))); } //gridLay->addLayout(hlay,row,1,Qt::AlignTop); } setVisibility(isImportant); } void XMLVec3Widget::set( const QString& exp ) { vcg::Point3f newVal = env.evalVec3(exp); for(int ii = 0;ii < 3;++ii) coordSB[ii]->setText(QString::number(newVal[ii],'g',4)); } void XMLVec3Widget::updateVisibility( const bool vis ) { setVisibility(vis); } QString XMLVec3Widget::getWidgetExpression() { return QString("[" + coordSB[0]->text() + "," + coordSB[1]->text() + "," + coordSB[2]->text() + "]"); } //void XMLVec3Widget::setExp(const QString& name,const QString& exp ) //{ // QRegExp pointRegExp("\[\d+(\.\d)*,\d+(\.\d)*,\d+(\.\d)*\]"); // if ((name==paramName) && (pointRegExp.exactMatch(exp))) // { // for(int i =0;i<3;++i) // coordSB[i]->setText(QString::number(val[i],'g',4)); // } //} void XMLVec3Widget::getPoint() { int index = getPoint3Combo->currentIndex(); qDebug("Got signal %i",index); switch(index) { case 0 : emit askViewDir(paramName); break; case 1 : emit askViewPos(paramName); break; case 2 : emit askSurfacePos(paramName); break; case 3 : emit askCameraPos(paramName); break; default : assert(0); } } void XMLVec3Widget::setShot(const QString& name,const vcg::Shotf& shot ) { vcg::Point3f p = shot.GetViewPoint(); setPoint(name,p); } void XMLVec3Widget::setPoint( const QString& name,const vcg::Point3f& p ) { if (name == paramName) { QString exp("[" + QString::number(p[0]) + "," + QString::number(p[1]) + "," + QString::number(p[2]) + "]"); set(exp); } } XMLVec3Widget::~XMLVec3Widget() { } void XMLVec3Widget::setVisibility( const bool vis ) { for(int ii = 0;ii < 3;++ii) coordSB[ii]->setVisible(vis); getPoint3Button->setVisible(vis); getPoint3Combo->setVisible(vis); descLab->setVisible(vis); } void XMLVec3Widget::addWidgetToGridLayout( QGridLayout* lay,const int r ) { if (lay != NULL) { lay->addWidget(descLab,r,0); lay->addLayout(hlay,r,1); } XMLMeshLabWidget::addWidgetToGridLayout(lay,r); } XMLColorWidget::XMLColorWidget( const MLXMLPluginInfo::XMLMap& xmlWidgetTag,EnvWrap& envir,QWidget* p ) :XMLMeshLabWidget(xmlWidgetTag,envir,p) { colorLabel = new QLabel(this); QString paramName = xmlWidgetTag[MLXMLElNames::paramName]; descLabel = new QLabel(xmlWidgetTag[MLXMLElNames::guiLabel],this); colorButton = new QPushButton(this); colorButton->setAutoFillBackground(true); colorButton->setFlat(true); //const QColor cl = rp->pd->defVal->getColor(); //resetWidgetValue(); QColor cl = envir.evalColor(xmlWidgetTag[MLXMLElNames::paramDefExpr]); pickcol = cl; updateColorInfo(cl); //int row = gridLay->rowCount() - 1; //gridLay->addWidget(descLabel,row,0,Qt::AlignTop); hlay = new QHBoxLayout(); QFontMetrics met(colorLabel->font()); QColor black(Qt::black); QString blackname = "(" + black.name() + ")"; QSize sz = met.size(Qt::TextSingleLine,blackname); colorLabel->setMaximumWidth(sz.width()); colorLabel->setMinimumWidth(sz.width()); hlay->addWidget(colorLabel,0,Qt::AlignRight); hlay->addWidget(colorButton); //gridLay->addLayout(lay,row,1,Qt::AlignTop); connect(colorButton,SIGNAL(clicked()),this,SLOT(pickColor())); connect(this,SIGNAL(dialogParamChanged()),p,SIGNAL(parameterChanged())); setVisibility(isImportant); } XMLColorWidget::~XMLColorWidget() { } void XMLColorWidget::updateVisibility( const bool vis ) { setVisibility(vis); } void XMLColorWidget::set( const QString& nwExpStr ) { QColor col = env.evalColor(nwExpStr); updateColorInfo(col); } QString XMLColorWidget::getWidgetExpression() { return QString("[" + QString::number(pickcol.red()) + "," + QString::number(pickcol.green()) + "," + QString::number(pickcol.blue()) + "," + QString::number(pickcol.alpha()) + "]"); } void XMLColorWidget::updateColorInfo( const QColor& col ) { colorLabel->setText("("+col.name()+")"); QPalette palette(col); colorButton->setPalette(palette); } void XMLColorWidget::pickColor() { pickcol =QColorDialog::getColor(pickcol); if(pickcol.isValid()) updateColorInfo(pickcol); emit dialogParamChanged(); } void XMLColorWidget::setVisibility( const bool vis ) { colorLabel->setVisible(vis); descLabel->setVisible(vis); colorButton->setVisible(vis); } void XMLColorWidget::addWidgetToGridLayout( QGridLayout* lay,const int r ) { if (lay != NULL) { lay->addWidget(descLabel,r,0,Qt::AlignTop); lay->addLayout(hlay,r,1,Qt::AlignTop); } XMLMeshLabWidget::addWidgetToGridLayout(lay,r); } XMLSliderWidget::XMLSliderWidget( const MLXMLPluginInfo::XMLMap& xmlWidgetTag,EnvWrap& envir,QWidget* p ) :XMLMeshLabWidget(xmlWidgetTag,envir,p) { minVal = env.evalFloat(xmlWidgetTag[MLXMLElNames::guiMinExpr]); maxVal = env.evalFloat(xmlWidgetTag[MLXMLElNames::guiMaxExpr]); valueLE = new QLineEdit(this); valueLE->setAlignment(Qt::AlignRight); valueSlider = new QSlider(Qt::Horizontal,this); valueSlider->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed); fieldDesc = new QLabel(xmlWidgetTag[MLXMLElNames::guiLabel],this); valueSlider->setMinimum(0); valueSlider->setMaximum(100); float fval = env.evalFloat(xmlWidgetTag[MLXMLElNames::paramDefExpr]); valueSlider->setValue(floatToInt( fval)); valueLE->setValidator(new QDoubleValidator (minVal,maxVal, 5, valueLE)); valueLE->setText(QString::number(fval)); //int row = gridLay->rowCount() - 1; //gridLay->addWidget(fieldDesc,row,0,Qt::AlignTop); hlay = new QHBoxLayout(); hlay->addWidget(valueLE,0,Qt::AlignHCenter); //lay->addWidget(valueSlider,0,Qt::AlignJustify); hlay->addWidget(valueSlider,0,0); //gridLay->addLayout(hlay,row,1,Qt::AlignTop); connect(valueLE,SIGNAL(textChanged(const QString &)),this,SLOT(setValue())); connect(valueSlider,SIGNAL(valueChanged(int)),this,SLOT(setValue(int))); connect(this,SIGNAL(dialogParamChanged()),p,SIGNAL(parameterChanged())); setVisibility(isImportant); } XMLSliderWidget::~XMLSliderWidget() { } void XMLSliderWidget::set( const QString& nwExpStr ) { float fval = env.evalFloat(nwExpStr); valueSlider->setValue(floatToInt(fval)); } void XMLSliderWidget::updateVisibility( const bool /*vis*/ ) { setVisibility(isImportant); } QString XMLSliderWidget::getWidgetExpression() { return valueLE->text(); } void XMLSliderWidget::setValue( int newv ) { if( QString::number(intToFloat(newv)) != valueLE->text()) valueLE->setText(QString::number(intToFloat(newv))); } void XMLSliderWidget::setValue( float newValue ) { if(floatToInt(float(valueLE->text().toDouble())) != newValue) valueLE->setText(QString::number(intToFloat(newValue))); } void XMLSliderWidget::setValue() { float newValLE=float(valueLE->text().toDouble()); valueSlider->setValue(floatToInt(newValLE)); emit dialogParamChanged(); } float XMLSliderWidget::intToFloat( int val ) { return minVal+float(val)/100.0f*(maxVal-minVal); } int XMLSliderWidget::floatToInt( float val ) { return int (100.0f*(val-minVal)/(maxVal-minVal)); } void XMLSliderWidget::setVisibility( const bool vis ) { valueLE->setVisible(vis); valueSlider->setVisible(vis); fieldDesc->setVisible(vis); } void XMLSliderWidget::addWidgetToGridLayout( QGridLayout* lay,const int r ) { if (lay != NULL) { lay->addWidget(fieldDesc,r,0); lay->addLayout(hlay,r,1); } XMLMeshLabWidget::addWidgetToGridLayout(lay,r); } XMLComboWidget::XMLComboWidget( const MLXMLPluginInfo::XMLMap& xmlWidgetTag,EnvWrap& envir,QWidget* p ) :XMLMeshLabWidget(xmlWidgetTag,envir,p) { enumLabel = new QLabel(this); enumLabel->setText(xmlWidgetTag[MLXMLElNames::guiLabel]); enumCombo = new QComboBox(this); int def; try { def = envir.evalInt(xmlWidgetTag[MLXMLElNames::paramDefExpr]); } catch (ExpressionHasNotThisTypeException& ex) { def = 0; } enumCombo->setCurrentIndex(def); //int row = gridLay->rowCount() - 1; //gridLay->addWidget(enumLabel,row,0,Qt::AlignTop); //gridLay->addWidget(enumCombo,row,1,Qt::AlignTop); connect(enumCombo,SIGNAL(activated(int)),this,SIGNAL(dialogParamChanged())); connect(this,SIGNAL(dialogParamChanged()),p,SIGNAL(parameterChanged())); setVisibility(isImportant); } void XMLComboWidget::setVisibility( const bool vis ) { enumLabel->setVisible(vis); enumCombo->setVisible(vis); } void XMLComboWidget::updateVisibility( const bool vis ) { setVisibility(vis); } QString XMLComboWidget::getWidgetExpression() { return enumCombo->currentText(); } XMLComboWidget::~XMLComboWidget() { } void XMLComboWidget::addWidgetToGridLayout( QGridLayout* lay,const int r ) { if (lay != NULL) { lay->addWidget(enumLabel,r,0); lay->addWidget(enumCombo,r,1); } XMLMeshLabWidget::addWidgetToGridLayout(lay,r); } XMLEnumWidget::XMLEnumWidget( const MLXMLPluginInfo::XMLMap& xmlWidgetTag,EnvWrap& envir,QWidget* p ) :XMLComboWidget(xmlWidgetTag,envir,p) { QString typ = xmlWidgetTag[MLXMLElNames::paramType]; QMap<int,QString> mp; bool rr = MLXMLUtilityFunctions::getEnumNamesValuesFromString(typ,mp); if (rr) { for(QMap<int,QString>::iterator it = mp.begin();it != mp.end();++it) enumCombo->addItem(it.value(),QVariant(it.key())); enumCombo->setCurrentIndex(env.evalInt(xmlWidgetTag[MLXMLElNames::paramDefExpr])); } } QString XMLEnumWidget::getWidgetExpression() { return enumCombo->itemData(enumCombo->currentIndex()).toString(); } XMLMeshWidget::XMLMeshWidget( MeshDocument* mdoc,const MLXMLPluginInfo::XMLMap& xmlWidgetTag,EnvWrap& envir,QWidget* p ) :XMLEnumWidget(xmlWidgetTag,envir,p) { foreach(MeshModel* mm,mdoc->meshList) enumCombo->addItem(mm->shortName(),mm->id()); int def = env.evalInt(xmlWidgetTag[MLXMLElNames::paramDefExpr]); if (mdoc->getMesh(def)) enumCombo->setCurrentIndex(def); } XMLShotWidget::XMLShotWidget( const MLXMLPluginInfo::XMLMap& xmlWidgetTag,EnvWrap& envir,QWidget* p ) :XMLMeshLabWidget(xmlWidgetTag,envir,p) { XMLStdParFrame* par = qobject_cast<XMLStdParFrame*>(p); if (par == NULL) throw MeshLabException("Critical Error: A widget must have an instance of XMLStdParFrame as parent."); gla_curr = par->curr_gla; //int row = gridLay->rowCount() - 1; this->setShotValue(paramName,vcg::Shotf()); paramName = xmlWidgetTag[MLXMLElNames::paramName]; descLab = new QLabel(xmlWidgetTag[MLXMLElNames::guiLabel],this); //gridLay->addWidget(descLab,row,0,Qt::AlignTop); hlay = new QHBoxLayout(); getShotButton = new QPushButton("Get Shot",this); getShotButton->setSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Preferred); getShotCombo = new QComboBox(this); int def; try { def = envir.evalInt(xmlWidgetTag[MLXMLElNames::paramDefExpr]); } catch (ExpressionHasNotThisTypeException& ex) { def = 0; } getShotCombo->setCurrentIndex(def); //int row = gridLay->rowCount() - 1; QStringList names; if(gla_curr) // if we have a connection to the current glarea we can setup the additional button for getting the current view direction. { names << "Current Trackball"; names << "Current Mesh"; names << "Current Raster"; connect(gla_curr,SIGNAL(transmitShot(QString,vcg::Shotf)),this,SLOT(setShotValue(QString,vcg::Shotf))); connect(this,SIGNAL(askViewerShot(QString)),gla_curr,SLOT(sendViewerShot(QString))); connect(this,SIGNAL(askMeshShot(QString)), gla_curr,SLOT(sendMeshShot(QString))); connect(this,SIGNAL(askRasterShot(QString)),gla_curr,SLOT(sendRasterShot(QString))); } names << "From File"; getShotCombo->addItems(names); hlay->addWidget(getShotCombo); hlay->addWidget(getShotButton); connect(getShotCombo,SIGNAL(activated(int)),this,SIGNAL(dialogParamChanged())); connect(this,SIGNAL(dialogParamChanged()),p,SIGNAL(parameterChanged())); connect(getShotCombo,SIGNAL(currentIndexChanged(int)),this,SLOT(getShot())); connect(getShotButton,SIGNAL(clicked()),this,SLOT(getShot())); //gridLay->addLayout(hlay,row,1,Qt::AlignTop); setVisibility(isImportant); } QString XMLShotWidget::getWidgetExpression() { vcg::Matrix44f m = curShot.Extrinsics.Rot(); vcg::Point3f t = curShot.Extrinsics.Tra(); float foc = curShot.Intrinsics.FocalMm; vcg::Point2f pxs = curShot.Intrinsics.PixelSizeMm; vcg::Point2f cp = curShot.Intrinsics.CenterPx; vcg::Point2i vw = curShot.Intrinsics.ViewportPx; vcg::Point2f dist = curShot.Intrinsics.DistorCenterPx; float* k = curShot.Intrinsics.k; QString ms = "new " + MLXMLElNames::shotType + "(["; for(int ii = 0;ii < 4;++ii) for(int jj = 0;jj < 4;++jj) ms = ms + QString::number(m[ii][jj]) + ","; ms += "],["; for(int ii = 0;ii < 3;++ii) ms = ms + QString::number(t[ii]) + ","; ms += "]," + QString::number(foc) + ",["; for(int ii = 0;ii < 2;++ii) ms = ms + QString::number(pxs[ii]) + ","; ms += "],["; for(int ii = 0;ii < 2;++ii) ms = ms + QString::number(cp[ii]) + ","; ms += "],["; for(int ii = 0;ii < 2;++ii) ms = ms + QString::number(vw[ii]) + ","; ms += "],["; for(int ii = 0;ii < 2;++ii) ms = ms + QString::number(dist[ii]) + ","; ms += "],["; for(int ii = 0;ii < 4;++ii) ms = ms + QString::number(k[ii]) + ","; ms += "])"; //no ; it will be added by the addExpressionBinding return ms; } void XMLShotWidget::getShot() { int index = getShotCombo->currentIndex(); switch(index) { case 0 : emit askViewerShot(paramName); break; case 1 : emit askMeshShot(paramName); break; case 2 : emit askRasterShot(paramName); break; case 3: { QString filename = QFileDialog::getOpenFileName(this, tr("Load xml camera"), "./", tr("Xml Files (*.xml)")); QFile qf(filename); QFileInfo qfInfo(filename); if( !qf.open(QIODevice::ReadOnly ) ) return ; QDomDocument doc("XmlDocument"); //It represents the XML document if(!doc.setContent( &qf )) return; qf.close(); QString type = doc.doctype().name(); //TextAlign file project //if(type == "RegProjectML") loadShotFromTextAlignFile(doc); //View State file //else if(type == "ViewState") loadViewFromViewStateFile(doc); //qDebug("End file reading"); // return true; } default : assert(0); } } void XMLShotWidget::setShotValue(QString name,vcg::Shotf newVal) { if(name==paramName) { curShot=newVal; } } void XMLShotWidget::updateVisibility( const bool vis ) { setVisibility(vis); } void XMLShotWidget::setVisibility( const bool vis ) { descLab->setVisible(vis); getShotCombo->setVisible(vis); getShotButton->setVisible(vis); } void XMLShotWidget::addWidgetToGridLayout( QGridLayout* lay,const int r ) { if (lay != NULL) { lay->addWidget(descLab,r,0); lay->addLayout(hlay,r,1); } XMLMeshLabWidget::addWidgetToGridLayout(lay,r); }
{ "content_hash": "4a2e8967fe561e8e42226ea3b5e3a079", "timestamp": "", "source": "github", "line_count": 1327, "max_line_length": 246, "avg_line_length": 33.220798794272795, "alnum_prop": 0.6499183377189003, "repo_name": "hlzz/dotfiles", "id": "d8f089102258fa72625c03e6b4c0f7a91b461ced", "size": "44084", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "graphics/meshlab/src/meshlab/xmlstdpardialog.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "AppleScript", "bytes": "1240" }, { "name": "Arc", "bytes": "38" }, { "name": "Assembly", "bytes": "449468" }, { "name": "Batchfile", "bytes": "16152" }, { "name": "C", "bytes": "102303195" }, { "name": "C++", "bytes": "155056606" }, { "name": "CMake", "bytes": "7200627" }, { "name": "CSS", "bytes": "179330" }, { "name": "Cuda", "bytes": "30026" }, { "name": "D", "bytes": "2152" }, { "name": "Emacs Lisp", "bytes": "14892" }, { "name": "FORTRAN", "bytes": "5276" }, { "name": "Forth", "bytes": "3637" }, { "name": "GAP", "bytes": "14495" }, { "name": "GLSL", "bytes": "438205" }, { "name": "Gnuplot", "bytes": "327" }, { "name": "Groff", "bytes": "518260" }, { "name": "HLSL", "bytes": "965" }, { "name": "HTML", "bytes": "2003175" }, { "name": "Haskell", "bytes": "10370" }, { "name": "IDL", "bytes": "2466" }, { "name": "Java", "bytes": "219109" }, { "name": "JavaScript", "bytes": "1618007" }, { "name": "Lex", "bytes": "119058" }, { "name": "Lua", "bytes": "23167" }, { "name": "M", "bytes": "1080" }, { "name": "M4", "bytes": "292475" }, { "name": "Makefile", "bytes": "7112810" }, { "name": "Matlab", "bytes": "1582" }, { "name": "NSIS", "bytes": "34176" }, { "name": "Objective-C", "bytes": "65312" }, { "name": "Objective-C++", "bytes": "269995" }, { "name": "PAWN", "bytes": "4107117" }, { "name": "PHP", "bytes": "2690" }, { "name": "Pascal", "bytes": "5054" }, { "name": "Perl", "bytes": "485508" }, { "name": "Pike", "bytes": "1338" }, { "name": "Prolog", "bytes": "5284" }, { "name": "Python", "bytes": "16799659" }, { "name": "QMake", "bytes": "89858" }, { "name": "Rebol", "bytes": "291" }, { "name": "Ruby", "bytes": "21590" }, { "name": "Scilab", "bytes": "120244" }, { "name": "Shell", "bytes": "2266191" }, { "name": "Slash", "bytes": "1536" }, { "name": "Smarty", "bytes": "1368" }, { "name": "Swift", "bytes": "331" }, { "name": "Tcl", "bytes": "1911873" }, { "name": "TeX", "bytes": "11981" }, { "name": "Verilog", "bytes": "3893" }, { "name": "VimL", "bytes": "595114" }, { "name": "XSLT", "bytes": "62675" }, { "name": "Yacc", "bytes": "307000" }, { "name": "eC", "bytes": "366863" } ], "symlink_target": "" }
from django.test import TestCase from rockit.core import holders from rockit.core import tasks class TaskSettingsTestCase(TestCase): def test_it_should_be_able_to_call_task(self): holder = holders.SettingsHolder() holder = tasks.settings(holder) self.assertEqual(0, len(holder.get_content()))
{ "content_hash": "dd3ea502184be1019b091209539805a1", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 54, "avg_line_length": 27, "alnum_prop": 0.7253086419753086, "repo_name": "acreations/rockit-server", "id": "c4dd6c102dcfd1f6319939b69f7d5c31cd22726b", "size": "324", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "rockit/core/tests/test_task_settings.py", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "1920" }, { "name": "CSS", "bytes": "4090" }, { "name": "HTML", "bytes": "24419" }, { "name": "JavaScript", "bytes": "35318" }, { "name": "Python", "bytes": "134803" }, { "name": "Shell", "bytes": "553" } ], "symlink_target": "" }
require("babel-core/register"); //http://babeljs.io/docs/usage/require/ to run with es6 transpiling require("./src/app");
{ "content_hash": "7a679460f3df12406c777442928aaa4c", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 99, "avg_line_length": 61, "alnum_prop": 0.7295081967213115, "repo_name": "broline/redux-todo", "id": "441bfb314b71d89c7b71d0bf1b177ad9837a8bb0", "size": "122", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "index.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "6467" } ], "symlink_target": "" }
#ifndef _MLX4_STATS_ #define _MLX4_STATS_ #ifdef MLX4_EN_PERF_STAT #define NUM_PERF_STATS NUM_PERF_COUNTERS #else #define NUM_PERF_STATS 0 #endif #define NUM_PRIORITIES 9 #define NUM_PRIORITY_STATS 2 struct mlx4_en_pkt_stats { unsigned long rx_packets; unsigned long rx_bytes; unsigned long rx_multicast_packets; unsigned long rx_broadcast_packets; unsigned long rx_errors; unsigned long rx_dropped; unsigned long rx_length_errors; unsigned long rx_over_errors; unsigned long rx_crc_errors; unsigned long rx_jabbers; unsigned long rx_in_range_length_error; unsigned long rx_out_range_length_error; unsigned long rx_lt_64_bytes_packets; unsigned long rx_127_bytes_packets; unsigned long rx_255_bytes_packets; unsigned long rx_511_bytes_packets; unsigned long rx_1023_bytes_packets; unsigned long rx_1518_bytes_packets; unsigned long rx_1522_bytes_packets; unsigned long rx_1548_bytes_packets; unsigned long rx_gt_1548_bytes_packets; unsigned long tx_packets; unsigned long tx_bytes; unsigned long tx_multicast_packets; unsigned long tx_broadcast_packets; unsigned long tx_errors; unsigned long tx_dropped; unsigned long tx_lt_64_bytes_packets; unsigned long tx_127_bytes_packets; unsigned long tx_255_bytes_packets; unsigned long tx_511_bytes_packets; unsigned long tx_1023_bytes_packets; unsigned long tx_1518_bytes_packets; unsigned long tx_1522_bytes_packets; unsigned long tx_1548_bytes_packets; unsigned long tx_gt_1548_bytes_packets; unsigned long rx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS]; unsigned long tx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS]; #define NUM_PKT_STATS 72 }; struct mlx4_en_vf_stats { unsigned long rx_packets; unsigned long rx_bytes; unsigned long rx_multicast_packets; unsigned long rx_broadcast_packets; unsigned long rx_errors; unsigned long rx_dropped; unsigned long tx_packets; unsigned long tx_bytes; unsigned long tx_multicast_packets; unsigned long tx_broadcast_packets; unsigned long tx_errors; #define NUM_VF_STATS 11 }; struct mlx4_en_vport_stats { unsigned long rx_unicast_packets; unsigned long rx_unicast_bytes; unsigned long rx_multicast_packets; unsigned long rx_multicast_bytes; unsigned long rx_broadcast_packets; unsigned long rx_broadcast_bytes; unsigned long rx_dropped; unsigned long rx_errors; unsigned long tx_unicast_packets; unsigned long tx_unicast_bytes; unsigned long tx_multicast_packets; unsigned long tx_multicast_bytes; unsigned long tx_broadcast_packets; unsigned long tx_broadcast_bytes; unsigned long tx_errors; #define NUM_VPORT_STATS 15 }; struct mlx4_en_port_stats { unsigned long tso_packets; unsigned long queue_stopped; unsigned long wake_queue; unsigned long tx_timeout; unsigned long rx_alloc_failed; unsigned long rx_chksum_good; unsigned long rx_chksum_none; unsigned long tx_chksum_offload; #define NUM_PORT_STATS 8 }; struct mlx4_en_perf_stats { u32 tx_poll; u64 tx_pktsz_avg; u32 inflight_avg; u16 tx_coal_avg; u16 rx_coal_avg; u32 napi_quota; #define NUM_PERF_COUNTERS 6 }; struct mlx4_en_flow_stats { u64 rx_pause; u64 rx_pause_duration; u64 rx_pause_transition; u64 tx_pause; u64 tx_pause_duration; u64 tx_pause_transition; }; #define MLX4_NUM_PRIORITIES 8 #define NUM_FLOW_PRIORITY_STATS 6 #define NUM_FLOW_STATS (NUM_FLOW_PRIORITY_STATS*MLX4_NUM_PRIORITIES) struct mlx4_en_stat_out_flow_control_mbox { /* Total number of PAUSE frames received from the far-end port */ __be64 rx_pause; /* Total number of microseconds that far-end port requested to pause * transmission of packets */ __be64 rx_pause_duration; /* Number of received transmission from XOFF state to XON state */ __be64 rx_pause_transition; /* Total number of PAUSE frames sent from the far-end port */ __be64 tx_pause; /* Total time in microseconds that transmission of packets has been * paused */ __be64 tx_pause_duration; /* Number of transmitter transitions from XOFF state to XON state */ __be64 tx_pause_transition; /* Reserverd */ __be64 reserved[2]; }; int mlx4_get_vport_ethtool_stats(struct mlx4_dev *dev, int port, struct mlx4_en_vport_stats *vport_stats, int reset); #define NUM_ALL_STATS (NUM_PKT_STATS + NUM_FLOW_STATS + NUM_VPORT_STATS + \ NUM_VF_STATS + NUM_PORT_STATS + NUM_PERF_STATS) #endif
{ "content_hash": "436e106cd54a0060fe69c9fcfe37d84e", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 75, "avg_line_length": 28.181818181818183, "alnum_prop": 0.7483870967741936, "repo_name": "jrobhoward/SCADAbase", "id": "0270cefd0ec4f6be055d23498170c510776ccb24", "size": "5777", "binary": false, "copies": "1", "ref": "refs/heads/SCADAbase", "path": "sys/ofed/drivers/net/mlx4/mlx4_stats.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "AGS Script", "bytes": "62471" }, { "name": "Assembly", "bytes": "4615704" }, { "name": "Awk", "bytes": "273794" }, { "name": "Batchfile", "bytes": "20333" }, { "name": "C", "bytes": "457666547" }, { "name": "C++", "bytes": "91495356" }, { "name": "CMake", "bytes": "17632" }, { "name": "CSS", "bytes": "104220" }, { "name": "ChucK", "bytes": "39" }, { "name": "D", "bytes": "6321" }, { "name": "DIGITAL Command Language", "bytes": "10638" }, { "name": "DTrace", "bytes": "1904158" }, { "name": "Emacs Lisp", "bytes": "32010" }, { "name": "EmberScript", "bytes": "286" }, { "name": "Forth", "bytes": "204603" }, { "name": "GAP", "bytes": "72078" }, { "name": "Groff", "bytes": "32376243" }, { "name": "HTML", "bytes": "5776268" }, { "name": "Haskell", "bytes": "2458" }, { "name": "IGOR Pro", "bytes": "6510" }, { "name": "Java", "bytes": "112547" }, { "name": "KRL", "bytes": "4950" }, { "name": "Lex", "bytes": "425858" }, { "name": "Limbo", "bytes": "4037" }, { "name": "Logos", "bytes": "179088" }, { "name": "Makefile", "bytes": "12750766" }, { "name": "Mathematica", "bytes": "21782" }, { "name": "Max", "bytes": "4105" }, { "name": "Module Management System", "bytes": "816" }, { "name": "Objective-C", "bytes": "1571960" }, { "name": "PHP", "bytes": "2471" }, { "name": "PLSQL", "bytes": "96552" }, { "name": "PLpgSQL", "bytes": "2212" }, { "name": "Perl", "bytes": "3947402" }, { "name": "Perl6", "bytes": "122803" }, { "name": "PostScript", "bytes": "152255" }, { "name": "Prolog", "bytes": "42792" }, { "name": "Protocol Buffer", "bytes": "54964" }, { "name": "Python", "bytes": "381066" }, { "name": "R", "bytes": "764" }, { "name": "Rebol", "bytes": "738" }, { "name": "Ruby", "bytes": "67015" }, { "name": "Scheme", "bytes": "5087" }, { "name": "Scilab", "bytes": "196" }, { "name": "Shell", "bytes": "10963470" }, { "name": "SourcePawn", "bytes": "2293" }, { "name": "SuperCollider", "bytes": "80208" }, { "name": "Tcl", "bytes": "7102" }, { "name": "TeX", "bytes": "720582" }, { "name": "VimL", "bytes": "19597" }, { "name": "XS", "bytes": "17496" }, { "name": "XSLT", "bytes": "4564" }, { "name": "Yacc", "bytes": "1881915" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <!-- The MIT License (MIT) Copyright (c) 2014 Paul Adams (adamspe@notiosoftware.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --> <features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${project.version}"> <!-- other repositories can be imported and then the features they expose referenced. No external features are referenced here so just including a few commented out repositories for illustration purposes. --> <!-- repository>mvn:org.apache.karaf.features/standard/${karaf.version}/xml/features</repository> <repository>mvn:org.apache.karaf.features/enterprise/${karaf.version}/xml/features</repository--> <feature name="notio-karaf-fse-api"> <details>FullStack Example API</details> <bundle>mvn:${project.groupId}/api/${project.version}</bundle> </feature> </features>
{ "content_hash": "f2102ba7e9e3f97bfd581a41b48c84d6", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 119, "avg_line_length": 54.97142857142857, "alnum_prop": 0.747920997920998, "repo_name": "adamspe/Karaf-FullStack-Example", "id": "21bc07fefa975f618009db8d0db87dae787497f2", "size": "1924", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/resources/features.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "4835" } ], "symlink_target": "" }
#pragma once #if defined WIN32 || defined WIN64 || defined _XBOX # if defined WIN32 || defined WIN64 # define WIN32_LEAN_AND_MEAN # include <windows.h> # elif defined _XBOX # include <xtl.h> # endif namespace sys { typedef LONGLONG hptimer_t; extern hptimer_t g_Start, g_Freq; //hptimer_t g_Start, g_Freq; inline hptimer_t queryPerformanceFrequency () { LARGE_INTEGER tmp; QueryPerformanceFrequency(&tmp); hptimer_t const res = tmp.QuadPart; return res; } inline hptimer_t queryPerformanceCounter () { LARGE_INTEGER tmp; QueryPerformanceCounter(&tmp); hptimer_t const res = tmp.QuadPart; return res; } inline void setTimeStart () { if (g_Start == 0) { g_Freq = queryPerformanceFrequency(); g_Start = queryPerformanceCounter(); } } inline hptimer_t queryTime () { return queryPerformanceCounter() - g_Start; } inline hptimer_t queryTime_ms () { return 1000 * (queryPerformanceCounter() - g_Start) / g_Freq; } // @TODO: get rid of div inline hptimer_t queryTime_us () { return 1000000 * (queryPerformanceCounter() - g_Start) / g_Freq; } inline double toSeconds (hptimer_t t) { return static_cast<double>(t) / g_Freq; } } #else # include <sys/time.h> # include <stdint.h> # include <stdbool.h> # include <stddef.h> namespace sys { static const unsigned usec_per_sec = 1000000; static const unsigned usec_per_msec = 1000; typedef int64_t hptimer_t; extern hptimer_t g_Start, g_Freq; inline hptimer_t queryPerformanceFrequency () { return usec_per_sec; /* gettimeofday reports to microsecond accuracy. */ } inline hptimer_t queryPerformanceCounter () { struct timeval time; gettimeofday(&time, NULL); hptimer_t performance_count = time.tv_usec + time.tv_sec * usec_per_sec; /* Seconds. */ return performance_count; } inline void setTimeStart () { if (g_Start == 0) { g_Freq = queryPerformanceFrequency(); g_Start = queryPerformanceCounter(); } } inline hptimer_t queryTime () { return queryPerformanceCounter() - g_Start; } inline hptimer_t queryTime_us () { return queryTime(); } inline hptimer_t queryTime_ms () { return queryTime_us() / 1000; } inline double toSeconds (hptimer_t t) { return static_cast<double>(t) / g_Freq; } } #endif namespace sys { struct Timer { hptimer_t m_expire_at; Timer () : m_expire_at(0) { } void set_delay_ms (unsigned delay_ms) { m_expire_at = queryTime_ms() + delay_ms; } void reset () { m_expire_at = 0; } bool enabled () const { return m_expire_at != 0; } bool expired () const { return queryTime_ms() > m_expire_at; } }; }
{ "content_hash": "a2ae02f80f601fef4d6ffd821a2b2928", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 125, "avg_line_length": 24.933962264150942, "alnum_prop": 0.6643965191070753, "repo_name": "mojmir-svoboda/DbgToolkit", "id": "d12f45133809f1372cf6038fcaaf4a0c4538cbe2", "size": "2643", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "include/sysfn/time_query.h", "mode": "33188", "license": "mit", "language": [ { "name": "Awk", "bytes": "3960" }, { "name": "Batchfile", "bytes": "2926" }, { "name": "C", "bytes": "3527150" }, { "name": "C++", "bytes": "8094856" }, { "name": "CMake", "bytes": "240374" }, { "name": "HTML", "bytes": "330871" }, { "name": "M4", "bytes": "9332" }, { "name": "Makefile", "bytes": "221500" }, { "name": "PAWN", "bytes": "673" }, { "name": "Perl", "bytes": "36555" }, { "name": "Python", "bytes": "1459" }, { "name": "QMake", "bytes": "9561" }, { "name": "Scheme", "bytes": "6418020" }, { "name": "Shell", "bytes": "1747" }, { "name": "TeX", "bytes": "1961" }, { "name": "XSLT", "bytes": "77656" } ], "symlink_target": "" }
using namespace gl; using namespace rx; using testing::_; using testing::NiceMock; using testing::Return; namespace { class MockFactory : public NullFactory { public: MOCK_METHOD1(createFramebuffer, FramebufferImpl *(const gl::Framebuffer::Data &)); MOCK_METHOD1(createProgram, ProgramImpl *(const gl::Program::Data &)); MOCK_METHOD1(createVertexArray, VertexArrayImpl *(const gl::VertexArray::Data &)); }; class MockValidationContext : public ValidationContext { public: MockValidationContext(GLint clientVersion, const State &state, const Caps &caps, const TextureCapsMap &textureCaps, const Extensions &extensions, const ResourceManager *resourceManager, const Limitations &limitations, bool skipValidation); MOCK_METHOD1(recordError, void(const Error &)); }; MockValidationContext::MockValidationContext(GLint clientVersion, const State &state, const Caps &caps, const TextureCapsMap &textureCaps, const Extensions &extensions, const ResourceManager *resourceManager, const Limitations &limitations, bool skipValidation) : ValidationContext(clientVersion, state, caps, textureCaps, extensions, resourceManager, limitations, skipValidation) { } // Test that ANGLE generates an INVALID_OPERATION when validating index data that uses a value // larger than MAX_ELEMENT_INDEX. Not specified in the GLES 3 spec, it's undefined behaviour, // but we want a test to ensure we maintain this behaviour. TEST(ValidationESTest, DrawElementsWithMaxIndexGivesError) { auto framebufferImpl = MakeFramebufferMock(); auto programImpl = MakeProgramMock(); // TODO(jmadill): Generalize some of this code so we can re-use it for other tests. NiceMock<MockFactory> mockFactory; EXPECT_CALL(mockFactory, createFramebuffer(_)).WillOnce(Return(framebufferImpl)); EXPECT_CALL(mockFactory, createProgram(_)).WillOnce(Return(programImpl)); EXPECT_CALL(mockFactory, createVertexArray(_)).WillOnce(Return(nullptr)); State state; Caps caps; TextureCapsMap textureCaps; Extensions extensions; Limitations limitations; // Set some basic caps. caps.maxElementIndex = 100; caps.maxDrawBuffers = 1; caps.maxColorAttachments = 1; state.initialize(caps, extensions, 3, false); NiceMock<MockTextureImpl> *textureImpl = new NiceMock<MockTextureImpl>(); EXPECT_CALL(*textureImpl, setStorage(_, _, _, _)).WillOnce(Return(Error(GL_NO_ERROR))); EXPECT_CALL(*textureImpl, destructor()).Times(1).RetiresOnSaturation(); Texture *texture = new Texture(textureImpl, 0, GL_TEXTURE_2D); texture->addRef(); texture->setStorage(GL_TEXTURE_2D, 1, GL_RGBA8, Extents(1, 1, 0)); VertexArray *vertexArray = new VertexArray(&mockFactory, 0, 1); Framebuffer *framebuffer = new Framebuffer(caps, &mockFactory, 1); framebuffer->setAttachment(GL_FRAMEBUFFER_DEFAULT, GL_BACK, ImageIndex::Make2D(0), texture); Program *program = new Program(&mockFactory, nullptr, 1); state.setVertexArrayBinding(vertexArray); state.setDrawFramebufferBinding(framebuffer); state.setProgram(program); NiceMock<MockValidationContext> testContext(3, state, caps, textureCaps, extensions, nullptr, limitations, false); // Set the expectation for the validation error here. Error expectedError(GL_INVALID_OPERATION, g_ExceedsMaxElementErrorMessage); EXPECT_CALL(testContext, recordError(expectedError)).Times(1); // Call once with maximum index, and once with an excessive index. GLuint indexData[] = {0, 1, static_cast<GLuint>(caps.maxElementIndex - 1), 3, 4, static_cast<GLuint>(caps.maxElementIndex)}; IndexRange indexRange; EXPECT_TRUE(ValidateDrawElements(&testContext, GL_TRIANGLES, 3, GL_UNSIGNED_INT, indexData, 1, &indexRange)); EXPECT_FALSE(ValidateDrawElements(&testContext, GL_TRIANGLES, 6, GL_UNSIGNED_INT, indexData, 2, &indexRange)); texture->release(); state.setVertexArrayBinding(nullptr); state.setDrawFramebufferBinding(nullptr); state.setProgram(nullptr); SafeDelete(vertexArray); SafeDelete(framebuffer); SafeDelete(program); } } // anonymous namespace
{ "content_hash": "781712c97d64a50a8998f42773e0184e", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 99, "avg_line_length": 40.27642276422764, "alnum_prop": 0.6241421073879693, "repo_name": "mikolalysenko/angle", "id": "ef049f99c263499f872ec2dbb5adecef260b3912", "size": "5518", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/libANGLE/validationES_unittest.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "10208" }, { "name": "C", "bytes": "906324" }, { "name": "C++", "bytes": "8818132" }, { "name": "Lex", "bytes": "26529" }, { "name": "Objective-C", "bytes": "26330" }, { "name": "Objective-C++", "bytes": "45015" }, { "name": "PostScript", "bytes": "989" }, { "name": "Python", "bytes": "90752" }, { "name": "Shell", "bytes": "1426" }, { "name": "Yacc", "bytes": "62180" } ], "symlink_target": "" }
@implementation DidJiexiaoViewCell - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { [self createUI]; } return self; } - (void)createUI{ // self.layer.borderWidth = 0.5; // self.layer.borderColor = [[UIColor grayColor] CGColor]; _imgProduct = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 80, 80)]; // _imgProduct.image = [UIImage imageNamed:@"noimage"]; // _imgProduct.layer.borderWidth = 0.5; // _imgProduct.layer.borderColor = [[UIColor grayColor] CGColor]; // _imgProduct.layer.cornerRadius = 10; _imgProduct.contentMode = UIViewContentModeScaleAspectFit; [self addSubview:_imgProduct]; _imgHead = [[UIImageView alloc] initWithFrame:CGRectMake(IPhone4_5_6_6P(MSW-40, MSW-40, MSW-50, MSW-50), 60, IPhone4_5_6_6P(30, 30, 40, 40), IPhone4_5_6_6P(30, 30, 40, 40))]; _imgHead.backgroundColor=[UIColor clearColor]; _imgHead.layer.cornerRadius = IPhone4_5_6_6P(15, 15, 20, 20); _imgHead.layer.masksToBounds = YES; [self addSubview:_imgHead]; _bthead = [[UIButton alloc] initWithFrame:CGRectMake(IPhone4_5_6_6P(MSW-40, MSW-40, MSW-50, MSW-50), 60, IPhone4_5_6_6P(30, 30, 40, 40), IPhone4_5_6_6P(30, 30, 40, 40))]; [self addSubview:_bthead]; _lblTitle = [[UILabel alloc] initWithFrame:CGRectMake(100, 10,[UIScreen mainScreen].bounds.size.width-110, 30)]; _lblTitle.font = [UIFont systemFontOfSize:12]; _lblTitle.textColor = [UIColor blackColor]; _lblTitle.numberOfLines = 2; _lblTitle.text=@"sdrftgyhjkl"; _lblTitle.lineBreakMode = NSLineBreakByTruncatingTail; [self addSubview:_lblTitle]; UILabel* lblName1 = [[UILabel alloc] initWithFrame:CGRectMake(100, 30+15+12, 45, 15)]; lblName1.text = @"获得者:"; lblName1.textColor = [UIColor lightGrayColor]; lblName1.font = [UIFont systemFontOfSize:12]; [self addSubview:lblName1]; _lblName = [[UILabel alloc] initWithFrame:CGRectMake(143, 30+15+12, MSW - 200, 15)]; _lblName.textColor = [UIColor colorWithRed:97/255.0 green:186/255.0 blue:255/255.0 alpha:1]; _lblName.font = [UIFont systemFontOfSize:12]; _lblName.text=@"王尼玛"; [self addSubview:_lblName]; UILabel* lblCode1 = [[UILabel alloc] initWithFrame:CGRectMake(100, 50+15+10, 100, 15)]; lblCode1.text = @"本期参与: "; lblCode1.textColor = [UIColor lightGrayColor]; lblCode1.font = [UIFont systemFontOfSize:12]; [self addSubview:lblCode1]; _lblCode = [[UILabel alloc] initWithFrame:CGRectMake(155, 50+15+10, MSW - 200, 15)]; _lblCode.textColor = MainColor; _lblCode.text = [NSString stringWithFormat:@"33 人次"]; _lblCode.font = [UIFont systemFontOfSize:12]; [self addSubview:_lblCode]; _lblPrice = [[UILabel alloc] initWithFrame:CGRectMake(100, 25+10+5, MSW - 200, 15)]; _lblPrice.textColor = [UIColor lightGrayColor]; _lblPrice.text = [NSString stringWithFormat:@"价值:¥111"]; _lblPrice.font = [UIFont systemFontOfSize:12]; [self addSubview:_lblPrice]; _lblTime = [[UILabel alloc] initWithFrame:CGRectMake(100, 65+15+10, IPhone4_5_6_6P(MSW - 120, MSW - 120, MSW - 100, MSW - 100), 15)]; _lblTime.text = [NSString stringWithFormat:@"揭晓时间:2896677"]; _lblTime.textColor = [UIColor lightGrayColor]; _lblTime.font = [UIFont systemFontOfSize:12]; _lblTime.numberOfLines = 0; _lblTime.adjustsFontSizeToFitWidth = YES; [self addSubview:_lblTime]; _imgxiangou=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 42, 42)]; _imgxiangou.backgroundColor=[UIColor clearColor]; _imgxiangou.image=[UIImage imageNamed:@"label_03"]; [self addSubview:_imgxiangou]; UILabel * lineLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 109+3+0.5, MSW, 0.5)]; lineLabel.backgroundColor = [UIColor lightGrayColor]; [self.contentView addSubview:lineLabel]; } - (void)setLatestModel:(LatestAnnouncedModel *)latestModel { _latestModel = latestModel; #warning 提示通知 [[NSNotificationCenter defaultCenter] postNotificationName:@"DidJiexiaoViewCellJieXiao" object:nil]; NSDictionary* style1 = @{@"body" : @[ [UIColor grayColor]], @"u": @[MainColor, ]}; [self.imgProduct sd_setImageWithURL:[NSURL URLWithString:latestModel.thumb] placeholderImage:[UIImage imageNamed:DefaultImage]]; [self.imgHead sd_setImageWithURL:[NSURL URLWithString:latestModel.img] placeholderImage:[UIImage imageNamed:DefaultImage]]; _lblTitle.text=_latestModel.title; _lblPrice.text=[NSString stringWithFormat:@"价值:¥%@",_latestModel.canyurenshu]; _lblName.text = _latestModel.username; // NSString * string = [NSString stringWithFormat:@"获得者:%@",_latestModel.username]; // NSMutableAttributedString * string1 = [[NSMutableAttributedString alloc]initWithString:string]; // NSString * string2 = _latestModel.username; // [string1 addAttribute:NSForegroundColorAttributeName // // value:[UIColor colorWithRed:106.0/255.0 green:192.0/255.0 blue:255.0/255.0 alpha:1] // // range:NSMakeRange(4, string2.length)]; //// _lblName.text=[NSString stringWithFormat:@"获得者:%@",_latestModel.username]; // _lblTime.attributedText = string1; NSString *str=_latestModel.jiexiao_time;//时间戳 NSTimeInterval time=[str doubleValue];//因为时差问题要加8小时 == 28800 sec NSDate *detaildate=[NSDate dateWithTimeIntervalSince1970:time]; //实例化一个NSDateFormatter对象 NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; //设定时间格式,这里可以设置成自己需要的格式 [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; _lblTime.text=[NSString stringWithFormat:@"揭晓时间: %@",[dateFormatter stringFromDate: detaildate]]; _lblCode.text=[NSString stringWithFormat:@"%@人次",_latestModel.gonumber]; _lblCode.attributedText=[[NSString stringWithFormat:@"<u>%@</u>人次",_latestModel.gonumber] attributedStringWithStyleBook:style1]; if ([_latestModel.xiangou isEqualToString:@"0"]) { _imgxiangou.image=[UIImage imageNamed:@""]; }else{ _imgxiangou.image=[UIImage imageNamed:@"label_03"]; } } - (void)awakeFromNib { // Initialization code } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } @end
{ "content_hash": "129768dd4cdf6a2a1b0ea6ed16f93487", "timestamp": "", "source": "github", "line_count": 189, "max_line_length": 178, "avg_line_length": 35.629629629629626, "alnum_prop": 0.6615681615681616, "repo_name": "Miaocool/MYG-OC", "id": "2ef6b4105771b1ce36b08fb59a61b81fb0861c91", "size": "7091", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "myg/Src/LatestAnnounced/View/DidJiexiaoViewCell.m", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "1147653" }, { "name": "C++", "bytes": "317661" }, { "name": "HTML", "bytes": "4482" }, { "name": "Objective-C", "bytes": "4234266" }, { "name": "Ruby", "bytes": "80" }, { "name": "Shell", "bytes": "8511" } ], "symlink_target": "" }
namespace em = enterprise_management; namespace policy { namespace { // UMA histogram names. const char kUMADelayInitialization[] = "Enterprise.UserPolicyChromeOS.DelayInitialization"; const char kUMAInitialFetchClientError[] = "Enterprise.UserPolicyChromeOS.InitialFetch.ClientError"; const char kUMAInitialFetchDelayClientRegister[] = "Enterprise.UserPolicyChromeOS.InitialFetch.DelayClientRegister"; const char kUMAInitialFetchDelayOAuth2Token[] = "Enterprise.UserPolicyChromeOS.InitialFetch.DelayOAuth2Token"; const char kUMAInitialFetchDelayPolicyFetch[] = "Enterprise.UserPolicyChromeOS.InitialFetch.DelayPolicyFetch"; const char kUMAInitialFetchDelayTotal[] = "Enterprise.UserPolicyChromeOS.InitialFetch.DelayTotal"; const char kUMAInitialFetchOAuth2Error[] = "Enterprise.UserPolicyChromeOS.InitialFetch.OAuth2Error"; const char kUMAInitialFetchOAuth2NetworkError[] = "Enterprise.UserPolicyChromeOS.InitialFetch.OAuth2NetworkError"; void OnWildcardCheckCompleted(const std::string& username, WildcardLoginChecker::Result result) { if (result == WildcardLoginChecker::RESULT_BLOCKED) { LOG(ERROR) << "Online wildcard login check failed, terminating session."; // TODO(mnissler): This only removes the user pod from the login screen, but // the cryptohome remains. This is because deleting the cryptohome for a // logged-in session is not possible. Fix this either by delaying the // cryptohome deletion operation or by getting rid of the in-session // wildcard check. chromeos::UserManager::Get()->RemoveUserFromList(username); chrome::AttemptUserExit(); } } } // namespace UserCloudPolicyManagerChromeOS::UserCloudPolicyManagerChromeOS( scoped_ptr<CloudPolicyStore> store, scoped_ptr<CloudExternalDataManager> external_data_manager, const base::FilePath& component_policy_cache_path, bool wait_for_policy_fetch, base::TimeDelta initial_policy_fetch_timeout, const scoped_refptr<base::SequencedTaskRunner>& task_runner, const scoped_refptr<base::SequencedTaskRunner>& file_task_runner, const scoped_refptr<base::SequencedTaskRunner>& io_task_runner) : CloudPolicyManager( PolicyNamespaceKey(dm_protocol::kChromeUserPolicyType, std::string()), store.get(), task_runner, file_task_runner, io_task_runner), store_(store.Pass()), external_data_manager_(external_data_manager.Pass()), component_policy_cache_path_(component_policy_cache_path), wait_for_policy_fetch_(wait_for_policy_fetch), policy_fetch_timeout_(false, false) { time_init_started_ = base::Time::Now(); if (wait_for_policy_fetch_) { policy_fetch_timeout_.Start( FROM_HERE, initial_policy_fetch_timeout, base::Bind(&UserCloudPolicyManagerChromeOS::OnBlockingFetchTimeout, base::Unretained(this))); } } UserCloudPolicyManagerChromeOS::~UserCloudPolicyManagerChromeOS() {} void UserCloudPolicyManagerChromeOS::Connect( PrefService* local_state, DeviceManagementService* device_management_service, scoped_refptr<net::URLRequestContextGetter> system_request_context, UserAffiliation user_affiliation) { DCHECK(device_management_service); DCHECK(local_state); local_state_ = local_state; scoped_refptr<net::URLRequestContextGetter> request_context; if (system_request_context) { // |system_request_context| can be null for tests. // Use the system request context here instead of a context derived // from the Profile because Connect() is called before the profile is // fully initialized (required so we can perform the initial policy load). // TODO(atwilson): Change this to use a UserPolicyRequestContext once // Connect() is called after profile initialization. http://crbug.com/323591 request_context = new SystemPolicyRequestContext( system_request_context, GetUserAgent()); } scoped_ptr<CloudPolicyClient> cloud_policy_client( new CloudPolicyClient(std::string(), std::string(), kPolicyVerificationKeyHash, user_affiliation, NULL, device_management_service, request_context)); core()->Connect(cloud_policy_client.Pass()); client()->AddObserver(this); external_data_manager_->Connect(request_context); CreateComponentCloudPolicyService(component_policy_cache_path_, request_context); // Determine the next step after the CloudPolicyService initializes. if (service()->IsInitializationComplete()) { OnInitializationCompleted(service()); } else { service()->AddObserver(this); } } void UserCloudPolicyManagerChromeOS::OnAccessTokenAvailable( const std::string& access_token) { access_token_ = access_token; if (!wildcard_username_.empty()) { wildcard_login_checker_.reset(new WildcardLoginChecker()); wildcard_login_checker_->StartWithAccessToken( access_token, base::Bind(&OnWildcardCheckCompleted, wildcard_username_)); } if (service() && service()->IsInitializationComplete() && client() && !client()->is_registered()) { OnOAuth2PolicyTokenFetched( access_token, GoogleServiceAuthError(GoogleServiceAuthError::NONE)); } } bool UserCloudPolicyManagerChromeOS::IsClientRegistered() const { return client() && client()->is_registered(); } void UserCloudPolicyManagerChromeOS::EnableWildcardLoginCheck( const std::string& username) { DCHECK(access_token_.empty()); wildcard_username_ = username; } void UserCloudPolicyManagerChromeOS::Shutdown() { if (client()) client()->RemoveObserver(this); if (service()) service()->RemoveObserver(this); token_fetcher_.reset(); external_data_manager_->Disconnect(); CloudPolicyManager::Shutdown(); } bool UserCloudPolicyManagerChromeOS::IsInitializationComplete( PolicyDomain domain) const { if (!CloudPolicyManager::IsInitializationComplete(domain)) return false; if (domain == POLICY_DOMAIN_CHROME) return !wait_for_policy_fetch_; return true; } void UserCloudPolicyManagerChromeOS::OnInitializationCompleted( CloudPolicyService* cloud_policy_service) { DCHECK_EQ(service(), cloud_policy_service); cloud_policy_service->RemoveObserver(this); time_init_completed_ = base::Time::Now(); UMA_HISTOGRAM_MEDIUM_TIMES(kUMADelayInitialization, time_init_completed_ - time_init_started_); // If the CloudPolicyClient isn't registered at this stage then it needs an // OAuth token for the initial registration. // // If |wait_for_policy_fetch_| is true then Profile initialization is blocking // on the initial policy fetch, so the token must be fetched immediately. // In that case, the signin Profile is used to authenticate a Gaia request to // fetch a refresh token, and then the policy token is fetched. // // If |wait_for_policy_fetch_| is false then the UserCloudPolicyTokenForwarder // service will eventually call OnAccessTokenAvailable() once an access token // is available. That call may have already happened while waiting for // initialization of the CloudPolicyService, so in that case check if an // access token is already available. if (!client()->is_registered()) { if (wait_for_policy_fetch_) { FetchPolicyOAuthTokenUsingSigninProfile(); } else if (!access_token_.empty()) { OnAccessTokenAvailable(access_token_); } } if (!wait_for_policy_fetch_) { // If this isn't blocking on a policy fetch then // CloudPolicyManager::OnStoreLoaded() already published the cached policy. // Start the refresh scheduler now, which will eventually refresh the // cached policy or make the first fetch once the OAuth2 token is // available. StartRefreshSchedulerIfReady(); } } void UserCloudPolicyManagerChromeOS::OnPolicyFetched( CloudPolicyClient* client) { // No action required. If we're blocked on a policy fetch, we'll learn about // completion of it through OnInitialPolicyFetchComplete(). } void UserCloudPolicyManagerChromeOS::OnRegistrationStateChanged( CloudPolicyClient* cloud_policy_client) { DCHECK_EQ(client(), cloud_policy_client); if (wait_for_policy_fetch_) { time_client_registered_ = base::Time::Now(); if (!time_token_available_.is_null()) { UMA_HISTOGRAM_MEDIUM_TIMES( kUMAInitialFetchDelayClientRegister, time_client_registered_ - time_token_available_); } // If we're blocked on the policy fetch, now is a good time to issue it. if (client()->is_registered()) { service()->RefreshPolicy( base::Bind( &UserCloudPolicyManagerChromeOS::OnInitialPolicyFetchComplete, base::Unretained(this))); } else { // If the client has switched to not registered, we bail out as this // indicates the cloud policy setup flow has been aborted. CancelWaitForPolicyFetch(); } } } void UserCloudPolicyManagerChromeOS::OnClientError( CloudPolicyClient* cloud_policy_client) { DCHECK_EQ(client(), cloud_policy_client); if (wait_for_policy_fetch_) { UMA_HISTOGRAM_SPARSE_SLOWLY(kUMAInitialFetchClientError, cloud_policy_client->status()); } CancelWaitForPolicyFetch(); } void UserCloudPolicyManagerChromeOS::OnComponentCloudPolicyUpdated() { CloudPolicyManager::OnComponentCloudPolicyUpdated(); StartRefreshSchedulerIfReady(); } void UserCloudPolicyManagerChromeOS::FetchPolicyOAuthTokenUsingSigninProfile() { scoped_refptr<net::URLRequestContextGetter> signin_context; Profile* signin_profile = chromeos::ProfileHelper::GetSigninProfile(); if (signin_profile) signin_context = signin_profile->GetRequestContext(); if (!signin_context.get()) { LOG(ERROR) << "No signin Profile for policy oauth token fetch!"; OnOAuth2PolicyTokenFetched( std::string(), GoogleServiceAuthError(GoogleServiceAuthError::NONE)); return; } token_fetcher_.reset(new PolicyOAuth2TokenFetcher( signin_context.get(), g_browser_process->system_request_context(), base::Bind(&UserCloudPolicyManagerChromeOS::OnOAuth2PolicyTokenFetched, base::Unretained(this)))); token_fetcher_->Start(); } void UserCloudPolicyManagerChromeOS::OnOAuth2PolicyTokenFetched( const std::string& policy_token, const GoogleServiceAuthError& error) { DCHECK(!client()->is_registered()); time_token_available_ = base::Time::Now(); if (wait_for_policy_fetch_) { UMA_HISTOGRAM_MEDIUM_TIMES(kUMAInitialFetchDelayOAuth2Token, time_token_available_ - time_init_completed_); } if (error.state() == GoogleServiceAuthError::NONE) { // Start client registration. Either OnRegistrationStateChanged() or // OnClientError() will be called back. client()->Register(em::DeviceRegisterRequest::USER, policy_token, std::string(), false, std::string()); } else { // Failed to get a token, stop waiting and use an empty policy. CancelWaitForPolicyFetch(); UMA_HISTOGRAM_ENUMERATION(kUMAInitialFetchOAuth2Error, error.state(), GoogleServiceAuthError::NUM_STATES); if (error.state() == GoogleServiceAuthError::CONNECTION_FAILED) { UMA_HISTOGRAM_SPARSE_SLOWLY(kUMAInitialFetchOAuth2NetworkError, error.network_error()); } } token_fetcher_.reset(); } void UserCloudPolicyManagerChromeOS::OnInitialPolicyFetchComplete( bool success) { const base::Time now = base::Time::Now(); UMA_HISTOGRAM_MEDIUM_TIMES(kUMAInitialFetchDelayPolicyFetch, now - time_client_registered_); UMA_HISTOGRAM_MEDIUM_TIMES(kUMAInitialFetchDelayTotal, now - time_init_started_); CancelWaitForPolicyFetch(); } void UserCloudPolicyManagerChromeOS::OnBlockingFetchTimeout() { if (!wait_for_policy_fetch_) return; LOG(WARNING) << "Timed out while waiting for the initial policy fetch. " << "The first session will start without policy."; CancelWaitForPolicyFetch(); } void UserCloudPolicyManagerChromeOS::CancelWaitForPolicyFetch() { if (!wait_for_policy_fetch_) return; wait_for_policy_fetch_ = false; policy_fetch_timeout_.Stop(); CheckAndPublishPolicy(); // Now that |wait_for_policy_fetch_| is guaranteed to be false, the scheduler // can be started. StartRefreshSchedulerIfReady(); } void UserCloudPolicyManagerChromeOS::StartRefreshSchedulerIfReady() { if (core()->refresh_scheduler()) return; // Already started. if (wait_for_policy_fetch_) return; // Still waiting for the initial, blocking fetch. if (!service() || !local_state_) return; // Not connected. if (component_policy_service() && !component_policy_service()->is_initialized()) { // If the client doesn't have the list of components to fetch yet then don't // start the scheduler. The |component_policy_service_| will call back into // OnComponentCloudPolicyUpdated() once it's ready. return; } core()->StartRefreshScheduler(); core()->TrackRefreshDelayPref(local_state_, policy_prefs::kUserPolicyRefreshRate); } } // namespace policy
{ "content_hash": "61be613226164d9d33307283f7a86fdd", "timestamp": "", "source": "github", "line_count": 352, "max_line_length": 80, "avg_line_length": 38.11363636363637, "alnum_prop": 0.7063208109719737, "repo_name": "anirudhSK/chromium", "id": "a8acd1fb804c7817f089c705f9eda1c39dd0b129", "size": "14754", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ASP", "bytes": "853" }, { "name": "AppleScript", "bytes": "6973" }, { "name": "Arduino", "bytes": "464" }, { "name": "Assembly", "bytes": "52960" }, { "name": "Awk", "bytes": "8660" }, { "name": "C", "bytes": "42502191" }, { "name": "C#", "bytes": "1132" }, { "name": "C++", "bytes": "201859263" }, { "name": "CSS", "bytes": "946557" }, { "name": "DOT", "bytes": "2984" }, { "name": "Java", "bytes": "5687122" }, { "name": "JavaScript", "bytes": "22163714" }, { "name": "M", "bytes": "2190" }, { "name": "Matlab", "bytes": "2496" }, { "name": "Objective-C", "bytes": "7670589" }, { "name": "PHP", "bytes": "97817" }, { "name": "Perl", "bytes": "672770" }, { "name": "Python", "bytes": "10873885" }, { "name": "R", "bytes": "262" }, { "name": "Shell", "bytes": "1315894" }, { "name": "Tcl", "bytes": "277091" }, { "name": "TypeScript", "bytes": "1560024" }, { "name": "XSLT", "bytes": "13493" }, { "name": "nesC", "bytes": "15206" } ], "symlink_target": "" }
<?php namespace Iyzipay\Request; use Iyzipay\JsonBuilder; use Iyzipay\Request; class ReportingPaymentTransactionRequest extends Request { private $transactionDate; private $page; public function getTransactionDate() { return $this->transactionDate; } public function setTransactionDate($transactionDate) { $this->transactionDate = $transactionDate; } public function getPage() { return $this->page; } public function setPage($page) { $this->page = $page; } public function getJsonObject() { return JsonBuilder::fromJsonObject(parent::getJsonObject()) ->add("transactionDate", $this->getTransactionDate()) ->add("page", $this->getPage()) ->getObject(); } }
{ "content_hash": "46a4efd29bc42d38f66beae5174496c2", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 67, "avg_line_length": 20.175, "alnum_prop": 0.6245353159851301, "repo_name": "iyzico/iyzipay-php", "id": "8bcceb19b38061417e5bb4bc423c55576567609a", "size": "807", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Iyzipay/Request/ReportingPaymentTransactionRequest.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "1014055" } ], "symlink_target": "" }
package com.intellij.openapi.roots.impl; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.fileTypes.FileTypeRegistry; import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.roots.*; import com.intellij.openapi.roots.impl.libraries.LibraryEx; import com.intellij.openapi.roots.libraries.Library; import com.intellij.openapi.util.Condition; import com.intellij.openapi.util.LowMemoryWatcher; import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.VfsUtilCore; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.vfs.newvfs.events.VFileEvent; import com.intellij.util.CollectionQuery; import com.intellij.util.EmptyQuery; import com.intellij.util.Query; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.containers.MultiMap; import gnu.trove.TObjectIntHashMap; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jps.model.module.JpsModuleSourceRootType; import java.util.*; public class RootIndex { public static final Comparator<OrderEntry> BY_OWNER_MODULE = new Comparator<OrderEntry>() { @Override public int compare(OrderEntry o1, OrderEntry o2) { String name1 = o1.getOwnerModule().getName(); String name2 = o2.getOwnerModule().getName(); return name1.compareTo(name2); } }; private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.roots.impl.RootIndex"); private final MultiMap<String, VirtualFile> myPackagePrefixRoots = new MultiMap<String, VirtualFile>() { @NotNull @Override protected Collection<VirtualFile> createCollection() { return ContainerUtil.newLinkedHashSet(); } }; private final Map<String, List<VirtualFile>> myDirectoriesByPackageNameCache = ContainerUtil.newConcurrentMap(); private final Set<String> myNonExistentPackages = ContainerUtil.newConcurrentSet(); private final InfoCache myInfoCache; private final List<JpsModuleSourceRootType<?>> myRootTypes = ContainerUtil.newArrayList(); private final TObjectIntHashMap<JpsModuleSourceRootType<?>> myRootTypeId = new TObjectIntHashMap<JpsModuleSourceRootType<?>>(); @NotNull private final Project myProject; private volatile Map<VirtualFile, OrderEntry[]> myOrderEntries; @SuppressWarnings("UnusedDeclaration") private final LowMemoryWatcher myLowMemoryWatcher = LowMemoryWatcher.register(new Runnable() { @Override public void run() { myNonExistentPackages.clear(); } }); // made public for Upsource public RootIndex(@NotNull Project project, @NotNull InfoCache cache) { myProject = project; myInfoCache = cache; final RootInfo info = buildRootInfo(project); Set<VirtualFile> allRoots = info.getAllRoots(); for (VirtualFile root : allRoots) { List<VirtualFile> hierarchy = getHierarchy(root, allRoots, info); Pair<DirectoryInfo, String> pair = hierarchy != null ? calcDirectoryInfo(root, hierarchy, info) : new Pair<DirectoryInfo, String>(NonProjectDirectoryInfo.IGNORED, null); cacheInfos(root, root, pair.first); myPackagePrefixRoots.putValue(pair.second, root); } } @NotNull private RootInfo buildRootInfo(@NotNull Project project) { final RootInfo info = new RootInfo(); for (final Module module : ModuleManager.getInstance(project).getModules()) { final ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(module); for (final VirtualFile contentRoot : moduleRootManager.getContentRoots()) { if (!info.contentRootOf.containsKey(contentRoot)) { info.contentRootOf.put(contentRoot, module); } } for (ContentEntry contentEntry : moduleRootManager.getContentEntries()) { if (!(contentEntry instanceof ContentEntryImpl) || !((ContentEntryImpl)contentEntry).isDisposed()) { for (VirtualFile excludeRoot : contentEntry.getExcludeFolderFiles()) { info.excludedFromModule.put(excludeRoot, module); } } // Init module sources for (final SourceFolder sourceFolder : contentEntry.getSourceFolders()) { final VirtualFile sourceFolderRoot = sourceFolder.getFile(); if (sourceFolderRoot != null) { info.rootTypeId.put(sourceFolderRoot, getRootTypeId(sourceFolder.getRootType())); info.classAndSourceRoots.add(sourceFolderRoot); info.sourceRootOf.putValue(sourceFolderRoot, module); info.packagePrefix.put(sourceFolderRoot, sourceFolder.getPackagePrefix()); } } } for (OrderEntry orderEntry : moduleRootManager.getOrderEntries()) { if (orderEntry instanceof LibraryOrSdkOrderEntry) { final LibraryOrSdkOrderEntry entry = (LibraryOrSdkOrderEntry)orderEntry; final VirtualFile[] sourceRoots = entry.getRootFiles(OrderRootType.SOURCES); final VirtualFile[] classRoots = entry.getRootFiles(OrderRootType.CLASSES); // Init library sources for (final VirtualFile sourceRoot : sourceRoots) { info.classAndSourceRoots.add(sourceRoot); info.libraryOrSdkSources.add(sourceRoot); info.packagePrefix.put(sourceRoot, ""); } // init library classes for (final VirtualFile classRoot : classRoots) { info.classAndSourceRoots.add(classRoot); info.libraryOrSdkClasses.add(classRoot); info.packagePrefix.put(classRoot, ""); } if (orderEntry instanceof LibraryOrderEntry) { Library library = ((LibraryOrderEntry)orderEntry).getLibrary(); if (library != null) { for (VirtualFile root : ((LibraryEx)library).getExcludedRoots()) { info.excludedFromLibraries.putValue(root, library); } for (VirtualFile root : sourceRoots) { info.sourceOfLibraries.putValue(root, library); } for (VirtualFile root : classRoots) { info.classOfLibraries.putValue(root, library); } } } } } } for (DirectoryIndexExcludePolicy policy : Extensions.getExtensions(DirectoryIndexExcludePolicy.EP_NAME, project)) { Collections.addAll(info.excludedFromProject, policy.getExcludeRootsForProject()); } return info; } @NotNull private Map<VirtualFile, OrderEntry[]> getOrderEntries() { Map<VirtualFile, OrderEntry[]> result = myOrderEntries; if (result != null) return result; MultiMap<VirtualFile, OrderEntry> libClassRootEntries = MultiMap.createSmart(); MultiMap<VirtualFile, OrderEntry> libSourceRootEntries = MultiMap.createSmart(); MultiMap<VirtualFile, OrderEntry> depEntries = MultiMap.createSmart(); for (final Module module : ModuleManager.getInstance(myProject).getModules()) { final ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(module); for (OrderEntry orderEntry : moduleRootManager.getOrderEntries()) { if (orderEntry instanceof ModuleOrderEntry) { final Module depModule = ((ModuleOrderEntry)orderEntry).getModule(); if (depModule != null) { VirtualFile[] importedClassRoots = OrderEnumerator.orderEntries(depModule).exportedOnly().recursively().classes().usingCache().getRoots(); for (VirtualFile importedClassRoot : importedClassRoots) { depEntries.putValue(importedClassRoot, orderEntry); } } for (VirtualFile sourceRoot : orderEntry.getFiles(OrderRootType.SOURCES)) { depEntries.putValue(sourceRoot, orderEntry); } } else if (orderEntry instanceof LibraryOrSdkOrderEntry) { final LibraryOrSdkOrderEntry entry = (LibraryOrSdkOrderEntry)orderEntry; for (final VirtualFile sourceRoot : entry.getRootFiles(OrderRootType.SOURCES)) { libSourceRootEntries.putValue(sourceRoot, orderEntry); } for (final VirtualFile classRoot : entry.getRootFiles(OrderRootType.CLASSES)) { libClassRootEntries.putValue(classRoot, orderEntry); } } } } RootInfo rootInfo = buildRootInfo(myProject); result = ContainerUtil.newHashMap(); Set<VirtualFile> allRoots = rootInfo.getAllRoots(); for (VirtualFile file : allRoots) { List<VirtualFile> hierarchy = getHierarchy(file, allRoots, rootInfo); result.put(file, hierarchy == null ? OrderEntry.EMPTY_ARRAY : calcOrderEntries(rootInfo, depEntries, libClassRootEntries, libSourceRootEntries, hierarchy)); } myOrderEntries = result; return result; } private static OrderEntry[] calcOrderEntries(@NotNull RootInfo info, @NotNull MultiMap<VirtualFile, OrderEntry> depEntries, @NotNull MultiMap<VirtualFile, OrderEntry> libClassRootEntries, @NotNull MultiMap<VirtualFile, OrderEntry> libSourceRootEntries, @NotNull List<VirtualFile> hierarchy) { @Nullable VirtualFile libraryClassRoot = info.findLibraryRootInfo(hierarchy, false); @Nullable VirtualFile librarySourceRoot = info.findLibraryRootInfo(hierarchy, true); Set<OrderEntry> orderEntries = ContainerUtil.newLinkedHashSet(); orderEntries .addAll(info.getLibraryOrderEntries(hierarchy, libraryClassRoot, librarySourceRoot, libClassRootEntries, libSourceRootEntries)); for (VirtualFile root : hierarchy) { orderEntries.addAll(depEntries.get(root)); } VirtualFile moduleContentRoot = info.findModuleRootInfo(hierarchy); if (moduleContentRoot != null) { ContainerUtil.addIfNotNull(orderEntries, info.getModuleSourceEntry(hierarchy, moduleContentRoot, libClassRootEntries)); } if (orderEntries.isEmpty()) { return null; } OrderEntry[] array = orderEntries.toArray(new OrderEntry[orderEntries.size()]); Arrays.sort(array, BY_OWNER_MODULE); return array; } public void checkConsistency() { for (VirtualFile file : myPackagePrefixRoots.values()) { assert file.exists() : file.getPath() + " does not exist"; } } private int getRootTypeId(@NotNull JpsModuleSourceRootType<?> rootType) { if (myRootTypeId.containsKey(rootType)) { return myRootTypeId.get(rootType); } int id = myRootTypes.size(); if (id > DirectoryInfoImpl.MAX_ROOT_TYPE_ID) { LOG.error("Too many different types of module source roots (" + id + ") registered: " + myRootTypes); } myRootTypes.add(rootType); myRootTypeId.put(rootType, id); return id; } @NotNull public DirectoryInfo getInfoForFile(@NotNull VirtualFile file) { if (!file.isValid()) { return NonProjectDirectoryInfo.INVALID; } VirtualFile dir; if (!file.isDirectory()) { DirectoryInfo info = myInfoCache.getCachedInfo(file); if (info != null) { return info; } if (isIgnored(file)) { return NonProjectDirectoryInfo.IGNORED; } dir = file.getParent(); } else { dir = file; } int count = 0; for (VirtualFile root = dir; root != null; root = root.getParent()) { if (++count > 1000) { throw new IllegalStateException("Possible loop in tree, started at " + dir.getName()); } DirectoryInfo info = myInfoCache.getCachedInfo(root); if (info != null) { if (!dir.equals(root)) { cacheInfos(dir, root, info); } return info; } if (isIgnored(root)) { return cacheInfos(dir, root, NonProjectDirectoryInfo.IGNORED); } } return cacheInfos(dir, null, NonProjectDirectoryInfo.NOT_UNDER_PROJECT_ROOTS); } @NotNull private DirectoryInfo cacheInfos(VirtualFile dir, @Nullable VirtualFile stopAt, @NotNull DirectoryInfo info) { while (dir != null) { myInfoCache.cacheInfo(dir, info); if (dir.equals(stopAt)) { break; } dir = dir.getParent(); } return info; } @NotNull public Query<VirtualFile> getDirectoriesByPackageName(@NotNull final String packageName, final boolean includeLibrarySources) { List<VirtualFile> result = myDirectoriesByPackageNameCache.get(packageName); if (result == null) { if (myNonExistentPackages.contains(packageName)) return EmptyQuery.getEmptyQuery(); result = ContainerUtil.newSmartList(); if (StringUtil.isNotEmpty(packageName) && !StringUtil.startsWithChar(packageName, '.')) { int i = packageName.lastIndexOf('.'); while (true) { String shortName = packageName.substring(i + 1); String parentPackage = i > 0 ? packageName.substring(0, i) : ""; for (VirtualFile parentDir : getDirectoriesByPackageName(parentPackage, true)) { VirtualFile child = parentDir.findChild(shortName); if (child != null && child.isDirectory() && getInfoForFile(child).isInProject() && packageName.equals(getPackageName(child))) { result.add(child); } } if (i < 0) break; i = packageName.lastIndexOf('.', i - 1); } } for (VirtualFile file : myPackagePrefixRoots.get(packageName)) { if (file.isDirectory()) { result.add(file); } } if (!result.isEmpty()) { myDirectoriesByPackageNameCache.put(packageName, result); } else { myNonExistentPackages.add(packageName); } } if (!includeLibrarySources) { result = ContainerUtil.filter(result, new Condition<VirtualFile>() { @Override public boolean value(VirtualFile file) { DirectoryInfo info = getInfoForFile(file); return info.isInProject() && (!info.isInLibrarySource() || info.isInModuleSource() || info.hasLibraryClassRoot()); } }); } return new CollectionQuery<VirtualFile>(result); } @Nullable public String getPackageName(@NotNull final VirtualFile dir) { if (dir.isDirectory()) { if (isIgnored(dir)) { return null; } for (final Map.Entry<String, Collection<VirtualFile>> entry : myPackagePrefixRoots.entrySet()) { if (entry.getValue().contains(dir)) { return entry.getKey(); } } final VirtualFile parent = dir.getParent(); if (parent != null) { return getPackageNameForSubdir(getPackageName(parent), dir.getName()); } } return null; } @Nullable protected static String getPackageNameForSubdir(String parentPackageName, @NotNull String subdirName) { if (parentPackageName == null) return null; return parentPackageName.isEmpty() ? subdirName : parentPackageName + "." + subdirName; } @Nullable public JpsModuleSourceRootType<?> getSourceRootType(@NotNull DirectoryInfo directoryInfo) { return myRootTypes.get(directoryInfo.getSourceRootTypeId()); } boolean resetOnEvents(@NotNull List<? extends VFileEvent> events) { for (VFileEvent event : events) { VirtualFile file = event.getFile(); if (file == null || file.isDirectory()) { return true; } } return false; } @Nullable("returns null only if dir is under ignored folder") private static List<VirtualFile> getHierarchy(VirtualFile dir, @NotNull Set<VirtualFile> allRoots, @NotNull RootInfo info) { List<VirtualFile> hierarchy = ContainerUtil.newArrayList(); boolean hasContentRoots = false; while (dir != null) { hasContentRoots |= info.contentRootOf.get(dir) != null; if (!hasContentRoots && isIgnored(dir)) { return null; } if (allRoots.contains(dir)) { hierarchy.add(dir); } dir = dir.getParent(); } return hierarchy; } private static boolean isIgnored(@NotNull VirtualFile dir) { return FileTypeRegistry.getInstance().isFileIgnored(dir); } private static class RootInfo { // getDirectoriesByPackageName used to be in this order, some clients might rely on that @NotNull final LinkedHashSet<VirtualFile> classAndSourceRoots = ContainerUtil.newLinkedHashSet(); @NotNull final Set<VirtualFile> libraryOrSdkSources = ContainerUtil.newHashSet(); @NotNull final Set<VirtualFile> libraryOrSdkClasses = ContainerUtil.newHashSet(); @NotNull final Map<VirtualFile, Module> contentRootOf = ContainerUtil.newHashMap(); @NotNull final MultiMap<VirtualFile, Module> sourceRootOf = MultiMap.createSet(); @NotNull final TObjectIntHashMap<VirtualFile> rootTypeId = new TObjectIntHashMap<VirtualFile>(); @NotNull final MultiMap<VirtualFile, Library> excludedFromLibraries = MultiMap.createSmart(); @NotNull final MultiMap<VirtualFile, Library> classOfLibraries = MultiMap.createSmart(); @NotNull final MultiMap<VirtualFile, Library> sourceOfLibraries = MultiMap.createSmart(); @NotNull final Set<VirtualFile> excludedFromProject = ContainerUtil.newHashSet(); @NotNull final Map<VirtualFile, Module> excludedFromModule = ContainerUtil.newHashMap(); @NotNull final Map<VirtualFile, String> packagePrefix = ContainerUtil.newHashMap(); @NotNull Set<VirtualFile> getAllRoots() { LinkedHashSet<VirtualFile> result = ContainerUtil.newLinkedHashSet(); result.addAll(classAndSourceRoots); result.addAll(contentRootOf.keySet()); result.addAll(excludedFromLibraries.keySet()); result.addAll(excludedFromModule.keySet()); result.addAll(excludedFromProject); return result; } @Nullable private VirtualFile findModuleRootInfo(@NotNull List<VirtualFile> hierarchy) { for (VirtualFile root : hierarchy) { Module module = contentRootOf.get(root); Module excludedFrom = excludedFromModule.get(root); if (module != null && excludedFrom != module) { return root; } if (excludedFrom != null || excludedFromProject.contains(root)) { return null; } } return null; } @Nullable private VirtualFile findNearestContentRootForExcluded(@NotNull List<VirtualFile> hierarchy) { for (VirtualFile root : hierarchy) { if (contentRootOf.containsKey(root)) { return root; } } return null; } @Nullable private VirtualFile findLibraryRootInfo(@NotNull List<VirtualFile> hierarchy, boolean source) { Set<Library> librariesToIgnore = ContainerUtil.newHashSet(); for (VirtualFile root : hierarchy) { librariesToIgnore.addAll(excludedFromLibraries.get(root)); if (source && libraryOrSdkSources.contains(root) && (!sourceOfLibraries.containsKey(root) || !librariesToIgnore.containsAll(sourceOfLibraries.get(root)))) { return root; } else if (!source && libraryOrSdkClasses.contains(root) && (!classOfLibraries.containsKey(root) || !librariesToIgnore.containsAll(classOfLibraries.get(root)))) { return root; } } return null; } private String calcPackagePrefix(@NotNull VirtualFile root, @NotNull List<VirtualFile> hierarchy, VirtualFile moduleContentRoot, VirtualFile libraryClassRoot, VirtualFile librarySourceRoot) { VirtualFile packageRoot = findPackageRootInfo(hierarchy, moduleContentRoot, libraryClassRoot, librarySourceRoot); String prefix = packagePrefix.get(packageRoot); if (prefix != null && !root.equals(packageRoot)) { assert packageRoot != null; String relative = VfsUtilCore.getRelativePath(root, packageRoot, '.'); prefix = StringUtil.isEmpty(prefix) ? relative : prefix + '.' + relative; } return prefix; } @Nullable private VirtualFile findPackageRootInfo(@NotNull List<VirtualFile> hierarchy, VirtualFile moduleContentRoot, VirtualFile libraryClassRoot, VirtualFile librarySourceRoot) { for (VirtualFile root : hierarchy) { if (moduleContentRoot != null && sourceRootOf.get(root).contains(contentRootOf.get(moduleContentRoot)) && librarySourceRoot == null) { return root; } if (root.equals(libraryClassRoot) || root.equals(librarySourceRoot)) { return root; } if (root.equals(moduleContentRoot) && !sourceRootOf.containsKey(root) && librarySourceRoot == null && libraryClassRoot == null) { return null; } } return null; } @NotNull private LinkedHashSet<OrderEntry> getLibraryOrderEntries(@NotNull List<VirtualFile> hierarchy, @Nullable VirtualFile libraryClassRoot, @Nullable VirtualFile librarySourceRoot, @NotNull MultiMap<VirtualFile, OrderEntry> libClassRootEntries, @NotNull MultiMap<VirtualFile, OrderEntry> libSourceRootEntries) { LinkedHashSet<OrderEntry> orderEntries = ContainerUtil.newLinkedHashSet(); for (VirtualFile root : hierarchy) { if (root.equals(libraryClassRoot) && !sourceRootOf.containsKey(root)) { orderEntries.addAll(libClassRootEntries.get(root)); } if (root.equals(librarySourceRoot) && libraryClassRoot == null) { orderEntries.addAll(libSourceRootEntries.get(root)); } if (libClassRootEntries.containsKey(root) || sourceRootOf.containsKey(root) && librarySourceRoot == null) { break; } } return orderEntries; } @Nullable private ModuleSourceOrderEntry getModuleSourceEntry(@NotNull List<VirtualFile> hierarchy, @NotNull VirtualFile moduleContentRoot, @NotNull MultiMap<VirtualFile, OrderEntry> libClassRootEntries) { Module module = contentRootOf.get(moduleContentRoot); for (VirtualFile root : hierarchy) { if (sourceRootOf.get(root).contains(module)) { return ContainerUtil.findInstance(ModuleRootManager.getInstance(module).getOrderEntries(), ModuleSourceOrderEntry.class); } if (libClassRootEntries.containsKey(root)) { return null; } } return null; } } @NotNull private static Pair<DirectoryInfo, String> calcDirectoryInfo(@NotNull final VirtualFile root, @NotNull final List<VirtualFile> hierarchy, @NotNull RootInfo info) { VirtualFile moduleContentRoot = info.findModuleRootInfo(hierarchy); VirtualFile libraryClassRoot = info.findLibraryRootInfo(hierarchy, false); VirtualFile librarySourceRoot = info.findLibraryRootInfo(hierarchy, true); boolean inProject = moduleContentRoot != null || libraryClassRoot != null || librarySourceRoot != null; VirtualFile nearestContentRoot; if (inProject) { nearestContentRoot = moduleContentRoot; } else { nearestContentRoot = info.findNearestContentRootForExcluded(hierarchy); if (nearestContentRoot == null) { return new Pair<DirectoryInfo, String>(NonProjectDirectoryInfo.EXCLUDED, null); } } VirtualFile sourceRoot = info.findPackageRootInfo(hierarchy, moduleContentRoot, null, librarySourceRoot); VirtualFile moduleSourceRoot = info.findPackageRootInfo(hierarchy, moduleContentRoot, null, null); boolean inModuleSources = moduleSourceRoot != null; boolean inLibrarySource = librarySourceRoot != null; int typeId = moduleSourceRoot != null ? info.rootTypeId.get(moduleSourceRoot) : 0; Module module = info.contentRootOf.get(nearestContentRoot); DirectoryInfo directoryInfo = new DirectoryInfoImpl(root, module, nearestContentRoot, sourceRoot, libraryClassRoot, inModuleSources, inLibrarySource, !inProject, typeId); String packagePrefix = info.calcPackagePrefix(root, hierarchy, moduleContentRoot, libraryClassRoot, librarySourceRoot); return Pair.create(directoryInfo, packagePrefix); } @NotNull public OrderEntry[] getOrderEntries(@NotNull DirectoryInfo info) { if (!(info instanceof DirectoryInfoImpl)) return OrderEntry.EMPTY_ARRAY; OrderEntry[] entries = this.getOrderEntries().get(((DirectoryInfoImpl)info).getRoot()); return entries == null ? OrderEntry.EMPTY_ARRAY : entries; } public interface InfoCache { @Nullable DirectoryInfo getCachedInfo(@NotNull VirtualFile dir); void cacheInfo(@NotNull VirtualFile dir, @NotNull DirectoryInfo info); } }
{ "content_hash": "1ef5dbdcba40cdec9b31197e313ad274", "timestamp": "", "source": "github", "line_count": 614, "max_line_length": 146, "avg_line_length": 41.486970684039086, "alnum_prop": 0.6656459780944529, "repo_name": "diorcety/intellij-community", "id": "50a7e625757cf2ee90a93614ee3d19fbac51df40", "size": "26073", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "platform/projectModel-impl/src/com/intellij/openapi/roots/impl/RootIndex.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "AspectJ", "bytes": "182" }, { "name": "Batchfile", "bytes": "63659" }, { "name": "C", "bytes": "214180" }, { "name": "C#", "bytes": "1538" }, { "name": "C++", "bytes": "190028" }, { "name": "CSS", "bytes": "108843" }, { "name": "CoffeeScript", "bytes": "1759" }, { "name": "Cucumber", "bytes": "14382" }, { "name": "Erlang", "bytes": "10" }, { "name": "FLUX", "bytes": "57" }, { "name": "Groff", "bytes": "35232" }, { "name": "Groovy", "bytes": "2211774" }, { "name": "HTML", "bytes": "1674627" }, { "name": "J", "bytes": "5050" }, { "name": "JFlex", "bytes": "166194" }, { "name": "Java", "bytes": "146664059" }, { "name": "JavaScript", "bytes": "125292" }, { "name": "Kotlin", "bytes": "225274" }, { "name": "Makefile", "bytes": "2352" }, { "name": "NSIS", "bytes": "85938" }, { "name": "Objective-C", "bytes": "28634" }, { "name": "Perl6", "bytes": "26" }, { "name": "Protocol Buffer", "bytes": "6570" }, { "name": "Python", "bytes": "21485830" }, { "name": "Ruby", "bytes": "1213" }, { "name": "Scala", "bytes": "11698" }, { "name": "Shell", "bytes": "63323" }, { "name": "Smalltalk", "bytes": "64" }, { "name": "TeX", "bytes": "60798" }, { "name": "TypeScript", "bytes": "6152" }, { "name": "XSLT", "bytes": "113040" } ], "symlink_target": "" }
CREATE TABLE public.products ( id uuid NOT NULL, brand_id uuid NOT NULL, code varchar(200) NOT NULL, "name" varchar(200) NOT NULL, stock numeric NOT NULL, unit_price money NOT NULL, vat money NOT NULL, created date NULL, update_time date NULL, short_description varchar(500) NULL, long_description varchar(1500) NULL, CONSTRAINT products_pk PRIMARY KEY (id) ) WITH ( OIDS=FALSE ) ; CREATE TABLE public.product_properties ( id uuid NOT NULL, product_id uuid NOT NULL, "key" varchar(200) NOT NULL, value varchar(1200) NOT NULL, CONSTRAINT product_properties_pk PRIMARY KEY (id), CONSTRAINT product_properties_products_fk FOREIGN KEY (product_id) REFERENCES public.products(id) ) WITH ( OIDS=FALSE ) ; CREATE INDEX product_properties_product_id_idx ON public.product_properties (product_id DESC,id DESC,"key" DESC) ; CREATE TABLE public.option_groups ( id uuid NOT NULL, "name" varchar(200) NOT NULL, CONSTRAINT option_groups_pk PRIMARY KEY (id) ) WITH ( OIDS=FALSE ) ; CREATE INDEX option_groups_id_idx ON public.option_groups (id DESC) ; CREATE TABLE public."options" ( id uuid NOT NULL, "name" varchar(200) NOT NULL, CONSTRAINT options_pk PRIMARY KEY (id) ) WITH ( OIDS=FALSE ) ; CREATE INDEX options_id_idx ON public."options" (id DESC) ; CREATE TABLE public.product_options ( id uuid NOT NULL, product_id uuid NOT NULL, option_group_id uuid NOT NULL, option_id uuid NOT NULL, price money NULL, CONSTRAINT product_options_pk PRIMARY KEY (id), CONSTRAINT product_options_options_fk FOREIGN KEY (option_id) REFERENCES public."options"(id) ) WITH ( OIDS=FALSE ) ; CREATE INDEX product_options_id_idx ON public.product_options (id DESC,product_id DESC,option_group_id DESC,option_id DESC) ;
{ "content_hash": "037cc66c3455420e47c6a8651e2f7903", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 125, "avg_line_length": 25.115942028985508, "alnum_prop": 0.7432198499711483, "repo_name": "cembasaranoglu/foxyecomm", "id": "185e58e6c9784862700656e4521100727ae6f09f", "size": "1735", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "FoxyEcomm/Scripts/inventory.sql", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "121" }, { "name": "C#", "bytes": "509840" }, { "name": "CSS", "bytes": "2626" }, { "name": "HTML", "bytes": "5069" }, { "name": "JavaScript", "bytes": "207925" } ], "symlink_target": "" }
package play.learn.java.design.observer1; import java.util.ArrayList; import java.util.List; public class Weather { private WeatherType currentWeather; private List<WeatherObserver> observers; public Weather() { observers = new ArrayList<>(); currentWeather = WeatherType.SUNNY; } public void addObserver(WeatherObserver obs) { observers.add(obs); } public void removeObserver(WeatherObserver obs) { observers.remove(obs); } /** * Makes time pass for weather */ public void timePasses() { WeatherType[] enumValues = WeatherType.values(); currentWeather = enumValues[(currentWeather.ordinal() + 1) % enumValues.length]; System.out.printf("The weather changed to %s.", currentWeather); notifyObservers(); } private void notifyObservers() { for (WeatherObserver obs : observers) { obs.update(currentWeather); } } }
{ "content_hash": "bfcd845816a1f508941873b05feb02c3", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 82, "avg_line_length": 21.525, "alnum_prop": 0.7259001161440186, "repo_name": "jasonwee/videoOnCloud", "id": "8fc0a907d1ed4712cd3ab9d7581c9915d5ed61db", "size": "861", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/java/play/learn/java/design/observer1/Weather.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "116270" }, { "name": "C", "bytes": "2209717" }, { "name": "C++", "bytes": "375267" }, { "name": "CSS", "bytes": "1134648" }, { "name": "Dockerfile", "bytes": "1656" }, { "name": "HTML", "bytes": "306558398" }, { "name": "Java", "bytes": "1465506" }, { "name": "JavaScript", "bytes": "9028509" }, { "name": "Jupyter Notebook", "bytes": "30907" }, { "name": "Less", "bytes": "107003" }, { "name": "PHP", "bytes": "856" }, { "name": "PowerShell", "bytes": "77807" }, { "name": "Pug", "bytes": "2968" }, { "name": "Python", "bytes": "1001861" }, { "name": "R", "bytes": "7390" }, { "name": "Roff", "bytes": "3553" }, { "name": "Shell", "bytes": "206191" }, { "name": "Thrift", "bytes": "80564" }, { "name": "XSLT", "bytes": "4740" } ], "symlink_target": "" }
"""This module contains a collection of unit tests which validate the ..async_actions module. """ from keyczar import keyczar from keyczar import keyczart import unittest import uuid from ..async_actions import AsyncHealthCheck from . import TempDirectory class AsyncHealthCheckTestCase(unittest.TestCase): def _get_aspect(self, aspects, aspect_name): for aspect in aspects: if aspect_name == aspect.name: return aspect return None def assertAspectHealth(self, aspects, aspect_name, is_ok): aspect = self._get_aspect(aspects, aspect_name) self.assertIsNotNone(aspect) self.assertEqual(aspect.name, aspect_name) self.assertEqual(aspect.is_ok, is_ok) def assertCrypterComponentHealth(self, component_health, name, is_configured, is_readable, is_working): self.assertIsNotNone(component_health) self.assertEqual(component_health.name, name) self.assertEqual(3, len(component_health.aspects)) self.assertAspectHealth(component_health.aspects, 'configured', is_configured) self.assertAspectHealth(component_health.aspects, 'readable', is_readable) self.assertAspectHealth(component_health.aspects, 'working', is_working) def test_check_crypter_not_configured(self): name = uuid.uuid4().hex directory_name = None crypter = None ahc = AsyncHealthCheck() component_health = ahc.check_crypter(name, directory_name, crypter) self.assertCrypterComponentHealth(component_health, name, False, False, False) def test_check_crypter_not_readable(self): name = uuid.uuid4().hex directory_name = uuid.uuid4().hex crypter = None ahc = AsyncHealthCheck() component_health = ahc.check_crypter(name, directory_name, crypter) self.assertCrypterComponentHealth(component_health, name, True, False, False) def test_check_crypter_not_working(self): with TempDirectory() as keyczar_keystore_dir: keyczart.Create(keyczar_keystore_dir.name, 'testing', keyczart.keyinfo.DECRYPT_AND_ENCRYPT) crypter = keyczar.Crypter.Read(keyczar_keystore_dir.name) name = uuid.uuid4().hex ahc = AsyncHealthCheck() component_health = ahc.check_crypter(name, keyczar_keystore_dir.name, crypter) self.assertCrypterComponentHealth(component_health, name, True, True, False) def test_check_crypter_happy_path(self): with TempDirectory() as keyczar_keystore_dir: keyczart.Create(keyczar_keystore_dir.name, 'testing', keyczart.keyinfo.DECRYPT_AND_ENCRYPT) keyczart.AddKey(keyczar_keystore_dir.name, keyczart.keyinfo.PRIMARY) crypter = keyczar.Crypter.Read(keyczar_keystore_dir.name) name = uuid.uuid4().hex ahc = AsyncHealthCheck() component_health = ahc.check_crypter(name, keyczar_keystore_dir.name, crypter) self.assertCrypterComponentHealth(component_health, name, True, True, True)
{ "content_hash": "5b3c8d15d0558cd9308e6fa7bdd0f8e2", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 107, "avg_line_length": 37.53658536585366, "alnum_prop": 0.6861598440545809, "repo_name": "simonsdave/cloudfeaster-services", "id": "cdad669cf6a0a12a7da2a469af3099c4b6526cf8", "size": "3078", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "cloudfeaster_services/tests/async_actions_unit_tests.py", "mode": "33188", "license": "mit", "language": [ { "name": "Dockerfile", "bytes": "1995" }, { "name": "JavaScript", "bytes": "1177" }, { "name": "Python", "bytes": "602059" }, { "name": "RAML", "bytes": "33777" }, { "name": "Shell", "bytes": "17929" } ], "symlink_target": "" }
drop table user if exists; create table user ( id integer NOT NULL PRIMARY KEY, name varchar(32), address varchar(64), state integer ); INSERT INTO user (id, name, address, state) VALUES (1, 'abel533', 'Hebei/Shijiazhuang', 1); INSERT INTO user (id, name, address, state) VALUES (2, 'isea533', 'Hebei/Handan', 0);
{ "content_hash": "a27419ce54e9baa1333eacedc44ed6d7", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 47, "avg_line_length": 24.357142857142858, "alnum_prop": 0.6598240469208211, "repo_name": "abel533/Mapper", "id": "aca7aa30cfd29c6291e68ceba444c48664545600", "size": "341", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "base/src/test/java/tk/mybatis/mapper/typehandler/CreateDB.sql", "mode": "33188", "license": "mit", "language": [ { "name": "FreeMarker", "bytes": "8465" }, { "name": "Java", "bytes": "1242615" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Login Page - Photon Admin Panel Theme</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"> <link rel="shortcut icon" href="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/favicon.ico"/> <link rel="apple-touch-icon" href="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/iosicon.png"/> <link rel="stylesheet" href="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/css/css_compiled/photon-min.css?v1.1" media="all"/> <link rel="stylesheet" href="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/css/css_compiled/photon-min-part2.css?v1.1" media="all"/> <link rel="stylesheet" href="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/css/css_compiled/photon-responsive-min.css?v1.1" media="all"/> <!--[if IE]> <link rel="stylesheet" type="text/css" href="css/css_compiled/ie-only-min.css?v1.1" /> <![endif]--> <!--[if lt IE 9]> <link rel="stylesheet" type="text/css" href="css/css_compiled/ie8-only-min.css?v1.1" /> <script type="text/javascript" src="js/plugins/excanvas.js"></script> <script type="text/javascript" src="js/plugins/html5shiv.js"></script> <script type="text/javascript" src="js/plugins/respond.min.js"></script> <script type="text/javascript" src="js/plugins/fixFontIcons.js"></script> <![endif]--> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/bootstrap/bootstrap.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/modernizr.custom.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/jquery.pnotify.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/less-1.3.1.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/xbreadcrumbs.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/jquery.maskedinput-1.3.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/jquery.autotab-1.1b.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/charCount.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/jquery.textareaCounter.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/elrte.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/elrte.en.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/select2.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/jquery-picklist.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/jquery.validate.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/additional-methods.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/jquery.form.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/jquery.metadata.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/jquery.mockjax.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/jquery.uniform.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/jquery.tagsinput.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/jquery.rating.pack.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/farbtastic.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/jquery.timeentry.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/jquery.dataTables.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/jquery.jstree.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/dataTables.bootstrap.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/jquery.mousewheel.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/jquery.mCustomScrollbar.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/jquery.flot.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/jquery.flot.stack.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/jquery.flot.pie.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/jquery.flot.resize.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/raphael.2.1.0.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/justgage.1.0.1.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/jquery.qrcode.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/jquery.clock.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/jquery.countdown.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/jquery.jqtweet.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/jquery.cookie.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/bootstrap-fileupload.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/prettify/prettify.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/bootstrapSwitch.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/plugins/mfupload.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/js/common.js"></script> </head> <body class="body-login"> <div class="nav-fixed-topright" style="visibility: hidden"> <ul class="nav nav-user-menu"> <li class="user-sub-menu-container"> <a href="javascript:;"> <i class="user-icon"></i><span class="nav-user-selection">Theme Options</span><i class="icon-menu-arrow"></i> </a> <ul class="nav user-sub-menu"> <li class="light"> <a href="javascript:;"> <i class='icon-photon stop'></i>Light Version </a> </li> <li class="dark"> <a href="javascript:;"> <i class='icon-photon stop'></i>Dark Version </a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-photon mail"></i> </a> </li> <li> <a href="javascript:;"> <i class="icon-photon comment_alt2_stroke"></i> <div class="notification-count">12</div> </a> </li> </ul> </div> <script> $(function(){ setTimeout(function(){ $('.nav-fixed-topright').removeAttr('style'); }, 300); $(window).scroll(function(){ if($('.breadcrumb-container').length){ var scrollState = $(window).scrollTop(); if (scrollState > 0) $('.nav-fixed-topright').addClass('nav-released'); else $('.nav-fixed-topright').removeClass('nav-released') } }); $('.user-sub-menu-container').on('click', function(){ $(this).toggleClass('active-user-menu'); }); $('.user-sub-menu .light').on('click', function(){ if ($('body').is('.light-version')) return; $('body').addClass('light-version'); setTimeout(function() { $.cookie('themeColor', 'light', { expires: 7, path: '/' }); }, 500); }); $('.user-sub-menu .dark').on('click', function(){ if ($('body').is('.light-version')) { $('body').removeClass('light-version'); $.cookie('themeColor', 'dark', { expires: 7, path: '/' }); } }); }); </script> <div class="container-login"> <div class="form-centering-wrapper"> <div class="form-window-login"> <div class="form-window-login-logo"> <div class="login-logo"> <img src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/images/photon/login-logo@2x.png" alt="Photon UI"/> </div> <h2 class="login-title">Welcome to Photon UI!</h2> <div class="login-member">Not a Member?&nbsp;<a href="jquery.textareaCounter.js.html#">Sign Up &#187;</a> <a href="jquery.textareaCounter.js.html#" class="btn btn-facebook"><i class="icon-fb"></i>Login with Facebook<i class="icon-fb-arrow"></i></a> </div> <div class="login-or">Or</div> <div class="login-input-area"> <form method="POST" action="dashboard.php"> <span class="help-block">Login With Your Photon Account</span> <input type="text" name="email" placeholder="Email"> <input type="password" name="password" placeholder="Password"> <button type="submit" class="btn btn-large btn-success btn-login">Login</button> </form> <a href="jquery.textareaCounter.js.html#" class="forgot-pass">Forgot Your Password?</a> </div> </div> </div> </div> </div> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-1936460-27']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html>
{ "content_hash": "63723646888425bada9189a8211bdeb9", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 195, "avg_line_length": 74.8076923076923, "alnum_prop": 0.7260374586852736, "repo_name": "user-tony/photon-rails", "id": "03fafc36a4e881978f3937c3f8de7487083a35f6", "size": "13615", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/assets/images/photon/plugins/elrte/js/plugins/css/css_compiled/js/js/plugins/jquery.textareaCounter.js.html", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "291750913" }, { "name": "JavaScript", "bytes": "59305" }, { "name": "Ruby", "bytes": "203" }, { "name": "Shell", "bytes": "99" } ], "symlink_target": "" }
/** * StringLengthError.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter. */ package com.google.api.ads.adwords.axis.v201406.cm; /** * Errors associated with the length of the given string being * out of bounds. */ public class StringLengthError extends com.google.api.ads.adwords.axis.v201406.cm.ApiError implements java.io.Serializable { /* The error reason represented by an enum. */ private com.google.api.ads.adwords.axis.v201406.cm.StringLengthErrorReason reason; public StringLengthError() { } public StringLengthError( java.lang.String fieldPath, java.lang.String trigger, java.lang.String errorString, java.lang.String apiErrorType, com.google.api.ads.adwords.axis.v201406.cm.StringLengthErrorReason reason) { super( fieldPath, trigger, errorString, apiErrorType); this.reason = reason; } /** * Gets the reason value for this StringLengthError. * * @return reason * The error reason represented by an enum. */ public com.google.api.ads.adwords.axis.v201406.cm.StringLengthErrorReason getReason() { return reason; } /** * Sets the reason value for this StringLengthError. * * @param reason * The error reason represented by an enum. */ public void setReason(com.google.api.ads.adwords.axis.v201406.cm.StringLengthErrorReason reason) { this.reason = reason; } private java.lang.Object __equalsCalc = null; public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof StringLengthError)) return false; StringLengthError other = (StringLengthError) obj; if (obj == null) return false; if (this == obj) return true; if (__equalsCalc != null) { return (__equalsCalc == obj); } __equalsCalc = obj; boolean _equals; _equals = super.equals(obj) && ((this.reason==null && other.getReason()==null) || (this.reason!=null && this.reason.equals(other.getReason()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; public synchronized int hashCode() { if (__hashCodeCalc) { return 0; } __hashCodeCalc = true; int _hashCode = super.hashCode(); if (getReason() != null) { _hashCode += getReason().hashCode(); } __hashCodeCalc = false; return _hashCode; } // Type metadata private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc(StringLengthError.class, true); static { typeDesc.setXmlType(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201406", "StringLengthError")); org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("reason"); elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201406", "reason")); elemField.setXmlType(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201406", "StringLengthError.Reason")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); } /** * Return type metadata object */ public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; } /** * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } }
{ "content_hash": "9ece0cf9380309fd09424c7b8e0268a2", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 141, "avg_line_length": 32.888888888888886, "alnum_prop": 0.6238738738738738, "repo_name": "nafae/developer", "id": "2c164ab34656e23065ec124cdfce5b1c8b1ccd11", "size": "4440", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201406/cm/StringLengthError.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "127846798" }, { "name": "Perl", "bytes": "28418" } ], "symlink_target": "" }
<?php /** * @uses Zend_Service_DeveloperGarden_Response_ConferenceCall_AbstractConferenceCall * @category Zend * @package Zend_Service * @subpackage DeveloperGarden * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @author Marco Kaiser * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Service_DeveloperGarden_Response_ConferenceCall_RemoveParticipantResponse extends Zend_Service_DeveloperGarden_Response_ConferenceCall_AbstractConferenceCall { /** * response data * * @codingStandardsIgnoreFile * @var Zend_Service_DeveloperGarden_Response_ConferenceCall_CCSResponseType */ public $CCSResponse = null; }
{ "content_hash": "2f1dee8ba49e69421ceef2348314bf14", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 90, "avg_line_length": 32.47826086956522, "alnum_prop": 0.7282463186077643, "repo_name": "Techlightenment/zf2", "id": "44cf773503abe6cd04febaf0abe7e450a7453c4d", "size": "1451", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "library/Zend/Service/DeveloperGarden/Response/ConferenceCall/RemoveParticipantResponse.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "1153" }, { "name": "JavaScript", "bytes": "30072" }, { "name": "PHP", "bytes": "29274702" }, { "name": "Puppet", "bytes": "2625" }, { "name": "Ruby", "bytes": "10" }, { "name": "Shell", "bytes": "3809" }, { "name": "TypeScript", "bytes": "3445" } ], "symlink_target": "" }
<?php namespace FacebookBundle\Service; use Doctrine\ORM\EntityManager; use Symfony\Component\Config\Definition\Exception\Exception; use AppBundle\Entity\User; use DateTime; use Facebook\Facebook; use Facebook\FacebookApp; use Facebook\FacebookRequest; use Facebook\Exceptions\FacebookSDKException; use Facebook\Exceptions\FacebookResponseException; class FacebookService { protected $em; protected $facebook; protected $fbApp; const TYPE_GROUP = 'group'; const TYPE_PAGE = 'page'; const VALID_SEARCH_TYPES =[ self::TYPE_PAGE, self::TYPE_GROUP, ]; /** * FacebookService constructor. * @param EntityManager $em * @param $appId * @param $appSecret */ public function __construct(EntityManager $em, $appId, $appSecret) { $this->em = $em; $this->facebook = new Facebook([ 'app_id' => "{$appId}", 'app_secret' => "{$appSecret}", 'default_graph_version' => 'v2.7', ]); $this->fbApp = new FacebookApp("{$appId}", "{$appSecret}"); } /** * @param User $user */ public function setLongLivedAccessToken(User $user){ $facebook = $this->facebook; // OAuth 2.0 client handler $oAuth2Client = $facebook->getOAuth2Client(); // Exchanges a short-lived access token for a long-lived one $longLivedAccessToken = $oAuth2Client->getLongLivedAccessToken("{$user->getFacebookAccessToken()}"); $user->setFacebookLongLivedAccessToken($longLivedAccessToken->getValue()); $user->setLlTokenExpirationDate($longLivedAccessToken->getExpiresAt()); $this->em->persist($user); $this->em->flush(); } /** * @param User $user * @return array */ public function getPermissions(User $user){ $fb = $this->facebook; $fb->setDefaultAccessToken($user->getFacebookLongLivedAccessToken()); try { $response = $fb->get("/{$user->getFacebookId()}/permissions"); } catch(FacebookResponseException $e) { // When Graph returns an error echo 'Graph returned an error: ' . $e->getMessage(); exit; } catch(FacebookSDKException $e) { // When validation fails or other local issues echo 'Facebook SDK returned an error: ' . $e->getMessage(); exit; } return $response->getDecodedBody(); } /** * @param array $permissions * @return bool */ public function checkPermissions(array $permissions){ foreach ($permissions['data'] as $perm){ if($perm['status'] != 'granted'){ return false; } } return true; } /** * @param User $user * @return bool */ public function checkTokenExpirationDate(User $user){ $now = new DateTime('now'); $tokenExpirationDate = $user->getLlTokenExpirationDate(); if($tokenExpirationDate < $now){ return false; }else{ return true; } } /** * @param $accessToken * @param $id * @param null $message * @param null $link * @return \Facebook\GraphNodes\GraphNode */ public function publish($accessToken, $id, $message = null, $link = null){ $fb = $this->facebook; $fb->setDefaultAccessToken($accessToken); $data = [ 'link' => $link, 'message' => $message, ]; try { // Returns a `Facebook\FacebookResponse` object $response = $fb->post("/{$id}/feed", $data); } catch(FacebookResponseException $e) { echo 'Graph returned an error: ' . $e->getMessage(); exit; } catch(FacebookSDKException $e) { echo 'Facebook SDK returned an error: ' . $e->getMessage(); exit; } return $response->getGraphNode(); } /** * @param User $user * @param $searchString * @param $type * @return array */ public function search(User $user, $searchString, $type){ $fb = $this->facebook; $fbApp = $this->fbApp; if(!in_array($type, self::VALID_SEARCH_TYPES)){ throw new Exception('invalid search type'); } $searchArray = array ( 'type' => $type, 'q' => $searchString, 'fields' => 'id,name,privacy,locale', ); $request = new FacebookRequest($fbApp, $user->getFacebookLongLivedAccessToken(), 'GET', '/search', $searchArray); // Send the request to Graph try { $response = $fb->getClient()->sendRequest($request); } catch(FacebookResponseException $e) { // When Graph returns an error echo 'Graph returned an error: ' . $e->getMessage(); exit; } catch(FacebookSDKException $e) { // When validation fails or other local issues echo 'Facebook SDK returned an error: ' . $e->getMessage(); exit; } return $response->getDecodedBody(); } /** * @param User $user * @param $pageId * @return array */ public function getPageAccessToken(User $user, $pageId){ $fb = $this->facebook; $fbApp = $this->fbApp; $fb->setDefaultAccessToken($user->getFacebookLongLivedAccessToken()); $request = new FacebookRequest($fbApp, $user->getFacebookLongLivedAccessToken(), 'GET', "/{$pageId}", ['fields' => 'access_token']); try { $response = $fb->getClient()->sendRequest($request);; } catch(FacebookResponseException $e) { // When Graph returns an error echo 'Graph returned an error: ' . $e->getMessage(); exit; } catch(FacebookSDKException $e) { // When validation fails or other local issues echo 'Facebook SDK returned an error: ' . $e->getMessage(); exit; } return $response->getDecodedBody(); } }
{ "content_hash": "b5e855727c9dd3635188528bd307c373", "timestamp": "", "source": "github", "line_count": 217, "max_line_length": 140, "avg_line_length": 28.110599078341014, "alnum_prop": 0.5614754098360656, "repo_name": "LechS/SwingSwing", "id": "570e0bbc89511f16c5397935b909a7a40dd9e605", "size": "6100", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/FacebookBundle/Service/FacebookService.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "9759" }, { "name": "HTML", "bytes": "539342" }, { "name": "JavaScript", "bytes": "492734" }, { "name": "PHP", "bytes": "125857" } ], "symlink_target": "" }
package metroinsight.citadel.metadata.impl; import java.sql.Statement; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.query.Binding; import org.eclipse.rdf4j.query.BindingSet; import org.eclipse.rdf4j.query.QueryLanguage; import org.eclipse.rdf4j.query.QueryResults; import org.eclipse.rdf4j.query.TupleQuery; import org.eclipse.rdf4j.query.TupleQueryResult; import org.eclipse.rdf4j.repository.RepositoryConnection; import io.vertx.core.AsyncResult; import io.vertx.core.Future; import io.vertx.core.Handler; import io.vertx.core.Vertx; import io.vertx.core.json.JsonArray; import io.vertx.core.json.JsonObject; import io.vertx.servicediscovery.ServiceDiscovery; import metroinsight.citadel.common.ErrorMessages; import metroinsight.citadel.metadata.MetadataService; import virtuoso.rdf4j.driver.VirtuosoRepository; public class VirtuosoRdf4jService implements MetadataService{ private final Vertx vertx; private final ServiceDiscovery discovery; ValueFactory factory; RepositoryConnection conn; // Prefixes final String CITADEL = "http://metroinsight.io/citadel#"; final String RDF = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"; final String RDFS = "http://www.w3.org/2000/01/rdf-schema#"; final String EX = "http://example.com#"; final String BIF = "http://www.openlinksw.com/schema/sparql/extensions#"; String queryPrefix; Map<String, IRI> propertyMap; Map<String, String> valPropMap; // TODO: Maybe add a map between uesr-prop to rdf property. e.g., "pointType" -> // rdf:type. // Common Variables IRI a; IRI hasUnit; IRI hasName; IRI context; // Units List<String> units; List<String> types; String graphname; public VirtuosoRdf4jService(Vertx vertx, String virtHostname, Integer virtPort, String graphname, String username, String password, ServiceDiscovery discovery) { String url = String.format("jdbc:virtuoso://%s:%d/log_enable=0", virtHostname, virtPort); VirtuosoRepository repository = new VirtuosoRepository(url, username, password); factory = repository.getValueFactory(); conn = repository.getConnection(); context = repository.getValueFactory().createIRI(graphname); this.graphname = graphname; this.vertx = vertx; this.discovery = discovery; initSchema(); } private void initSchema() { // Init prefixes for SPARQL queryPrefix = String.format("PREFIX citadel: <%s>\n", CITADEL) + String.format("PREFIX rdf: <%s>\n", RDF) + String.format("PREFIX rdfs: <%s>\n", RDFS) + String.format("PREFIX ex: <%s>\n", EX) + "PREFIX bif: <bif:>\n" + "PREFIX xsd: <xsd:>\n"; // Init common variables units = new ArrayList<String>(); types = new ArrayList<String>(); a = factory.createIRI(RDF, "type"); hasUnit = factory.createIRI(CITADEL, "unit"); hasName = factory.createIRI(CITADEL, "name"); // Init Namespace Map // This may be automated once we get a schema file (in Turtle). propertyMap = new HashMap<String, IRI>(); propertyMap.put("pointType", factory.createIRI(RDF, "type")); propertyMap.put("subClassOf", factory.createIRI(RDFS, "subClassOf")); propertyMap.put("unit", factory.createIRI(CITADEL, "unit")); propertyMap.put("owner", factory.createIRI(CITADEL, "owner")); propertyMap.put("name", factory.createIRI(CITADEL, "name")); valPropMap = new HashMap<String, String>(); valPropMap.put("name", "string"); valPropMap.put("unit", "citadel"); valPropMap.put("pointType", "citadel"); // Init units // types List<String> citadelTypes = new ArrayList<String>(units); citadelTypes.addAll(types); for (int i = 0; i < citadelTypes.size(); i++) { String v = citadelTypes.get(i); propertyMap.put(v, factory.createIRI(CITADEL, v)); } } private Value withPrefixValue(String prop, String id) { if (valPropMap.containsKey(prop)) { String valType = valPropMap.get(prop); if (valType.equals("string")) { return factory.createLiteral(id); } else if (valType.equals("citadel")) { return factory.createIRI(CITADEL, id); } else { System.out.println("TODO: Unknown value type"); return factory.createIRI(EX, id); } } else { return factory.createLiteral(id); } } private IRI withPrefixProp(String id) { return propertyMap.getOrDefault(id, factory.createIRI(EX, id)); } // public static final String VIRTUOSO_INSTANCE = "mc64"; public static final String VIRTUOSO_INSTANCE = "localhost"; public static final int VIRTUOSO_PORT = 1111; public static final String VIRTUOSO_USERNAME = "dba"; public static final String VIRTUOSO_PASSWORD = "dba"; public static void log(String mess) { System.out.println(" " + mess); } TupleQueryResult doTupleQuery(String query) throws Exception { try { TupleQuery resultsTable = conn.prepareTupleQuery(QueryLanguage.SPARQL, query); resultsTable.setIncludeInferred(false); TupleQueryResult bindings = resultsTable.evaluate(); bindings = QueryResults.distinctResults(bindings); return bindings; } catch (Exception e) { e.printStackTrace(); throw e; } } static void exec_query(Statement st, String query) throws Exception { String s = trimStr(query); if (s.length() > 0) { if (s.charAt(s.length() - 1) == ';') { s = s.substring(0, s.length() - 1); } st.execute(s); } } static String trimStr(String s) { int last = s.length() - 1; for (int i = last; i >= 0 && Character.isWhitespace(s.charAt(i)); i--) { } return s.substring(0, last).trim(); } private JsonArray findByStringValue(String tag, String value) throws Exception { try { if (value.startsWith("\"") && value.endsWith("\"")) { value = value.substring(1, value.length() - 1); } String qStr = queryPrefix + "SELECT ?s FROM <" + context + "> WHERE {\n" + String.format("?s citadel:%s ?o . ?o bif:contains \"'%s'\". }\n", tag, value); TupleQueryResult res = doTupleQuery(qStr); JsonArray results = new JsonArray(); while (res.hasNext()) { BindingSet tup = res.next(); Binding aaa = tup.getBinding("s"); results.add(aaa.toString()); } return results; } catch (Exception e) { throw e; } } @Override public void createPoint(JsonObject jsonMetadata, Handler<AsyncResult<String>> resultHandler) { try { long totalStartTime = System.nanoTime(); if (jsonMetadata.getString("name").contains(" ")) { throw new Exception("Empty space is not allowed in name."); } else if (jsonMetadata.getString("unit").contains(" ")) { throw new Exception("Empty space is not allowed in unit."); } // Check if the name already exists String nameStr = jsonMetadata.getString("name"); /* ParameterizedSparqlString pss = getDefaultPss(); pss.setCommandText("select ?s where {?s citadel:name ?name .}"); pss.setParam("name", name); ResultSet res = sparqlQuery(pss.toString()); */ long startTime = System.nanoTime(); Value name = withPrefixValue("name", nameStr); // TODO: Change name to Literal later //ResultSet res = findByStringValue("name", nameStr); JsonArray res = findByStringValue("name", name.stringValue()); //Node name = withPrefixValue("name", nameStr); // TODO: Change name to Literal later if (res.size() > 0) { resultHandler.handle(Future.failedFuture(ErrorMessages.EXISTING_POINT_NAME)); } else { // Create the point startTime = System.nanoTime(); String uuid = jsonMetadata.getString("uuid");//UUID.randomUUID().toString(); IRI point = factory.createIRI(EX, uuid); Value pointType = withPrefixValue("pointType", jsonMetadata.getString("pointType")); conn.add(point, a, pointType); Value unit = withPrefixValue("unit", jsonMetadata.getString("unit")); conn.add(point, hasUnit, unit, context); conn.add(point, hasName, name, context); Iterator<String> tagIter = jsonMetadata.fieldNames().iterator(); while (tagIter.hasNext()) { String tag = tagIter.next(); String value = jsonMetadata.getString(tag); // Check if tag corresponds to predefines properties which should be handeled above. if (!tag.equals("unit") && !tag.equals("name") && !tag.equals("uuid") && !tag.equals("pointType")) { conn.add(point, withPrefixProp(tag), withPrefixValue(tag, value), context); } } resultHandler.handle(Future.succeededFuture(uuid)); } } catch (Exception e) { resultHandler.handle(Future.failedFuture(e)); } } @Override public void getPoint(String uuid, Handler<AsyncResult<JsonObject>> resultHandler) { try { String qStr = queryPrefix + String.format("SELECT ?p ?o WHERE {<%s> ?p ?o}", factory.createIRI(EX, uuid)); TupleQueryResult results = doTupleQuery(qStr); if (!results.hasNext()) { resultHandler.handle(Future.failedFuture("Not existing UUID")); } else { JsonObject metadata = new JsonObject(); while (results.hasNext()) { BindingSet result = results.next(); String p = result.getValue("p").toString().split("#")[1]; String o = result.getValue("o").toString().split("#")[1]; // TODO: If it is a string? if (p.equals("type")) { p = "pointType"; } metadata.put(p, o); } metadata.put("uuid", uuid); resultHandler.handle(Future.succeededFuture(metadata)); } } catch (Exception e) { resultHandler.handle(Future.failedFuture(e)); } } @Override public void queryPoint(JsonObject query, Handler<AsyncResult<JsonArray>> resultHandler) { try { // Construct a SPARQL query. String qStr = queryPrefix + "SELECT ?s FROM <" + context + "> WHERE {\n"; Iterator<String> fieldIter = query.fieldNames().iterator(); while (fieldIter.hasNext()) { String tagStr = fieldIter.next(); IRI tagNode = withPrefixProp(tagStr); Value valNode = withPrefixValue(tagStr, query.getString(tagStr)); Boolean isIri = true; try { IRI aaa = (IRI) valNode; } catch (Exception e) { isIri = false; } if (isIri) { qStr += String.format("?s <%s> <%s> . \n", tagNode, valNode); } else { qStr += String.format("?s <%s> %s . \n", tagNode, valNode); } } qStr += "?s ?p ?o .\n}"; TupleQueryResult results = doTupleQuery(qStr); JsonArray uuids = new JsonArray(); while (results.hasNext()) { uuids.add(results.next().getValue("s").toString().split("#")[1]); } resultHandler.handle(Future.succeededFuture(uuids)); }catch (Exception e) { resultHandler.handle(Future.failedFuture(e)); } } @Override public void upsertMetadata(String uuid, JsonObject newMetadata, Handler<AsyncResult<Void>> rh) { try { IRI point = factory.createIRI(EX, uuid); Iterator<String> keys = newMetadata.fieldNames().iterator(); while (keys.hasNext()) { String key = keys.next(); IRI prop = withPrefixProp(key); Object value = newMetadata.getString(key); if (value instanceof List) { // TODO: Check this is working. If not working, use try catch. Iterator<String> valueIter = ((List<String>) value).iterator(); while (valueIter.hasNext()) { conn.add(point, prop, withPrefixProp(valueIter.next()), context); } } else if (value instanceof String) { conn.add(point, prop, withPrefixValue(key, (String) value)); } } rh.handle(Future.succeededFuture()); } catch (Exception e) { rh.handle(Future.failedFuture(e)); } } public static void main(String[] args) { } }
{ "content_hash": "19c55252cfffbf6233020436b451684e", "timestamp": "", "source": "github", "line_count": 335, "max_line_length": 116, "avg_line_length": 36.94328358208955, "alnum_prop": 0.6390594699418228, "repo_name": "MetroInsight/citadel", "id": "119920fc14efd35803da6072a6b4d45a95ff096a", "size": "12376", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/metroinsight/citadel/metadata/impl/VirtuosoRdf4jService.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "8975" }, { "name": "Java", "bytes": "219637" }, { "name": "JavaScript", "bytes": "2643" }, { "name": "Shell", "bytes": "1073" } ], "symlink_target": "" }
from __future__ import unicode_literals from __future__ import absolute_import from django.views.generic import TemplateView from django.shortcuts import render class AboutContribView(TemplateView): template_name = 'about-contrib/raffles.html' class AboutWydView(TemplateView): template_name = 'about-wyd/history.html' def home(request): return render(request, 'home.html')
{ "content_hash": "a5e33c0f70a7705c9688732c32a24b27", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 48, "avg_line_length": 21.88888888888889, "alnum_prop": 0.7639593908629442, "repo_name": "alexfalcucc/wyd-kravov-raffle", "id": "15bf9c7e445b65347707d6326eceea513a274c93", "size": "434", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "jmj_2016/core/views.py", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "25037" }, { "name": "HTML", "bytes": "43952" }, { "name": "JavaScript", "bytes": "45999" }, { "name": "Python", "bytes": "7022" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" content="text/html"> <title></title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> <!-- Optional theme --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous"> <!-- Latest compiled and minified JavaScript --> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> <?php echo link_tag('assets/css/login/signin.css'); ?> <?php echo link_tag('assets/css/login/create.css'); ?> <?php echo link_tag('assets/css/site/nav.css'); ?> </head> <body>
{ "content_hash": "08fb5f9762ce0bfc9eeced1fa5654e4c", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 218, "avg_line_length": 58.25, "alnum_prop": 0.7244635193133048, "repo_name": "mredfern79/uh-team-a", "id": "cf51493bc89829cc2818010e37080f0116cd3790", "size": "1165", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/views/includes/header.php", "mode": "33188", "license": "mit", "language": [ { "name": "ActionScript", "bytes": "15982" }, { "name": "ApacheConf", "bytes": "1071" }, { "name": "CSS", "bytes": "104601" }, { "name": "HTML", "bytes": "8419588" }, { "name": "JavaScript", "bytes": "889600" }, { "name": "PHP", "bytes": "2298282" }, { "name": "Shell", "bytes": "173" } ], "symlink_target": "" }
FROM ubuntu # File Author / Maintainer MAINTAINER Jonas Rosland # Add the application resources URL RUN echo "deb http://archive.ubuntu.com/ubuntu/ $(lsb_release -sc) main universe" >> /etc/apt/sources.list # Update the sources list RUN apt-get update # Install basic applications RUN apt-get install -y tar git curl nano wget dialog net-tools build-essential unzip zlib1g-dev # Install Python and Basic Python Tools RUN apt-get install -y ruby-dev nodejs # Install the Dashing and Bundler gems RUN gem install dashing RUN gem install bundler # Copy the application folder inside the container ADD . /social-dashboard # Install Dashing into /social-dashboard #RUN dashing new social-dashboard # Bundle the dashboard RUN cd /social-dashboard && bundle # Download widgets #RUN cd /social-dashboard && wget https://github.com/cmaujean/dashing-github-stats/archive/master.zip #RUN cd /social-dashboard && unzip master.zip #RUN cd /social-dashboard && cp -r dashing-github-stats-master/assets/* assets #RUN cd /social-dashboard && cp -r dashing-github-stats-master/jobs/* jobs #RUN cd /social-dashboard && cp -r dashing-github-stats-master/widgets/* widgets #RUN cd /social-dashboard && cp dashing-github-stats-master/github.yml . #RUN cd /social-dashboard && rm -fr dashing-github-stats-master #ADD ./github.yml /social-dashboard/github.yml #ADD ./Gemfile /social-dashboard/Gemfile #ADD ./sample.erb /social-dashboard/dashboards/sample.erb # Expose ports EXPOSE 3030 # Set the default directory where CMD will execute WORKDIR /social-dashboard # Set the default command to execute # when creating a new container # i.e. using CherryPy to serve the application CMD dashing start
{ "content_hash": "afa17cc3d90b5e2c77734ef1d09a1c4c", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 106, "avg_line_length": 31.849056603773583, "alnum_prop": 0.7713270142180095, "repo_name": "emccode/dashboard", "id": "aa3745c97f6b91fa7b10be8b795749a89228b888", "size": "1917", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Dockerfile", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "15167" }, { "name": "CoffeeScript", "bytes": "7138" }, { "name": "HTML", "bytes": "25082" }, { "name": "JavaScript", "bytes": "226397" }, { "name": "Ruby", "bytes": "17213" } ], "symlink_target": "" }
using System; using System.Windows.Input; namespace Guinunit.Utilities { public static class CursorHelper { public static IDisposable UseWait() { return new CursorRestoreHandle(Cursors.Wait); } } }
{ "content_hash": "2e28a8b0fe773ecd22a23644aaa105ec", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 57, "avg_line_length": 19.076923076923077, "alnum_prop": 0.6370967741935484, "repo_name": "janno-p/Guinunit", "id": "8ab3c949914052607dcddf00feb0da9ff491ca9a", "size": "250", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Guinunit/Utilities/CursorHelper.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "25804" } ], "symlink_target": "" }
using Microsoft.TeamFoundation.Client; using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Web; using System.Web.Mvc; using TFSAdminDashboard.DataAccess; using TFSAdminDashboard.DTO; using TFSAdminDashboard.Models; using Microsoft.TeamFoundation.Framework.Client; namespace TFSAdminDashboard.Controllers { public class DashboardViewController : TFAdminControllerBase { // GET: DashboardView public ActionResult Index() { var projectCollections = CatalogNodeBrowsingHelper.GetProjectCollections(configurationServer.CatalogNode); OrganizationalOverviewModel dashb = new OrganizationalOverviewModel() { ProjectCollectionCollection = projectCollections, ProjectCount = CatalogNodeBrowsingHelper.GetTeamProjects(configurationServer.CatalogNode, true).Count() }; return View(dashb); } } }
{ "content_hash": "65ec0e9591f7ee1f0e0103f77251ae02", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 119, "avg_line_length": 29.393939393939394, "alnum_prop": 0.7247422680412371, "repo_name": "fbouteruche/tfsadmindashboard", "id": "cb8db7a614732c9dbdad32df309e9eee2dbcd2b3", "size": "972", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "TFSAdminDashboard/TFSAdminDashboard/Controllers/DashboardViewController.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "108" }, { "name": "C#", "bytes": "139073" }, { "name": "CSS", "bytes": "16606" }, { "name": "HTML", "bytes": "5125" }, { "name": "JavaScript", "bytes": "70078" }, { "name": "PowerShell", "bytes": "3837" }, { "name": "Shell", "bytes": "2366" } ], "symlink_target": "" }
/* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef __ISL29023_H__ #define __ISL29023_H__ #include <linux/types.h> #define ISL29023_PD_MODE 0x0 #define ISL29023_ALS_ONCE_MODE 0x1 #define ISL29023_IR_ONCE_MODE 0x2 #define ISL29023_ALS_CONT_MODE 0x5 #define ISL29023_IR_CONT_MODE 0x6 #define ISL29023_INT_PERSISTS_1 0x0 #define ISL29023_INT_PERSISTS_4 0x1 #define ISL29023_INT_PERSISTS_8 0x2 #define ISL29023_INT_PERSISTS_16 0x3 #define ISL29023_RES_16 0x0 #define ISL29023_RES_12 0x1 #define ISL29023_RES_8 0x2 #define ISL29023_RES_4 0x3 #define ISL29023_RANGE_1K 0x0 #define ISL29023_RANGE_4K 0x1 #define ISL29023_RANGE_16K 0x2 #define ISL29023_RANGE_64K 0x3 #endif
{ "content_hash": "49b1e429e8aecea0ee254ccd36d6d6be", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 74, "avg_line_length": 30.177777777777777, "alnum_prop": 0.7584683357879234, "repo_name": "draftedstuff/android-serial-test", "id": "c5106ae32abe2ecdf6a173597973135fd4255fca", "size": "1437", "binary": false, "copies": "94", "ref": "refs/heads/master", "path": "include/linux/isl29023.h", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "34046" }, { "name": "C", "bytes": "2959699" }, { "name": "C++", "bytes": "3190" }, { "name": "Makefile", "bytes": "358" }, { "name": "Objective-C", "bytes": "1112" } ], "symlink_target": "" }
<?php use \Mockery as m; use Crafter\Installer\Repositories\ZendRepository; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class ZendRepositoryTest extends PHPUnit_Framework_TestCase { /** * The Repository. * * @var LaravelRepository */ protected $repo; /** * Setup the test environment. * * @return void */ protected function setUp() { $this->repo = m::mock(ZendRepository::class . '[runCommands]', [ m::mock(InputInterface::class), m::mock(OutputInterface::class), 'FooProject', 'latest', ]); } /** * Clean up the testing environment before the next test. * * @return void */ protected function tearDown() { m::close(); unset($this->repo); } /** * Test get the commands to run. * * @return void */ public function testGetCommandsToRunMethod() { $this->assertEquals( 'composer create-project -n -sdev zendframework/skeleton-application ' . getcwd() . DIRECTORY_SEPARATOR . 'FooProject 3.0.*', $this->repo->getCommandsToRun() ); } }
{ "content_hash": "29168348c5e42d0416828d75a5adb054", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 137, "avg_line_length": 22.78181818181818, "alnum_prop": 0.5762170790103751, "repo_name": "percymamedy/crafter", "id": "6bdd4f91f2cdc72c35aba87b255cfeb679ae0cdc", "size": "1253", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/Repositories/ZendRepositoryTest.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "29127" } ], "symlink_target": "" }
<!-- header start --> <!-- header end -->
{ "content_hash": "748b6960ed92cc0614c4d86dda223500", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 21, "avg_line_length": 21, "alnum_prop": 0.47619047619047616, "repo_name": "DayS/blog", "id": "bde6e5abb8d3541cff2a3b6b126b61b7603da37b", "size": "42", "binary": false, "copies": "2", "ref": "refs/heads/gh-pages", "path": "_includes/header.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "16520" }, { "name": "HTML", "bytes": "13493" }, { "name": "JavaScript", "bytes": "3529" } ], "symlink_target": "" }
module Financial class Expense < ActiveRecord::Base belongs_to :exp_type belongs_to :payment_type end end
{ "content_hash": "6f2c9f6dbec208a0dbda4790ea5ecd80", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 36, "avg_line_length": 19.5, "alnum_prop": 0.7264957264957265, "repo_name": "lnthai2002/financial", "id": "d3dcb64668dd470dc0f8d651af013f39928ecf53", "size": "117", "binary": false, "copies": "1", "ref": "refs/heads/issue_3", "path": "app/models/financial/expense.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1427" }, { "name": "JavaScript", "bytes": "1282" }, { "name": "Ruby", "bytes": "53154" } ], "symlink_target": "" }
PasteFinder ------------- Search for a paste on sprunge.us (OLD CODE)
{ "content_hash": "83c0a34e757600298c26921a95fefc7d", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 32, "avg_line_length": 10.428571428571429, "alnum_prop": 0.6027397260273972, "repo_name": "JustHvost/PasteFinder", "id": "3fbf687069bdaf8c30b6283d21a445ca44d6c50f", "size": "73", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "935" } ], "symlink_target": "" }
package com.mohawk.webcrawler.lang.operator; import com.mohawk.webcrawler.lang.BaseOperator; import com.mohawk.webcrawler.lang.LangCore; import com.mohawk.webcrawler.lang.LanguageException; import com.mohawk.webcrawler.lang.ScriptContext; public class InvertBoolean_Operator extends BaseOperator { @Override public int numOfParams() { return 1; } @Override public OperReturnType returnType() { return OperReturnType.BOOLEAN; } @Override public Object run(ScriptContext scriptContext, Object... params) throws Exception { Object p1 = LangCore.resolveParameter(scriptContext, params[0]); if (p1 instanceof Boolean) return !(Boolean)p1; else throw new LanguageException("Unable to invert value>> " + p1); } }
{ "content_hash": "3113eeb7563a78fe8b0700ae332112f0", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 74, "avg_line_length": 25.060606060606062, "alnum_prop": 0.6880290205562273, "repo_name": "chanh75/MohawkWebCrawler", "id": "892f11dec95feb89b28bb9bf9d29bf3888359cec", "size": "1419", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/com/mohawk/webcrawler/lang/operator/InvertBoolean_Operator.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "233" }, { "name": "Java", "bytes": "187805" } ], "symlink_target": "" }
package io.zhuliang.appchooser.action; import android.content.ComponentName; import android.content.Intent; import java.io.File; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; import io.zhuliang.appchooser.AppChooser; import io.zhuliang.appchooser.BuildConfig; import io.zhuliang.appchooser.internal.Preconditions; import io.zhuliang.appchooser.ui.view.ViewFragment; import io.zhuliang.appchooser.util.FileUtils; /** * @author Zhu Liang */ public class ViewAction { private static final String FRAGMENT_TAG = BuildConfig.APPLICATION_ID + ".fragment.tag.VIEW"; private AppChooser mAppChooser; private ActionConfig mActionConfig = new ActionConfig(); public ViewAction(AppChooser appChooser) { mAppChooser = appChooser; mActionConfig.actionName = Intent.ACTION_VIEW; } public ViewAction file(@NonNull File file) { FileUtils.checkFile(file); mActionConfig.pathname = file.getAbsolutePath(); return this; } public ViewAction requestCode(int requestCode) { mActionConfig.requestCode = requestCode; return this; } public ViewAction excluded(ComponentName... componentNames) { mActionConfig.excluded = componentNames; return this; } public ViewAction authority(String authority) { mActionConfig.authority = authority; mActionConfig.isUriExposed = false; return this; } public void load() { FragmentActivity activity = mAppChooser.getActivity(); if (activity != null) { mActionConfig.fromActivity = true; ViewFragment.newInstance(mActionConfig).show(activity.getSupportFragmentManager(), FRAGMENT_TAG); return; } Fragment fragment = mAppChooser.getFragment(); if (fragment != null) { mActionConfig.fromActivity = false; FragmentManager fragmentManager = Preconditions.checkNotNull(fragment.getFragmentManager()); ViewFragment.newInstance(mActionConfig).show(fragmentManager, FRAGMENT_TAG); return; } throw new NullPointerException("activity and fragment both are null"); } }
{ "content_hash": "3efabc8cc037d57d2bdcd78c968136d1", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 97, "avg_line_length": 31.453333333333333, "alnum_prop": 0.6875794828317083, "repo_name": "JulianAndroid/AppChooser", "id": "ef637d764faa5b54550b13c357c289d8f981df2a", "size": "2359", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "library/src/main/java/io/zhuliang/appchooser/action/ViewAction.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "141977" } ], "symlink_target": "" }
package com.guilite.hostmonitor; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Matrix; import android.util.AttributeSet; import android.util.Log; import android.view.MotionEvent; import android.view.SurfaceHolder; import android.view.SurfaceView; import java.io.IOException; import static android.content.ContentValues.TAG; public class MonitorView extends SurfaceView implements SurfaceHolder.Callback{ public MonitorView(Context context, AttributeSet attrs) { super(context, attrs); // TODO Auto-generated constructor stub m_holder = getHolder(); m_holder.addCallback(this); m_activity = (MainActivity) context; } public MonitorView(Context context) { super(context); // TODO Auto-generated constructor stub m_holder = getHolder(); m_holder.addCallback(this); } @Override public void surfaceChanged(SurfaceHolder m_holder, int format, int width, int height) { } @Override public void surfaceCreated(SurfaceHolder holder) { Canvas canvas = holder.lockCanvas(); if(canvas != null)holder.unlockCanvasAndPost(canvas); m_thread_update = new ThreadUpdate(this); m_thread_update.start(); } @Override public void surfaceDestroyed(SurfaceHolder m_holder) { } private void build_bmp() { m_bm_width = ThreadNative.UI_WIDHT; m_bm_height = ThreadNative.UI_HEIGHT; m_bmp = Bitmap.createBitmap(m_bm_width, m_bm_height, Bitmap.Config.RGB_565); float scaleWidth =((float)getWidth() / m_bm_width); float scaleHeight =((float)getHeight() / m_bm_height); m_matrix.reset(); m_matrix.postScale(scaleWidth, scaleHeight); } private void on_fresh() throws IOException { if(null == m_holder){ return; } if(null == m_bmp){ build_bmp(); return; } ThreadNative.updateBitmap(m_bmp, m_bm_width, m_bm_height); Canvas canvas = m_holder.lockCanvas(); if(null == canvas){ return; } canvas.drawBitmap(m_bmp, m_matrix,null); if(null != canvas)m_holder.unlockCanvasAndPost(canvas); } @Override public boolean onTouchEvent(MotionEvent e) { int logic_x = x2logic((int)e.getX()); int logic_y = y2logic((int)e.getY()); switch (e.getAction()) { case MotionEvent.ACTION_DOWN: checkDoubleClick(e); ThreadNative.on_action_down(logic_x, logic_y); break; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: ThreadNative.on_action_up(logic_x, logic_y); break; case MotionEvent.ACTION_MOVE: ThreadNative.on_action_down(logic_x, logic_y); break; } return true; } private int x2logic(int x){ if(0 != getWidth()) { return (x * m_bm_width / getWidth()); } else { return -1; } } private int y2logic(int y){ if(0 != getHeight()) { return (y * m_bm_height / getHeight()); } return -1; } private class ThreadUpdate extends Thread{ ThreadUpdate(MonitorView main_view){ m_view = main_view; } public void run(){ while (true) { try { m_view.on_fresh(); } catch (Exception e) { e.printStackTrace(); } } } private MonitorView m_view; } private void checkDoubleClick(MotionEvent e) { if(e.getAction() != MotionEvent.ACTION_DOWN) { return; } long time = e.getEventTime(); if(ms_click_time != 0) { if(time - ms_click_time < THRESHOLD_DOUBLE_CLICK){ m_activity.ConnectUsbSerial(); } } ms_click_time = time; } private MainActivity m_activity; private SurfaceHolder m_holder; private Matrix m_matrix = new Matrix(); private ThreadUpdate m_thread_update; private int m_bm_width; private int m_bm_height; private Bitmap m_bmp = null; private static long ms_click_time = 0; private static final long THRESHOLD_DOUBLE_CLICK = 300; }
{ "content_hash": "347dd1680607b30fd51c3412aad79b4a", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 84, "avg_line_length": 28.337423312883434, "alnum_prop": 0.5598614418705348, "repo_name": "idea4good/GuiLiteSamples", "id": "94bd0f02931c17f26223fafb90440eb6e86e0181", "size": "4619", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "HostMonitor/BuildAndroid/app/src/main/java/com/guilite/hostmonitor/MonitorView.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "213104" }, { "name": "Batchfile", "bytes": "119939" }, { "name": "C", "bytes": "37202254" }, { "name": "C#", "bytes": "7658" }, { "name": "C++", "bytes": "48895275" }, { "name": "CMake", "bytes": "18464" }, { "name": "Dockerfile", "bytes": "112" }, { "name": "Go", "bytes": "485" }, { "name": "Java", "bytes": "19115" }, { "name": "PowerShell", "bytes": "19823" }, { "name": "QMake", "bytes": "3902" }, { "name": "Shell", "bytes": "44435" }, { "name": "Swift", "bytes": "46327" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "631af1950bbe47f90a95603b4c314f3d", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "b8ce28abb498f48be212e10207907cfddfe0f35d", "size": "181", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Oxalidales/Elaeocarpaceae/Adenobasium/Adenobasium obtusifolium/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<!DOCTYPE html> <html> <head> <meta charset=utf-8 /> <meta name="viewport" content="width=device-width, initial-scale=0.75, maximum-scale=1"> <style type="text/css"> body { margin: 20px; font-family: sans-serif; font-size: 20px; color: #666; } h2 { font-size: 22px; padding-bottom: 20px; color: #00AEFF; } label { font-size: 14px; } .scopeContainer { margin-bottom: 20px; } .scope { float: left; border: 1px solid #666; } .labelContainer { float: left; padding-left: 10px; } p.scopeLabel { margin: 0; padding-bottom: 10px; font-size: 16px; } #selector { margin-bottom: 10px; } .clear:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } .clear {display: inline-block;} * html .clear {height: 1%;} .clear {display: block;} </style> <title>TriggerPoint Example</title> <!-- The following (socket.io.js) is only required when using the node_server --> <script src="../../socket.io/socket.io.js"></script> <script src="../../dist/Breakout.min.js"></script> <script src="../libs/jquery.min.js"></script> <script src="../libs/requestAnimFrame.js"></script> <script type="text/javascript"> $(document).ready(function() { // Declare these variables so you don't have // to type the full namespace var PinEvent = BO.PinEvent; var IOBoard = BO.IOBoard; var IOBoardEvent = BO.IOBoardEvent; var TriggerPoint = BO.filters.TriggerPoint; var SignalScope = JSUTILS.SignalScope; // Set to true to print debug messages to console BO.enableDebugging = true; // If you are not serving this file from the same computer // that the Arduino board is connected to, replace // window.location.hostname with the IP address or hostname // of the computer that the Arduino board is connected to. var host = window.location.hostname; // if the file is opened locally, set the host to "localhost" if (window.location.protocol.indexOf("file:") === 0) { host = "localhost"; } var arduino = new IOBoard(host, 8887); // Variables var pot; var triggerPoint; var scope1 = new SignalScope("scope1", 200, 100, 0, 1); // points to add to triggerpoint filter var points = [[0.5, 0.05], [0.25, 0], [0.65, 0], [0.8, 0.05]]; // Listen for the IOBoard READY event which indicates the IOBoard // is ready to send and receive data arduino.addEventListener(IOBoardEvent.READY, onReady); function onReady(event) { // Remove the event listener because it is no longer needed arduino.removeEventListener(IOBoardEvent.READY, onReady); // Need to enable an analog pin in order to read it arduino.enableAnalogPin(0); pot = arduino.getAnalogPin(0); // Create a new trigger point at 0.5 with a threshold of 0.05 // pass an array of points to the TriggerPoint Constructor // to pass multiple points pass an array of arrays like this: // [[0.5, 0.05], [0.25, 0]] triggerPoint = new TriggerPoint([0.5, 0.05]); // Attach the trigger point filter to the pin object pot.addFilter(triggerPoint); pot.addEventListener(PinEvent.CHANGE, onPotChange); initGUIListeners(); // Add markers to scope to indicate where points are set // blue lines above and below a green line indicate teh // threshold for that point (green line) scope1.addMarker(0.5, '#00FF00') scope1.addMarker(0.5 + 0.05, '#0080FF'); scope1.addMarker(0.5 - 0.05, '#0080FF'); animate(); } function onPotChange(event) { var pin = event.target; $('#filteredValue').text('Filtered value: ' + pin.value); } function initGUIListeners() { $('select').on('change', function(evt) { pot.removeAllFilters(); addFilter(this.value); }); } function addFilter(numPoints) { var i=0, value = 0, threshold = 0, pointsString = "["; // Remove all points because from the filter triggerPoint.removeAllPoints(); scope1.removeAllMarkers(); for (i=0; i<numPoints; i++) { value = points[i][0]; threshold = points[i][1]; // Add a new point, pass the point to and and the threshold triggerPoint.addPoint(value, threshold); scope1.addMarker(value, '#00FF00'); if (threshold !== 0) { scope1.addMarker(value + threshold, '#0080FF'); scope1.addMarker(value - threshold, '#0080FF'); } pointsString += '[' + value + ', ' + threshold + ']' if (i !== numPoints - 1) pointsString += ', '; } pointsString += ']'; $('#printPoints').text('Points = ' + pointsString); pot.addFilter(triggerPoint); $('#scope1Label').text(numPoints + ' Points'); } function animate() { scope1.update(pot.preFilterValue); $('#preFilterValue').text('Pre-filtered value: ' + pot.preFilterValue.toFixed(3)); requestAnimFrame(animate); } }); </script> </head> <body> <h2>TriggerPoint Example</h2> <div id="containers" style="width:400px;"> <label for="selector">Set number of points: </label> <select id="selector" name="numPoints"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> </select> <div class="scopeContainer clear"> <canvas id="scope1" class="scope" width="200" height="100"></canvas> <div class="labelContainer"> <p id="scope1Label" class="scopeLabel">1 Points</p> <p id="preFilterValue" class="scopeLabel">Pre-filtered value: </p> <p id="filteredValue" class="scopeLabel">Filtered value: </p> </div> </div> <p id="printPoints" class="scopeLabel">Points = [[0.5, 0.05]]</p> </div> </body> </html>​
{ "content_hash": "b73bfca3f82889fe952488e8f11d8030", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 90, "avg_line_length": 29.19905213270142, "alnum_prop": 0.590650868365525, "repo_name": "weberl48/Breakout", "id": "d89be45e0a463c314d87bdb2fbe3938184bc9921", "size": "6163", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "examples/filters/triggerpoint.html", "mode": "33188", "license": "mit", "language": [ { "name": "Arduino", "bytes": "26025" }, { "name": "C++", "bytes": "16734" }, { "name": "CSS", "bytes": "19547" }, { "name": "HTML", "bytes": "46725" }, { "name": "JavaScript", "bytes": "815749" } ], "symlink_target": "" }
package semt import ( "encoding/xml" "github.com/fgrid/iso20022" ) type Document01300103 struct { XMLName xml.Name `xml:"urn:iso:std:iso:20022:tech:xsd:semt.013.001.03 Document"` Message *IntraPositionMovementInstructionV03 `xml:"IntraPosMvmntInstr"` } func (d *Document01300103) AddMessage() *IntraPositionMovementInstructionV03 { d.Message = new(IntraPositionMovementInstructionV03) return d.Message } // Scope // An account owner sends a IntraPositionMovementInstruction to an account servicer to instruct the movement of securities within its holding from one sub-balance to another, for example, blocking of securities. // The account owner/servicer relationship may be: // - a global custodian which has an account with its local agent (sub-custodian), or // - an investment management institution which manage a fund account opened at a custodian, or // - a broker which has an account with a custodian, or // - a central securities depository participant which has an account with a central securities depository, or // - a central securities depository which has an account with a custodian, another central securities depository or another settlement market infrastructure. // Usage // The message may also be used to: // - re-send a message previously sent, // - provide a third party with a copy of a message for information, // - re-send to a third party a copy of a message for information. // using the relevant elements in the Business Application Header. // ISO 15022 - 20022 Coexistence // This ISO 20022 message is reversed engineered from ISO 15022. Both standards will coexist for a certain number of years. Until this coexistence period ends, the usage of certain data types is restricted to ensure interoperability between ISO 15022 and 20022 users. Compliance to these rules is mandatory in a coexistence environment. The coexistence restrictions are described in a Textual Rule linked to the Message Items they concern. These coexistence textual rules are clearly identified as follows: “CoexistenceXxxxRule”. type IntraPositionMovementInstructionV03 struct { // Unambiguous identification of the transaction as know by the instructing party. TransactionIdentification *iso20022.Max35Text `xml:"TxId"` // Identification assigned by the account servicer to unambiguously identify a corporate action event. CorporateActionEventIdentification *iso20022.Identification1 `xml:"CorpActnEvtId,omitempty"` // Count of the number of transactions linked. NumberCounts *iso20022.NumberCount1Choice `xml:"NbCounts,omitempty"` // Link to another transaction that must be processed after, before or at the same time. Linkages []*iso20022.Linkages19 `xml:"Lnkgs,omitempty"` // Party that legally owns the account. AccountOwner *iso20022.PartyIdentification36Choice `xml:"AcctOwnr,omitempty"` // Account to or from which a securities entry is made. SafekeepingAccount *iso20022.SecuritiesAccount13 `xml:"SfkpgAcct"` // Place where the securities are safe-kept, physically or notionally. This place can be, for example, a local custodian, a Central Securities Depository (CSD) or an International Central Securities Depository (ICSD). SafekeepingPlace *iso20022.SafekeepingPlaceFormat3Choice `xml:"SfkpgPlc,omitempty"` // Financial instrument representing a sum of rights of the investor vis-a-vis the issuer. FinancialInstrumentIdentification *iso20022.SecurityIdentification14 `xml:"FinInstrmId"` // Elements characterising a financial instrument. FinancialInstrumentAttributes *iso20022.FinancialInstrumentAttributes36 `xml:"FinInstrmAttrbts,omitempty"` // Intra-position movement transaction details. IntraPositionDetails *iso20022.IntraPositionDetails21 `xml:"IntraPosDtls"` // Additional information that cannot be captured in the structured elements and/or any other specific block. SupplementaryData []*iso20022.SupplementaryData1 `xml:"SplmtryData,omitempty"` } func (i *IntraPositionMovementInstructionV03) SetTransactionIdentification(value string) { i.TransactionIdentification = (*iso20022.Max35Text)(&value) } func (i *IntraPositionMovementInstructionV03) AddCorporateActionEventIdentification() *iso20022.Identification1 { i.CorporateActionEventIdentification = new(iso20022.Identification1) return i.CorporateActionEventIdentification } func (i *IntraPositionMovementInstructionV03) AddNumberCounts() *iso20022.NumberCount1Choice { i.NumberCounts = new(iso20022.NumberCount1Choice) return i.NumberCounts } func (i *IntraPositionMovementInstructionV03) AddLinkages() *iso20022.Linkages19 { newValue := new(iso20022.Linkages19) i.Linkages = append(i.Linkages, newValue) return newValue } func (i *IntraPositionMovementInstructionV03) AddAccountOwner() *iso20022.PartyIdentification36Choice { i.AccountOwner = new(iso20022.PartyIdentification36Choice) return i.AccountOwner } func (i *IntraPositionMovementInstructionV03) AddSafekeepingAccount() *iso20022.SecuritiesAccount13 { i.SafekeepingAccount = new(iso20022.SecuritiesAccount13) return i.SafekeepingAccount } func (i *IntraPositionMovementInstructionV03) AddSafekeepingPlace() *iso20022.SafekeepingPlaceFormat3Choice { i.SafekeepingPlace = new(iso20022.SafekeepingPlaceFormat3Choice) return i.SafekeepingPlace } func (i *IntraPositionMovementInstructionV03) AddFinancialInstrumentIdentification() *iso20022.SecurityIdentification14 { i.FinancialInstrumentIdentification = new(iso20022.SecurityIdentification14) return i.FinancialInstrumentIdentification } func (i *IntraPositionMovementInstructionV03) AddFinancialInstrumentAttributes() *iso20022.FinancialInstrumentAttributes36 { i.FinancialInstrumentAttributes = new(iso20022.FinancialInstrumentAttributes36) return i.FinancialInstrumentAttributes } func (i *IntraPositionMovementInstructionV03) AddIntraPositionDetails() *iso20022.IntraPositionDetails21 { i.IntraPositionDetails = new(iso20022.IntraPositionDetails21) return i.IntraPositionDetails } func (i *IntraPositionMovementInstructionV03) AddSupplementaryData() *iso20022.SupplementaryData1 { newValue := new(iso20022.SupplementaryData1) i.SupplementaryData = append(i.SupplementaryData, newValue) return newValue }
{ "content_hash": "fc8c657bbdf7b36b729d67ba275a3e4d", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 531, "avg_line_length": 49.696, "alnum_prop": 0.8147134578235673, "repo_name": "fgrid/iso20022", "id": "6d73b106cc6c5b7f5d66934c9d17a1ac4004c07c", "size": "6216", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "semt/IntraPositionMovementInstructionV03.go", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "21383920" } ], "symlink_target": "" }
(function (global) { "use strict"; var $ = global.jQuery var LCC = global.LCC || {} LCC.Modules = LCC.Modules || {} LCC.Modules.ImageGallery = function () { this.start = function (element) { var thumbnails = element.data('thumbnails') ? element.data('thumbnails') : "li img", main_image = element.data('main-image') ? element.data('main-image') : "img.main-image"; element.find(thumbnails).hover(function () { element.find(main_image).attr('src', $(this).attr('src')); }); } }; global.LCC = LCC })(window);
{ "content_hash": "091014e437355e7b216b26dd8fc6758f", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 104, "avg_line_length": 28.428571428571427, "alnum_prop": 0.5661641541038526, "repo_name": "lccgov/lcc_templates", "id": "632b5649cd157ebf21e8cec5beea91983cb59c02", "size": "597", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "source/assets/javascripts/modules/image-gallery.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "251" }, { "name": "HTML", "bytes": "56457" }, { "name": "JavaScript", "bytes": "163012" } ], "symlink_target": "" }
package com.huge.code.strategy; import java.util.ArrayList; import java.util.List; import com.huge.code.canvas.BasicCanvas; import com.huge.code.command.BucketCommand; import com.huge.code.common.Chars; import com.huge.code.strategy.base.Strategy; /** * @author Felipe * @version 1.0 * Represents the strategy to fill the draw * */ public class BucketFillStr implements Strategy { private List<BucketCommand> commands; private BasicCanvas canvas; public BucketFillStr(){ commands = new ArrayList<>(); } public BucketFillStr( BucketCommand bucketFill ) { commands = new ArrayList<>(); addCommand(bucketFill); } @Override public void drawIn(BasicCanvas canvas) { this.canvas = canvas; if( commands.size() > 0 ){ for( BucketCommand bucketCommand : commands ){ Point p = bucketCommand.getPoint(); if( canDraw( p ) ){ bucketFillAlg( canvas.getArea(), p.getY(), p.getX(), Chars.SPACE.asChar(), bucketCommand.getPoint().getC() ); } } } } public void bucketFillAlg( char area[][], int x, int y, char targetColor, char replacementColor ){ if( area[x][y] == 'x' || area[x][y] == replacementColor ){ return; } if( Character.isSpaceChar(area[x][y]) ){ area[x][y] = replacementColor; } if( x-1>=0 ){ bucketFillAlg( area, x-1, y, Chars.SPACE.asChar(), replacementColor ); } if( x+1 < canvas.getCommand().getHeight() ){ bucketFillAlg( area, x+1, y, Chars.SPACE.asChar(), replacementColor ); } if( y-1 >= 0 ){ bucketFillAlg( area, x, y-1, Chars.SPACE.asChar(), replacementColor ); } if( y+1 < canvas.getCommand().getWidth() ){ bucketFillAlg( area, x, y+1, Chars.SPACE.asChar(), replacementColor ); } return; } public BasicCanvas getCanvas() { return canvas; } public void setCanvas(BasicCanvas canvas) { this.canvas = canvas; } public boolean canDraw( Point p ){ return (p.getX() >=0 && p.getX()<canvas.getCommand().getWidth() && p.getY() >=0 && p.getY()<canvas.getCommand().getHeight()); } /** * @param command represent the command of a bucket fill * adds the list of commands to be executed * */ public void addCommand( BucketCommand command ){ commands.add(command); } public List<BucketCommand> getCommands( ){ return commands; } }
{ "content_hash": "7c1b0bb6107c50e29f715db05a785981", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 127, "avg_line_length": 25.43820224719101, "alnum_prop": 0.6704946996466431, "repo_name": "felipecardozo/drawingtool", "id": "5ced1d9989c37fdfffa65729b75ff868f4b47832", "size": "2264", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/com/huge/code/strategy/BucketFillStr.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "39157" } ], "symlink_target": "" }
/* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton interface for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { TOK_PPEQ = 258, TOK_VBracketLeft = 259, TOK_VBracketRight = 260, TOK_whitespace = 261, TOK_opaque = 262, TOK_bstring = 263, TOK_cstring = 264, TOK_hstring = 265, TOK_identifier = 266, TOK_number = 267, TOK_number_negative = 268, TOK_realnumber = 269, TOK_tuple = 270, TOK_quadruple = 271, TOK_typereference = 272, TOK_capitalreference = 273, TOK_typefieldreference = 274, TOK_valuefieldreference = 275, TOK_Literal = 276, TOK_ExtValue_BIT_STRING = 277, TOK_ABSENT = 278, TOK_ABSTRACT_SYNTAX = 279, TOK_ALL = 280, TOK_ANY = 281, TOK_APPLICATION = 282, TOK_AUTOMATIC = 283, TOK_BEGIN = 284, TOK_BIT = 285, TOK_BMPString = 286, TOK_BOOLEAN = 287, TOK_BY = 288, TOK_CHARACTER = 289, TOK_CHOICE = 290, TOK_CLASS = 291, TOK_COMPONENT = 292, TOK_COMPONENTS = 293, TOK_CONSTRAINED = 294, TOK_CONTAINING = 295, TOK_DEFAULT = 296, TOK_DEFINITIONS = 297, TOK_DEFINED = 298, TOK_EMBEDDED = 299, TOK_ENCODED = 300, TOK_ENCODING_CONTROL = 301, TOK_END = 302, TOK_ENUMERATED = 303, TOK_EXPLICIT = 304, TOK_EXPORTS = 305, TOK_EXTENSIBILITY = 306, TOK_EXTERNAL = 307, TOK_FALSE = 308, TOK_FROM = 309, TOK_GeneralizedTime = 310, TOK_GeneralString = 311, TOK_GraphicString = 312, TOK_IA5String = 313, TOK_IDENTIFIER = 314, TOK_IMPLICIT = 315, TOK_IMPLIED = 316, TOK_IMPORTS = 317, TOK_INCLUDES = 318, TOK_INSTANCE = 319, TOK_INSTRUCTIONS = 320, TOK_INTEGER = 321, TOK_ISO646String = 322, TOK_MAX = 323, TOK_MIN = 324, TOK_MINUS_INFINITY = 325, TOK_NULL = 326, TOK_NumericString = 327, TOK_OBJECT = 328, TOK_ObjectDescriptor = 329, TOK_OCTET = 330, TOK_OF = 331, TOK_OPTIONAL = 332, TOK_PATTERN = 333, TOK_PDV = 334, TOK_PLUS_INFINITY = 335, TOK_PRESENT = 336, TOK_PrintableString = 337, TOK_PRIVATE = 338, TOK_REAL = 339, TOK_RELATIVE_OID = 340, TOK_SEQUENCE = 341, TOK_SET = 342, TOK_SIZE = 343, TOK_STRING = 344, TOK_SYNTAX = 345, TOK_T61String = 346, TOK_TAGS = 347, TOK_TeletexString = 348, TOK_TRUE = 349, TOK_TYPE_IDENTIFIER = 350, TOK_UNIQUE = 351, TOK_UNIVERSAL = 352, TOK_UniversalString = 353, TOK_UTCTime = 354, TOK_UTF8String = 355, TOK_VideotexString = 356, TOK_VisibleString = 357, TOK_WITH = 358, UTF8_BOM = 359, TOK_EXCEPT = 360, TOK_INTERSECTION = 361, TOK_UNION = 362, TOK_TwoDots = 363, TOK_ThreeDots = 364 }; #endif /* Tokens. */ #define TOK_PPEQ 258 #define TOK_VBracketLeft 259 #define TOK_VBracketRight 260 #define TOK_whitespace 261 #define TOK_opaque 262 #define TOK_bstring 263 #define TOK_cstring 264 #define TOK_hstring 265 #define TOK_identifier 266 #define TOK_number 267 #define TOK_number_negative 268 #define TOK_realnumber 269 #define TOK_tuple 270 #define TOK_quadruple 271 #define TOK_typereference 272 #define TOK_capitalreference 273 #define TOK_typefieldreference 274 #define TOK_valuefieldreference 275 #define TOK_Literal 276 #define TOK_ExtValue_BIT_STRING 277 #define TOK_ABSENT 278 #define TOK_ABSTRACT_SYNTAX 279 #define TOK_ALL 280 #define TOK_ANY 281 #define TOK_APPLICATION 282 #define TOK_AUTOMATIC 283 #define TOK_BEGIN 284 #define TOK_BIT 285 #define TOK_BMPString 286 #define TOK_BOOLEAN 287 #define TOK_BY 288 #define TOK_CHARACTER 289 #define TOK_CHOICE 290 #define TOK_CLASS 291 #define TOK_COMPONENT 292 #define TOK_COMPONENTS 293 #define TOK_CONSTRAINED 294 #define TOK_CONTAINING 295 #define TOK_DEFAULT 296 #define TOK_DEFINITIONS 297 #define TOK_DEFINED 298 #define TOK_EMBEDDED 299 #define TOK_ENCODED 300 #define TOK_ENCODING_CONTROL 301 #define TOK_END 302 #define TOK_ENUMERATED 303 #define TOK_EXPLICIT 304 #define TOK_EXPORTS 305 #define TOK_EXTENSIBILITY 306 #define TOK_EXTERNAL 307 #define TOK_FALSE 308 #define TOK_FROM 309 #define TOK_GeneralizedTime 310 #define TOK_GeneralString 311 #define TOK_GraphicString 312 #define TOK_IA5String 313 #define TOK_IDENTIFIER 314 #define TOK_IMPLICIT 315 #define TOK_IMPLIED 316 #define TOK_IMPORTS 317 #define TOK_INCLUDES 318 #define TOK_INSTANCE 319 #define TOK_INSTRUCTIONS 320 #define TOK_INTEGER 321 #define TOK_ISO646String 322 #define TOK_MAX 323 #define TOK_MIN 324 #define TOK_MINUS_INFINITY 325 #define TOK_NULL 326 #define TOK_NumericString 327 #define TOK_OBJECT 328 #define TOK_ObjectDescriptor 329 #define TOK_OCTET 330 #define TOK_OF 331 #define TOK_OPTIONAL 332 #define TOK_PATTERN 333 #define TOK_PDV 334 #define TOK_PLUS_INFINITY 335 #define TOK_PRESENT 336 #define TOK_PrintableString 337 #define TOK_PRIVATE 338 #define TOK_REAL 339 #define TOK_RELATIVE_OID 340 #define TOK_SEQUENCE 341 #define TOK_SET 342 #define TOK_SIZE 343 #define TOK_STRING 344 #define TOK_SYNTAX 345 #define TOK_T61String 346 #define TOK_TAGS 347 #define TOK_TeletexString 348 #define TOK_TRUE 349 #define TOK_TYPE_IDENTIFIER 350 #define TOK_UNIQUE 351 #define TOK_UNIVERSAL 352 #define TOK_UniversalString 353 #define TOK_UTCTime 354 #define TOK_UTF8String 355 #define TOK_VideotexString 356 #define TOK_VisibleString 357 #define TOK_WITH 358 #define UTF8_BOM 359 #define TOK_EXCEPT 360 #define TOK_INTERSECTION 361 #define TOK_UNION 362 #define TOK_TwoDots 363 #define TOK_ThreeDots 364 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE #line 115 "asn1p_y.y" { asn1p_t *a_grammar; asn1p_module_flags_e a_module_flags; asn1p_module_t *a_module; asn1p_expr_type_e a_type; /* ASN.1 Type */ asn1p_expr_t *a_expr; /* Constructed collection */ asn1p_constraint_t *a_constr; /* Constraint */ enum asn1p_constraint_type_e a_ctype;/* Constraint type */ asn1p_xports_t *a_xports; /* IMports/EXports */ struct AssignedIdentifier a_aid; /* Assigned Identifier */ asn1p_oid_t *a_oid; /* Object Identifier */ asn1p_oid_arc_t a_oid_arc; /* Single OID's arc */ struct asn1p_type_tag_s a_tag; /* A tag */ asn1p_ref_t *a_ref; /* Reference to custom type */ asn1p_wsyntx_t *a_wsynt; /* WITH SYNTAX contents */ asn1p_wsyntx_chunk_t *a_wchunk; /* WITH SYNTAX chunk */ struct asn1p_ref_component_s a_refcomp; /* Component of a reference */ asn1p_value_t *a_value; /* Number, DefinedValue, etc */ struct asn1p_param_s a_parg; /* A parameter argument */ asn1p_paramlist_t *a_plist; /* A pargs list */ struct asn1p_expr_marker_s a_marker; /* OPTIONAL/DEFAULT */ enum asn1p_constr_pres_e a_pres; /* PRESENT/ABSENT/OPTIONAL */ asn1c_integer_t a_int; double a_dbl; char *tv_str; struct { char *buf; int len; } tv_opaque; struct { char *name; struct asn1p_type_tag_s tag; } tv_nametag; } /* Line 1529 of yacc.c. */ #line 302 "asn1p_y.h" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif extern YYSTYPE asn1p_lval;
{ "content_hash": "04f0a9f7b95bab1b29a43263521f6375", "timestamp": "", "source": "github", "line_count": 309, "max_line_length": 75, "avg_line_length": 28.779935275080906, "alnum_prop": 0.6938041155965367, "repo_name": "khmseu/asn1c", "id": "8581bc80bf9e60ce3b4c6230257e30a7c9c853d9", "size": "8893", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "libasn1parser/asn1p_y.h", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "C", "bytes": "1479253" }, { "name": "C++", "bytes": "308" }, { "name": "Groff", "bytes": "9896" }, { "name": "Lex", "bytes": "13962" }, { "name": "Makefile", "bytes": "224" }, { "name": "Objective-C", "bytes": "5078" }, { "name": "Perl", "bytes": "966" }, { "name": "Shell", "bytes": "22046" }, { "name": "Yacc", "bytes": "52559" } ], "symlink_target": "" }
#include "server.h" #include "win32-low.h" #include "x86-low.h" #ifndef CONTEXT_EXTENDED_REGISTERS #define CONTEXT_EXTENDED_REGISTERS 0 #endif #define FCS_REGNUM 27 #define FOP_REGNUM 31 #define FLAG_TRACE_BIT 0x100 #ifdef __x86_64__ /* Defined in auto-generated file reg-amd64.c. */ void init_registers_amd64 (void); extern const struct target_desc *tdesc_amd64; #else /* Defined in auto-generated file reg-i386.c. */ void init_registers_i386 (void); extern const struct target_desc *tdesc_i386; #endif static struct x86_debug_reg_state debug_reg_state; static int update_debug_registers_callback (struct inferior_list_entry *entry, void *pid_p) { struct thread_info *thr = (struct thread_info *) entry; win32_thread_info *th = inferior_target_data (thr); int pid = *(int *) pid_p; /* Only update the threads of this process. */ if (pid_of (thr) == pid) { /* The actual update is done later just before resuming the lwp, we just mark that the registers need updating. */ th->debug_registers_changed = 1; } return 0; } /* Update the inferior's debug register REGNUM from STATE. */ static void x86_dr_low_set_addr (int regnum, CORE_ADDR addr) { /* Only update the threads of this process. */ int pid = pid_of (current_thread); gdb_assert (DR_FIRSTADDR <= regnum && regnum <= DR_LASTADDR); find_inferior (&all_threads, update_debug_registers_callback, &pid); } /* Update the inferior's DR7 debug control register from STATE. */ static void x86_dr_low_set_control (unsigned long control) { /* Only update the threads of this process. */ int pid = pid_of (current_thread); find_inferior (&all_threads, update_debug_registers_callback, &pid); } /* Return the current value of a DR register of the current thread's context. */ static DWORD64 win32_get_current_dr (int dr) { win32_thread_info *th = inferior_target_data (current_thread); win32_require_context (th); #define RET_DR(DR) \ case DR: \ return th->context.Dr ## DR switch (dr) { RET_DR (0); RET_DR (1); RET_DR (2); RET_DR (3); RET_DR (6); RET_DR (7); } #undef RET_DR gdb_assert_not_reached ("unhandled dr"); } static CORE_ADDR x86_dr_low_get_addr (int regnum) { gdb_assert (DR_FIRSTADDR <= regnum && regnum <= DR_LASTADDR); return win32_get_current_dr (regnum - DR_FIRSTADDR); } static unsigned long x86_dr_low_get_control (void) { return win32_get_current_dr (7); } /* Get the value of the DR6 debug status register from the inferior and record it in STATE. */ static unsigned long x86_dr_low_get_status (void) { return win32_get_current_dr (6); } /* Low-level function vector. */ struct x86_dr_low_type x86_dr_low = { x86_dr_low_set_control, x86_dr_low_set_addr, x86_dr_low_get_addr, x86_dr_low_get_status, x86_dr_low_get_control, sizeof (void *), }; /* Breakpoint/watchpoint support. */ static int i386_supports_z_point_type (char z_type) { switch (z_type) { case Z_PACKET_WRITE_WP: case Z_PACKET_ACCESS_WP: return 1; default: return 0; } } static int i386_insert_point (enum raw_bkpt_type type, CORE_ADDR addr, int size, struct raw_breakpoint *bp) { switch (type) { case raw_bkpt_type_write_wp: case raw_bkpt_type_access_wp: { enum target_hw_bp_type hw_type = raw_bkpt_type_to_target_hw_bp_type (type); return x86_dr_insert_watchpoint (&debug_reg_state, hw_type, addr, size); } default: /* Unsupported. */ return 1; } } static int i386_remove_point (enum raw_bkpt_type type, CORE_ADDR addr, int size, struct raw_breakpoint *bp) { switch (type) { case raw_bkpt_type_write_wp: case raw_bkpt_type_access_wp: { enum target_hw_bp_type hw_type = raw_bkpt_type_to_target_hw_bp_type (type); return x86_dr_remove_watchpoint (&debug_reg_state, hw_type, addr, size); } default: /* Unsupported. */ return 1; } } static int x86_stopped_by_watchpoint (void) { return x86_dr_stopped_by_watchpoint (&debug_reg_state); } static CORE_ADDR x86_stopped_data_address (void) { CORE_ADDR addr; if (x86_dr_stopped_data_address (&debug_reg_state, &addr)) return addr; return 0; } static void i386_initial_stuff (void) { x86_low_init_dregs (&debug_reg_state); } static void i386_get_thread_context (win32_thread_info *th) { /* Requesting the CONTEXT_EXTENDED_REGISTERS register set fails if the system doesn't support extended registers. */ static DWORD extended_registers = CONTEXT_EXTENDED_REGISTERS; again: th->context.ContextFlags = (CONTEXT_FULL | CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS | extended_registers); if (!GetThreadContext (th->h, &th->context)) { DWORD e = GetLastError (); if (extended_registers && e == ERROR_INVALID_PARAMETER) { extended_registers = 0; goto again; } error ("GetThreadContext failure %ld\n", (long) e); } } static void i386_prepare_to_resume (win32_thread_info *th) { if (th->debug_registers_changed) { struct x86_debug_reg_state *dr = &debug_reg_state; win32_require_context (th); th->context.Dr0 = dr->dr_mirror[0]; th->context.Dr1 = dr->dr_mirror[1]; th->context.Dr2 = dr->dr_mirror[2]; th->context.Dr3 = dr->dr_mirror[3]; /* th->context.Dr6 = dr->dr_status_mirror; FIXME: should we set dr6 also ?? */ th->context.Dr7 = dr->dr_control_mirror; th->debug_registers_changed = 0; } } static void i386_thread_added (win32_thread_info *th) { th->debug_registers_changed = 1; } static void i386_single_step (win32_thread_info *th) { th->context.EFlags |= FLAG_TRACE_BIT; } #ifndef __x86_64__ /* An array of offset mappings into a Win32 Context structure. This is a one-to-one mapping which is indexed by gdb's register numbers. It retrieves an offset into the context structure where the 4 byte register is located. An offset value of -1 indicates that Win32 does not provide this register in it's CONTEXT structure. In this case regptr will return a pointer into a dummy register. */ #define context_offset(x) ((int)&(((CONTEXT *)NULL)->x)) static const int mappings[] = { context_offset (Eax), context_offset (Ecx), context_offset (Edx), context_offset (Ebx), context_offset (Esp), context_offset (Ebp), context_offset (Esi), context_offset (Edi), context_offset (Eip), context_offset (EFlags), context_offset (SegCs), context_offset (SegSs), context_offset (SegDs), context_offset (SegEs), context_offset (SegFs), context_offset (SegGs), context_offset (FloatSave.RegisterArea[0 * 10]), context_offset (FloatSave.RegisterArea[1 * 10]), context_offset (FloatSave.RegisterArea[2 * 10]), context_offset (FloatSave.RegisterArea[3 * 10]), context_offset (FloatSave.RegisterArea[4 * 10]), context_offset (FloatSave.RegisterArea[5 * 10]), context_offset (FloatSave.RegisterArea[6 * 10]), context_offset (FloatSave.RegisterArea[7 * 10]), context_offset (FloatSave.ControlWord), context_offset (FloatSave.StatusWord), context_offset (FloatSave.TagWord), context_offset (FloatSave.ErrorSelector), context_offset (FloatSave.ErrorOffset), context_offset (FloatSave.DataSelector), context_offset (FloatSave.DataOffset), context_offset (FloatSave.ErrorSelector), /* XMM0-7 */ context_offset (ExtendedRegisters[10 * 16]), context_offset (ExtendedRegisters[11 * 16]), context_offset (ExtendedRegisters[12 * 16]), context_offset (ExtendedRegisters[13 * 16]), context_offset (ExtendedRegisters[14 * 16]), context_offset (ExtendedRegisters[15 * 16]), context_offset (ExtendedRegisters[16 * 16]), context_offset (ExtendedRegisters[17 * 16]), /* MXCSR */ context_offset (ExtendedRegisters[24]) }; #undef context_offset #else /* __x86_64__ */ #define context_offset(x) (offsetof (CONTEXT, x)) static const int mappings[] = { context_offset (Rax), context_offset (Rbx), context_offset (Rcx), context_offset (Rdx), context_offset (Rsi), context_offset (Rdi), context_offset (Rbp), context_offset (Rsp), context_offset (R8), context_offset (R9), context_offset (R10), context_offset (R11), context_offset (R12), context_offset (R13), context_offset (R14), context_offset (R15), context_offset (Rip), context_offset (EFlags), context_offset (SegCs), context_offset (SegSs), context_offset (SegDs), context_offset (SegEs), context_offset (SegFs), context_offset (SegGs), context_offset (FloatSave.FloatRegisters[0]), context_offset (FloatSave.FloatRegisters[1]), context_offset (FloatSave.FloatRegisters[2]), context_offset (FloatSave.FloatRegisters[3]), context_offset (FloatSave.FloatRegisters[4]), context_offset (FloatSave.FloatRegisters[5]), context_offset (FloatSave.FloatRegisters[6]), context_offset (FloatSave.FloatRegisters[7]), context_offset (FloatSave.ControlWord), context_offset (FloatSave.StatusWord), context_offset (FloatSave.TagWord), context_offset (FloatSave.ErrorSelector), context_offset (FloatSave.ErrorOffset), context_offset (FloatSave.DataSelector), context_offset (FloatSave.DataOffset), context_offset (FloatSave.ErrorSelector) /* XMM0-7 */ , context_offset (Xmm0), context_offset (Xmm1), context_offset (Xmm2), context_offset (Xmm3), context_offset (Xmm4), context_offset (Xmm5), context_offset (Xmm6), context_offset (Xmm7), context_offset (Xmm8), context_offset (Xmm9), context_offset (Xmm10), context_offset (Xmm11), context_offset (Xmm12), context_offset (Xmm13), context_offset (Xmm14), context_offset (Xmm15), /* MXCSR */ context_offset (FloatSave.MxCsr) }; #undef context_offset #endif /* __x86_64__ */ /* Fetch register from gdbserver regcache data. */ static void i386_fetch_inferior_register (struct regcache *regcache, win32_thread_info *th, int r) { char *context_offset = (char *) &th->context + mappings[r]; long l; if (r == FCS_REGNUM) { l = *((long *) context_offset) & 0xffff; supply_register (regcache, r, (char *) &l); } else if (r == FOP_REGNUM) { l = (*((long *) context_offset) >> 16) & ((1 << 11) - 1); supply_register (regcache, r, (char *) &l); } else supply_register (regcache, r, context_offset); } /* Store a new register value into the thread context of TH. */ static void i386_store_inferior_register (struct regcache *regcache, win32_thread_info *th, int r) { char *context_offset = (char *) &th->context + mappings[r]; collect_register (regcache, r, context_offset); } static const unsigned char i386_win32_breakpoint = 0xcc; #define i386_win32_breakpoint_len 1 static void i386_arch_setup (void) { #ifdef __x86_64__ init_registers_amd64 (); win32_tdesc = tdesc_amd64; #else init_registers_i386 (); win32_tdesc = tdesc_i386; #endif } struct win32_target_ops the_low_target = { i386_arch_setup, sizeof (mappings) / sizeof (mappings[0]), i386_initial_stuff, i386_get_thread_context, i386_prepare_to_resume, i386_thread_added, i386_fetch_inferior_register, i386_store_inferior_register, i386_single_step, &i386_win32_breakpoint, i386_win32_breakpoint_len, i386_supports_z_point_type, i386_insert_point, i386_remove_point, x86_stopped_by_watchpoint, x86_stopped_data_address };
{ "content_hash": "872b80e9ded8aad2a6df089995db53fb", "timestamp": "", "source": "github", "line_count": 461, "max_line_length": 71, "avg_line_length": 24.90238611713666, "alnum_prop": 0.6749128919860627, "repo_name": "armoredsoftware/protocol", "id": "7c22f058fe49daefbd672169ec5280873956a762", "size": "12214", "binary": false, "copies": "41", "ref": "refs/heads/master", "path": "measurer/gdb-7.9/gdb/gdbserver/win32-i386-low.c", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Ada", "bytes": "252822" }, { "name": "Assembly", "bytes": "11210154" }, { "name": "Awk", "bytes": "6556" }, { "name": "Batchfile", "bytes": "79841" }, { "name": "C", "bytes": "92554796" }, { "name": "C++", "bytes": "29411093" }, { "name": "CSS", "bytes": "96602" }, { "name": "D", "bytes": "12894" }, { "name": "DIGITAL Command Language", "bytes": "17168" }, { "name": "DTrace", "bytes": "32201" }, { "name": "Emacs Lisp", "bytes": "3647" }, { "name": "FORTRAN", "bytes": "15411" }, { "name": "Go", "bytes": "2202" }, { "name": "Groff", "bytes": "2159080" }, { "name": "HTML", "bytes": "14351037" }, { "name": "Haskell", "bytes": "519183" }, { "name": "Java", "bytes": "9276960" }, { "name": "JavaScript", "bytes": "49539" }, { "name": "Lex", "bytes": "16562" }, { "name": "Logos", "bytes": "184506" }, { "name": "Makefile", "bytes": "1431247" }, { "name": "Objective-C", "bytes": "139451" }, { "name": "Pascal", "bytes": "3521" }, { "name": "Perl", "bytes": "180326" }, { "name": "Python", "bytes": "305456" }, { "name": "R", "bytes": "54" }, { "name": "Scheme", "bytes": "2254611" }, { "name": "Scilab", "bytes": "2316184" }, { "name": "Shell", "bytes": "2184639" }, { "name": "TeX", "bytes": "318429" }, { "name": "XSLT", "bytes": "152406" }, { "name": "Yacc", "bytes": "430581" } ], "symlink_target": "" }
package net.sourceforge.myvd.test.router; import java.util.ArrayList; import java.util.Properties; import junit.framework.TestCase; import net.sourceforge.myvd.chain.AddInterceptorChain; import net.sourceforge.myvd.chain.BindInterceptorChain; import net.sourceforge.myvd.chain.CompareInterceptorChain; import net.sourceforge.myvd.chain.DeleteInterceptorChain; import net.sourceforge.myvd.chain.ExetendedOperationInterceptorChain; import net.sourceforge.myvd.chain.ModifyInterceptorChain; import net.sourceforge.myvd.chain.PostSearchCompleteInterceptorChain; import net.sourceforge.myvd.chain.PostSearchEntryInterceptorChain; import net.sourceforge.myvd.chain.RenameInterceptorChain; import net.sourceforge.myvd.chain.SearchInterceptorChain; import net.sourceforge.myvd.core.NameSpace; import net.sourceforge.myvd.inserts.Insert; import net.sourceforge.myvd.types.Attribute; import net.sourceforge.myvd.types.Bool; import net.sourceforge.myvd.types.DistinguishedName; import net.sourceforge.myvd.types.Entry; import net.sourceforge.myvd.types.ExtendedOperation; import net.sourceforge.myvd.types.Filter; import net.sourceforge.myvd.types.Int; import net.sourceforge.myvd.types.Password; import net.sourceforge.myvd.types.Results; import com.novell.ldap.LDAPAttribute; import com.novell.ldap.LDAPConstraints; import com.novell.ldap.LDAPEntry; import com.novell.ldap.LDAPException; import com.novell.ldap.LDAPModification; import com.novell.ldap.LDAPSearchConstraints; public class TestglobalChain extends TestCase implements Insert { public void testdonothing() { } String name; public void configure(String name, Properties props, NameSpace nameSpace) throws LDAPException { // TODO Auto-generated method stub this.name = name; } public void add(AddInterceptorChain chain, Entry entry, LDAPConstraints constraints) throws LDAPException { entry = new Entry(new LDAPEntry(entry.getEntry().getDN() + ",c=us",entry.getEntry().getAttributeSet())); chain.nextAdd(entry,constraints); } public void bind(BindInterceptorChain chain, DistinguishedName dn, Password pwd, LDAPConstraints constraints) throws LDAPException { dn = new DistinguishedName(dn.getDN().toString() + ",c=us"); chain.nextBind(dn,pwd,constraints); } public void compare(CompareInterceptorChain chain, DistinguishedName dn, Attribute attrib, LDAPConstraints constraints) throws LDAPException { dn = new DistinguishedName(dn.getDN().toString() + ",c=us"); chain.nextCompare(dn,attrib,constraints); } public void delete(DeleteInterceptorChain chain, DistinguishedName dn, LDAPConstraints constraints) throws LDAPException { dn = new DistinguishedName(dn.getDN().toString() + ",c=us"); chain.nextDelete(dn,constraints); } public void extendedOperation(ExetendedOperationInterceptorChain chain, ExtendedOperation op, LDAPConstraints constraints) throws LDAPException { chain.nextExtendedOperations(op,constraints); } public void modify(ModifyInterceptorChain chain, DistinguishedName dn, ArrayList<LDAPModification> mods, LDAPConstraints constraints) throws LDAPException { dn = new DistinguishedName(dn.getDN().toString() + ",c=us"); chain.nextModify(dn,mods,constraints); } public void search(SearchInterceptorChain chain, DistinguishedName base, Int scope, Filter filter, ArrayList<Attribute> attributes, Bool typesOnly, Results results, LDAPSearchConstraints constraints) throws LDAPException { if (base.getDN().getRDNs().size() > 0) { base = new DistinguishedName(base.getDN().toString() + ",c=us"); } chain.nextSearch(base,scope,filter,attributes,typesOnly,results,constraints); } public void rename(RenameInterceptorChain chain, DistinguishedName dn, DistinguishedName newRdn, Bool deleteOldRdn, LDAPConstraints constraints) throws LDAPException { chain.getRequest().put("ISRENAME","ISRENAME"); dn = new DistinguishedName(dn.getDN().toString() + ",c=us"); chain.nextRename(dn,newRdn,deleteOldRdn,constraints); } public void rename(RenameInterceptorChain chain, DistinguishedName dn, DistinguishedName newRdn, DistinguishedName newParentDN, Bool deleteOldRdn, LDAPConstraints constraints) throws LDAPException { chain.getRequest().put("ISRENAME","ISRENAME"); dn = new DistinguishedName(dn.getDN().toString() + ",c=us"); chain.nextRename(dn,newRdn,newParentDN,deleteOldRdn,constraints); } public void postSearchEntry(PostSearchEntryInterceptorChain chain, Entry entry, DistinguishedName base, Int scope, Filter filter, ArrayList<Attribute> attributes, Bool typesOnly, LDAPSearchConstraints constraints) throws LDAPException { if (! chain.getRequest().containsKey("ISRENAME")) { entry.getEntry().getAttributeSet().add(new LDAPAttribute("globalTestAttrib","globalTestVal")); } chain.nextPostSearchEntry(entry,base,scope,filter,attributes,typesOnly,constraints); } public void postSearchComplete(PostSearchCompleteInterceptorChain chain, DistinguishedName base, Int scope, Filter filter, ArrayList<Attribute> attributes, Bool typesOnly, LDAPSearchConstraints constraints) throws LDAPException { chain.nextPostSearchComplete(base,scope,filter,attributes,typesOnly,constraints); } public String getName() { return this.name; } public void shutdown() { // TODO Auto-generated method stub } }
{ "content_hash": "e711fe6768266c9ece7b70f6e278dddb", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 106, "avg_line_length": 34.19108280254777, "alnum_prop": 0.7889344262295082, "repo_name": "TremoloSecurity/MyVirtualDirectory", "id": "7075588ce871a6b00ad3917e29852b01cda7544e", "size": "5976", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "server/src/test/java/net/sourceforge/myvd/test/router/TestglobalChain.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "64532" }, { "name": "Java", "bytes": "3930003" }, { "name": "Python", "bytes": "2126" }, { "name": "Shell", "bytes": "68752" } ], "symlink_target": "" }
// // SSLinkedInShareContentEntity.h // LinkedInConnection // // Created by vimfung on 13-10-26. // Copyright (c) 2013年 掌淘科技. All rights reserved. // #import <Foundation/Foundation.h> #import <ShareSDK/ShareSDKPlugin.h> /** * @brief 分享内容实体 */ @interface SSLinkedInShareContentEntity : NSObject <ISSPlatformShareContentEntity, NSCoding> { @private NSMutableDictionary *_dict; } /** * @brief 内容 */ @property (nonatomic,copy) NSString *comment; /** * @brief 标题 */ @property (nonatomic,copy) NSString *title; /** * @brief 描述 */ @property (nonatomic,copy) NSString *description; /** * @brief 链接 */ @property (nonatomic,copy) NSString *url; /** * @brief 图片 */ @property (nonatomic,retain) id<ISSCAttachment> image; /** * @brief 可见性 */ @property (nonatomic,copy) NSString *visibility; /** * @brief 通过分享内容解析实体数据 * * @param content 分享内容 */ - (void)parseWithContent:(id<ISSContent>)content; @end
{ "content_hash": "b56f921ef805f15968600b4e696ef60e", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 82, "avg_line_length": 16.54237288135593, "alnum_prop": 0.6444672131147541, "repo_name": "zhwe130205/iOS_NewsReader", "id": "b4194d238e51adf406773e7003e9d359283438cd", "size": "1056", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "iOS_新闻阅读/ShareSDK/Connection/LinkedInConnection.framework/Headers/SSLinkedInShareContentEntity.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "18224" }, { "name": "C++", "bytes": "5930" }, { "name": "Objective-C", "bytes": "1280268" } ], "symlink_target": "" }
package herddb.model; public class ColumnTypesTest { }
{ "content_hash": "b3c29d1918526e17b656eff2ecc0b424", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 30, "avg_line_length": 9.666666666666666, "alnum_prop": 0.7586206896551724, "repo_name": "diennea/herddb", "id": "36fe7e8cb5f43486ca7c298142fb88d76af678eb", "size": "814", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "herddb-core/src/test/java/herddb/model/ColumnTypesTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "2721" }, { "name": "CSS", "bytes": "125107" }, { "name": "HTML", "bytes": "28704" }, { "name": "Java", "bytes": "5714205" }, { "name": "JavaScript", "bytes": "29064" }, { "name": "Shell", "bytes": "40921" }, { "name": "TSQL", "bytes": "938" } ], "symlink_target": "" }
<?php namespace TYPO3\CMS\Fluid\ViewHelpers\Be\Menus; /* * * This script is backported from the TYPO3 Flow package "TYPO3.Fluid". * * * * It is free software; you can redistribute it and/or modify it under * * the terms of the GNU Lesser General Public License, either version 3 * * of the License, or (at your option) any later version. * * * * * * This script is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- * * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser * * General Public License for more details. * * * * You should have received a copy of the GNU Lesser General Public * * License along with the script. * * If not, see http://www.gnu.org/licenses/lgpl.html * * * * The TYPO3 project - inspiring people to share! * * */ /** * View helper which returns an option tag. * This view helper only works in conjunction with \TYPO3\CMS\Fluid\ViewHelpers\Be\Menus\ActionMenuViewHelper * Note: This view helper is experimental! * * = Examples = * * <code title="Simple"> * <f:be.menus.actionMenu> * <f:be.menus.actionMenuItem label="Overview" controller="Blog" action="index" /> * <f:be.menus.actionMenuItem label="Create new Blog" controller="Blog" action="new" /> * <f:be.menus.actionMenuItem label="List Posts" controller="Post" action="index" arguments="{blog: blog}" /> * </f:be.menus.actionMenu> * </code> * <output> * Selectbox with the options "Overview", "Create new Blog" and "List Posts" * </output> * * <code title="Localized"> * <f:be.menus.actionMenu> * <f:be.menus.actionMenuItem label="{f:translate(key='overview')}" controller="Blog" action="index" /> * <f:be.menus.actionMenuItem label="{f:translate(key='create_blog')}" controller="Blog" action="new" /> * </f:be.menus.actionMenu> * </code> * <output> * localized selectbox * <output> */ class ActionMenuItemViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper { /** * @var string */ protected $tagName = 'option'; /** * Renders an ActionMenu option tag * * @param string $label label of the option tag * @param string $controller controller to be associated with this ActionMenuItem * @param string $action the action to be associated with this ActionMenuItem * @param array $arguments additional controller arguments to be passed to the action when this ActionMenuItem is selected * @return string the rendered option tag * @see \TYPO3\CMS\Fluid\ViewHelpers\Be\Menus\ActionMenuViewHelper */ public function render($label, $controller, $action, array $arguments = []) { $uriBuilder = $this->controllerContext->getUriBuilder(); $uri = $uriBuilder->reset()->uriFor($action, $arguments, $controller); $this->tag->addAttribute('value', $uri); $currentRequest = $this->controllerContext->getRequest(); $currentController = $currentRequest->getControllerName(); $currentAction = $currentRequest->getControllerActionName(); if ($action === $currentAction && $controller === $currentController) { $this->tag->addAttribute('selected', 'selected'); } $this->tag->setContent($label); return $this->tag->render(); } }
{ "content_hash": "464f297222fc0843b585ee35ae80e17b", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 126, "avg_line_length": 48.426829268292686, "alnum_prop": 0.5691261646940318, "repo_name": "ahmedRguei/blogTypo", "id": "9967ca9075bcd308da204a733b30f4f78907b879", "size": "3971", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "typo3/sysext/fluid/Classes/ViewHelpers/Be/Menus/ActionMenuItemViewHelper.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "3425" }, { "name": "CSS", "bytes": "1591892" }, { "name": "HTML", "bytes": "617019" }, { "name": "JavaScript", "bytes": "3011598" }, { "name": "PHP", "bytes": "25967799" }, { "name": "PLpgSQL", "bytes": "3957" }, { "name": "Shell", "bytes": "7244" }, { "name": "Smarty", "bytes": "302" }, { "name": "TypeScript", "bytes": "122147" }, { "name": "XSLT", "bytes": "27654" } ], "symlink_target": "" }
import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'csfrd' copyright = u'2014, cSFR Team' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '0.1.0' # The full version, including alpha/beta/rc tags. release = '0.1.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # "<project> v<release> documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a <link> tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'csfrddoc' # -- Options for LaTeX output -------------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'csfrd.tex', u'csfrd Documentation', u'cSFR Team', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'csfrd', u'csfrd Documentation', [u'SFRDirect Team'], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------------ # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'csfrd', u'csfrd Documentation', u'SFRDirect Team', 'csfrd', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote'
{ "content_hash": "53b44d97e027cc0ccc135dbd37c08391", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 80, "avg_line_length": 31.82532751091703, "alnum_prop": 0.6999176728869374, "repo_name": "saffroncoin/csfrd", "id": "6c7af3408457b54f6219fd4732ab7e0451915af3", "size": "7704", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/conf.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "364358" } ], "symlink_target": "" }
date: "2020-03-19T19:27:00+02:00" title: "Installation with Docker" slug: "install-with-docker" weight: 10 toc: true draft: false menu: sidebar: parent: "installation" name: "With Docker" weight: 10 identifier: "install-with-docker" --- # Installation with Docker Gitea provides automatically updated Docker images within its Docker Hub organization. It is possible to always use the latest stable tag or to use another service that handles updating Docker images. This reference setup guides users through the setup based on `docker-compose`, but the installation of `docker-compose` is out of scope of this documentation. To install `docker-compose` itself, follow the official [install instructions](https://docs.docker.com/compose/install/). ## Basics The most simple setup just creates a volume and a network and starts the `gitea/gitea:latest` image as a service. Since there is no database available, one can be initialized using SQLite3. Create a directory like `gitea` and paste the following content into a file named `docker-compose.yml`. Note that the volume should be owned by the user/group with the UID/GID specified in the config file. If you don't give the volume correct permissions, the container may not start. Also be aware that the tag `:latest` will install the current development version. For a stable release you can use `:1` or specify a certain release like `:{{< version >}}`. ```yaml version: "3" networks: gitea: external: false services: server: image: gitea/gitea:latest container_name: gitea environment: - USER_UID=1000 - USER_GID=1000 restart: always networks: - gitea volumes: - ./gitea:/data - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro ports: - "3000:3000" - "222:22" ``` ## Custom port To bind the integrated openSSH daemon and the webserver on a different port, adjust the port section. It's common to just change the host port and keep the ports within the container like they are. ```diff version: "3" networks: gitea: external: false services: server: image: gitea/gitea:latest container_name: gitea environment: - USER_UID=1000 - USER_GID=1000 restart: always networks: - gitea volumes: - ./gitea:/data - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro ports: - - "3000:3000" - - "222:22" + - "8080:3000" + - "2221:22" ``` ## MySQL database To start Gitea in combination with a MySQL database, apply these changes to the `docker-compose.yml` file created above. ```diff version: "3" networks: gitea: external: false services: server: image: gitea/gitea:latest container_name: gitea environment: - USER_UID=1000 - USER_GID=1000 + - DB_TYPE=mysql + - DB_HOST=db:3306 + - DB_NAME=gitea + - DB_USER=gitea + - DB_PASSWD=gitea restart: always networks: - gitea volumes: - ./gitea:/data - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro ports: - "3000:3000" - "222:22" + depends_on: + - db + + db: + image: mysql:5.7 + restart: always + environment: + - MYSQL_ROOT_PASSWORD=gitea + - MYSQL_USER=gitea + - MYSQL_PASSWORD=gitea + - MYSQL_DATABASE=gitea + networks: + - gitea + volumes: + - ./mysql:/var/lib/mysql ``` ## PostgreSQL database To start Gitea in combination with a PostgreSQL database, apply these changes to the `docker-compose.yml` file created above. ```diff version: "3" networks: gitea: external: false services: server: image: gitea/gitea:latest container_name: gitea environment: - USER_UID=1000 - USER_GID=1000 + - DB_TYPE=postgres + - DB_HOST=db:5432 + - DB_NAME=gitea + - DB_USER=gitea + - DB_PASSWD=gitea restart: always networks: - gitea volumes: - ./gitea:/data - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro ports: - "3000:3000" - "222:22" + depends_on: + - db + + db: + image: postgres:9.6 + restart: always + environment: + - POSTGRES_USER=gitea + - POSTGRES_PASSWORD=gitea + - POSTGRES_DB=gitea + networks: + - gitea + volumes: + - ./postgres:/var/lib/postgresql/data ``` ## Named volumes To use named volumes instead of host volumes, define and use the named volume within the `docker-compose.yml` configuration. This change will automatically create the required volume. You don't need to worry about permissions with named volumes; Docker will deal with that automatically. ```diff version: "3" networks: gitea: external: false +volumes: + gitea: + driver: local + services: server: image: gitea/gitea:latest container_name: gitea restart: always networks: - gitea volumes: - - ./gitea:/data + - gitea:/data - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro ports: - "3000:3000" - "222:22" ``` MySQL or PostgreSQL containers will need to be created separately. ## Start To start this setup based on `docker-compose`, execute `docker-compose up -d`, to launch Gitea in the background. Using `docker-compose ps` will show if Gitea started properly. Logs can be viewed with `docker-compose logs`. To shut down the setup, execute `docker-compose down`. This will stop and kill the containers. The volumes will still exist. Notice: if using a non-3000 port on http, change app.ini to match `LOCAL_ROOT_URL = http://localhost:3000/`. ## Install After starting the Docker setup via `docker-compose`, Gitea should be available using a favorite browser to finalize the installation. Visit http://server-ip:3000 and follow the installation wizard. If the database was started with the `docker-compose` setup as documented above, please note that `db` must be used as the database hostname. ## Environments variables You can configure some of Gitea's settings via environment variables: (Default values are provided in **bold**) * `APP_NAME`: **"Gitea: Git with a cup of tea"**: Application name, used in the page title. * `RUN_MODE`: **dev**: For performance and other purposes, change this to `prod` when deployed to a production environment. * `DOMAIN`: **localhost**: Domain name of this server, used for the displayed http clone URL in Gitea's UI. * `SSH_DOMAIN`: **localhost**: Domain name of this server, used for the displayed ssh clone URL in Gitea's UI. If the install page is enabled, SSH Domain Server takes DOMAIN value in the form (which overwrite this setting on save). * `SSH_PORT`: **22**: SSH port displayed in clone URL. * `SSH_LISTEN_PORT`: **%(SSH\_PORT)s**: Port for the built-in SSH server. * `DISABLE_SSH`: **false**: Disable SSH feature when it's not available. If you want to disable SSH feature, you should set SSH port to `0` when installing Gitea. * `HTTP_PORT`: **3000**: HTTP listen port. * `ROOT_URL`: **""**: Overwrite the automatically generated public URL. This is useful if the internal and the external URL don't match (e.g. in Docker). * `LFS_START_SERVER`: **false**: Enables git-lfs support. * `DB_TYPE`: **sqlite3**: The database type in use \[mysql, postgres, mssql, sqlite3\]. * `DB_HOST`: **localhost:3306**: Database host address and port. * `DB_NAME`: **gitea**: Database name. * `DB_USER`: **root**: Database username. * `DB_PASSWD`: **"\<empty>"**: Database user password. Use \`your password\` for quoting if you use special characters in the password. * `INSTALL_LOCK`: **false**: Disallow access to the install page. * `SECRET_KEY`: **""**: Global secret key. This should be changed. If this has a value and `INSTALL_LOCK` is empty, `INSTALL_LOCK` will automatically set to `true`. * `DISABLE_REGISTRATION`: **false**: Disable registration, after which only admin can create accounts for users. * `REQUIRE_SIGNIN_VIEW`: **false**: Enable this to force users to log in to view any page. * `USER_UID`: **1000**: The UID (Unix user ID) of the user that runs Gitea within the container. Match this to the UID of the owner of the `/data` volume if using host volumes (this is not necessary with named volumes). * `USER_GID`: **1000**: The GID (Unix group ID) of the user that runs Gitea within the container. Match this to the GID of the owner of the `/data` volume if using host volumes (this is not necessary with named volumes). # Customization Customization files described [here](https://docs.gitea.io/en-us/customizing-gitea/) should be placed in `/data/gitea` directory. If using host volumes, it's quite easy to access these files; for named volumes, this is done through another container or by direct access at `/var/lib/docker/volumes/gitea_gitea/_data`. The configuration file will be saved at `/data/gitea/conf/app.ini` after the installation. # Upgrading :exclamation::exclamation: **Make sure you have volumed data to somewhere outside Docker container** :exclamation::exclamation: To upgrade your installation to the latest release: ``` # Edit `docker-compose.yml` to update the version, if you have one specified # Pull new images docker-compose pull # Start a new container, automatically removes old one docker-compose up -d ``` # SSH Container Passthrough Since SSH is running inside the container, you'll have to pass SSH from the host to the container if you wish to use SSH support. If you wish to do this without running the container SSH on a non-standard port (or move your host port to a non-standard port), you can forward SSH connections destined for the container with a little extra setup. This guide assumes that you have created a user on the host called `git` which shares the same UID/GID as the container values `USER_UID`/`USER_GID`. You should also create the directory `/var/lib/gitea` on the host, owned by the `git` user and mounted in the container, e.g. ``` version: "3" services: server: image: gitea/gitea:latest container_name: gitea environment: - USER_UID=1000 - USER_GID=1000 restart: always networks: - gitea volumes: - /var/lib/gitea:/data - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro ports: - "3000:3000" - "127.0.0.1:2222:22" ``` You can see that we're also exposing the container SSH port to port 2222 on the host, and binding this to 127.0.0.1 to prevent it being accessible external to the host machine itself. On the **host**, you should create the file `/app/gitea/gitea` with the following contents and make it executable (`chmod +x /app/gitea/gitea`): ``` #!/bin/sh ssh -p 2222 -o StrictHostKeyChecking=no git@127.0.0.1 "SSH_ORIGINAL_COMMAND=\"$SSH_ORIGINAL_COMMAND\" $0 $@" ``` Your `git` user needs to have an SSH key generated: ``` sudo -u git ssh-keygen -t rsa -b 4096 -C "Gitea Host Key" ``` Now, proceed with one of the points given below: - symlink the container `.ssh/authorized_keys` file to your git user `.ssh/authorized_keys`. This can be done on the host as the `/var/lib/gitea` directory is mounted inside the container under `/data`: ``` ln -s /var/lib/gitea/git/.ssh/authorized_keys /home/git/.ssh/authorized_keys ``` Then echo the `git` user SSH key into the authorized_keys file so the host can talk to the container over SSH: ``` echo "no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty $(cat /home/git/.ssh/id_rsa.pub)" >> /var/lib/gitea/git/.ssh/authorized_keys ``` Lastly, Gitea makes `authorized_keys` backups by default. This could be a problem as the symbolic link made to `authorized_keys` previously could end up pointing to an old backup. To resolve this, please put the following into your Gitea config: ``` [ssh] SSH_AUTHORIZED_KEYS_BACKUP=false ``` - mount your `.ssh` directory directly into the container i.e. add the following to the `volumes` section of your Docker container config: ``` - /home/git/.ssh/:/data/git/.ssh/ ``` Now you should be able to use Git over SSH to your container without disrupting SSH access to the host. Please note: SSH container passthrough will work only if using opensshd in container, and will not work if `AuthorizedKeysCommand` is used in combination with setting `SSH_CREATE_AUTHORIZED_KEYS_FILE=false` to disable authorized files key generation.
{ "content_hash": "dbcea05f69bfed847eb059c044036a7c", "timestamp": "", "source": "github", "line_count": 387, "max_line_length": 231, "avg_line_length": 32.26614987080104, "alnum_prop": 0.6958436774245215, "repo_name": "sapk-fork/gitea", "id": "8773e34872d9abfcd52fad93a592ee40bf648288", "size": "12491", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/content/doc/installation/with-docker.en-us.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "156527" }, { "name": "Dockerfile", "bytes": "1253" }, { "name": "Go", "bytes": "4805825" }, { "name": "JavaScript", "bytes": "122408" }, { "name": "Makefile", "bytes": "25655" }, { "name": "Perl", "bytes": "36597" }, { "name": "Roff", "bytes": "164" }, { "name": "Shell", "bytes": "357092" }, { "name": "TSQL", "bytes": "117" }, { "name": "Vue", "bytes": "3220" } ], "symlink_target": "" }
<?php declare(strict_types=1); namespace Eelly\SDK\EellyOldCode\Api\Store\ServiceTools; use Eelly\SDK\EellyClient; /** * Class ServiceTools. * * modules/Store/Service/ServiceTools * * @author sunanzhi <sunanzhi@hotmail.com> */ class StUserTools { /** * 插入增值服务用户与工具关系. * * @param int $userId 用户id * @param int $tId 工具类型 * @param int $aId 工具价格类型 * @param int $expireTime 到期时间 * @param string $desc 描述 * @param array $extends 拓展使用 * * @author sunanzhi <sunanzhi@hotmail.com> * * @since 2019.3.6 */ public function addStUserToolsV2($userId, $tId, $aId, $expireTime, $desc = '', $extends = []) { return EellyClient::request('eellyOldCode/store/ServiceTools/StUserTools', __FUNCTION__, true, $userId, $tId, $aId, $expireTime, $desc, $extends); } /** * 赠送工具,只会赠送数量. * * @param $userId * @param $adminName * @param $tId * @param int $aId 工具子表id * @param $des * @param $gsId * @param $timeNumber 时间单位 * @param array $extensions 其他信息 * * @return array */ public function giveUserSetupSave($userId, $adminName, $tId, $aId, $des, $gsId = 0, $timeNumber = 0, array $extensions = []) { return EellyClient::request('eellyOldCode/store/ServiceTools/StUserTools', __FUNCTION__, true, $userId, $adminName, $tId, $aId, $des, $gsId, $timeNumber, $extensions); } /** * 获取店铺开通的vip有效信息. * * @param array $storeIds 店铺id * * @return array * * @author wangjiang<wangjiang@eelly.net> * * @since 2018年3月29日 */ public function getStoreVipValidInfo(array $storeIds) { return EellyClient::request('eellyOldCode/store/ServiceTools/StUserTools', __FUNCTION__, true, $storeIds); } /** * 检验用户增值服务工具是否过期 * * @param int $userId 用户id * @param string $toolsName 工具名称 * * @author wechan<liweiquan@eelly.net> * * @since 2017年12月01日 */ public function checkToolsIsOverTime($userId, $toolsName) { return EellyClient::request('eellyOldCode/store/ServiceTools/StUserTools', __FUNCTION__, true, $userId, $toolsName); } public static function isValidUserTool(int $userId, string $enName) { return EellyClient::requestJson('eellyOldCode/store/ServiceTools/StUserTools', __FUNCTION__, [ 'userId' => $userId, 'enName' => $enName ]); } }
{ "content_hash": "4d944aaa1996b68cfadaceac0a3f1b6d", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 175, "avg_line_length": 26.53684210526316, "alnum_prop": 0.5910353034510115, "repo_name": "EellyDev/eelly-sdk-php", "id": "a4ee3e51884fbb16b57c9aad0450579007aa68c8", "size": "2910", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/SDK/EellyOldCode/Api/Store/ServiceTools/StUserTools.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "4569960" } ], "symlink_target": "" }
module GameJam { export class Level1 extends Phaser.State { background: Phaser.Sprite; music: Phaser.Sound; player: GameJam.Player; blockedLayer: Phaser.TilemapLayer; map: Phaser.Tilemap; backgroundlayer: Phaser.TilemapLayer; enemies: Phaser.Group; create() { this.map = this.game.add.tilemap('level1Tiles'); this.map.addTilesetImage('tiles_spritesheet', 'gameTiles'); this.backgroundlayer = this.map.createLayer('backgroundLayer'); this.blockedLayer = this.map.createLayer('blockedLayer'); this.map.setCollisionBetween(1, 100000, true, 'blockedLayer'); this.backgroundlayer.resizeWorld(); this.game.physics.startSystem(Phaser.Physics.ARCADE); this.game.physics.arcade.checkCollision.down = false; this.player = new Player(this.game, 60, this.game.world.height - 150); this.enemies = this.game.add.group(); this.enemies.enableBody = true; this.enemies.physicsBodyType = Phaser.Physics.ARCADE; this.player.events.onOutOfBounds.add(this.killPlayer, this); this.enemies.add(new BananaEnemy(this.game, 160, this.game.world.height - 200)); this.enemies.add(new Tomato(this.game, 100, this.game.world.height - 180)); this.enemies.add(new Onion(this.game, 200, this.game.world.height - 260)); this.enemies.add(new Cherry(this.game, 250, this.game.world.height - 260)); this.enemies.add(new Celery(this.game, 280, this.game.world.height - 260)); this.game.add.existing(this.enemies); this.game.camera.follow(this.player); } killPlayer() { // TODO: Show game over screen. Stop Movement. this.input.disabled = true; } onHit(damage) { if (!this.player.invincible) { //We only damage the player if not invincible this.player.health -= damage; //we toggle invincibility this.toggleInvincible(); //and then we add a timer to restore the player to a vulnerable state this.game.time.events.add(2000, this.toggleInvincible, this); } } toggleInvincible() { this.player.invincible = !this.player.invincible; } playerHit() { this.onHit(1); } enemyHit(obj1, obj2: BananaEnemy) { //obj1.destroy(); if (obj2.hitPoints <= 0) { obj2.destroy(); } else { obj2.hitPoints--; } } update() { this.game.physics.arcade.collide(this.player, this.blockedLayer, null, null, this); this.game.physics.arcade.collide(this.player, this.enemies, this.playerHit, null, this); this.game.physics.arcade.collide(this.player.bullets, this.enemies, this.enemyHit, null, this); this.game.physics.arcade.collide(this.enemies, this.blockedLayer, null, null, this); } } }
{ "content_hash": "073c318b0b78266c7707de4fa402eadd", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 107, "avg_line_length": 38.77777777777778, "alnum_prop": 0.5861190703597581, "repo_name": "drasticactions/GameJamProject", "id": "24be8be87075fb899ef719a12361cbc0e2e22eb4", "size": "3143", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "GameJamProject/Level1.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "87" }, { "name": "HTML", "bytes": "374" }, { "name": "JavaScript", "bytes": "2763110" }, { "name": "TypeScript", "bytes": "20010" } ], "symlink_target": "" }
using Omu.ValueInjecter; using OnlineLibrary.Areas.Admin.Models; using OnlineLibrary.Data.Entities; using OnlineLibrary.Domain.Entities; using OnlineLibrary.Models; using OnlineLibrary.Classes; using OnlineLibrary.Services; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Web; using System.Web.Mvc; namespace OnlineLibrary.Areas.Admin.Controllers { public class DashBoardController : Controller { const int pageSize = 10; public IBookService service { get; set; } public DashBoardController(IBookService service) { this.service = service; } [RoleAuthorization("Admin")] public ActionResult Index(string searchString) { List<BookViewModel> booksList = new List<BookViewModel>(); var booksDbList = service.GetAllRecords(); booksList.InjectFrom(booksDbList); for (var i = 0; i < booksList.Count; i++) { booksList[i].Author = booksDbList[i].Author.FullName; booksList[i].Category = booksDbList[i].Category.Category; booksList[i].Publishing = booksDbList[i].Publishing.Publishing; } var model = booksList; if (searchString != null) { int yearParsed = 0; //string searchString = Session["searchString"].ToString(); bool isNumeric = int.TryParse(searchString, out yearParsed); string searchStringLower = searchString.ToLower(); var booksListSearch = booksList.Where(x => x.Title.ToLower().Contains(searchStringLower) || x.Category.ToLower().Contains(searchStringLower) || x.Author.ToLower().Contains(searchStringLower) || x.ISBN.ToLower().Contains(searchStringLower) || x.Publishing.ToLower().Contains(searchStringLower) || x.Year == yearParsed); model = booksListSearch.ToList(); } return View(model); } public ActionResult Add() { AdminBookModel addBook = new AdminBookModel(); BookStoreEntities model = new BookStoreEntities(); addBook.Authors = new SelectList(model.Authors.OrderBy(m => m.LastName), "ID", "FullName"); addBook.Categories = new SelectList(model.Categories.OrderBy(m => m.Category), "ID", "Category"); addBook.Publishings = new SelectList(model.Publishings.OrderBy(m => m.Publishing), "ID", "Publishing"); //ViewBag.AuthorID = new SelectList(model.Authors.OrderBy(m=>m.LastName), "ID", "FullName"); //ViewBag.CategoriesID = new SelectList(model.Categories.OrderBy(m => m.Category), "ID", "Category"); //ViewBag.PublishingsID = new SelectList(model.Publishings.OrderBy(m => m.Publishing), "ID", "Publishing"); return View(addBook); } [HttpPost] public ActionResult Add(AdminBookModel model) { try { if (ModelState.IsValid) { Books newBook = new Books(); newBook.InjectFrom(model); if (newBook.File != null) { var fileName = Path.GetFileName(newBook.File.FileName); var path = Path.Combine(Server.MapPath("~/images"), fileName); newBook.File.SaveAs(path); newBook.imageURL = "../../images/" + fileName; } else { newBook.imageURL = "../../images/default.png"; } service.CreateBook(newBook); } return RedirectToAction("Index"); } catch { return View(); } } public ActionResult Edit(int? id) { if (id == null) { ViewBag.ErrorMsg = "Error. Book not exist"; ViewBag.ToController = "DashBoard"; return View("NotFound"); } Books books = service.GetAllRecords().Find(b => b.ID == id); if (books == null) { ViewBag.ErrorMsg = "Error. Book not exist"; ViewBag.ToController = "DashBoard"; return View("NotFound"); } AdminBookModel editBook = new AdminBookModel(); editBook.InjectFrom(books); BookStoreEntities model = new BookStoreEntities(); editBook.Authors = new SelectList(model.Authors.OrderBy(m => m.LastName), "ID", "FullName"); editBook.Categories = new SelectList(model.Categories.OrderBy(m => m.Category), "ID", "Category"); editBook.Publishings = new SelectList(model.Publishings.OrderBy(m => m.Publishing), "ID", "Publishing"); return View("Edit", editBook); } [HttpPost] [ValidateAntiForgeryToken] public ActionResult Edit(AdminBookModel model) { try { if (ModelState.IsValid) { Books newBook = new Books(); newBook.InjectFrom(model); if (newBook.File != null) { var fileName = Path.GetFileName(newBook.File.FileName); var path = Path.Combine(Server.MapPath("~/images"), fileName); newBook.File.SaveAs(path); newBook.imageURL = "../../images/" + fileName; } service.EditBook(newBook); } return RedirectToAction("Index"); } catch { return View(); } } public ActionResult Details(int? id) { if (id == null) { ViewBag.ErrorMsg = "Error. Book not exist"; ViewBag.ToController = "DashBoard"; return View("NotFound"); } Books books = service.GetAllRecords().Find(b => b.ID == id); if (books == null) { ViewBag.ErrorMsg = "Error. Book not exist"; ViewBag.ToController = "DashBoard"; return View("NotFound"); } BookViewModel model = new BookViewModel(); model.InjectFrom(books); model.Author = books.Author.FullName; model.Category = books.Category.Category; model.Publishing = books.Publishing.Publishing; model.Availability = books.NoOfBooks - books.Loans.Where(l => l.BookID == books.ID).Count(); model.AvailabilityDate = (books.Loans.Where(l => l.BookID == books.ID).Count() != 0) ? books.Loans.Where(l => l.BookID == books.ID).OrderBy(l => l.loanDate).First().loanDate.ToString("dd-MM-yyyy") : ""; return View(model); } public ActionResult Delete(int? id) { if (id == null) { ViewBag.ErrorMsg = "Error. Book not exist"; ViewBag.ToController = "DashBoard"; return View("NotFound"); } Books books = service.GetAllRecords().Find(b => b.ID == id); if (books == null) { ViewBag.ErrorMsg = "Error. Book not exist"; ViewBag.ToController = "DashBoard"; return View("NotFound"); } BookViewModel model = new BookViewModel(); model.InjectFrom(books); model.Author = books.Author.FullName; model.Category = books.Category.Category; model.Publishing = books.Publishing.Publishing; return View(model); } [HttpPost, ActionName("Delete")] [ValidateAntiForgeryToken] public ActionResult DeleteConfirmed(int id) { Books book = service.GetAllRecords().Find(b => b.ID == id); service.DeleteBook(book); return RedirectToAction("Index"); } public JsonResult PopulateDropDown() { List<Books> allBooks = service.GetAllRecords(); var books = allBooks.Select(b => new { BookID = b.ID, Text = b.Title.Trim() + " - " + b.Author.FullName.Trim() }); return Json(books, JsonRequestBehavior.AllowGet); } } }
{ "content_hash": "a17469da781acbbc0462d1e8cd8452f6", "timestamp": "", "source": "github", "line_count": 249, "max_line_length": 136, "avg_line_length": 31.51004016064257, "alnum_prop": 0.5816976803466735, "repo_name": "iulianj/OnlineLibrary", "id": "c37616b1eb4e4d2ccc157678fa9bfbc66720aee5", "size": "7848", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "OnlineLibrary/Areas/Admin/Controllers/DashBoardController.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "104" }, { "name": "C#", "bytes": "262959" }, { "name": "CSS", "bytes": "17435" }, { "name": "HTML", "bytes": "5127" }, { "name": "JavaScript", "bytes": "479668" } ], "symlink_target": "" }
package org.gradle.logging; import org.gradle.api.logging.StandardOutputListener; public interface StandardOutputRedirector extends StandardOutputCapture { void redirectStandardOutputTo(StandardOutputListener stdOutDestination); void redirectStandardErrorTo(StandardOutputListener stdErrDestination); }
{ "content_hash": "966d99788e4f178bf4d4732c430e61c0", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 76, "avg_line_length": 28.727272727272727, "alnum_prop": 0.8544303797468354, "repo_name": "tkmnet/RCRS-ADF", "id": "048d8bd7966c53e12f6248bc295dc489d7c6e28e", "size": "931", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "gradle/gradle-2.1/src/core/org/gradle/logging/StandardOutputRedirector.java", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Assembly", "bytes": "277" }, { "name": "Batchfile", "bytes": "2394" }, { "name": "C", "bytes": "115742" }, { "name": "C++", "bytes": "4876" }, { "name": "CSS", "bytes": "104604" }, { "name": "GAP", "bytes": "176" }, { "name": "Groovy", "bytes": "1142351" }, { "name": "HTML", "bytes": "28618885" }, { "name": "Java", "bytes": "10250957" }, { "name": "JavaScript", "bytes": "190908" }, { "name": "Objective-C", "bytes": "698" }, { "name": "Objective-C++", "bytes": "442" }, { "name": "Scala", "bytes": "3073" }, { "name": "Shell", "bytes": "16330" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <HTML style="overflow:auto;"> <HEAD> <meta name="generator" content="JDiff v1.1.0"> <!-- Generated by the JDiff Javadoc doclet --> <!-- (http://www.jdiff.org) --> <meta name="description" content="JDiff is a Javadoc doclet which generates an HTML report of all the packages, classes, constructors, methods, and fields which have been removed, added or changed in any way, including their documentation, when two APIs are compared."> <meta name="keywords" content="diff, jdiff, javadiff, java diff, java difference, API difference, difference between two APIs, API diff, Javadoc, doclet"> <TITLE> android.telecom </TITLE> <link href="../../../../assets/android-developer-docs.css" rel="stylesheet" type="text/css" /> <link href="../stylesheet-jdiff.css" rel="stylesheet" type="text/css" /> <noscript> <style type="text/css"> body{overflow:auto;} #body-content{position:relative; top:0;} #doc-content{overflow:visible;border-left:3px solid #666;} #side-nav{padding:0;} #side-nav .toggle-list ul {display:block;} #resize-packages-nav{border-bottom:3px solid #666;} </style> </noscript> <style type="text/css"> </style> </HEAD> <BODY> <!-- Start of nav bar --> <a name="top"></a> <div id="header" style="margin-bottom:0;padding-bottom:0;"> <div id="headerLeft"> <a href="../../../../index.html" tabindex="-1" target="_top"><img src="../../../../assets/images/bg_logo.png" alt="Android Developers" /></a> </div> <div id="headerRight"> <div id="headerLinks"> <!-- <img src="/assets/images/icon_world.jpg" alt="" /> --> <span class="text"> <!-- &nbsp;<a href="#">English</a> | --> <nobr><a href="http://developer.android.com" target="_top">Android Developers</a> | <a href="http://www.android.com" target="_top">Android.com</a></nobr> </span> </div> <div class="and-diff-id" style="margin-top:6px;margin-right:8px;"> <table class="diffspectable"> <tr> <td colspan="2" class="diffspechead">API Diff Specification</td> </tr> <tr> <td class="diffspec" style="padding-top:.25em">To Level:</td> <td class="diffvaluenew" style="padding-top:.25em">23</td> </tr> <tr> <td class="diffspec">From Level:</td> <td class="diffvalueold">22</td> </tr> <tr> <td class="diffspec">Generated</td> <td class="diffvalue">2015.08.14 14:28</td> </tr> </table> </div><!-- End and-diff-id --> <div class="and-diff-id" style="margin-right:8px;"> <table class="diffspectable"> <tr> <td class="diffspec" colspan="2"><a href="jdiff_statistics.html">Statistics</a> </tr> </table> </div> <!-- End and-diff-id --> </div> <!-- End headerRight --> </div> <!-- End header --> <div id="body-content" xstyle="padding:12px;padding-right:18px;"> <div id="doc-content" style="position:relative;"> <div id="mainBodyFluid"> <H2> Package <A HREF="../../../../reference/android/telecom/package-summary.html" target="_top"><font size="+1"><code>android.telecom</code></font></A> </H2> <p> <a NAME="Added"></a> <TABLE summary="Added Classes" WIDTH="100%"> <TR> <TH VALIGN="TOP" COLSPAN=2>Added Classes</FONT></TD> </TH> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="Call"></A> <nobr><A HREF="../../../../reference/android/telecom/Call.html" target="_top"><code>Call</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="Call.Callback"></A> <nobr><A HREF="../../../../reference/android/telecom/Call.Callback.html" target="_top"><code>Call.Callback</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="Call.Details"></A> <nobr><A HREF="../../../../reference/android/telecom/Call.Details.html" target="_top"><code>Call.Details</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="CallAudioState"></A> <nobr><A HREF="../../../../reference/android/telecom/CallAudioState.html" target="_top"><code>CallAudioState</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="Conference"></A> <nobr><A HREF="../../../../reference/android/telecom/Conference.html" target="_top"><code>Conference</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="Conferenceable"></A> <nobr><A HREF="../../../../reference/android/telecom/Conferenceable.html" target="_top"><code>Conferenceable</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="Connection"></A> <nobr><A HREF="../../../../reference/android/telecom/Connection.html" target="_top"><code>Connection</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="Connection.VideoProvider"></A> <nobr><A HREF="../../../../reference/android/telecom/Connection.VideoProvider.html" target="_top"><code>Connection.VideoProvider</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="ConnectionRequest"></A> <nobr><A HREF="../../../../reference/android/telecom/ConnectionRequest.html" target="_top"><code>ConnectionRequest</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="ConnectionService"></A> <nobr><A HREF="../../../../reference/android/telecom/ConnectionService.html" target="_top"><code>ConnectionService</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="DisconnectCause"></A> <nobr><A HREF="../../../../reference/android/telecom/DisconnectCause.html" target="_top"><code>DisconnectCause</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="GatewayInfo"></A> <nobr><A HREF="../../../../reference/android/telecom/GatewayInfo.html" target="_top"><code>GatewayInfo</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="InCallService"></A> <nobr><A HREF="../../../../reference/android/telecom/InCallService.html" target="_top"><code>InCallService</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="InCallService.VideoCall"></A> <nobr><A HREF="../../../../reference/android/telecom/InCallService.VideoCall.html" target="_top"><code>InCallService.VideoCall</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="InCallService.VideoCall.Callback"></A> <nobr><A HREF="../../../../reference/android/telecom/InCallService.VideoCall.Callback.html" target="_top"><code>InCallService.VideoCall.<br>Callback</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="PhoneAccount"></A> <nobr><A HREF="../../../../reference/android/telecom/PhoneAccount.html" target="_top"><code>PhoneAccount</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="PhoneAccount.Builder"></A> <nobr><A HREF="../../../../reference/android/telecom/PhoneAccount.Builder.html" target="_top"><code>PhoneAccount.Builder</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="PhoneAccountHandle"></A> <nobr><A HREF="../../../../reference/android/telecom/PhoneAccountHandle.html" target="_top"><code>PhoneAccountHandle</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="RemoteConference"></A> <nobr><A HREF="../../../../reference/android/telecom/RemoteConference.html" target="_top"><code>RemoteConference</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="RemoteConference.Callback"></A> <nobr><A HREF="../../../../reference/android/telecom/RemoteConference.Callback.html" target="_top"><code>RemoteConference.Callback</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="RemoteConnection"></A> <nobr><A HREF="../../../../reference/android/telecom/RemoteConnection.html" target="_top"><code>RemoteConnection</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="RemoteConnection.Callback"></A> <nobr><A HREF="../../../../reference/android/telecom/RemoteConnection.Callback.html" target="_top"><code>RemoteConnection.Callback</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="RemoteConnection.VideoProvider"></A> <nobr><A HREF="../../../../reference/android/telecom/RemoteConnection.VideoProvider.html" target="_top"><code>RemoteConnection.VideoProvider</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="RemoteConnection.VideoProvider.Callback"></A> <nobr><A HREF="../../../../reference/android/telecom/RemoteConnection.VideoProvider.Callback.html" target="_top"><code>RemoteConnection.VideoProvider.<br>Callback</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="StatusHints"></A> <nobr><A HREF="../../../../reference/android/telecom/StatusHints.html" target="_top"><code>StatusHints</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="VideoProfile"></A> <nobr><A HREF="../../../../reference/android/telecom/VideoProfile.html" target="_top"><code>VideoProfile</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="VideoProfile.CameraCapabilities"></A> <nobr><A HREF="../../../../reference/android/telecom/VideoProfile.CameraCapabilities.html" target="_top"><code>VideoProfile.CameraCapabilities</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> </TABLE> &nbsp; <p> <a NAME="Changed"></a> <TABLE summary="Changed Classes" WIDTH="100%"> <TR> <TH VALIGN="TOP" COLSPAN=2>Changed Classes</FONT></TD> </TH> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="TelecomManager"></A> <nobr><A HREF="android.telecom.TelecomManager.html">TelecomManager</A></nobr> </TD> <TD>&nbsp;</TD> </TR> </TABLE> &nbsp; </div> <div id="footer"> <div id="copyright"> Except as noted, this content is licensed under <a href="http://creativecommons.org/licenses/by/2.5/"> Creative Commons Attribution 2.5</a>. For details and restrictions, see the <a href="/license.html">Content License</a>. </div> <div id="footerlinks"> <p> <a href="http://www.android.com/terms.html">Site Terms of Service</a> - <a href="http://www.android.com/privacy.html">Privacy Policy</a> - <a href="http://www.android.com/branding.html">Brand Guidelines</a> </p> </div> </div> <!-- end footer --> </div><!-- end doc-content --> </div> <!-- end body-content --> <script src="http://www.google-analytics.com/ga.js" type="text/javascript"> </script> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-5831155-1"); pageTracker._setAllowAnchor(true); pageTracker._initData(); pageTracker._trackPageview(); } catch(e) {} </script> </BODY> </HTML>
{ "content_hash": "f9f2a9bf140ac1a3775d2c0358d8efff", "timestamp": "", "source": "github", "line_count": 316, "max_line_length": 269, "avg_line_length": 38.86708860759494, "alnum_prop": 0.6337730011398794, "repo_name": "Ant-Droid/android_frameworks_base_OLD", "id": "39f02458fda738682c5935597e0b98b1b52e57e9", "size": "12282", "binary": false, "copies": "3", "ref": "refs/heads/mm600", "path": "docs/html/sdk/api_diff/23/changes/pkg_android.telecom.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "167132" }, { "name": "C++", "bytes": "7099875" }, { "name": "GLSL", "bytes": "20654" }, { "name": "HTML", "bytes": "224185" }, { "name": "Java", "bytes": "79415679" }, { "name": "Makefile", "bytes": "419370" }, { "name": "Python", "bytes": "42309" }, { "name": "RenderScript", "bytes": "153826" }, { "name": "Shell", "bytes": "21079" } ], "symlink_target": "" }
package se.toxbee.sleepfighter.model; import com.badlogic.gdx.utils.IntArray; import com.google.common.collect.Ordering; import java.util.ArrayList; import java.util.BitSet; import java.util.Collections; import java.util.List; import se.toxbee.sleepfighter.model.Alarm.AlarmEvent; import se.toxbee.sleepfighter.utils.collect.IdObservableList; /** * {@link AlarmList} manages all the existing alarms. * * @author Centril<twingoow@gmail.com> / Mazdak Farrokhzad. * @version 1.1 * @since Sep 18, 2013 */ public class AlarmList extends IdObservableList<Alarm> { /* -------------------------------- * Fields: Sorting. * -------------------------------- */ private SortMode sortMode; private Ordering<Alarm> ordering; /* -------------------------------- * Constructors. * -------------------------------- */ /** * Constructs the list with no initial alarms. */ public AlarmList() { this( new ArrayList<Alarm>() ); } /** * Constructs the list starting with given alarms. * * @param alarms list of given alarms. Don't modify this list directly. */ public AlarmList( List<Alarm> alarms ) { this.setDelegate( alarms ); this.sortMode = new SortMode(); this.ordering = this.sortMode.ordering(); } /* -------------------------------- * Unnamed placements. * -------------------------------- */ @Override protected void fireEvent( Event e ) { switch( e.operation() ) { case UPDATE: // order() will cause an infinite loop if we dont bail here. return; case ADD: int maxId = this.maxId(); // Set placement and order for all added alarms. for ( Object obj : e.elements() ) { Alarm curr = (Alarm) obj; this.setPlacement( curr ); curr.setOrder( ++maxId ); } // Reorder the list. this.order(); // FALLTROUGH default: super.fireEvent( e ); } } /** * Returns the maximum id in the list. * * @return the maximum id. */ public int maxId() { int maxId = 0; if ( this.sortMode.field() == SortMode.Field.ID ) { // Optimized since we're already sorting by id. maxId = this.get( this.sortMode.direction() ? this.size() - 1 : 0 ).getId(); } else { for ( Alarm elem : this.delegate() ) { int currId = elem.getId(); if ( currId > maxId ) { maxId = currId; } } } return maxId; } private void setPlacement( Alarm alarm ) { if ( alarm.isUnnamed() ) { alarm.setUnnamedPlacement( this.findLowestUnnamedPlacement() ); } } /** * <p>Finds the lowest unnamed placement number.</p> * * <p>Time complexity: O(n),<br/> * Space complexity: O(n).</p> * * @see Alarm#getUnnamedPlacement() * @return the lowest unnamed placement number. */ public int findLowestUnnamedPlacement() { // Bail early if we can. if ( this.size() == 0 ) { return 1; } // First extract the unnamed placements defined. IntArray arr = new IntArray(); arr.ordered = false; for ( Alarm alarm : this ) { if ( alarm.isUnnamed() ) { int place = alarm.getUnnamedPlacement(); if ( place > 0 ) { arr.add( place ); } } } // Another opportunity to bail. if ( arr.size == 0 ) { return 1; } arr.shrink(); // Set all bits < N BitSet bits = new BitSet( arr.size ); for ( int i = 0; i < arr.size; ++i ) { int v = arr.get( i ) - 1; if ( v < arr.size ) { bits.set( v ); } } // Find first false bit. return bits.nextClearBit( 0 ) + 1; } /* -------------------------------- * Public methods: etc. * -------------------------------- */ /** * Returns info about the earliest alarm.<br/> * The info contains info about milliseconds and the alarm. * * @param now current time in UNIX epoch timestamp. * @return info about the earliest alarm. */ public AlarmTimestamp getEarliestAlarm( long now ) { Long millis = null; int earliestIndex = -1; for ( int i = 0; i < this.size(); i++ ) { Long currMillis = this.get( i ).getNextMillis( now ); if ( currMillis != Alarm.NEXT_NON_REAL && (millis == Alarm.NEXT_NON_REAL || millis > currMillis) ) { earliestIndex = i; millis = currMillis; } } return earliestIndex == -1 ? AlarmTimestamp.INVALID : new AlarmTimestamp( millis, this.get( earliestIndex) ); } /* -------------------------------- * Public methods: Sorting. * -------------------------------- */ /** * Returns the current sort mode. * * @return the mode. */ public SortMode getSortMode() { return this.sortMode; } /** * Orders the list using the result of {@link #getSortMode()}. */ public void order() { Collections.sort( this, this.ordering ); } /** * Orders if needed according to current result of {@link #getSortMode()}. * * @param evt the event. */ public boolean orderIfNeeded( AlarmEvent evt ) { if ( this.sortMode.requiresReordering( evt ) ) { this.order(); return true; } return false; } /** * Sets the result of {@link #getSortMode()} and calls {@link #order()}. * * @param mode the {@link SortMode} to use. * @return true if the mode was changed. */ public boolean order( SortMode mode ) { if ( this.sortMode.equals( mode ) ) { return false; } this.sortMode = mode; this.ordering = mode.ordering(); this.order(); return true; } }
{ "content_hash": "9da58b0bc91958f159a20b360c34bab2", "timestamp": "", "source": "github", "line_count": 240, "max_line_length": 111, "avg_line_length": 21.995833333333334, "alnum_prop": 0.5866641409357833, "repo_name": "Centril/sleepfighter", "id": "b5aef69954e7fb657be747ac332ef6ca39cdc9cf", "size": "5867", "binary": false, "copies": "1", "ref": "refs/heads/development", "path": "application/sleepfighter/src/main/java/se/toxbee/sleepfighter/model/AlarmList.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "6512" }, { "name": "Java", "bytes": "900045" }, { "name": "JavaScript", "bytes": "63829" } ], "symlink_target": "" }
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import operator import optparse import os import os.path import sys import time import yaml import ansible from ansible import constants as C from ansible.module_utils.six import string_types from ansible.module_utils._text import to_native from ansible.release import __version__ from ansible.utils.path import unfrackpath # # Special purpose OptionParsers # class SortedOptParser(optparse.OptionParser): """Optparser which sorts the options by opt before outputting --help""" def format_help(self, formatter=None, epilog=None): self.option_list.sort(key=operator.methodcaller('get_opt_string')) return optparse.OptionParser.format_help(self, formatter=None) # Note: Inherit from SortedOptParser so that we get our format_help method class InvalidOptsParser(SortedOptParser): """Ignore invalid options. Meant for the special case where we need to take care of help and version but may not know the full range of options yet. .. seealso:: See it in use in ansible.cli.CLI.set_action """ def __init__(self, parser): # Since this is special purposed to just handle help and version, we # take a pre-existing option parser here and set our options from # that. This allows us to give accurate help based on the given # option parser. SortedOptParser.__init__(self, usage=parser.usage, option_list=parser.option_list, option_class=parser.option_class, conflict_handler=parser.conflict_handler, description=parser.description, formatter=parser.formatter, add_help_option=False, prog=parser.prog, epilog=parser.epilog) self.version = parser.version def _process_long_opt(self, rargs, values): try: optparse.OptionParser._process_long_opt(self, rargs, values) except optparse.BadOptionError: pass def _process_short_opts(self, rargs, values): try: optparse.OptionParser._process_short_opts(self, rargs, values) except optparse.BadOptionError: pass # # Callbacks to validate and normalize Options # def unfrack_paths(option, opt, value, parser): """Turn an Option's value into a list of paths in Ansible locations""" paths = getattr(parser.values, option.dest) if paths is None: paths = [] if isinstance(value, string_types): paths[:0] = [unfrackpath(x) for x in value.split(os.pathsep) if x] elif isinstance(value, list): paths[:0] = [unfrackpath(x) for x in value if x] else: pass # FIXME: should we raise options error? setattr(parser.values, option.dest, paths) def unfrack_path(option, opt, value, parser): """Turn an Option's data into a single path in Ansible locations""" if value != '-': setattr(parser.values, option.dest, unfrackpath(value)) else: setattr(parser.values, option.dest, value) def _git_repo_info(repo_path): """ returns a string containing git branch, commit id and commit date """ result = None if os.path.exists(repo_path): # Check if the .git is a file. If it is a file, it means that we are in a submodule structure. if os.path.isfile(repo_path): try: gitdir = yaml.safe_load(open(repo_path)).get('gitdir') # There is a possibility the .git file to have an absolute path. if os.path.isabs(gitdir): repo_path = gitdir else: repo_path = os.path.join(repo_path[:-4], gitdir) except (IOError, AttributeError): return '' with open(os.path.join(repo_path, "HEAD")) as f: line = f.readline().rstrip("\n") if line.startswith("ref:"): branch_path = os.path.join(repo_path, line[5:]) else: branch_path = None if branch_path and os.path.exists(branch_path): branch = '/'.join(line.split('/')[2:]) with open(branch_path) as f: commit = f.readline()[:10] else: # detached HEAD commit = line[:10] branch = 'detached HEAD' branch_path = os.path.join(repo_path, "HEAD") date = time.localtime(os.stat(branch_path).st_mtime) if time.daylight == 0: offset = time.timezone else: offset = time.altzone result = "({0} {1}) last updated {2} (GMT {3:+04d})".format(branch, commit, time.strftime("%Y/%m/%d %H:%M:%S", date), int(offset / -36)) else: result = '' return result def _gitinfo(): basedir = os.path.join(os.path.dirname(__file__), '..', '..', '..') repo_path = os.path.join(basedir, '.git') result = _git_repo_info(repo_path) submodules = os.path.join(basedir, '.gitmodules') if not os.path.exists(submodules): return result with open(submodules) as f: for line in f: tokens = line.strip().split(' ') if tokens[0] == 'path': submodule_path = tokens[2] submodule_info = _git_repo_info(os.path.join(basedir, submodule_path, '.git')) if not submodule_info: submodule_info = ' not found - use git submodule update --init ' + submodule_path result += "\n {0}: {1}".format(submodule_path, submodule_info) return result def version(prog=None): """ return ansible version """ if prog: result = " ".join((prog, __version__)) else: result = __version__ gitinfo = _gitinfo() if gitinfo: result = result + " {0}".format(gitinfo) result += "\n config file = %s" % C.CONFIG_FILE if C.DEFAULT_MODULE_PATH is None: cpath = "Default w/o overrides" else: cpath = C.DEFAULT_MODULE_PATH result = result + "\n configured module search path = %s" % cpath result = result + "\n ansible python module location = %s" % ':'.join(ansible.__path__) result = result + "\n executable location = %s" % sys.argv[0] result = result + "\n python version = %s" % ''.join(sys.version.splitlines()) return result # # Functions to add pre-canned options to an OptionParser # def create_base_parser(usage="", desc=None, epilog=None): """ Create an options parser for all ansible scripts """ # base opts parser = SortedOptParser(usage, version=to_native(version("%prog")), description=desc, epilog=epilog) parser.remove_option('--version') version_help = "show program's version number, config file location, configured module search path," \ " module location, executable location and exit" parser.add_option('--version', action="version", help=version_help) parser.add_option('-v', '--verbose', dest='verbosity', default=C.DEFAULT_VERBOSITY, action="count", help="verbose mode (-vvv for more, -vvvv to enable connection debugging)") return parser def add_async_options(parser): """Add options for commands which can launch async tasks""" parser.add_option('-P', '--poll', default=C.DEFAULT_POLL_INTERVAL, type='int', dest='poll_interval', help="set the poll interval if using -B (default=%s)" % C.DEFAULT_POLL_INTERVAL) parser.add_option('-B', '--background', dest='seconds', type='int', default=0, help='run asynchronously, failing after X seconds (default=N/A)') def add_basedir_options(parser): """Add options for commands which can set a playbook basedir""" parser.add_option('--playbook-dir', default=None, dest='basedir', action='store', help="Since this tool does not use playbooks, use this as a substitute playbook directory." "This sets the relative path for many features including roles/ group_vars/ etc.") def add_check_options(parser): """Add options for commands which can run with diagnostic information of tasks""" parser.add_option("-C", "--check", default=False, dest='check', action='store_true', help="don't make any changes; instead, try to predict some of the changes that may occur") parser.add_option('--syntax-check', dest='syntax', action='store_true', help="perform a syntax check on the playbook, but do not execute it") parser.add_option("-D", "--diff", default=C.DIFF_ALWAYS, dest='diff', action='store_true', help="when changing (small) files and templates, show the differences in those" " files; works great with --check") def add_connect_options(parser): """Add options for commands which need to connection to other hosts""" connect_group = optparse.OptionGroup(parser, "Connection Options", "control as whom and how to connect to hosts") connect_group.add_option('-k', '--ask-pass', default=C.DEFAULT_ASK_PASS, dest='ask_pass', action='store_true', help='ask for connection password') connect_group.add_option('--private-key', '--key-file', default=C.DEFAULT_PRIVATE_KEY_FILE, dest='private_key_file', help='use this file to authenticate the connection', action="callback", callback=unfrack_path, type='string') connect_group.add_option('-u', '--user', default=C.DEFAULT_REMOTE_USER, dest='remote_user', help='connect as this user (default=%s)' % C.DEFAULT_REMOTE_USER) connect_group.add_option('-c', '--connection', dest='connection', default=C.DEFAULT_TRANSPORT, help="connection type to use (default=%s)" % C.DEFAULT_TRANSPORT) connect_group.add_option('-T', '--timeout', default=C.DEFAULT_TIMEOUT, type='int', dest='timeout', help="override the connection timeout in seconds (default=%s)" % C.DEFAULT_TIMEOUT) connect_group.add_option('--ssh-common-args', default='', dest='ssh_common_args', help="specify common arguments to pass to sftp/scp/ssh (e.g. ProxyCommand)") connect_group.add_option('--sftp-extra-args', default='', dest='sftp_extra_args', help="specify extra arguments to pass to sftp only (e.g. -f, -l)") connect_group.add_option('--scp-extra-args', default='', dest='scp_extra_args', help="specify extra arguments to pass to scp only (e.g. -l)") connect_group.add_option('--ssh-extra-args', default='', dest='ssh_extra_args', help="specify extra arguments to pass to ssh only (e.g. -R)") parser.add_option_group(connect_group) def add_fork_options(parser): """Add options for commands that can fork worker processes""" parser.add_option('-f', '--forks', dest='forks', default=C.DEFAULT_FORKS, type='int', help="specify number of parallel processes to use (default=%s)" % C.DEFAULT_FORKS) def add_inventory_options(parser): """Add options for commands that utilize inventory""" parser.add_option('-i', '--inventory', '--inventory-file', dest='inventory', action="append", help="specify inventory host path or comma separated host list. --inventory-file is deprecated") parser.add_option('--list-hosts', dest='listhosts', action='store_true', help='outputs a list of matching hosts; does not execute anything else') parser.add_option('-l', '--limit', default=C.DEFAULT_SUBSET, dest='subset', help='further limit selected hosts to an additional pattern') def add_meta_options(parser): """Add options for commands which can launch meta tasks from the command line""" parser.add_option('--force-handlers', default=C.DEFAULT_FORCE_HANDLERS, dest='force_handlers', action='store_true', help="run handlers even if a task fails") parser.add_option('--flush-cache', dest='flush_cache', action='store_true', help="clear the fact cache for every host in inventory") def add_module_options(parser): """Add options for commands that load modules""" module_path = C.config.get_configuration_definition('DEFAULT_MODULE_PATH').get('default', '') parser.add_option('-M', '--module-path', dest='module_path', default=None, help="prepend colon-separated path(s) to module library (default=%s)" % module_path, action="callback", callback=unfrack_paths, type='str') def add_output_options(parser): """Add options for commands which can change their output""" parser.add_option('-o', '--one-line', dest='one_line', action='store_true', help='condense output') parser.add_option('-t', '--tree', dest='tree', default=None, help='log output to this directory') def add_runas_options(parser): """ Add options for commands which can run tasks as another user Note that this includes the options from add_runas_prompt_options(). Only one of these functions should be used. """ runas_group = optparse.OptionGroup(parser, "Privilege Escalation Options", "control how and which user you become as on target hosts") # consolidated privilege escalation (become) runas_group.add_option("-b", "--become", default=C.DEFAULT_BECOME, action="store_true", dest='become', help="run operations with become (does not imply password prompting)") runas_group.add_option('--become-method', dest='become_method', default=C.DEFAULT_BECOME_METHOD, help="privilege escalation method to use (default=%default), use " "`ansible-doc -t become -l` to list valid choices.") runas_group.add_option('--become-user', default=None, dest='become_user', type='string', help='run operations as this user (default=%s)' % C.DEFAULT_BECOME_USER) add_runas_prompt_options(parser, runas_group=runas_group) def add_runas_prompt_options(parser, runas_group=None): """ Add options for commands which need to prompt for privilege escalation credentials Note that add_runas_options() includes these options already. Only one of the two functions should be used. """ if runas_group is None: runas_group = optparse.OptionGroup(parser, "Privilege Escalation Options", "control how and which user you become as on target hosts") runas_group.add_option('-K', '--ask-become-pass', dest='become_ask_pass', action='store_true', help='ask for privilege escalation password', default=C.DEFAULT_BECOME_ASK_PASS) parser.add_option_group(runas_group) def add_runtask_options(parser): """Add options for commands that run a task""" parser.add_option('-e', '--extra-vars', dest="extra_vars", action="append", help="set additional variables as key=value or YAML/JSON, if filename prepend with @", default=[]) def add_subset_options(parser): """Add options for commands which can run a subset of tasks""" parser.add_option('-t', '--tags', dest='tags', default=C.TAGS_RUN, action='append', help="only run plays and tasks tagged with these values") parser.add_option('--skip-tags', dest='skip_tags', default=C.TAGS_SKIP, action='append', help="only run plays and tasks whose tags do not match these values") def add_vault_options(parser): """Add options for loading vault files""" parser.add_option('--ask-vault-pass', default=C.DEFAULT_ASK_VAULT_PASS, dest='ask_vault_pass', action='store_true', help='ask for vault password') parser.add_option('--vault-password-file', default=[], dest='vault_password_files', help="vault password file", action="callback", callback=unfrack_paths, type='string') parser.add_option('--vault-id', default=[], dest='vault_ids', action='append', type='string', help='the vault identity to use') def add_vault_rekey_options(parser): """Add options for commands which can edit/rekey a vault file""" parser.add_option('--new-vault-password-file', default=None, dest='new_vault_password_file', help="new vault password file for rekey", action="callback", callback=unfrack_path, type='string') parser.add_option('--new-vault-id', default=None, dest='new_vault_id', type='string', help='the new vault identity to use for rekey')
{ "content_hash": "ac4538c738046bdd78da985b120f5e40", "timestamp": "", "source": "github", "line_count": 363, "max_line_length": 144, "avg_line_length": 46.680440771349865, "alnum_prop": 0.6197108291531426, "repo_name": "SergeyCherepanov/ansible", "id": "f133740cd775fa4c3f1c72d632a57732fe7aebba", "size": "17078", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "ansible/ansible/cli/arguments/optparse_helpers.py", "mode": "33188", "license": "mit", "language": [ { "name": "Shell", "bytes": "824" } ], "symlink_target": "" }
package org.wisdom.framework.vertx.ssl; import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.wisdom.framework.vertx.ServiceAccessor; import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManager; import javax.net.ssl.TrustManagerFactory; import java.io.File; import java.io.FileInputStream; import java.security.KeyStore; import java.security.KeyStoreException; /** * A class creating the SSL server context. */ public final class SSLServerContext { private static final Logger LOGGER = LoggerFactory.getLogger("wisdom-vertx-engine"); private static final String PROTOCOL = "TLS"; private static SSLServerContext INSTANCE; private final SSLContext serverContext; private final ServiceAccessor accessor; private static final String HTTPSWARN = "HTTPS configured with no client " + "side CA verification. Requires http://webid.info/ for client certificate verification."; private static final String HTTPSFAIL = "Failure during HTTPS initialization"; /** * Constructor for singleton. * * @param accessor used to access services. */ private SSLServerContext(final ServiceAccessor accessor) { LOGGER.info("Configuring HTTPS support"); this.accessor = accessor; final File root = accessor.getConfiguration().getBaseDir(); final String path = accessor.getConfiguration().get("https.keyStore"); final String ca = accessor.getConfiguration().get("https.trustStore"); KeyManagerFactory kmf = null; TrustManager[] trusts = null; // configure keystore if (path == null) { kmf = getFakeKeyManagerFactory(root); LOGGER.warn(HTTPSWARN); trusts = new TrustManager[]{new AcceptAllTrustManager()}; } else { try { kmf = getKeyManagerFactoryFromKeyStore(root, path); } catch (final KeyStoreException e) { throw new RuntimeException("Cannot read the key store file", e); } } // configure trustore if (ca == null) { LOGGER.info("Using default trust store for client side CA verification"); } else if ("noCA".equalsIgnoreCase(ca)) { trusts = new TrustManager[]{new AcceptAllTrustManager()}; LOGGER.warn(HTTPSWARN); } else { try { trusts = getTrustManagerFactoryFromKeyStore(root, ca).getTrustManagers(); } catch (final KeyStoreException e) { throw new RuntimeException("Cannot read the trust store file", e); } } try { final SSLContext context = SSLContext.getInstance(PROTOCOL); context.init(kmf.getKeyManagers(), trusts, null); serverContext = context; } catch (final Exception e) { throw new RuntimeException(HTTPSFAIL + e.getMessage(), e); } } /** * Returns the singleton instance for this class. */ public static synchronized SSLServerContext getInstance(final ServiceAccessor accessor) { if (INSTANCE == null) { INSTANCE = new SSLServerContext(accessor); } return INSTANCE; } /** * Returns the server context with server side key store. */ public SSLContext serverContext() { return serverContext; } private KeyManagerFactory getKeyManagerFactoryFromKeyStore(final File maybeRoot, final String path) throws KeyStoreException { KeyManagerFactory kmf; File file = new File(path); if (!file.isFile()) { // Second chance. file = new File(maybeRoot, path); } LOGGER.info("\t key store: " + file.getAbsolutePath()); final KeyStore keyStore = KeyStore.getInstance(accessor.getConfiguration().getWithDefault("https.keyStoreType", "JKS")); LOGGER.info("\t key store type: " + keyStore.getType()); LOGGER.info("\t key store provider: " + keyStore.getProvider()); final char[] password = accessor.getConfiguration().getWithDefault("https.keyStorePassword", "").toCharArray(); LOGGER.info("\t key store password length: " + password.length); final String algorithm = accessor.getConfiguration().getWithDefault("https.keyStoreAlgorithm", KeyManagerFactory.getDefaultAlgorithm()); LOGGER.info("\t key store algorithm: " + algorithm); if (file.isFile()) { FileInputStream stream = null; try { stream = new FileInputStream(file); keyStore.load(stream, password); kmf = KeyManagerFactory.getInstance(algorithm); kmf.init(keyStore, password); } catch (final Exception e) { throw new RuntimeException(HTTPSFAIL + e.getMessage(), e); } finally { IOUtils.closeQuietly(stream); } } else { throw new RuntimeException("Cannot load key store from '" + file.getAbsolutePath() + "', " + "the file does not exist"); } return kmf; } private KeyManagerFactory getFakeKeyManagerFactory(final File root) { KeyManagerFactory kmf; LOGGER.warn("Using generated key with self signed certificate for HTTPS. This MUST not be used in " + "production. To set the key store use: `-Dhttps.keyStore=my-keystore`"); kmf = FakeKeyStore.keyManagerFactory(root); return kmf; } private TrustManagerFactory getTrustManagerFactoryFromKeyStore(final File maybeRoot, final String path) throws KeyStoreException { final TrustManagerFactory tmf; File file = new File(path); if (!file.isFile()) { // Second chance. file = new File(maybeRoot, path); } LOGGER.info("\t trust store: " + file.getAbsolutePath()); final KeyStore trustStore = KeyStore.getInstance(accessor.getConfiguration().getWithDefault("https.trustStoreType", "JKS")); LOGGER.info("\t trust store type: " + trustStore.getType()); LOGGER.info("\t trust store provider: " + trustStore.getProvider()); final char[] password = accessor.getConfiguration().getWithDefault("https.trustStorePassword", "").toCharArray(); LOGGER.info("\t trust store password length: " + password.length); final String algorithm = accessor.getConfiguration().getWithDefault("https.trustStoreAlgorithm", KeyManagerFactory.getDefaultAlgorithm()); LOGGER.info("\t trust store algorithm: " + algorithm); if (file.isFile()) { FileInputStream stream = null; try { stream = new FileInputStream(file); trustStore.load(stream, password); tmf = TrustManagerFactory.getInstance(algorithm); tmf.init(trustStore); } catch (final Exception e) { throw new RuntimeException(HTTPSFAIL + e.getMessage(), e); } finally { IOUtils.closeQuietly(stream); } } else { throw new RuntimeException("Cannot load trust store from '" + file.getAbsolutePath() + "', " + "the file does not exist"); } return tmf; } }
{ "content_hash": "4c8a108b8b4ddebfa20015ddb60d9198", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 146, "avg_line_length": 41.07222222222222, "alnum_prop": 0.629108616258623, "repo_name": "evrignaud/wisdom", "id": "69f7ee23063794dfc85d17c9d80f48700a19f8e2", "size": "8049", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "extensions/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/ssl/SSLServerContext.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "59099" }, { "name": "CoffeeScript", "bytes": "2303" }, { "name": "Groovy", "bytes": "7871" }, { "name": "Java", "bytes": "2914920" }, { "name": "JavaScript", "bytes": "336988" }, { "name": "Shell", "bytes": "2382" } ], "symlink_target": "" }
using System; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Z.Core.Test { [TestClass] public class System_String_ExtractUInt64 { [TestMethod] public void ExtractUInt64() { // Type // Exemples ulong result1 = "Fizz 123 Buzz".ExtractUInt64(); // return 123; ulong result2 = "Fizz -123 Buzz".ExtractUInt64(); // return 123; ulong result3 = "-Fizz 123 Buzz".ExtractUInt64(); // return 123; ulong result4 = "Fizz 123.456 Buzz".ExtractUInt64(); // return 123456; ulong result5 = "Fizz -123Fizz.Buzz456 Buzz".ExtractUInt64(); // return 123456; // Unit Test Assert.AreEqual((UInt64) 123, result1); Assert.AreEqual((UInt64) 123, result2); Assert.AreEqual((UInt64) 123, result3); Assert.AreEqual((UInt64) 123456, result4); Assert.AreEqual((UInt64) 123456, result5); } } }
{ "content_hash": "86ada0fc20a28d85fcd4bc411f4c7fed", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 91, "avg_line_length": 33.93103448275862, "alnum_prop": 0.5833333333333334, "repo_name": "zzzprojects/Z.ExtensionMethods", "id": "a3e9d649d4cdeac76ebd52effff965a59439f4ac", "size": "1409", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/Z.Core.Test/System.String/String.ExtractUInt64.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "2614731" }, { "name": "Visual Basic", "bytes": "1411898" } ], "symlink_target": "" }
/* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, see <http://www.gnu.org/licenses/> or write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "LibVT_Internal.h" #include "LibVT.h" #include "dxt.h" extern vtConfig c; void * vtuCompressRGBA_DXT1(void *rgba) { #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE #else int out_bytes = 0; uint8_t *out = (uint8_t *)malloc((c.pageDimension+3)*(c.pageDimension+3)/16*8); CompressImageDXT1((const byte*)rgba, out, c.pageDimension, c.pageDimension, out_bytes); return out; #endif } void * vtuCompressRGBA_DXT5(void *rgba) { #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE #else int out_bytes = 0; uint8_t *out = (uint8_t *)malloc((c.pageDimension+3)*(c.pageDimension+3)/16*16); CompressImageDXT5((const byte*)rgba, out, c.pageDimension, c.pageDimension, out_bytes); return out; #endif }
{ "content_hash": "26dee3c4d351a0d59fdf9840467eb48d", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 249, "avg_line_length": 32.53333333333333, "alnum_prop": 0.7418032786885246, "repo_name": "mattjr/seafloorexplore", "id": "fec742ec71b5e1f0e7e5adda7c4e1ed8773051c4", "size": "1590", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "LibVT/LibVT_TextureCompression.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "1348006" }, { "name": "C++", "bytes": "10602121" }, { "name": "CMake", "bytes": "14594" }, { "name": "GLSL", "bytes": "38682" }, { "name": "Objective-C", "bytes": "1053643" }, { "name": "Objective-C++", "bytes": "312055" }, { "name": "Shell", "bytes": "1959" } ], "symlink_target": "" }