text
stringlengths
2
1.04M
meta
dict
<?xml version="1.0" encoding="iso-8859-1"?> <!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> <title>Docs For Class Swift_Mailer_ArrayRecipientIterator</title> <link rel="stylesheet" href="../../media/stylesheet.css" /> <script src="../../media/lib/classTree.js"></script> <link id="webfx-tab-style-sheet" type="text/css" rel="stylesheet" href="../../media/lib/tab.webfx.css" /> <script type="text/javascript" src="../../media/lib/tabpane.js"></script> <script language="javascript" type="text/javascript" src="../../media/lib/ua.js"></script> <script language="javascript" type="text/javascript"> var imgPlus = new Image(); var imgMinus = new Image(); imgPlus.src = "../../media/images/plus.gif"; imgMinus.src = "../../media/images/minus.gif"; function showNode(Node){ switch(navigator.family){ case 'nn4': // Nav 4.x code fork... var oTable = document.layers["span" + Node]; var oImg = document.layers["img" + Node]; break; case 'ie4': // IE 4/5 code fork... var oTable = document.all["span" + Node]; var oImg = document.all["img" + Node]; break; case 'gecko': // Standards Compliant code fork... var oTable = document.getElementById("span" + Node); var oImg = document.getElementById("img" + Node); break; } oImg.src = imgMinus.src; oTable.style.display = "block"; } function hideNode(Node){ switch(navigator.family){ case 'nn4': // Nav 4.x code fork... var oTable = document.layers["span" + Node]; var oImg = document.layers["img" + Node]; break; case 'ie4': // IE 4/5 code fork... var oTable = document.all["span" + Node]; var oImg = document.all["img" + Node]; break; case 'gecko': // Standards Compliant code fork... var oTable = document.getElementById("span" + Node); var oImg = document.getElementById("img" + Node); break; } oImg.src = imgPlus.src; oTable.style.display = "none"; } function nodeIsVisible(Node){ switch(navigator.family){ case 'nn4': // Nav 4.x code fork... var oTable = document.layers["span" + Node]; break; case 'ie4': // IE 4/5 code fork... var oTable = document.all["span" + Node]; break; case 'gecko': // Standards Compliant code fork... var oTable = document.getElementById("span" + Node); break; } return (oTable && oTable.style.display == "block"); } function toggleNodeVisibility(Node){ if (nodeIsVisible(Node)){ hideNode(Node); }else{ showNode(Node); } } </script> <!-- template designed by Julien Damon based on PHPEdit's generated templates, and tweaked by Greg Beaver --> <body bgcolor="#ffffff" > <!-- Start of Class Data --> <h2> Class Swift_Mailer_ArrayRecipientIterator </h2> (line <span class="linenumber">19</span>) <div class="tab-pane" id="tabPane1"> <script type="text/javascript"> tp1 = new WebFXTabPane( document.getElementById( "tabPane1" )); </script> <div class="tab-page" id="Description"> <h2 class="tab">Description</h2> <pre> </pre> <p> <b><i>Located in File: <a href="_vendors---swiftMailer---classes---Swift---Mailer---ArrayRecipientIterator.php.html">/vendors/swiftMailer/classes/Swift/Mailer/ArrayRecipientIterator.php</a></i></b><br> </p> <!-- ========== Info from phpDoc block ========= --> <h5>Wraps a standard PHP array in an interator.</h5> <ul> <li><strong>author:</strong> - Chris Corbyn</li> </ul> <br /><hr /> </div> <script type="text/javascript">tp1.addTabPage( document.getElementById( "Description" ) );</script> <div class="tab-page" id="tabPage1"> <h2 class="tab">Class Variables</h2> <!-- ============ VARIABLE DETAIL =========== --> <strong>Summary:</strong><br /> <hr /> <script type="text/javascript">tp1.addTabPage( document.getElementById( "tabPage1" ) );</script> </div> <div class="tab-page" id="constantsTabpage"> <h2 class="tab">Class Constants</h2> <!-- ============ VARIABLE DETAIL =========== --> <strong>Summary:</strong><br /> <hr /> <script type="text/javascript">tp1.addTabPage( document.getElementById( "constantsTabpage" ) );</script> </div> <div class="tab-page" id="tabPage2"> <h2 class="tab">Method Detail</h2> <!-- ============ METHOD DETAIL =========== --> <strong>Summary:</strong><br /> <div class="method-summary"> <div class="method-definition"> <span class="method-result">Swift_Mailer_ArrayRecipientIterator</span> <a href="#method__construct" title="details" class="method-name">__construct</a> (<span class="var-type"></span>&nbsp;<span class="var-name">$recipients</span>) </div> <div class="method-definition"> <span class="method-result">boolean</span> <a href="#methodhasNext" title="details" class="method-name">hasNext</a> () </div> <div class="method-definition"> <span class="method-result">array</span> <a href="#methodnextRecipient" title="details" class="method-name">nextRecipient</a> () </div> </div> <hr /> <A NAME='method_detail'></A> <a name="method__construct" id="method__construct"><!-- --></a> <div style="background='#ffffff'"><h4> <img src="../../media/images/Constructor.gif" border="0" /> <strong class="method">Constructor __construct</strong> (line <span class="linenumber">34</span>) </h4> <h4><i>Swift_Mailer_ArrayRecipientIterator</i> <strong>__construct( $recipients)</strong></h4> <!-- ========== Info from phpDoc block ========= --> <h5>Create a new ArrayRecipientIterator from $recipients.</h5> <h4>Parameters</h4> <ul> <li><strong>array $recipients</strong>: </li> </ul> <h4>Info</h4> <ul> <li><strong>access</strong> - public</li> </ul> </div> <a name="methodhasNext" id="methodhasNext"><!-- --></a> <div style="background='#eeeeee'"><h4> <img src="../../media/images/PublicMethod.gif" border="0" /> <strong class="method">Method hasNext</strong> (line <span class="linenumber">43</span>) </h4> <h4><i>boolean</i> <strong>hasNext( )</strong></h4> <hr class="separator" /> <div class="notes">Implementation of:</div> <dl> <dt><a href="Swift_Mailer_RecipientIterator.html#methodhasNext">Swift_Mailer_RecipientIterator::hasNext()</a></dt> <dd>Returns true only if there are more recipients to send to.</dd> </dl> <!-- ========== Info from phpDoc block ========= --> <h5>Returns true only if there are more recipients to send to.</h5> <h4>Info</h4> <ul> <li><strong>access</strong> - public</li> </ul> </div> <a name="methodnextRecipient" id="methodnextRecipient"><!-- --></a> <div style="background='#ffffff'"><h4> <img src="../../media/images/PublicMethod.gif" border="0" /> <strong class="method">Method nextRecipient</strong> (line <span class="linenumber">54</span>) </h4> <h4><i>array</i> <strong>nextRecipient( )</strong></h4> <hr class="separator" /> <div class="notes">Implementation of:</div> <dl> <dt><a href="Swift_Mailer_RecipientIterator.html#methodnextRecipient">Swift_Mailer_RecipientIterator::nextRecipient()</a></dt> <dd>Returns an array where the keys are the addresses of recipients and the values are the names.</dd> </dl> <!-- ========== Info from phpDoc block ========= --> <h5>Returns an array where the keys are the addresses of recipients and the values are the names.</h5> <div class="desc"><p>e.g. ('foo@bar' =&gt; 'Foo') or ('foo@bar' =&gt; NULL)</p></div> <h4>Info</h4> <ul> <li><strong>access</strong> - public</li> </ul> </div> <script type="text/javascript">tp1.addTabPage( document.getElementById( "tabPage2" ) );</script> </div> <div class="tab-page" id="iVars"> <h2 class="tab">Inherited Variables</h2> <script type="text/javascript">tp1.addTabPage( document.getElementById( "iVars" ) );</script> <!-- =========== VAR INHERITED SUMMARY =========== --> <A NAME='var_inherited_summary'><!-- --></A> <h3>Inherited Class Variable Summary</h3> </div> <div class="tab-page" id="iMethods"> <h2 class="tab">Inherited Methods</h2> <script type="text/javascript">tp1.addTabPage( document.getElementById( "iMethods" ) );</script> <!-- =========== INHERITED METHOD SUMMARY =========== --> <A NAME='functions_inherited'><!-- --></A> <h3>Inherited Method Summary</h3> </div> </div> <script type="text/javascript"> //<![CDATA[ setupAllTabs(); //]]> </script> <div id="credit"> <hr /> Documentation generated on Fri, 12 Nov 2010 20:45:13 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.3</a> </div> </body> </html>
{ "content_hash": "52157d18072d7314ecd7d2c996537d47", "timestamp": "", "source": "github", "line_count": 252, "max_line_length": 202, "avg_line_length": 35.92857142857143, "alnum_prop": 0.6015020985199911, "repo_name": "m1k3777/vic", "id": "cd21fa45263ae6e7433501eb8764bb047c80ed5b", "size": "9054", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "protected/extensions/yii-mail/doc/Swift/Mailer/Swift_Mailer_ArrayRecipientIterator.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "371066" }, { "name": "JavaScript", "bytes": "162781" }, { "name": "PHP", "bytes": "761169" }, { "name": "Shell", "bytes": "395" } ], "symlink_target": "" }
SpBluetooth::SpBluetooth(SoftwareSerial& s, char* inputBuffer) : serial(s), inputBuffer(inputBuffer) { inputUsage = 0; } void SpBluetooth::begin(int baudRate) { serial.begin(baudRate); } bool SpBluetooth::loop() { int l = serial.available(); if(l == 0) { return false; } l = serial.readBytes(&(inputBuffer[inputUsage]), l); inputUsage += l; if(inputBuffer[inputUsage - 1] == '\n') { inputBuffer[inputUsage - 1] = '\0'; inputUsage = 0; return true; } return false; } void SpBluetooth::write(const char* message) { serial.println(message); }
{ "content_hash": "30b2e789365d5eb8e32b13bad33cc008", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 62, "avg_line_length": 18.90909090909091, "alnum_prop": 0.6089743589743589, "repo_name": "ddmendes/SmartPendant", "id": "e5a9e1b05b5992057bb52a9dea71a8700c433b60", "size": "672", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "arduino/libraries/SpBluetooth/src/SpBluetooth.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "Arduino", "bytes": "8249" }, { "name": "C", "bytes": "379" }, { "name": "C++", "bytes": "205955" }, { "name": "CMake", "bytes": "1086" }, { "name": "Java", "bytes": "82215" }, { "name": "Shell", "bytes": "3944" } ], "symlink_target": "" }
package lombok; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import lombok.javac.CapturingDiagnosticListener.CompilerMessage; public class CompilerMessageMatcher { /** Line Number (starting at 1) */ private final long line; /** Position is either column number, OR position in file starting from the first byte. */ private final long position; private final Collection<String> messageParts; public CompilerMessageMatcher(long line, long position, String message) { this.line = line; this.position = position; this.messageParts = Arrays.asList(message.split("\\s+")); } public static CompilerMessageMatcher asCompilerMessageMatcher(CompilerMessage message) { return new CompilerMessageMatcher(message.getLine(), message.getColumnOrPosition(), message.getMessage()); } @Override public String toString() { StringBuilder parts = new StringBuilder(); for (String part : messageParts) parts.append(part).append(" "); if (parts.length() > 0) parts.setLength(parts.length() - 1); return String.format("%d:%d %s", line, position, parts); } public boolean matches(CompilerMessage message) { if (message.getLine() != this.line) return false; if (message.getColumnOrPosition() != this.position) return false; for (String token : messageParts) { if (!message.getMessage().contains(token)) return false; } return true; } public static List<CompilerMessageMatcher> readAll(InputStream rawIn) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(rawIn, "UTF-8")); List<CompilerMessageMatcher> out = new ArrayList<CompilerMessageMatcher>(); for (String line = in.readLine(); line != null; line = in.readLine()) { CompilerMessageMatcher cmm = read(line); if (cmm != null) out.add(cmm); } return out; } private static final Pattern PATTERN = Pattern.compile("^(\\d+):(\\d+) (.*)$"); private static CompilerMessageMatcher read(String line) { line = line.trim(); if (line.isEmpty()) return null; Matcher m = PATTERN.matcher(line); if (!m.matches()) throw new IllegalArgumentException("Typo in test file: " + line); return new CompilerMessageMatcher(Integer.parseInt(m.group(1)), Integer.parseInt(m.group(2)), m.group(3)); } }
{ "content_hash": "87f28495cc572603ac3d7a1f263a56cf", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 108, "avg_line_length": 35.81159420289855, "alnum_prop": 0.736139214892756, "repo_name": "redundent/lombok", "id": "af12e199fcd458bd6bcc7698f21057193556978c", "size": "3610", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "test/core/src/lombok/CompilerMessageMatcher.java", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "2647" }, { "name": "CSS", "bytes": "5669" }, { "name": "Java", "bytes": "1730226" }, { "name": "JavaScript", "bytes": "4148" } ], "symlink_target": "" }
import ModelFactory from 'ember-data-tiny-factory'; import QUnit from 'qunit'; QUnit.testStart(function(){ ModelFactory.setup(); }); QUnit.testDone(function(){ ModelFactory.teardown(); }); export function factorySetup(options){ ModelFactory.setResolver(options.resolver); ModelFactory.setModulePrefix(options.modulePrefix); }
{ "content_hash": "c331ec607ae49bc2e281a2519bb16793", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 55, "avg_line_length": 24.571428571428573, "alnum_prop": 0.752906976744186, "repo_name": "grese/ember-data-tiny-factory", "id": "53441d28a237c5e4db47508e691bad5edca7116f", "size": "344", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "addon/setup/qunit.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "1835" }, { "name": "Handlebars", "bytes": "52" }, { "name": "JavaScript", "bytes": "28252" } ], "symlink_target": "" }
static std::mutex _mutex; namespace wolf { namespace render { namespace vulkan { class w_buffer_pimp { public: w_buffer_pimp() : _name("w_buffer::"), _gDevice(nullptr), _map_data(nullptr), _memory_allocation(nullptr), _mapped(false), _allocated_from_pool(false) { } W_RESULT allocate(_In_ const std::shared_ptr<w_graphics_device>& pGDevice, _In_ uint32_t pBufferSizeInBytes, _In_ const uint32_t pUsageFlags, _In_ const w_memory_usage_flag pMemoryFlag, _In_ const bool pAllocateFromMemoryPool) { const std::string _trace_info = this->_name + "::allocate"; this->_gDevice = pGDevice; this->_usage_flags = pUsageFlags; this->_memory_flag = pMemoryFlag; this->_allocated_from_pool = pAllocateFromMemoryPool; if (this->_allocated_from_pool) { pBufferSizeInBytes = static_cast<uint32_t>(std::round_up(pBufferSizeInBytes, 4)); const VkBufferCreateInfo _buffer_create_info = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, // Type nullptr, // Next 0, // Flags (VkDeviceSize)pBufferSizeInBytes, // Size (VkBufferUsageFlags)this->_usage_flags, // Usage VK_SHARING_MODE_EXCLUSIVE, // SharingMode 0, // QueueFamilyIndexCount nullptr // QueueFamilyIndices }; //alocate memory for this buffer this->_memory_allocation = this->_gDevice->memory_allocator.allocate_buffer( _buffer_create_info, this->_memory_flag, this->_buffer_handle.handle, this->_memory_allocation_info); if (!this->_memory_allocation) { V(W_FAILED, w_log_type::W_ERROR, "allocating memory for graphics device: {}. trace info: {}", this->_gDevice->get_info(), _trace_info); return W_FAILED; } } else { //create seperated buffer if (this->_memory_flag & w_memory_usage_flag::MEMORY_USAGE_CPU_ONLY) { this->_memory_property_flags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; } else if (this->_memory_flag & w_memory_usage_flag::MEMORY_USAGE_GPU_ONLY) { this->_memory_property_flags = w_memory_property_flag_bits::DEVICE_LOCAL_BIT; } const VkBufferCreateInfo _buffer_create_info = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, // Type nullptr, // Next 0, // Flags (VkDeviceSize)pBufferSizeInBytes, // Size (VkBufferUsageFlags)this->_usage_flags, // Usage VK_SHARING_MODE_EXCLUSIVE, // SharingMode 0, // QueueFamilyIndexCount nullptr // QueueFamilyIndices }; auto _hr = vkCreateBuffer(this->_gDevice->vk_device, &_buffer_create_info, nullptr, &this->_buffer_handle.handle); if (_hr) { V(W_FAILED, w_log_type::W_ERROR, "creating buffer for graphics device: {}. trace info: {}", this->_gDevice->get_info(), _trace_info); return W_FAILED; } VkMemoryRequirements _buffer_memory_requirements; vkGetBufferMemoryRequirements(this->_gDevice->vk_device, this->_buffer_handle.handle, &_buffer_memory_requirements); VkPhysicalDeviceMemoryProperties _memory_properties; vkGetPhysicalDeviceMemoryProperties(this->_gDevice->vk_physical_device, &_memory_properties); uint32_t _mem_index = 0; if (w_graphics_device_manager::memory_type_from_properties( _memory_properties, _buffer_memory_requirements.memoryTypeBits, _memory_property_flags, &_mem_index)) { V(W_FAILED, w_log_type::W_ERROR, "finding memory index of buffer for graphics device: {}. trace info; {}", this->_gDevice->get_info(), _trace_info); return W_FAILED; } VkMemoryAllocateInfo _memory_allocate_info = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, // Type nullptr, // Next _buffer_memory_requirements.size, // AllocationSize _mem_index // MemoryTypeIndex }; if (vkAllocateMemory(this->_gDevice->vk_device, &_memory_allocate_info, nullptr, &this->_memory_allocation_info.deviceMemory)) { V(W_FAILED, w_log_type::W_ERROR, "allocating memory of buffer for graphics device: {}. trace info: {}", this->_gDevice->get_info(), _trace_info); return W_FAILED; } this->_memory_allocation_info.offset = 0; this->_memory_allocation_info.size = pBufferSizeInBytes; } this->_used_memory_size = pBufferSizeInBytes; this->_descriptor_info.buffer = this->_buffer_handle.handle; this->_descriptor_info.offset = 0;// this->_memory_allocation_info.offset; this->_descriptor_info.range = this->_used_memory_size;//this->_memory_allocation_info.size; return W_PASSED; } W_RESULT reallocate(_In_ const uint32_t pBufferSizeInBytes) { //const std::string _trace_info = this->_name + "::reallocate"; if (!this->_gDevice) return W_FAILED; if (free() == W_PASSED) { return allocate(this->_gDevice, pBufferSizeInBytes, this->_usage_flags, this->_memory_flag, this->_allocated_from_pool); } return W_FAILED; } W_RESULT bind() { if (this->_allocated_from_pool) { return this->_gDevice->memory_allocator.bind(this->_memory_allocation, this->_buffer_handle.handle); } else { return vkBindBufferMemory(this->_gDevice->vk_device, this->_buffer_handle.handle, this->_memory_allocation_info.deviceMemory, 0) == VK_SUCCESS ? W_PASSED : W_FAILED; } } //Set data to DRAM W_RESULT set_data(_In_ const void* const pData) { //we can not access to VRAM, but we can copy our data to DRAM if (this->_memory_flag == w_memory_usage_flag::MEMORY_USAGE_GPU_ONLY) return W_FAILED; if (map() == nullptr) return W_FAILED; memcpy(this->_map_data, pData, static_cast<size_t>(this->_used_memory_size));// memory_allocation_info.size); auto _hr = flush(); unmap(); return _hr; } W_RESULT copy_to(_In_ w_buffer& pDestinationBuffer) { const std::string _trace_info = this->_name + "::copy_to"; //create one command buffer w_command_buffers _copy_command_buffer; auto _hr = _copy_command_buffer.load(this->_gDevice, 1); if (_hr != W_PASSED) { V(W_FAILED, w_log_type::W_ERROR, "loading command buffer for graphics device: {}. trace info: {}", _gDevice->get_info(), _trace_info); return _hr; } _hr = _copy_command_buffer.begin(0); if (_hr != W_PASSED) { _copy_command_buffer.release(); V(W_FAILED, w_log_type::W_ERROR, "begining command buffer for graphics device: {}. trace info: {}", _gDevice->get_info(), _trace_info); return _hr; } VkBufferCopy _copy_region = {}; _copy_region.srcOffset = 0;// get_offset(); _copy_region.dstOffset = 0;// pDestinationBuffer.get_offset(); _copy_region.size = this->_used_memory_size; auto _dest_buffer = pDestinationBuffer.get_buffer_handle(); vkCmdCopyBuffer( _copy_command_buffer.get_command_at(0).handle, this->_buffer_handle.handle, _dest_buffer.handle, 1, &_copy_region); _hr = _copy_command_buffer.flush(0);// this->_gDevice); if (_hr != W_PASSED) { V(W_FAILED, w_log_type::W_ERROR, "flushing command buffer of graphics device: {}. trace info: {}", _gDevice->get_info(), _trace_info); } _copy_command_buffer.release(); return _hr; } void* map() { const std::string _trace_info = this->_name + "::map"; if (this->_allocated_from_pool) { if (this->_gDevice->memory_allocator.map(this->_memory_allocation, &this->_map_data) == W_FAILED) { this->_map_data = nullptr; V(W_FAILED, w_log_type::W_ERROR, "mapping memory for graphics device: {}. trace info: {}", this->_gDevice->get_info(), _trace_info); return nullptr; } } else { if (this->_memory_property_flags & w_memory_property_flag_bits::DEVICE_LOCAL_BIT) return nullptr; if (vkMapMemory(this->_gDevice->vk_device, this->_memory_allocation_info.deviceMemory, 0, this->_memory_allocation_info.size, 0, &this->_map_data)) { this->_map_data = nullptr; V(W_FAILED, w_log_type::W_ERROR, "mapping memory for graphics device: {}. trace info: {}", this->_gDevice->get_info(), _trace_info); return nullptr; } } this->_mapped = true; return this->_map_data; } void unmap() { if (this->_allocated_from_pool) { this->_gDevice->memory_allocator.unmap(this->_memory_allocation); } else { vkUnmapMemory(this->_gDevice->vk_device, this->_memory_allocation_info.deviceMemory); } this->_mapped = false; if (this->_map_data) { this->_map_data = nullptr; } } W_RESULT flush() { VkMemoryPropertyFlags _mem_flags = this->_gDevice->memory_allocator.get_memory_property_flags(this->_memory_allocation_info); if ((_mem_flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) == 0) { VkMappedMemoryRange _mem_range = { VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE }; _mem_range.memory = this->_memory_allocation_info.deviceMemory; _mem_range.offset = this->_memory_allocation_info.offset; _mem_range.size = this->_used_memory_size;//this->_memory_allocation_info.size return vkFlushMappedMemoryRanges(this->_gDevice->vk_device, 1, &_mem_range) ? W_FAILED : W_PASSED; } return W_PASSED; } W_RESULT free() { if (!this->_gDevice) return W_FAILED; if (this->_mapped) { unmap(); } if (this->_allocated_from_pool) { this->_gDevice->memory_allocator.free_buffer(this->_memory_allocation, this->_buffer_handle.handle); SAFE_DELETE(this->_memory_allocation); } else { if (this->_buffer_handle.handle) { vkDestroyBuffer(this->_gDevice->vk_device, this->_buffer_handle.handle, nullptr); this->_buffer_handle.handle = 0; } if (this->_memory_allocation_info.deviceMemory) { vkFreeMemory(this->_gDevice->vk_device, this->_memory_allocation_info.deviceMemory, nullptr); this->_memory_allocation_info.deviceMemory = 0; } } this->_used_memory_size = 0; return W_PASSED; } ULONG release() { this->_name.clear(); free(); this->_gDevice = nullptr; return 0; } const uint32_t get_size() const { return (uint32_t)this->_used_memory_size; } const uint32_t get_global_size() const { return (uint32_t)this->_memory_allocation_info.size; } const uint32_t get_offset() const { return (uint32_t)this->_memory_allocation_info.offset; } //const uint32_t get_global_offset() const //{ // return (uint32_t)this->_memory_allocation_info.offset; //} const w_device_memory get_memory() const { w_device_memory _memory; _memory.handle = this->_memory_allocation_info.deviceMemory; return _memory; } const uint32_t get_usage_flags() const { return this->_usage_flags; } const uint32_t get_memory_flags() const { return this->_memory_flag; } const w_buffer_handle get_handle() const { return this->_buffer_handle; } const w_descriptor_buffer_info get_descriptor_info() const { return this->_descriptor_info; } private: std::string _name; std::shared_ptr<w_graphics_device> _gDevice; bool _mapped; void* _map_data; w_buffer_handle _buffer_handle; w_memory_usage_flag _memory_flag; uint32_t _usage_flags; w_descriptor_buffer_info _descriptor_info; VmaAllocation* _memory_allocation; VmaAllocationInfo _memory_allocation_info; bool _allocated_from_pool; uint32_t _memory_property_flags; VkDeviceSize _used_memory_size; }; } } } using namespace wolf::render::vulkan; w_buffer::w_buffer() : _is_released(false), _pimp(new w_buffer_pimp()) { } w_buffer::~w_buffer() { release(); } W_RESULT w_buffer::allocate_as_staging( _In_ const std::shared_ptr<w_graphics_device>& pGDevice, _In_ const uint32_t pBufferSize, _In_ const bool pAllocateFromMemoryPool) { if (!this->_pimp) return W_FAILED; return this->_pimp->allocate(pGDevice, pBufferSize, VK_BUFFER_USAGE_TRANSFER_SRC_BIT, w_memory_usage_flag::MEMORY_USAGE_CPU_ONLY, pAllocateFromMemoryPool); } W_RESULT w_buffer::allocate( _In_ const std::shared_ptr<w_graphics_device>& pGDevice, _In_ const uint32_t pBufferSizeInBytes, _In_ const uint32_t pUsageFlags, _In_ const w_memory_usage_flag pMemoryFlag, _In_ const bool pAllocateFromMemoryPool) { if(!this->_pimp) return W_FAILED; return this->_pimp->allocate(pGDevice, pBufferSizeInBytes, pUsageFlags, pMemoryFlag, pAllocateFromMemoryPool); } W_RESULT w_buffer::reallocate(_In_ const uint32_t pBufferSizeInBytes) { if (!this->_pimp) return W_FAILED; return this->_pimp->reallocate(pBufferSizeInBytes); } W_RESULT w_buffer::bind() { if (!this->_pimp) return W_FAILED; return this->_pimp->bind(); } W_RESULT w_buffer::set_data(_In_ const void* const pData) { if(!this->_pimp) return W_FAILED; return this->_pimp->set_data(pData); } W_RESULT w_buffer::copy_to(_In_ w_buffer& pDestinationBuffer) { if (!this->_pimp) return W_FAILED; return this->_pimp->copy_to(pDestinationBuffer); } void* w_buffer::map() { if (!this->_pimp) return nullptr; return this->_pimp->map(); } void w_buffer::unmap() { if (!this->_pimp) return; this->_pimp->unmap(); } W_RESULT w_buffer::flush() { if (!this->_pimp) return W_FAILED; return this->_pimp->flush(); } W_RESULT w_buffer::free() { if (!this->_pimp) return W_FAILED; return this->_pimp->free(); } ULONG w_buffer::release() { if(this->_is_released) return 1; SAFE_RELEASE(this->_pimp); this->_is_released = true; return 0; } #pragma region Getters const uint32_t w_buffer::get_size() const { if(!this->_pimp) return 0; return this->_pimp->get_size(); } // //const uint32_t w_buffer::get_global_offset() const //{ // if (!this->_pimp) return 0; // // return this->_pimp->get_global_offset(); //} const uint32_t w_buffer::get_offset() const { if (!this->_pimp) return 0; return this->_pimp->get_offset(); } const uint32_t w_buffer::get_usage_flags() const { if(!this->_pimp) return VkBufferUsageFlagBits::VK_BUFFER_USAGE_FLAG_BITS_MAX_ENUM; return this->_pimp->get_usage_flags(); } const uint32_t w_buffer::get_memory_flags() const { if(!this->_pimp) return w_memory_property_flag_bits::DEVICE_LOCAL_BIT; return this->_pimp->get_memory_flags(); } const w_buffer_handle w_buffer::get_buffer_handle() const { if(!this->_pimp) return w_buffer_handle(); return this->_pimp->get_handle(); } const w_descriptor_buffer_info w_buffer::get_descriptor_info() const { if (!this->_pimp) { w_descriptor_buffer_info _buffer_info; _buffer_info.buffer = 0; _buffer_info.offset = 0; _buffer_info.range = 0; return _buffer_info; } return this->_pimp->get_descriptor_info(); } const w_device_memory w_buffer::get_memory() const { return this->_pimp ? this->_pimp->get_memory() : w_device_memory(); } #pragma endregion
{ "content_hash": "5d3883f22bf697e70a6651d80174d378", "timestamp": "", "source": "github", "line_count": 619, "max_line_length": 130, "avg_line_length": 26.793214862681744, "alnum_prop": 0.5799216159179982, "repo_name": "PooyaEimandar/WolfEngine", "id": "f777e84d5d43982cfa40626a8607bb637cf89097", "size": "16684", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "engine/src/wolf.render/vulkan/w_buffer.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "5545" }, { "name": "C++", "bytes": "317259" }, { "name": "Objective-C", "bytes": "1179" }, { "name": "Python", "bytes": "1532" } ], "symlink_target": "" }
namespace Graphics{ class Bitmap; } class Animation; namespace Storage{ class AbsolutePath; } namespace Paintown{ class Actor: public ObjectNonAttack { public: Actor( const Filesystem::AbsolutePath & filename ); Actor( const Actor & item ); virtual void act( std::vector< Object * > * others, World * world, std::vector< Object * > * add ); virtual void draw( Graphics::Bitmap * work, int rel_x, int rel_y ); virtual bool isCollidable( Object * obj ); virtual bool isGettable(); virtual int getWidth() const; virtual int getHeight() const; virtual Network::Message getCreateMessage(); virtual Object * copy(); virtual ~Actor(); protected: std::vector< Animation * > animations; Animation * current_animation; }; } #endif
{ "content_hash": "91c17f6680e4847e74f63f932808283c", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 100, "avg_line_length": 20.37837837837838, "alnum_prop": 0.7042440318302388, "repo_name": "Sevalecan/paintown", "id": "d4dfe70eb591e3c368b83913590a2af2b499a057", "size": "938", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/paintown-engine/object/actor.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ApacheConf", "bytes": "58533" }, { "name": "C", "bytes": "4873643" }, { "name": "C++", "bytes": "7998163" }, { "name": "HTML", "bytes": "1129787" }, { "name": "Java", "bytes": "685830" }, { "name": "Makefile", "bytes": "6324" }, { "name": "Objective-C", "bytes": "21651" }, { "name": "Perl", "bytes": "15275" }, { "name": "Python", "bytes": "554146" }, { "name": "Racket", "bytes": "10157" }, { "name": "Ruby", "bytes": "231143" }, { "name": "Scala", "bytes": "305676" }, { "name": "Scheme", "bytes": "5291" }, { "name": "Shell", "bytes": "64837" }, { "name": "VimL", "bytes": "115" } ], "symlink_target": "" }
// // IAASViewController.m // IAAS // // Created by Brandon Williams on 8/10/10. // Copyright 2010 Opetopic. All rights reserved. // #import "IAASViewController.h" @implementation IAASViewController @synthesize delegate; @synthesize iaasURLPath; @synthesize showCloseButton; #pragma mark Initialization methods -(id) initWithURLPath:(NSString *)path { if (self = [super init]) { self.iaasURLPath = path; } return self; } -(void) viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor blackColor]; // show an activity view while loading the IAAS UIActivityIndicatorView *activity = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; activity.center = self.view.center; [activity startAnimating]; [self.view addSubview:activity]; [activity release]; // full screen webview for the app store UIWebView *web = [[UIWebView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 480.0f)]; web.hidden = YES; web.delegate = self; [self.view addSubview:web]; NSURLRequest *r = [NSURLRequest requestWithURL:[NSURL URLWithString:iaasURLPath]]; [web loadRequest:r]; web.tag = 0; [web release]; // add a close button to the top-left corner of the view UIImage *closeImage = [UIImage imageNamed:@"IAAS.bundle/close.png"]; closeButton = [[UIButton alloc] initWithFrame:CGRectMake(2.0f, 2.0f, closeImage.size.width, closeImage.size.height)]; closeButton.hidden = ! showCloseButton; [closeButton setImage:closeImage forState:UIControlStateNormal]; [closeButton addTarget:self action:@selector(closeButtonPressed) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:closeButton]; } #pragma mark - #pragma mark Interface actions -(void) closeButtonPressed { // let our delegate know we are closing if ([(id)delegate respondsToSelector:@selector(IAASDidClose:)]) [delegate IAASDidClose:self]; // we might show this view modally or inside a navigation controller, so remove us accordingly [self dismissModalViewControllerAnimated:YES]; [self.navigationController popViewControllerAnimated:YES]; } #pragma mark - #pragma mark UIWebView delegate methods -(void) webViewDidFinishLoad:(UIWebView *)webView { webView.hidden = NO; } -(void) webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { // the first time the webview fails to load we will try loading the local version of the IAAS webView.tag++; if (webView.tag == 1) { NSString *html = [NSString stringWithContentsOfFile:[[[NSBundle mainBundle] pathForResource:@"IAAS" ofType:@"bundle"] stringByAppendingPathComponent:@"index.html"] encoding:NSUTF8StringEncoding error:NULL]; NSURL *base = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"IAAS" ofType:@"bundle"]]; [webView loadHTMLString:html baseURL:base]; } } -(BOOL) webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { // allow following links in the webview if (navigationType == UIWebViewNavigationTypeLinkClicked) [[UIApplication sharedApplication] openURL:[request URL]]; return YES; } #pragma mark - #pragma mark Custom getters and setters -(void) setShowCloseButton:(BOOL)b { showCloseButton = b; closeButton.hidden = !b; } -(CGSize) contentSizeForViewInPopover { return CGSizeMake(320.0f, 480.0f); } #pragma mark - #pragma mark Memory management - (void)dealloc { delegate = nil; [closeButton release], closeButton = nil; [iaasURLPath release], iaasURLPath = nil; [super dealloc]; } @end
{ "content_hash": "805fba4d41053b3c2e36bcb30cd9c23f", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 208, "avg_line_length": 30.38135593220339, "alnum_prop": 0.7581589958158996, "repo_name": "mbrandonw/In-App-App-Store", "id": "82d21c09e74b855d858c0bf11a485234fac6984f", "size": "3585", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "IAAS/IAASViewController.m", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "1308" }, { "name": "Objective-C", "bytes": "5780" } ], "symlink_target": "" }
#ifndef TIMERS_H #define TIMERS_H /************* Semantic Versioning***************/ #define TIMERS_LIBRARY /************* Magic Numbers ***************/ #define NO_TIMER_INTERRUPT (void*)0 #define TIMER_ON 1 #define TIMER_OFF 0 /************* Enumeration ***************/ enum TIMERS_AVAILABLE { #if defined __PIC24F08KL200__ TIMER1, TIMER2, TIMER3, #elif defined PLACE_MICROCHIP_PART_NAME_HERE TIMER1, TIMER2, TIMER3, TIMER4, #else #warning "This chip is not setup for timers yet" #endif NUMBER_OF_AVAILABLE_TIMERS }; enum TIMER_UNITS { SECONDS, MILLI_SECONDS, MICRO_SECONDS, NANO_SECONDS, TICKS }; /***********State Machine Definitions************/ /*************Function Prototypes***************/ /** * Initializes the specified timer to have a set period * @param timer The target timer, use the enum TIMERS_AVAILABLE * @param time The length of time it takes the timer to expire * @param units The units to use (S, mS, uS, nS). Use the enum TIMER_UNITS to correctly specify * @param interruptFunction The function that will be called when the timer expires, it should be a function pointer that has the format of "void Some_Function(void)"\ * Sending a null pointer "(void *)0" is acceptable, this would be done if you did not want a function to be called during the interrupt * @return 1 = everything was verified and the timer has been properly initialized\ * 0 = Something failed, either an argument sent was out of range or the timer is unavailable on the current chip */ int Initialize_Timer(enum TIMERS_AVAILABLE timer, int time, enum TIMER_UNITS units, void (*interruptFunction)(void)); /** * Initializes Timer 3 as a gated timer * @param time The length of time it takes the timer to expire * @param units The units to use (S, mS, uS, nS). Use the enum TIMER_UNITS to correctly specify * @param gateSource What source causes the gate to open and close\ * 0 = T3G input pin\ * 1 = TMR2 to match PR2 output\ * 2 = Comparator 1 output\ * 3 = Comparator 2 output * @param mode How the timer accumulates\ * 0 = Timer Gate Single Pulse mode is disabled <---- I believe this means it stop-starts every time a pulse occurs, giving the total amount of time the gate was open\ * 1 = Timer Gate Single Pulse mode is enabled <---- I believe this means it auto-resets every time a new pulse starts, giving the total amount of time the pulse lasted * @param triggerPolarity On which edge should the trigger occur\ * 0 = Active Low\ * 1 = Active High * @param interruptFunction The function that will be called when the timer expires, it should be a function pointer that has the format of "void Some_Function(void)"\ * Sending a null pointer "(void *)0" is acceptable, this would be done if you did not want a function to be called during the interrupt * @return 1 = everything was verified and the timer has been properly initialized\ * 0 = Something failed, either an argument sent was out of range or the timer is unavailable on the current chip */ int Initialize_TMR3_As_Gated_Timer(int time, enum TIMER_UNITS units, int gateSource, int mode, int triggerPolarity, void (*interruptFunction)(void)); /** * This function will turn on or off a specified timer * @param timer The target timer, use the enum TIMERS_AVAILABLE * @param newState The state that the timer should be changed to\ * 1 = Enabled\ * 0 = Disabled * @return 1 = The timer was succefully changed\ * 0 = Either the timer was out of range or the new state was invalid */ int Change_Timer_Trigger(enum TIMERS_AVAILABLE timer, int newState); /** * Allows the reading of the timer value * @param timer The target timer, use the enum TIMERS_AVAILABLE * @param timeUnits The units to use (S, mS, uS, nS). Use the enum TIMER_UNITS to correctly specify * @return The current timer value in the units specified */ int Current_Timer(enum TIMERS_AVAILABLE timer, enum TIMER_UNITS units); /** * Allow the lengthening or shortening of the timers length * @param timer The target timer, use the enum TIMERS_AVAILABLE * @param time The desired length of time it takes the timer to expire * @param units The units to use (S, mS, uS, nS). Use the enum TIMER_UNITS to correctly specify * @return 1 = everything was verified and the timer has been properly setup\ * 0 = Something failed, either an argument sent was out of range or the timer is unavailable on the current chip */ int Change_Timer_Time(enum TIMERS_AVAILABLE timer, int time, enum TIMER_UNITS units); #endif /* TIMERS_H */
{ "content_hash": "4dfbb8a1ca327987dc89ea3389b6f94a", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 168, "avg_line_length": 43.49038461538461, "alnum_prop": 0.718770727393323, "repo_name": "CraigComberbach/Timers", "id": "b3f73c10e2f22462d896ddd61eeabd3953f6cb7e", "size": "4523", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Firmware/Timers.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "25102" }, { "name": "C++", "bytes": "4523" } ], "symlink_target": "" }
<?php /** * Use the DS to separate the directories in other defines */ if (!defined('DS')) { define('DS', DIRECTORY_SEPARATOR); } /** * These defines should only be edited if you have cake installed in * a directory layout other than the way it is distributed. * When using custom settings be sure to use the DS and do not add a trailing DS. */ /** * The full path to the directory which holds "app", WITHOUT a trailing DS. * */ if (!defined('ROOT')) { define('ROOT', dirname(dirname(dirname(__FILE__)))); } /** * The actual directory name for the "app". * */ if (!defined('APP_DIR')) { define('APP_DIR', basename(dirname(dirname(__FILE__)))); } /** * The absolute path to the "cake" directory, WITHOUT a trailing DS. * * Un-comment this line to specify a fixed path to CakePHP. * This should point at the directory containing `Cake`. * * For ease of development CakePHP uses PHP's include_path. If you * cannot modify your include_path set this value. * * Leaving this constant undefined will result in it being defined in Cake/bootstrap.php */ //define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib'); /** * Editing below this line should NOT be necessary. * Change at your own risk. * */ if (!defined('WEBROOT_DIR')) { define('WEBROOT_DIR', basename(dirname(__FILE__))); } if (!defined('WWW_ROOT')) { define('WWW_ROOT', dirname(__FILE__) . DS); } require_once ROOT . DS . 'vendor' . DS . 'autoload.php'; if (!require_once ROOT . DS . 'vendor' . DS . 'cakephp' . DS . 'cakephp' . DS . 'lib' . DS . 'Cake' . DS . 'bootstrap.php') { trigger_error("CakePHP core could not be found. Use 'composer update' or 'composer install' at the top of the project!", E_USER_ERROR); } if (isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] == '/favicon.ico') { return; } App::uses('Dispatcher', 'Routing'); $Dispatcher = new Dispatcher(); $Dispatcher->dispatch(new CakeRequest(), new CakeResponse(array('charset' => Configure::read('App.encoding'))));
{ "content_hash": "6d3370230118c64b2bd7b66fa4f4a937", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 136, "avg_line_length": 28.72463768115942, "alnum_prop": 0.6619576185671039, "repo_name": "imsamurai/cakephp-environment", "id": "05da95a1d200ef14f9d0f8acfba203eb5476b36c", "size": "2630", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Template/webroot/index.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "39731" }, { "name": "Shell", "bytes": "5289" } ], "symlink_target": "" }
package org.spongepowered.api.event.entity; import org.spongepowered.api.entity.Entity; import org.spongepowered.api.util.event.Cancellable; /** * Called when an {@link Entity} is tamed. */ public interface EntityTameEvent extends EntityEvent, Cancellable { }
{ "content_hash": "099b2aa9646800720865c8d66bbec342", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 67, "avg_line_length": 20.46153846153846, "alnum_prop": 0.7781954887218046, "repo_name": "Fozie/SpongeAPI", "id": "fbc27fd56a27097d5d08a3d23dcb9ecfff08041e", "size": "1516", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/org/spongepowered/api/event/entity/EntityTameEvent.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "893003" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "1181b5a05cfa0599b13f53042791b550", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "acc2ecdf3336f9ca90f2c3d85d6fcfc3a777480b", "size": "178", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Laurales/Lauraceae/Acrodiclidium/Acrodiclidium ita-uba/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
// Copyright 2011 Splunk, Inc. // // 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. exports.setup = function (svc, loggedOutSvc) { return ( describe("Service tests", function (done) { require("./service_tests/app").setup(svc); require("./service_tests/collection").setup(svc, loggedOutSvc); require("./service_tests/configuration").setup(svc); require("./service_tests/datamodels").setup(svc); require("./service_tests/endpoint").setup(svc); require("./service_tests/entity").setup(svc, loggedOutSvc); require("./service_tests/firedalerts").setup(svc, loggedOutSvc); require("./service_tests/indexes").setup(svc, loggedOutSvc); require("./service_tests/job").setup(svc); require("./service_tests/namespace").setup(svc); require("./service_tests/parser").setup(svc); require("./service_tests/pivot").setup(svc); require("./service_tests/properties").setup(svc); require("./service_tests/savedsearch").setup(svc, loggedOutSvc); require("./service_tests/serverinfo").setup(svc); require("./service_tests/storagepasswords").setup(svc); require("./service_tests/typeahead").setup(svc, loggedOutSvc); require("./service_tests/user").setup(svc, loggedOutSvc); require("./service_tests/view").setup(svc); }) ) }; if (module.id === __filename && module.parent.id.includes('mocha')) { var splunkjs = require('../index'); var options = require('./cmdline'); var cmdline = options.create().parse(process.argv); // If there is no command line, we should return if (!cmdline) { throw new Error("Error in parsing command line parameters"); } if (!process.env.SPLUNK_HOME) { throw new Error("$PATH variable SPLUNK_HOME is not set. Please export SPLUNK_HOME to the splunk instance."); } var svc = new splunkjs.Service({ scheme: cmdline.opts.scheme, host: cmdline.opts.host, port: cmdline.opts.port, username: cmdline.opts.username, password: cmdline.opts.password, version: cmdline.opts.version }); var loggedOutSvc = new splunkjs.Service({ scheme: cmdline.opts.scheme, host: cmdline.opts.host, port: cmdline.opts.port, username: cmdline.opts.username, password: cmdline.opts.password + 'wrong', version: cmdline.opts.version }); // Exports tests on a successful login module.exports = new Promise((resolve, reject) => { svc.login(function (err, success) { if (err || !success) { throw new Error("Login failed - not running tests", err || ""); } return resolve(exports.setup(svc, loggedOutSvc)); }); }); }
{ "content_hash": "a0d16c05d266bbc213b2140ad9b40164", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 116, "avg_line_length": 41.416666666666664, "alnum_prop": 0.6096579476861167, "repo_name": "splunk/splunk-sdk-javascript", "id": "c4b24aff5377ad0c9e10cc86d3cd4cf404f26cc0", "size": "3479", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/test_service.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "15" }, { "name": "CSS", "bytes": "24231" }, { "name": "EJS", "bytes": "725" }, { "name": "HTML", "bytes": "4418" }, { "name": "JavaScript", "bytes": "8063472" }, { "name": "Makefile", "bytes": "1573" }, { "name": "Mustache", "bytes": "35665" }, { "name": "Shell", "bytes": "1791" } ], "symlink_target": "" }
__author__ = 'Alex' from PyQt4.QtGui import * import sys import json import requests,base64 from PyQt4 import uic import threading class Window(QWidget): def __init__(self,parent=None): QWidget.__init__(self) authThread=threading.Thread(target=self.Auth()) uiThread=threading.Thread(target=self.UiInit()) #getRemithread=threading.Thread(target=self.DatosDeRemitentes()) #getDestiThread=threading.Thread(target=self.DatosDeDestinatarios()) authThread.start() #getRemithread.start() #getDestiThread.start() uiThread.start() def Auth(self): username='here the username of your api django rest' password='passwd of your api' base64string = base64.encodestring('%s:%s' % (username, password)).replace('\n', '') self.cabecera = { #"Content-Type" : "application/json", "Authorization": "Basic %s"%(base64string), #"Accept":"application/json" } """def DatosDeRemitentes(self): url="http://192.168.0.2:8000/remitentes" response=requests.get(url,headers=self.cabecera) print response.json() list=response.json() print "\nREMITENTES\n" for item in list: id=item['id'] nombre=item['nombre'] correo= item['correo'] cadena= "\nId: "+str(id)+"\n"+"Nombre: "+nombre+"\n"+"Correo: "+correo print cadena""" """def DatosDeDestinatarios(self): url="http://192.168.0.2:8000/destinatarios" response=requests.get(url,headers=self.cabecera) print response.json() list=response.json() print "\nDESTINATARIOS\n" for item in list: id=item['id'] nombre=item['nombre'] correo= item['correo'] cadena= "\nId: "+str(id)+"\n"+"Nombre: "+nombre+"\n"+"Correo: "+correo print cadena""" def UiInit(self): uic.loadUi("view.ui",self) #sendThread=threading.Thread(target=self.SendMail()) self.btnSend.clicked.connect(self.SendData) def SendData(self): _from=self.leFrom.text() _to=self.leTo.text() _subject=self.leSubject.text() _message=self.teMessage.toPlainText() correo=json.dumps({"remitente":unicode(_from),"destinatario":unicode(_to),"asunto":unicode(_subject),"mensaje":unicode(_message)}) url = 'http://192.168.0.2:8000/sendMail/' username='alex' password='admin' base64string = base64.encodestring('%s:%s' % (username, password)).replace('\n', '') cabeceras = { "Content-Type" : "application/json", "Authorization": "Basic %s"%(base64string), "Accept":"application/json" } response=requests.post(url,data=correo,headers=cabeceras) print response if __name__=="__main__": app=QApplication(sys.argv) ventana=Window() ventana.show() sys.exit(app.exec_())
{ "content_hash": "56199769721e13617d678c636d66bb9d", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 138, "avg_line_length": 34.12222222222222, "alnum_prop": 0.57896450667535, "repo_name": "AlexEnriquez/PyQtMail", "id": "4a4340b169a5b7892a0bd3c0fc45f4c65c6a7d8d", "size": "3071", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "PyQtMail/app.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "13468" } ], "symlink_target": "" }
package org.jetbrains.plugins.gradle.service.settings; import com.intellij.openapi.externalSystem.model.ProjectSystemId; import com.intellij.openapi.externalSystem.service.settings.ExternalSystemConfigLocator; import com.intellij.openapi.externalSystem.settings.ExternalProjectSettings; import com.intellij.openapi.vfs.LocalFileSystem; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.util.containers.ContainerUtil; import org.gradle.tooling.GradleConnector; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.plugins.gradle.util.GradleConstants; import java.io.File; import java.util.List; /** * We store not gradle config file but its parent dir path instead. That is implied by gradle design * ({@link GradleConnector#forProjectDirectory(File)}). * <p/> * That's why we need to provide special code which maps that directory to exact config file. * * @author Denis Zhdanov * @since 7/16/13 3:43 PM */ public class GradleConfigLocator implements ExternalSystemConfigLocator { @NotNull @Override public ProjectSystemId getTargetExternalSystemId() { return GradleConstants.SYSTEM_ID; } @Nullable @Override public VirtualFile adjust(@NotNull VirtualFile configPath) { if (!configPath.isDirectory()) { return configPath; } VirtualFile result = configPath.findChild(GradleConstants.DEFAULT_SCRIPT_NAME); if (result != null) { return result; } result = configPath.findChild(GradleConstants.KOTLIN_DSL_SCRIPT_NAME); if (result != null) { return result; } for (VirtualFile child : configPath.getChildren()) { String name = child.getName(); if (!name.endsWith(GradleConstants.EXTENSION) || !name.endsWith(GradleConstants.KOTLIN_DSL_SCRIPT_EXTENSION)) { continue; } if (!GradleConstants.SETTINGS_FILE_NAME.equals(name) && !GradleConstants.KOTLIN_DSL_SETTINGS_FILE_NAME.equals(name) && !child.isDirectory()) { return child; } } return null; } @NotNull @Override public List<VirtualFile> findAll(@NotNull ExternalProjectSettings externalProjectSettings) { List<VirtualFile> list = ContainerUtil.newArrayList(); for (String path : externalProjectSettings.getModules()) { VirtualFile vFile = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(path)); if (vFile != null) { for (VirtualFile child : vFile.getChildren()) { String name = child.getName(); if (!child.isDirectory() && name.endsWith(GradleConstants.EXTENSION)) { list.add(child); } } } } return list; } }
{ "content_hash": "c724ce76f42fe3d66aca74dbdb3c3b32", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 117, "avg_line_length": 33.370370370370374, "alnum_prop": 0.7162412134665187, "repo_name": "sabi0/intellij-community", "id": "78219777cff740b3dc510cf011d8c70c67523ce5", "size": "2703", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "plugins/gradle/src/org/jetbrains/plugins/gradle/service/settings/GradleConfigLocator.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <CQLQuery xmlns="http://CQL.caBIG/1/gov.nih.nci.cagrid.CQLQuery"> <Target name="edu.wustl.catissuecore.domain.SpecimenRequirement"/> </CQLQuery>
{ "content_hash": "fa8167fbb86c57ff37752659beb23f20", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 66, "avg_line_length": 46, "alnum_prop": 0.7391304347826086, "repo_name": "NCIP/catissue-core", "id": "46cb011a729070a1e68cf8c2283e8b1d54cff8f1", "size": "184", "binary": false, "copies": "1", "ref": "refs/heads/trunk", "path": "software/caTissue/modules/caTissueStaticDataService/queries/SpecimenRequirement.xml", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ActionScript", "bytes": "263825" }, { "name": "CSS", "bytes": "355520" }, { "name": "Java", "bytes": "11570343" }, { "name": "JavaScript", "bytes": "957613" }, { "name": "Shell", "bytes": "1912" }, { "name": "XSLT", "bytes": "256376" } ], "symlink_target": "" }
using System; using CoreFoundation; using CoreGraphics; using Foundation; using SceneKit; using UIKit; namespace PlacingObjects { public partial class ViewController : IVirtualObjectManagerDelegate, IVirtualObjectSelectionViewControllerDelegate { public void CouldNotPlace(VirtualObjectManager manager, VirtualObject virtualObject) { UserFeedback.ShowMessage("Cannot place object\nTry moving left or right."); } public void DidLoad(VirtualObjectManager manager, VirtualObject virtualObject) { IsLoadingObject = false; //Remove progress indicator Spinner.RemoveFromSuperview(); AddObjectButton.SetImage(UIImage.FromBundle("add"), UIControlState.Normal); AddObjectButton.SetImage(UIImage.FromBundle("addPressed"), UIControlState.Highlighted); } public void WillLoad(VirtualObjectManager manager, VirtualObject virtualObject) { // Show progress indicator Spinner = new UIActivityIndicatorView(); Spinner.Center = AddObjectButton.Center; Spinner.Bounds = new CGRect(0, 0, AddObjectButton.Bounds.Width - 5, AddObjectButton.Bounds.Height - 5); AddObjectButton.SetImage(UIImage.FromBundle("buttonring"), UIControlState.Normal); SceneView.AddSubview(Spinner); Spinner.StartAnimating(); IsLoadingObject = true; } public void DidSelectObjectAt(int index) { if (Session == null || ViewController.CurrentFrame == null) { return; } var cameraTransform = ViewController.CurrentFrame.Camera.Transform; var definition = VirtualObjectManager.AvailableObjects[index]; var vo = new VirtualObject(definition); var position = FocusSquare != null ? FocusSquare.LastPosition : new SCNVector3(0, 0, -1.0f); virtualObjectManager.LoadVirtualObject(vo, position, cameraTransform); if (vo.ParentNode == null) { SceneView.Scene.RootNode.AddChildNode(vo); } } public void DidDeselectObjectAt(int index) { virtualObjectManager.RemoveVirtualObject(index); } } }
{ "content_hash": "1f762a9568249b7d6278b9da1f7f8e53", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 115, "avg_line_length": 31.56451612903226, "alnum_prop": 0.7634133878385284, "repo_name": "xamarin/monotouch-samples", "id": "c402b20912ecb3fc00939a167c6ba271db42c6ce", "size": "1959", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ios11/ARKitPlacingObjects/PlacingObjects/ViewController+ObjectSelection.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "5568672" }, { "name": "F#", "bytes": "11402" }, { "name": "GLSL", "bytes": "13657" }, { "name": "HTML", "bytes": "9912" }, { "name": "Makefile", "bytes": "16378" }, { "name": "Metal", "bytes": "4299" }, { "name": "Objective-C", "bytes": "106014" }, { "name": "Shell", "bytes": "6235" } ], "symlink_target": "" }
@interface IUTAssertionInfoTest : IUTTest { } @end
{ "content_hash": "91b2beeb729d80cc6787fd17932d3d85", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 43, "avg_line_length": 10.6, "alnum_prop": 0.7358490566037735, "repo_name": "katsuyoshi/iunittest", "id": "caff28fbc21b0cfd08f5ac135dbb36f87a8e6369", "size": "264", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/iUnitTestTest/SelfTests/IUTAssertionInfoTest.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "12242" }, { "name": "Objective-C", "bytes": "284500" }, { "name": "Ruby", "bytes": "3642" }, { "name": "Shell", "bytes": "28" } ], "symlink_target": "" }
package com.javarush.test.level26.lesson15.big01.command; import com.javarush.test.level26.lesson15.big01.CashMachine; import com.javarush.test.level26.lesson15.big01.ConsoleHelper; import com.javarush.test.level26.lesson15.big01.CurrencyManipulator; import com.javarush.test.level26.lesson15.big01.CurrencyManipulatorFactory; import java.util.ResourceBundle; /** * Created by Alex on 29.04.2014. */ class InfoCommand implements Command { private final ResourceBundle res = ResourceBundle .getBundle(CashMachine.RESOURCE_PATH + "info_en"); @Override public void execute() { boolean money = false; ConsoleHelper.writeMessage(res.getString("before")); for (CurrencyManipulator cur : CurrencyManipulatorFactory.getAllCurrencyManipulators()) { if (cur.hasMoney()) { if (cur.getTotalAmount() > 0) { ConsoleHelper.writeMessage(cur.getCurrencyCode() + " - " + cur.getTotalAmount()); money = true; } } } if (!money) { ConsoleHelper.writeMessage(res.getString("no.money")); } } }
{ "content_hash": "2c05f1eda39a8c552728cccc47594f0e", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 93, "avg_line_length": 32.39393939393939, "alnum_prop": 0.7128157156220767, "repo_name": "ailyenko/JavaRush", "id": "8ee182351094740290772ee07d5af19c1f4aebeb", "size": "1069", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/com/javarush/test/level26/lesson15/big01/command/InfoCommand.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "872336" } ], "symlink_target": "" }
Contributions are **welcome** and will be fully **credited**. We accept contributions via Pull Requests on [Github](https://github.com/spatie/emoji). ## Pull Requests - **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer). - **Add tests!** - Your patch won't be accepted if it doesn't have tests. - **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. - **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option. - **Create feature branches** - Don't ask us to pull from your master branch. - **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. - **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. ## Running Tests ``` bash $ composer test ``` **Happy coding**!
{ "content_hash": "777f1dffed28092e1a5ccd9c3211d195", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 302, "avg_line_length": 45.172413793103445, "alnum_prop": 0.7374045801526717, "repo_name": "Jasper9041/docs.spatie.be", "id": "7fc0bb7a25d9d5af5e8f1fdd3c74022a50892b15", "size": "1326", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "CONTRIBUTING.md", "mode": "33261", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "553" }, { "name": "CSS", "bytes": "44113" }, { "name": "JavaScript", "bytes": "1114660" }, { "name": "PHP", "bytes": "88060" } ], "symlink_target": "" }
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>CodePen - A Pen by Olga</title> </head> <body> <!-- This line is an HTML comment. --> <!-- Coments help PEOPLE read code. They are ignored by the computer. You should use comments to leave notes for yourself (and anyone else who might read your code later). --> <!-- The <head> element contains information that won't be displayed on the page. --> <head> <!-- The <title> element normally sets the name of the browser tab (but in this example codepen's title overrides the title I set) --> <title>Andy's Notes</title> </head> <!-- The <h1> tag stands for "heading 1". Heading tags go all the way up to <h6>. Lower numbered headings indicate content that is more important. --> <h1>Important Concepts</h1> <b>How the Web Works</b> <p>The web is a bunch of computers that communicate with each other. When a person goes to a web page like www.google.com, their computer sends a <em>HTTP Request</em> to a <em>server</em>. The server finds the appropriate HTML document and sends it back to the user's computer where a <em>web browser</em> interprets the page and displays it on the user's screen. <a href="https://www.udacity.com/course/viewer#!/c-ud721/l-3508959201/e-48329854/m-48480496">This video</a> does a good job of explaining. </p> <b>HTML</b> <p>HTML stands for <em>Hypertext Markup Language.</em> HTML documents form the majority of the content on the web. HTML documents contain <em>text content</em> which describes "what you see" and <em>markup</em> which describes "how it looks". <a href="https://www.udacity.com/course/viewer#!/c-ud721/l-3508959201/m-48724340"> This video</a> gives a good overview. </p> <b>Tags and Elements</b> <p>HTML documents are made of HTML <b>elements</b>. When writing HTML, we tell browsers the type of each element by using HTML <b>tags</b>. <a href="https://www.udacity.com/course/viewer#!/c-ud721/l-3508959201/m-48723444">This video</a> explains the distinction well. </p> <b>Why Computers are Stupid</b> <p>Computers are stupid because they interpret instructions literally. This makes them very unforgiving since a small mistake by a programmer can cause huge problems in a program. </p> <b>Inline vs Block Elements</b> <p>HTML elements are either <b>inline</b> or <b>block</b>. Block elements form an "invisible box" around the content inside of them. </p> </body> </html>
{ "content_hash": "1c58f67cf2e34068040291dbb0d76a02", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 175, "avg_line_length": 35.970588235294116, "alnum_prop": 0.7134096484055601, "repo_name": "olyanewyork/getting-started-with-html", "id": "2665dff9b1a307c01262c422648dae0a384922e8", "size": "2446", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "index.html", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "2446" } ], "symlink_target": "" }
using System; using Microsoft.SPOT; using System.Collections; namespace NetMf.CommonExtensions { /// <summary> /// Extension methods for ArrayList /// </summary> public static class ArrayListExtensions { /// <summary> /// Add Range to ArrayList /// </summary> /// <param name="list">Aray List to add to</param> /// <param name="arr">Items to be added to the collection</param> public static void AddRange(this ArrayList list, Array arr) { foreach (object b in arr) { list.Add(b); } } /// <summary> /// Removes a range of elements from the ArrayList /// </summary> /// <param name="list">List to operate on</param> /// <param name="index">starting index</param> /// <param name="count"></param> public static void RemoveRange(this ArrayList list, int index, int count) { for (int i = 0; i < count; i++) { list.RemoveAt(index); } } } }
{ "content_hash": "afb94807b9b268d1731f54c0ff513a0b", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 81, "avg_line_length": 26.878048780487806, "alnum_prop": 0.5226860254083484, "repo_name": "JakeLardinois/NETMF.CommonExtensions", "id": "85ce1bba499285d52d32af70f93f6777c77a1323", "size": "1102", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "NetMf.CommonExtensions/ArrayListExtensions.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "104714" } ], "symlink_target": "" }
package org.chocosolver.solver.trace; import org.chocosolver.solver.Solver; import org.chocosolver.solver.search.loop.monitors.IMonitorInitPropagation; /** * A search monitor logger which prints statistics every XX ms. * <br/> * * @author Charles Prud'homme * @since 18 aug. 2010 */ public class LogStatEveryXXms implements IMonitorInitPropagation { Thread printer; public LogStatEveryXXms(final Solver solver, final long duration) { printer = new Thread() { @Override public void run() { try { sleep(duration); //noinspection InfiniteLoopStatement do { solver.getMeasures().updateTimeCount(); solver.getMeasures().updatePropagationCount(); System.out.println(String.format(">> %s", solver.getMeasures().toOneShortLineString())); sleep(duration); } while (true); } catch (InterruptedException ignored) { } } }; printer.setDaemon(true); } @Override public void beforeInitialPropagation() { } @Override public void afterInitialPropagation() { printer.start(); } }
{ "content_hash": "926cf51aabf4de075f8c5113180da824", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 112, "avg_line_length": 27.1875, "alnum_prop": 0.5685823754789272, "repo_name": "PhilAndrew/choco3gwt", "id": "dafa1b50c7838977479a42aa09b94ae01fa1b24d", "size": "2986", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "choco-solver/src/main/java/org/chocosolver/solver/trace/LogStatEveryXXms.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Java", "bytes": "5113605" }, { "name": "Makefile", "bytes": "14215" }, { "name": "Python", "bytes": "17252" }, { "name": "Shell", "bytes": "24907" }, { "name": "TeX", "bytes": "11938" } ], "symlink_target": "" }
function install_LMG %% Add GIBBON paths disp('---INSTALLING THE LMG TOOLBOX ---'); disp('-> Adding LMG paths'); toolboxPath=fileparts(mfilename('fullpath')); %Get the LMG path addpath(fullfile(toolboxPath,'lib')); %Add toolbox lib path so toolbox functions used here are known %% [pathNames]=getSubPaths(toolboxPath); %% ignoreString='.'; %Target for ignoring .git and other hidden folders for q=1:1:numel(pathNames) pathNameNow=pathNames{q}; if ~any(strfind(pathNameNow,ignoreString)) addpath(pathNameNow); %Add path end end %% Add 3rd party paths % disp('-> Adding 3rd party paths'); % % prompt = {'FEBio full path to program (e.g. .../bin/FEBio2.lnx64 or ...\bin\FEBio2.exe):','export_fig path:'}; % dlg_title = 'Path definitions (leave empty if not used)'; % % FEBioPath=getFEBioPath; % % exportFigPath=fileparts(which('export_fig')); % defaultOptions = {FEBioPath,exportFigPath}; % % s=25+max([cellfun(@numel,prompt) cellfun(@numel,defaultOptions)]); % % Q = inputdlg(prompt,dlg_title,[1 s],defaultOptions); % % if ~isempty(Q) % if ~isempty(Q{1}) % setFEBioPath(Q{1}); %Set FEBio path in config file % end % if ~isempty(Q{2}) % addpath(Q{2}); %Add export_fig to the path % end % end %% Saving path definitions disp('-> Saving path definitions'); savepath; %% Integrating help/documentations disp('-> Integrating help'); createHelpDemoDocumentation; disp('------- FINISHED -------');
{ "content_hash": "ba8b8a55a1fd5196c36d5baa77e80ee2", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 112, "avg_line_length": 28.509090909090908, "alnum_prop": 0.6262755102040817, "repo_name": "CELavecchia/LMG", "id": "e1e949692c7f1545970d9a9c177b3353819f9e86", "size": "1568", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "install_LMG.m", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "HTML", "bytes": "31859" }, { "name": "Matlab", "bytes": "234230" } ], "symlink_target": "" }
<!DOCTYPE html> <HTML><head><TITLE>Manpage of lppasswd</TITLE> <meta charset="utf-8"> <link rel="stylesheet" href="/css/main.css" type="text/css"> </head> <body> <header class="site-header"> <div class="wrap"> <div class="site-title"><a href="/manpages/index.html">linux manpages</a></div> <div class="site-description">{"type":"documentation"}</div> </div> </header> <div class="page-content"><div class="wrap"> <H1>lppasswd</H1> Section: Apple Inc. (1)<BR>Updated: CUPS<BR><A HREF="#index">Index</A> <A HREF="/manpages/index.html">Return to Main Contents</A><HR> <A NAME="lbAB">&nbsp;</A> <H2>NAME</H2> lppasswd - add, change, or delete digest passwords. <A NAME="lbAC">&nbsp;</A> <H2>SYNOPSIS</H2> <B>lppasswd</B> [ <I>username</I> ] <BR> <B>lppasswd</B> -a [ -g <I>groupname</I> ] <I>username</I> <BR> <B>lppasswd</B> -x <I>username</I> <A NAME="lbAD">&nbsp;</A> <H2>DESCRIPTION</H2> <I>lppasswd</I> adds, changes, or deletes passwords in the CUPS digest password file, <I>passwd.md5</I>. When run by a normal user, <I>lppasswd</I> will prompt for the old and new passwords. When run by the super-user, <I>lppasswd</I> can add new accounts (<I>-a username</I>), change existing accounts (<I>username</I>), or delete accounts (<I>-x username</I>) in the digest password file. Digest usernames do not have to match local UNIX usernames. <A NAME="lbAE">&nbsp;</A> <H2>OPTIONS</H2> <I>lppasswd</I> supports the following options: <DL COMPACT> <DT>-g groupname<DD> <BR> Specifies a group other than the default system group. </DL> <A NAME="lbAF">&nbsp;</A> <H2>SECURITY ISSUES</H2> By default, the <I>lppasswd</I> program is not installed to allow ordinary users to change their passwords. To enable this, the <I>lppasswd</I> command must be made setuid to root with the command: <BR> <PRE> chmod u+s lppasswd </PRE> <P> While every attempt has been made to make <I>lppasswd</I> secure against exploits that could grant super-user privileges to unprivileged users, paranoid system administrators may wish to use Basic authentication with accounts managed by PAM instead. <A NAME="lbAG">&nbsp;</A> <H2>SEE ALSO</H2> <I><A HREF="/manpages/index.html?1+lp">lp</A>(1)</I>, <I><A HREF="http://localhost/cgi-bin/man/man2html?1+lpr">lpr</A>(1)</I>, <BR> <A HREF="http://localhost:631/help">http://localhost:631/help</A> <A NAME="lbAH">&nbsp;</A> <H2>COPYRIGHT</H2> Copyright 2007-2009 by Apple Inc. <P> <HR> <A NAME="index">&nbsp;</A><H2>Index</H2> <DL> <DT><A HREF="#lbAB">NAME</A><DD> <DT><A HREF="#lbAC">SYNOPSIS</A><DD> <DT><A HREF="#lbAD">DESCRIPTION</A><DD> <DT><A HREF="#lbAE">OPTIONS</A><DD> <DT><A HREF="#lbAF">SECURITY ISSUES</A><DD> <DT><A HREF="#lbAG">SEE ALSO</A><DD> <DT><A HREF="#lbAH">COPYRIGHT</A><DD> </DL> <HR> This document was created by <A HREF="/manpages/index.html">man2html</A>, using the manual pages.<BR> Time: 05:29:05 GMT, December 24, 2015 </div></div> </body> </HTML>
{ "content_hash": "bf050c139974b07ca87f310bee01e8e1", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 126, "avg_line_length": 24.366666666666667, "alnum_prop": 0.6754445964432284, "repo_name": "yuweijun/yuweijun.github.io", "id": "1912f468bdf34005a82c427859eedde2cc0cd017", "size": "2924", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "manpages/man1/lppasswd.1.html", "mode": "33188", "license": "mit", "language": [ { "name": "ActionScript", "bytes": "589062" }, { "name": "CSS", "bytes": "86538" }, { "name": "Go", "bytes": "2652" }, { "name": "HTML", "bytes": "126806134" }, { "name": "JavaScript", "bytes": "12389716" }, { "name": "Perl", "bytes": "7390" }, { "name": "PostScript", "bytes": "32036" }, { "name": "Ruby", "bytes": "8626" }, { "name": "Shell", "bytes": "193" }, { "name": "Vim Script", "bytes": "209" }, { "name": "XSLT", "bytes": "7176" } ], "symlink_target": "" }
DROP TABLE IF EXISTS `{prefix}access`; CREATE TABLE `{prefix}access` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `access_level_id` INT(11) DEFAULT NULL, `user_id` INT(11) DEFAULT NULL, `created` DATETIME DEFAULT NULL, `modified` DATETIME DEFAULT NULL, PRIMARY KEY (`id`), KEY `access_level_id` (`access_level_id`), KEY `user_id` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Users with certain access' AUTO_INCREMENT=1;
{ "content_hash": "f83fbd17d77e57f93566f3891845feb5", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 90, "avg_line_length": 38.416666666666664, "alnum_prop": 0.6767895878524945, "repo_name": "andreasdr/croogo-forum", "id": "bf5a386b0014c26f338e51e7001af5db7e05a566", "size": "462", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "Config/Schema/Deprecated/access.sql", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "28731" }, { "name": "JavaScript", "bytes": "224726" }, { "name": "PHP", "bytes": "276603" } ], "symlink_target": "" }
import { assert } from '../../platform/chai-web.js'; import { Loader } from '../../platform/loader.js'; import { Manifest } from '../manifest.js'; import { Runtime } from '../runtime.js'; export async function manifestTestSetup() { const registry = {}; const loader = new Loader(); const manifest = await Manifest.load('./src/runtime/tests/artifacts/test.manifest', loader, registry); assert(manifest); const runtime = new Runtime({ loader, context: manifest }); const arc = await runtime.allocator.startArc({ arcName: 'test' }); const recipe = manifest.recipes[0]; assert(recipe.normalize()); assert(recipe.isResolved()); return { runtime, arc, recipe }; } //# sourceMappingURL=manifest-integration-test-setup.js.map
{ "content_hash": "c2f9818a701dd1188e261605c65955c6", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 106, "avg_line_length": 42.111111111111114, "alnum_prop": 0.6781002638522428, "repo_name": "PolymerLabs/arcs-live", "id": "d3ad197de2c23a1371b50ae85d9b00df8985893b", "size": "1094", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "build/runtime/testing/manifest-integration-test-setup.js", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "42" }, { "name": "C++", "bytes": "2523" }, { "name": "CSS", "bytes": "91310" }, { "name": "CoffeeScript", "bytes": "3272" }, { "name": "HTML", "bytes": "1280188" }, { "name": "JavaScript", "bytes": "6704824" }, { "name": "Kotlin", "bytes": "55841" }, { "name": "Makefile", "bytes": "89" }, { "name": "PHP", "bytes": "3338" }, { "name": "Shell", "bytes": "2391" }, { "name": "Starlark", "bytes": "7650" }, { "name": "TypeScript", "bytes": "178144" } ], "symlink_target": "" }
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.scvmm.generated; import com.azure.core.util.Context; /** Samples for VirtualNetworks Delete. */ public final class VirtualNetworksDeleteSamples { /* * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/DeleteVirtualNetwork.json */ /** * Sample code: DeleteVirtualNetwork. * * @param manager Entry point to ScvmmManager. */ public static void deleteVirtualNetwork(com.azure.resourcemanager.scvmm.ScvmmManager manager) { manager.virtualNetworks().delete("testrg", "HRVirtualNetwork", null, Context.NONE); } }
{ "content_hash": "b5b919a1abca42f5432d1b42e3837ecb", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 141, "avg_line_length": 36.90909090909091, "alnum_prop": 0.7352216748768473, "repo_name": "Azure/azure-sdk-for-java", "id": "9225f895732261d080c04b07c2f9bde665de8296", "size": "812", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualNetworksDeleteSamples.java", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "8762" }, { "name": "Bicep", "bytes": "15055" }, { "name": "CSS", "bytes": "7676" }, { "name": "Dockerfile", "bytes": "2028" }, { "name": "Groovy", "bytes": "3237482" }, { "name": "HTML", "bytes": "42090" }, { "name": "Java", "bytes": "432409546" }, { "name": "JavaScript", "bytes": "36557" }, { "name": "Jupyter Notebook", "bytes": "95868" }, { "name": "PowerShell", "bytes": "737517" }, { "name": "Python", "bytes": "240542" }, { "name": "Scala", "bytes": "1143898" }, { "name": "Shell", "bytes": "18488" }, { "name": "XSLT", "bytes": "755" } ], "symlink_target": "" }
using Orchard.UI.Resources; namespace Orchard.Tags { public class ResourceManifest : IResourceManifestProvider { public void BuildManifests(ResourceManifestBuilder builder) { var manifest = builder.Add(); manifest.DefineScript("TagsAutocomplete").SetUrl("orchard-tags-autocomplete.js").SetDependencies("jQueryUI_Widgets"); manifest.DefineStyle("TagsAdmin").SetUrl("orchard-tags-admin.css"); } } }
{ "content_hash": "1758905acc3d7ffc2572ac671a199fe3", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 129, "avg_line_length": 35.30769230769231, "alnum_prop": 0.6971677559912854, "repo_name": "neTp9c/Orchard", "id": "43301450a766911d3e2f1514a2fa7ce6d39d9003", "size": "459", "binary": false, "copies": "3", "ref": "refs/heads/dev", "path": "src/Orchard.Web/Modules/Orchard.Tags/ResourceManifest.cs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ASP", "bytes": "1401" }, { "name": "Batchfile", "bytes": "7830" }, { "name": "C", "bytes": "4755" }, { "name": "C#", "bytes": "9573337" }, { "name": "CSS", "bytes": "900711" }, { "name": "Cucumber", "bytes": "91965" }, { "name": "HTML", "bytes": "37855" }, { "name": "JavaScript", "bytes": "10392569" }, { "name": "PowerShell", "bytes": "1694" }, { "name": "TypeScript", "bytes": "51522" }, { "name": "XSLT", "bytes": "119918" } ], "symlink_target": "" }
package jef.database.query.function; import java.util.List; import jef.database.jsqlparser.visitor.Expression; import org.apache.commons.lang.ArrayUtils; public abstract class BaseArgumentSqlFunction implements SQLFunction { public boolean needEscape() { return false; } public boolean hasArguments() { return true; } public boolean hasParenthesesIfNoArguments() { return true; } public String[] requiresUserFunction() { return ArrayUtils.EMPTY_STRING_ARRAY; } protected void assertParam(List<Expression> arguments, int i) { if(i==0 && arguments==null){ return; } if(arguments.size()!=i){ throw new IllegalArgumentException("function "+ getName()+" must have "+ i+ " args, but current is "+arguments.size()); } } }
{ "content_hash": "1101830bf41cfa9e4c86329dc6141b3a", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 122, "avg_line_length": 20.594594594594593, "alnum_prop": 0.7217847769028871, "repo_name": "GeeQuery/ef-orm", "id": "d640c5d2f10929a767c5bcfbc28b97060ca75399", "size": "762", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "common-orm/src/main/java/jef/database/query/function/BaseArgumentSqlFunction.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "245" }, { "name": "Java", "bytes": "8573985" }, { "name": "Lua", "bytes": "30" }, { "name": "PLSQL", "bytes": "671" }, { "name": "PLpgSQL", "bytes": "185" }, { "name": "SQLPL", "bytes": "413" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Coq bench</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../../..">Unstable</a></li> <li><a href=".">dev / contrib:lambda 8.4.dev</a></li> <li class="active"><a href="">2014-11-29 12:11:32</a></li> </ul> <ul class="nav navbar-nav navbar-right"> <li><a href="../../../../../about.html">About</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href=".">« Up</a> <h1> contrib:lambda <small> 8.4.dev <span class="label label-info">Not compatible with this Coq</span> </small> </h1> <p><em><script>document.write(moment("2014-11-29 12:11:32 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2014-11-29 12:11:32 UTC)</em><p> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>ruby lint.rb unstable ../unstable/packages/coq:contrib:lambda/coq:contrib:lambda.8.4.dev</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> <dt>Output</dt> <dd><pre>The package is valid. </pre></dd> </dl> <h2>Dry install</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --dry-run coq:contrib:lambda.8.4.dev coq.dev</code></dd> <dt>Return code</dt> <dd>768</dd> <dt>Duration</dt> <dd>0 s</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is dev). The following dependencies couldn&#39;t be met: - coq:contrib:lambda -&gt; coq &lt;= 8.4.dev Your request can&#39;t be satisfied: - Conflicting version constraints for coq No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq, to test if the problem was incompatibility with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --dry-run coq:contrib:lambda.8.4.dev</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>3 s</dd> <dt>Output</dt> <dd><pre>The following actions will be performed: - remove coq.dev === 1 to remove === =-=- Removing Packages =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Removing coq.dev. [WARNING] Directory /home/bench/.opam/system/lib/coq is not empty, not removing The following actions will be performed: - install coq.8.4.dev [required by coq:contrib:lambda] - install coq:contrib:lambda.8.4.dev === 2 to install === =-=- Synchronizing package archives -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= =-=- Installing packages =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Building coq.8.4.dev: ./configure -configdir /home/bench/.opam/system/lib/coq/config -mandir /home/bench/.opam/system/man -docdir /home/bench/.opam/system/doc -prefix /home/bench/.opam/system -usecamlp5 -camlp5dir /home/bench/.opam/system/lib/camlp5 -coqide no make -j4 make install Installing coq.8.4.dev. Building coq:contrib:lambda.8.4.dev: coq_makefile -f Make -o Makefile make -j4 make install Installing coq:contrib:lambda.8.4.dev. </pre></dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>Data not available in this bench.</p> <h2>Uninstall</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> <small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small> </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{ "content_hash": "31c026075565a0eb5480ea548b6bb32f", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 240, "avg_line_length": 40.76190476190476, "alnum_prop": 0.502482476635514, "repo_name": "coq-bench/coq-bench.github.io-old", "id": "e6e4c0052c9c33878bde38b9d073e390d4258dfa", "size": "6850", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.02.1-1.2.0/unstable/dev/contrib:lambda/8.4.dev/2014-11-29_12-11-32.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
class HistoriesController < ApplicationController before_action :require_login, except: %i(index show) def index @histories = History.order(updated_at: :desc).page(params[:page]).includes(:toy, cat: [:user]) end def show @history = History.find(params[:id]) end def new @toy = Toy.find(params[:toy]) set_user_histories(@toy) end def create @history = History.new(history_params) @toy = @history.toy unless current_user.cats.exists?(id: @history.cat.id) set_user_histories(@toy) @history.errors[:base] << 'mismatch cat and user' respond_to do |format| format.html { render :new } format.json { render json: @histories.errors, status: :unprocessable_entity } end return end respond_to do |format| if @history.save format.html { redirect_to @history, notice: '更新しました' } format.json { render :show, status: :created, location: @history } else set_user_histories(@toy) format.html { render :new } format.json { render json: @histories.errors, status: :unprocessable_entity } end end end def edit @history = History.find(params[:id]) raise 'user mismatched' unless @history.cat.user == current_user end def update @history = History.find(params[:id]) @toy = @history.toy respond_to do |format| if @history.update(history_params) format.html { redirect_to @history, notice: '更新しました' } format.json { render :show, status: :ok, location: @history } else set_user_histories(@toy) format.html { render :new } format.json { render json: @history.errors, status: :unprocessable_entity } end end end #def destroy #end private def history_params params.require(:history).permit(:toy_id, :cat_id, :rate, :comment) end def set_user_histories(toy) rate = params[:rate].to_i @histories = current_user.cats.includes(:histories).map do |cat| hist = cat.histories.to_a.find { |i| i.toy_id == toy.id } if hist hist else History.new(toy: toy, cat: cat, rate: rate) end end end end
{ "content_hash": "74e7a09f360ff8515367212cfe783a75", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 98, "avg_line_length": 26.70731707317073, "alnum_prop": 0.6223744292237443, "repo_name": "holrock/cattoy", "id": "c5c3cc2ca06da9b052cb7c6b843f0ed9a0e8a2c0", "size": "2214", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/controllers/histories_controller.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "24298" }, { "name": "CoffeeScript", "bytes": "211" }, { "name": "HTML", "bytes": "20781" }, { "name": "JavaScript", "bytes": "5161" }, { "name": "Ruby", "bytes": "92485" }, { "name": "Shell", "bytes": "106" }, { "name": "Vue", "bytes": "428" } ], "symlink_target": "" }
package upload import ( "fmt" "io" "net/http" "os" "path/filepath" "strconv" "time" ) // StoreFiles stores file uploads at paths like /YYYY/MM/filename.ext func StoreFiles(req *http.Request) (map[string]string, error) { err := req.ParseMultipartForm(1024 * 1024 * 4) // maxMemory 4MB if err != nil { return nil, err } ts := req.FormValue("timestamp") // timestamp in milliseconds since unix epoch if ts == "" { ts = fmt.Sprintf("%d", int64(time.Nanosecond)*time.Now().UnixNano()/int64(time.Millisecond)) // Unix() returns seconds since unix epoch } req.Form.Set("timestamp", ts) // To use for FormValue name:urlPath urlPaths := make(map[string]string) // get or create upload directory to save files from request pwd, err := os.Getwd() if err != nil { err := fmt.Errorf("Failed to locate current directory: %s", err) return nil, err } i, err := strconv.ParseInt(ts, 10, 64) if err != nil { return nil, err } tm := time.Unix(int64(i/1000), int64(i%1000)) urlPathPrefix := "api" uploadDirName := "uploads" uploadDir := filepath.Join(pwd, uploadDirName, fmt.Sprintf("%d", tm.Year()), fmt.Sprintf("%02d", tm.Month())) err = os.MkdirAll(uploadDir, os.ModeDir|os.ModePerm) // loop over all files and save them to disk for name, fds := range req.MultipartForm.File { filename := fds[0].Filename src, err := fds[0].Open() if err != nil { err := fmt.Errorf("Couldn't open uploaded file: %s", err) return nil, err } defer src.Close() // check if file at path exists, if so, add timestamp to file absPath := filepath.Join(uploadDir, filename) if _, err := os.Stat(absPath); !os.IsNotExist(err) { filename = fmt.Sprintf("%d-%s", time.Now().Unix(), filename) absPath = filepath.Join(uploadDir, filename) } // save to disk (TODO: or check if S3 credentials exist, & save to cloud) dst, err := os.Create(absPath) if err != nil { err := fmt.Errorf("Failed to create destination file for upload: %s", err) return nil, err } // copy file from src to dst on disk if _, err = io.Copy(dst, src); err != nil { err := fmt.Errorf("Failed to copy uploaded file to destination: %s", err) return nil, err } // add name:urlPath to req.PostForm to be inserted into db urlPath := fmt.Sprintf("/%s/%s/%d/%02d/%s", urlPathPrefix, uploadDirName, tm.Year(), tm.Month(), filename) urlPaths[name] = urlPath } return urlPaths, nil }
{ "content_hash": "d8b34fb828c043609ebdaf86c0b9a70f", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 137, "avg_line_length": 26.88888888888889, "alnum_prop": 0.6578512396694215, "repo_name": "gopheracademy/gccms", "id": "6b99dfcd9df258f7e7446e487ff129f2e0c63086", "size": "2420", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/admin/upload/upload.go", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Go", "bytes": "56379" } ], "symlink_target": "" }
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> Partial Class MQTTConnectForm Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel() Me.Label9 = New System.Windows.Forms.Label() Me.TopicInput = New System.Windows.Forms.TextBox() Me.BoxKeepAlive = New System.Windows.Forms.NumericUpDown() Me.BoxReconnect = New System.Windows.Forms.NumericUpDown() Me.BoxTimeout = New System.Windows.Forms.NumericUpDown() Me.Label7 = New System.Windows.Forms.Label() Me.Label8 = New System.Windows.Forms.Label() Me.Label6 = New System.Windows.Forms.Label() Me.BoxPassword = New System.Windows.Forms.TextBox() Me.BoxUsername = New System.Windows.Forms.TextBox() Me.BoxHost = New System.Windows.Forms.TextBox() Me.Label1 = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.BoxClientID = New System.Windows.Forms.TextBox() Me.Label4 = New System.Windows.Forms.Label() Me.Label5 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label() Me.BoxPort = New System.Windows.Forms.NumericUpDown() Me.ButtonConnect = New System.Windows.Forms.Button() Me.ButtonDisconnect = New System.Windows.Forms.Button() Me.TopicList = New System.Windows.Forms.ListBox() Me.CleanSessionBox = New System.Windows.Forms.CheckBox() Me.QOSBox = New System.Windows.Forms.ListBox() Me.TableLayoutPanel2 = New System.Windows.Forms.TableLayoutPanel() Me.OutputText = New System.Windows.Forms.Label() Me.TableLayoutPanel1.SuspendLayout() CType(Me.BoxKeepAlive, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.BoxReconnect, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.BoxTimeout, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.BoxPort, System.ComponentModel.ISupportInitialize).BeginInit() Me.TableLayoutPanel2.SuspendLayout() Me.SuspendLayout() ' 'TableLayoutPanel1 ' Me.TableLayoutPanel1.ColumnCount = 2 Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333!)) Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 66.66667!)) Me.TableLayoutPanel1.Controls.Add(Me.Label9, 0, 8) Me.TableLayoutPanel1.Controls.Add(Me.TopicInput, 0, 10) Me.TableLayoutPanel1.Controls.Add(Me.BoxKeepAlive, 1, 7) Me.TableLayoutPanel1.Controls.Add(Me.BoxReconnect, 1, 5) Me.TableLayoutPanel1.Controls.Add(Me.BoxTimeout, 1, 6) Me.TableLayoutPanel1.Controls.Add(Me.Label7, 0, 7) Me.TableLayoutPanel1.Controls.Add(Me.Label8, 0, 6) Me.TableLayoutPanel1.Controls.Add(Me.Label6, 0, 5) Me.TableLayoutPanel1.Controls.Add(Me.BoxPassword, 1, 4) Me.TableLayoutPanel1.Controls.Add(Me.BoxUsername, 1, 3) Me.TableLayoutPanel1.Controls.Add(Me.BoxHost, 1, 1) Me.TableLayoutPanel1.Controls.Add(Me.Label1, 0, 0) Me.TableLayoutPanel1.Controls.Add(Me.Label2, 0, 1) Me.TableLayoutPanel1.Controls.Add(Me.BoxClientID, 1, 0) Me.TableLayoutPanel1.Controls.Add(Me.Label4, 0, 4) Me.TableLayoutPanel1.Controls.Add(Me.Label5, 0, 2) Me.TableLayoutPanel1.Controls.Add(Me.Label3, 0, 3) Me.TableLayoutPanel1.Controls.Add(Me.BoxPort, 1, 2) Me.TableLayoutPanel1.Controls.Add(Me.ButtonConnect, 1, 11) Me.TableLayoutPanel1.Controls.Add(Me.ButtonDisconnect, 0, 11) Me.TableLayoutPanel1.Controls.Add(Me.TopicList, 1, 10) Me.TableLayoutPanel1.Controls.Add(Me.CleanSessionBox, 1, 9) Me.TableLayoutPanel1.Controls.Add(Me.QOSBox, 1, 8) Me.TableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill Me.TableLayoutPanel1.Location = New System.Drawing.Point(3, 3) Me.TableLayoutPanel1.Name = "TableLayoutPanel1" Me.TableLayoutPanel1.RowCount = 12 Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.666667!)) Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.666667!)) Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.666667!)) Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.666667!)) Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.666667!)) Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.666667!)) Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.666667!)) Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.666667!)) Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 13.33333!)) Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.666667!)) Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20.0!)) Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.666667!)) Me.TableLayoutPanel1.Size = New System.Drawing.Size(425, 560) Me.TableLayoutPanel1.TabIndex = 0 ' 'Label9 ' Me.Label9.AutoSize = True Me.Label9.Dock = System.Windows.Forms.DockStyle.Fill Me.Label9.Location = New System.Drawing.Point(3, 296) Me.Label9.Name = "Label9" Me.Label9.Size = New System.Drawing.Size(135, 74) Me.Label9.TabIndex = 18 Me.Label9.Text = "QoS" Me.Label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'TopicInput ' Me.TopicInput.Dock = System.Windows.Forms.DockStyle.Fill Me.TopicInput.Location = New System.Drawing.Point(3, 410) Me.TopicInput.Name = "TopicInput" Me.TopicInput.Size = New System.Drawing.Size(135, 20) Me.TopicInput.TabIndex = 9 ' 'BoxKeepAlive ' Me.BoxKeepAlive.Dock = System.Windows.Forms.DockStyle.Fill Me.BoxKeepAlive.Location = New System.Drawing.Point(144, 262) Me.BoxKeepAlive.Maximum = New Decimal(New Integer() {100000, 0, 0, 0}) Me.BoxKeepAlive.Name = "BoxKeepAlive" Me.BoxKeepAlive.Size = New System.Drawing.Size(278, 20) Me.BoxKeepAlive.TabIndex = 7 Me.BoxKeepAlive.Value = New Decimal(New Integer() {10, 0, 0, 0}) ' 'BoxReconnect ' Me.BoxReconnect.Dock = System.Windows.Forms.DockStyle.Fill Me.BoxReconnect.Location = New System.Drawing.Point(144, 188) Me.BoxReconnect.Maximum = New Decimal(New Integer() {100000, 0, 0, 0}) Me.BoxReconnect.Name = "BoxReconnect" Me.BoxReconnect.Size = New System.Drawing.Size(278, 20) Me.BoxReconnect.TabIndex = 5 Me.BoxReconnect.Value = New Decimal(New Integer() {1000, 0, 0, 0}) ' 'BoxTimeout ' Me.BoxTimeout.Dock = System.Windows.Forms.DockStyle.Fill Me.BoxTimeout.Location = New System.Drawing.Point(144, 225) Me.BoxTimeout.Maximum = New Decimal(New Integer() {1000, 0, 0, 0}) Me.BoxTimeout.Name = "BoxTimeout" Me.BoxTimeout.Size = New System.Drawing.Size(278, 20) Me.BoxTimeout.TabIndex = 6 Me.BoxTimeout.Value = New Decimal(New Integer() {30, 0, 0, 0}) ' 'Label7 ' Me.Label7.AutoSize = True Me.Label7.Dock = System.Windows.Forms.DockStyle.Fill Me.Label7.Location = New System.Drawing.Point(3, 259) Me.Label7.Name = "Label7" Me.Label7.Size = New System.Drawing.Size(135, 37) Me.Label7.TabIndex = 16 Me.Label7.Text = "Keep Alive [s]" Me.Label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'Label8 ' Me.Label8.AutoSize = True Me.Label8.Dock = System.Windows.Forms.DockStyle.Fill Me.Label8.Location = New System.Drawing.Point(3, 222) Me.Label8.Name = "Label8" Me.Label8.Size = New System.Drawing.Size(135, 37) Me.Label8.TabIndex = 15 Me.Label8.Text = "Connection Timeout [s]" Me.Label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'Label6 ' Me.Label6.AutoSize = True Me.Label6.Dock = System.Windows.Forms.DockStyle.Fill Me.Label6.Location = New System.Drawing.Point(3, 185) Me.Label6.Name = "Label6" Me.Label6.Size = New System.Drawing.Size(135, 37) Me.Label6.TabIndex = 13 Me.Label6.Text = "Reconnect Period [ms]" Me.Label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'BoxPassword ' Me.BoxPassword.Dock = System.Windows.Forms.DockStyle.Fill Me.BoxPassword.Location = New System.Drawing.Point(144, 151) Me.BoxPassword.Name = "BoxPassword" Me.BoxPassword.Size = New System.Drawing.Size(278, 20) Me.BoxPassword.TabIndex = 4 ' 'BoxUsername ' Me.BoxUsername.Dock = System.Windows.Forms.DockStyle.Fill Me.BoxUsername.Location = New System.Drawing.Point(144, 114) Me.BoxUsername.Name = "BoxUsername" Me.BoxUsername.Size = New System.Drawing.Size(278, 20) Me.BoxUsername.TabIndex = 3 ' 'BoxHost ' Me.BoxHost.Dock = System.Windows.Forms.DockStyle.Fill Me.BoxHost.Location = New System.Drawing.Point(144, 40) Me.BoxHost.Name = "BoxHost" Me.BoxHost.Size = New System.Drawing.Size(278, 20) Me.BoxHost.TabIndex = 1 Me.BoxHost.Text = "broker.hivemq.com" ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Dock = System.Windows.Forms.DockStyle.Fill Me.Label1.Location = New System.Drawing.Point(3, 0) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(135, 37) Me.Label1.TabIndex = 0 Me.Label1.Text = "Client ID" Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Dock = System.Windows.Forms.DockStyle.Fill Me.Label2.Location = New System.Drawing.Point(3, 37) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(135, 37) Me.Label2.TabIndex = 1 Me.Label2.Text = "Host" Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'BoxClientID ' Me.BoxClientID.Dock = System.Windows.Forms.DockStyle.Fill Me.BoxClientID.Location = New System.Drawing.Point(144, 3) Me.BoxClientID.Name = "BoxClientID" Me.BoxClientID.Size = New System.Drawing.Size(278, 20) Me.BoxClientID.TabIndex = 0 ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.Dock = System.Windows.Forms.DockStyle.Fill Me.Label4.Location = New System.Drawing.Point(3, 148) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(135, 37) Me.Label4.TabIndex = 3 Me.Label4.Text = "Password" Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'Label5 ' Me.Label5.AutoSize = True Me.Label5.Dock = System.Windows.Forms.DockStyle.Fill Me.Label5.Location = New System.Drawing.Point(3, 74) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(135, 37) Me.Label5.TabIndex = 4 Me.Label5.Text = "Port" Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Dock = System.Windows.Forms.DockStyle.Fill Me.Label3.Location = New System.Drawing.Point(3, 111) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(135, 37) Me.Label3.TabIndex = 2 Me.Label3.Text = "Username" Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'BoxPort ' Me.BoxPort.Dock = System.Windows.Forms.DockStyle.Fill Me.BoxPort.Location = New System.Drawing.Point(144, 77) Me.BoxPort.Maximum = New Decimal(New Integer() {65535, 0, 0, 0}) Me.BoxPort.Name = "BoxPort" Me.BoxPort.Size = New System.Drawing.Size(278, 20) Me.BoxPort.TabIndex = 2 Me.BoxPort.Value = New Decimal(New Integer() {1883, 0, 0, 0}) ' 'ButtonConnect ' Me.ButtonConnect.Dock = System.Windows.Forms.DockStyle.Fill Me.ButtonConnect.Location = New System.Drawing.Point(144, 522) Me.ButtonConnect.Name = "ButtonConnect" Me.ButtonConnect.Size = New System.Drawing.Size(278, 35) Me.ButtonConnect.TabIndex = 11 Me.ButtonConnect.Text = "Connect" Me.ButtonConnect.UseVisualStyleBackColor = True ' 'ButtonDisconnect ' Me.ButtonDisconnect.Dock = System.Windows.Forms.DockStyle.Fill Me.ButtonDisconnect.Location = New System.Drawing.Point(3, 522) Me.ButtonDisconnect.Name = "ButtonDisconnect" Me.ButtonDisconnect.Size = New System.Drawing.Size(135, 35) Me.ButtonDisconnect.TabIndex = 12 Me.ButtonDisconnect.Text = "Disconnect" Me.ButtonDisconnect.UseVisualStyleBackColor = True ' 'TopicList ' Me.TopicList.Dock = System.Windows.Forms.DockStyle.Fill Me.TopicList.FormattingEnabled = True Me.TopicList.Location = New System.Drawing.Point(144, 410) Me.TopicList.Name = "TopicList" Me.TopicList.ScrollAlwaysVisible = True Me.TopicList.Size = New System.Drawing.Size(278, 106) Me.TopicList.TabIndex = 10 ' 'CleanSessionBox ' Me.CleanSessionBox.AutoSize = True Me.CleanSessionBox.Location = New System.Drawing.Point(144, 373) Me.CleanSessionBox.Name = "CleanSessionBox" Me.CleanSessionBox.Size = New System.Drawing.Size(93, 17) Me.CleanSessionBox.TabIndex = 20 Me.CleanSessionBox.Text = "Clean Session" Me.CleanSessionBox.TextAlign = System.Drawing.ContentAlignment.MiddleRight Me.CleanSessionBox.UseVisualStyleBackColor = True ' 'QOSBox ' Me.QOSBox.Dock = System.Windows.Forms.DockStyle.Fill Me.QOSBox.FormattingEnabled = True Me.QOSBox.Items.AddRange(New Object() {"At Most Once (0)", "At Least Once (1)", "Exactly Once (2)"}) Me.QOSBox.Location = New System.Drawing.Point(144, 299) Me.QOSBox.Name = "QOSBox" Me.QOSBox.Size = New System.Drawing.Size(278, 68) Me.QOSBox.TabIndex = 21 ' 'TableLayoutPanel2 ' Me.TableLayoutPanel2.ColumnCount = 1 Me.TableLayoutPanel2.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) Me.TableLayoutPanel2.Controls.Add(Me.OutputText, 0, 1) Me.TableLayoutPanel2.Controls.Add(Me.TableLayoutPanel1, 0, 0) Me.TableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill Me.TableLayoutPanel2.Location = New System.Drawing.Point(0, 0) Me.TableLayoutPanel2.Name = "TableLayoutPanel2" Me.TableLayoutPanel2.RowCount = 2 Me.TableLayoutPanel2.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 90.0!)) Me.TableLayoutPanel2.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10.0!)) Me.TableLayoutPanel2.Size = New System.Drawing.Size(431, 629) Me.TableLayoutPanel2.TabIndex = 1 ' 'OutputText ' Me.OutputText.AutoSize = True Me.OutputText.Dock = System.Windows.Forms.DockStyle.Fill Me.OutputText.Location = New System.Drawing.Point(3, 566) Me.OutputText.Name = "OutputText" Me.OutputText.Size = New System.Drawing.Size(425, 63) Me.OutputText.TabIndex = 17 Me.OutputText.Text = "Press Connect..." Me.OutputText.TextAlign = System.Drawing.ContentAlignment.TopCenter ' 'MQTTConnectForm ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(431, 629) Me.Controls.Add(Me.TableLayoutPanel2) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow Me.KeyPreview = True Me.Name = "MQTTConnectForm" Me.ShowIcon = False Me.ShowInTaskbar = False Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "MQTT_Connect" Me.TopMost = True Me.TableLayoutPanel1.ResumeLayout(False) Me.TableLayoutPanel1.PerformLayout() CType(Me.BoxKeepAlive, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.BoxReconnect, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.BoxTimeout, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.BoxPort, System.ComponentModel.ISupportInitialize).EndInit() Me.TableLayoutPanel2.ResumeLayout(False) Me.TableLayoutPanel2.PerformLayout() Me.ResumeLayout(False) End Sub Friend WithEvents TableLayoutPanel1 As Windows.Forms.TableLayoutPanel Friend WithEvents BoxKeepAlive As Windows.Forms.NumericUpDown Friend WithEvents BoxReconnect As Windows.Forms.NumericUpDown Friend WithEvents Label7 As Windows.Forms.Label Friend WithEvents Label8 As Windows.Forms.Label Friend WithEvents Label6 As Windows.Forms.Label Friend WithEvents BoxPassword As Windows.Forms.TextBox Friend WithEvents BoxUsername As Windows.Forms.TextBox Friend WithEvents BoxHost As Windows.Forms.TextBox Friend WithEvents Label1 As Windows.Forms.Label Friend WithEvents Label2 As Windows.Forms.Label Friend WithEvents BoxClientID As Windows.Forms.TextBox Friend WithEvents Label4 As Windows.Forms.Label Friend WithEvents Label5 As Windows.Forms.Label Friend WithEvents Label3 As Windows.Forms.Label Friend WithEvents BoxPort As Windows.Forms.NumericUpDown Friend WithEvents BoxTimeout As Windows.Forms.NumericUpDown Friend WithEvents TopicInput As Windows.Forms.TextBox Friend WithEvents TopicList As Windows.Forms.ListBox Friend WithEvents TableLayoutPanel2 As Windows.Forms.TableLayoutPanel Friend WithEvents OutputText As Windows.Forms.Label Friend WithEvents Label9 As Windows.Forms.Label Friend WithEvents CleanSessionBox As Windows.Forms.CheckBox Friend WithEvents ButtonConnect As Windows.Forms.Button Friend WithEvents ButtonDisconnect As Windows.Forms.Button Friend WithEvents QOSBox As Windows.Forms.ListBox End Class
{ "content_hash": "7412ba7dc562e8327fcb2d13d3df9deb", "timestamp": "", "source": "github", "line_count": 415, "max_line_length": 127, "avg_line_length": 43.16626506024097, "alnum_prop": 0.7635368985151278, "repo_name": "mateuszzwierzycki/Owl", "id": "6f3904d6035ff6ea3d7135f99032897cb6c844fe", "size": "17916", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Owl.GH.Networking/MQTTConnectForm.Designer.vb", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "17477" }, { "name": "Visual Basic .NET", "bytes": "550306" } ], "symlink_target": "" }
<?php /** * Created by PhpStorm. * User: Pavel Batanov <pavel@batanov.me> * Date: 28.05.2015 * Time: 15:44 */ namespace NemesisPlatform\Core\CMS\Entity; use NemesisPlatform\Components\Form\Survey\Entity\Survey; use NemesisPlatform\Components\MultiSite\Entity\MultiSiteElement; use NemesisPlatform\Components\MultiSite\Entity\SiteInterface; class SiteSurvey extends Survey implements MultiSiteElement { /** @var SiteInterface */ private $site; /** * @return SiteInterface */ public function getSite() { return $this->site; } /** * @param SiteInterface $site */ public function setSite($site) { $this->site = $site; } /** {@inheritdoc} */ public function belongsToSite(SiteInterface $site) { return $this->site === $site; } }
{ "content_hash": "927b7bf5ab630545f161f9ebd0a3eb12", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 65, "avg_line_length": 20.390243902439025, "alnum_prop": 0.6435406698564593, "repo_name": "nemesis-platform/platform", "id": "9d6aac827041c8275c99d2b1f11ac1149b7e3b92", "size": "836", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/NemesisPlatform/Core/CMS/Entity/SiteSurvey.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "84866" }, { "name": "Cucumber", "bytes": "45205" }, { "name": "HTML", "bytes": "191374" }, { "name": "JavaScript", "bytes": "12435" }, { "name": "PHP", "bytes": "836648" } ], "symlink_target": "" }
using System.Threading; using SharpLib.Log; namespace DemoWpf { public partial class TabMemo { #region Поля private readonly ILogger _logger; private int _id; private Timer _timer; #endregion #region Конструктор public TabMemo() { InitializeComponent(); var target = new MemoryEventTarget("memory", TargetOnEventReceived); LogManager.Instance.Configuration.AddTarget(target, LogLevel.Debug); _logger = LogManager.Instance.GetLogger(); _timer = new Timer(OnTimer, null, 0, 5000); } #endregion #region Методы private void TargetOnEventReceived(MemoryEventTarget sender, MemoryEventTargetArgs args) { var evt = args.Value.FormattedMessage; PART_memo.AddLine(evt); } private void OnTimer(object state) { _logger.Info("Сообщение: {0}", ++_id); } #endregion } }
{ "content_hash": "8daea10e35c575550e8cd17b103e8d3d", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 96, "avg_line_length": 20.48, "alnum_prop": 0.5751953125, "repo_name": "kav-it/SharpLib", "id": "d963ba9c642200ea2977c3e3791547e4bd8167b9", "size": "1056", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "Source/Demo/Demo.Wpf/Source/Tabs/TabMemo.xaml.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "3000" }, { "name": "C", "bytes": "20844" }, { "name": "C#", "bytes": "6514736" }, { "name": "Smalltalk", "bytes": "5400" } ], "symlink_target": "" }
<?php /* CadyUserBundle:Registration:register_content.html.twig */ class __TwigTemplate_9c1c4aa42e875675b9f1549426cca44e753b10225fa87d6932620578950b516b extends Twig_Template { public function __construct(Twig_Environment $env) { parent::__construct($env); $this->parent = false; $this->blocks = array( ); } protected function doDisplay(array $context, array $blocks = array()) { // line 2 echo " <form action=\""; // line 3 echo $this->env->getExtension('routing')->getPath("fos_user_registration_register"); echo "\" "; echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getContext($context, "form"), 'enctype'); echo " method=\"POST\" class=\"fos_user_registration_register\"> "; // line 4 echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getContext($context, "form"), 'widget'); echo " <div> <input type=\"submit\" value=\""; // line 6 echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("registration.submit", array(), "FOSUserBundle"), "html", null, true); echo "\" /> </div> </form> "; } public function getTemplateName() { return "CadyUserBundle:Registration:register_content.html.twig"; } public function isTraitable() { return false; } public function getDebugInfo() { return array ( 33 => 6, 28 => 4, 22 => 3, 19 => 2,); } }
{ "content_hash": "ac03bc6fd2ca6f1be80acdacc1e46053", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 160, "avg_line_length": 29.09259259259259, "alnum_prop": 0.593252705283259, "repo_name": "kooliameni/ProjetCommerce", "id": "678b9ac27c458aae5251a982cd38ad77a40d7969", "size": "1571", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/cache/dev/twig/9c/1c/4aa42e875675b9f1549426cca44e753b10225fa87d6932620578950b516b.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "440216" }, { "name": "JavaScript", "bytes": "1272000" }, { "name": "PHP", "bytes": "115185" }, { "name": "Shell", "bytes": "1596" } ], "symlink_target": "" }
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?><!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Welcome to CodeIgniter</title> <style type="text/css"> ::selection { background-color: #E13300; color: white; } ::-moz-selection { background-color: #E13300; color: white; } body { background-color: #fff; margin: 40px; font: 13px/20px normal Helvetica, Arial, sans-serif; color: #4F5155; } a { color: #003399; background-color: transparent; font-weight: normal; } h1 { color: #444; background-color: transparent; border-bottom: 1px solid #D0D0D0; font-size: 19px; font-weight: normal; margin: 0 0 14px 0; padding: 14px 15px 10px 15px; } code { font-family: Consolas, Monaco, Courier New, Courier, monospace; font-size: 12px; background-color: #f9f9f9; border: 1px solid #D0D0D0; color: #002166; display: block; margin: 14px 0 14px 0; padding: 12px 10px 12px 10px; } #body { margin: 0 15px 0 15px; } p.footer { text-align: right; font-size: 11px; border-top: 1px solid #D0D0D0; line-height: 32px; padding: 0 10px 0 10px; margin: 20px 0 0 0; } #container { margin: 10px; border: 1px solid #D0D0D0; box-shadow: 0 0 8px #D0D0D0; } </style> </head> <body> <div id="container"> <? $testval='///'; ?> <h1>Welcome to CodeIgniter! <?=$testval?></h1> <div id="body"> <p>The page you are looking at is being generated dynamically by CodeIgniter.</p> <p>If you would like to edit this page you'll find it located at:</p> <code>application/views/welcome_message.php</code> <p>The corresponding controller for this page is found at:</p> <code>application/controllers/Welcome.php</code> <p>If you are exploring CodeIgniter for the very first time, you should start by reading the <a href="user_guide/">User Guide</a>.</p> </div> <p class="footer">Page rendered in <strong>{elapsed_time}</strong> seconds. <?php echo (ENVIRONMENT === 'development') ? 'CodeIgniter Version <strong>' . CI_VERSION . '</strong>' : '' ?></p> </div> </body> </html>
{ "content_hash": "118e6f61c866926b2b1d17546d82ba9e", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 193, "avg_line_length": 22.717391304347824, "alnum_prop": 0.6636363636363637, "repo_name": "sonchai058/codeig", "id": "83c1464ef0647f0f80b99d014c78f1336dfed265", "size": "2090", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/views/web/welcome_message.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "1469" }, { "name": "HTML", "bytes": "23875" }, { "name": "JavaScript", "bytes": "1675" }, { "name": "Makefile", "bytes": "4614" }, { "name": "PHP", "bytes": "2012608" }, { "name": "Python", "bytes": "11579" } ], "symlink_target": "" }
package brooklyn.clocker.example; import brooklyn.catalog.Catalog; import brooklyn.catalog.CatalogConfig; import brooklyn.config.ConfigKey; import brooklyn.entity.basic.AbstractApplication; import brooklyn.entity.basic.ConfigKeys; import brooklyn.entity.basic.Entities; import brooklyn.entity.basic.SoftwareProcess; import brooklyn.entity.java.UsesJmx; import brooklyn.entity.java.UsesJmx.JmxAgentModes; import brooklyn.entity.proxying.EntitySpec; import brooklyn.entity.webapp.JavaWebAppService; import brooklyn.entity.webapp.WebAppService; import brooklyn.entity.webapp.tomcat.TomcatServer; import brooklyn.location.basic.PortRanges; /** * Single-node Tomcat server instance. */ @Catalog(name="Tomcat Server", description="Single Tomcat web application server", iconUrl="classpath://tomcat-logo.png") public class TomcatApplication extends AbstractApplication { public static final String DEFAULT_WAR_PATH = "https://s3-eu-west-1.amazonaws.com/brooklyn-clocker/hello-world.war"; @CatalogConfig(label="War File (URL)", priority=0) public static final ConfigKey<String> WAR_PATH = ConfigKeys.newConfigKey( "app.war", "URL to the application archive which should be deployed", DEFAULT_WAR_PATH); @Override public void initApp() { addChild(EntitySpec.create(TomcatServer.class) .displayName("Tomcat Server") .configure(WebAppService.HTTP_PORT, PortRanges.fromString("8080+")) .configure(JavaWebAppService.ROOT_WAR, Entities.getRequiredUrlConfig(this, WAR_PATH)) .configure(SoftwareProcess.SUGGESTED_VERSION, "7.0.53") .configure(UsesJmx.USE_JMX, Boolean.TRUE) .configure(UsesJmx.JMX_AGENT_MODE, JmxAgentModes.JMXMP) .configure(UsesJmx.JMX_PORT, PortRanges.fromString("30000+"))); } }
{ "content_hash": "64bfc17767a286a78066e0b07d5c34d8", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 120, "avg_line_length": 41.4, "alnum_prop": 0.7348362855609233, "repo_name": "pushtechnology/clocker", "id": "fa7484ccc5dbab04a11e6e03c870daadb326d8d0", "size": "2479", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "examples/src/main/java/brooklyn/clocker/example/TomcatApplication.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "2472" }, { "name": "HTML", "bytes": "8362" }, { "name": "Java", "bytes": "450847" }, { "name": "JavaScript", "bytes": "5761" }, { "name": "Shell", "bytes": "10129" } ], "symlink_target": "" }
{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} -- | Model library. module HL.M where import Control.Applicative -- | The model monad. newtype Model a = Model (IO a) deriving (Monad,Functor,Applicative)
{ "content_hash": "196435058a21340a7a0e8f4380093c2d", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 43, "avg_line_length": 19.666666666666668, "alnum_prop": 0.7203389830508474, "repo_name": "yogsototh/hl", "id": "70438bf0658207d54bbd35dc1a572efd98aeb457", "size": "236", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/HL/M.hs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "20108" }, { "name": "Emacs Lisp", "bytes": "98" }, { "name": "HTML", "bytes": "2952955" }, { "name": "Haskell", "bytes": "35879" }, { "name": "JavaScript", "bytes": "3183" }, { "name": "Shell", "bytes": "236" } ], "symlink_target": "" }
package com.jdon.container.builder; import com.jdon.container.ContainerWrapper; /** * the container builder * * @author <event href="mailto:banqiao@jdon.com">banq</event> * */ public interface ContainerRegistryBuilder { String APPLICATION_CONTEXT_ATTRIBUTE_NAME = "ContainerBuilder"; public void registerAppRoot(String configureFileName) throws Exception; public void registerComponents() throws Exception; public void registerAspectComponents() throws Exception; public void registerUserService() throws Exception; public void startApp(); public void stopApp(); public ContainerWrapper getContainerWrapper(); public void setKernelStartup(boolean startup); public boolean isKernelStartup(); public void doAfterStarted() throws Exception; }
{ "content_hash": "604010cc4369663cd5240a94e3c8bd61", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 72, "avg_line_length": 22.47222222222222, "alnum_prop": 0.7478368355995055, "repo_name": "banq/jdonframework", "id": "30513efcc77361f6efab4d7b8d4384b246f8f133", "size": "1439", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/jdon/container/builder/ContainerRegistryBuilder.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1537464" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>idxassoc: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.15.0 / idxassoc - 8.5.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> idxassoc <small> 8.5.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-11-02 08:22:03 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-11-02 08:22:03 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-gmp 4 Virtual package relying on a GMP lib system installation coq 8.15.0 Formal proof management system dune 3.5.0 Fast, portable, and opinionated build system ocaml 4.05.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.05.0 Official 4.05.0 release ocaml-config 1 OCaml Switch Configuration ocaml-secondary-compiler 4.08.1-1 OCaml 4.08.1 Secondary Switch Compiler ocamlfind 1.9.1 A library manager for OCaml ocamlfind-secondary 1.9.1 Adds support for ocaml-secondary-compiler to ocamlfind zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;matej.kosik@inria.fr&quot; homepage: &quot;https://github.com/coq-contribs/idxassoc&quot; license: &quot;BSD with advertising clause&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/IdxAssoc&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.5&quot; &amp; &lt; &quot;8.6~&quot;} ] tags: [ &quot;keyword:associative arrays&quot; &quot;keyword:search operator&quot; &quot;keyword:data structures&quot; &quot;category:Computer Science/Data Types and Data Structures&quot; &quot;date:2001-04&quot; ] authors: [ &quot;Dominique Quatravaux &lt;&gt;&quot; &quot;Gérald Macinenti &lt;&gt;&quot; &quot;François-René Ridaux &lt;&gt;&quot; ] bug-reports: &quot;https://github.com/coq-contribs/idxassoc/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/idxassoc.git&quot; synopsis: &quot;Associative Arrays&quot; description: &quot;&quot;&quot; We define the associative array (key -&gt; value associations) datatype as list of couples, providing definitions of standards operations such as adding, deleting. We introduce predicates for membership of a key and of couples. Finally we define a search operator (&quot;find&quot;) which returns the value associated with a key or the &quot;none&quot; option (see file Option.v which should be part of this contribution) on failure. Lemmas we prove about these concepts were motivated by our needs at the moment we created this file. We hope they&#39;ll suit your needs too but anyway, feel free to communicate any wish or remark.&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/idxassoc/archive/v8.5.0.tar.gz&quot; checksum: &quot;md5=4ba65dcf6f3a74cfb6a9a4c91c65de54&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-idxassoc.8.5.0 coq.8.15.0</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.15.0). The following dependencies couldn&#39;t be met: - coq-idxassoc -&gt; coq &lt; 8.6~ -&gt; ocaml &lt; 4.03.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-idxassoc.8.5.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{ "content_hash": "e1ebe20cd9d2da9374b913129ea86de5", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 214, "avg_line_length": 44.429378531073446, "alnum_prop": 0.564471007121058, "repo_name": "coq-bench/coq-bench.github.io", "id": "89f1e0d015c6272ac6e9799fd96c1d4aa116deea", "size": "7892", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.05.0-2.0.1/released/8.15.0/idxassoc/8.5.0.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
package io.machinecode.chainlink.core.jsl.impl.execution; import io.machinecode.chainlink.core.context.ExecutionContextImpl; import io.machinecode.chainlink.core.context.JobContextImpl; import io.machinecode.chainlink.core.jsl.impl.JobImpl; import io.machinecode.chainlink.core.jsl.impl.transition.TransitionImpl; import io.machinecode.chainlink.core.util.Statuses; import io.machinecode.chainlink.core.work.ExecutionExecutable; import io.machinecode.chainlink.spi.Messages; import io.machinecode.chainlink.spi.configuration.Configuration; import io.machinecode.chainlink.spi.context.ExecutionContext; import io.machinecode.chainlink.spi.execution.WorkerId; import io.machinecode.chainlink.spi.registry.ExecutableId; import io.machinecode.chainlink.spi.registry.RepositoryId; import io.machinecode.chainlink.spi.then.Chain; import io.machinecode.then.api.Promise; import io.machinecode.then.core.ResolvedDeferred; import org.jboss.logging.Logger; import javax.batch.runtime.BatchStatus; import java.io.Serializable; import java.util.List; /** * @author <a href="mailto:brent.n.douglas@gmail.com">Brent Douglas</a> * @since 1.0 */ public abstract class ExecutionImpl implements io.machinecode.chainlink.spi.jsl.execution.Execution, Serializable { private static final long serialVersionUID = 1L; private static final Logger log = Logger.getLogger(ExecutionImpl.class); protected final String id; public ExecutionImpl(final String id) { this.id = id; } @Override public String getId() { return this.id; } public abstract Promise<Chain<?>,Throwable,?> before(final JobImpl job, final Configuration configuration, final RepositoryId repositoryId, final WorkerId workerId, final ExecutableId callbackId, final ExecutableId parentId, final ExecutionContextImpl context) throws Exception; public abstract Promise<Chain<?>,Throwable,?> after(final JobImpl job, final Configuration configuration, final RepositoryId repositoryId, final WorkerId workerId, final ExecutableId parentId, final ExecutionContextImpl context, final ExecutionContext childContext) throws Exception; public TransitionImpl transition(final ExecutionContextImpl context, final List<? extends TransitionImpl> transitions, final BatchStatus batchStatus, final String exitStatus) throws Exception { final String actualStatus = exitStatus == null ? batchStatus.name() : exitStatus; log().tracef(Messages.get("CHAINLINK-009103.execution.transition.statuses"), context, id, exitStatus); for (final TransitionImpl transition : transitions) { if (Statuses.matches(transition.getOn(), actualStatus)) { log().tracef(Messages.get("CHAINLINK-009101.execution.transition.matched"), context, id, transition.element(), actualStatus, transition.getOn()); if (transition.isTerminating()) { final JobContextImpl jobContext = context.getJobContext(); jobContext.setBatchStatus(transition.getBatchStatus()); final String transitionExitStatus = transition.getExitStatus(); if (transitionExitStatus != null) { jobContext.setExitStatus(transitionExitStatus); } context.setRestartElementId(transition.getRestartId()); } return transition; } else { log().tracef(Messages.get("CHAINLINK-009102.execution.transition.skipped"), context, id, transition.element(), actualStatus, transition.getOn()); } } log().tracef(Messages.get("CHAINLINK-009104.execution.no.transition.matched"), context, id, actualStatus); return null; } public Promise<Chain<?>,Throwable,?> next(final JobImpl job, final Configuration configuration, final WorkerId workerId, final ExecutionContextImpl context, final ExecutableId parentId, final RepositoryId repositoryId, final String next, final TransitionImpl transition) throws Exception { final JobContextImpl jobContext = context.getJobContext(); final BatchStatus batchStatus = jobContext.getBatchStatus(); if (Statuses.isStopping(context) || Statuses.isFailed(batchStatus)) { return configuration.getTransport().callback(parentId, context); } if (transition != null && transition.getNext() != null) { log().debugf(Messages.get("CHAINLINK-009100.execution.transition"), context, id, transition.getNext()); return _runNextExecution(job, configuration, parentId, context, workerId, repositoryId, transition.getNext()); } else if (next != null) { log().debugf(Messages.get("CHAINLINK-009100.execution.transition"), context, id, next); return _runNextExecution(job, configuration, parentId, context, workerId, repositoryId, next); } else { return configuration.getTransport().callback(parentId, context); } } private Promise<Chain<?>,Throwable,?> _runNextExecution(final JobImpl job, final Configuration configuration, final ExecutableId parentId, final ExecutionContextImpl context, final WorkerId workerId, final RepositoryId repositoryId, final String next) throws Exception { final ExecutionImpl execution = job.getNextExecution(next); return _resolve(JobImpl.execute(configuration, new ExecutionExecutable( job, parentId, execution, context, repositoryId, workerId ))); } protected Logger log() { return log; } protected ResolvedDeferred<Chain<?>,Throwable,Object> _resolve(final Chain<?> chain) { return new ResolvedDeferred<Chain<?>,Throwable,Object>(chain); } }
{ "content_hash": "7b6dbd6cb6ecacc12916f1d51402f619", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 178, "avg_line_length": 52.23076923076923, "alnum_prop": 0.6802487317951236, "repo_name": "BrentDouglas/chainlink", "id": "80c40d52a30b1685c7b71e5074b99bb9a98a55b6", "size": "6778", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "core/src/main/java/io/machinecode/chainlink/core/jsl/impl/execution/ExecutionImpl.java", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Groovy", "bytes": "38244" }, { "name": "Java", "bytes": "3335539" }, { "name": "Shell", "bytes": "46609" } ], "symlink_target": "" }
.. _author: Author ====== XlsxWriter was written by John McNamara. * `GitHub <https://github.com/jmcnamara>`_ * `Twitter @jmcnamara13 <https://twitter.com/jmcnamara13>`_ * `Coderwall <https://coderwall.com/jmcnamara>`_ * `Ohloh <https://www.ohloh.net/p/XlsxWriter/contributors/2717606196831029>`_ You can contact me at jmcnamara@cpan.org. Donations --------- If you would like to donate to the xlsxwriter project to keep it active or to pay for the PDF copy of the documentation you can do so via `PayPal <https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RRZCPSL65X858>`_. .. raw:: html <center> <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"> <input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="hosted_button_id" value="DL8AH2YG9XT42"> <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"> </form> </center>
{ "content_hash": "987603340b420190e8f46a2ec301073b", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 169, "avg_line_length": 36.83870967741935, "alnum_prop": 0.6926444833625219, "repo_name": "LuaDist2/xlsxwriter", "id": "4489764baba46c9e65fd2af8bafedd287cb6eaf9", "size": "1142", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "dev/docs/source/author.rst", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "5113" }, { "name": "CMake", "bytes": "31452" }, { "name": "CSS", "bytes": "16544" }, { "name": "HTML", "bytes": "13100" }, { "name": "Lua", "bytes": "429589" }, { "name": "Makefile", "bytes": "6611" }, { "name": "Perl", "bytes": "2005" }, { "name": "Python", "bytes": "39207" }, { "name": "Shell", "bytes": "3737" } ], "symlink_target": "" }
FROM balenalib/colibri-imx6dl-debian:bullseye-run ENV NODE_VERSION 14.15.4 ENV YARN_VERSION 1.22.4 RUN buildDeps='curl libatomic1' \ && set -x \ && for key in \ 6A010C5166006599AA17F08146C2130DFD2497F5 \ ; do \ gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \ gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \ done \ && apt-get update && apt-get install -y $buildDeps --no-install-recommends \ && rm -rf /var/lib/apt/lists/* \ && curl -SLO "http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-armv7l.tar.gz" \ && echo "ffce90b07675434491361dfc74eee230f9ffc65c6c08efb88a18781bcb931871 node-v$NODE_VERSION-linux-armv7l.tar.gz" | sha256sum -c - \ && tar -xzf "node-v$NODE_VERSION-linux-armv7l.tar.gz" -C /usr/local --strip-components=1 \ && rm "node-v$NODE_VERSION-linux-armv7l.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \ && gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && mkdir -p /opt/yarn \ && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \ && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && npm config set unsafe-perm true -g --unsafe-perm \ && rm -rf /tmp/* CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@node.sh" \ && echo "Running test-stack@node" \ && chmod +x test-stack@node.sh \ && bash test-stack@node.sh \ && rm -rf test-stack@node.sh RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Debian Bullseye \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nNode.js v14.15.4, Yarn v1.22.4 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
{ "content_hash": "13af9a03beff6527ddd3033477db8ef4", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 694, "avg_line_length": 65.08888888888889, "alnum_prop": 0.7050187777398429, "repo_name": "nghiant2710/base-images", "id": "67317926b230eb079bf1da80b0f9bf303e3ec99f", "size": "2950", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "balena-base-images/node/colibri-imx6dl/debian/bullseye/14.15.4/run/Dockerfile", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "144558581" }, { "name": "JavaScript", "bytes": "16316" }, { "name": "Shell", "bytes": "368690" } ], "symlink_target": "" }
- Removed legacy onTokenIssuanceStart contracts - Updated responses to return 500 Internal error - Added additional validation for Token Claims ## 1.0.0-beta.1 (2022-09-14) ### Other Changes - The initial beta release
{ "content_hash": "87ebfba76fae6137bfd382c96c1ce96a", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 48, "avg_line_length": 24.555555555555557, "alnum_prop": 0.7692307692307693, "repo_name": "Azure/azure-sdk-for-net", "id": "218fa1ba0be6bb4ddb1c8088da8c528f9badd178", "size": "396", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "sdk/entra/Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents/CHANGELOG.md", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
<?php namespace AppBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\CollectionType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; class ParticipationPhoneNumberList extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add( 'phoneNumbers', CollectionType::class, array( 'label' => false, 'entry_type' => PhoneNumberType::class, 'allow_add' => true, 'allow_delete' => true, 'attr' => array('aria-describedby' => 'help-info-phone-numbers') ) ); } public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults( array( 'data_class' => 'AppBundle\Entity\Participation', ) ); } }
{ "content_hash": "dda973c03b581ebe6ae55ff63467d4cf", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 88, "avg_line_length": 28.055555555555557, "alnum_prop": 0.5841584158415841, "repo_name": "theoboldt/juvem", "id": "6f7a5983b1cc14106ddae814a5fb3b60b1ae5b54", "size": "1235", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/AppBundle/Form/ParticipationPhoneNumberList.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "10048" }, { "name": "HTML", "bytes": "8494" }, { "name": "JavaScript", "bytes": "246390" }, { "name": "PHP", "bytes": "2484612" }, { "name": "SCSS", "bytes": "42083" }, { "name": "Twig", "bytes": "845089" } ], "symlink_target": "" }
[![Angular Style Guide](https://mgechev.github.io/angular2-style-guide/images/badge.svg)](https://angular.io/styleguide) [![Build Status](https://travis-ci.org/mgechev/angular-seed.svg?branch=master)](https://travis-ci.org/mgechev/angular-seed) [![Build Status](https://ci.appveyor.com/api/projects/status/jg5vg36w0klpa00e/branch/master?svg=true)](https://ci.appveyor.com/project/mgechev/angular2-seed) [![Join the chat at https://gitter.im/mgechev/angular2-seed](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mgechev/angular2-seed?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Dependency Status](https://david-dm.org/mgechev/angular-seed.svg)](https://david-dm.org/mgechev/angular-seed) [![devDependency Status](https://david-dm.org/mgechev/angular-seed/dev-status.svg)](https://david-dm.org/mgechev/angular-seed#info=devDependencies) Provides fast, reliable and extensible starter for the development of Angular projects. `angular-seed` provides the following features: - Allows you to painlessly update the seed tasks of your already existing project. - Supports multiple Angular applications with shared codebase in a single instance of the seed. - Official Angular i18n support. - Ready to go, statically typed build system using gulp for working with TypeScript. - Production and development builds. - **Ahead-of-Time** compilation support. - **Tree-Shaking** production builds with Rollup. - Sample unit tests with Jasmine and Karma including code coverage via [istanbul](https://gotwarlost.github.io/istanbul/). - End-to-end tests with Protractor. - Development server with Livereload. - Following the [best practices](https://angular.io/styleguide). - Manager of your type definitions using @types. - Has autoprefixer and css-lint support. - Provides full Docker support for both development and production environment - Support for Angular Mobile Toolkit # How to start **Note** that this seed project requires node v4.x.x or higher and npm 2.14.7 but in order to be able to take advantage of the complete functionality we **strongly recommend node >=v6.5.0 and npm >=3.10.3**. **Here is how to [speed-up the build on Windows](https://github.com/mgechev/angular-seed/wiki/Speed-up-the-build-on-Windows)**. In order to start the seed use: ```bash $ git clone --depth 1 https://github.com/mgechev/angular-seed.git $ cd angular-seed # install the project's dependencies $ npm install # fast install (via Yarn, https://yarnpkg.com) $ yarn install # or yarn # watches your files and uses livereload by default $ npm start # generate api documentation $ npm run compodoc $ npm run serve.compodoc # to start deving with livereload site and coverage as well as continuous testing $ npm run start.deving # dev build $ npm run build.dev # prod build, will output the production application in `dist/prod` # the produced code can be deployed (rsynced) to a remote server $ npm run build.prod # dev build of multiple applications (by default the value of --app is "app") $ npm start -- --app baz $ npm start -- --app foo $ npm start -- --app bar ``` _Does not rely on any global dependencies._ # How to start with AoT compilation **Note** that AoT compilation requires **node v6.5.0 or higher** and **npm 3.10.3 or higher**. In order to start the seed with AoT use: ```bash # prod build with AoT compilation, will output the production application in `dist/prod` # the produced code can be deployed (rsynced) to a remote server $ npm run build.prod.aot ``` # Tree-shaking with Rollup This application provides full support for tree-shaking your production builds with Rollup, which can drastically reduce the size of your application. This is the highest level of optimization currently available. To run this optimized production build, use: ```bash # prod build with AoT compilation and Rollup tree-shaking, will output the production application in `dist/prod` # the produced code can be deployed (rsynced) to a remote server $ npm run build.prod.rollup.aot ``` Your project will be compiled ahead of time (AOT), and then the resulting bundle will be tree-shaken and minified. During the tree-shaking process Rollup statically analyses your code, and your dependencies, and includes the bare minimum in your bundle. **Notes** - Beware of non-static/side-effectful imports. These cannot be properly optimized. For this reason, even though tree-shaking is taking place the developer still needs to be careful not to include non-static imports that are unnecessary, as those referenced imports will always end up in final bundle. Special attention should be given to RxJs, which makes heavy use of non-static/side-effectful imports: make sure you only add the operators you use, as any added operators will be included in your final production bundle. - UMD modules result in code that cannot be properly optimized. For best results, prefer ES6 modules whenever possible. This includes third-party dependencies: if one is published in both UMD and ES6 modules, go with the ES6 modules version. - During a production build, CommonJs modules will be automatically converted to ES6 modules. This means you can use them and/or require dependencies that use them without any issues. # Internationalization Put `i18n` attribute to your html tag to mark it for translation, more information here: https://angular.io/docs/ts/latest/cookbook/i18n.html ## Create a translation source file ```bash # Your translation file will be generated here `dist/locale` $ npm run i18n ``` ## Production build with your language ```bash # Build prod app with the language file `dist/locale/messages.en.xlf` $ npm run build.prod.rollup.aot -- --lang en ``` # Dockerization The application provides full Docker support. You can use it for both development as well as production builds and deployments. ## How to build and start the dockerized version of the application The Dockerization infrastructure is described in the `docker-compose.yml` (respectively `docker-compose.production.yml`. The application consists of two containers: - `angular-seed` - In development mode, this container serves the angular app. In production mode it builds the angular app, with the build artifacts being served by the Nginx container - `angular-seed-nginx` - This container is used only production mode. It serves the built angular app with Nginx. ## Development build and deployment Run the following: ```bash $ docker-compose build $ docker-compose up -d ``` Now open your browser at http://localhost:5555 ## Production build and deployment Run the following: ```bash $ docker-compose -f docker-compose.production.yml build $ docker-compose -f docker-compose.production.yml up angular-seed # Wait until this container has finished building, as the nginx container is dependent on the production build artifacts $ docker-compose -f docker-compose.production.yml up -d angular-seed-nginx # Start the nginx container in detached mode ``` Now open your browser at http://localhost:5555 # Table of Contents - [Introduction](#introduction) - [How to start](#how-to-start) - [How to start with Aot](#how-to-start-with-aot-compilation) - [Tree-shaking with Rollup](#tree-shaking-with-rollup) - [Dockerization](#dockerization) + [How to build and start the dockerized version of the application](#how-to-build-and-start-the-dockerized-version-of-the-application) + [Development build and deployment](#development-build-and-deployment) + [Production build and deployment](#production-build-and-deployment) - [Table of Content](#table-of-content) - [Configuration](#configuration) - [Environment Configuration](#environment-configuration) - [Tools documentation](#tools-documentation) - [How to extend?](#how-to-extend) - [Running tests](#running-tests) - [Contributing](#contributing) - [Advanced Seed Option](#advanced-seed-option) - [Examples](#examples) - [Directory Structure](#directory-structure) - [Contributors](#contributors) - [Wiki Contributors](#wiki-contributors) - [Change Log](#change-log) - [License](#license) # Configuration Default application server configuration ```js var PORT = 5555; var DOCS_PORT = 4003; var APP_BASE = '/'; ``` Configure at runtime ```bash $ npm start -- --port 8080 --base /my-app/ ``` ## Environment configuration If you have different environments and you need to configure them to use different end points, settings, etc. you can use the files `dev.ts` or `prod.ts` in`./tools/env/`. The name of the file is environment you want to use. The environment can be specified by using: ```bash $ npm start -- --env-config ENV_NAME ``` Currently the `ENV_NAME`s are `dev`, `prod`, `staging`, but you can simply add a different file `"ENV_NAME.ts".` file in order to alter extra such environments. # Tools documentation A documentation of the provided tools can be found in [tools/README.md](tools/README.md). # How to extend? Visit the [Wiki page](https://github.com/mgechev/angular-seed/wiki) of the project. # How to update? ``` git remote add upstream https://github.com/mgechev/angular-seed git pull upstream master ``` # Running tests ```bash $ npm test # Development. Your app will be watched by karma # on each change all your specs will be executed. $ npm run test.watch # NB: The command above might fail with a "EMFILE: too many open files" error. # Some OS have a small limit of opened file descriptors (256) by default # and will result in the EMFILE error. # You can raise the maximum of file descriptors by running the command below: $ ulimit -n 10480 # code coverage (istanbul) # auto-generated at the end of `npm test` # view coverage report: $ npm run serve.coverage # e2e (aka. end-to-end, integration) - In three different shell windows # Make sure you don't have a global instance of Protractor # Make sure you do have Java in your PATH (required for webdriver) # npm install webdriver-manager <- Install this first for e2e testing # npm run webdriver-update <- You will need to run this the first time $ npm run webdriver-start $ npm run serve.e2e $ npm run e2e # e2e live mode - Protractor interactive mode # Instead of last command above, you can use: $ npm run e2e.live ``` You can learn more about [Protractor Interactive Mode here](https://github.com/angular/protractor/blob/master/docs/debugging.md#testing-out-protractor-interactively) # Contributing Please see the [CONTRIBUTING](https://github.com/mgechev/angular-seed/blob/master/.github/CONTRIBUTING.md) file for guidelines. # Advanced Seed Option An [advanced option to this seed exists here](https://github.com/NathanWalker/angular-seed-advanced) which mirrors the latest changes here but adds core support for: - [ngrx/store](https://github.com/ngrx/store) RxJS powered state management, inspired by **Redux** - [ngrx/effects](https://github.com/ngrx/effects) Side effect model for @ngrx/store - [ngx-translate](https://github.com/ngx-translate/core) for i18n - Usage is optional but on by default - Up to you and your team how you want to utilize it. It can be easily removed if not needed. - [angulartics2](https://github.com/angulartics/angulartics2) Vendor-agnostic analytics for Angular applications. - Out of box support for [Segment](https://segment.com/) - When using the seed, be sure to change your `write_key` [here](https://github.com/NathanWalker/angular-seed-advanced/blob/master/src/client/index.html#L24) - Can be changed to any vendor, [learn more here](https://github.com/angulartics/angulartics2#supported-providers) - [lodash](https://lodash.com/) Helps reduce blocks of code down to single lines and enhances readability - [NativeScript](https://www.nativescript.org/) cross platform mobile (w/ native UI) apps. - [Electron](http://electron.atom.io/) cross platform desktop apps (Mac, Windows and Linux). You may use it to learn how to extend this seed for your own use cases or use the advanced seed if your project needs those features. # Examples Forks of this project demonstrate how to extend and integrate with other libraries: - https://github.com/mgechev/switching-to-angular2 - code samples for the book ["Switching to Angular 2"](https://www.packtpub.com/web-development/switching-angular-2). - https://github.com/DeviantJS/angular2-seed-postcss - Extending PostCSS with precss / cssnext for Sass-like features. - https://github.com/AngularShowcase/angular2-sample-app - sample Angular application. - https://github.com/AngularShowcase/ng2-bootstrap-sbadmin - ng2-bootstrap-sbadmin. - https://github.com/AngularShowcase/angular2-seed-ng2-highcharts - Simple application including a [Highcharts](http://www.highcharts.com) graph. - https://github.com/tarlepp/angular-sailsjs-boilerplate-frontend-angular2 - Example application for [Sails.js](http://sailsjs.org/) integration. - https://github.com/ludohenin/ng2-wp-blog - Angular application using Wordpress [JSON-API](http://v2.wp-api.org) backend.. - https://github.com/AngularShowcase/angular2-seed-example-mashup - Angular application demonstrating the use of [Redux](http://redux.js.org/), [D3](https://github.com/mbostock/d3), [socket io](https://github.com/socketio), [Google Charts](https://developers.google.com/chart/), and [RxJs](https://github.com/Reactive-Extensions/RxJS). - https://github.com/tiagomapmarques/angular2-seed-phaser/tree/releases - integration with [Phaser](http://phaser.io/). - https://github.com/vyakymenko/angular-seed-express - integration with [Express](https://expressjs.com/) full-stack development. - https://github.com/UIUXEngineering/angular2-jspm-typescript-seed - integration with [JSPM](http://jspm.io/). - http://ngbot.io - a chat bot built with angular-seed. - [angular-seed-inspinia](https://github.com/DmitriyPotapov/angular-seed-inspinia) - integration with custom design template - [telerik/kendo-angular-quickstart-seed](https://github.com/telerik/kendo-angular-quickstart-seed) - integration with Kendo UI for Angular # Directory Structure ``` . ├── .docker │   ├── dist-build.development.dockerfile <- Dockerfile for development environment │   └── dist-build.production.dockerfile <- Dockerfile for production environment ├── .dockerignore <- ignore file for the docker builds ├── LICENSE ├── README.md ├── appveyor.yml ├── docker-compose.production.yml <- docker-compose file for production environment ├── docker-compose.yml. <- docker-compose file for development environment ├── gulpfile.ts <- configuration of the gulp tasks ├── karma.conf.js <- configuration of the test runner ├── package.json <- dependencies of the project ├── protractor.conf.js <- e2e tests configuration ├── src <- source code of the application │   └── client │   ├── app │   │   ├── about │   │   │   ├── about.component.css │   │   │   ├── about.component.e2e-spec.ts │   │   │   ├── about.component.html │   │   │   ├── about.component.spec.ts │   │   │   ├── about.component.ts │   │   │   ├── about.module.ts │   │   │   ├── about.routes.ts │   │   │   └── index.ts │   │   ├── app.component.e2e-spec.ts │   │   ├── app.component.html │   │   ├── app.component.spec.ts │   │   ├── app.component.ts │   │   ├── app.module.ts │   │   ├── app.routes.ts │   │   ├── home │   │   │   ├── home.component.css │   │   │   ├── home.component.e2e-spec.ts │   │   │   ├── home.component.html │   │   │   ├── home.component.spec.ts │   │   │   ├── home.component.ts │   │   │   ├── home.module.ts │   │   │   ├── home.routes.ts │   │   │   └── index.ts │   │   ├── i18n.providers.ts │   │   ├── main-prod.ts │   │   ├── main.ts │   │   ├── operators.ts │   │   ├── shared │   │   │   ├── config │   │   │   │   └── env.config.ts │   │   │   ├── index.ts │   │   │   ├── name-list │   │   │   │   ├── index.ts │   │   │   │   ├── name-list.service.spec.ts │   │   │   │   └── name-list.service.ts │   │   │   ├── navbar │   │   │   │   ├── index.ts │   │   │   │   ├── navbar.component.css │   │   │   │   ├── navbar.component.html │   │   │   │   └── navbar.component.ts │   │   │   ├── shared.module.ts │   │   │   └── toolbar │   │   │   ├── index.ts │   │   │   ├── toolbar.component.css │   │   │   ├── toolbar.component.html │   │   │   └── toolbar.component.ts │   │   └── system-config.ts │   ├── assets │   │   ├── data.json │   │   └── favicon │   │   ├── favicon-DEV.ico │   │   └── favicon-PROD.ico │   │   └── svg │   │   └── more.svg │   ├── css │   │   └── main.css │   ├── index.html │   └── tsconfig.json ├── test-config.js <- testing configuration ├── test-main.js <- karma test launcher ├── tools │   ├── README.md <- build documentation │   ├── config │   │   ├── banner-256.txt │   │   ├── banner.txt │   │   ├── project.config.ts <- configuration of the specific project │   │   ├── project.tasks.json <- override composite gulp tasks │   │   ├── seed.config.ts <- generic configuration of the seed project │   │   ├── seed.config.interfaces.ts │   │   ├── seed.tasks.json <- default composite gulp tasks │   │   └── seed.tslint.json <- generic tslint configuration of the seed project │   ├── config.ts <- exported configuration (merge both seed.config and project.config, project.config overrides seed.config) │   ├── debug.ts │   ├── env <- environment configuration │   │   ├── base.ts │   │   ├── dev.ts │   │   ├── env-config.interface.ts │   │   └── prod.ts │   ├── manual_typings │   │   ├── project <- manual ambient typings for the project │   │   │   └── sample.package.d.ts │   │   └── seed <- seed manual ambient typings │   │   ├── autoprefixer.d.ts │   │   ├── cssnano.d.ts │   │   ├── express-history-api-fallback.d.ts │   │   ├── istream.d.ts │   │   ├── karma.d.ts │   │   ├── merge-stream.d.ts │   │   ├── open.d.ts │   │   ├── operators.d.ts │   │   ├── slash.d.ts │   │   ├── systemjs-builder.d.ts │   │   └── tildify.d.ts │   ├── tasks <- gulp tasks │   │   ├── assets_task.ts │   │   ├── css_task.ts │   │   ├── project <- project specific gulp tasks │   │   │   └── sample.task.ts │   │   └── seed <- seed generic gulp tasks. They can be overriden by the project specific gulp tasks │   │   │   ├── build.assets.dev.ts │   │   │   ├── build.assets.prod.ts │   │   │   ├── build.bundle.rxjs.ts │   │   │   ├── build.bundles.app.exp.ts │   │   │   ├── build.bundles.app.ts │   │   │   ├── build.bundles.ts │   │   │   ├── build.docs.ts │   │   │   ├── build.html_css.ts │   │   │   ├── build.index.dev.ts │   │   │   ├── build.index.prod.ts │   │   │   ├── build.js.dev.ts │   │   │   ├── build.js.e2e.ts │   │   │   ├── build.js.prod.exp.ts │   │   │   ├── build.js.prod.ts │   │   │   ├── build.js.test.ts │   │   │   ├── build.tools.ts │   │   │   ├── check.tools.ts │   │   │   ├── check.versions.ts │   │   │   ├── clean.all.ts │   │   │   ├── clean.coverage.ts │   │   │   ├── clean.dev.ts │   │   │   ├── clean.prod.ts │   │   │   ├── clean.tools.ts │   │   │   ├── clear.files.ts │   │   │   ├── compile.ahead.prod.ts │   │   │   ├── copy.prod.ts │   │   │   ├── e2e.ts │   │   │   ├── generate.manifest.ts │   │   │   ├── karma.run.ts │   │   │   ├── karma.run.with_coverage.ts │   │   │   ├── karma.watch.ts │   │   │   ├── minify.bundles.ts │   │   │   ├── print.banner.ts │   │   │   ├── serve.coverage.ts │   │   │   ├── serve.coverage.watch.ts │   │   │   ├── serve.docs.ts │   │   │   ├── server.prod.ts │   │   │   ├── server.start.ts │   │   │   ├── start.deving.ts │   │   │   ├── tslint.ts │   │   │   ├── watch.dev.ts │   │   │   ├── watch.e2e.ts │   │   │   ├── watch.test.ts │   │   │   └── webdriver.ts │   │   ├── task.ts │   │   └── typescript_task.ts │   ├── utils <- build utils │   │   ├── project <- project specific gulp utils │   │   │   └── sample_util.ts │   │   ├── project.utils.ts │   │   ├── seed <- seed specific gulp utils │   │   │   ├── clean.ts │   │   │   ├── code_change_tools.ts │   │   │   ├── karma.start.ts │   │   │   ├── server.ts │   │   │   ├── tasks_tools.ts │   │   │   ├── template_locals.ts │   │   │   ├── tsproject.ts │   │   │   └── watch.ts │   │   └── seed.utils.ts │   └── utils.ts ├── tsconfig.json <- configuration of the typescript project (ts-node, which runs the tasks defined in gulpfile.ts) ├── tslint.json <- tslint configuration └── yarn.lock ``` # Contributors [<img alt="mgechev" src="https://avatars2.githubusercontent.com/u/455023?v=3&s=117" width="117">](https://github.com/mgechev) |[<img alt="ludohenin" src="https://avatars3.githubusercontent.com/u/1011516?v=3&s=117" width="117">](https://github.com/ludohenin) |[<img alt="d3viant0ne" src="https://avatars2.githubusercontent.com/u/8420490?v=3&s=117" width="117">](https://github.com/d3viant0ne) |[<img alt="Shyam-Chen" src="https://avatars2.githubusercontent.com/u/13535256?v=3&s=117" width="117">](https://github.com/Shyam-Chen) |[<img alt="NathanWalker" src="https://avatars1.githubusercontent.com/u/457187?v=3&s=117" width="117">](https://github.com/NathanWalker) |[<img alt="Nightapes" src="https://avatars2.githubusercontent.com/u/15911153?v=3&s=117" width="117">](https://github.com/Nightapes) | :---: |:---: |:---: |:---: |:---: |:---: | [mgechev](https://github.com/mgechev) |[ludohenin](https://github.com/ludohenin) |[d3viant0ne](https://github.com/d3viant0ne) |[Shyam-Chen](https://github.com/Shyam-Chen) |[NathanWalker](https://github.com/NathanWalker) |[Nightapes](https://github.com/Nightapes) | [<img alt="karlhaas" src="https://avatars1.githubusercontent.com/u/7677394?v=3&s=117" width="117">](https://github.com/karlhaas) |[<img alt="tarlepp" src="https://avatars1.githubusercontent.com/u/595561?v=3&s=117" width="117">](https://github.com/tarlepp) |[<img alt="TheDonDope" src="https://avatars1.githubusercontent.com/u/1188033?v=3&s=117" width="117">](https://github.com/TheDonDope) |[<img alt="robstoll" src="https://avatars2.githubusercontent.com/u/5557885?v=3&s=117" width="117">](https://github.com/robstoll) |[<img alt="hank-ehly" src="https://avatars0.githubusercontent.com/u/11639738?v=3&s=117" width="117">](https://github.com/hank-ehly) |[<img alt="nareshbhatia" src="https://avatars2.githubusercontent.com/u/1220198?v=3&s=117" width="117">](https://github.com/nareshbhatia) | :---: |:---: |:---: |:---: |:---: |:---: | [karlhaas](https://github.com/karlhaas) |[tarlepp](https://github.com/tarlepp) |[TheDonDope](https://github.com/TheDonDope) |[robstoll](https://github.com/robstoll) |[hank-ehly](https://github.com/hank-ehly) |[nareshbhatia](https://github.com/nareshbhatia) | [<img alt="kiuka" src="https://avatars2.githubusercontent.com/u/11283191?v=3&s=117" width="117">](https://github.com/kiuka) |[<img alt="vyakymenko" src="https://avatars2.githubusercontent.com/u/7300673?v=3&s=117" width="117">](https://github.com/vyakymenko) |[<img alt="jesperronn" src="https://avatars1.githubusercontent.com/u/6267?v=3&s=117" width="117">](https://github.com/jesperronn) |[<img alt="daniru" src="https://avatars0.githubusercontent.com/u/2070853?v=3&s=117" width="117">](https://github.com/daniru) |[<img alt="njs50" src="https://avatars3.githubusercontent.com/u/55112?v=3&s=117" width="117">](https://github.com/njs50) |[<img alt="aboeglin" src="https://avatars3.githubusercontent.com/u/8297302?v=3&s=117" width="117">](https://github.com/aboeglin) | :---: |:---: |:---: |:---: |:---: |:---: | [kiuka](https://github.com/kiuka) |[vyakymenko](https://github.com/vyakymenko) |[jesperronn](https://github.com/jesperronn) |[daniru](https://github.com/daniru) |[njs50](https://github.com/njs50) |[aboeglin](https://github.com/aboeglin) | [<img alt="eppsilon" src="https://avatars2.githubusercontent.com/u/5643?v=3&s=117" width="117">](https://github.com/eppsilon) |[<img alt="netstart" src="https://avatars2.githubusercontent.com/u/200232?v=3&s=117" width="117">](https://github.com/netstart) |[<img alt="sasikumardr" src="https://avatars3.githubusercontent.com/u/1760104?v=3&s=117" width="117">](https://github.com/sasikumardr) |[<img alt="ryzy" src="https://avatars2.githubusercontent.com/u/994940?v=3&s=117" width="117">](https://github.com/ryzy) |[<img alt="gkalpak" src="https://avatars1.githubusercontent.com/u/8604205?v=3&s=117" width="117">](https://github.com/gkalpak) |[<img alt="nhutcorp" src="https://avatars0.githubusercontent.com/u/259458?v=3&s=117" width="117">](https://github.com/nhutcorp) | :---: |:---: |:---: |:---: |:---: |:---: | [eppsilon](https://github.com/eppsilon) |[netstart](https://github.com/netstart) |[sasikumardr](https://github.com/sasikumardr) |[ryzy](https://github.com/ryzy) |[gkalpak](https://github.com/gkalpak) |[nhutcorp](https://github.com/nhutcorp) | [<img alt="sfabriece" src="https://avatars1.githubusercontent.com/u/3108592?v=3&s=117" width="117">](https://github.com/sfabriece) |[<img alt="markwhitfeld" src="https://avatars3.githubusercontent.com/u/1948265?v=3&s=117" width="117">](https://github.com/markwhitfeld) |[<img alt="patrickmichalina" src="https://avatars0.githubusercontent.com/u/6701211?v=3&s=117" width="117">](https://github.com/patrickmichalina) |[<img alt="jerryorta-dev" src="https://avatars2.githubusercontent.com/u/341155?v=3&s=117" width="117">](https://github.com/jerryorta-dev) |[<img alt="treyrich" src="https://avatars3.githubusercontent.com/u/1641028?v=3&s=117" width="117">](https://github.com/treyrich) |[<img alt="natarajanmca11" src="https://avatars1.githubusercontent.com/u/9244766?v=3&s=117" width="117">](https://github.com/natarajanmca11) | :---: |:---: |:---: |:---: |:---: |:---: | [sfabriece](https://github.com/sfabriece) |[markwhitfeld](https://github.com/markwhitfeld) |[patrickmichalina](https://github.com/patrickmichalina) |[jerryorta-dev](https://github.com/jerryorta-dev) |[treyrich](https://github.com/treyrich) |[natarajanmca11](https://github.com/natarajanmca11) | [<img alt="e-oz" src="https://avatars3.githubusercontent.com/u/526352?v=3&s=117" width="117">](https://github.com/e-oz) |[<img alt="nosachamos" src="https://avatars2.githubusercontent.com/u/1261686?v=3&s=117" width="117">](https://github.com/nosachamos) |[<img alt="pgrzeszczak" src="https://avatars3.githubusercontent.com/u/3300099?v=3&s=117" width="117">](https://github.com/pgrzeszczak) |[<img alt="alllx" src="https://avatars2.githubusercontent.com/u/701295?v=3&s=117" width="117">](https://github.com/alllx) |[<img alt="LuxDie" src="https://avatars1.githubusercontent.com/u/12536671?v=3&s=117" width="117">](https://github.com/LuxDie) |[<img alt="JakePartusch" src="https://avatars3.githubusercontent.com/u/6424140?v=3&s=117" width="117">](https://github.com/JakePartusch) | :---: |:---: |:---: |:---: |:---: |:---: | [e-oz](https://github.com/e-oz) |[nosachamos](https://github.com/nosachamos) |[pgrzeszczak](https://github.com/pgrzeszczak) |[alllx](https://github.com/alllx) |[LuxDie](https://github.com/LuxDie) |[JakePartusch](https://github.com/JakePartusch) | [<img alt="admosity" src="https://avatars1.githubusercontent.com/u/4655972?v=3&s=117" width="117">](https://github.com/admosity) |[<img alt="JohnCashmore" src="https://avatars0.githubusercontent.com/u/2050794?v=3&s=117" width="117">](https://github.com/JohnCashmore) |[<img alt="larsthorup" src="https://avatars1.githubusercontent.com/u/1202959?v=3&s=117" width="117">](https://github.com/larsthorup) |[<img alt="Karasuni" src="https://avatars2.githubusercontent.com/u/15806406?v=3&s=117" width="117">](https://github.com/Karasuni) |[<img alt="irsick" src="https://avatars3.githubusercontent.com/u/1380457?v=3&s=117" width="117">](https://github.com/irsick) |[<img alt="StefanKoenen" src="https://avatars0.githubusercontent.com/u/1442819?v=3&s=117" width="117">](https://github.com/StefanKoenen) | :---: |:---: |:---: |:---: |:---: |:---: | [admosity](https://github.com/admosity) |[JohnCashmore](https://github.com/JohnCashmore) |[larsthorup](https://github.com/larsthorup) |[Karasuni](https://github.com/Karasuni) |[irsick](https://github.com/irsick) |[StefanKoenen](https://github.com/StefanKoenen) | [<img alt="amedinavalencia" src="https://avatars3.githubusercontent.com/u/21317797?v=3&s=117" width="117">](https://github.com/amedinavalencia) |[<img alt="odk211" src="https://avatars0.githubusercontent.com/u/1321120?v=3&s=117" width="117">](https://github.com/odk211) |[<img alt="troyanskiy" src="https://avatars2.githubusercontent.com/u/1538862?v=3&s=117" width="117">](https://github.com/troyanskiy) |[<img alt="tsm91" src="https://avatars0.githubusercontent.com/u/4459551?v=3&s=117" width="117">](https://github.com/tsm91) |[<img alt="domfarolino" src="https://avatars2.githubusercontent.com/u/9669289?v=3&s=117" width="117">](https://github.com/domfarolino) |[<img alt="juristr" src="https://avatars0.githubusercontent.com/u/542458?v=3&s=117" width="117">](https://github.com/juristr) | :---: |:---: |:---: |:---: |:---: |:---: | [amedinavalencia](https://github.com/amedinavalencia) |[odk211](https://github.com/odk211) |[troyanskiy](https://github.com/troyanskiy) |[tsm91](https://github.com/tsm91) |[domfarolino](https://github.com/domfarolino) |[juristr](https://github.com/juristr) | [<img alt="jvitor83" src="https://avatars1.githubusercontent.com/u/3493339?v=3&s=117" width="117">](https://github.com/jvitor83) |[<img alt="JayKan" src="https://avatars3.githubusercontent.com/u/1400300?v=3&s=117" width="117">](https://github.com/JayKan) |[<img alt="turbohappy" src="https://avatars2.githubusercontent.com/u/437299?v=3&s=117" width="117">](https://github.com/turbohappy) |[<img alt="devanp92" src="https://avatars1.githubusercontent.com/u/4533277?v=3&s=117" width="117">](https://github.com/devanp92) |[<img alt="DmitriyPotapov" src="https://avatars3.githubusercontent.com/u/5184083?v=3&s=117" width="117">](https://github.com/DmitriyPotapov) |[<img alt="evanplaice" src="https://avatars2.githubusercontent.com/u/303159?v=3&s=117" width="117">](https://github.com/evanplaice) | :---: |:---: |:---: |:---: |:---: |:---: | [jvitor83](https://github.com/jvitor83) |[JayKan](https://github.com/JayKan) |[turbohappy](https://github.com/turbohappy) |[devanp92](https://github.com/devanp92) |[DmitriyPotapov](https://github.com/DmitriyPotapov) |[evanplaice](https://github.com/evanplaice) | [<img alt="hAWKdv" src="https://avatars0.githubusercontent.com/u/4449497?v=3&s=117" width="117">](https://github.com/hAWKdv) |[<img alt="JunaidZA" src="https://avatars0.githubusercontent.com/u/16782593?v=3&s=117" width="117">](https://github.com/JunaidZA) |[<img alt="c-ice" src="https://avatars0.githubusercontent.com/u/347238?v=3&s=117" width="117">](https://github.com/c-ice) |[<img alt="markharding" src="https://avatars0.githubusercontent.com/u/851436?v=3&s=117" width="117">](https://github.com/markharding) |[<img alt="ojacquemart" src="https://avatars2.githubusercontent.com/u/1189345?v=3&s=117" width="117">](https://github.com/ojacquemart) |[<img alt="rafaelss95" src="https://avatars3.githubusercontent.com/u/11965907?v=3&s=117" width="117">](https://github.com/rafaelss95) | :---: |:---: |:---: |:---: |:---: |:---: | [hAWKdv](https://github.com/hAWKdv) |[JunaidZA](https://github.com/JunaidZA) |[c-ice](https://github.com/c-ice) |[markharding](https://github.com/markharding) |[ojacquemart](https://github.com/ojacquemart) |[rafaelss95](https://github.com/rafaelss95) | [<img alt="gotenxds" src="https://avatars1.githubusercontent.com/u/3519520?v=3&s=117" width="117">](https://github.com/gotenxds) |[<img alt="TuiKiken" src="https://avatars2.githubusercontent.com/u/959821?v=3&s=117" width="117">](https://github.com/TuiKiken) |[<img alt="edud69" src="https://avatars1.githubusercontent.com/u/1514745?v=3&s=117" width="117">](https://github.com/edud69) |[<img alt="idready" src="https://avatars2.githubusercontent.com/u/4941311?v=3&s=117" width="117">](https://github.com/idready) |[<img alt="Yonet" src="https://avatars2.githubusercontent.com/u/3523671?v=3&s=117" width="117">](https://github.com/Yonet) |[<img alt="Green-Cat" src="https://avatars1.githubusercontent.com/u/3328823?v=3&s=117" width="117">](https://github.com/Green-Cat) | :---: |:---: |:---: |:---: |:---: |:---: | [gotenxds](https://github.com/gotenxds) |[TuiKiken](https://github.com/TuiKiken) |[edud69](https://github.com/edud69) |[idready](https://github.com/idready) |[Yonet](https://github.com/Yonet) |[Green-Cat](https://github.com/Green-Cat) | [<img alt="ip512" src="https://avatars3.githubusercontent.com/u/1699735?v=3&s=117" width="117">](https://github.com/ip512) |[<img alt="joshboley" src="https://avatars3.githubusercontent.com/u/5840836?v=3&s=117" width="117">](https://github.com/joshboley) |[<img alt="Marcelh1983" src="https://avatars2.githubusercontent.com/u/3284645?v=3&s=117" width="117">](https://github.com/Marcelh1983) |[<img alt="Bigous" src="https://avatars2.githubusercontent.com/u/6886560?v=3&s=117" width="117">](https://github.com/Bigous) |[<img alt="rajeev-tripathi" src="https://avatars0.githubusercontent.com/u/12512503?v=3&s=117" width="117">](https://github.com/rajeev-tripathi) |[<img alt="alexweber" src="https://avatars2.githubusercontent.com/u/14409?v=3&s=117" width="117">](https://github.com/alexweber) | :---: |:---: |:---: |:---: |:---: |:---: | [ip512](https://github.com/ip512) |[joshboley](https://github.com/joshboley) |[Marcelh1983](https://github.com/Marcelh1983) |[Bigous](https://github.com/Bigous) |[rajeev-tripathi](https://github.com/rajeev-tripathi) |[alexweber](https://github.com/alexweber) | [<img alt="allenhwkim" src="https://avatars2.githubusercontent.com/u/1437734?v=3&s=117" width="117">](https://github.com/allenhwkim) |[<img alt="hellofornow" src="https://avatars0.githubusercontent.com/u/3720413?v=3&s=117" width="117">](https://github.com/hellofornow) |[<img alt="Falinor" src="https://avatars1.githubusercontent.com/u/9626158?v=3&s=117" width="117">](https://github.com/Falinor) |[<img alt="amaltsev" src="https://avatars1.githubusercontent.com/u/2480962?v=3&s=117" width="117">](https://github.com/amaltsev) |[<img alt="yassirh" src="https://avatars1.githubusercontent.com/u/4649139?v=3&s=117" width="117">](https://github.com/yassirh) |[<img alt="taguan" src="https://avatars0.githubusercontent.com/u/1026937?v=3&s=117" width="117">](https://github.com/taguan) | :---: |:---: |:---: |:---: |:---: |:---: | [allenhwkim](https://github.com/allenhwkim) |[hellofornow](https://github.com/hellofornow) |[Falinor](https://github.com/Falinor) |[amaltsev](https://github.com/amaltsev) |[yassirh](https://github.com/yassirh) |[taguan](https://github.com/taguan) | [<img alt="bbarry" src="https://avatars3.githubusercontent.com/u/84951?v=3&s=117" width="117">](https://github.com/bbarry) |[<img alt="sonicparke" src="https://avatars1.githubusercontent.com/u/1139721?v=3&s=117" width="117">](https://github.com/sonicparke) |[<img alt="brendanbenson" src="https://avatars3.githubusercontent.com/u/866866?v=3&s=117" width="117">](https://github.com/brendanbenson) |[<img alt="brian428" src="https://avatars0.githubusercontent.com/u/140338?v=3&s=117" width="117">](https://github.com/brian428) |[<img alt="briantopping" src="https://avatars1.githubusercontent.com/u/158115?v=3&s=117" width="117">](https://github.com/briantopping) |[<img alt="ckapilla" src="https://avatars0.githubusercontent.com/u/451875?v=3&s=117" width="117">](https://github.com/ckapilla) | :---: |:---: |:---: |:---: |:---: |:---: | [bbarry](https://github.com/bbarry) |[sonicparke](https://github.com/sonicparke) |[brendanbenson](https://github.com/brendanbenson) |[brian428](https://github.com/brian428) |[briantopping](https://github.com/briantopping) |[ckapilla](https://github.com/ckapilla) | [<img alt="cadriel" src="https://avatars1.githubusercontent.com/u/205520?v=3&s=117" width="117">](https://github.com/cadriel) |[<img alt="Cselt" src="https://avatars3.githubusercontent.com/u/11027521?v=3&s=117" width="117">](https://github.com/Cselt) |[<img alt="dszymczuk" src="https://avatars0.githubusercontent.com/u/539352?v=3&s=117" width="117">](https://github.com/dszymczuk) |[<img alt="dmurat" src="https://avatars2.githubusercontent.com/u/470930?v=3&s=117" width="117">](https://github.com/dmurat) |[<img alt="peah90" src="https://avatars3.githubusercontent.com/u/4435255?v=3&s=117" width="117">](https://github.com/peah90) |[<img alt="dstockhammer" src="https://avatars2.githubusercontent.com/u/1156637?v=3&s=117" width="117">](https://github.com/dstockhammer) | :---: |:---: |:---: |:---: |:---: |:---: | [cadriel](https://github.com/cadriel) |[Cselt](https://github.com/Cselt) |[dszymczuk](https://github.com/dszymczuk) |[dmurat](https://github.com/dmurat) |[peah90](https://github.com/peah90) |[dstockhammer](https://github.com/dstockhammer) | [<img alt="madcalfus" src="https://avatars0.githubusercontent.com/u/8432125?v=3&s=117" width="117">](https://github.com/madcalfus) |[<img alt="dwido" src="https://avatars0.githubusercontent.com/u/154235?v=3&s=117" width="117">](https://github.com/dwido) |[<img alt="totev" src="https://avatars0.githubusercontent.com/u/4454638?v=3&s=117" width="117">](https://github.com/totev) |[<img alt="ericdoerheit" src="https://avatars2.githubusercontent.com/u/8611720?v=3&s=117" width="117">](https://github.com/ericdoerheit) |[<img alt="gp187" src="https://avatars3.githubusercontent.com/u/3019963?v=3&s=117" width="117">](https://github.com/gp187) |[<img alt="gsamokovarov" src="https://avatars3.githubusercontent.com/u/604618?v=3&s=117" width="117">](https://github.com/gsamokovarov) | :---: |:---: |:---: |:---: |:---: |:---: | [madcalfus](https://github.com/madcalfus) |[dwido](https://github.com/dwido) |[totev](https://github.com/totev) |[ericdoerheit](https://github.com/ericdoerheit) |[gp187](https://github.com/gp187) |[gsamokovarov](https://github.com/gsamokovarov) | [<img alt="koodikindral" src="https://avatars0.githubusercontent.com/u/6285484?v=3&s=117" width="117">](https://github.com/koodikindral) |[<img alt="hpinsley" src="https://avatars3.githubusercontent.com/u/750098?v=3&s=117" width="117">](https://github.com/hpinsley) |[<img alt="NN77" src="https://avatars1.githubusercontent.com/u/3319904?v=3&s=117" width="117">](https://github.com/NN77) |[<img alt="isidroamv" src="https://avatars3.githubusercontent.com/u/4197621?v=3&s=117" width="117">](https://github.com/isidroamv) |[<img alt="JohnnyQQQQ" src="https://avatars3.githubusercontent.com/u/3528218?v=3&s=117" width="117">](https://github.com/JohnnyQQQQ) |[<img alt="jeffbcross" src="https://avatars1.githubusercontent.com/u/463703?v=3&s=117" width="117">](https://github.com/jeffbcross) | :---: |:---: |:---: |:---: |:---: |:---: | [koodikindral](https://github.com/koodikindral) |[hpinsley](https://github.com/hpinsley) |[NN77](https://github.com/NN77) |[isidroamv](https://github.com/isidroamv) |[JohnnyQQQQ](https://github.com/JohnnyQQQQ) |[jeffbcross](https://github.com/jeffbcross) | [<img alt="Drane" src="https://avatars2.githubusercontent.com/u/389499?v=3&s=117" width="117">](https://github.com/Drane) |[<img alt="johnjelinek" src="https://avatars1.githubusercontent.com/u/873610?v=3&s=117" width="117">](https://github.com/johnjelinek) |[<img alt="JunusErgin" src="https://avatars2.githubusercontent.com/u/7281463?v=3&s=117" width="117">](https://github.com/JunusErgin) |[<img alt="justindujardin" src="https://avatars3.githubusercontent.com/u/101493?v=3&s=117" width="117">](https://github.com/justindujardin) |[<img alt="lihaibh" src="https://avatars0.githubusercontent.com/u/4681233?v=3&s=117" width="117">](https://github.com/lihaibh) |[<img alt="Brooooooklyn" src="https://avatars2.githubusercontent.com/u/3468483?v=3&s=117" width="117">](https://github.com/Brooooooklyn) | :---: |:---: |:---: |:---: |:---: |:---: | [Drane](https://github.com/Drane) |[johnjelinek](https://github.com/johnjelinek) |[JunusErgin](https://github.com/JunusErgin) |[justindujardin](https://github.com/justindujardin) |[lihaibh](https://github.com/lihaibh) |[Brooooooklyn](https://github.com/Brooooooklyn) | [<img alt="tandu" src="https://avatars3.githubusercontent.com/u/273313?v=3&s=117" width="117">](https://github.com/tandu) |[<img alt="inkidotcom" src="https://avatars0.githubusercontent.com/u/100466?v=3&s=117" width="117">](https://github.com/inkidotcom) |[<img alt="mpetkov" src="https://avatars2.githubusercontent.com/u/8858458?v=3&s=117" width="117">](https://github.com/mpetkov) |[<img alt="daixtrose" src="https://avatars1.githubusercontent.com/u/5588692?v=3&s=117" width="117">](https://github.com/daixtrose) |[<img alt="Doehl" src="https://avatars3.githubusercontent.com/u/1913751?v=3&s=117" width="117">](https://github.com/Doehl) |[<img alt="MathijsHoogland" src="https://avatars1.githubusercontent.com/u/7372934?v=3&s=117" width="117">](https://github.com/MathijsHoogland) | :---: |:---: |:---: |:---: |:---: |:---: | [tandu](https://github.com/tandu) |[inkidotcom](https://github.com/inkidotcom) |[mpetkov](https://github.com/mpetkov) |[daixtrose](https://github.com/daixtrose) |[Doehl](https://github.com/Doehl) |[MathijsHoogland](https://github.com/MathijsHoogland) | [<img alt="mjwwit" src="https://avatars0.githubusercontent.com/u/4455124?v=3&s=117" width="117">](https://github.com/mjwwit) |[<img alt="oferze" src="https://avatars0.githubusercontent.com/u/5157769?v=3&s=117" width="117">](https://github.com/oferze) |[<img alt="ocombe" src="https://avatars3.githubusercontent.com/u/265378?v=3&s=117" width="117">](https://github.com/ocombe) |[<img alt="gdi2290" src="https://avatars0.githubusercontent.com/u/1016365?v=3&s=117" width="117">](https://github.com/gdi2290) |[<img alt="typekpb" src="https://avatars2.githubusercontent.com/u/499820?v=3&s=117" width="117">](https://github.com/typekpb) |[<img alt="pavlovich" src="https://avatars3.githubusercontent.com/u/1209167?v=3&s=117" width="117">](https://github.com/pavlovich) | :---: |:---: |:---: |:---: |:---: |:---: | [mjwwit](https://github.com/mjwwit) |[oferze](https://github.com/oferze) |[ocombe](https://github.com/ocombe) |[gdi2290](https://github.com/gdi2290) |[typekpb](https://github.com/typekpb) |[pavlovich](https://github.com/pavlovich) | [<img alt="philipooo" src="https://avatars0.githubusercontent.com/u/1702399?v=3&s=117" width="117">](https://github.com/philipooo) |[<img alt="redian" src="https://avatars1.githubusercontent.com/u/816941?v=3&s=117" width="117">](https://github.com/redian) |[<img alt="robbatt" src="https://avatars1.githubusercontent.com/u/1379424?v=3&s=117" width="117">](https://github.com/robbatt) |[<img alt="robertpenner" src="https://avatars3.githubusercontent.com/u/79827?v=3&s=117" width="117">](https://github.com/robertpenner) |[<img alt="Sjiep" src="https://avatars0.githubusercontent.com/u/5003111?v=3&s=117" width="117">](https://github.com/Sjiep) |[<img alt="RoxKilly" src="https://avatars2.githubusercontent.com/u/12346501?v=3&s=117" width="117">](https://github.com/RoxKilly) | :---: |:---: |:---: |:---: |:---: |:---: | [philipooo](https://github.com/philipooo) |[redian](https://github.com/redian) |[robbatt](https://github.com/robbatt) |[robertpenner](https://github.com/robertpenner) |[Sjiep](https://github.com/Sjiep) |[RoxKilly](https://github.com/RoxKilly) | [<img alt="siovene" src="https://avatars3.githubusercontent.com/u/891580?v=3&s=117" width="117">](https://github.com/siovene) |[<img alt="SamVerschueren" src="https://avatars1.githubusercontent.com/u/1913805?v=3&s=117" width="117">](https://github.com/SamVerschueren) |[<img alt="sclausen" src="https://avatars2.githubusercontent.com/u/916076?v=3&s=117" width="117">](https://github.com/sclausen) |[<img alt="heavymery" src="https://avatars2.githubusercontent.com/u/3417123?v=3&s=117" width="117">](https://github.com/heavymery) |[<img alt="tapas4java" src="https://avatars3.githubusercontent.com/u/2254963?v=3&s=117" width="117">](https://github.com/tapas4java) |[<img alt="tsvetomir" src="https://avatars2.githubusercontent.com/u/247917?v=3&s=117" width="117">](https://github.com/tsvetomir) | :---: |:---: |:---: |:---: |:---: |:---: | [siovene](https://github.com/siovene) |[SamVerschueren](https://github.com/SamVerschueren) |[sclausen](https://github.com/sclausen) |[heavymery](https://github.com/heavymery) |[tapas4java](https://github.com/tapas4java) |[tsvetomir](https://github.com/tsvetomir) | [<img alt="valera-rozuvan" src="https://avatars2.githubusercontent.com/u/2273090?v=3&s=117" width="117">](https://github.com/valera-rozuvan) |[<img alt="vogloblinsky" src="https://avatars0.githubusercontent.com/u/2841805?v=3&s=117" width="117">](https://github.com/vogloblinsky) |[<img alt="vincentpalita" src="https://avatars0.githubusercontent.com/u/2738822?v=3&s=117" width="117">](https://github.com/vincentpalita) |[<img alt="VladimirMakaev" src="https://avatars0.githubusercontent.com/u/2001475?v=3&s=117" width="117">](https://github.com/VladimirMakaev) |[<img alt="Yalrafih" src="https://avatars2.githubusercontent.com/u/7460011?v=3&s=117" width="117">](https://github.com/Yalrafih) |[<img alt="arioth" src="https://avatars0.githubusercontent.com/u/3458082?v=3&s=117" width="117">](https://github.com/arioth) | :---: |:---: |:---: |:---: |:---: |:---: | [valera-rozuvan](https://github.com/valera-rozuvan) |[vogloblinsky](https://github.com/vogloblinsky) |[vincentpalita](https://github.com/vincentpalita) |[VladimirMakaev](https://github.com/VladimirMakaev) |[Yalrafih](https://github.com/Yalrafih) |[arioth](https://github.com/arioth) | [<img alt="billsworld" src="https://avatars0.githubusercontent.com/u/16911647?v=3&s=117" width="117">](https://github.com/billsworld) |[<img alt="blackheart01" src="https://avatars2.githubusercontent.com/u/1414277?v=3&s=117" width="117">](https://github.com/blackheart01) |[<img alt="butterfieldcons" src="https://avatars1.githubusercontent.com/u/12204784?v=3&s=117" width="117">](https://github.com/butterfieldcons) |[<img alt="danielcrisp" src="https://avatars2.githubusercontent.com/u/1104814?v=3&s=117" width="117">](https://github.com/danielcrisp) |[<img alt="gforceg" src="https://avatars0.githubusercontent.com/u/14267747?v=3&s=117" width="117">](https://github.com/gforceg) |[<img alt="jgolla" src="https://avatars0.githubusercontent.com/u/1542447?v=3&s=117" width="117">](https://github.com/jgolla) | :---: |:---: |:---: |:---: |:---: |:---: | [billsworld](https://github.com/billsworld) |[blackheart01](https://github.com/blackheart01) |[butterfieldcons](https://github.com/butterfieldcons) |[danielcrisp](https://github.com/danielcrisp) |[gforceg](https://github.com/gforceg) |[jgolla](https://github.com/jgolla) | [<img alt="omerfarukyilmaz" src="https://avatars0.githubusercontent.com/u/5538485?v=3&s=117" width="117">](https://github.com/omerfarukyilmaz) |[<img alt="pbazurin-softheme" src="https://avatars0.githubusercontent.com/u/4518922?v=3&s=117" width="117">](https://github.com/pbazurin-softheme) |[<img alt="ZuSe" src="https://avatars0.githubusercontent.com/u/522403?v=3&s=117" width="117">](https://github.com/ZuSe) |[<img alt="rossedfort" src="https://avatars0.githubusercontent.com/u/11775628?v=3&s=117" width="117">](https://github.com/rossedfort) |[<img alt="ruffiem" src="https://avatars2.githubusercontent.com/u/1785492?v=3&s=117" width="117">](https://github.com/ruffiem) |[<img alt="savcha" src="https://avatars3.githubusercontent.com/u/879542?v=3&s=117" width="117">](https://github.com/savcha) | :---: |:---: |:---: |:---: |:---: |:---: | [omerfarukyilmaz](https://github.com/omerfarukyilmaz) |[pbazurin-softheme](https://github.com/pbazurin-softheme) |[ZuSe](https://github.com/ZuSe) |[rossedfort](https://github.com/rossedfort) |[ruffiem](https://github.com/ruffiem) |[savcha](https://github.com/savcha) | [<img alt="ultrasonicsoft" src="https://avatars0.githubusercontent.com/u/4145169?v=3&s=117" width="117">](https://github.com/ultrasonicsoft) |[<img alt="nulldev07" src="https://avatars3.githubusercontent.com/u/2115712?v=3&s=117" width="117">](https://github.com/nulldev07) | :---: |:---: | [ultrasonicsoft](https://github.com/ultrasonicsoft) |[nulldev07](https://github.com/nulldev07) | ## Wiki Contributors Here are all the awesome guys who are helping to make the project's wiki even better! ``` 60 Minko Gechev 35 Clayton K. N. Passos 15 Shyam-Chen 14 Vincent van Proosdij 8 Robert van Kints 8 matthew harwood 8 Christian Dobert 7 Neo Minchul Chae 6 Ludovic HENIN 6 ruffiem 5 Attila Egyed 5 hhubik 4 Chris Kapilla 4 davidgfolch 4 gforceg 4 Brian Kotek 3 Ezequiel Cicala 3 Stefan Schüller 3 Kirill Zdornyy 3 Patrick Hillert 3 Robert Stoll 2 Dinsitro 2 Brooke Smith 2 Joshua Wiens 2 Daniele Zurico 2 Amal Shehu 2 Cy Klassen 2 Nathan Walker 2 Simon Hampton 2 omerfarukyilmaz 2 Hank Ehly 2 zealitude 2 Paul Davis 2 valentin 2 Giovanni Candido da Silva 2 Drake Wilson 2 Yannick Koehler 1 jovermier 1 kiuka 1 mcchae7 1 neridonk 1 samuelfernandez 1 silicakes 1 zcsongor 1 Adam Johannesmeyer 1 陳彥澄 1 Alexander Yamkov 1 Ameer Nuri 1 Ankit Kamboj 1 BouncingBit 1 Charlie Hua 1 Dang Tung 1 EBIA 1 Eddie Sun 1 Enrico Secondulfo 1 Eugene Serkin 1 Fede Guzmán 1 Frido Koch 1 Ishara Samantha 1 Jack Morrissey 1 Jesper Rønn-Jensen 1 José Rebelo 1 Karasu 1 Marc-André Barbeau 1 Mathias Døhl 1 Myrmex 1 Pol Stafford 1 Raphael Schmitt 1 Sebastian Fuss 1 Sebastien de Salvador 1 Shyam Chen 1 Simon Altschuler 1 Sylvain Francois 1 The Ult 1 Valentyn Yakymenko 1 Vivin Antony 1 Yen-cheng Chen, 陳彥澄 1 Yonet 1 Zakhar Gulchak 1 ganesansays 1 geo101 1 graham ``` # Change Log You can follow the [Angular change log here](https://github.com/angular/angular/blob/master/CHANGELOG.md). # License MIT
{ "content_hash": "c64f70aba2ada75badd0bbe3b90f60fa", "timestamp": "", "source": "github", "line_count": 685, "max_line_length": 827, "avg_line_length": 73.28613138686131, "alnum_prop": 0.6837313997729129, "repo_name": "snaik2064/chipotle", "id": "973c3f42bd6469a4ee4aac26447af03eb065fc7c", "size": "52931", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "4719" }, { "name": "HTML", "bytes": "7035" }, { "name": "JavaScript", "bytes": "7120" }, { "name": "Nginx", "bytes": "1052" }, { "name": "TypeScript", "bytes": "18911" } ], "symlink_target": "" }
INSERT INTO gnaf.address_alias_lookup SELECT aa.principal_pid, aa.alias_pid, aut.name AS join_type FROM raw_gnaf.address_alias AS aa INNER JOIN gnaf.temp_addresses AS adr ON aa.alias_pid = adr.gnaf_pid INNER JOIN gnaf.temp_addresses AS adr2 ON aa.principal_pid = adr2.gnaf_pid INNER JOIN raw_gnaf.address_alias_type_aut AS aut ON aa.alias_type_code = aut.code WHERE adr2.alias_principal = 'P'; -- GNAF 2015-11, there are 23 aliases that are listed as principals in the raw_gnaf.address_alias - these need to be excluded
{ "content_hash": "07a21572aeb3f578545259ff06481537", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 161, "avg_line_length": 75.57142857142857, "alnum_prop": 0.7618147448015122, "repo_name": "minus34/gnaf-loader", "id": "db6094fdb24d0d67daaa2f8bd2e4a9873e6e00b8", "size": "529", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "postgres-scripts/03-08-reference-populate-address-alias-lookup.sql", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Python", "bytes": "140148" }, { "name": "Shell", "bytes": "39974" } ], "symlink_target": "" }
require 'sleeping_king_studios/tools/toolbox/configuration' require 'sleeping_king_studios/tasks/apps' module SleepingKingStudios::Tasks::Apps # Application configuration options. class AppConfiguration < SleepingKingStudios::Tools::Toolbox::Configuration namespace :ci do option :rspec, :default => {} option :rubocop, :default => {} option :simplecov, :default => {} option :steps, :default => ->() { SleepingKingStudios::Tasks.configuration.apps.ci.steps } define_method :steps_with_options do steps.each.with_object({}) do |step, hsh| value = send(step) next hsh[step] = false if value == false default = SleepingKingStudios::Tasks.configuration.apps.ci.send(step) hsh[step] = default.merge(value) end # each end # method steps_with_options end # namespace define_method :default_source_files do files = [ "apps/#{short_name}", "apps/#{short_name}.rb", "lib/#{short_name}", "lib/#{short_name}.rb" ] # end files files.select { |path| File.exist?(path) } end # method default_source_files define_method :default_spec_files do files = ["apps/#{short_name}/spec", "spec/#{short_name}"] files.select { |path| File.exist?(path) } end # method default_spec_files define_method :short_name do # rubocop:disable Style/RedundantSelf tools.str.underscore(self.name.gsub(/\s+/, '_')) # rubocop:enable Style/RedundantSelf end # define_method define_method :tools do SleepingKingStudios::Tools::Toolbelt.instance end # method tools option :gemfile, :default => 'Gemfile' option :name option :source_files, :default => ->() { default_source_files } option :spec_files, :default => ->() { default_spec_files } end # module end # module
{ "content_hash": "4255c38cbe626a6cf3e55e5f39835d93", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 77, "avg_line_length": 28.848484848484848, "alnum_prop": 0.6260504201680672, "repo_name": "sleepingkingstudios/sleeping_king_studios-tasks", "id": "ac21a7e4ff53e976a5d641a16875a50912a8d241", "size": "1965", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/sleeping_king_studios/tasks/apps/app_configuration.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Gherkin", "bytes": "578" }, { "name": "HTML", "bytes": "1113" }, { "name": "Ruby", "bytes": "330280" } ], "symlink_target": "" }
/* * HE_Mesh Frederik Vanhoutte - www.wblut.com * * https://github.com/wblut/HE_Mesh * A Processing/Java library for for creating and manipulating polygonal meshes. * * Public Domain: http://creativecommons.org/publicdomain/zero/1.0/ */ package wblut.hemesh; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import wblut.geom.WB_Point; /** * Creates the dual of a mesh. Vertices are replace with faces connecting all * face centers surrounding original vertex. The faces are replaced by vertices * at their center. * * @author Frederik Vanhoutte (W:Blut) * */ public class HEC_Dual extends HEC_Creator { /** Source mesh. */ private HE_Mesh source; private boolean fixNonPlanarFaces; private boolean setCenter; private boolean keepBoundary; /** * Instantiates a new HEC_Dual. * */ public HEC_Dual() { super(); override = true; toModelview = false; } /** * Instantiates a new HEC_Dual. * * @param mesh * source mesh */ public HEC_Dual(final HE_Mesh mesh) { this(); source = mesh; fixNonPlanarFaces = true; } /** * Set source mesh. * * @param mesh * source mesh * @return self */ public HEC_Dual setSource(final HE_Mesh mesh) { source = mesh; return this; } /** * * * @param b * @return */ public HEC_Dual resetCenter(final boolean b) { setCenter = b; return this; } /** * * * @param b * @return */ public HEC_Dual setKeepBoundary(final boolean b) { keepBoundary = b; return this; } /** * * * @param b * @return */ public HEC_Dual setFixNonPlanarFaces(final boolean b) { fixNonPlanarFaces = b; return this; } /* * (non-Javadoc) * * @see wblut.hemesh.HE_Creator#create() */ @Override public HE_Mesh createBase() { final HE_Mesh result = new HE_Mesh(); if (source == null || source.getNumberOfFaces() < 3) { return result; } final HashMap<Long, Long> faceVertexCorrelation = new HashMap<Long, Long>(); final Iterator<HE_Face> fItr = source.fItr(); HE_Face f; while (fItr.hasNext()) { f = fItr.next(); final HE_Vertex cv = new HE_Vertex(f.getFaceCenter()); faceVertexCorrelation.put(f.key(), cv.key()); result.add(cv); } HE_Halfedge he; if (keepBoundary) { final Iterator<HE_Halfedge> heItr = source.heItr(); while (heItr.hasNext()) { he = heItr.next(); if (he.isOuterBoundary()) { HE_Vertex cv = new HE_Vertex(he.getEdgeCenter()); faceVertexCorrelation.put(he.key(), cv.key()); result.add(cv); cv = new HE_Vertex(he.getVertex()); faceVertexCorrelation.put(he.getVertex().key(), cv.key()); result.add(cv); } } } final Iterator<HE_Vertex> vItr = source.vItr(); HE_Vertex v; final List<WB_Point> centers = new ArrayList<WB_Point>(); while (vItr.hasNext()) { v = vItr.next(); if (!v.isBoundary()) { he = v.getHalfedge(); final List<HE_Halfedge> faceHalfedges = new ArrayList<HE_Halfedge>(); final HE_Face nf = new HE_Face(); final WB_Point p = new WB_Point(); int n = 0; do { final HE_Halfedge hen = new HE_Halfedge(); faceHalfedges.add(hen); result.setFace(hen, nf); final Long key = faceVertexCorrelation.get(he.getFace().key()); result.setVertex(hen, result.getVertexWithKey(key)); p.addSelf(hen.getVertex()); n++; if (hen.getVertex().getHalfedge() == null) { result.setHalfedge(hen.getVertex(), hen); } if (nf.getHalfedge() == null) { result.setHalfedge(nf, hen); } he = he.getNextInVertex(); } while (he != v.getHalfedge()); p.divSelf(n); centers.add(p); result.cycleHalfedges(faceHalfedges); result.addHalfedges(faceHalfedges); result.add(nf); } else if (keepBoundary) { he = v.getHalfedge(); while (!he.isOuterBoundary()) { he = he.getNextInVertex(); } HE_Halfedge start = he; final List<HE_Halfedge> faceHalfedges = new ArrayList<HE_Halfedge>(); final HE_Face nf = new HE_Face(); final WB_Point p = new WB_Point(); int n = 0; HE_Halfedge hen = new HE_Halfedge(); faceHalfedges.add(hen); result.setFace(hen, nf); Long key = faceVertexCorrelation.get(v.key()); result.setVertex(hen, result.getVertexWithKey(key)); p.addSelf(hen.getVertex()); n++; hen = new HE_Halfedge(); faceHalfedges.add(hen); result.setFace(hen, nf); key = faceVertexCorrelation.get(he.key()); result.setVertex(hen, result.getVertexWithKey(key)); p.addSelf(hen.getVertex()); n++; result.setHalfedge(hen.getVertex(), hen); result.setHalfedge(nf, hen); he = he.getNextInVertex(); do { hen = new HE_Halfedge(); faceHalfedges.add(hen); result.setFace(hen, nf); key = he.isOuterBoundary() ? faceVertexCorrelation.get(he.key()) : faceVertexCorrelation.get(he.getFace().key()); result.setVertex(hen, result.getVertexWithKey(key)); p.addSelf(hen.getVertex()); n++; he = he.getNextInVertex(); } while (he != start); he = he.getPrevInVertex(); hen = new HE_Halfedge(); faceHalfedges.add(hen); result.setFace(hen, nf); key = faceVertexCorrelation.get(he.getPair().key()); result.setVertex(hen, result.getVertexWithKey(key)); p.addSelf(hen.getVertex()); n++; p.divSelf(n); centers.add(p); result.cycleHalfedges(faceHalfedges); result.addHalfedges(faceHalfedges); result.add(nf); } } result.pairHalfedges(); result.capHalfedges(); if (setCenter) { result.moveToSelf(source.getCenter()); } HET_MeshOp.flipFaces(result); final List<HE_Face> faces = result.getFaces(); final int fs = faces.size(); for (int i = 0; i < fs; i++) { if (!faces.get(i).isPlanar() && fixNonPlanarFaces) { HEM_TriSplit.splitFaceTri(result, faces.get(i), centers.get(i)); } } return result; } }
{ "content_hash": "1a1ae9c9f353a50745d5ec6788a79910", "timestamp": "", "source": "github", "line_count": 249, "max_line_length": 80, "avg_line_length": 23.835341365461847, "alnum_prop": 0.6308340353833193, "repo_name": "DweebsUnited/CodeMonkey", "id": "9b128c6e30d07247f876cfe87d5e4c404f80df41", "size": "5935", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "java/CodeMonkey/HEMesh/wblut/hemesh/HEC_Dual.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "718" }, { "name": "C++", "bytes": "2748240" }, { "name": "CMake", "bytes": "11221" }, { "name": "CSS", "bytes": "896" }, { "name": "GLSL", "bytes": "1116" }, { "name": "HTML", "bytes": "887" }, { "name": "Java", "bytes": "132732" }, { "name": "Makefile", "bytes": "23824" }, { "name": "Meson", "bytes": "246" }, { "name": "Objective-C", "bytes": "810" }, { "name": "Processing", "bytes": "205574" }, { "name": "Python", "bytes": "65902" }, { "name": "Shell", "bytes": "6253" } ], "symlink_target": "" }
 CKEDITOR.dialog.add("textfield", function (c) { function e(a) { var a = a.element, b = this.getValue(); b ? a.setAttribute(this.id, b) : a.removeAttribute(this.id) } function f(a) { this.setValue(a.hasAttribute(this.id) && a.getAttribute(this.id) || "") } var g = {text:1, password:1}; return{title:c.lang.forms.textfield.title, minWidth:350, minHeight:150, onShow:function () { delete this.textField; var a = this.getParentEditor().getSelection().getSelectedElement(); if (a && "input" == a.getName() && (g[a.getAttribute("type")] || !a.getAttribute("type")))this.textField = a, this.setupContent(a) }, onOk:function () { var a = this.getParentEditor(), b = this.textField, c = !b; c && (b = a.document.createElement("input"), b.setAttribute("type", "text")); b = {element:b}; c && a.insertElement(b.element); this.commitContent(b); c || a.getSelection().selectElement(b.element) }, onLoad:function () { this.foreach(function (a) { if (a.getValue && (a.setup || (a.setup = f), !a.commit))a.commit = e }) }, contents:[ {id:"info", label:c.lang.forms.textfield.title, title:c.lang.forms.textfield.title, elements:[ {type:"hbox", widths:["50%", "50%"], children:[ {id:"_cke_saved_name", type:"text", label:c.lang.forms.textfield.name, "default":"", accessKey:"N", setup:function (a) { this.setValue(a.data("cke-saved-name") || a.getAttribute("name") || "") }, commit:function (a) { a = a.element; this.getValue() ? a.data("cke-saved-name", this.getValue()) : (a.data("cke-saved-name", !1), a.removeAttribute("name")) }}, {id:"value", type:"text", label:c.lang.forms.textfield.value, "default":"", accessKey:"V", commit:function (a) { if (CKEDITOR.env.ie && !this.getValue()) { var b = a.element, d = new CKEDITOR.dom.element("input", c.document); b.copyAttributes(d, {value:1}); d.replace(b); a.element = d } else e.call(this, a) }} ]}, {type:"hbox", widths:["50%", "50%"], children:[ {id:"size", type:"text", label:c.lang.forms.textfield.charWidth, "default":"", accessKey:"C", style:"width:50px", validate:CKEDITOR.dialog.validate.integer(c.lang.common.validateNumberFailed)}, {id:"maxLength", type:"text", label:c.lang.forms.textfield.maxChars, "default":"", accessKey:"M", style:"width:50px", validate:CKEDITOR.dialog.validate.integer(c.lang.common.validateNumberFailed)} ], onLoad:function () { CKEDITOR.env.ie7Compat && this.getElement().setStyle("zoom", "100%") }}, {id:"type", type:"select", label:c.lang.forms.textfield.type, "default":"text", accessKey:"M", items:[ [c.lang.forms.textfield.typeText, "text"], [c.lang.forms.textfield.typePass, "password"] ], setup:function (a) { this.setValue(a.getAttribute("type")) }, commit:function (a) { var b = a.element; if (CKEDITOR.env.ie) { var d = b.getAttribute("type"), e = this.getValue(); d != e && (d = CKEDITOR.dom.element.createFromHtml('<input type="' + e + '"></input>', c.document), b.copyAttributes(d, {type:1}), d.replace(b), a.element = d) } else b.setAttribute("type", this.getValue()) }} ]} ]} });
{ "content_hash": "58bc8fce4b7ac91b7d4a6c73ad27147b", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 204, "avg_line_length": 47.80281690140845, "alnum_prop": 0.5857395403653506, "repo_name": "Webkadabra/WkdYiiBootstrap", "id": "131f7a2883d94ebadd6fcff1c495007add3442f4", "size": "3543", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "assets/js/ckeditor/plugins/forms/dialogs/textfield.js", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "1768659" }, { "name": "JavaScript", "bytes": "2066169" }, { "name": "PHP", "bytes": "388389" } ], "symlink_target": "" }
import Anagram from './Anagram.js'; import Dictionary from './Dictionary.js'; import Hash from './Hash.js'; var _ = require('underscore'), Chance = require("chance"), chance = new Chance(); // Test cases for both Anagram and Dictionary, as they test each other describe('utils: Anagram', function() { var test_times = 500, anagram_ratio = 0.3, max_anagram_per_hash = 5, anagram = new Anagram(), dict = new Dictionary(test_times, test_times * anagram_ratio, max_anagram_per_hash); beforeEach(function() { anagram.clear(); }); // prepare the test data describe('constructor()', function() { it('new Anagram should have zero word', function() { expect(anagram.anagramNum()).toEqual(0); }); it('new Anagram should have zero anagram', function() { expect(anagram.anagramNum()).toEqual(0); }); }); describe('feed only common words, unique hashes', function() { it('the word count should equal to the fed words', function() { anagram.feedArray(dict.non_anagrams); expect(anagram.getAnagrams().length).toEqual(0); }); it('no anagram should be found', function() { anagram.feedArray(dict.non_anagrams); expect(anagram.wordNum()).toEqual(dict.non_anagrams.length); }); }); describe('feed only anagrams', function() { it('the anagram hashes should equal to the anagram groups created', function() { anagram.feedArray(dict.anagrams); expect(anagram.getAnagrams().length).toEqual(dict.anagram_groups.length); }); it('the total anagrams found should match the generated ones', function() { anagram.feedArray(dict.anagrams); expect(anagram.getAnagrammaticWords().length).toEqual(dict.anagrams.length); }); it('the total input words should equal to the anagram count', function() { anagram.feedArray(dict.anagrams); // the total input words should equal to the total anagram word number expect(anagram.wordNum()).toEqual(anagram.anagramNum()); }); }); describe('feed a mixture of common words and anagrams', function() { it('the anagram hashes should equal to the anagram groups created', function() { anagram.feedArray(dict.words); expect(anagram.getAnagrams().length).toEqual(dict.anagram_groups.length); }); it('the total anagrams found should match the generated ones', function() { anagram.feedArray(dict.words); expect(anagram.getAnagrammaticWords().length).toEqual(dict.anagrams.length); }); it('the total input words should match the word count', function() { anagram.feedArray(dict.words); expect(anagram.wordNum()).toEqual(dict.words.length); }); }); describe('the anagrams are really anagrams', function() { it('each word in the same anagram group should have the same hash', function() { anagram.feedArray(dict.words); var anagram_groups = anagram.getAnagrams(), hashes, diff; // each anagram group should have the same hash for (var anagrams of anagram_groups) { hashes = anagrams.map(Hash.sort); diff = _.difference([hashes[0]], hashes.slice(1, hashes.size)); expect(diff.length).toEqual(0); } }); it('all the anagram group have unique hash', function() { anagram.feedArray(dict.words); var anagram_groups = anagram.getAnagrams(); var hashes = anagram_groups.map(function(anagrams) { return Hash.sort(anagrams[0]); }).sort(); var diff = _.difference([hashes[0]], hashes.slice(1, hashes.size)); expect(diff.length).toEqual(1); }); }) });
{ "content_hash": "c3aa212c08b4df4d96e81af083e5a57c", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 95, "avg_line_length": 36.77272727272727, "alnum_prop": 0.5888751545117429, "repo_name": "madwyn/anagram.js", "id": "b37918dedb4c78aa57ac9e74638bb21435a5e102", "size": "4045", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/utils/Anagram.spec.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "7551" }, { "name": "JavaScript", "bytes": "54848" }, { "name": "NSIS", "bytes": "3768" } ], "symlink_target": "" }
import Ember from "ember"; var oldActionHelper; var newActionHelper; //HTMLBars version if (!Ember.HTMLBars) { //cache the old handler oldActionHelper = Ember.Handlebars.helpers.action; newActionHelper = Ember.Handlebars.helpers.action = function (/*actionName*/) { var options = arguments[arguments.length - 1]; var hash = options.hash; hash.on = hash.on || 'tap'; return oldActionHelper.apply(this, arguments); }; } export default newActionHelper; export { oldActionHelper, newActionHelper };
{ "content_hash": "35cc52e2ac940ede4397a9311d3d256a", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 81, "avg_line_length": 20.46153846153846, "alnum_prop": 0.7124060150375939, "repo_name": "mattmarcum/ember-mobiletouch", "id": "a78cde6e707ff72ef6779b7acf966cfc50968ecb", "size": "532", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "addon/overrides/action-helper.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "101" }, { "name": "HTML", "bytes": "1879" }, { "name": "Handlebars", "bytes": "3094" }, { "name": "JavaScript", "bytes": "86332" } ], "symlink_target": "" }
namespace Google.Cloud.Iot.V1.Snippets { // [START cloudiot_v1_generated_DeviceManager_ListDevices_sync_flattened] using Google.Api.Gax; using Google.Cloud.Iot.V1; using System; public sealed partial class GeneratedDeviceManagerClientSnippets { /// <summary>Snippet for ListDevices</summary> /// <remarks> /// This snippet has been automatically generated and should be regarded as a code template only. /// It will require modifications to work: /// - It may require correct/in-range values for request initialization. /// - It may require specifying regional endpoints when creating the service client as shown in /// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. /// </remarks> public void ListDevices() { // Create client DeviceManagerClient deviceManagerClient = DeviceManagerClient.Create(); // Initialize request argument(s) string parent = "projects/[PROJECT]/locations/[LOCATION]/registries/[REGISTRY]"; // Make the request PagedEnumerable<ListDevicesResponse, Device> response = deviceManagerClient.ListDevices(parent); // Iterate over all response items, lazily performing RPCs as required foreach (Device item in response) { // Do something with each item Console.WriteLine(item); } // Or iterate over pages (of server-defined size), performing one RPC per page foreach (ListDevicesResponse page in response.AsRawResponses()) { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (Device item in page) { // Do something with each item Console.WriteLine(item); } } // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; Page<Device> singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); foreach (Device item in singlePage) { // Do something with each item Console.WriteLine(item); } // Store the pageToken, for when the next page is required. string nextPageToken = singlePage.NextPageToken; } } // [END cloudiot_v1_generated_DeviceManager_ListDevices_sync_flattened] }
{ "content_hash": "76cd96e8ec3296a4c2ca44c64b2e9217", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 120, "avg_line_length": 44.83606557377049, "alnum_prop": 0.6062157221206581, "repo_name": "googleapis/google-cloud-dotnet", "id": "1a64093a1e93c0143de8597a5f7e85fb58a562ba", "size": "3357", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "apis/Google.Cloud.Iot.V1/Google.Cloud.Iot.V1.GeneratedSnippets/DeviceManagerClient.ListDevicesSnippet.g.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "767" }, { "name": "C#", "bytes": "319820004" }, { "name": "Dockerfile", "bytes": "3415" }, { "name": "PowerShell", "bytes": "3303" }, { "name": "Python", "bytes": "2744" }, { "name": "Shell", "bytes": "65881" } ], "symlink_target": "" }
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package cs480.quiz2; import java.io.FileNotFoundException; import java.io.IOException; /** * * @author raliclo */ public interface LineReader { public int readLines(String filename) throws FileNotFoundException,IOException; public int readFirstNLines(String filename, int n) throws FileNotFoundException,IOException; public int readLastNLines(String filename, int n) throws FileNotFoundException,IOException; public int readSpecificLines(String filename, int m, int n) throws FileNotFoundException,IOException; }
{ "content_hash": "ad835a649724d936bdef2f13b2323307", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 105, "avg_line_length": 31, "alnum_prop": 0.7896213183730715, "repo_name": "ralic/NPU-CS480", "id": "e013247af1cd87022956eeae7830fa521ba18dec", "size": "713", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "CS480-Quiz2-LineReader/src/cs480/quiz2/LineReader.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "176048" } ], "symlink_target": "" }
using UnityEngine; namespace MixedRealityToolkit.Common { /// <summary> /// A MonoBehaviour that interpolates a transform's position, rotation or scale. /// </summary> public class Interpolator : MonoBehaviour { [Tooltip("When interpolating, use unscaled time. This is useful for games that have a pause mechanism or otherwise adjust the game timescale.")] public bool UseUnscaledTime = true; // A very small number that is used in determining if the Interpolator // needs to run at all. private const float smallNumber = 0.0000001f; // The movement speed in meters per second public float PositionPerSecond = 30.0f; // The rotation speed, in degrees per second public float RotationDegreesPerSecond = 720.0f; // Adjusts rotation speed based on angular distance public float RotationSpeedScaler = 0.0f; // The amount to scale per second public float ScalePerSecond = 5.0f; // Lerp the estimated targets towards the object each update, // slowing and smoothing movement. [HideInInspector] public bool SmoothLerpToTarget = false; [HideInInspector] public float SmoothPositionLerpRatio = 0.5f; [HideInInspector] public float SmoothRotationLerpRatio = 0.5f; [HideInInspector] public float SmoothScaleLerpRatio = 0.5f; // Position data private Vector3 targetPosition; /// <summary> /// True if the transform's position is animating; false otherwise. /// </summary> public bool AnimatingPosition { get; private set; } // Rotation data private Quaternion targetRotation; /// <summary> /// True if the transform's rotation is animating; false otherwise. /// </summary> public bool AnimatingRotation { get; private set; } // Local Rotation data private Quaternion targetLocalRotation; /// <summary> /// True if the transform's local rotation is animating; false otherwise. /// </summary> public bool AnimatingLocalRotation { get; private set; } // Scale data private Vector3 targetLocalScale; /// <summary> /// True if the transform's scale is animating; false otherwise. /// </summary> public bool AnimatingLocalScale { get; private set; } /// <summary> /// The event fired when an Interpolation is started. /// </summary> public event System.Action InterpolationStarted; /// <summary> /// The event fired when an Interpolation is completed. /// </summary> public event System.Action InterpolationDone; /// <summary> /// The velocity of a transform whose position is being interpolated. /// </summary> public Vector3 PositionVelocity { get; private set; } private Vector3 oldPosition = Vector3.zero; /// <summary> /// True if position, rotation or scale are animating; false otherwise. /// </summary> public bool Running { get { return (AnimatingPosition || AnimatingRotation || AnimatingLocalRotation || AnimatingLocalScale); } } public void Awake() { targetPosition = transform.position; targetRotation = transform.rotation; targetLocalRotation = transform.localRotation; targetLocalScale = transform.localScale; enabled = false; } /// <summary> /// Sets the target position for the transform and if position wasn't /// already animating, fires the InterpolationStarted event. /// </summary> /// <param name="target">The new target position to for the transform.</param> public void SetTargetPosition(Vector3 target) { bool wasRunning = Running; targetPosition = target; float magsq = (targetPosition - transform.position).sqrMagnitude; if (magsq > smallNumber) { AnimatingPosition = true; enabled = true; if (InterpolationStarted != null && !wasRunning) { InterpolationStarted(); } } else { // Set immediately to prevent accumulation of error. transform.position = target; AnimatingPosition = false; } } /// <summary> /// Sets the target rotation for the transform and if rotation wasn't /// already animating, fires the InterpolationStarted event. /// </summary> /// <param name="target">The new target rotation for the transform.</param> public void SetTargetRotation(Quaternion target) { bool wasRunning = Running; targetRotation = target; if (Quaternion.Dot(transform.rotation, target) < 1.0f) { AnimatingRotation = true; enabled = true; if (InterpolationStarted != null && !wasRunning) { InterpolationStarted(); } } else { // Set immediately to prevent accumulation of error. transform.rotation = target; AnimatingRotation = false; } } /// <summary> /// Sets the target local rotation for the transform and if rotation /// wasn't already animating, fires the InterpolationStarted event. /// </summary> /// <param name="target">The new target local rotation for the transform.</param> public void SetTargetLocalRotation(Quaternion target) { bool wasRunning = Running; targetLocalRotation = target; if (Quaternion.Dot(transform.localRotation, target) < 1.0f) { AnimatingLocalRotation = true; enabled = true; if (InterpolationStarted != null && !wasRunning) { InterpolationStarted(); } } else { // Set immediately to prevent accumulation of error. transform.localRotation = target; AnimatingLocalRotation = false; } } /// <summary> /// Sets the target local scale for the transform and if scale /// wasn't already animating, fires the InterpolationStarted event. /// </summary> /// <param name="target">The new target local rotation for the transform.</param> public void SetTargetLocalScale(Vector3 target) { bool wasRunning = Running; targetLocalScale = target; float magsq = (targetLocalScale - transform.localScale).sqrMagnitude; if (magsq > Mathf.Epsilon) { AnimatingLocalScale = true; enabled = true; if (InterpolationStarted != null && !wasRunning) { InterpolationStarted(); } } else { // set immediately to prevent accumulation of error transform.localScale = target; AnimatingLocalScale = false; } } /// <summary> /// Interpolates smoothly to a target position. /// </summary> /// <param name="start">The starting position.</param> /// <param name="target">The destination position.</param> /// <param name="deltaTime">Caller-provided Time.deltaTime.</param> /// <param name="speed">The speed to apply to the interpolation.</param> /// <returns>New interpolated position closer to target</returns> public static Vector3 NonLinearInterpolateTo(Vector3 start, Vector3 target, float deltaTime, float speed) { // If no interpolation speed, jump to target value. if (speed <= 0.0f) { return target; } Vector3 distance = (target - start); // When close enough, jump to the target if (distance.sqrMagnitude <= Mathf.Epsilon) { return target; } // Apply the delta, then clamp so we don't overshoot the target Vector3 deltaMove = distance * Mathf.Clamp(deltaTime * speed, 0.0f, 1.0f); return start + deltaMove; } public void Update() { float deltaTime = UseUnscaledTime ? Time.unscaledDeltaTime : Time.deltaTime; bool interpOccuredThisFrame = false; if (AnimatingPosition) { Vector3 lerpTargetPosition = targetPosition; if (SmoothLerpToTarget) { lerpTargetPosition = Vector3.Lerp(transform.position, lerpTargetPosition, SmoothPositionLerpRatio); } Vector3 newPosition = NonLinearInterpolateTo(transform.position, lerpTargetPosition, deltaTime, PositionPerSecond); if ((targetPosition - newPosition).sqrMagnitude <= smallNumber) { // Snap to final position newPosition = targetPosition; AnimatingPosition = false; } else { interpOccuredThisFrame = true; } transform.position = newPosition; //calculate interpolatedVelocity and store position for next frame PositionVelocity = oldPosition - newPosition; oldPosition = newPosition; } // Determine how far we need to rotate if (AnimatingRotation) { Quaternion lerpTargetRotation = targetRotation; if (SmoothLerpToTarget) { lerpTargetRotation = Quaternion.Lerp(transform.rotation, lerpTargetRotation, SmoothRotationLerpRatio); } float angleDiff = Quaternion.Angle(transform.rotation, lerpTargetRotation); float speedScale = 1.0f + (Mathf.Pow(angleDiff, RotationSpeedScaler) / 180.0f); float ratio = Mathf.Clamp01((speedScale * RotationDegreesPerSecond * deltaTime) / angleDiff); if (angleDiff < Mathf.Epsilon) { AnimatingRotation = false; transform.rotation = targetRotation; } else { // Only lerp rotation here, as ratio is NaN if angleDiff is 0.0f transform.rotation = Quaternion.Slerp(transform.rotation, lerpTargetRotation, ratio); interpOccuredThisFrame = true; } } // Determine how far we need to rotate if (AnimatingLocalRotation) { Quaternion lerpTargetLocalRotation = targetLocalRotation; if (SmoothLerpToTarget) { lerpTargetLocalRotation = Quaternion.Lerp(transform.localRotation, lerpTargetLocalRotation, SmoothRotationLerpRatio); } float angleDiff = Quaternion.Angle(transform.localRotation, lerpTargetLocalRotation); float speedScale = 1.0f + (Mathf.Pow(angleDiff, RotationSpeedScaler) / 180.0f); float ratio = Mathf.Clamp01((speedScale * RotationDegreesPerSecond * deltaTime) / angleDiff); if (angleDiff < Mathf.Epsilon) { AnimatingLocalRotation = false; transform.localRotation = targetLocalRotation; } else { // Only lerp rotation here, as ratio is NaN if angleDiff is 0.0f transform.localRotation = Quaternion.Slerp(transform.localRotation, lerpTargetLocalRotation, ratio); interpOccuredThisFrame = true; } } if (AnimatingLocalScale) { Vector3 lerpTargetLocalScale = targetLocalScale; if (SmoothLerpToTarget) { lerpTargetLocalScale = Vector3.Lerp(transform.localScale, lerpTargetLocalScale, SmoothScaleLerpRatio); } Vector3 newScale = NonLinearInterpolateTo(transform.localScale, lerpTargetLocalScale, deltaTime, ScalePerSecond); if ((targetLocalScale - newScale).sqrMagnitude <= smallNumber) { // Snap to final scale newScale = targetLocalScale; AnimatingLocalScale = false; } else { interpOccuredThisFrame = true; } transform.localScale = newScale; } // If all interpolations have completed, stop updating if (!interpOccuredThisFrame) { if (InterpolationDone != null) { InterpolationDone(); } enabled = false; } } /// <summary> /// Snaps to the final target and stops interpolating /// </summary> public void SnapToTarget() { if (enabled) { transform.position = TargetPosition; transform.rotation = TargetRotation; transform.localRotation = TargetLocalRotation; transform.localScale = TargetLocalScale; AnimatingPosition = false; AnimatingLocalScale = false; AnimatingRotation = false; AnimatingLocalRotation = false; enabled = false; if (InterpolationDone != null) { InterpolationDone(); } } } /// <summary> /// Stops the interpolation regardless if it has reached the target /// </summary> public void StopInterpolating() { if (enabled) { Reset(); if (InterpolationDone != null) { InterpolationDone(); } } } /// <summary> /// Stops the transform in place and terminates any animations. /// </summary> public void Reset() { targetPosition = transform.position; targetRotation = transform.rotation; targetLocalRotation = transform.localRotation; targetLocalScale = transform.localScale; AnimatingPosition = false; AnimatingRotation = false; AnimatingLocalRotation = false; AnimatingLocalScale = false; enabled = false; } /// <summary> /// If animating position, specifies the target position as specified /// by SetTargetPosition. Otherwise returns the current position of /// the transform. /// </summary> public Vector3 TargetPosition { get { if (AnimatingPosition) { return targetPosition; } return transform.position; } } /// <summary> /// If animating rotation, specifies the target rotation as specified /// by SetTargetRotation. Otherwise returns the current rotation of /// the transform. /// </summary> public Quaternion TargetRotation { get { if (AnimatingRotation) { return targetRotation; } return transform.rotation; } } /// <summary> /// If animating local rotation, specifies the target local rotation as /// specified by SetTargetLocalRotation. Otherwise returns the current /// local rotation of the transform. /// </summary> public Quaternion TargetLocalRotation { get { if (AnimatingLocalRotation) { return targetLocalRotation; } return transform.localRotation; } } /// <summary> /// If animating local scale, specifies the target local scale as /// specified by SetTargetLocalScale. Otherwise returns the current /// local scale of the transform. /// </summary> public Vector3 TargetLocalScale { get { if (AnimatingLocalScale) { return targetLocalScale; } return transform.localScale; } } } }
{ "content_hash": "5be218cc0dfd5346f38c8af45331a5e2", "timestamp": "", "source": "github", "line_count": 507, "max_line_length": 152, "avg_line_length": 34.2741617357002, "alnum_prop": 0.5347298152730621, "repo_name": "davidezordan/MixedRealitySamples", "id": "edfe979b139a3d190cb97b1a70bc8132e64d50cd", "size": "17531", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Two-hands manipulation/Assets/MixedRealityToolkit/Common/Scripts/Interpolator.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "17515940" }, { "name": "GLSL", "bytes": "37630" }, { "name": "HLSL", "bytes": "102589" }, { "name": "JavaScript", "bytes": "43789" }, { "name": "Mathematica", "bytes": "46437" }, { "name": "ShaderLab", "bytes": "586118" }, { "name": "Smalltalk", "bytes": "6" } ], "symlink_target": "" }
package net.will_co21.application.googleAPIImageSearch; public interface ISwingLogPrinter { public void print(String str); }
{ "content_hash": "f4c97d4cc91e6459643cc66ec9705d22", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 55, "avg_line_length": 26.4, "alnum_prop": 0.7878787878787878, "repo_name": "j6k1/googleAPIImageSearch", "id": "7ea8895a912329179717a8a06c700d7ea21d8873", "size": "132", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/net/will_co21/application/googleAPIImageSearch/ISwingLogPrinter.java", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "22688" }, { "name": "Java", "bytes": "443153" }, { "name": "JavaScript", "bytes": "2948" } ], "symlink_target": "" }
import unittest from mock import Mock from wack.tree import Tree from wack.http.errors import HttpNotFound import util class TreeTester(unittest.TestCase): def setUp(self): super(TreeTester, self).setUp() self.tree = Tree() def tearDown(self): super(TreeTester, self).tearDown() self.tree = None def test_dispatch(self): environ = util.test_environ(path_info='/foo/bar/') self.tree.mount('^/foo', Mock()) self.tree(environ, Mock()) self.assertEqual(environ['PATH_INFO'], '/bar/') self.assertEqual(environ['SCRIPT_NAME'], '/foo/') def test_dispatch_no_slash(self): environ = util.test_environ(path_info='/foo/bar') self.tree.mount('^/foo', Mock()) self.tree(environ, Mock()) self.assertEqual(environ['PATH_INFO'], '/bar') self.assertEqual(environ['SCRIPT_NAME'], '/foo/') def test_double_match(self): environ = util.test_environ(path_info='/foo/foo/') self.tree.mount('^/foo', Mock()) self.tree(environ, Mock()) self.assertEqual(environ['PATH_INFO'], '/foo/') self.assertEqual(environ['SCRIPT_NAME'], '/foo/') def test_regex(self): environ = util.test_environ('/foo/bar/baz/') self.tree.mount('^/foo/[^/]+', Mock()) self.tree(environ, Mock()) self.assertEqual(environ['PATH_INFO'], '/baz/') self.assertEqual(environ['SCRIPT_NAME'], '/foo/bar/') def test_bad_regex(self): self.assertRaises(ValueError, self.tree.mount, '/foo', None) self.assertRaises(ValueError, self.tree.mount, '^/foo$', None) self.assertRaises(ValueError, self.tree.mount, '^/foo/', None) def test_not_found(self): environ = util.test_environ() start_response = Mock() self.assertRaises(HttpNotFound, self.tree, environ, start_response) # ------------------------------------------------------------------------------ if __name__ == '__main__': unittest.main()
{ "content_hash": "91f4bac08f98d252d82edb14a8770ef0", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 80, "avg_line_length": 32.58064516129032, "alnum_prop": 0.5836633663366336, "repo_name": "jlconnor/wsgistack", "id": "c803a353dc38eee91628d713fd8e9d5431733c2d", "size": "2078", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/test_tree.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "40012" } ], "symlink_target": "" }
package com.taskadapter.redmineapi; import com.taskadapter.redmineapi.bean.Changeset; import com.taskadapter.redmineapi.bean.CustomFieldDefinition; import com.taskadapter.redmineapi.bean.CustomFieldFactory; import com.taskadapter.redmineapi.bean.Issue; import com.taskadapter.redmineapi.bean.IssueCategory; import com.taskadapter.redmineapi.bean.IssueCategoryFactory; import com.taskadapter.redmineapi.bean.IssueFactory; import com.taskadapter.redmineapi.bean.IssueRelation; import com.taskadapter.redmineapi.bean.IssueStatus; import com.taskadapter.redmineapi.bean.Journal; import com.taskadapter.redmineapi.bean.JournalDetail; import com.taskadapter.redmineapi.bean.Project; import com.taskadapter.redmineapi.bean.SavedQuery; import com.taskadapter.redmineapi.bean.Tracker; import com.taskadapter.redmineapi.bean.User; import com.taskadapter.redmineapi.bean.Version; import com.taskadapter.redmineapi.bean.VersionFactory; import com.taskadapter.redmineapi.bean.Watcher; import com.taskadapter.redmineapi.bean.WatcherFactory; import com.taskadapter.redmineapi.internal.ResultsWrapper; import org.apache.http.client.HttpClient; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; import java.util.ArrayList; import java.util.Calendar; import java.util.Collection; import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Random; import java.util.Set; import java.util.UUID; import static com.taskadapter.redmineapi.CustomFieldResolver.getCustomFieldByName; import static com.taskadapter.redmineapi.IssueHelper.createIssue; import static com.taskadapter.redmineapi.IssueHelper.createIssues; import com.taskadapter.redmineapi.bean.CustomField; import com.taskadapter.redmineapi.bean.Group; import com.taskadapter.redmineapi.bean.GroupFactory; import com.taskadapter.redmineapi.bean.Role; import com.taskadapter.redmineapi.bean.RoleFactory; import java.util.Arrays; import java.util.Collections; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; public class IssueManagerIT { private static IssueManager issueManager; private static ProjectManager projectManager; private static MembershipManager membershipManager; private static Project project; private static int projectId; private static String projectKey; private static Project project2; private static String projectKey2; private static RedmineManager mgr; private static UserManager userManager; private static Group demoGroup; @BeforeClass public static void oneTimeSetup() throws RedmineException { mgr = IntegrationTestHelper.createRedmineManager(); userManager = mgr.getUserManager(); issueManager = mgr.getIssueManager(); projectManager = mgr.getProjectManager(); membershipManager = mgr.getMembershipManager(); project = IntegrationTestHelper.createProject(mgr); projectId = project.getId(); projectKey = project.getIdentifier(); project2 = IntegrationTestHelper.createProject(mgr); projectKey2 = project2.getIdentifier(); Group g = GroupFactory.create(); g.setName("Group" + System.currentTimeMillis()); demoGroup = userManager.createGroup(g); // Add membership of group for the demo projects Collection<Role> allRoles = Arrays.asList(new Role[] { RoleFactory.create(3), // Manager RoleFactory.create(4), // Developer RoleFactory.create(5) // Reporter }); membershipManager.createMembershipForGroup(project.getId(), demoGroup.getId(), allRoles); membershipManager.createMembershipForGroup(project2.getId(), demoGroup.getId(), allRoles); } @AfterClass public static void oneTimeTearDown() throws RedmineException { IntegrationTestHelper.deleteProject(mgr, project.getIdentifier()); IntegrationTestHelper.deleteProject(mgr, project2.getIdentifier()); userManager.deleteGroup(demoGroup); } @Test public void issueCreated() throws RedmineException { Issue issueToCreate = IssueFactory.create(projectId, "test zzx"); Calendar startCal = Calendar.getInstance(); // have to clear them because they are ignored by Redmine and // prevent from comparison later startCal.clear(Calendar.HOUR_OF_DAY); startCal.clear(Calendar.MINUTE); startCal.clear(Calendar.SECOND); startCal.clear(Calendar.MILLISECOND); startCal.add(Calendar.DATE, 5); issueToCreate.setStartDate(startCal.getTime()); Calendar due = Calendar.getInstance(); due.add(Calendar.MONTH, 1); issueToCreate.setDueDate(due.getTime()); User ourUser = IntegrationTestHelper.getOurUser(); issueToCreate.setAssigneeId(ourUser.getId()); String description = "This is the description for the new task." + "\nIt has several lines." + "\nThis is the last line."; issueToCreate.setDescription(description); float estimatedHours = 44; issueToCreate.setEstimatedHours(estimatedHours); Issue newIssue = issueManager.createIssue(issueToCreate); assertNotNull("Checking returned result", newIssue); assertNotNull("New issue must have some ID", newIssue.getId()); // check startDate Calendar returnedStartCal = Calendar.getInstance(); returnedStartCal.setTime(newIssue.getStartDate()); assertEquals(startCal.get(Calendar.YEAR), returnedStartCal.get(Calendar.YEAR)); assertEquals(startCal.get(Calendar.MONTH), returnedStartCal.get(Calendar.MONTH)); assertEquals(startCal.get(Calendar.DAY_OF_MONTH), returnedStartCal.get(Calendar.DAY_OF_MONTH)); // check dueDate Calendar returnedDueCal = Calendar.getInstance(); returnedDueCal.setTime(newIssue.getDueDate()); assertEquals(due.get(Calendar.YEAR), returnedDueCal.get(Calendar.YEAR)); assertEquals(due.get(Calendar.MONTH), returnedDueCal.get(Calendar.MONTH)); assertEquals(due.get(Calendar.DAY_OF_MONTH), returnedDueCal.get(Calendar.DAY_OF_MONTH)); // check ASSIGNEE assertThat(ourUser.getId()).isEqualTo(newIssue.getAssigneeId()); // check AUTHOR Integer EXPECTED_AUTHOR_ID = IntegrationTestHelper.getOurUser().getId(); assertEquals(EXPECTED_AUTHOR_ID, newIssue.getAuthorId()); // check ESTIMATED TIME assertEquals((Float) estimatedHours, newIssue.getEstimatedHours()); // check multi-line DESCRIPTION String regexpStripExtra = "\\r|\\n|\\s"; description = description.replaceAll(regexpStripExtra, ""); String actualDescription = newIssue.getDescription(); actualDescription = actualDescription.replaceAll(regexpStripExtra, ""); assertEquals(description, actualDescription); // PRIORITY assertNotNull(newIssue.getPriorityId()); assertTrue(newIssue.getPriorityId() > 0); } @Test public void issueWithParentCreated() throws RedmineException { Issue parentIssue = IssueFactory.create(projectId, "parent 1"); Issue newParentIssue = issueManager.createIssue(parentIssue); assertNotNull("Checking parent was created", newParentIssue); assertNotNull("Checking ID of parent issue is not null", newParentIssue.getId()); // Integer parentId = 46; Integer parentId = newParentIssue.getId(); Issue childIssue = IssueFactory.create(projectId, "child 1"); childIssue.setParentId(parentId); Issue newChildIssue = issueManager.createIssue(childIssue); assertEquals("Checking parent ID of the child issue", parentId, newChildIssue.getParentId()); } /** * Regression test for https://github.com/taskadapter/redmine-java-api/issues/117 */ @Test public void parentIdCanBeErased() throws RedmineException { Issue parentIssue = IssueFactory.create(projectId, "parent task"); Issue newParentIssue = issueManager.createIssue(parentIssue); Integer parentId = newParentIssue.getId(); Issue childIssue = IssueFactory.create(projectId, "child task"); childIssue.setParentId(parentId); Issue newChildIssue = issueManager.createIssue(childIssue); assertThat(newChildIssue.getParentId()).isEqualTo(parentId); newChildIssue.setParentId(null); issueManager.update(newChildIssue); final Issue reloadedIssue = issueManager.getIssueById(newChildIssue.getId()); assertThat(reloadedIssue.getParentId()).isNull(); } @Test public void testUpdateIssue() throws RedmineException { String originalSubject = "Issue " + new Date(); Issue issue = IssueFactory.create(projectId, originalSubject); Issue newIssue = issueManager.createIssue(issue); String changedSubject = "changed subject"; newIssue.setSubject(changedSubject); issueManager.update(newIssue); Issue reloadedFromRedmineIssue = issueManager.getIssueById(newIssue.getId()); assertEquals("Checking if 'update issue' operation changed 'subject' field", changedSubject, reloadedFromRedmineIssue.getSubject()); } /** * Tests the retrieval of an {@link Issue} by its ID. * * @throws com.taskadapter.redmineapi.RedmineException * thrown in case something went wrong in Redmine * @throws RedmineAuthenticationException thrown in case something went wrong while trying to login * @throws com.taskadapter.redmineapi.NotFoundException * thrown in case the objects requested for could not be found */ @Test public void testGetIssueById() throws RedmineException { String originalSubject = "Issue " + new Date(); Issue issue = IssueFactory.create(projectId, originalSubject); Issue newIssue = issueManager.createIssue(issue); Issue reloadedFromRedmineIssue = issueManager.getIssueById(newIssue.getId()); assertEquals( "Checking if 'get issue by ID' operation returned issue with same 'subject' field", originalSubject, reloadedFromRedmineIssue.getSubject()); Tracker tracker = reloadedFromRedmineIssue.getTracker(); assertNotNull("Tracker of issue should not be null", tracker); assertNotNull("ID of tracker of issue should not be null", tracker.getId()); assertNotNull("Name of tracker of issue should not be null", tracker.getName()); } @Test public void testGetIssues() throws RedmineException { // create at least 1 issue Issue issueToCreate = IssueFactory.create(projectId, "testGetIssues: " + new Date()); Issue newIssue = issueManager.createIssue(issueToCreate); List<Issue> issues = issueManager.getIssues(projectKey, null); assertTrue(issues.size() > 0); boolean found = false; for (Issue issue : issues) { if (issue.getId().equals(newIssue.getId())) { found = true; break; } } if (!found) { fail("getIssues() didn't return the issue we just created. The query " + " must have returned all issues created during the last 2 days"); } } @Test(expected = NotFoundException.class) public void testGetIssuesInvalidQueryId() throws RedmineException { Integer invalidQueryId = 9999999; issueManager.getIssues(projectKey, invalidQueryId); } @Test public void testCreateIssueNonUnicodeSymbols() throws RedmineException { String nonLatinSymbols = "Example with accents A��o"; Issue toCreate = IssueFactory.create(projectId, nonLatinSymbols); Issue created = issueManager.createIssue(toCreate); assertEquals(nonLatinSymbols, created.getSubject()); } @Test public void testCreateIssueSummaryOnly() throws RedmineException { Issue issueToCreate = IssueFactory.create(projectId, "This is the summary line 123"); Issue newIssue = issueManager.createIssue(issueToCreate); assertNotNull("Checking returned result", newIssue); assertNotNull("New issue must have some ID", newIssue.getId()); // check AUTHOR Integer EXPECTED_AUTHOR_ID = IntegrationTestHelper.getOurUser().getId(); assertEquals(EXPECTED_AUTHOR_ID, newIssue.getAuthorId()); } @Test public void privateFlagIsRespectedWhenCreatingIssues() throws RedmineException { Issue privateIssueToCreate = IssueFactory.create(projectId, "private issue"); privateIssueToCreate.setPrivateIssue(true); Issue newIssue = issueManager.createIssue(privateIssueToCreate); assertThat(newIssue.isPrivateIssue()).isTrue(); Issue publicIssueToCreate = IssueFactory.create(projectId, "public issue"); publicIssueToCreate.setPrivateIssue(false); Issue newPublicIssue = issueManager.createIssue(publicIssueToCreate); assertThat(newPublicIssue.isPrivateIssue()).isFalse(); // default value for "is private" should be false Issue newDefaultIssue = issueManager.createIssue(IssueFactory.create(projectId, "default public issue")); assertThat(newDefaultIssue.isPrivateIssue()).isFalse(); } /* this test fails with Redmine 3.0.0-3.0.3 because Redmine 3.0.x started * returning "not authorized" instead of "not found" for projects with unknown Ids. * This worked differently with Redmine 2.6.x. * <p> * This test is not critical for the release of Redmine Java API library. I am marking it as "ignored" for now. */ @Ignore @Test(expected = NotFoundException.class) public void creatingIssueWithNonExistingProjectIdGivesNotFoundException() throws RedmineException { int nonExistingProjectId = 99999999; // hopefully this does not exist :) Issue issueToCreate = IssueFactory.create(nonExistingProjectId, "Summary line 100"); issueManager.createIssue(issueToCreate); } @Test(expected = NotFoundException.class) public void retrievingIssueWithNonExistingIdGivesNotFoundException() throws RedmineException { int someNonExistingID = 999999; issueManager.getIssueById(someNonExistingID); } @Test(expected = NotFoundException.class) public void updatingIssueWithNonExistingIdGivesNotFoundException() throws RedmineException { int nonExistingId = 999999; Issue issue = IssueFactory.create(nonExistingId); issueManager.update(issue); } @Test public void testGetIssuesPaging() throws RedmineException { // create 27 issues. default page size is 25. createIssues(issueManager, projectId, 27); List<Issue> issues = issueManager.getIssues(projectKey, null); assertThat(issues.size()).isGreaterThan(26); // check that there are no duplicates in the list. Set<Issue> issueSet = new HashSet<>(issues); assertThat(issueSet.size()).isEqualTo(issues.size()); } @Test public void canControlLimitAndOffsetDirectly() throws RedmineException { // create 27 issues. default Redmine page size is usually 25 (unless changed in the server settings). createIssues(issueManager, projectId, 27); Map<String, String> params = new HashMap<>(); params.put("limit", "3"); params.put("offset", "0"); params.put("project_id", projectId + ""); List<Issue> issues = issueManager.getIssues(params).getResults(); // only the requested number of issues is loaded, not all result pages. assertThat(issues.size()).isEqualTo(3); } @Test(expected = NotFoundException.class) public void testDeleteIssue() throws RedmineException { Issue issue = createIssues(issueManager, projectId, 1).get(0); Issue retrievedIssue = issueManager.getIssueById(issue.getId()); assertEquals(issue, retrievedIssue); issueManager.deleteIssue(issue.getId()); issueManager.getIssueById(issue.getId()); } @Test public void testUpdateIssueSpecialXMLtags() throws Exception { Issue issue = createIssues(issueManager, projectId, 1).get(0); String newSubject = "\"text in quotes\" and <xml> tags"; String newDescription = "<taghere>\"abc\"</here>"; issue.setSubject(newSubject); issue.setDescription(newDescription); issueManager.update(issue); Issue updatedIssue = issueManager.getIssueById(issue.getId()); assertEquals(newSubject, updatedIssue.getSubject()); assertEquals(newDescription, updatedIssue.getDescription()); } @Test public void testCreateRelation() throws RedmineException { List<Issue> issues = createIssues(issueManager, projectId, 2); Issue src = issues.get(0); Issue target = issues.get(1); String relationText = IssueRelation.TYPE.precedes.toString(); IssueRelation r = issueManager.createRelation(src.getId(), target.getId(), relationText); assertEquals(src.getId(), r.getIssueId()); assertEquals(target.getId(), r.getIssueToId()); assertEquals(relationText, r.getType()); } private IssueRelation createTwoRelatedIssues() throws RedmineException { List<Issue> issues = createIssues(issueManager, projectId, 2); Issue src = issues.get(0); Issue target = issues.get(1); String relationText = IssueRelation.TYPE.precedes.toString(); return issueManager.createRelation(src.getId(), target.getId(), relationText); } @Test public void issueRelationsAreCreatedAndLoadedOK() throws RedmineException { IssueRelation relation = createTwoRelatedIssues(); Issue issue = issueManager.getIssueById(relation.getIssueId(), Include.relations); Issue issueTarget = issueManager.getIssueById(relation.getIssueToId(), Include.relations); assertThat(issue.getRelations().size()).isEqualTo(1); assertThat(issueTarget.getRelations().size()).isEqualTo(1); IssueRelation relation1 = issue.getRelations().iterator().next(); assertThat(relation1.getIssueId()).isEqualTo(issue.getId()); assertThat(relation1.getIssueToId()).isEqualTo(issueTarget.getId()); assertThat(relation1.getType()).isEqualTo("precedes"); assertThat(relation1.getDelay()).isEqualTo((Integer) 0); IssueRelation reverseRelation = issueTarget.getRelations().iterator().next(); // both forward and reverse relations are the same! assertThat(reverseRelation).isEqualTo(relation1); } @Test public void issueRelationIsDeleted() throws RedmineException { IssueRelation relation = createTwoRelatedIssues(); issueManager.deleteRelation(relation.getId()); Issue issue = issueManager.getIssueById(relation.getIssueId(), Include.relations); assertThat(issue.getRelations()).isEmpty(); } @Test public void testIssueRelationsDelete() throws RedmineException { List<Issue> issues = createIssues(issueManager, projectId, 3); Issue src = issues.get(0); Issue target = issues.get(1); String relationText = IssueRelation.TYPE.precedes.toString(); issueManager.createRelation(src.getId(), target.getId(), relationText); target = issues.get(2); issueManager.createRelation(src.getId(), target.getId(), relationText); src = issueManager.getIssueById(src.getId(), Include.relations); issueManager.deleteIssueRelations(src); Issue issue = issueManager.getIssueById(src.getId(), Include.relations); assertTrue(issue.getRelations().isEmpty()); } /** * Requires Redmine 2.3 */ @Test public void testAddIssueWatcher() throws RedmineException { final Issue issue = createIssues(issueManager, projectId, 1).get(0); final Issue retrievedIssue = issueManager.getIssueById(issue.getId()); assertEquals(issue, retrievedIssue); final User newUser = userManager.createUser(UserGenerator.generateRandomUser()); try { Watcher watcher = WatcherFactory.create(newUser.getId()); issueManager.addWatcherToIssue(watcher, issue); } finally { userManager.deleteUser(newUser.getId()); } issueManager.getIssueById(issue.getId()); } /** * Requires Redmine 2.3 */ @Test public void testDeleteIssueWatcher() throws RedmineException { final Issue issue = createIssues(issueManager, projectId, 1).get(0); final Issue retrievedIssue = issueManager.getIssueById(issue.getId()); assertEquals(issue, retrievedIssue); final User newUser = userManager.createUser(UserGenerator.generateRandomUser()); try { Watcher watcher = WatcherFactory.create(newUser.getId()); issueManager.addWatcherToIssue(watcher, issue); issueManager.deleteWatcherFromIssue(watcher, issue); } finally { userManager.deleteUser(newUser.getId()); } issueManager.deleteIssue(issue.getId()); } /** * Requires Redmine 2.3 */ @Test public void testGetIssueWatcher() throws RedmineException { final Issue issue = createIssues(issueManager, projectId, 1).get(0); final Issue retrievedIssue = issueManager.getIssueById(issue.getId()); assertEquals(issue, retrievedIssue); final User newUser = userManager.createUser(UserGenerator.generateRandomUser()); try { Watcher watcher = WatcherFactory.create(newUser.getId()); issueManager.addWatcherToIssue(watcher, issue); final Issue includeWatcherIssue = issueManager.getIssueById(issue.getId(), Include.watchers); if (!includeWatcherIssue.getWatchers().isEmpty()) { Watcher watcher1 = includeWatcherIssue.getWatchers().iterator().next(); assertThat(watcher1.getId()).isEqualTo(newUser.getId()); } } finally { userManager.deleteUser(newUser.getId()); } issueManager.getIssueById(issue.getId()); } @Test public void testAddIssueWithWatchers() throws RedmineException { final Issue issue = IssueHelper.generateRandomIssue(projectId); final User newUserWatcher = userManager.createUser(UserGenerator.generateRandomUser()); try { List<Watcher> watchers = new ArrayList<>(); Watcher watcher = WatcherFactory.create(newUserWatcher.getId()); watchers.add(watcher); issue.addWatchers(watchers); final Issue retrievedIssue = issueManager.createIssue(issue); final Issue retrievedIssueWithWatchers = issueManager.getIssueById(retrievedIssue.getId(), Include.watchers); assertNotNull(retrievedIssueWithWatchers); assertNotNull(retrievedIssueWithWatchers.getWatchers()); assertEquals(watchers.size(), retrievedIssueWithWatchers.getWatchers().size()); assertEquals(watcher.getId(), retrievedIssueWithWatchers.getWatchers().iterator().next().getId()); } finally { userManager.deleteUser(newUserWatcher.getId()); } } @Test public void testGetIssuesBySummary() throws RedmineException { String summary = "issue with subject ABC"; Issue issue = IssueFactory.create(projectId, summary); User ourUser = IntegrationTestHelper.getOurUser(); issue.setAssigneeId(ourUser.getId()); Issue newIssue = issueManager.createIssue(issue); assertNotNull("Checking returned result", newIssue); assertNotNull("New issue must have some ID", newIssue.getId()); List<Issue> foundIssues = issueManager.getIssuesBySummary(projectKey, summary); assertNotNull("Checking if search results is not NULL", foundIssues); assertTrue("Search results must be not empty", !(foundIssues.isEmpty())); Issue loadedIssue1 = RedmineTestUtils.findIssueInList(foundIssues, newIssue.getId()); assertNotNull(loadedIssue1); assertEquals(summary, loadedIssue1.getSubject()); } @Test public void findByNonExistingSummaryReturnsEmptyList() throws RedmineException { String summary = "some summary here for issue which does not exist"; List<Issue> foundIssues = issueManager.getIssuesBySummary(projectKey, summary); assertNotNull("Search result must be not null", foundIssues); assertTrue("Search result list must be empty", foundIssues.isEmpty()); } @Test(expected = RedmineAuthenticationException.class) public void noAPIKeyOnCreateIssueThrowsAE() throws Exception { TestConfig testConfig = new TestConfig(); final HttpClient httpClient = IntegrationTestHelper.getHttpClientForTestServer(); RedmineManager redmineMgrEmpty = RedmineManagerFactory.createUnauthenticated(testConfig.getURI(), httpClient); Issue issue = IssueFactory.create(projectId, "test zzx"); redmineMgrEmpty.getIssueManager().createIssue(issue); } @Test(expected = RedmineAuthenticationException.class) public void wrongAPIKeyOnCreateIssueThrowsAE() throws Exception { TestConfig testConfig = new TestConfig(); final HttpClient httpClient = IntegrationTestHelper.getHttpClientForTestServer(); RedmineManager redmineMgrInvalidKey = RedmineManagerFactory.createWithApiKey( testConfig.getURI(), "wrong_key", httpClient); Issue issue = IssueFactory.create(projectId, "test zzx"); redmineMgrInvalidKey.getIssueManager().createIssue(issue); } @Test public void testIssueDoneRatio() throws RedmineException { Issue issue = IssueFactory.create(projectId, "Issue " + new Date()); Issue createdIssue = issueManager.createIssue(issue); assertEquals("Initial 'done ratio' must be 0", (Integer) 0, createdIssue.getDoneRatio()); Integer doneRatio = 50; createdIssue.setDoneRatio(doneRatio); issueManager.update(createdIssue); Integer issueId = createdIssue.getId(); Issue reloadedFromRedmineIssue = issueManager.getIssueById(issueId); assertEquals( "Checking if 'update issue' operation changed 'done ratio' field", doneRatio, reloadedFromRedmineIssue.getDoneRatio()); Integer invalidDoneRatio = 130; reloadedFromRedmineIssue.setDoneRatio(invalidDoneRatio); try { issueManager.update(reloadedFromRedmineIssue); } catch (RedmineProcessingException e) { assertEquals("Must be 1 error", 1, e.getErrors().size()); assertEquals("Checking error text", "% Done is not included in the list", e.getErrors() .get(0)); } Issue reloadedFromRedmineIssueUnchanged = issueManager.getIssueById(issueId); assertEquals( "'done ratio' must have remained unchanged after invalid value", doneRatio, reloadedFromRedmineIssueUnchanged.getDoneRatio()); } @Test public void nullDescriptionErasesItOnServer() throws RedmineException { Issue issue = new Issue(); String subject = "Issue " + new Date(); String descr = "Some description"; issue.setSubject(subject); issue.setDescription(descr); issue.setProjectId(projectId); Issue createdIssue = issueManager.createIssue(issue); assertThat(createdIssue.getDescription()).isEqualTo(descr); createdIssue.setDescription(null); issueManager.update(createdIssue); Integer issueId = createdIssue.getId(); Issue reloadedFromRedmineIssue = issueManager.getIssueById(issueId); assertThat(reloadedFromRedmineIssue.getDescription()).isNull(); } @Test public void testIssueJournals() throws RedmineException { // create at least 1 issue Issue issueToCreate = new Issue(); issueToCreate.setSubject("testGetIssues: " + new Date()); issueToCreate.setProjectId(projectId); Issue newIssue = issueManager.createIssue(issueToCreate); Issue loadedIssueWithJournals = issueManager.getIssueById(newIssue.getId(), Include.journals); assertTrue(loadedIssueWithJournals.getJournals().isEmpty()); String commentDescribingTheUpdate = "some comment describing the issue update"; loadedIssueWithJournals.setSubject("new subject"); loadedIssueWithJournals.setNotes(commentDescribingTheUpdate); issueManager.update(loadedIssueWithJournals); Issue loadedIssueWithJournals2 = issueManager.getIssueById(newIssue.getId(), Include.journals); assertEquals(1, loadedIssueWithJournals2.getJournals() .size()); Journal journalItem = loadedIssueWithJournals2.getJournals().iterator().next(); assertEquals(commentDescribingTheUpdate, journalItem.getNotes()); User ourUser = IntegrationTestHelper.getOurUser(); // can't compare User objects because either of them is not // completely filled assertEquals(ourUser.getId(), journalItem.getUser().getId()); assertEquals(ourUser.getFirstName(), journalItem.getUser() .getFirstName()); assertEquals(ourUser.getLastName(), journalItem.getUser() .getLastName()); assertEquals(1, journalItem.getDetails().size()); final JournalDetail journalDetail = journalItem.getDetails().get(0); assertEquals("new subject", journalDetail.getNewValue()); assertEquals("subject", journalDetail.getName()); assertEquals("attr", journalDetail.getProperty()); Issue loadedIssueWithoutJournals = issueManager.getIssueById(newIssue.getId()); assertTrue(loadedIssueWithoutJournals.getJournals().isEmpty()); } @Test public void updateIssueDescription() throws RedmineException { Issue issue = IssueFactory.create(projectId, "test123"); final Issue iss1 = issueManager.createIssue(issue); final Issue iss2 = IssueFactory.create(iss1.getId()); iss2.setProjectId(projectId); iss2.setDescription("This is a test"); issueManager.update(iss2); final Issue iss3 = issueManager.getIssueById(iss2.getId()); assertEquals("test123", iss3.getSubject()); assertEquals("This is a test", iss3.getDescription()); } @Test public void updateIssueTitle() throws RedmineException { Issue issue = IssueFactory.create(projectId, "test123"); issue.setDescription("Original description"); final Issue iss1 = issueManager.createIssue(issue); final Issue iss2 = IssueFactory.create(iss1.getId()); iss2.setSubject("New subject"); iss2.setProjectId(projectId); issueManager.update(iss2); final Issue iss3 = issueManager.getIssueById(iss2.getId()); assertEquals("New subject", iss3.getSubject()); assertEquals("Original description", iss3.getDescription()); } @Test public void testIssuePriorities() throws RedmineException { assertTrue(issueManager.getIssuePriorities().size() > 0); } @Test public void issueTargetVersionIsSetWhenCreatingOrUpdatingIssues() throws Exception { final String version1Name = "1.0"; final String version2Name = "2.0"; final Issue issueToCreate = IssueHelper.generateRandomIssue(projectId); Version version1 = createVersion(version1Name); issueToCreate.setTargetVersion(version1); issueToCreate.setProjectId(project.getId()); final Issue createdIssue = issueManager.createIssue(issueToCreate); assertNotNull(createdIssue.getTargetVersion()); assertEquals(createdIssue.getTargetVersion().getName(), version1Name); Version version2 = createVersion(version2Name); createdIssue.setTargetVersion(version2); issueManager.update(createdIssue); Issue updatedIssue = issueManager.getIssueById(createdIssue.getId()); assertThat(updatedIssue.getTargetVersion().getName()).isEqualTo(version2Name); createdIssue.setTargetVersion(null); issueManager.update(createdIssue); updatedIssue = issueManager.getIssueById(createdIssue.getId()); assertThat(updatedIssue.getTargetVersion()).isNull(); } private Version createVersion(String versionName) throws RedmineException { final Version version = VersionFactory.create(1); version.setName(versionName); version.setProjectId(projectId); return mgr.getProjectManager().createVersion(version); } @Test public void testUpdateIssueDoesNotChangeEstimatedTime() throws RedmineException { String originalSubject = "Issue " + new Date(); Issue issue = IssueFactory.create(projectId, originalSubject); Issue newIssue = issueManager.createIssue(issue); assertEquals("Estimated hours must be NULL", null, newIssue.getEstimatedHours()); issueManager.update(newIssue); Issue reloadedFromRedmineIssue = issueManager.getIssueById(newIssue.getId()); assertEquals("Estimated hours must be NULL", null, reloadedFromRedmineIssue.getEstimatedHours()); } /** * tests the retrieval of statuses. * * @throws RedmineProcessingException thrown in case something went wrong in Redmine * @throws java.io.IOException thrown in case something went wrong while performing I/O * operations * @throws RedmineAuthenticationException thrown in case something went wrong while trying to login * @throws NotFoundException thrown in case the objects requested for could not be found */ @Test public void testGetStatuses() throws RedmineException { // TODO we should create some statuses first, but the Redmine Java API // does not support this presently List<IssueStatus> statuses = issueManager.getStatuses(); assertFalse("Expected list of statuses not to be empty", statuses.isEmpty()); for (IssueStatus issueStatus : statuses) { // asserts on status assertNotNull("ID of status must not be null", issueStatus.getId()); assertNotNull("Name of status must not be null", issueStatus.getName()); } } /** * tests the creation and deletion of a {@link com.taskadapter.redmineapi.bean.IssueCategory}. * * @throws RedmineException thrown in case something went wrong in Redmine * @throws java.io.IOException thrown in case something went wrong while performing I/O * operations * @throws RedmineAuthenticationException thrown in case something went wrong while trying to login * @throws NotFoundException thrown in case the objects requested for could not be found */ @Test public void testCreateAndDeleteIssueCategory() throws RedmineException { Project project = projectManager.getProjectByKey(projectKey); IssueCategory category = IssueCategoryFactory.create(project.getId(), "Category" + new Date().getTime()); category.setAssigneeId(IntegrationTestHelper.getOurUser().getId()); IssueCategory newIssueCategory = issueManager.createCategory(category); assertNotNull("Expected new category not to be null", newIssueCategory); assertNotNull("Expected projectId of new category not to be null", newIssueCategory.getProjectId()); assertNotNull("Expected assignee of new category not to be null", newIssueCategory.getAssigneeId()); assertThat(newIssueCategory.getAssigneeId()).isEqualTo(IntegrationTestHelper.getOurUser().getId()); // now delete category issueManager.deleteCategory(newIssueCategory); // assert that the category is gone List<IssueCategory> categories = issueManager.getCategories(project.getId()); assertTrue( "List of categories of test project must be empty now but is " + categories, categories.isEmpty()); } /** * tests the creation and deletion of a {@link com.taskadapter.redmineapi.bean.IssueCategory} * with the group as assignee * * @throws RedmineException thrown in case something went wrong in Redmine * @throws java.io.IOException thrown in case something went wrong while performing I/O * operations * @throws RedmineAuthenticationException thrown in case something went wrong while trying to login * @throws NotFoundException thrown in case the objects requested for could not be found */ @Test public void testCreateAndDeleteIssueCategoryGroupAssignee() throws RedmineException { Project project = projectManager.getProjectByKey(projectKey); IssueCategory category = IssueCategoryFactory.create(project.getId(), "Category" + new Date().getTime()); category.setAssigneeId(demoGroup.getId()); IssueCategory newIssueCategory = issueManager.createCategory(category); assertNotNull("Expected new category not to be null", newIssueCategory); assertNotNull("Expected projectId of new category not to be null", newIssueCategory.getProjectId()); assertNotNull("Expected assignee of new category not to be null", newIssueCategory.getAssigneeId()); assertThat(newIssueCategory.getAssigneeId()).isEqualTo(demoGroup.getId()); assertThat(newIssueCategory.getAssigneeName()).isEqualTo(demoGroup.getName()); // now delete category issueManager.deleteCategory(newIssueCategory); // assert that the category is gone List<IssueCategory> categories = issueManager.getCategories(project.getId()); assertTrue( "List of categories of test project must be empty now but is " + categories, categories.isEmpty()); } /** * tests the retrieval of {@link IssueCategory}s. * * @throws RedmineException thrown in case something went wrong in Redmine * @throws java.io.IOException thrown in case something went wrong while performing I/O * operations * @throws RedmineAuthenticationException thrown in case something went wrong while trying to login * @throws NotFoundException thrown in case the objects requested for could not be found */ @Test public void testGetIssueCategories() throws RedmineException { Project project = projectManager.getProjectByKey(projectKey); // create some categories IssueCategory testIssueCategory1 = IssueCategoryFactory.create(project.getId(), "Category" + new Date().getTime()); Integer ourUserId = IntegrationTestHelper.getOurUser().getId(); testIssueCategory1.setAssigneeId(ourUserId); IssueCategory newIssueCategory1 = issueManager.createCategory(testIssueCategory1); IssueCategory testIssueCategory2 = IssueCategoryFactory.create(project.getId(), "Category" + new Date().getTime()); testIssueCategory2.setAssigneeId(ourUserId); IssueCategory newIssueCategory2 = issueManager.createCategory(testIssueCategory2); try { List<IssueCategory> categories = issueManager.getCategories(project.getId()); assertEquals("Wrong number of categories for project " + project.getName() + " delivered by Redmine Java API", 2, categories.size()); for (IssueCategory category : categories) { // assert category assertNotNull("ID of category must not be null", category.getId()); assertNotNull("Name of category must not be null", category.getName()); assertNotNull("ProjectId must not be null", category.getProjectId()); assertNotNull("Assignee of category must not be null", category.getAssigneeId()); } } finally { // scrub test categories if (newIssueCategory1 != null) { issueManager.deleteCategory(newIssueCategory1); } if (newIssueCategory2 != null) { issueManager.deleteCategory(newIssueCategory2); } } } /** * tests the creation of an invalid {@link IssueCategory}. * * @throws RedmineException thrown in case something went wrong in Redmine * @throws java.io.IOException thrown in case something went wrong while performing I/O * operations * @throws RedmineAuthenticationException thrown in case something went wrong while trying to login * @throws NotFoundException thrown in case the objects requested for could not be found */ @Test(expected = IllegalArgumentException.class) public void testCreateInvalidIssueCategory() throws RedmineException { IssueCategory category = IssueCategoryFactory.create(null, "InvalidCategory" + new Date().getTime()); issueManager.createCategory(category); } /** * tests the deletion of an invalid {@link IssueCategory}. Expects a * {@link NotFoundException} to be thrown. * * @throws RedmineException thrown in case something went wrong in Redmine * @throws java.io.IOException thrown in case something went wrong while performing I/O * operations * @throws RedmineAuthenticationException thrown in case something went wrong while trying to login * @throws NotFoundException thrown in case the objects requested for could not be found */ @Test(expected = NotFoundException.class) public void testDeleteInvalidIssueCategory() throws RedmineException { // create new test category IssueCategory category = IssueCategoryFactory.create(-1); category.setName("InvalidCategory" + new Date().getTime()); // now try deleting the category issueManager.deleteCategory(category); } /** * Tests the creation and retrieval of an * {@link com.taskadapter.redmineapi.bean.Issue} with a * {@link IssueCategory}. * * @throws RedmineException thrown in case something went wrong in Redmine * @throws java.io.IOException thrown in case something went wrong while performing I/O * operations * @throws RedmineAuthenticationException thrown in case something went wrong while trying to login * @throws NotFoundException thrown in case the objects requested for could not be found */ @Test public void testCreateAndGetIssueWithCategory() throws RedmineException { IssueCategory newIssueCategory = null; Issue newIssue = null; try { Project project = projectManager.getProjectByKey(projectKey); // create an issue category IssueCategory category = IssueCategoryFactory.create(project.getId(), "Category_" + new Date().getTime()); category.setAssigneeId(IntegrationTestHelper.getOurUser().getId()); newIssueCategory = issueManager.createCategory(category); // create an issue Issue issueToCreate = IssueFactory.create(projectId, "getIssueWithCategory_" + UUID.randomUUID()); issueToCreate.setCategory(newIssueCategory); newIssue = issueManager.createIssue(issueToCreate); // retrieve issue Issue retrievedIssue = issueManager.getIssueById(newIssue.getId()); // assert retrieved category of issue IssueCategory retrievedCategory = retrievedIssue.getCategory(); assertNotNull("Category retrieved for issue " + newIssue.getId() + " should not be null", retrievedCategory); assertEquals("ID of category retrieved for issue " + newIssue.getId() + " is wrong", newIssueCategory.getId(), retrievedCategory.getId()); assertEquals("Name of category retrieved for issue " + newIssue.getId() + " is wrong", newIssueCategory.getName(), retrievedCategory.getName()); retrievedIssue.setCategory(null); issueManager.update(retrievedIssue); Issue updatedIssue = issueManager.getIssueById(newIssue.getId()); assertThat(updatedIssue.getCategory()).isNull(); } finally { if (newIssue != null) { issueManager.deleteIssue(newIssue.getId()); } if (newIssueCategory != null) { issueManager.deleteCategory(newIssueCategory); } } } @Test public void nullStartDateIsPreserved() throws RedmineException { Issue issue = IssueFactory.create(projectId, "test start date"); issue.setStartDate(null); Issue newIssue = issueManager.createIssue(issue); Issue loadedIssue = issueManager.getIssueById(newIssue.getId()); assertNull(loadedIssue.getStartDate()); } /** * The custom fields used here MUST ALREADY EXIST on the server and be * associated with the required task type (bug/feature/task/..). * <p/> * See feature request http://www.redmine.org/issues/9664 */ @Test public void testCustomFields() throws Exception { Issue issue = createIssue(issueManager, projectId); // TODO this needs to be reworked, when Redmine gains a real CRUD interface for custom fields // // To test right now the test system needs: // // Custom Field with ID 1 needs to be: // name: my_custom_1 // format: Text (string) // for all project, for all trackers // // Custom Field with ID 2 needs to be: // name: custom_boolean_1 // format: Boolean (bool) // // Custom Field with ID 3 needs to be: // name: custom_multi_list // format: List (list) // multiple values: enabled // possible values: V1, V2, V3 // default value: V2 // // All fields: need to be issue fields, for all project, for all trackers List<CustomFieldDefinition> customFieldDefinitions = mgr.getCustomFieldManager().getCustomFieldDefinitions(); CustomFieldDefinition customField1 = getCustomFieldByName(customFieldDefinitions, "my_custom_1"); CustomFieldDefinition customField2 = getCustomFieldByName(customFieldDefinitions, "custom_boolean_1"); // default empty values assertThat(issue.getCustomFields().size()).isEqualTo(3); issue.clearCustomFields(); String custom1Value = "some value 123"; String custom2Value = "true"; issue.addCustomField(CustomFieldFactory.create(customField1.getId(), customField1.getName(), custom1Value)); issue.addCustomField(CustomFieldFactory.create(customField2.getId(), customField2.getName(), custom2Value)); issueManager.update(issue); Issue updatedIssue = issueManager.getIssueById(issue.getId()); assertThat(updatedIssue.getCustomFields().size()).isEqualTo(3); assertThat(updatedIssue.getCustomFieldByName(customField1.getName()).getValue()).isEqualTo(custom1Value); assertThat(updatedIssue.getCustomFieldByName(customField2.getName()).getValue()).isEqualTo(custom2Value); } @Test public void defaultValueUsedWhenCustomFieldNotProvidedWhenCreatingIssue() throws Exception { Issue newIssue = IssueFactory.create(projectId, "test for custom multi fields"); Issue createdIssue = issueManager.createIssue(newIssue); CustomField customField = createdIssue.getCustomFieldByName("custom_multi_list"); assertThat(customField).isNotNull(); assertThat(customField.getValues().size()).isEqualTo(1); assertThat(customField.getValues().get(0)).isEqualTo("V2"); issueManager.deleteIssue(createdIssue.getId()); } @Test public void setOneValueForMultiLineCustomField() throws Exception { Issue newIssue = IssueFactory.create(projectId, "test for custom multi fields - set one value"); CustomFieldDefinition multiFieldDefinition = loadMultiLineCustomFieldDefinition(); CustomField customField = CustomFieldFactory.create(multiFieldDefinition.getId()); String defaultValue = multiFieldDefinition.getDefaultValue(); customField.setValues(Collections.singletonList(defaultValue)); newIssue.addCustomField(customField); Issue createdIssue = issueManager.createIssue(newIssue); customField = createdIssue.getCustomFieldByName("custom_multi_list"); assertThat(customField).isNotNull(); assertThat(customField.getValues().size()).isEqualTo(1); assertThat(customField.getValues().get(0)).isEqualTo(defaultValue); issueManager.deleteIssue(createdIssue.getId()); } /** * See check for https://github.com/taskadapter/redmine-java-api/issues/54 * * BUG in Redmine 3.0.0: multi-line custom fields values are ignored by Redmine 3.0.0 for new issues * without tracker_id value. * the server ignores values V1, V3 and assigns default V2 value to that multi-line custom field. * I submitted this as http://www.redmine.org/issues/19368 - fixed in Redmine 3.0.1 */ @Test public void setMultiValuesForMultiLineCustomField() throws Exception { Issue issue = IssueFactory.create(projectId, "test for custom multi fields - set multiple values"); CustomFieldDefinition multiFieldDefinition = loadMultiLineCustomFieldDefinition(); CustomField customField = CustomFieldFactory.create(multiFieldDefinition.getId()); customField.setValues(Arrays.asList("V1", "V3")); issue.addCustomField(customField); Issue createdIssue = issueManager.createIssue(issue); CustomField loadedCustomField = createdIssue.getCustomFieldByName("custom_multi_list"); assertThat(loadedCustomField).isNotNull(); assertThat(loadedCustomField.getValues().size()).isEqualTo(2); List<String> values = new ArrayList<>(loadedCustomField.getValues()); Collections.sort(values); assertThat(loadedCustomField.getValues().get(0)).isEqualTo("V1"); assertThat(loadedCustomField.getValues().get(1)).isEqualTo("V3"); issueManager.deleteIssue(createdIssue.getId()); } /** * This is to make sure we have a workaround for a known bug in redmine 2.6. */ @Test public void createIssueWithEmptyListInMultilineCustomFields() throws Exception { Issue newIssue = IssueFactory.create(projectId, "test for custom multi fields - set multiple values"); CustomFieldDefinition multiFieldDefinition = loadMultiLineCustomFieldDefinition(); CustomField customField = CustomFieldFactory.create(multiFieldDefinition.getId()); customField.setValues(Collections.EMPTY_LIST); newIssue.addCustomField(customField); Issue createdIssue = issueManager.createIssue(newIssue); customField = createdIssue.getCustomFieldByName("custom_multi_list"); assertThat(customField).isNotNull(); assertThat(customField.getValues().size()).isEqualTo(0); issueManager.deleteIssue(createdIssue.getId()); } private static CustomFieldDefinition loadMultiLineCustomFieldDefinition() throws RedmineException { List<CustomFieldDefinition> customFieldDefinitions = mgr.getCustomFieldManager().getCustomFieldDefinitions(); return getCustomFieldByName(customFieldDefinitions, "custom_multi_list"); } @Ignore @Test public void testChangesets() throws RedmineException { final Issue issue = issueManager.getIssueById(89, Include.changesets); assertThat(issue.getChangesets().size()).isEqualTo(2); final Changeset firstChange = issue.getChangesets().iterator().next(); assertNotNull(firstChange.getComments()); } /** * Tests the retrieval of {@link Tracker}s. * * @throws RedmineException thrown in case something went wrong in Redmine * @throws RedmineAuthenticationException thrown in case something went wrong while trying to login * @throws NotFoundException thrown in case the objects requested for could not be found */ @Test public void testGetTrackers() throws RedmineException { List<Tracker> trackers = issueManager.getTrackers(); assertNotNull("List of trackers returned should not be null", trackers); assertFalse("List of trackers returned should not be empty", trackers.isEmpty()); for (Tracker tracker : trackers) { assertNotNull("Tracker returned should not be null", tracker); assertNotNull("ID of tracker returned should not be null", tracker.getId()); assertNotNull("Name of tracker returned should not be null", tracker.getName()); } } @Test public void getSavedQueriesDoesNotFailForTempProject() throws RedmineException { issueManager.getSavedQueries(projectKey); } @Test public void getSavedQueriesDoesNotFailForNULLProject() throws RedmineException { issueManager.getSavedQueries(null); } @Ignore("This test requires a specific project configuration") @Test public void testSavedQueries() throws RedmineException { final Collection<SavedQuery> queries = issueManager.getSavedQueries("test"); assertTrue(queries.size() > 0); } @Test public void statusIsUpdated() throws RedmineException { Issue issue = createIssues(issueManager, projectId, 1).get(0); Issue retrievedIssue = issueManager.getIssueById(issue.getId()); Integer initialStatusId = retrievedIssue.getStatusId(); List<IssueStatus> statuses = issueManager.getStatuses(); // get some status ID that is not equal to the initial one Integer newStatusId = null; for (IssueStatus status : statuses) { if (!status.getId().equals(initialStatusId)) { newStatusId = status.getId(); break; } } if (newStatusId == null) { throw new RuntimeException("can't run this test: no Issue Statuses are available except for the initial one"); } retrievedIssue.setStatusId(newStatusId); issueManager.update(retrievedIssue); Issue issueWithUpdatedStatus = issueManager.getIssueById(retrievedIssue.getId()); assertThat(issueWithUpdatedStatus.getStatusId()).isEqualTo(newStatusId); } @Test public void changeProject() throws RedmineException { Project project1 = mgr.getProjectManager().getProjectByKey(projectKey); Project project2 = mgr.getProjectManager().getProjectByKey(projectKey2); Issue issue = createIssue(issueManager, projectId); Issue retrievedIssue = issueManager.getIssueById(issue.getId()); assertThat(retrievedIssue.getProjectId()).isEqualTo(project1.getId()); issue.setProjectId(project2.getId()); issueManager.update(issue); retrievedIssue = issueManager.getIssueById(issue.getId()); assertThat(retrievedIssue.getProjectId()).isEqualTo(project2.getId()); deleteIssueIfNotNull(issue); } @Test public void issueAssignmentUserAndGroup() throws RedmineException { Issue issue = createIssue(issueManager, projectId); assertNull(issue.getAssigneeId()); issue.setAssigneeId(IntegrationTestHelper.getOurUser().getId()); issueManager.update(issue); Issue retrievedIssue = issueManager.getIssueById(issue.getId()); // User assignment succeeded assertThat(retrievedIssue.getAssigneeId()).isEqualTo(IntegrationTestHelper.getOurUser().getId()); issue.setAssigneeId(demoGroup.getId()); issueManager.update(issue); retrievedIssue = issueManager.getIssueById(issue.getId()); // Group assignment succeeded assertThat(retrievedIssue.getAssigneeId()).isEqualTo(demoGroup.getId()); deleteIssueIfNotNull(issue); } @Test public void issueCanBeCreatedOnBehalfOfAnotherUser() throws RedmineException { final User newUser = userManager.createUser(UserGenerator.generateRandomUser()); Issue issue = null; try { RedmineManager managerOnBehalfOfUser = IntegrationTestHelper.createRedmineManager(); managerOnBehalfOfUser.setOnBehalfOfUser(newUser.getLogin()); issue = createIssue(managerOnBehalfOfUser.getIssueManager(), projectId); assertThat(issue.getAuthorName()).isEqualTo(newUser.getFullName()); } finally { userManager.deleteUser(newUser.getId()); deleteIssueIfNotNull(issue); } } @Test public void issuesCanBeFoundByFreeFormSearch() throws RedmineException { // create some random issues in the project createIssues(issueManager, projectId, 3); final String subject = "test for free_form_search."; final Issue issueToCreate = IssueFactory.create(projectId, subject); Integer createdIssueId = null; try { createdIssueId = issueManager.createIssue(issueToCreate).getId(); Map<String, String> params = new HashMap<>(); params.put("project_id", Integer.toString(projectId)); params.put("subject", "~free_form_search"); List<Issue> issues = issueManager.getIssues(params).getResults(); assertThat(issues.size()).isEqualTo(1); final Issue loaded = issues.get(0); assertThat(loaded.getSubject()).isEqualTo(subject); } finally { issueManager.deleteIssue(createdIssueId); } } /** * regression test for https://github.com/taskadapter/redmine-java-api/issues/12 and * https://github.com/taskadapter/redmine-java-api/issues/215 */ @Test public void issuesCanBeFoundByMultiQuerySearch() throws RedmineException { final Issue issue1 = IssueFactory.create(projectId, "summary 1 here"); issueManager.createIssue(issue1); final Issue issue2 = IssueFactory.create(projectId, "summary 2 here"); issueManager.createIssue(issue2); // have some random subject to avoid collisions with other tests String subject = "another" + new Random().nextInt(); final Issue issue3 = IssueFactory.create(projectId, subject); issueManager.createIssue(issue3); final User currentUser = userManager.getCurrentUser(); Params params = new Params() .add("set_filter", "1") .add("f[]", "subject") .add("op[subject]", "~") .add("v[subject][]", subject) .add("f[]", "author_id") .add("op[author_id]", "~") .add("v[author_id][]", currentUser.getId()+""); final ResultsWrapper<Issue> list = issueManager.getIssues(params); // only 1 issue must be found assertThat(list.getResults()).hasSize(1); } private void deleteIssueIfNotNull(Issue issue) throws RedmineException { if (issue != null) { issueManager.deleteIssue(issue.getId()); } } }
{ "content_hash": "29ddc71cde19299c2adf15fc2027b31e", "timestamp": "", "source": "github", "line_count": 1329, "max_line_length": 123, "avg_line_length": 45.84499623777276, "alnum_prop": 0.6780133928571429, "repo_name": "redminenb/redmine-java-api", "id": "40a93d409a95609fd4607156a21d133ba46972eb", "size": "60932", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/java/com/taskadapter/redmineapi/IssueManagerIT.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "780" }, { "name": "Java", "bytes": "490106" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "db47e904c6711f245495ef80a17adf4b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "e54894c7d1a36583e770e7f004ee2316759f52ed", "size": "176", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Pteridophyta/Polypodiopsida/Polypodiales/Pteridaceae/Acrostichum/Chrysodium pellucens/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
Package model is a convenience wrapper around what the `Store` provides. It's main responsibility is to maintain indexes that would otherwise be maintaned by the users to enable different queries on the same data. ## Usage The following snippets will this piece of code prepends them. ```go import( model "github.com/micro/micro/v3/service/model" fs "github.com/micro/micro/v3/service/store/file" ) type User struct { ID string `json:"id"` Name string `json:"name"` Age int `json:"age"` HasPet bool `json:"hasPet"` Created int64 `json:"created"` Tag string `json:"tag"` Updated int64 `json:"updated"` } ``` ## Query by field equality For each field we want to query on we have to create an index. Index by `id` is provided by default to each `DB`, there is no need to specify it. ```go ageIndex := model.ByEquality("age") db := model.New(User{}, []model.Index{(ageIndex}) err := db.Create(User{ ID: "1", Name: "Alice", Age: 20, }) if err != nil { // handle save error } err := db.Create(User{ ID: "2", Name: "Jane", Age: 22 }) if err != nil { // handle save error } err = db.Read(model.Equals("age", 22), &users) if err != nil { // handle list error } fmt.Println(users) // will print // [{"id":"2","name":"Jane","age":22}] ``` ## Reading all records in an index Reading can be done without specifying a value: ```go db.Read(Equals("age", nil), &users) ``` Readings will be unordered, ascending ordered or descending ordered depending on the ordering settings of the index. ## Ordering Indexes by default are ordered. If we want to turn this behaviour off: ```go ageIndex.Order.Type = OrderTypeUnordered ageQuery := model.Equals("age", 22) ageQuery.Order.Type = OrderTypeUnordered ``` ### Filtering by one field, ordering by other ```go typeIndex := ByEquality("type") typeIndex.Order = Order{ Type: OrderTypeDesc, FieldName: "age", } // Results will be ordered by age db.Read(typeIndex.ToQuery("a-certain-type-value")) ``` By default the ordering field is the same as the filtering field. ### Reverse order ```go ageQuery.Desc = true ``` ### Queries must match indexes It is important to note that queries must match indexes. The following index-query pairs match (separated by an empty line) ```go // Ascending ordered index by age index := model.Equality("age") // Read ascending ordered by age query := model.Equals("age", nil) // Read ascending ordered by age where age = 20 query2 := model.Equals("age", 20) // Descending ordered index by age index := model.Equality("age") index.Order.Type = OrderTypeDesc // Read descending ordered by age query := model.Equals("age", nil) query.Order.Type = OrderTypeDesc // Read descending ordered by age where age = 20 query2 := model.Equals("age", 20) query2.Order.Type = OrderTypeDesc // Unordered index by age index := model.Equality("age") index.Order.Type = OrderTypeUnordered // Read unordered by age query := model.Equals("age", nil) query.Order.Type = OrderTypeUnordered // Read unordered by age where age = 20 query2 := model.Equals("age", 20) query2.Order.Type = OrderTypeUnordered ``` Of course, maintaining this might be inconvenient, for this reason the `ToQuery` method was introduced, see below. #### Creating a query out of an Index ```go index := model.Equality("age") index.Order.Type = OrderTypeUnordered db.Read(index.ToQuery(25)) ``` ### Unordered listing without value It's easy to see how listing things by unordered indexes on different fields should result in the same output: a randomly ordered list, ie: ```go ageIndex := model.Equality("age") ageIndex.Order.Type = OrderTypeUnordered emailIndex := model.Equality("email") emailIndex.Order.Type = OrderTypeUnordered result1 := []User{} result2 := []User{} db.Read(model.Equals("age"), &result1) db.Read(model.Equals("email"), &result2) // Both result1 and result2 will be an unordered listing without // filtering on either the age or email fields. // Could be thought of as a noop query despite not having an explicit "no query" listing. ``` ### Ordering by string fields Ordering comes for "free" when dealing with numeric or boolean fields, but it involves in padding, inversing and order preserving base32 encoding of values to work for strings. This can sometimes result in large keys saved, as the inverse of a small 1 byte character in a string is a 4 byte rune. Optionally adding base32 encoding on top to prevent exotic runes appearing in keys, strings blow up in size even more. If saving space is a requirement and ordering is not, ordering for strings should be turned off. The matter is further complicated by the fact that the padding size must be specified ahead of time. ```go nameIndex := model.ByEquality("name") nameIndex.StringOrderPadLength = 10 nameQuery := model.Equals("age", 22) // `StringOrderPadLength` is not needed to be specified for the query ``` To turn off base32 encoding and keep the runes: ```go nameIndex.Base32Encode = false ``` ## Unique indexes ```go emailIndex := model.ByEquality("email") emailIndex.Unique = true ``` ## Design ### Restrictions To maintain all indexes properly, all fields must be filled out when saving. This sometimes requires a `Read, Modify, Write` pattern. In other words, partial updates will break indexes. This could be avoided later if model does the loading itself. ## TODO - Implement deletes - Implement counters, for pattern inspiration see the [tags service](https://github.com/micro/services/tree/master/blog/tags) - Test boolean indexes and its ordering - There is a stuttering in the way `id` fields are being saved twice. ID fields since they are unique do not need `id` appended after them in the record keys.
{ "content_hash": "0c80c31149336f4918428983a3124d00", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 335, "avg_line_length": 26.990610328638496, "alnum_prop": 0.7232562184727779, "repo_name": "micro/micro", "id": "567148aa7ce537fcc25bb5d7ffd769430f8d3ceb", "size": "5758", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "service/model/README.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "2059" }, { "name": "Go", "bytes": "2360256" }, { "name": "JavaScript", "bytes": "21608" }, { "name": "Makefile", "bytes": "4089" }, { "name": "PowerShell", "bytes": "3133" }, { "name": "Shell", "bytes": "15973" } ], "symlink_target": "" }
@interface NSDictionary (Extra) - (NSDate *)dateForKey:(NSString *)key format:(NSString *)format; - (NSDate *)unixDateForKey:(NSString *)key; - (NSString *)stringForKey:(NSString *)key; - (NSUInteger)intForKey:(NSString *)key; - (BOOL)boolForKey:(NSString *)key; - (double)doubleForKey:(NSString *)key; - (float)floatForKey:(NSString *)key; - (NSNumber *)numberForKey:(NSString *)key; - (NSArray *)arrayForKey:(NSString *)key; @end
{ "content_hash": "b1a97c510c41a0549d232ccf3eba31c6", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 65, "avg_line_length": 33.30769230769231, "alnum_prop": 0.7136258660508084, "repo_name": "Thanhktm/IBChecker", "id": "020ce2ab9d5e231ca70db6739a2c0fa4026162e5", "size": "588", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Library/NSDictionary+Extra/NSDictionary+Extra.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "1020" }, { "name": "HTML", "bytes": "1061" }, { "name": "Objective-C", "bytes": "983515" } ], "symlink_target": "" }
[![Build Status](https://travis-ci.org/OpenGene/MrBam.svg?branch=master)](https://travis-ci.org/OpenGene/MrBam) [![Coverage Status](https://coveralls.io/repos/github/OpenGene/MrBam/badge.svg?branch=master)](https://coveralls.io/github/OpenGene/MrBam?branch=master) For a given mutation, query its mutated reads from a BAM, merge the reads by positions and give the unique count. # Prerequisites - Python 3.4+ - Pysam (`$pip install pysam`) # Usage ``` $ python -m MrBam.main --help usage: main.py [-h] [-c CFDNA] [-g GDNA] [-o OUTPUT] [-i INFO] [-q QUAL] [-s] [-f] [-v] query example: $ MrBam sample.vcf --cfdna sample_cfdna.bam -o sample_MrBam.vcf --simple positional arguments: query vcf file contains mutations to query optional arguments: -h, --help show this help message and exit -c, --cfdna CFDNA bam file contains cfdna reads info. There must be a corresponding .bai file in the same directory -g, --gdna GDNA bam file contains gdna reads info. There must be a corresponding .bai file in the same directory -o, --output OUTPUT output vcf file. Will be overwritten if already exists --skip SKIP skip the first N lines -q, --qual QUAL drop bases whose qulity is less than this (default: 25) -s, --simple annotate less infomations into vcf output -f, --fast do not infer origin read size by CIGAR, it can be faster and consume less memory. --drop-inconsist drop different reads stack at the same position. This decreases sensitivity. --dropXA drop reads that has XA tag (multiple alignment) -m, --mismatch-limit MISMATCH_LIMIT if set, drop reads that has more mismatches than the limit. requires a 'MD' or a 'NM' tag to be present. -v, --verbos output debug info ``` # Performace ``` #sample option bam_size(mb) vcf_lines CPU_time(s) Memory(mb) Sam3 (default) 194 14978 147 1116 Sam3 --fast 194 14978 129 27 Sam2 (default) 655 33702 500 3162 Sam2 --fast 655 33702 417 28 Sam1 (default) 1620 113066 5952 8377 Sam1 --fast 1620 113066 5785 34 Sam4 (default) 2338 648336 49067 9912 Sam4 --fast 2338 648336 60393 36 ``` * CPU_time is user + sys * Memory may vary accroding to system memory pressure * Test on Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz
{ "content_hash": "fcf62d2a8f0bc0184eac190236713aef", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 152, "avg_line_length": 43.596774193548384, "alnum_prop": 0.5904550499445061, "repo_name": "ylxdzsw/MrBam", "id": "57b595a6b4802e74e59dc0faf4d0b139d0676f8f", "size": "2711", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Julia", "bytes": "2344" }, { "name": "Python", "bytes": "31189" }, { "name": "Shell", "bytes": "528" } ], "symlink_target": "" }
//=============================================================================== // Microsoft patterns & practices // Unity Application Block //=============================================================================== // Copyright © Microsoft Corporation. All rights reserved. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND // FITNESS FOR A PARTICULAR PURPOSE. //=============================================================================== using System; using System.Collections.Generic; using System.Reflection; namespace SimpleEventBroker { public class PublishedEvent { private List<object> publishers; private List<EventHandler> subscribers; public PublishedEvent() { publishers = new List<object>(); subscribers = new List<EventHandler>(); } public IEnumerable<object> Publishers { get { foreach(object publisher in publishers) { yield return publisher; } } } public IEnumerable<EventHandler> Subscribers { get { foreach(EventHandler subscriber in subscribers) { yield return subscriber; } } } public bool HasPublishers { get { return publishers.Count > 0; } } public bool HasSubscribers { get { return subscribers.Count > 0; } } public void AddPublisher(object publisher, string eventName) { publishers.Add(publisher); EventInfo targetEvent = publisher.GetType().GetEvent(eventName); GuardEventExists(eventName, publisher, targetEvent); MethodInfo addEventMethod = targetEvent.GetAddMethod(); GuardAddMethodExists(targetEvent); EventHandler newSubscriber = OnPublisherFiring; addEventMethod.Invoke(publisher, new object[] { newSubscriber }); } public void RemovePublisher(object publisher, string eventName) { publishers.Remove(publisher); EventInfo targetEvent = publisher.GetType().GetEvent(eventName); GuardEventExists(eventName, publisher, targetEvent); MethodInfo removeEventMethod = targetEvent.GetRemoveMethod(); GuardRemoveMethodExists(targetEvent); EventHandler subscriber = OnPublisherFiring; removeEventMethod.Invoke(publisher, new object[] {subscriber}); } public void AddSubscriber(EventHandler subscriber) { subscribers.Add(subscriber); } public void RemoveSubscriber(EventHandler subscriber) { subscribers.Remove(subscriber); } private void OnPublisherFiring(object sender, EventArgs e) { foreach(EventHandler subscriber in subscribers) { subscriber(sender, e); } } private static void GuardEventExists(string eventName, object publisher, EventInfo targetEvent) { if(targetEvent == null) { throw new ArgumentException(string.Format("The event '{0}' is not implemented on type '{1}'", eventName, publisher.GetType().Name)); } } private static void GuardAddMethodExists(EventInfo targetEvent) { if(targetEvent.GetAddMethod() == null) { throw new ArgumentException(string.Format("The event '{0}' does not have a public Add method", targetEvent.Name)); } } private static void GuardRemoveMethodExists(EventInfo targetEvent) { if (targetEvent.GetRemoveMethod() == null) { throw new ArgumentException(string.Format("The event '{0}' does not have a public Remove method", targetEvent.Name)); } } } }
{ "content_hash": "e5dde2dbff104b6eb761104e5a1915cb", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 113, "avg_line_length": 33.07575757575758, "alnum_prop": 0.5302336234539624, "repo_name": "austriapro/ebinterface-word-plugin", "id": "2557d007a7c16c3e977ebb722867245687d846e7", "size": "4369", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "eRechnungWordPlugIn/SimpleEventBroker/PublishedEvent.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "1953648" }, { "name": "PowerShell", "bytes": "43108" }, { "name": "Smalltalk", "bytes": "17892" } ], "symlink_target": "" }
// Copyright (c) 2012, Event Store LLP // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // Neither the name of the Event Store LLP nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTitle("EventStore.Padmin")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Event Store LLP")] [assembly: AssemblyProduct("EventStore.Padmin")] [assembly: AssemblyCopyright("Copyright © Event Store LLP. All rights reserved.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] //NOTE: Do not change these, they will be modified during the build by TeamCity. [assembly: AssemblyVersion("0.0.0.0")] [assembly: AssemblyFileVersion("0.0.0.0")] [assembly: ComVisible(false)] [assembly: Guid("17e3f3af-6b48-4e6e-8261-e049af827ba5")]
{ "content_hash": "5a0c8de4aa1754e518efbab3fb23ace2", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 82, "avg_line_length": 49.644444444444446, "alnum_prop": 0.7743957027752909, "repo_name": "msbahrul/EventStore", "id": "ea88905a73391e6ca6a667a54ac1c5737b68b233", "size": "2237", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/EventStore/EventStore.Padmin/Properties/AssemblyInfo.cs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "4483" }, { "name": "C", "bytes": "3503" }, { "name": "C#", "bytes": "8749942" }, { "name": "C++", "bytes": "34319" }, { "name": "CSS", "bytes": "7878" }, { "name": "HTML", "bytes": "150447" }, { "name": "JavaScript", "bytes": "4908689" }, { "name": "PowerShell", "bytes": "9755" }, { "name": "Protocol Buffer", "bytes": "5491" }, { "name": "Shell", "bytes": "29478" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; namespace Spark.Engine.Extensions { public static class RegexExtensions { public static string ReplaceGroup(this Regex regex, string input, string groupName, string replacement) { return ReplaceGroups(regex, input, new Dictionary<string, string> { { groupName, replacement } }); } public static string ReplaceGroups(this Regex regex, string input, Dictionary<string, string> replacements) { return regex.Replace(input, m => { return ReplaceNamedGroups(m, input, replacements); }); } private static string ReplaceNamedGroups(Match m, string input, Dictionary<string, string> replacements) { string result = m.Value; foreach (var replacement in replacements) { var groupName = replacement.Key; var replaceWith = replacement.Value; foreach (Capture cap in m.Groups[groupName]?.Captures) { result = result.Remove(cap.Index - m.Index, cap.Length); result = result.Insert(cap.Index - m.Index, replaceWith); } } return result; } } }
{ "content_hash": "c45e38f77b8c0e2c398675841bd9f97d", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 115, "avg_line_length": 33.642857142857146, "alnum_prop": 0.5966029723991507, "repo_name": "aerosonik/SparkValidation", "id": "8df33b147d03d24fa77a37723eead2dfe572d8d1", "size": "1415", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/Spark.Engine/Extensions/RegexExtensions.cs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ASP", "bytes": "99" }, { "name": "Batchfile", "bytes": "49" }, { "name": "C#", "bytes": "912293" }, { "name": "CSS", "bytes": "5040" }, { "name": "HTML", "bytes": "5069" }, { "name": "JavaScript", "bytes": "136201" }, { "name": "XSLT", "bytes": "10021" } ], "symlink_target": "" }
namespace Browsio.UnitTest.Domain { #region << Using >> using System.Collections.Generic; using Browsio.Domain; using Incoding.MSpecContrib; using Machine.Specifications; #endregion [Subject(typeof(GetGenresByCategoryQuery))] public class When_genres_by_category { #region Establish value static MockMessage<GetGenresByCategoryQuery, List<Genre>> mockQuery; static List<Genre> expected; #endregion Establish establish = () => { var query = Pleasure.Generator.Invent<GetGenresByCategoryQuery>(); expected = Pleasure.ToList(Pleasure.Generator.Invent<Genre>()); mockQuery = MockQuery<GetGenresByCategoryQuery, List<Genre>> .When(query) .StubQuery(whereSpecification: new GenreByCategoryOptWhereSpec(query.Category), entities: expected.ToArray()); }; Because of = () => mockQuery.Original.Execute(); It should_be_result = () => mockQuery.ShouldBeIsResult(expected); } }
{ "content_hash": "e0e96985f0a7dde38c31b5b15a79710e", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 126, "avg_line_length": 34.31578947368421, "alnum_prop": 0.5253067484662577, "repo_name": "IncodingSoftware/Browsio", "id": "4157864cfa87c4b44bdd994323fbf9f5bac486ac", "size": "1306", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Domain.UnitTest/Domain/Operations/Genre/Query/When_genres_by_category.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "98" }, { "name": "C#", "bytes": "401488" }, { "name": "CSS", "bytes": "326290" }, { "name": "JavaScript", "bytes": "690658" }, { "name": "PowerShell", "bytes": "5313" }, { "name": "Puppet", "bytes": "5525" }, { "name": "Ruby", "bytes": "4394" }, { "name": "Shell", "bytes": "5124" } ], "symlink_target": "" }
<?php namespace App\Entity; use App\Model\UserInterface; use App\Validator\Constraints as CustomAssert; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Criteria; use Doctrine\ORM\PersistentCollection; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Validator\Constraints as Assert; /** * @CustomAssert\ValidUser(groups={"registration", "request_reset_password"}) * @UniqueEntity(fields={"email"}) */ class User implements UserInterface { const ROLE_ALLOWED_TO_SWITCH = 'ROLE_ALLOWED_TO_SWITCH'; const ROLE_ACCOUNTANT = 'ROLE_ACCOUNTANT'; const ROLE_SALES_AGENT = 'ROLE_SALES_AGENT'; const ROLE_CLERK = 'ROLE_CLERK'; const ROLE_OWNER = 'ROLE_OWNER'; const ROLE_SUPER_ADMIN = 'ROLE_SUPER_ADMIN'; const ROLE_PREVIOUS_ADMIN = 'ROLE_PREVIOUS_ADMIN'; const ROLE_USER = 'ROLE_USER'; protected $id; /** * @var string */ protected $username; /** * @Assert\NotBlank(message="error.empty_email", groups={"default", "update", "registration", "request_reset_password"}) * @Assert\Email(message="error.invalid_email", groups={"default", "update", "registration", "request_reset_password"}) * * @var string */ protected $email; /** * @var bool */ protected $enabled; /** * The salt to use for hashing. * * @var string */ protected $salt; /** * Encrypted password. Must be persisted. * * @var string */ protected $password; /** * Plain password. Used for model validation. Must not be persisted. * * @Assert\NotBlank(message="error.empty_password", groups={"default", "registration", "change_password", "reset_password"}) * @Assert\Length(min=6, groups={"default", "registration", "change_password", "reset_password"}) * * @var string */ protected $plainPassword; /** * @var \DateTime */ protected $lastLogin; /** * Random string sent to the user email address in order to verify it. * * @var string */ protected $confirmationToken; /** * Random string sent to the user email address in order to reset the password. * * @var string */ protected $resetPasswordToken; /** * @var \DateTime */ protected $passwordRequestedAt; /** * @var array */ protected $roles; /** * @var ArrayCollection */ private $ownedCompanies; /** * @var ArrayCollection */ private $managedCompanies; /** * @var ArrayCollection */ private $accountedCompanies; /** * @var ArrayCollection */ private $marketedCompanies; /** * @var ArrayCollection */ private $sentInvites; /** * @var ArrayCollection */ private $receivedInvites; public static function create($email, $password, $salt) { $entity = new self(); $entity->username = $email; $entity->email = $email; $entity->password = $password; $entity->salt = $salt; return $entity; } public function __construct() { $this->salt = base_convert(sha1(uniqid(mt_rand(), true)), 16, 36); $this->enabled = false; $this->roles = []; $this->ownedCompanies = new ArrayCollection(); $this->managedCompanies = new ArrayCollection(); $this->marketedCompanies = new ArrayCollection(); $this->accountedCompanies = new ArrayCollection(); $this->sentInvites = new ArrayCollection(); $this->receivedInvites = new ArrayCollection(); } public function __toString() { return (string)$this->getEmail(); } /** * Returns the user unique id. * * @return mixed */ public function getId() { return $this->id; } public function getUsername() { return $this->username; } public function setUsername($username) { $this->username = $username; } public function getSalt() { return $this->salt; } public function setSalt($salt) { $this->salt = $salt; } public function getEmail() { return $this->email; } public function setEmail($email) { if ($this->username == null) { $this->setUsername($email); } $this->email = $email; } public function getPassword() { return $this->password; } public function setPassword($password) { $this->password = $password; } public function isEnabled() { return $this->enabled; } public function setEnabled($boolean) { $this->enabled = (Boolean)$boolean; return $this; } public function getPlainPassword() { return $this->plainPassword; } public function setPlainPassword($password) { $this->plainPassword = $password; return $this; } public function getLastLogin() { return $this->lastLogin; } public function setLastLogin(\DateTime $time = null) { $this->lastLogin = $time; return $this; } public function getConfirmationToken() { return $this->confirmationToken; } public function setConfirmationToken($confirmationToken) { $this->confirmationToken = $confirmationToken; return $this; } public function getResetPasswordToken() { return $this->resetPasswordToken; } public function setResetPasswordToken($resetPasswordToken) { $this->resetPasswordToken = $resetPasswordToken; return $this; } public function getPasswordRequestedAt() { return $this->passwordRequestedAt; } public function setPasswordRequestedAt(\DateTime $date = null) { $this->passwordRequestedAt = $date; return $this; } public function getRoles() { $roles = $this->roles; // we need to make sure to have at least one role $roles[] = static::ROLE_USER; return array_unique($roles); } public function setRoles(array $roles) { $this->roles = []; foreach ($roles as $role) { $this->addRole($role); } return $this; } public function hasRole($role) { return in_array(strtoupper($role), $this->getRoles(), true); } public function addRole($role) { $role = strtoupper($role); if ($role === self::ROLE_USER) { return $this; } if (!in_array($role, $this->roles, true)) { $this->roles[] = $role; } return $this; } public function removeRole($role) { if (false !== $key = array_search(strtoupper($role), $this->roles, true)) { unset($this->roles[$key]); $this->roles = array_values($this->roles); } return $this; } /** * Serializes the user. * * The serialized data have to contain the fields used by the equals method and the username. * * @return string */ public function serialize() { return serialize( [ $this->password, $this->salt, $this->username, $this->enabled, $this->id, ] ); } /** * Unserializes the user. * * @param string $serialized */ public function unserialize($serialized) { $data = unserialize($serialized); // add a few extra elements in the array to ensure that we have enough keys when unserializing // older data which does not include all properties. $data = array_merge($data, array_fill(0, 2, null)); list( $this->password, $this->salt, $this->username, $this->enabled, $this->id ) = $data; } /** * Removes sensitive data from the user. */ public function eraseCredentials() { $this->plainPassword = null; } public function isPasswordRequestNonExpired($ttl) { return $this->getPasswordRequestedAt() instanceof \DateTime && $this->getPasswordRequestedAt()->getTimestamp() + $ttl > time(); } public function isSuperadmin() { return $this->hasRole(self::ROLE_SUPER_ADMIN); } public function isAccountant() { return $this->accountedCompanies->count() > 0; } public function isOwner() { return $this->ownedCompanies->count() > 0; } public function isClerk() { return $this->managedCompanies->count() > 0; } public function isSalesAgent() { return $this->marketedCompanies->count() > 0; } public function isSameAs(User $user) { return $this->getId() === $user->getId(); } /** * @inheritdoc */ public function isAccountNonExpired() { return true; } /** * @inheritdoc */ public function isAccountNonLocked() { return true; } /** * @inheritdoc */ public function isCredentialsNonExpired() { return true; } public function getOwnedCompanies() { return $this->ownedCompanies; } public function setOwnedCompanies($ownedCompanies) { /** @var Company $company */ foreach ($ownedCompanies as $company) { $this->addOwnedCompany($company); } } public function addOwnedCompany(Company $company) { $this->ownedCompanies->add($company); $company->setOwner($this); } public function hasOwnedCompanies() { return $this->ownedCompanies->count() > 0; } public function getManagedCompanies() { return $this->managedCompanies; } public function setManagedCompanies($managedCompanies) { /** @var Company $company */ foreach ($managedCompanies as $company) { $this->addManagedCompany($company); } } public function addManagedCompany(Company $company) { $this->managedCompanies->add($company); $company->addManager($this); } public function removeManagedCompany(Company $company) { $this->managedCompanies->removeElement($company); $company->removeManager($this); } public function getAccountedCompanies() { return $this->accountedCompanies; } public function setAccountedCompanies($accountedCompanies) { $this->accountedCompanies = $accountedCompanies; } public function addAccountedCompany(Company $company) { $this->accountedCompanies->add($company); $company->setAccountant($this); } public function removeAccountedCompany(Company $company) { $this->accountedCompanies->removeElement($company); $company->setAccountant(null); } public function getMarketedCompanies() { return $this->marketedCompanies; } public function setMarketedCompanies($marketedCompanies) { $this->marketedCompanies = $marketedCompanies; } public function addMarketedCompany(Company $company) { $this->marketedCompanies->add($company); $company->addSalesAgent($this); } public function removeMarketedCompany(Company $company) { $this->marketedCompanies->removeElement($company); $company->removeSalesAgent($this); } public function getDefaultCompany() { if ($this->ownedCompanies->count() > 0) { return $this->ownedCompanies->get(0); } return null; } public function canAddAccount() { return $this->hasOwnedCompanies(); } public function hasCompanyManager(User $user) { /** @var Company $ownedCompany */ foreach ($this->ownedCompanies as $ownedCompany) { if ($ownedCompany->hasManager($user)) { return true; } } return false; } public function ownsCompany(Company $company) { /** @var Company $ownedCompany */ foreach ($this->ownedCompanies as $ownedCompany) { if ($ownedCompany->isSameAs($company)) { return true; } } return false; } public function ownsAccount(Account $account) { foreach ($this->ownedCompanies as $ownedCompany) { if ($ownedCompany->isSameAs($account->getCompany())) { return true; } } return false; } public function canEditCustomer(Customer $customer) { return $this->canManageCompany($customer->getCompany()); } public function canDeleteCustomer(Customer $customer) { return $this->canManageCompany($customer->getCompany()); } public function canManageDocument(Document $document) { return $this->canManageCompany($document->getCompany()); } public function canManageRecurrence(Recurrence $recurrence) { return $this->canManageCompany($recurrence->getCompany()); } public function canManageCompany(Company $company) { return $this->isSuperadmin() || $this->managedCompanies->contains($company) || $this->ownedCompanies->contains($company); } public function canManageParagraphTemplates(Company $company) { return $this->canManageWorkingNotes($company); } public function canManageWorkingNotes(Company $company) { return $this->isSuperadmin() || $this->managedCompanies->contains($company) || $this->marketedCompanies->contains($company) || $this->ownedCompanies->contains($company); } public function getDecimalPoint() { return '.'; } public function getNumberSeparator() { return ','; } public function canManageMultipleCompanies() { return $this->isSuperadmin() || ($this->isManagingMultipleCompanies()); } public function ownsProduct(Product $product) { return $this->canManageCompany($product->getCompany()); } public function ownsService(Service $service) { return $this->canManageCompany($service->getCompany()); } public function isAccountantFor(Company $company) { return $company->hasAccountant() && $company->getAccountant()->isSameAs($this); } public function isSalesAgentFor(Company $company) { return $company->hasSalesAgent($this); } public function isManagingMultipleCompanies() { return $this->managedCompanies->count() > 1; } public function hasReceivedInvites() { return $this->receivedInvites->count() > 0; } public function getSentInvites() { return $this->sentInvites; } public function setSentInvites($sentInvites) { $this->sentInvites = $sentInvites; } public function getReceivedInvites() { return $this->receivedInvites; } public function addReceivedInvite(Invite $invite) { $this->receivedInvites->add($invite); } public function setReceivedInvites($receivedInvites) { $this->receivedInvites = $receivedInvites; } public function canShowPettyCashNote(PettyCashNote $note) { return $this->isAccountant() && $this->isAccountantFor($note->getCompany()); } public function isManagingSingleCompany() { return $this->isManager() && !$this->isManagingMultipleCompanies(); } private function isManager() { return $this->managedCompanies->count() > 0; } public function canDeleteMedium(Medium $medium) { return $this->canManageCompany($medium->getContainer()); } public function canEditMedium(Medium $medium) { return $this->canManageCompany($medium->getContainer()); } public function ownsWorkingNote(WorkingNote $workingNote) { return $this->canManageCompany($workingNote->getCompany()) || $this->canManageWorkingNotes( $workingNote->getCompany() ); } public function ownsParagraphTemplate(ParagraphTemplate $paragraphTemplate) { return $this->canManageCompany($paragraphTemplate->getCompany()) || $this->canManageParagraphTemplates( $paragraphTemplate->getCompany() ); } public function getManagedNotOwnedCompanies() { $that = $this; return $this->managedCompanies->filter(function(Company $company) use ($that) { return !$company->getOwner()->isSameAs($that); }); } }
{ "content_hash": "d106077d74aa9d1d4d2f2b25e87a41f3", "timestamp": "", "source": "github", "line_count": 750, "max_line_length": 128, "avg_line_length": 22.697333333333333, "alnum_prop": 0.5845033190389473, "repo_name": "disider/invox", "id": "55bfc7867909bada95ce252a7e954be60970c887", "size": "17216", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Entity/User.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1620694" }, { "name": "Gherkin", "bytes": "372957" }, { "name": "HTML", "bytes": "8151016" }, { "name": "JavaScript", "bytes": "8662911" }, { "name": "Makefile", "bytes": "266" }, { "name": "PHP", "bytes": "1018100" }, { "name": "Ruby", "bytes": "322" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <resources> <string name="activity">Aktiivsus</string> <string name="hostedALiveStream">Tegi otseülekannet</string> <plurals name="supportedNbMonths"> <item quantity="one">Toeta Lichess.org\'i %1$s kuu %2$s</item> <item quantity="other">Toeta Lichess.org\'i %1$s kuud %2$s</item> </plurals> <plurals name="practicedNbPositions"> <item quantity="one">Harjutas %1$s seisu teemas %2$s</item> <item quantity="other">Harjutas %1$s seisu teemas %2$s</item> </plurals> <plurals name="solvedNbPuzzles"> <item quantity="one">Lahendas %s taktikalise pusle</item> <item quantity="other">Lahendas %s taktikalist puslet</item> </plurals> <plurals name="playedNbGames"> <item quantity="one">Mängis %1$s %2$s mängu</item> <item quantity="other">Mängis %1$s %2$s mängu</item> </plurals> <plurals name="postedNbMessages"> <item quantity="one">Postitas %1$s sõnumi foorumis %2$s</item> <item quantity="other">Postitas %1$s sõnumit foorumis %2$s</item> </plurals> <plurals name="playedNbMoves"> <item quantity="one">Mängis %1$s käigu</item> <item quantity="other">Mängis %1$s käiku</item> </plurals> <plurals name="inNbCorrespondenceGames"> <item quantity="one">lõpetas %1$s kirjavahetusmängu</item> <item quantity="other">lõpetas %1$s kirjavahetusmängu</item> </plurals> <plurals name="completedNbGames"> <item quantity="one">Lõpetas %s kirjavahetusmängu</item> <item quantity="other">Lõpetas %s kirjavahetusmängu</item> </plurals> <plurals name="followedNbPlayers"> <item quantity="one">Hakkas jälgima %s mängijat</item> <item quantity="other">Hakkas jälgima %s mängijat</item> </plurals> <plurals name="gainedNbFollowers"> <item quantity="one">Sai %s uue jälgija</item> <item quantity="other">Sai %s uut jälgijat</item> </plurals> <plurals name="hostedNbSimuls"> <item quantity="one">Korraldas %s simultaani</item> <item quantity="other">Korraldas %s simultaani</item> </plurals> <plurals name="joinedNbSimuls"> <item quantity="one">Osales %s simultaanis</item> <item quantity="other">Osales %s simultaanis</item> </plurals> <plurals name="createdNbStudies"> <item quantity="one">Lõi %s uue õppe</item> <item quantity="other">Lõi %s uut õpet</item> </plurals> <plurals name="competedInNbTournaments"> <item quantity="one">Võistles %s turniiril</item> <item quantity="other">Võistles %s turniiril</item> </plurals> <plurals name="rankedInTournament"> <item quantity="one">Saavutas #%1$s koha (parima %2$s%% seas) %3$s mänguga turniiril %4$s</item> <item quantity="other">Saavutas #%1$s koha (parima %2$s%% seas) %3$s mänguga turniiril %4$s</item> </plurals> <plurals name="competedInNbSwissTournaments"> <item quantity="one">Võistles %s šveitsi turniiril</item> <item quantity="other">Võistles %s šveitsi turniiril</item> </plurals> <string name="rankedInSwissTournament">Saavutas #%1$s koha mängus %2$s</string> <string name="signedUp">Registreerus lehel lichess.org</string> <plurals name="joinedNbTeams"> <item quantity="one">Liitus %s rühmaga</item> <item quantity="other">Liitus %s rühmaga</item> </plurals> </resources>
{ "content_hash": "b202b2b2f34ac3a713c189926e777dc6", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 102, "avg_line_length": 43.46666666666667, "alnum_prop": 0.6895705521472393, "repo_name": "luanlv/lila", "id": "a4a4d5d6ea74202d39d57b7bf9295e79a42ac185", "size": "3300", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "translation/dest/activity/et-EE.xml", "mode": "33188", "license": "mit", "language": [ { "name": "ActionScript", "bytes": "849" }, { "name": "CSS", "bytes": "228239" }, { "name": "Cycript", "bytes": "3701" }, { "name": "Emacs Lisp", "bytes": "31342" }, { "name": "Erlang", "bytes": "19825" }, { "name": "Fancy", "bytes": "119" }, { "name": "GAP", "bytes": "11334" }, { "name": "GLSL", "bytes": "2434" }, { "name": "HTML", "bytes": "332219" }, { "name": "Hy", "bytes": "20591" }, { "name": "Io", "bytes": "4943" }, { "name": "Java", "bytes": "21183" }, { "name": "JavaScript", "bytes": "434326" }, { "name": "Makefile", "bytes": "15207" }, { "name": "Mathematica", "bytes": "18454" }, { "name": "NewLisp", "bytes": "19130" }, { "name": "OCaml", "bytes": "1709" }, { "name": "Perl6", "bytes": "19794" }, { "name": "PostScript", "bytes": "2604" }, { "name": "Python", "bytes": "1959" }, { "name": "Ruby", "bytes": "31020" }, { "name": "Scala", "bytes": "1673987" }, { "name": "Shell", "bytes": "9946" }, { "name": "Slash", "bytes": "18065" }, { "name": "Smalltalk", "bytes": "18999" }, { "name": "SystemVerilog", "bytes": "17827" } ], "symlink_target": "" }
ACCEPTED #### According to Index Fungorum #### Published in null #### Original name Biatora rhabdogena Norman ### Remarks null
{ "content_hash": "6d767c27fd67779893d8d14e09406ae9", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 25, "avg_line_length": 10, "alnum_prop": 0.7153846153846154, "repo_name": "mdoering/backbone", "id": "92c3df0eb14beb862dfcbe0b4357efe0778cf25b", "size": "187", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Fungi/Ascomycota/Lecanoromycetes/Lecanorales/Pilocarpaceae/Micarea/Micarea rhabdogena/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
ACCEPTED #### According to Interim Register of Marine and Nonmarine Genera #### Published in null #### Original name null ### Remarks null
{ "content_hash": "36ce25b67d5f23772c3f3f124df58c01", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 47, "avg_line_length": 10.923076923076923, "alnum_prop": 0.7183098591549296, "repo_name": "mdoering/backbone", "id": "2e16c55020e439fad97fd17643d52af56a9fe07c", "size": "228", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Protozoa/Acritarcha/Polygonium/Polygonium clarum/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
 <!DOCTYPE HTML> <!-- Solid State by HTML5 UP html5up.net | @ajlkn Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) --> <html> <head> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-72755780-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-72755780-1'); </script> <script src="/assets/js/redirectNow.js"></script> <title>Richard Kingston - IMS Discovery - Week 3</title> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <!--[if lte IE 8]><script src="/assets/js/ie/html5shiv.js"></script><![endif]--> <link rel="stylesheet" href="/assets/sass/main.css" /> <link rel="stylesheet" href="/assets/css/override.css" /> <!--[if lte IE 9]><link rel="stylesheet" href="/assets/sass/ie9.css" /><![endif]--> <!--[if lte IE 8]><link rel="stylesheet" href="/assets/sass/ie8.css" /><![endif]--> </head> <body> <!-- Page Wrapper --> <div id="page-wrapper"> <!-- Header --> <header id="header"> <h1><a href="/">Richard Kingston</a></h1> <nav> <a href="#menu">Menu</a> </nav> </header> <!-- Menu --> <nav id="menu"> <div class="inner"> <h2>Menu</h2> <ul class="links"> <li><a href="/posts">Archive</a></li> <li><a href="/tags">Tags</a></li> <li><a href="/about">About Me</a></li> </ul> <a href="#" class="close">Close</a> </div> </nav> <section id="banner"> <div class="inner"> <h2>IMS Discovery - Week 3</h2> <p>We&#x27;ve drafted requirements for delivery support and have taken advice from MHCLG on getting our project started.</p> <p><em>Published on 27 September 2019</em></p> <a role="button" href="/tags/IMS-Discovery" class="button small">IMS Discovery</a> <a role="button" href="/tags/Income-Management" class="button small">Income Management</a> <a role="button" href="/tags/Local-Digital-Fund" class="button small">Local Digital Fund</a> </div> </section> <!-- Main --> <section id="wrapper"> <section class="wrapper style2"> <div class="inner"> <p>This page has moved. If you are not redirected automatically, click the link below:</p> <ul> <li><a id="redirectUrl" href="https://www.localgovims.digital/blog/ims-discovery-week-3/">IMS Discovery - Week 3</a></li> </ul> </div> </section> </section> <!-- Footer --> <footer id="footer"> <div class="inner"> <section> <h2>Feeds</h2> <ul class="actions"> <li><a href="/feed.rss" class="button small"><i class="fa fa-rss"></i> RSS Feed</a></li> <li><a href="/feed.atom" class="button small"><i class="fa fa-rss"></i> Atom Feed</a></li> </ul> </section> <section> </section> <ul class="copyright"> <li>Copyright © 2020</li> <li>Design: <a href="http://html5up.net">HTML5 UP</a></li> <li><a href="https://wyam.io">Generated by Wyam</a></li> </ul> </div> </footer> </div> <!-- Scripts --> <script src="/assets/js/skel.min.js"></script> <script src="/assets/js/jquery.min.js"></script> <script src="/assets/js/jquery.scrollex.min.js"></script> <script src="/assets/js/util.js"></script> <!--[if lte IE 8]><script src="/assets/js/ie/respond.min.js"></script><![endif]--> <script src="/assets/js/main.js"></script> <script src="/assets/js/redirectNow.js"></script> <script type="text/javascript">redirectNow();</script> </body> </html>
{ "content_hash": "0299a696b00298ff6af291e24044517d", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 132, "avg_line_length": 31.727272727272727, "alnum_prop": 0.562125553529565, "repo_name": "kingstonrichard/kingstonrichard.github.io", "id": "3d4165ea002b32c7f8e7bf1fae2ed1c7e97480b1", "size": "3842", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "posts/ims-discovery-week-3.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "102216" }, { "name": "HTML", "bytes": "533560" }, { "name": "JavaScript", "bytes": "14890" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_05) on Thu Dec 11 10:42:19 EST 2014 --> <title>Uses of Class com.compsci408.androidrx.R.menu</title> <meta name="date" content="2014-12-11"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class com.compsci408.androidrx.R.menu"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../com/compsci408/androidrx/R.menu.html" title="class in com.compsci408.androidrx">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/compsci408/androidrx/class-use/R.menu.html" target="_top">Frames</a></li> <li><a href="R.menu.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class com.compsci408.androidrx.R.menu" class="title">Uses of Class<br>com.compsci408.androidrx.R.menu</h2> </div> <div class="classUseContainer">No usage of com.compsci408.androidrx.R.menu</div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../com/compsci408/androidrx/R.menu.html" title="class in com.compsci408.androidrx">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/compsci408/androidrx/class-use/R.menu.html" target="_top">Frames</a></li> <li><a href="R.menu.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "content_hash": "8aa55856edbd3fd09ac3e05ecd6c9500", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 125, "avg_line_length": 34.45967741935484, "alnum_prop": 0.6115141586707231, "repo_name": "duke-compsci408-fall2014/GlassRx", "id": "428cd9aa5087be67d78bf867dadc39a0695be705", "size": "4273", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "AndroidRx/doc/com/compsci408/androidrx/class-use/R.menu.html", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "1" }, { "name": "C++", "bytes": "1" }, { "name": "CSS", "bytes": "52380" }, { "name": "Java", "bytes": "310827" }, { "name": "JavaScript", "bytes": "3368" } ], "symlink_target": "" }
package model //! conf.redis import ( "errors" "fmt" "strings" "github.com/ezbuy/redis-orm/orm" ) var ( _redis_store *orm.RedisStore ) const ( PAIR = "pair" HASH = "hash" SET = "set" ZSET = "zset" GEO = "geo" LIST = "list" ERROR_SPLIT = "#-#" ) type Object interface { GetClassName() string GetStoreType() string GetPrimaryName() string GetIndexes() []string } type RedisConfig struct { Host string Port int Password string } func RedisSetUp(cf *RedisConfig) { store, err := orm.NewRedisClient(cf.Host, cf.Port, cf.Password, 0) if err != nil { panic(err) } _redis_store = store } func Redis() *orm.RedisStore { return _redis_store } // 处理error,把一个error变成error数组 func SplitError(err error) []error { ss := strings.Split(err.Error(), ERROR_SPLIT) result := make([]error, len(ss)) for i, s := range ss { result[i] = errors.New(s) } return result } //! util functions func keyOfObject(obj Object, keys ...string) string { if len(keys) > 0 { suffix := strings.Join(keys, ":") return fmt.Sprintf("%s:%s:object:%s", obj.GetStoreType(), obj.GetClassName(), suffix) } return keyOfClass(obj) } func keyOfClass(obj Object, keys ...string) string { switch obj.GetStoreType() { case PAIR: return pairOfClass(obj.GetClassName(), keys...) case HASH: return hashOfClass(obj.GetClassName(), keys...) case SET: return setOfClass(obj.GetClassName(), keys...) case ZSET: return zsetOfClass(obj.GetClassName(), keys...) case GEO: return geoOfClass(obj.GetClassName(), keys...) case LIST: return listOfClass(obj.GetClassName(), keys...) } return "" } func pairOfClass(class string, keys ...string) string { if len(keys) > 0 { suffix := strings.Join(keys, ":") return fmt.Sprintf("%s:%s:%s", PAIR, class, suffix) } return fmt.Sprintf("%s:%s", PAIR, class) } func hashOfClass(class string, keys ...string) string { if len(keys) > 0 { suffix := strings.Join(keys, ":") return fmt.Sprintf("%s:%s:%s", HASH, class, suffix) } return fmt.Sprintf("%s:%s", HASH, class) } func setOfClass(class string, keys ...string) string { if len(keys) > 0 { suffix := strings.Join(keys, ":") return fmt.Sprintf("%s:%s:%s", SET, class, suffix) } return fmt.Sprintf("%s:%s", SET, class) } func zsetOfClass(class string, keys ...string) string { if len(keys) > 0 { suffix := strings.Join(keys, ":") return fmt.Sprintf("%s:%s:%s", ZSET, class, suffix) } return fmt.Sprintf("%s:%s", ZSET, class) } func geoOfClass(class string, keys ...string) string { if len(keys) > 0 { suffix := strings.Join(keys, ":") return fmt.Sprintf("%s:%s:%s", GEO, class, suffix) } return fmt.Sprintf("%s:%s", GEO, class) } func listOfClass(class string, keys ...string) string { if len(keys) > 0 { suffix := strings.Join(keys, ":") return fmt.Sprintf("%s:%s:%s", LIST, class, suffix) } return fmt.Sprintf("%s:%s", LIST, class) }
{ "content_hash": "a69ead9a1d5aaea945ee5722a572b9e0", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 87, "avg_line_length": 21.40740740740741, "alnum_prop": 0.6477508650519032, "repo_name": "ezbuy/redis-orm", "id": "9659f4b4e2557dfd9b1f37d3f94110570ed3bb94", "size": "2910", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "example/model/gen.conf.redis.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Go", "bytes": "317115" }, { "name": "Makefile", "bytes": "507" } ], "symlink_target": "" }
var BikeService = require("bikes/bikeService"); var Logger = require("utils/logger"); var BikeController = function() { this.logAllBikes = function() { var bikes = BikeService.get(); Logger.logList(bikes); }; this.logSingleBike = function(bikeName) { var bike = BikeService.find(bikeName); Logger.logSingle(bike); }; }; /* At my company, we use play framework that compile html pages. This pages receives params from server and sends to javascript functions/modules I did this workaround to access BikeController in html script tag. :( */ window.BikeController = BikeController; module.exports = BikeController;
{ "content_hash": "8660ba40c4cafe61e3b3b355495ea3e6", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 82, "avg_line_length": 27.958333333333332, "alnum_prop": 0.6974664679582713, "repo_name": "lucamaral/webpack-sample", "id": "d8c309e1c8b068b6fee1d9f8b1b70d9ffbf5360b", "size": "671", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/bikes/bikeController.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "734" }, { "name": "JavaScript", "bytes": "4931" } ], "symlink_target": "" }
import base64 import hashlib from datetime import datetime from lmap import * import config def ldap_connect(): ld = ldap.ldap(config.LDAP.URI) ld.simple_bind(config.LDAP.BINDDN, config.LDAP.BINDPW) return lmap.lmap(dn=config.LDAP.BASE, ldap=ld), ld def pwcheck(record, pw): if not record.startswith('{SSHA}'): return record == pw bd = base64.b64decode(bytearray(record[6:], 'UTF-8')) hashv = bd[:20] salt = bd[20:] newhashv = hashlib.sha1(bytearray(pw, 'UTF-8')+salt).digest() return hashv == newhashv def authenticate(uid, pin): lm, ld = ldap_connect() try: user = lm(config.LDAP.USERBASE).search(config.LDAP.ACCESS_FILTER.format(uid))[0] username = user[config.LDAP.UIDFIELD] if pwcheck(user[config.LDAP.PINFIELD], pin): print(datetime.now(), 'Valid combination for user "%s". Opening lock' % username) ld.close() return True except Exception as e: print(datetime.now(), 'Invalid user/pin:', uid, '('+str(e)+')') ld.close() return False numbuf = [] if __name__ == "__main__": print(pwcheck('{SSHA}c8pLDYbSkF2jBAKxxa67nY7NYkdQXiPNFzzRso9FRZI=', '1234'))
{ "content_hash": "e86c1b2a44e8bcd5f7f0d8c042889306", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 84, "avg_line_length": 25.022727272727273, "alnum_prop": 0.6930063578564941, "repo_name": "c-base/raspberrylock", "id": "b5277bba56ae34b4aeaae503898123946c4dd065", "size": "1149", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ldap_interface.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Python", "bytes": "28575" }, { "name": "Shell", "bytes": "287" } ], "symlink_target": "" }
package com.clockwise.tworcy.model.account; import java.util.List; import javax.servlet.http.HttpServletRequest; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.stereotype.Service; public @Service interface AccountService extends UserDetailsService { void update(Account player); void delete(Integer id); List<Account> getList(Integer count, Integer offset); Account get(Integer id); Account get(String name); Account getLogged(); boolean isLogged(); Account login(String name, String password, HttpServletRequest request) throws Exception; Account register(String name, String password) throws Exception; void logout(); }
{ "content_hash": "601b2d05898e18860fe05b56247410e5", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 90, "avg_line_length": 28.958333333333332, "alnum_prop": 0.8014388489208633, "repo_name": "ghandhikus/TworcyGierStrona", "id": "0bcd329fd18b009dc1c48dae5c0640e479c9397e", "size": "695", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/clockwise/tworcy/model/account/AccountService.java", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "274" }, { "name": "CSS", "bytes": "13128" }, { "name": "HTML", "bytes": "49823" }, { "name": "Java", "bytes": "255218" }, { "name": "JavaScript", "bytes": "325480" } ], "symlink_target": "" }
from .conftest import load class TestStatic: def test_get_index(self, client): response = client.get("/") assert 200 == response.status_code assert 'href="/api"' in load(response, as_json=False)
{ "content_hash": "b3b3faf8e311f76eb1417653d14a0a3c", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 61, "avg_line_length": 22.7, "alnum_prop": 0.6343612334801763, "repo_name": "joshfriend/memegen", "id": "1b6aa0b4a6fb56fc8f543dc51f5618ddae53c6e1", "size": "306", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/test_routes_static.py", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "8500" }, { "name": "HTML", "bytes": "20826" }, { "name": "JavaScript", "bytes": "1977" }, { "name": "Makefile", "bytes": "8100" }, { "name": "Python", "bytes": "72631" }, { "name": "Shell", "bytes": "199" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "3e77a1f731e541fcf4151a51a3805acb", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "358d5a91e80c7aa0c0fa0805abe454e54293a40d", "size": "191", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Rubiaceae/Coffea/Coffea liberica/ Syn. Coffea abeokutae sphaerocarpa/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="description" content="Get a Scholarship form the world's biggest scholarship search engine."> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Skolaly - Get a Scholarship</title> <!-- Material Design Lite --> <script type="text/javascript" src="@{'/public/javascripts/mdl/material.min.js'}"></script> <link rel="stylesheet" href="@{'/public/javascripts/mdl/material.min.css'}"> <!-- Material Design icon font --> <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> <link rel="stylesheet" type="text/css" href="@{'/public/stylesheets/main.css'}"> <link rel="shortcut icon" type="image/png" href="@{'/public/images/favicon.png'}"> <style> a { color: #2196F3; } #page-content p { font-size: 1.5em; line-height: 2em; max-width: 300px; text-align: center; margin: auto; } </style> </head> <body> <div class="demo-layout-transparent mdl-layout mdl-js-layout mdl-layout--fixed-header"> <header class="mdl-layout__header mdl-layout__header--transparent"> <div class="mdl-layout__header-row"> <!-- Title --> <span class="mdl-layout-title"><a href="@{Application.index()}"><img src="@{'/public/images/header_logo.png'}" /></a></span> <!-- Add spacer, to align navigation to the right --> <div class="mdl-layout-spacer"> </div> <!-- Navigation --> <nav class="mdl-navigation"> <a class="mdl-navigation__link" href="@{Application.about()}">About</a> <a class="mdl-navigation__link" href="@{Application.terms()}">Terms</a> <a class="mdl-navigation__link" href="@{Application.privacy()}">Privacy and Cookies</a> </nav> </div> </header> <main class="mdl-layout__content"> <div id="page-content"> <p> Skolaly is an open source educational opportunities (scholarships, conferences, competitions, etc) search engine built by <a href="https://twitter.com/tahteche">@tahteche</a> and <a href="https://twitter.com/ffringel">@ffringel</a> to help students find scholarship opportunities for free. </p> <p> Contact us on twitter: <a href="https://twitter.com/craniumdev">@craniumdev</a> </p> <p> The project is still in beta so expect many improvements to come soon. </p> </div> </main> </div> </body> </html>
{ "content_hash": "9f490f23dcad484053dfe6e29563a11c", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 313, "avg_line_length": 48.36507936507937, "alnum_prop": 0.5251066622907778, "repo_name": "CraniumDev/Skolaly", "id": "17b341feb7382be6ab485aa9bc252d942daa8e1e", "size": "3047", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/views/Application/about.html", "mode": "33261", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "304557" }, { "name": "HTML", "bytes": "71777" }, { "name": "Java", "bytes": "5005" }, { "name": "JavaScript", "bytes": "141050" } ], "symlink_target": "" }
#ifndef _CHARMAP_DIR_H #define _CHARMAP_DIR_H 1 /* The data type of a charmap directory being traversed. */ typedef struct charmap_dir CHARMAP_DIR; /* Starts a charmap directory traversal. Returns a CHARMAP_DIR, or NULL if the directory doesn't exist. */ extern CHARMAP_DIR *charmap_opendir (const char *directory); /* Reads the next directory entry. Returns its charmap name, or NULL if past the last entry or upon error. The storage returned may be overwritten by a later charmap_readdir call on the same CHARMAP_DIR. */ extern const char *charmap_readdir (CHARMAP_DIR *dir); /* Finishes a charmap directory traversal, and frees the resources attached to the CHARMAP_DIR. */ extern int charmap_closedir (CHARMAP_DIR *dir); /* Returns a NULL terminated list of alias names of a charmap. */ extern char **charmap_aliases (const char *directory, const char *name); /* Frees an alias list returned by charmap_aliases. */ extern void charmap_free_aliases (char **aliases); /* Opens a charmap for reading, given its name (not an alias name). */ extern FILE *charmap_open (const char *directory, const char *name); #endif /* _CHARMAP_DIR_H */
{ "content_hash": "25fd54ff3be331329522ed2b4f040746", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 74, "avg_line_length": 36.5625, "alnum_prop": 0.7324786324786324, "repo_name": "endplay/omniplay", "id": "028f926b0a7cc23a7294b335903660807aea05fe", "size": "1979", "binary": false, "copies": "24", "ref": "refs/heads/master", "path": "eglibc-2.15/locale/programs/charmap-dir.h", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "ASP", "bytes": "4528" }, { "name": "Assembly", "bytes": "17491433" }, { "name": "Awk", "bytes": "79791" }, { "name": "Batchfile", "bytes": "903" }, { "name": "C", "bytes": "444772157" }, { "name": "C++", "bytes": "10631343" }, { "name": "GDB", "bytes": "17950" }, { "name": "HTML", "bytes": "47935" }, { "name": "Java", "bytes": "2193" }, { "name": "Lex", "bytes": "44513" }, { "name": "M4", "bytes": "9029" }, { "name": "Makefile", "bytes": "1758605" }, { "name": "Objective-C", "bytes": "5278898" }, { "name": "Perl", "bytes": "649746" }, { "name": "Perl 6", "bytes": "1101" }, { "name": "Python", "bytes": "585875" }, { "name": "RPC", "bytes": "97869" }, { "name": "Roff", "bytes": "2522798" }, { "name": "Scilab", "bytes": "21433" }, { "name": "Shell", "bytes": "426172" }, { "name": "TeX", "bytes": "283872" }, { "name": "UnrealScript", "bytes": "6143" }, { "name": "XS", "bytes": "1240" }, { "name": "Yacc", "bytes": "93190" }, { "name": "sed", "bytes": "9202" } ], "symlink_target": "" }
bazel build //pipeline/samples/bazel/java:hello-world bazel build //pipeline/samples/bazel/java:hello-resources ##### Run: bazel run //pipeline/samples/bazel/java:hello-world bazel run //pipeline/samples/bazel/java:hello-resources ##### Test: ###### All: bazel test //pipeline/samples/bazel/java/... ###### Specific: bazel test //pipeline/samples/bazel/java:hello bazel test //pipeline/samples/bazel/java:custom
{ "content_hash": "c97cab332d3f961f80a35bc88368929f", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 61, "avg_line_length": 25.27777777777778, "alnum_prop": 0.676923076923077, "repo_name": "blackducksoftware/hub-detect", "id": "84a1c55a00bfef722a7b8bd904866a53717e7e4a", "size": "491", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "hub-detect/src/test/resources/bazel/multiLevel/java/README.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "FreeMarker", "bytes": "3602" }, { "name": "Java", "bytes": "1869630" }, { "name": "Python", "bytes": "7144" }, { "name": "Ruby", "bytes": "4029" }, { "name": "Shell", "bytes": "10052" } ], "symlink_target": "" }
/** * Tangyoon (NPC 1092000) * The Nautilus: Cafeteria (Map 120000103) * * Small talk. * * @author GoldenKevin (content from KiniroMS r227) */ npc.say("The stable is off-limits to everyone else, and I'm afraid I can't let you go there as well.");
{ "content_hash": "e487a90c0f5951f5bfea84a49302bf0f", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 103, "avg_line_length": 21.333333333333332, "alnum_prop": 0.6796875, "repo_name": "Tagette/WvsNpcSimulator", "id": "c4812dd4fe6efd3cc21ca15bf19f571d51baaae1", "size": "1026", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "JavaScript Npcs/nautil_cow.js", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "94350" }, { "name": "JavaScript", "bytes": "670266" } ], "symlink_target": "" }
package com.devicehive.service; import com.devicehive.auth.HiveAuthentication; import com.devicehive.auth.HivePrincipal; import com.devicehive.model.FilterEntity; import com.devicehive.model.eventbus.Filter; import com.devicehive.model.query.PluginReqisterQuery; import com.devicehive.model.rpc.ListDeviceTypeRequest; import com.devicehive.model.rpc.ListNetworkRequest; import com.devicehive.model.rpc.PluginSubscribeRequest; import com.devicehive.vo.DeviceTypeVO; import com.devicehive.vo.DeviceVO; import com.devicehive.vo.NetworkVO; import com.devicehive.vo.PluginVO; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Service; import java.util.Collections; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; import static com.devicehive.model.converters.SetHelper.toLongSet; import static com.devicehive.model.converters.SetHelper.toStringSet; @Service public class FilterService { private static final Logger logger = LoggerFactory.getLogger(FilterService.class); private final BaseFilterService filterService; @Autowired public FilterService(BaseFilterService filterService) { this.filterService = filterService; } public PluginSubscribeRequest createPluginSubscribeRequest(String filter) { FilterEntity filterEntity = new FilterEntity(filter); PluginSubscribeRequest request = new PluginSubscribeRequest(); request.setFilters(createFilters(filterEntity)); request.setReturnCommands(filterEntity.isReturnCommands()); request.setReturnUpdatedCommands(filterEntity.isReturnUpdatedCommands()); request.setReturnNotifications(filterEntity.isReturnNotifications()); return request; } private Set<Filter> createFilters(FilterEntity filterEntity) { final HiveAuthentication authentication = (HiveAuthentication) SecurityContextHolder.getContext().getAuthentication(); return filterService.getFilterList(filterEntity.getDeviceId(), toLongSet(filterEntity.getNetworkIds()), toLongSet(filterEntity.getDeviceTypeIds()), null, toStringSet(filterEntity.getNames()), authentication); } }
{ "content_hash": "a3f384467205cd563bb611987844fecc", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 126, "avg_line_length": 38.483870967741936, "alnum_prop": 0.7954735959765298, "repo_name": "devicehive/devicehive-java-server", "id": "1c8a119465a478c529ae6679afdcd0f50151954e", "size": "3040", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "devicehive-plugin/src/main/java/com/devicehive/service/FilterService.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "3007" }, { "name": "HTML", "bytes": "16626" }, { "name": "Java", "bytes": "1519376" }, { "name": "PLpgSQL", "bytes": "8639" }, { "name": "Shell", "bytes": "12940" } ], "symlink_target": "" }
package Agua::Common::App; use Moose::Role; use Moose::Util::TypeConstraints; =head2 PACKAGE Agua::Common::App PURPOSE APPLICATION METHODS FOR Agua::Common =cut use Data::Dumper; sub getAppHeadings { my $self = shift; $self->logDebug(""); #### VALIDATE my $username = $self->username(); $self->logError("User $username not validated") and return unless $self->validate($username); my $headings = { leftPane => ["Parameters", "App", "Packages"], middlePane => ["Packages", "Parameters", "App"], rightPane => ["App", "Packages", "Parameters"] }; $self->logDebug("headings", $headings); return $headings; } sub getApps { my $self = shift; my $username = $self->username(); my $agua = $self->conf()->getKey("agua", "AGUAUSER"); my $query = qq{SELECT * FROM app WHERE owner = '$username' OR owner='$agua' ORDER BY owner, package, type, name}; $self->logDebug("query", $query); my $apps = $self->db()->queryhasharray($query) || []; if ( not $self->isAdminUser($username)) { my $adminapps = $self->getAdminApps(); @$apps = (@$apps, @$adminapps); } return $apps; } sub getAdminApps { #### GET ONLY 'PUBLIC' APPS OWNED BY ADMIN USER my $self = shift; $self->logDebug(""); #### GET ADMIN USER'S PUBLIC APPS my $admin = $self->conf()->getKey("agua", 'ADMINUSER'); my $query = qq{SELECT app.* FROM app, package WHERE app.owner = '$admin' AND app.owner = package.username AND package.privacy='public' ORDER BY package, type, name}; my $adminapps = $self->db()->queryhasharray($query) || []; $self->logDebug("adminapps", $adminapps); return $adminapps; } sub deleteApp { =head2 SUBROUTINE: deleteApp PURPOSE: VALIDATE THE admin USER THEN DELETE AN APPLICATION =cut my $self = shift; my $data = $self->json()->{data}; $data->{owner} = $self->json()->{username}; $self->logDebug("data", $data); my $success = $self->_removeApp($data); return if not defined $success; $self->logStatus("Deleted application $data->{name}") if $success; $self->logError("Could not delete application $data->{name} from the apps table") if not $success; return; } sub _removeApp { my $self = shift; my $data = shift; #$self->logDebug("data", $data); #$self->logDebug("self", $self); my $table = "app"; my $required = ["owner", "package", "name", "type"]; #### CHECK REQUIRED FIELDS ARE DEFINED my $notdefined = $self->db()->notDefined($data, $required); $self->logDebug("notdefined", $notdefined); $self->logError("undefined values: @$notdefined") and return if @$notdefined; #### REMOVE return $self->_removeFromTable($table, $data, $required); } sub saveApp { =head2 SUBROUTINE: saveApp PURPOSE: SAVE APPLICATION INFORMATION =cut my $self = shift; #### VALIDATE my $username = $self->username(); $self->logError("User $username not validated") and return unless $self->validate($username); #### GET DATA FOR PRIMARY KEYS FOR apps TABLE: #### name, type, location my $json = $self->json(); $self->logDebug("json", $json); my $data = $json->{data}; my $name = $data->{name}; my $type = $data->{type}; my $location = $data->{location}; $self->logDebug("name", $name); $self->logDebug("type", $type); $self->logDebug("location", $location); #### CHECK INPUTS $self->logError("Name $name not defined or empty") and return if not defined $name or $name =~ /^\s*$/; $self->logError("Name $type not defined or empty") and return if not defined $type or $type =~ /^\s*$/; $self->logError("Name $location not defined or empty") and return if not defined $location or $location =~ /^\s*$/; my $success = $self->_saveApp($data); $self->logDebug("success", $success); $self->logError("Could not insert application $name into app table ") and return if not $success; $self->logStatus("Inserted application $name into app table"); return; } sub _saveApp { my $self = shift; my $data = shift; $self->logDebug("data", $data); #### GET APP IF ALREADY EXISTS my $table = "app"; my $fields = ["owner", "package", "name", "type"]; my $where = $self->db()->where($data, $fields); my $query = qq{SELECT * FROM $table $where}; $self->logDebug("query", $query); my $app = $self->db()->queryhash($query); $self->logDebug("app", $app); #### REMOVE APP IF EXISTS if ( defined $app ) { $self->_removeApp($data); #### ... AND COPY OVER DATA ONTO APP foreach my $key ( keys %$data ) { $app->{$key} = $data->{$key}; } $self->logDebug("app", $app); #### ADD APP MODIFIED WITH DATA my $success = $self->_addApp($app); return if not defined $success; } #### ADD DATA return $self->_addApp($data); } sub _addApp { my $self = shift; my $data = shift; $self->logNote("data", $data); my $owner = $data->{owner}; my $name = $data->{name}; #### CHECK REQUIRED FIELDS ARE DEFINED my $table = "app"; my $required_fields = ["owner", "package", "name", "type"]; my $not_defined = $self->db()->notDefined($data, $required_fields); $self->logError("undefined values: @$not_defined") and return if @$not_defined; #### DO ADD return $self->_addToTable($table, $data, $required_fields); } sub saveParameter { =head2 SUBROUTINE: saveParameter PURPOSE: VALIDATE THE admin USER THEN SAVE APPLICATION INFORMATION =cut my $self = shift; $self->logDebug("Admin::saveParameter()"); my $json = $self->json(); #### GET DATA FOR PRIMARY KEYS FOR parameters TABLE: my $username = $self->username(); my $data = $json->{data}; my $appname = $data->{appname}; my $name = $data->{name}; my $paramtype = $data->{paramtype}; #### SET owner AS USERNAME IN data $data->{owner} = $username; #### CHECK INPUTS $self->logError("appname not defined or empty") and return if not defined $appname or $appname =~ /^\s*$/; $self->logError("name not defined or empty") and return if not defined $name or $name =~ /^\s*$/; $self->logError("paramtype not defined or empty") and return if not defined $paramtype or $paramtype =~ /^\s*$/; $self->logDebug("name", $name); $self->logDebug("paramtype", $paramtype); $self->logDebug("appname", $appname); my $success = $self->_addParameter($data); if ( $success != 1 ) { $self->logError("Could not insert parameter $name into app $appname"); } else { $self->logStatus("Inserted parameter $name into app $appname"); } return; } sub _addParameter { my $self = shift; my $data = shift; my $username = $data->{username}; my $appname = $data->{appname}; my $name = $data->{name}; my $table = "parameter"; my $required = ["owner", "appname", "name", "paramtype"]; my $updates = ["version", "status"]; #### REMOVE IF EXISTS ALREADY my $success = $self->_removeFromTable($table, $data, $required); $self->logNote("Deleted app success") if $success; #### INSERT my $fields = $self->db()->fields('parameter'); my $insert = $self->db()->insert($data, $fields); my $query = qq{INSERT INTO $table VALUES ($insert)}; $self->logNote("query", $query); return $self->db()->do($query); } sub deleteParameter { =head2 SUBROUTINE: deleteParameter PURPOSE: VALIDATE THE admin USER THEN DELETE AN APPLICATION =cut my $self = shift; #### GET DATA my $json = $self->json(); my $data = $json->{data}; #### REMOVE my $success = $self->_removeParameter($data); $self->logStatus("Deleted parameter $data->{name}") and return if defined $success and $success; $self->logError("Could not delete parameter $data->{name}"); return; } sub _removeParameter { my $self = shift; my $data = shift; $self->logDebug("data", $data); my $table = "parameter"; my $required_fields = ["owner", "name", "appname", "paramtype"]; #### CHECK REQUIRED FIELDS ARE DEFINED my $not_defined = $self->db()->notDefined($data, $required_fields); $self->logError("undefined values: @$not_defined") and return if @$not_defined; #### REMOVE IF EXISTS ALREADY $self->_removeFromTable($table, $data, $required_fields); } 1;
{ "content_hash": "460e85ab156cbc67cb46b6a3ed269f75", "timestamp": "", "source": "github", "line_count": 325, "max_line_length": 116, "avg_line_length": 24.944615384615386, "alnum_prop": 0.6263722708770199, "repo_name": "agua/agua", "id": "8a5a7ba33ab684b28617d75d8f5cfc3268a3eefb", "size": "8107", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/Agua/Common/App.pm", "mode": "33188", "license": "mit", "language": [ { "name": "ActionScript", "bytes": "21071" }, { "name": "C", "bytes": "929361" }, { "name": "C++", "bytes": "47947" }, { "name": "CSS", "bytes": "3453393" }, { "name": "Java", "bytes": "137781" }, { "name": "JavaScript", "bytes": "32393155" }, { "name": "Lua", "bytes": "23713" }, { "name": "PHP", "bytes": "616960" }, { "name": "Perl", "bytes": "3453598" }, { "name": "Puppet", "bytes": "4423" }, { "name": "Python", "bytes": "60419" }, { "name": "Ruby", "bytes": "1521" }, { "name": "Shell", "bytes": "44467" }, { "name": "TeX", "bytes": "4217" }, { "name": "XQuery", "bytes": "799" }, { "name": "XSLT", "bytes": "104131" } ], "symlink_target": "" }
package com.ljz.base.widget.tabhost; import android.content.Context; import android.content.res.TypedArray; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; import android.widget.LinearLayout; import android.widget.TabHost; import android.widget.TabWidget; import java.util.ArrayList; /** * 作者: lujianzhao * 创建时间: 2016/05/17 20:19 * 描述: */ public class FragmentTabHost extends TabHost implements TabHost.OnTabChangeListener { private final ArrayList<TabInfo> mTabs = new ArrayList<TabInfo>(); private FrameLayout mRealTabContent; private Context mContext; private FragmentManager mFragmentManager; private int mContainerId; private OnTabChangeListener mOnTabChangeListener; private TabInfo mLastTab; private boolean mAttached; static final class TabInfo { private final String tag; private final Class<?> clss; private final Bundle args; private Fragment fragment; TabInfo(String _tag, Class<?> _class, Bundle _args) { tag = _tag; clss = _class; args = _args; } } static class DummyTabFactory implements TabContentFactory { private final Context mContext; public DummyTabFactory(Context context) { mContext = context; } @Override public View createTabContent(String tag) { View v = new View(mContext); v.setMinimumWidth(0); v.setMinimumHeight(0); return v; } } static class SavedState extends BaseSavedState { String curTab; SavedState(Parcelable superState) { super(superState); } private SavedState(Parcel in) { super(in); curTab = in.readString(); } @Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeString(curTab); } @Override public String toString() { return "FragmentTabHost.SavedState{" + Integer.toHexString(System.identityHashCode(this)) + " curTab=" + curTab + "}"; } public static final Creator<SavedState> CREATOR = new Creator<SavedState>() { public SavedState createFromParcel(Parcel in) { return new SavedState(in); } public SavedState[] newArray(int size) { return new SavedState[size]; } }; } public FragmentTabHost(Context context) { // Note that we call through to the version that takes an AttributeSet, // because the simple Context construct can result in a broken object! super(context, null); initFragmentTabHost(context, null); } public FragmentTabHost(Context context, AttributeSet attrs) { super(context, attrs); initFragmentTabHost(context, attrs); } private void initFragmentTabHost(Context context, AttributeSet attrs) { TypedArray a = context.obtainStyledAttributes(attrs, new int[]{android.R.attr.inflatedId}, 0, 0); mContainerId = a.getResourceId(0, 0); a.recycle(); super.setOnTabChangedListener(this); } private void ensureHierarchy(Context context) { // If owner hasn't made its own view hierarchy, then as a convenience // we will construct a standard one here. if (findViewById(android.R.id.tabs) == null) { LinearLayout ll = new LinearLayout(context); ll.setOrientation(LinearLayout.VERTICAL); addView(ll, new LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); TabWidget tw = new TabWidget(context); tw.setId(android.R.id.tabs); tw.setOrientation(TabWidget.HORIZONTAL); ll.addView(tw, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, 0)); FrameLayout fl = new FrameLayout(context); fl.setId(android.R.id.tabcontent); ll.addView(fl, new LinearLayout.LayoutParams(0, 0, 0)); mRealTabContent = fl = new FrameLayout(context); mRealTabContent.setId(mContainerId); ll.addView(fl, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, 0, 1)); } } /** * @deprecated Don't call the original TabHost setup, you must instead * call {@link #setup(Context, FragmentManager)} or * {@link #setup(Context, FragmentManager, int)}. */ @Override @Deprecated public void setup() { throw new IllegalStateException("Must call setup() that takes a Context and FragmentManager"); } public void setup(Context context, FragmentManager manager) { ensureHierarchy(context); // Ensure views required by super.setup() super.setup(); mContext = context; mFragmentManager = manager; ensureContent(); } public void setup(Context context, FragmentManager manager, int containerId) { ensureHierarchy(context); // Ensure views required by super.setup() super.setup(); mContext = context; mFragmentManager = manager; mContainerId = containerId; ensureContent(); mRealTabContent.setId(containerId); // We must have an ID to be able to save/restore our state. If // the owner hasn't set one at this point, we will set it ourself. if (getId() == View.NO_ID) { setId(android.R.id.tabhost); } } private void ensureContent() { if (mRealTabContent == null) { mRealTabContent = (FrameLayout) findViewById(mContainerId); if (mRealTabContent == null) { throw new IllegalStateException("No tab content FrameLayout found for id " + mContainerId); } } } @Override public void setOnTabChangedListener(OnTabChangeListener l) { mOnTabChangeListener = l; } public void addTab(TabSpec tabSpec, Class<?> clss, Bundle args) { tabSpec.setContent(new DummyTabFactory(mContext)); String tag = tabSpec.getTag(); TabInfo info = new TabInfo(tag, clss, args); if (mAttached) { // If we are already attached to the window, then check to make // sure this tab's fragment is inactive if it exists. This shouldn't // normally happen. info.fragment = mFragmentManager.findFragmentByTag(tag); if (info.fragment != null && !info.fragment.isDetached()) { FragmentTransaction ft = mFragmentManager.beginTransaction(); // ft.detach(info.fragment); ft.hide(info.fragment); ft.commit(); } } mTabs.add(info); addTab(tabSpec); } @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); String currentTab = getCurrentTabTag(); // Go through all tabs and make sure their fragments match // the correct state. FragmentTransaction ft = null; for (int i = 0; i < mTabs.size(); i++) { TabInfo tab = mTabs.get(i); tab.fragment = mFragmentManager.findFragmentByTag(tab.tag); // if (tab.fragment != null && !tab.fragment.isDetached()) { if (tab.fragment != null) { if (tab.tag.equals(currentTab)) { // The fragment for this tab is already there and // active, and it is what we really want to have // as the current tab. Nothing to do. mLastTab = tab; } else { // This fragment was restored in the active state, // but is not the current tab. Deactivate it. if (ft == null) { ft = mFragmentManager.beginTransaction(); } // ft.detach(tab.fragment); ft.hide(tab.fragment); } } } // We are now ready to go. Make sure we are switched to the // correct tab. mAttached = true; ft = doTabChanged(currentTab, ft); if (ft != null) { ft.commit(); mFragmentManager.executePendingTransactions(); } } @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); mAttached = false; } @Override protected Parcelable onSaveInstanceState() { Parcelable superState = super.onSaveInstanceState(); SavedState ss = new SavedState(superState); ss.curTab = getCurrentTabTag(); return ss; } @Override protected void onRestoreInstanceState(Parcelable state) { if (!(state instanceof SavedState)) { super.onRestoreInstanceState(state); return; } SavedState ss = (SavedState) state; super.onRestoreInstanceState(ss.getSuperState()); setCurrentTabByTag(ss.curTab); } @Override public void onTabChanged(String tabId) { if (mAttached) { FragmentTransaction ft = doTabChanged(tabId, null); if (ft != null) { ft.commit(); } } if (mOnTabChangeListener != null) { mOnTabChangeListener.onTabChanged(tabId); } } private FragmentTransaction doTabChanged(String tabId, FragmentTransaction ft) { TabInfo newTab = null; for (int i = 0; i < mTabs.size(); i++) { TabInfo tab = mTabs.get(i); if (tab.tag.equals(tabId)) { newTab = tab; } } if (newTab == null) { throw new IllegalStateException("No tab known for tag " + tabId); } if (mLastTab != newTab) { if (ft == null) { ft = mFragmentManager.beginTransaction(); } if (mLastTab != null) { if (mLastTab.fragment != null) { // ft.detach(mLastTab.fragment); ft.hide(mLastTab.fragment); } } if (newTab.fragment == null) { newTab.fragment = Fragment.instantiate(mContext, newTab.clss.getName(), newTab.args); ft.add(mContainerId, newTab.fragment, newTab.tag); } else { // ft.attach(newTab.fragment); ft.show(newTab.fragment); } mLastTab = newTab; } return ft; } }
{ "content_hash": "e75174f09d10fa63f91d848d650843f7", "timestamp": "", "source": "github", "line_count": 326, "max_line_length": 134, "avg_line_length": 33.68711656441718, "alnum_prop": 0.5913312693498453, "repo_name": "MacNovice/AndroidBase", "id": "850d38dfa19fa89cac53a1ce97f57ccaafdc5098", "size": "10998", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "AndroidWidget/src/main/java/com/ljz/base/widget/tabhost/FragmentTabHost.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1419532" } ], "symlink_target": "" }
package PACKAGE // emitted by compiler, not referred to by go programs func new(typ *byte) *any func panicindex() func panicslice() func throwreturn() func throwinit() func panicwrap(string, string, string) func panic(interface{}) func recover(*int32) interface{} func printbool(bool) func printfloat(float64) func printint(int64) func printuint(uint64) func printcomplex(complex128) func printstring(string) func printpointer(any) func printiface(any) func printeface(any) func printslice(any) func printnl() func printsp() func goprintf() // filled in by compiler: int n, string, string, ... func concatstring() // filled in by compiler: Type*, int n, Slice, ... func append() func appendslice(typ *byte, x any, y []any) any func appendstr(typ *byte, x []byte, y string) []byte func cmpstring(string, string) int func eqstring(string, string) bool func intstring(int64) string func slicebytetostring([]byte) string func slicerunetostring([]rune) string func stringtoslicebyte(string) []byte func stringtoslicerune(string) []rune func stringiter(string, int) int func stringiter2(string, int) (retk int, retv rune) func copy(to any, fr any, wid uintptr) int func slicestringcopy(to any, fr any) int // interface conversions func typ2Itab(typ *byte, typ2 *byte, cache **byte) (ret *byte) func convI2E(elem any) (ret any) func convI2I(typ *byte, elem any) (ret any) func convT2E(typ *byte, elem any) (ret any) func convT2I(typ *byte, typ2 *byte, cache **byte, elem any) (ret any) // interface type assertions x.(T) func assertE2E(typ *byte, iface any) (ret any) func assertE2E2(typ *byte, iface any) (ret any, ok bool) func assertE2I(typ *byte, iface any) (ret any) func assertE2I2(typ *byte, iface any) (ret any, ok bool) func assertE2T(typ *byte, iface any) (ret any) func assertE2T2(typ *byte, iface any) (ret any, ok bool) func assertI2E(typ *byte, iface any) (ret any) func assertI2E2(typ *byte, iface any) (ret any, ok bool) func assertI2I(typ *byte, iface any) (ret any) func assertI2I2(typ *byte, iface any) (ret any, ok bool) func assertI2T(typ *byte, iface any) (ret any) func assertI2T2(typ *byte, iface any) (ret any, ok bool) func assertI2TOK(typ *byte, iface any) (ok bool) func assertE2TOK(typ *byte, iface any) (ok bool) func ifaceeq(i1 any, i2 any) (ret bool) func efaceeq(i1 any, i2 any) (ret bool) func ifacethash(i1 any) (ret uint32) func efacethash(i1 any) (ret uint32) func equal(typ *byte, x1, x2 any) (ret bool) // *byte is really *runtime.Type func makemap(mapType *byte, hint int64) (hmap map[any]any) func mapaccess1(mapType *byte, hmap map[any]any, key any) (val any) func mapaccess2(mapType *byte, hmap map[any]any, key any) (val any, pres bool) func mapassign1(mapType *byte, hmap map[any]any, key any, val any) func mapassign2(mapType *byte, hmap map[any]any, key any, val any, pres bool) func mapiterinit(mapType *byte, hmap map[any]any, hiter *any) func mapdelete(mapType *byte, hmap map[any]any, key any) func mapiternext(hiter *any) func mapiter1(hiter *any) (key any) func mapiter2(hiter *any) (key any, val any) // *byte is really *runtime.Type func makechan(chanType *byte, hint int64) (hchan chan any) func chanrecv1(chanType *byte, hchan <-chan any) (elem any) func chanrecv2(chanType *byte, hchan <-chan any) (elem any, received bool) func chansend1(chanType *byte, hchan chan<- any, elem any) func closechan(hchan any) func selectnbsend(chanType *byte, hchan chan<- any, elem any) bool func selectnbrecv(chanType *byte, elem *any, hchan <-chan any) bool func selectnbrecv2(chanType *byte, elem *any, received *bool, hchan <-chan any) bool func newselect(size int32) (sel *byte) func selectsend(sel *byte, hchan chan<- any, elem *any) (selected bool) func selectrecv(sel *byte, hchan <-chan any, elem *any) (selected bool) func selectrecv2(sel *byte, hchan <-chan any, elem *any, received *bool) (selected bool) func selectdefault(sel *byte) (selected bool) func selectgo(sel *byte) func block() func makeslice(typ *byte, nel int64, cap int64) (ary []any) func growslice(typ *byte, old []any, n int64) (ary []any) func closure() // has args, but compiler fills in func memequal(eq *bool, size uintptr, x, y *any) func memequal8(eq *bool, size uintptr, x, y *any) func memequal16(eq *bool, size uintptr, x, y *any) func memequal32(eq *bool, size uintptr, x, y *any) func memequal64(eq *bool, size uintptr, x, y *any) func memequal128(eq *bool, size uintptr, x, y *any) // only used on 32-bit func int64div(int64, int64) int64 func uint64div(uint64, uint64) uint64 func int64mod(int64, int64) int64 func uint64mod(uint64, uint64) uint64 func float64toint64(float64) int64 func float64touint64(float64) uint64 func int64tofloat64(int64) float64 func uint64tofloat64(uint64) float64 func complex128div(num complex128, den complex128) (quo complex128) // race detection func racefuncenter(uintptr) func racefuncexit() func raceread(uintptr) func racewrite(uintptr)
{ "content_hash": "636a25865702b7c59d69e934ba482de1", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 88, "avg_line_length": 35.666666666666664, "alnum_prop": 0.7423811458756603, "repo_name": "rflanagan/reginaldflanagan-project1", "id": "f45de0c9978747a2bf1938ce7f92764e0525f214", "size": "5276", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/cmd/gc/runtime.go", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "312383" }, { "name": "Awk", "bytes": "3780" }, { "name": "Bison", "bytes": "93818" }, { "name": "C", "bytes": "4712670" }, { "name": "C++", "bytes": "93164" }, { "name": "CSS", "bytes": "1897" }, { "name": "Emacs Lisp", "bytes": "34415" }, { "name": "Go", "bytes": "18307023" }, { "name": "HTML", "bytes": "105884" }, { "name": "JavaScript", "bytes": "2308" }, { "name": "Logos", "bytes": "1248" }, { "name": "Makefile", "bytes": "9219" }, { "name": "Objective-C", "bytes": "749" }, { "name": "OpenEdge ABL", "bytes": "9784" }, { "name": "Perl", "bytes": "191105" }, { "name": "Python", "bytes": "123100" }, { "name": "Shell", "bytes": "80030" }, { "name": "VimL", "bytes": "24060" } ], "symlink_target": "" }
package org.camunda.bpm.engine.test.standalone.pvm; import java.util.ArrayList; import java.util.List; import org.camunda.bpm.engine.impl.pvm.ProcessDefinitionBuilder; import org.camunda.bpm.engine.impl.pvm.PvmExecution; import org.camunda.bpm.engine.impl.pvm.PvmProcessDefinition; import org.camunda.bpm.engine.impl.pvm.PvmProcessInstance; import org.camunda.bpm.engine.impl.pvm.process.ActivityImpl; import org.camunda.bpm.engine.impl.pvm.process.ProcessDefinitionImpl; import org.camunda.bpm.engine.impl.test.PvmTestCase; import org.camunda.bpm.engine.test.standalone.pvm.activities.Automatic; import org.camunda.bpm.engine.test.standalone.pvm.activities.EmbeddedSubProcess; import org.camunda.bpm.engine.test.standalone.pvm.activities.End; import org.camunda.bpm.engine.test.standalone.pvm.activities.ParallelGateway; import org.camunda.bpm.engine.test.standalone.pvm.activities.WaitState; /** * @author Tom Baeyens */ public class PvmEmbeddedSubProcessTest extends PvmTestCase { /** * +------------------------------+ * | embedded subprocess | * +-----+ | +-----------+ +---------+ | +---+ * |start|-->| |startInside|-->|endInside| |-->|end| * +-----+ | +-----------+ +---------+ | +---+ * +------------------------------+ */ public void testEmbeddedSubProcess() { PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder() .createActivity("start") .initial() .behavior(new Automatic()) .transition("embeddedsubprocess") .endActivity() .createActivity("embeddedsubprocess") .scope() .behavior(new EmbeddedSubProcess()) .createActivity("startInside") .behavior(new Automatic()) .transition("endInside") .endActivity() .createActivity("endInside") .behavior(new End()) .endActivity() .transition("end") .endActivity() .createActivity("end") .behavior(new WaitState()) .endActivity() .buildProcessDefinition(); PvmProcessInstance processInstance = processDefinition.createProcessInstance(); processInstance.start(); List<String> expectedActiveActivityIds = new ArrayList<String>(); expectedActiveActivityIds.add("end"); assertEquals(expectedActiveActivityIds, processInstance.findActiveActivityIds()); } /** * +----------------------------------------+ * | embeddedsubprocess +----------+ | * | +---->|endInside1| | * | | +----------+ | * | | | * +-----+ | +-----------+ +----+ +----------+ | +---+ * |start|-->| |startInside|-->|fork|-->|endInside2| |-->|end| * +-----+ | +-----------+ +----+ +----------+ | +---+ * | | | * | | +----------+ | * | +---->|endInside3| | * | +----------+ | * +----------------------------------------+ */ public void testMultipleConcurrentEndsInsideEmbeddedSubProcess() { PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder() .createActivity("start") .initial() .behavior(new Automatic()) .transition("embeddedsubprocess") .endActivity() .createActivity("embeddedsubprocess") .scope() .behavior(new EmbeddedSubProcess()) .createActivity("startInside") .behavior(new Automatic()) .transition("fork") .endActivity() .createActivity("fork") .behavior(new ParallelGateway()) .transition("endInside1") .transition("endInside2") .transition("endInside3") .endActivity() .createActivity("endInside1") .behavior(new End()) .endActivity() .createActivity("endInside2") .behavior(new End()) .endActivity() .createActivity("endInside3") .behavior(new End()) .endActivity() .transition("end") .endActivity() .createActivity("end") .behavior(new End()) .endActivity() .buildProcessDefinition(); PvmProcessInstance processInstance = processDefinition.createProcessInstance(); processInstance.start(); assertTrue(processInstance.isEnded()); } /** * +-------------------------------------------------+ * | embeddedsubprocess +----------+ | * | +---->|endInside1| | * | | +----------+ | * | | | * +-----+ | +-----------+ +----+ +----+ +----------+ | +---+ * |start|-->| |startInside|-->|fork|-->|wait|-->|endInside2| |-->|end| * +-----+ | +-----------+ +----+ +----+ +----------+ | +---+ * | | | * | | +----------+ | * | +---->|endInside3| | * | +----------+ | * +-------------------------------------------------+ */ public void testMultipleConcurrentEndsInsideEmbeddedSubProcessWithWaitState() { PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder() .createActivity("start") .initial() .behavior(new Automatic()) .transition("embeddedsubprocess") .endActivity() .createActivity("embeddedsubprocess") .scope() .behavior(new EmbeddedSubProcess()) .createActivity("startInside") .behavior(new Automatic()) .transition("fork") .endActivity() .createActivity("fork") .behavior(new ParallelGateway()) .transition("endInside1") .transition("wait") .transition("endInside3") .endActivity() .createActivity("endInside1") .behavior(new End()) .endActivity() .createActivity("wait") .behavior(new WaitState()) .transition("endInside2") .endActivity() .createActivity("endInside2") .behavior(new End()) .endActivity() .createActivity("endInside3") .behavior(new End()) .endActivity() .transition("end") .endActivity() .createActivity("end") .behavior(new End()) .endActivity() .buildProcessDefinition(); PvmProcessInstance processInstance = processDefinition.createProcessInstance(); processInstance.start(); assertFalse(processInstance.isEnded()); PvmExecution execution = processInstance.findExecution("wait"); execution.signal(null, null); assertTrue(processInstance.isEnded()); } /** * +-------------------------------------------------------+ * | embedded subprocess | * | +--------------------------------+ | * | | nested embedded subprocess | | * +-----+ | +-----------+ | +-----------+ +---------+ | | +---+ * |start|-->| |startInside|--> | |startInside|-->|endInside| | |-->|end| * +-----+ | +-----------+ | +-----------+ +---------+ | | +---+ * | +--------------------------------+ | * | | * +-------------------------------------------------------+ */ public void testNestedSubProcessNoEnd() { PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder() .createActivity("start") .initial() .behavior(new Automatic()) .transition("embeddedsubprocess") .endActivity() .createActivity("embeddedsubprocess") .scope() .behavior(new EmbeddedSubProcess()) .createActivity("startInside") .behavior(new Automatic()) .transition("nestedSubProcess") .endActivity() .createActivity("nestedSubProcess") .scope() .behavior(new EmbeddedSubProcess()) .createActivity("startNestedInside") .behavior(new Automatic()) .transition("endInside") .endActivity() .createActivity("endInside") .behavior(new End()) .endActivity() .endActivity() .transition("end") .endActivity() .createActivity("end") .behavior(new WaitState()) .endActivity() .buildProcessDefinition(); PvmProcessInstance processInstance = processDefinition.createProcessInstance(); processInstance.start(); List<String> expectedActiveActivityIds = new ArrayList<String>(); expectedActiveActivityIds.add("end"); assertEquals(expectedActiveActivityIds, processInstance.findActiveActivityIds()); } /** * +------------------------------+ * | embedded subprocess | * +-----+ | +-----------+ | * |start|-->| |startInside| | * +-----+ | +-----------+ | * +------------------------------+ */ public void testEmbeddedSubProcessWithoutEndEvents() { PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder() .createActivity("start") .initial() .behavior(new Automatic()) .transition("embeddedsubprocess") .endActivity() .createActivity("embeddedsubprocess") .scope() .behavior(new EmbeddedSubProcess()) .createActivity("startInside") .behavior(new Automatic()) .endActivity() .endActivity() .buildProcessDefinition(); PvmProcessInstance processInstance = processDefinition.createProcessInstance(); processInstance.start(); assertTrue(processInstance.isEnded()); } /** * +-------------------------------------------------------+ * | embedded subprocess | * | +--------------------------------+ | * | | nested embedded subprocess | | * +-----+ | +-----------+ | +-----------+ | | * |start|-->| |startInside|--> | |startInside| | | * +-----+ | +-----------+ | +-----------+ | | * | +--------------------------------+ | * | | * +-------------------------------------------------------+ */ public void testNestedSubProcessBothNoEnd() { PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder() .createActivity("start") .initial() .behavior(new Automatic()) .transition("embeddedsubprocess") .endActivity() .createActivity("embeddedsubprocess") .scope() .behavior(new EmbeddedSubProcess()) .createActivity("startInside") .behavior(new Automatic()) .transition("nestedSubProcess") .endActivity() .createActivity("nestedSubProcess") .scope() .behavior(new EmbeddedSubProcess()) .createActivity("startNestedInside") .behavior(new Automatic()) .endActivity() .endActivity() .endActivity() .buildProcessDefinition(); PvmProcessInstance processInstance = processDefinition.createProcessInstance(); processInstance.start(); assertTrue(processInstance.isEnded()); } /** * +------------------------------+ * | embedded subprocess | * +-----+ | +-----------+ +---------+ | * |start|-->| |startInside|-->|endInside| | * +-----+ | +-----------+ +---------+ | * +------------------------------+ */ public void testEmbeddedSubProcessNoEnd() { PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder() .createActivity("start") .initial() .behavior(new Automatic()) .transition("embeddedsubprocess") .endActivity() .createActivity("embeddedsubprocess") .scope() .behavior(new EmbeddedSubProcess()) .createActivity("startInside") .behavior(new Automatic()) .transition("endInside") .endActivity() .createActivity("endInside") .behavior(new End()) .endActivity() .endActivity() .buildProcessDefinition(); PvmProcessInstance processInstance = processDefinition.createProcessInstance(); processInstance.start(); assertTrue(processInstance.isEnded()); } /** * +------------------------------+ * | embedded subprocess | * +-----+ | +-----------+ +---------+ | +---+ * |start|-->| |startInside|-->|endInside| |-->|end| * +-----+ | +-----------+ +---------+ | +---+ * +------------------------------+ */ public void testStartInScope() { PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder() .createActivity("start") .initial() .behavior(new Automatic()) .transition("embeddedsubprocess") .endActivity() .createActivity("embeddedsubprocess") .scope() .behavior(new EmbeddedSubProcess()) .createActivity("startInside") .behavior(new Automatic()) .transition("endInside") .endActivity() .createActivity("endInside") .behavior(new End()) .endActivity() .transition("end") .endActivity() .createActivity("end") .behavior(new WaitState()) .endActivity() .buildProcessDefinition(); PvmProcessInstance processInstance = ((ProcessDefinitionImpl) processDefinition) .createProcessInstanceForInitial((ActivityImpl) processDefinition.findActivity("startInside")); processInstance.start(); List<String> expectedActiveActivityIds = new ArrayList<String>(); expectedActiveActivityIds.add("end"); assertEquals(expectedActiveActivityIds, processInstance.findActiveActivityIds()); } }
{ "content_hash": "c0079d8e5f08282e991cdd3767c895ea", "timestamp": "", "source": "github", "line_count": 391, "max_line_length": 103, "avg_line_length": 37.130434782608695, "alnum_prop": 0.4907700785232126, "repo_name": "xasx/camunda-bpm-platform", "id": "261a7cb15cbfce4bd394eda800483a7f166cf76c", "size": "15169", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "engine/src/test/java/org/camunda/bpm/engine/test/standalone/pvm/PvmEmbeddedSubProcessTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "7146" }, { "name": "CSS", "bytes": "2750" }, { "name": "Groovy", "bytes": "1594" }, { "name": "HTML", "bytes": "43699" }, { "name": "Java", "bytes": "31223302" }, { "name": "JavaScript", "bytes": "43" }, { "name": "PLpgSQL", "bytes": "30667" }, { "name": "Python", "bytes": "187" }, { "name": "Ruby", "bytes": "60" }, { "name": "SQLPL", "bytes": "26986" }, { "name": "Shell", "bytes": "8400" } ], "symlink_target": "" }
<!-- HEAD Start --> <head> {% include force-https.html %} <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content="{{site.description}}"> <meta name="author" content="{{site.author}}"> <meta name="keywords" content="{{site.keywords}}"> <link rel="canonical" href="{{page.url | replace:'index.html','' | prepend: site.baseurl}}"> <title>{{site.title}}{% if page.title %} | {{page.title}}{% endif %}</title> <!-- Bootstrap Core CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <!-- Custom CSS --> <link href="{{site.baseurl}}/css/grayscale.css" rel="stylesheet"> {% if page.section-type == "index" %} <link href="{{site.baseurl}}/css/timeline.css" rel="stylesheet"> {% endif %} <link href="{{site.baseurl}}/css/row-column.css" rel="stylesheet"> <!-- Custom Fonts --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"> <link href="//fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" rel="stylesheet" type="text/css"> <link href="//fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css"> <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Open+Sans"> <link rel="stylesheet" href="{{site.baseurl}}/css/rrssb.css" /> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> {% if site.favicon %} <link rel="shortcut icon" type="image/x-icon" href="{{site.baseurl}}{{site.favicon}}"> {% endif %} {% if page.url == "/404.html" | prepend: {{site.baseurl}} %} <meta http-equiv="refresh" content="20; url={{site.baseurl}}/"> {% endif %} {% include web-app.html %} {% include syntax-highlight.html %} </head> <!-- HEAD End -->
{ "content_hash": "6a0f6ec93e850c8c21a0230dde365e01", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 115, "avg_line_length": 42, "alnum_prop": 0.6482479784366577, "repo_name": "ghdi6758/ghdi6758.github.io", "id": "3d3bbf219375fc94e948881f18186e806158ed66", "size": "2227", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_includes/head.html", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "277104" }, { "name": "HTML", "bytes": "495250" }, { "name": "JavaScript", "bytes": "85246" }, { "name": "PHP", "bytes": "2244" }, { "name": "Ruby", "bytes": "1782" }, { "name": "Shell", "bytes": "206" } ], "symlink_target": "" }
package org.elasticsearch.cluster.metadata; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.admin.indices.delete.DeleteIndexClusterStateUpdateRequest; import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.cluster.AckedClusterStateUpdateTask; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.RestoreInProgress; import org.elasticsearch.cluster.block.ClusterBlocks; import org.elasticsearch.cluster.routing.RoutingTable; import org.elasticsearch.cluster.routing.allocation.AllocationService; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.Priority; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.set.Sets; import org.elasticsearch.index.Index; import org.elasticsearch.snapshots.RestoreService; import org.elasticsearch.snapshots.SnapshotInProgressException; import org.elasticsearch.snapshots.SnapshotsService; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; /** * Deletes indices. */ public class MetadataDeleteIndexService { private static final Logger logger = LogManager.getLogger(MetadataDeleteIndexService.class); private final Settings settings; private final ClusterService clusterService; private final AllocationService allocationService; @Inject public MetadataDeleteIndexService(Settings settings, ClusterService clusterService, AllocationService allocationService) { this.settings = settings; this.clusterService = clusterService; this.allocationService = allocationService; } public void deleteIndices(final DeleteIndexClusterStateUpdateRequest request, final ActionListener<AcknowledgedResponse> listener) { if (request.indices() == null || request.indices().length == 0) { throw new IllegalArgumentException("Index name is required"); } clusterService.submitStateUpdateTask("delete-index " + Arrays.toString(request.indices()), new AckedClusterStateUpdateTask(Priority.URGENT, request, listener) { @Override public ClusterState execute(final ClusterState currentState) { return deleteIndices(currentState, Sets.newHashSet(request.indices())); } }); } /** * Delete some indices from the cluster state. */ public ClusterState deleteIndices(ClusterState currentState, Set<Index> indices) { final Metadata meta = currentState.metadata(); final Set<Index> indicesToDelete = new HashSet<>(); final Map<Index, DataStream> backingIndices = new HashMap<>(); for (Index index : indices) { IndexMetadata im = meta.getIndexSafe(index); IndexAbstraction.DataStream parent = meta.getIndicesLookup().get(im.getIndex().getName()).getParentDataStream(); if (parent != null) { if (parent.getWriteIndex().equals(im)) { throw new IllegalArgumentException("index [" + index.getName() + "] is the write index for data stream [" + parent.getName() + "] and cannot be deleted"); } else { backingIndices.put(index, parent.getDataStream()); } } indicesToDelete.add(im.getIndex()); } // Check if index deletion conflicts with any running snapshots Set<Index> snapshottingIndices = SnapshotsService.snapshottingIndices(currentState, indicesToDelete); if (snapshottingIndices.isEmpty() == false) { throw new SnapshotInProgressException("Cannot delete indices that are being snapshotted: " + snapshottingIndices + ". Try again after snapshot finishes or cancel the currently running snapshot."); } RoutingTable.Builder routingTableBuilder = RoutingTable.builder(currentState.routingTable()); Metadata.Builder metadataBuilder = Metadata.builder(meta); ClusterBlocks.Builder clusterBlocksBuilder = ClusterBlocks.builder().blocks(currentState.blocks()); final IndexGraveyard.Builder graveyardBuilder = IndexGraveyard.builder(metadataBuilder.indexGraveyard()); final int previousGraveyardSize = graveyardBuilder.tombstones().size(); for (final Index index : indices) { String indexName = index.getName(); logger.info("{} deleting index", index); routingTableBuilder.remove(indexName); clusterBlocksBuilder.removeIndexBlocks(indexName); metadataBuilder.remove(indexName); if (backingIndices.containsKey(index)) { DataStream parent = metadataBuilder.dataStream(backingIndices.get(index).getName()); metadataBuilder.put(parent.removeBackingIndex(index)); } } // add tombstones to the cluster state for each deleted index final IndexGraveyard currentGraveyard = graveyardBuilder.addTombstones(indices).build(settings); metadataBuilder.indexGraveyard(currentGraveyard); // the new graveyard set on the metadata logger.trace("{} tombstones purged from the cluster state. Previous tombstone size: {}. Current tombstone size: {}.", graveyardBuilder.getNumPurged(), previousGraveyardSize, currentGraveyard.getTombstones().size()); Metadata newMetadata = metadataBuilder.build(); ClusterBlocks blocks = clusterBlocksBuilder.build(); // update snapshot restore entries ImmutableOpenMap<String, ClusterState.Custom> customs = currentState.getCustoms(); final RestoreInProgress restoreInProgress = currentState.custom(RestoreInProgress.TYPE, RestoreInProgress.EMPTY); RestoreInProgress updatedRestoreInProgress = RestoreService.updateRestoreStateWithDeletedIndices(restoreInProgress, indices); if (updatedRestoreInProgress != restoreInProgress) { ImmutableOpenMap.Builder<String, ClusterState.Custom> builder = ImmutableOpenMap.builder(customs); builder.put(RestoreInProgress.TYPE, updatedRestoreInProgress); customs = builder.build(); } return allocationService.reroute( ClusterState.builder(currentState) .routingTable(routingTableBuilder.build()) .metadata(newMetadata) .blocks(blocks) .customs(customs) .build(), "deleted indices [" + indices + "]"); } }
{ "content_hash": "7424b0ae504e1a959f0859f916fb2324", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 136, "avg_line_length": 49.15827338129496, "alnum_prop": 0.7059856578369677, "repo_name": "robin13/elasticsearch", "id": "1fd597cc7f9dcb833b890feaccb2fb3876f9879a", "size": "7186", "binary": false, "copies": "9", "ref": "refs/heads/master", "path": "server/src/main/java/org/elasticsearch/cluster/metadata/MetadataDeleteIndexService.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "11082" }, { "name": "Batchfile", "bytes": "14049" }, { "name": "Emacs Lisp", "bytes": "3341" }, { "name": "FreeMarker", "bytes": "45" }, { "name": "Groovy", "bytes": "315863" }, { "name": "HTML", "bytes": "3399" }, { "name": "Java", "bytes": "40107206" }, { "name": "Perl", "bytes": "7271" }, { "name": "Python", "bytes": "54437" }, { "name": "Shell", "bytes": "108937" } ], "symlink_target": "" }
namespace krono { size_t DataFormat::gTypeSize[DataFormat::TypeCount] = {sizeof(float), sizeof(unsigned char), sizeof(short), 3, sizeof(float), sizeof(long), 5}; DataFormat::DataFormat() : type(Type::TypeCount), count(0) { } DataFormat::DataFormat(Type type, size_t count) : type(type), count(count) { } DataFormat::~DataFormat(void) { } size_t DataFormat::GetSize() const { return gTypeSize[type] * count; } bool DataFormat::IsDepthFormat() const { return IsDepthFormat(type); } bool DataFormat::IsDepthFormat(Type type) { return type >= Depth16 && type <= Depth32FS8; } }
{ "content_hash": "500b9183e41e5d5523433a5de6c681aa", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 143, "avg_line_length": 14.463414634146341, "alnum_prop": 0.6998313659359191, "repo_name": "lambertjamesd/Krono", "id": "4c8d18ecabe96f58f51a9108cc24dac06ee5f851", "size": "620", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "DeferredRendering/Interface/DataFormat.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "2927" }, { "name": "C++", "bytes": "961054" }, { "name": "CMake", "bytes": "10630" }, { "name": "GLSL", "bytes": "5523" }, { "name": "HLSL", "bytes": "26536" }, { "name": "Lua", "bytes": "268994" }, { "name": "Makefile", "bytes": "3714" }, { "name": "Shell", "bytes": "54" } ], "symlink_target": "" }
from django.contrib import admin from tjrapid import settings class CustomAdminSite(admin.AdminSite): def get_app_list(self, request): app_list = super().get_app_list(request) apps = {x['app_label']: x for x in app_list} app_list = [] for label, model_list in settings.APP_LIST: if label not in apps: continue app = apps[label] models = {x['object_name']: x for x in app['models']} app['models'] = [models[x] for x in model_list if x in models] app_list += [app] return app_list
{ "content_hash": "55bbe6c446ac61bea4f7f5abc3300f75", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 74, "avg_line_length": 33.44444444444444, "alnum_prop": 0.5681063122923588, "repo_name": "peterkuma/tjrapid", "id": "05f78eba5c895ccb1e9353ba0534dbd7af1a381b", "size": "602", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tjrapid/admin.py", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "35400" }, { "name": "HTML", "bytes": "43945" }, { "name": "JavaScript", "bytes": "257779" }, { "name": "Python", "bytes": "82948" }, { "name": "XSLT", "bytes": "2142" } ], "symlink_target": "" }
package org.simpleframework.xml.core; /** * The <code>Group</code> interface represents a group of labels * associated with a particular union annotation. A group allows * a <code>Label</code> to be acquired by name or type. Acquiring * the label by type allows the serialization process to dynamically * select a label, and thus converter, based on the instance type. * On deserialization a label is dynamically selected based on name. * * @author Niall Gallagher */ interface Group { /** * This is used to acquire a <code>Label</code> based on the type * of an object. Selecting a label based on the type ensures that * the serialization process can dynamically convert an object * to XML. If the type is not supported, this returns null. * * @param type this is the type to select the label from * * @return this returns the label based on the type */ public Label getLabel(Class type); /** * This is used to acquire a <code>LabelMap</code> containing the * labels available to the group. Providing a context object * ensures that each of the labels is mapped to a name that is * styled according to the internal style of the context. * * @param context this is the context used for serialization * * @return this returns a label map containing the labels */ public LabelMap getElements(Context context) throws Exception; /** * This returns a string representation of the union group. * Providing a string representation in this way ensures that the * group can be used in exception messages and for any debugging. * * @return this returns a string representation of the group */ public String toString(); }
{ "content_hash": "2c0129043b24dbb8528ec27e66e38666", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 68, "avg_line_length": 36.83673469387755, "alnum_prop": 0.681994459833795, "repo_name": "glorycloud/GloryMail", "id": "677338ac85ff5344f42adfe7e43a178ed2f4bce0", "size": "2476", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "CloudyMail/lib_src/org/simpleframework/xml/core/Group.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "4606" }, { "name": "Groovy", "bytes": "266457" }, { "name": "HTML", "bytes": "114900" }, { "name": "Java", "bytes": "12412368" }, { "name": "JavaScript", "bytes": "1929" }, { "name": "SQLPL", "bytes": "16169" }, { "name": "Shell", "bytes": "13664" } ], "symlink_target": "" }
package com.plivo.helper.api.response.pricing; public class SipOutboundPricing { public String rate ; public SipOutboundPricing() { // empty } @Override public String toString() { return "SipOutboundPricing [rate=" + rate + "]"; } }
{ "content_hash": "9982ba69427de7bfd876f4dce80e11ca", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 50, "avg_line_length": 17.642857142857142, "alnum_prop": 0.7004048582995951, "repo_name": "TechniqueSoftware/plivo-java", "id": "e891c0491a92052444c16b1c573f623da31175ea", "size": "247", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/plivo/helper/api/response/pricing/SipOutboundPricing.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "112393" } ], "symlink_target": "" }
package com.mark.planewar; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); View startButton = findViewById(R.id.button_start); if (startButton != null) { startButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { startActivity(new Intent(MainActivity.this, GameActivity.class)); } }); } View endButton = findViewById(R.id.button_exit); if (endButton != null) { endButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { finish(); } }); } } }
{ "content_hash": "6d2b8cb24fb1e03554c48f98cf67326e", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 85, "avg_line_length": 31.17142857142857, "alnum_prop": 0.5692025664527957, "repo_name": "markzhai/PlaneWar", "id": "46284b3a095454bb3ee4866305431f6dd5187f52", "size": "1091", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/com/mark/planewar/MainActivity.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "20257" } ], "symlink_target": "" }
package mem import ( _ "embed" "fmt" "runtime" "github.com/influxdata/telegraf" "github.com/influxdata/telegraf/plugins/inputs" "github.com/influxdata/telegraf/plugins/inputs/system" ) // DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data. //go:embed sample.conf var sampleConfig string type MemStats struct { ps system.PS platform string } func (*MemStats) SampleConfig() string { return sampleConfig } func (ms *MemStats) Init() error { ms.platform = runtime.GOOS return nil } func (ms *MemStats) Gather(acc telegraf.Accumulator) error { vm, err := ms.ps.VMStat() if err != nil { return fmt.Errorf("error getting virtual memory info: %s", err) } fields := map[string]interface{}{ "total": vm.Total, "available": vm.Available, "used": vm.Used, "used_percent": 100 * float64(vm.Used) / float64(vm.Total), "available_percent": 100 * float64(vm.Available) / float64(vm.Total), } switch ms.platform { case "darwin": fields["active"] = vm.Active fields["free"] = vm.Free fields["inactive"] = vm.Inactive fields["wired"] = vm.Wired case "openbsd": fields["active"] = vm.Active fields["cached"] = vm.Cached fields["free"] = vm.Free fields["inactive"] = vm.Inactive fields["wired"] = vm.Wired case "freebsd": fields["active"] = vm.Active fields["buffered"] = vm.Buffers fields["cached"] = vm.Cached fields["free"] = vm.Free fields["inactive"] = vm.Inactive fields["laundry"] = vm.Laundry fields["wired"] = vm.Wired case "linux": fields["active"] = vm.Active fields["buffered"] = vm.Buffers fields["cached"] = vm.Cached fields["commit_limit"] = vm.CommitLimit fields["committed_as"] = vm.CommittedAS fields["dirty"] = vm.Dirty fields["free"] = vm.Free fields["high_free"] = vm.HighFree fields["high_total"] = vm.HighTotal fields["huge_pages_free"] = vm.HugePagesFree fields["huge_page_size"] = vm.HugePageSize fields["huge_pages_total"] = vm.HugePagesTotal fields["inactive"] = vm.Inactive fields["low_free"] = vm.LowFree fields["low_total"] = vm.LowTotal fields["mapped"] = vm.Mapped fields["page_tables"] = vm.PageTables fields["shared"] = vm.Shared fields["slab"] = vm.Slab fields["sreclaimable"] = vm.Sreclaimable fields["sunreclaim"] = vm.Sunreclaim fields["swap_cached"] = vm.SwapCached fields["swap_free"] = vm.SwapFree fields["swap_total"] = vm.SwapTotal fields["vmalloc_chunk"] = vm.VmallocChunk fields["vmalloc_total"] = vm.VmallocTotal fields["vmalloc_used"] = vm.VmallocUsed fields["write_back_tmp"] = vm.WriteBackTmp fields["write_back"] = vm.WriteBack } acc.AddGauge("mem", fields, nil) return nil } func init() { ps := system.NewSystemPS() inputs.Add("mem", func() telegraf.Input { return &MemStats{ps: ps} }) }
{ "content_hash": "29d319c79f5ee93fd0fa98038b17efe7", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 85, "avg_line_length": 26.514018691588785, "alnum_prop": 0.6704265068734578, "repo_name": "Brightspace/telegraf", "id": "961a02ed1002202bed1320115a7a2f173a0c8548", "size": "2899", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "plugins/inputs/mem/mem.go", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "9352068" }, { "name": "Makefile", "bytes": "14981" }, { "name": "PowerShell", "bytes": "1385" }, { "name": "Ragel", "bytes": "10377" }, { "name": "Ruby", "bytes": "1981" }, { "name": "Shell", "bytes": "32178" } ], "symlink_target": "" }
@interface PLYNavigationController () @end @implementation PLYNavigationController - (BOOL)shouldAutorotate { return self.topViewController.shouldAutorotate; } - (PLY_SUPPORTED_INTERFACE_ORIENTATIONS_RETURN_TYPE)supportedInterfaceOrientations { return self.topViewController.supportedInterfaceOrientations; } @end
{ "content_hash": "327495cfeca9e538fe3f6eb69547094a", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 82, "avg_line_length": 18.88235294117647, "alnum_prop": 0.8348909657320872, "repo_name": "ProductLayer/ProductLayer-SDK-for-iOS", "id": "a5ec9f7480b7414b2395a0bddd88015f227fc74b", "size": "542", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "Core/Source/iOS/PLYNavigationController.m", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "C++", "bytes": "536" }, { "name": "Objective-C", "bytes": "652725" }, { "name": "Ruby", "bytes": "5253" } ], "symlink_target": "" }
package com.dubture.composer.ui; public class ComposerUIPluginConstants { public static final int DIALOG_LABEL_WIDTH = 100; public static final int DIALOG_CONTROL_WIDTH = 175; }
{ "content_hash": "c9c056992e902562c99217c0032e17f3", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 52, "avg_line_length": 26, "alnum_prop": 0.7857142857142857, "repo_name": "pulse00/Composer-Eclipse-Plugin", "id": "3036e44cefb20e5d8de34ddcb4c985351fe5e37f", "size": "182", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "com.dubture.composer.ui/src/com/dubture/composer/ui/ComposerUIPluginConstants.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "143" }, { "name": "Java", "bytes": "568762" }, { "name": "PHP", "bytes": "76396" }, { "name": "Shell", "bytes": "4869" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>PowerShell - Set-HostsEntry - Carbon</title> <link href="styles.css" type="text/css" rel="stylesheet" /> </head> <body> <ul id="SiteNav"> <li><a href="/">Get-Carbon</a></li> <li>-Documentation</li> <li><a href="../releasenotes.html">-ReleaseNotes</a></li> <li><a href="http://pshdo.com">-Blog</a></li> </ul> <div id="CommandMenuContainer" style="float:left;"> <ul id="CategoryMenu"> <li class="Category">ActiveDirectory</li> <ul class="CommandMenu"> <li><a href="Find-ADUser.html">Find-ADUser</a></li> <li><a href="Format-ADSearchFilterValue.html">Format-ADSearchFilterValue</a></li> <li><a href="Get-ADDomainController.html">Get-ADDomainController</a></li> </ul> <li class="Category">Certificates</li> <ul class="CommandMenu"> <li><a href="Get-Certificate.html">Get-Certificate</a></li> <li><a href="Get-CertificateStore.html">Get-CertificateStore</a></li> <li><a href="Get-SslCertificateBinding.html">Get-SslCertificateBinding</a></li> <li><a href="Install-Certificate.html">Install-Certificate</a></li> <li><a href="Remove-SslCertificateBinding.html">Remove-SslCertificateBinding</a></li> <li><a href="Set-SslCertificateBinding.html">Set-SslCertificateBinding</a></li> <li><a href="Test-SslCertificateBinding.html">Test-SslCertificateBinding</a></li> <li><a href="Uninstall-Certificate.html">Uninstall-Certificate</a></li> </ul> <li class="Category">COM</li> <ul class="CommandMenu"> <li><a href="Get-ComPermission.html">Get-ComPermission</a></li> <li><a href="Get-ComSecurityDescriptor.html">Get-ComSecurityDescriptor</a></li> <li><a href="Grant-ComPermission.html">Grant-ComPermission</a></li> <li><a href="Revoke-ComPermission.html">Revoke-ComPermission</a></li> </ul> <li class="Category">Computer</li> <ul class="CommandMenu"> <li><a href="Get-ProgramInstallInfo.html">Get-ProgramInstallInfo</a></li> <li><a href="Remove-EnvironmentVariable.html">Remove-EnvironmentVariable</a></li> <li><a href="Resolve-NetPath.html">Resolve-NetPath</a></li> <li><a href="Set-EnvironmentVariable.html">Set-EnvironmentVariable</a></li> <li><a href="Test-OSIs32Bit.html">Test-OSIs32Bit</a></li> <li><a href="Test-OSIs64Bit.html">Test-OSIs64Bit</a></li> </ul> <li class="Category">Cryptography</li> <ul class="CommandMenu"> <li><a href="New-RsaKeyPair.html">New-RsaKeyPair</a></li> <li><a href="Protect-String.html">Protect-String</a></li> <li><a href="Unprotect-String.html">Unprotect-String</a></li> </ul> <li class="Category">DotNet</li> <ul class="CommandMenu"> <li><a href="Set-DotNetAppSetting.html">Set-DotNetAppSetting</a></li> <li><a href="Set-DotNetConnectionString.html">Set-DotNetConnectionString</a></li> <li><a href="Test-DotNet.html">Test-DotNet</a></li> </ul> <li class="Category">DSC</li> <ul class="CommandMenu"> <li><a href="Clear-DscLocalResourceCache.html">Clear-DscLocalResourceCache</a></li> <li><a href="Clear-MofAuthoringMetadata.html">Clear-MofAuthoringMetadata</a></li> <li><a href="Copy-DscResource.html">Copy-DscResource</a></li> <li><a href="Get-DscError.html">Get-DscError</a></li> <li><a href="Get-DscWinEvent.html">Get-DscWinEvent</a></li> <li><a href="Initialize-Lcm.html">Initialize-Lcm</a></li> <li><a href="Start-DscPullConfiguration.html">Start-DscPullConfiguration</a></li> <li><a href="Test-DscTargetResource.html">Test-DscTargetResource</a></li> <li><a href="Write-DscError.html">Write-DscError</a></li> </ul> <li class="Category">DSC Resources</li> <ul class="CommandMenu"> <li><a href="Carbon_EnvironmentVariable.html">Carbon_EnvironmentVariable</a></li> <li><a href="Carbon_FirewallRule.html">Carbon_FirewallRule</a></li> <li><a href="Carbon_IniFile.html">Carbon_IniFile</a></li> <li><a href="Carbon_Permission.html">Carbon_Permission</a></li> <li><a href="Carbon_Privilege.html">Carbon_Privilege</a></li> <li><a href="Carbon_ScheduledTask.html">Carbon_ScheduledTask</a></li> <li><a href="Carbon_Service.html">Carbon_Service</a></li> </ul> <li class="Category">FileSystem</li> <ul class="CommandMenu"> <li><a href="Compress-Item.html">Compress-Item</a></li> <li><a href="Disable-NtfsCompression.html">Disable-NtfsCompression</a></li> <li><a href="Enable-NtfsCompression.html">Enable-NtfsCompression</a></li> <li><a href="Expand-Item.html">Expand-Item</a></li> <li><a href="Install-Junction.html">Install-Junction</a></li> <li><a href="New-Junction.html">New-Junction</a></li> <li><a href="New-TempDirectory.html">New-TempDirectory</a></li> <li><a href="Remove-Junction.html">Remove-Junction</a></li> <li><a href="Test-NtfsCompression.html">Test-NtfsCompression</a></li> <li><a href="Test-PathIsJunction.html">Test-PathIsJunction</a></li> <li><a href="Test-ZipFile.html">Test-ZipFile</a></li> <li><a href="Uninstall-Junction.html">Uninstall-Junction</a></li> </ul> <li class="Category">Firewall</li> <ul class="CommandMenu"> <li><a href="Assert-FirewallConfigurable.html">Assert-FirewallConfigurable</a></li> <li><a href="Disable-FirewallStatefulFtp.html">Disable-FirewallStatefulFtp</a></li> <li><a href="Enable-FirewallStatefulFtp.html">Enable-FirewallStatefulFtp</a></li> <li><a href="Get-FirewallRule.html">Get-FirewallRule</a></li> <li><a href="Test-FirewallStatefulFtp.html">Test-FirewallStatefulFtp</a></li> </ul> <li class="Category">HostsFile</li> <ul class="CommandMenu"> <li><a href="Get-PathToHostsFile.html">Get-PathToHostsFile</a></li> <li><a href="Remove-HostsEntry.html">Remove-HostsEntry</a></li> <li><a href="Reset-HostsFile.html">Reset-HostsFile</a></li> <li><a href="Set-HostsEntry.html">Set-HostsEntry</a></li> </ul> <li class="Category">IIS</li> <ul class="CommandMenu"> <li><a href="Add-IisDefaultDocument.html">Add-IisDefaultDocument</a></li> <li><a href="Disable-IisSecurityAuthentication.html">Disable-IisSecurityAuthentication</a></li> <li><a href="Enable-IisDirectoryBrowsing.html">Enable-IisDirectoryBrowsing</a></li> <li><a href="Enable-IisSecurityAuthentication.html">Enable-IisSecurityAuthentication</a></li> <li><a href="Enable-IisSsl.html">Enable-IisSsl</a></li> <li><a href="Get-IisApplication.html">Get-IisApplication</a></li> <li><a href="Get-IisAppPool.html">Get-IisAppPool</a></li> <li><a href="Get-IisConfigurationSection.html">Get-IisConfigurationSection</a></li> <li><a href="Get-IisHttpHeader.html">Get-IisHttpHeader</a></li> <li><a href="Get-IisHttpRedirect.html">Get-IisHttpRedirect</a></li> <li><a href="Get-IisMimeMap.html">Get-IisMimeMap</a></li> <li><a href="Get-IisSecurityAuthentication.html">Get-IisSecurityAuthentication</a></li> <li><a href="Get-IisVersion.html">Get-IisVersion</a></li> <li><a href="Get-IisWebsite.html">Get-IisWebsite</a></li> <li><a href="Install-IisApplication.html">Install-IisApplication</a></li> <li><a href="Install-IisAppPool.html">Install-IisAppPool</a></li> <li><a href="Install-IisVirtualDirectory.html">Install-IisVirtualDirectory</a></li> <li><a href="Install-IisWebsite.html">Install-IisWebsite</a></li> <li><a href="Invoke-AppCmd.html">Invoke-AppCmd</a></li> <li><a href="Join-IisVirtualPath.html">Join-IisVirtualPath</a></li> <li><a href="Lock-IisConfigurationSection.html">Lock-IisConfigurationSection</a></li> <li><a href="Remove-IisMimeMap.html">Remove-IisMimeMap</a></li> <li><a href="Set-IisHttpHeader.html">Set-IisHttpHeader</a></li> <li><a href="Set-IisHttpRedirect.html">Set-IisHttpRedirect</a></li> <li><a href="Set-IisMimeMap.html">Set-IisMimeMap</a></li> <li><a href="Set-IisWebsiteID.html">Set-IisWebsiteID</a></li> <li><a href="Set-IisWebsiteSslCertificate.html">Set-IisWebsiteSslCertificate</a></li> <li><a href="Set-IisWindowsAuthentication.html">Set-IisWindowsAuthentication</a></li> <li><a href="Test-IisAppPool.html">Test-IisAppPool</a></li> <li><a href="Test-IisConfigurationSection.html">Test-IisConfigurationSection</a></li> <li><a href="Test-IisSecurityAuthentication.html">Test-IisSecurityAuthentication</a></li> <li><a href="Test-IisWebsite.html">Test-IisWebsite</a></li> <li><a href="Uninstall-IisAppPool.html">Uninstall-IisAppPool</a></li> <li><a href="Uninstall-IisWebsite.html">Uninstall-IisWebsite</a></li> <li><a href="Unlock-IisConfigurationSection.html">Unlock-IisConfigurationSection</a></li> </ul> <li class="Category">INI</li> <ul class="CommandMenu"> <li><a href="Remove-IniEntry.html">Remove-IniEntry</a></li> <li><a href="Set-IniEntry.html">Set-IniEntry</a></li> <li><a href="Split-Ini.html">Split-Ini</a></li> </ul> <li class="Category">InternetExplorer</li> <ul class="CommandMenu"> <li><a href="Disable-IEEnhancedSecurityConfiguration.html">Disable-IEEnhancedSecurityConfiguration</a></li> <li><a href="Enable-IEActivationPermission.html">Enable-IEActivationPermission</a></li> </ul> <li class="Category">MSI</li> <ul class="CommandMenu"> <li><a href="Invoke-WindowsInstaller.html">Invoke-WindowsInstaller</a></li> </ul> <li class="Category">MSMQ</li> <ul class="CommandMenu"> <li><a href="Get-MsmqMessageQueue.html">Get-MsmqMessageQueue</a></li> <li><a href="Get-MsmqMessageQueuePath.html">Get-MsmqMessageQueuePath</a></li> <li><a href="Grant-MsmqMessageQueuePermission.html">Grant-MsmqMessageQueuePermission</a></li> <li><a href="Install-Msmq.html">Install-Msmq</a></li> <li><a href="Install-MsmqMessageQueue.html">Install-MsmqMessageQueue</a></li> <li><a href="Reset-MsmqQueueManagerID.html">Reset-MsmqQueueManagerID</a></li> <li><a href="Test-MsmqMessageQueue.html">Test-MsmqMessageQueue</a></li> <li><a href="Uninstall-MsmqMessageQueue.html">Uninstall-MsmqMessageQueue</a></li> </ul> <li class="Category">Network</li> <ul class="CommandMenu"> <li><a href="Get-IPAddress.html">Get-IPAddress</a></li> <li><a href="Test-IPAddress.html">Test-IPAddress</a></li> </ul> <li class="Category">Path</li> <ul class="CommandMenu"> <li><a href="Get-PathProvider.html">Get-PathProvider</a></li> <li><a href="Resolve-FullPath.html">Resolve-FullPath</a></li> <li><a href="Resolve-PathCase.html">Resolve-PathCase</a></li> <li><a href="Resolve-RelativePath.html">Resolve-RelativePath</a></li> <li><a href="Test-UncPath.html">Test-UncPath</a></li> </ul> <li class="Category">PerformanceCounters</li> <ul class="CommandMenu"> <li><a href="Get-PerformanceCounter.html">Get-PerformanceCounter</a></li> <li><a href="Install-PerformanceCounter.html">Install-PerformanceCounter</a></li> <li><a href="Test-PerformanceCounter.html">Test-PerformanceCounter</a></li> <li><a href="Test-PerformanceCounterCategory.html">Test-PerformanceCounterCategory</a></li> <li><a href="Uninstall-PerformanceCounterCategory.html">Uninstall-PerformanceCounterCategory</a></li> </ul> <li class="Category">PowerShell</li> <ul class="CommandMenu"> <li><a href="Add-TrustedHost.html">Add-TrustedHost</a></li> <li><a href="Clear-TrustedHost.html">Clear-TrustedHost</a></li> <li><a href="Get-PowerShellModuleInstallPath.html">Get-PowerShellModuleInstallPath</a></li> <li><a href="Get-PowershellPath.html">Get-PowershellPath</a></li> <li><a href="Get-TrustedHost.html">Get-TrustedHost</a></li> <li><a href="Invoke-PowerShell.html">Invoke-PowerShell</a></li> <li><a href="Set-TrustedHost.html">Set-TrustedHost</a></li> <li><a href="Test-PowerShellIs32Bit.html">Test-PowerShellIs32Bit</a></li> <li><a href="Test-PowerShellIs64Bit.html">Test-PowerShellIs64Bit</a></li> </ul> <li class="Category">Privileges</li> <ul class="CommandMenu"> <li><a href="Get-Privilege.html">Get-Privilege</a></li> <li><a href="Grant-Privilege.html">Grant-Privilege</a></li> <li><a href="Revoke-Privilege.html">Revoke-Privilege</a></li> <li><a href="Test-Privilege.html">Test-Privilege</a></li> </ul> <li class="Category">Registry</li> <ul class="CommandMenu"> <li><a href="Get-RegistryKeyValue.html">Get-RegistryKeyValue</a></li> <li><a href="Install-RegistryKey.html">Install-RegistryKey</a></li> <li><a href="Remove-RegistryKeyValue.html">Remove-RegistryKeyValue</a></li> <li><a href="Set-RegistryKeyValue.html">Set-RegistryKeyValue</a></li> <li><a href="Test-RegistryKeyValue.html">Test-RegistryKeyValue</a></li> </ul> <li class="Category">ScheduledTasks</li> <ul class="CommandMenu"> <li><a href="Get-ScheduledTask.html">Get-ScheduledTask</a></li> <li><a href="Install-ScheduledTask.html">Install-ScheduledTask</a></li> <li><a href="Test-ScheduledTask.html">Test-ScheduledTask</a></li> <li><a href="Uninstall-ScheduledTask.html">Uninstall-ScheduledTask</a></li> </ul> <li class="Category">Security</li> <ul class="CommandMenu"> <li><a href="Assert-AdminPrivilege.html">Assert-AdminPrivilege</a></li> <li><a href="Convert-SecureStringToString.html">Convert-SecureStringToString</a></li> <li><a href="ConvertTo-ContainerInheritanceFlags.html">ConvertTo-ContainerInheritanceFlags</a></li> <li><a href="ConvertTo-InheritanceFlag.html">ConvertTo-InheritanceFlag</a></li> <li><a href="ConvertTo-PropagationFlag.html">ConvertTo-PropagationFlag</a></li> <li><a href="Get-Permission.html">Get-Permission</a></li> <li><a href="Grant-Permission.html">Grant-Permission</a></li> <li><a href="New-Credential.html">New-Credential</a></li> <li><a href="Protect-Acl.html">Protect-Acl</a></li> <li><a href="Revoke-Permission.html">Revoke-Permission</a></li> <li><a href="Test-AdminPrivilege.html">Test-AdminPrivilege</a></li> <li><a href="Test-Permission.html">Test-Permission</a></li> </ul> <li class="Category">Service</li> <ul class="CommandMenu"> <li><a href="Assert-Service.html">Assert-Service</a></li> <li><a href="Get-ServiceAcl.html">Get-ServiceAcl</a></li> <li><a href="Get-ServiceConfiguration.html">Get-ServiceConfiguration</a></li> <li><a href="Get-ServicePermission.html">Get-ServicePermission</a></li> <li><a href="Get-ServiceSecurityDescriptor.html">Get-ServiceSecurityDescriptor</a></li> <li><a href="Grant-ServiceControlPermission.html">Grant-ServiceControlPermission</a></li> <li><a href="Grant-ServicePermission.html">Grant-ServicePermission</a></li> <li><a href="Install-Service.html">Install-Service</a></li> <li><a href="Restart-RemoteService.html">Restart-RemoteService</a></li> <li><a href="Revoke-ServicePermission.html">Revoke-ServicePermission</a></li> <li><a href="Set-ServiceAcl.html">Set-ServiceAcl</a></li> <li><a href="Test-Service.html">Test-Service</a></li> <li><a href="Uninstall-Service.html">Uninstall-Service</a></li> </ul> <li class="Category">Shares</li> <ul class="CommandMenu"> <li><a href="Install-SmbShare.html">Install-SmbShare</a></li> </ul> <li class="Category">Text</li> <ul class="CommandMenu"> <li><a href="ConvertFrom-Base64.html">ConvertFrom-Base64</a></li> <li><a href="ConvertTo-Base64.html">ConvertTo-Base64</a></li> </ul> <li class="Category">UsersAndGroups</li> <ul class="CommandMenu"> <li><a href="Add-GroupMember.html">Add-GroupMember</a></li> <li><a href="Get-Group.html">Get-Group</a></li> <li><a href="Get-User.html">Get-User</a></li> <li><a href="Get-WmiLocalUserAccount.html">Get-WmiLocalUserAccount</a></li> <li><a href="Install-Group.html">Install-Group</a></li> <li><a href="Install-User.html">Install-User</a></li> <li><a href="Remove-GroupMember.html">Remove-GroupMember</a></li> <li><a href="Resolve-Identity.html">Resolve-Identity</a></li> <li><a href="Test-Group.html">Test-Group</a></li> <li><a href="Test-Identity.html">Test-Identity</a></li> <li><a href="Test-User.html">Test-User</a></li> <li><a href="Uninstall-User.html">Uninstall-User</a></li> </ul> <li class="Category">WindowsFeatures</li> <ul class="CommandMenu"> <li><a href="Get-WindowsFeature.html">Get-WindowsFeature</a></li> <li><a href="Install-WindowsFeature.html">Install-WindowsFeature</a></li> <li><a href="Test-WindowsFeature.html">Test-WindowsFeature</a></li> <li><a href="Uninstall-WindowsFeature.html">Uninstall-WindowsFeature</a></li> </ul> <li class="Category">Xml</li> <ul class="CommandMenu"> <li><a href="Convert-XmlFile.html">Convert-XmlFile</a></li> </ul> </ul> </div> <h1>Set-HostsEntry</h1> <div><p>Sets a hosts entry in a hosts file.</p></div> <h2>Syntax</h2> <pre class="Syntax"><code>Set-HostsEntry [-IPAddress] &lt;IPAddress&gt; [-HostName] &lt;String&gt; [[-Description] &lt;String&gt;] [[-Path] &lt;String&gt;] [-WhatIf] [-Confirm] [&lt;CommonParameters&gt;]</code></pre> <h2>Description</h2> <div class="Description"> <p>Sets the IP address for a given hostname. If the hostname doesn't exist in the hosts file, appends a new entry to the end. If the hostname does exist, its IP address gets updated. If you supply a description, it is appended to the line as a comment.</p> <p>If any duplicate hosts entries are found, they are commented out; Windows uses the first duplicate entry.</p> <p>This function scans the entire hosts file. If you have a large hosts file, and are updating multiple entries, this function will be slow.</p> <p>You can operate on a custom hosts file, too. Pass its path with the <code>Path</code> parameter.</p> <p>Sometimes the system's hosts file is in use and locked when you try to update it. The <code>Set-HostsEntry</code> function tries 10 times to set a hosts entry before giving up and writing an error. It waits a random amount of time (from 0 to 1000 milliseconds) between each attempt.</p> </div> <h2> Parameters </h2> <table border='1'> <tr> <th>Name</th> <th>Type</th> <th>Description</th> <th>Required?</th> <th>Pipeline Input</th> <th>Default Value</th> </tr> <tr valign='top'> <td>IPAddress</td> <td><a href="http://msdn.microsoft.com/en-us/library/system.net.ipaddress.aspx">IPAddress</a></td> <td>The IP address for the hosts entry.</td> <td>true</td> <td>false</td> <td></td> </tr> <tr valign='top'> <td>HostName</td> <td><a href="http://msdn.microsoft.com/en-us/library/system.string.aspx">String</a></td> <td>The hostname for the hosts entry.</td> <td>true</td> <td>false</td> <td></td> </tr> <tr valign='top'> <td>Description</td> <td><a href="http://msdn.microsoft.com/en-us/library/system.string.aspx">String</a></td> <td>An optional description of the hosts entry.</td> <td>false</td> <td>false</td> <td></td> </tr> <tr valign='top'> <td>Path</td> <td><a href="http://msdn.microsoft.com/en-us/library/system.string.aspx">String</a></td> <td>The path to the hosts file where the entry should be set. Defaults to the local computer's hosts file.</td> <td>false</td> <td>false</td> <td>(Get-PathToHostsFile)</td> </tr> <tr valign='top'> <td>WhatIf</td> <td><a href="http://msdn.microsoft.com/en-us/library/system.management.automation.switchparameter.aspx">SwitchParameter</a></td> <td></td> <td>false</td> <td>false</td> <td></td> </tr> <tr valign='top'> <td>Confirm</td> <td><a href="http://msdn.microsoft.com/en-us/library/system.management.automation.switchparameter.aspx">SwitchParameter</a></td> <td></td> <td>false</td> <td>false</td> <td></td> </tr> <tr valign="top"> <td><a href="http://technet.microsoft.com/en-us/library/dd315352.aspx">CommonParameters</a></td> <td></td> <td>This cmdlet supports common parameters. For more information type <br> <code>Get-Help about_CommonParameters</code>.</td> <td></td> <td></td> <td></td> </tr> </table> <h2>EXAMPLE 1</h2> <pre><code>Set-HostsEntry -IPAddress 10.2.3.4 -HostName 'myserver' -Description "myserver's IP address"</code></pre> <p>If your hosts file contains the following:</p> <pre><code>127.0.0.1 localhost </code></pre> <p>After running this command, it will contain the following:</p> <pre><code>127.0.0.1 localhost 10.2.3.4 myserver # myserver's IP address </code></pre> <h2>EXAMPLE 2</h2> <pre><code>Set-HostsEntry -IPAddress 10.5.6.7 -HostName 'myserver'</code></pre> <p>If your hosts file contains the following:</p> <pre><code>127.0.0.1 localhost 10.2.3.4 myserver # myserver's IP address </code></pre> <p>After running this command, it will contain the following:</p> <pre><code>127.0.0.1 localhost 10.5.6.7 myserver </code></pre> </body> </html>
{ "content_hash": "f532e7c9bbe8ad92baf94bc4d6bcc07f", "timestamp": "", "source": "github", "line_count": 424, "max_line_length": 289, "avg_line_length": 48.908018867924525, "alnum_prop": 0.6847663596470077, "repo_name": "MattHubble/carbon", "id": "173ce623c18c9866e6f9b5b0ba8288ee4d8a3ed7", "size": "20737", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Website/help/Set-HostsEntry.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "120589" }, { "name": "CSS", "bytes": "3345" }, { "name": "HTML", "bytes": "3922524" }, { "name": "PowerShell", "bytes": "1645017" } ], "symlink_target": "" }
{- TRANSFORMERZ - Monad Transformer in vanilla Haskell Nothing imported - just code Author: Marco Faustinelli (contacts@faustinelli.net) Web: http://faustinelli.net/ http://faustinelli.wordpress.com/ Version: 1.0 The MIT License - Copyright (c) 2015 Transformerz Project -} {-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, FunctionalDependencies, StandaloneDeriving, FlexibleContexts, UndecidableInstances, DeriveFunctor #-} module Nilsson_02 where -- WriterT import Data.Maybe import Data.Monoid import qualified Data.Map as Map import Control.Applicative import Text.Show.Functions import Nilsson_01 newtype WT w m a = WT (m (a, w)) deriving instance Show (m (a, w)) => Show (WT w m a) deriving instance Eq (m (a, w)) => Eq (WT w m a) unWT :: (Monoid w, Monad m) => WT w m a -> m (a, w) unWT (WT mcaw) = mcaw runWT :: (Monoid w, Monad m) => WT w m a -> m a runWT mcaw = do (aa, _) <- unWT mcaw return aa instance (Monoid w, Monad m) => Monad (WT w m) where return x = WT (return (x, mempty)) wtmcaw >>= fawtwmb = WT $ do (a, w1) <- unWT wtmcaw (b, w2) <- unWT (fawtwmb a) return (b, mappend w1 w2) instance (Monoid w, Functor m, Monad m) => Applicative (WT w m) where pure = return -- af (a -> b) <*> af a -> af b -- (a -> b, w) <*> (a, w) -> (b, w) wtwmfab <*> wtwma = WT $ do (fab, w1) <- unWT wtwmfab (a, w2) <- unWT wtwma return (fab a, mappend w1 w2) instance (Monoid w, Functor m, Monad m) => Functor (WT w m) where fmap fab wtwma = WT $ do (a, w) <- unWT wtwma return (fab a, w) --------------------------------------------- -- kind of MonadWriter class (Monoid w, Monad m) => W w m | m -> w where -- tell w is an action that produces the output w tell :: w -> m () -- listen m is an action that executes action m and adds its output to the value of the computation listen :: m a -> m (a, w) -- pass m is an action that executes action m (which returns a value and a function) and returns the value applying the function to the output -- pass :: m (a, w -> w) -> m a instance (Monoid w, Monad m) => W w (WT w m) where --tell :: (Monoid w, Monad m) => w -> WT w m () tell msg = WT $ return ((), msg) --listen :: (Monoid w, Monad m) => WT w m a -> WT w m (a, w) listen ma = WT $ do (a, w) <- unWT ma return ((a, w), w) -- listen ma = do a <- ma -- return (a, mempty) instance (Monoid w, Monad m) => MonadTransformer (WT w) m where -- lift :: m a -> t m a -- lift :: m a -> WT w m a = WT (m (a, w)) lift ma = WT $ do a <- ma return (a, mempty) ------------- ET + WT ----------------- type Eval4c a = ET (WT [String] I) a -- = ET (WT [String] I) (Maybe a) -- = ET (WT I(Maybe a, [String])) runEval4c :: Eval4c Value -> (Maybe Value, [String]) runEval4c etwticmaybevalstrarra = unI $ unWT $ unET etwticmaybevalstrarra eval4c :: Env -> Exp -> Eval4c Value eval4c env (Lit i) = do lift $ tell ["literal"] return $ IntVal i eval4c env (Var name) = do lift $ tell ["lookup " ++ name] case (Map.lookup name env) of Just val -> do lift $ tell ["lookup ok"] return $ val Nothing -> do lift $ tell ["lookup ko"] eFail eval4c env (Plus e1 e2) = do lift $ tell ["sum"] v1 <- eval4c env e1 v2 <- eval4c env e2 case (v1, v2) of (IntVal i1, IntVal i2) -> do lift $ tell ["sum ok"] return $ IntVal (i1 + i2) _ -> do lift $ tell ["sum ko"] eFail eval4c env (Lambda argname body) = do lift $ tell ["lambda"] return $ FunVal argname body env eval4c env (App lambda exp) = do lift $ tell ["application"] val <- eval4c env exp funval <- eval4c env lambda case funval of FunVal argname body env' -> do lift $ tell ["application ok"] eval4c (Map.insert argname val env') body _ -> do lift $ tell ["application ko"] eFail ------------- ET + WT + ST ----------------- type Eval4d s a = ET (WT [String] (ST s I)) a -- = ET (WT [String] (ST s I)) (Maybe a) -- = ET (WT (ST s I)(Maybe a, [String])) -- = ET (WT (ST (s -> I((Maybe a, [String]), s)))) runEval4d :: Int -> Eval4d Int Value -> ((Maybe Value, [String]), Int) runEval4d s etwtstinticcmaybevalstrarraint = unI $ unST (unWT (unET etwtstinticcmaybevalstrarraint)) s eval4d :: Env -> Exp -> Eval4d Int Value eval4d env (Lit i) = do lift $ lift tick lift $ tell ["literal"] return $ IntVal i eval4d env (Var name) = do lift $ lift tick lift $ tell ["lookup " ++ name] case (Map.lookup name env) of (Just val) -> do lift $ tell ["lookup ok"] return $ val Nothing -> do lift $ tell ["lookup ko"] eFail eval4d env (Plus e1 e2) = do lift $ lift tick lift $ tell ["sum"] v1 <- eval4d env e1 v2 <- eval4d env e2 case (v1, v2) of (IntVal i1, IntVal i2) -> do lift $ tell ["sum ok"] return $ IntVal $ i1 + i2 _ -> do lift $ tell ["sum ko"] eFail eval4d env (Lambda argname body) = do lift $ lift tick lift $ tell ["lambda"] return $ FunVal argname body env eval4d env (App lambda exp) = do lift $ lift tick lift $ tell ["application"] val <- eval4d env exp funval <- eval4d env lambda case funval of FunVal argname body env' -> do lift $ tell ["application ok"] eval4d (Map.insert argname val env') body _ -> do lift $ tell ["application ko"] eFail --
{ "content_hash": "941cfa66eec745dea6ab68e7a9521232", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 156, "avg_line_length": 40.208333333333336, "alnum_prop": 0.4698741672834937, "repo_name": "Muzietto/transformerz", "id": "c1ec9befd428c6edddc30f6e0d3523dc329283ae", "size": "6755", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "haskell/nilsson/Nilsson_02.hs", "mode": "33188", "license": "mit", "language": [ { "name": "Haskell", "bytes": "167621" } ], "symlink_target": "" }