code stringlengths 4 991k | repo_name stringlengths 6 116 | path stringlengths 4 249 | language stringclasses 30 values | license stringclasses 15 values | size int64 4 991k | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|
$(function() {
(function() {
$('.j_toClass').each(function(index, el) {
var $it = $(this);
var targetTo = $it.attr('data-target');
var thisTo = $it.attr('data-this');
var targetId = $it.attr('href');
var $target = $(targetId);
var _fn = {
on: function() {
$target.addClass(targetTo);
$it.addClass(thisTo);
},
off: function() {
$target.removeClass(targetTo);
$it.removeClass(thisTo);
}
};
targetTo = targetTo && targetTo !== '' ? targetTo : 'on';
thisTo = thisTo && thisTo !== '' ? thisTo : 'on';
$it.on('click', function(e) {
e.preventDefault;
}).on('mouseenter', function() {
_fn.on();
return false;
}).on('mouseleave', function() {
_fn.off();
return false;
});
});
})();
$('.j-tab').on('click','a',function(e){
e.preventDefault();
var $it=$(this);
var targetId=$it.attr('href');
var $target=$(targetId);
$it.addClass('on').siblings('.on').removeClass('on');
$target.addClass('on').siblings('.on').removeClass('on');
$target.find('img[data-src]').each(function(index, el) {
var $it=$(this);
var src=$it.attr('data-src');
$it.attr('src',src).removeAttr('data-src');
});
});
//弹出框
$('body').on('click','.modal-close, .modal .j-close',function(e){
e.preventDefault();
var $it=$(this);
var $moldal=$it.parents('.modal');
$it.parents('.modal').removeClass('on');
}).on('click','.j-modal',function(e){
e.preventDefault();
var $it=$(this);
var targetId=$it.attr('href');
var $target=$(targetId);
$target.addClass('on');
});
}); | pro27/kezhanbang-m | static/global/js/global.js | JavaScript | gpl-3.0 | 1,583 | [
30522,
1002,
1006,
3853,
1006,
1007,
1063,
1006,
3853,
1006,
1007,
1063,
1002,
1006,
1005,
1012,
1046,
1035,
2000,
26266,
1005,
1007,
1012,
2169,
1006,
3853,
1006,
5950,
1010,
3449,
1007,
1063,
13075,
1002,
2009,
1027,
1002,
1006,
2023,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
if(!class_exists('AbstractQueuedJob')) return;
/**
* A Job for running a external link check for published pages
*
*/
class CheckLinksJob extends AbstractQueuedJob implements QueuedJob {
public function getTitle() {
return _t('CheckLinksJob.TITLE', 'Checking for broken links');
}
public function getJobType() {
return QueuedJob::QUEUED;
}
public function getSignature() {
return md5(get_class($this));
}
/**
* Check an individual page
*/
public function process() {
$task = CheckLinksTask::create();
$track = $task->runLinksCheck(1);
$this->currentStep = $track->CompletedPages;
$this->totalSteps = $track->TotalPages;
$this->isComplete = $track->Status === 'Completed';
}
}
| blpraveen/silverstripe-brokenlinks | code/jobs/CheckLinksJob.php | PHP | bsd-3-clause | 722 | [
30522,
1026,
1029,
25718,
2065,
1006,
999,
2465,
1035,
6526,
1006,
1005,
10061,
4226,
5657,
2094,
5558,
2497,
1005,
1007,
1007,
2709,
1025,
1013,
1008,
1008,
1008,
1037,
3105,
2005,
2770,
1037,
6327,
4957,
4638,
2005,
2405,
5530,
1008,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/**
* @file
* Packet buffer management
*
* Packets are built from the pbuf data structure. It supports dynamic
* memory allocation for packet contents or can reference externally
* managed packet contents both in RAM and ROM. Quick allocation for
* incoming packets is provided through pools with fixed sized pbufs.
*
* A packet may span over multiple pbufs, chained as a singly linked
* list. This is called a "pbuf chain".
*
* Multiple packets may be queued, also using this singly linked list.
* This is called a "packet queue".
*
* So, a packet queue consists of one or more pbuf chains, each of
* which consist of one or more pbufs. CURRENTLY, PACKET QUEUES ARE
* NOT SUPPORTED!!! Use helper structs to queue multiple packets.
*
* The differences between a pbuf chain and a packet queue are very
* precise but subtle.
*
* The last pbuf of a packet has a ->tot_len field that equals the
* ->len field. It can be found by traversing the list. If the last
* pbuf of a packet has a ->next field other than NULL, more packets
* are on the queue.
*
* Therefore, looping through a pbuf of a single packet, has an
* loop end condition (tot_len == p->len), NOT (next == NULL).
*/
/*
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. 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.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
*
* This file is part of the lwIP TCP/IP stack.
*
* Author: Adam Dunkels <adam@sics.se>
*
*/
#include "lwip/opt.h"
#include "lwip/stats.h"
#include "lwip/def.h"
#include "lwip/mem.h"
#include "lwip/memp.h"
#include "lwip/pbuf.h"
#include "lwip/sys.h"
#if LWIP_TCP && TCP_QUEUE_OOSEQ
#include "lwip/tcp_impl.h"
#endif
#if LWIP_CHECKSUM_ON_COPY
#include "lwip/inet_chksum.h"
#endif
#include <lwk/string.h>
#define SIZEOF_STRUCT_PBUF LWIP_MEM_ALIGN_SIZE(sizeof(struct pbuf))
/* Since the pool is created in memp, PBUF_POOL_BUFSIZE will be automatically
aligned there. Therefore, PBUF_POOL_BUFSIZE_ALIGNED can be used here. */
#define PBUF_POOL_BUFSIZE_ALIGNED LWIP_MEM_ALIGN_SIZE(PBUF_POOL_BUFSIZE)
#if !LWIP_TCP || !TCP_QUEUE_OOSEQ || !PBUF_POOL_FREE_OOSEQ
#define PBUF_POOL_IS_EMPTY()
#else /* !LWIP_TCP || !TCP_QUEUE_OOSEQ || !PBUF_POOL_FREE_OOSEQ */
#if !NO_SYS
#ifndef PBUF_POOL_FREE_OOSEQ_QUEUE_CALL
#include "lwip/tcpip.h"
#define PBUF_POOL_FREE_OOSEQ_QUEUE_CALL() do { \
if(tcpip_callback_with_block(pbuf_free_ooseq_callback, NULL, 0) != ERR_OK) { \
SYS_ARCH_PROTECT(old_level); \
pbuf_free_ooseq_pending = 0; \
SYS_ARCH_UNPROTECT(old_level); \
} } while(0)
#endif /* PBUF_POOL_FREE_OOSEQ_QUEUE_CALL */
#endif /* !NO_SYS */
volatile u8_t pbuf_free_ooseq_pending;
#define PBUF_POOL_IS_EMPTY() pbuf_pool_is_empty()
/**
* Attempt to reclaim some memory from queued out-of-sequence TCP segments
* if we run out of pool pbufs. It's better to give priority to new packets
* if we're running out.
*
* This must be done in the correct thread context therefore this function
* can only be used with NO_SYS=0 and through tcpip_callback.
*/
#if !NO_SYS
static
#endif /* !NO_SYS */
void
pbuf_free_ooseq(void)
{
struct tcp_pcb* pcb;
SYS_ARCH_DECL_PROTECT(old_level);
SYS_ARCH_PROTECT(old_level);
pbuf_free_ooseq_pending = 0;
SYS_ARCH_UNPROTECT(old_level);
for (pcb = tcp_active_pcbs; NULL != pcb; pcb = pcb->next) {
if (NULL != pcb->ooseq) {
/** Free the ooseq pbufs of one PCB only */
LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_free_ooseq: freeing out-of-sequence pbufs\n"));
tcp_segs_free(pcb->ooseq);
pcb->ooseq = NULL;
return;
}
}
}
#if !NO_SYS
/**
* Just a callback function for tcpip_timeout() that calls pbuf_free_ooseq().
*/
static void
pbuf_free_ooseq_callback(void *arg)
{
LWIP_UNUSED_ARG(arg);
pbuf_free_ooseq();
}
#endif /* !NO_SYS */
/** Queue a call to pbuf_free_ooseq if not already queued. */
static void
pbuf_pool_is_empty(void)
{
#ifndef PBUF_POOL_FREE_OOSEQ_QUEUE_CALL
SYS_ARCH_DECL_PROTECT(old_level);
SYS_ARCH_PROTECT(old_level);
pbuf_free_ooseq_pending = 1;
SYS_ARCH_UNPROTECT(old_level);
#else /* PBUF_POOL_FREE_OOSEQ_QUEUE_CALL */
u8_t queued;
SYS_ARCH_DECL_PROTECT(old_level);
SYS_ARCH_PROTECT(old_level);
queued = pbuf_free_ooseq_pending;
pbuf_free_ooseq_pending = 1;
SYS_ARCH_UNPROTECT(old_level);
if(!queued) {
/* queue a call to pbuf_free_ooseq if not already queued */
PBUF_POOL_FREE_OOSEQ_QUEUE_CALL();
}
#endif /* PBUF_POOL_FREE_OOSEQ_QUEUE_CALL */
}
#endif /* !LWIP_TCP || !TCP_QUEUE_OOSEQ || !PBUF_POOL_FREE_OOSEQ */
/**
* Allocates a pbuf of the given type (possibly a chain for PBUF_POOL type).
*
* The actual memory allocated for the pbuf is determined by the
* layer at which the pbuf is allocated and the requested size
* (from the size parameter).
*
* @param layer flag to define header size
* @param length size of the pbuf's payload
* @param type this parameter decides how and where the pbuf
* should be allocated as follows:
*
* - PBUF_RAM: buffer memory for pbuf is allocated as one large
* chunk. This includes protocol headers as well.
* - PBUF_ROM: no buffer memory is allocated for the pbuf, even for
* protocol headers. Additional headers must be prepended
* by allocating another pbuf and chain in to the front of
* the ROM pbuf. It is assumed that the memory used is really
* similar to ROM in that it is immutable and will not be
* changed. Memory which is dynamic should generally not
* be attached to PBUF_ROM pbufs. Use PBUF_REF instead.
* - PBUF_REF: no buffer memory is allocated for the pbuf, even for
* protocol headers. It is assumed that the pbuf is only
* being used in a single thread. If the pbuf gets queued,
* then pbuf_take should be called to copy the buffer.
* - PBUF_POOL: the pbuf is allocated as a pbuf chain, with pbufs from
* the pbuf pool that is allocated during pbuf_init().
*
* @return the allocated pbuf. If multiple pbufs where allocated, this
* is the first pbuf of a pbuf chain.
*/
struct pbuf *
pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
{
struct pbuf *p, *q, *r;
u16_t offset;
s32_t rem_len; /* remaining length */
LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloc(length=%"U16_F")\n", length));
/* determine header offset */
switch (layer) {
case PBUF_TRANSPORT:
/* add room for transport (often TCP) layer header */
offset = PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN;
break;
case PBUF_IP:
/* add room for IP layer header */
offset = PBUF_LINK_HLEN + PBUF_IP_HLEN;
break;
case PBUF_LINK:
/* add room for link layer header */
offset = PBUF_LINK_HLEN;
break;
case PBUF_RAW:
offset = 0;
break;
default:
LWIP_ASSERT("pbuf_alloc: bad pbuf layer", 0);
return NULL;
}
switch (type) {
case PBUF_POOL:
/* allocate head of pbuf chain into p */
p = (struct pbuf *)memp_malloc(MEMP_PBUF_POOL);
LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloc: allocated pbuf %p\n", (void *)p));
if (p == NULL) {
PBUF_POOL_IS_EMPTY();
return NULL;
}
p->type = type;
p->next = NULL;
/* make the payload pointer point 'offset' bytes into pbuf data memory */
p->payload = LWIP_MEM_ALIGN((void *)((u8_t *)p + (SIZEOF_STRUCT_PBUF + offset)));
LWIP_ASSERT("pbuf_alloc: pbuf p->payload properly aligned",
((mem_ptr_t)p->payload % MEM_ALIGNMENT) == 0);
/* the total length of the pbuf chain is the requested size */
p->tot_len = length;
/* set the length of the first pbuf in the chain */
p->len = LWIP_MIN(length, PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(offset));
LWIP_ASSERT("check p->payload + p->len does not overflow pbuf",
((u8_t*)p->payload + p->len <=
(u8_t*)p + SIZEOF_STRUCT_PBUF + PBUF_POOL_BUFSIZE_ALIGNED));
LWIP_ASSERT("PBUF_POOL_BUFSIZE must be bigger than MEM_ALIGNMENT",
(PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(offset)) > 0 );
/* set reference count (needed here in case we fail) */
p->ref = 1;
/* now allocate the tail of the pbuf chain */
/* remember first pbuf for linkage in next iteration */
r = p;
/* remaining length to be allocated */
rem_len = length - p->len;
/* any remaining pbufs to be allocated? */
while (rem_len > 0) {
q = (struct pbuf *)memp_malloc(MEMP_PBUF_POOL);
if (q == NULL) {
PBUF_POOL_IS_EMPTY();
/* free chain so far allocated */
pbuf_free(p);
/* bail out unsuccesfully */
return NULL;
}
q->type = type;
q->flags = 0;
q->next = NULL;
/* make previous pbuf point to this pbuf */
r->next = q;
/* set total length of this pbuf and next in chain */
LWIP_ASSERT("rem_len < max_u16_t", rem_len < 0xffff);
q->tot_len = (u16_t)rem_len;
/* this pbuf length is pool size, unless smaller sized tail */
q->len = LWIP_MIN((u16_t)rem_len, PBUF_POOL_BUFSIZE_ALIGNED);
q->payload = (void *)((u8_t *)q + SIZEOF_STRUCT_PBUF);
LWIP_ASSERT("pbuf_alloc: pbuf q->payload properly aligned",
((mem_ptr_t)q->payload % MEM_ALIGNMENT) == 0);
LWIP_ASSERT("check p->payload + p->len does not overflow pbuf",
((u8_t*)p->payload + p->len <=
(u8_t*)p + SIZEOF_STRUCT_PBUF + PBUF_POOL_BUFSIZE_ALIGNED));
q->ref = 1;
/* calculate remaining length to be allocated */
rem_len -= q->len;
/* remember this pbuf for linkage in next iteration */
r = q;
}
/* end of chain */
/*r->next = NULL;*/
break;
case PBUF_RAM:
/* If pbuf is to be allocated in RAM, allocate memory for it. */
p = (struct pbuf*)mem_malloc(LWIP_MEM_ALIGN_SIZE(SIZEOF_STRUCT_PBUF + offset) + LWIP_MEM_ALIGN_SIZE(length));
if (p == NULL) {
return NULL;
}
/* Set up internal structure of the pbuf. */
p->payload = LWIP_MEM_ALIGN((void *)((u8_t *)p + SIZEOF_STRUCT_PBUF + offset));
p->len = p->tot_len = length;
p->next = NULL;
p->type = type;
LWIP_ASSERT("pbuf_alloc: pbuf->payload properly aligned",
((mem_ptr_t)p->payload % MEM_ALIGNMENT) == 0);
break;
/* pbuf references existing (non-volatile static constant) ROM payload? */
case PBUF_ROM:
/* pbuf references existing (externally allocated) RAM payload? */
case PBUF_REF:
/* only allocate memory for the pbuf structure */
p = (struct pbuf *)memp_malloc(MEMP_PBUF);
if (p == NULL) {
LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_LEVEL_SERIOUS,
("pbuf_alloc: Could not allocate MEMP_PBUF for PBUF_%s.\n",
(type == PBUF_ROM) ? "ROM" : "REF"));
return NULL;
}
/* caller must set this field properly, afterwards */
p->payload = NULL;
p->len = p->tot_len = length;
p->next = NULL;
p->type = type;
break;
default:
LWIP_ASSERT("pbuf_alloc: erroneous type", 0);
return NULL;
}
/* set reference count */
p->ref = 1;
/* set flags */
p->flags = 0;
LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloc(length=%"U16_F") == %p\n", length, (void *)p));
return p;
}
#if LWIP_SUPPORT_CUSTOM_PBUF
/** Initialize a custom pbuf (already allocated).
*
* @param layer flag to define header size
* @param length size of the pbuf's payload
* @param type type of the pbuf (only used to treat the pbuf accordingly, as
* this function allocates no memory)
* @param p pointer to the custom pbuf to initialize (already allocated)
* @param payload_mem pointer to the buffer that is used for payload and headers,
* must be at least big enough to hold 'length' plus the header size,
* may be NULL if set later.
* ATTENTION: The caller is responsible for correct alignment of this buffer!!
* @param payload_mem_len the size of the 'payload_mem' buffer, must be at least
* big enough to hold 'length' plus the header size
*/
struct pbuf*
pbuf_alloced_custom(pbuf_layer l, u16_t length, pbuf_type type, struct pbuf_custom *p,
void *payload_mem, u16_t payload_mem_len)
{
u16_t offset;
LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloced_custom(length=%"U16_F")\n", length));
/* determine header offset */
switch (l) {
case PBUF_TRANSPORT:
/* add room for transport (often TCP) layer header */
offset = PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN;
break;
case PBUF_IP:
/* add room for IP layer header */
offset = PBUF_LINK_HLEN + PBUF_IP_HLEN;
break;
case PBUF_LINK:
/* add room for link layer header */
offset = PBUF_LINK_HLEN;
break;
case PBUF_RAW:
offset = 0;
break;
default:
LWIP_ASSERT("pbuf_alloced_custom: bad pbuf layer", 0);
return NULL;
}
if (LWIP_MEM_ALIGN_SIZE(offset) + length > payload_mem_len) {
LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_LEVEL_WARNING, ("pbuf_alloced_custom(length=%"U16_F") buffer too short\n", length));
return NULL;
}
p->pbuf.next = NULL;
if (payload_mem != NULL) {
p->pbuf.payload = (u8_t *)payload_mem + LWIP_MEM_ALIGN_SIZE(offset);
} else {
p->pbuf.payload = NULL;
}
p->pbuf.flags = PBUF_FLAG_IS_CUSTOM;
p->pbuf.len = p->pbuf.tot_len = length;
p->pbuf.type = type;
p->pbuf.ref = 1;
return &p->pbuf;
}
#endif /* LWIP_SUPPORT_CUSTOM_PBUF */
/**
* Shrink a pbuf chain to a desired length.
*
* @param p pbuf to shrink.
* @param new_len desired new length of pbuf chain
*
* Depending on the desired length, the first few pbufs in a chain might
* be skipped and left unchanged. The new last pbuf in the chain will be
* resized, and any remaining pbufs will be freed.
*
* @note If the pbuf is ROM/REF, only the ->tot_len and ->len fields are adjusted.
* @note May not be called on a packet queue.
*
* @note Despite its name, pbuf_realloc cannot grow the size of a pbuf (chain).
*/
void
pbuf_realloc(struct pbuf *p, u16_t new_len)
{
struct pbuf *q;
u16_t rem_len; /* remaining length */
s32_t grow;
LWIP_ASSERT("pbuf_realloc: p != NULL", p != NULL);
LWIP_ASSERT("pbuf_realloc: sane p->type", p->type == PBUF_POOL ||
p->type == PBUF_ROM ||
p->type == PBUF_RAM ||
p->type == PBUF_REF);
/* desired length larger than current length? */
if (new_len >= p->tot_len) {
/* enlarging not yet supported */
return;
}
/* the pbuf chain grows by (new_len - p->tot_len) bytes
* (which may be negative in case of shrinking) */
grow = new_len - p->tot_len;
/* first, step over any pbufs that should remain in the chain */
rem_len = new_len;
q = p;
/* should this pbuf be kept? */
while (rem_len > q->len) {
/* decrease remaining length by pbuf length */
rem_len -= q->len;
/* decrease total length indicator */
LWIP_ASSERT("grow < max_u16_t", grow < 0xffff);
q->tot_len += (u16_t)grow;
/* proceed to next pbuf in chain */
q = q->next;
LWIP_ASSERT("pbuf_realloc: q != NULL", q != NULL);
}
/* we have now reached the new last pbuf (in q) */
/* rem_len == desired length for pbuf q */
/* shrink allocated memory for PBUF_RAM */
/* (other types merely adjust their length fields */
if ((q->type == PBUF_RAM) && (rem_len != q->len)) {
/* reallocate and adjust the length of the pbuf that will be split */
q = (struct pbuf *)mem_trim(q, (u16_t)((u8_t *)q->payload - (u8_t *)q) + rem_len);
LWIP_ASSERT("mem_trim returned q == NULL", q != NULL);
}
/* adjust length fields for new last pbuf */
q->len = rem_len;
q->tot_len = q->len;
/* any remaining pbufs in chain? */
if (q->next != NULL) {
/* free remaining pbufs in chain */
pbuf_free(q->next);
}
/* q is last packet in chain */
q->next = NULL;
}
/**
* Adjusts the payload pointer to hide or reveal headers in the payload.
*
* Adjusts the ->payload pointer so that space for a header
* (dis)appears in the pbuf payload.
*
* The ->payload, ->tot_len and ->len fields are adjusted.
*
* @param p pbuf to change the header size.
* @param header_size_increment Number of bytes to increment header size which
* increases the size of the pbuf. New space is on the front.
* (Using a negative value decreases the header size.)
* If hdr_size_inc is 0, this function does nothing and returns succesful.
*
* PBUF_ROM and PBUF_REF type buffers cannot have their sizes increased, so
* the call will fail. A check is made that the increase in header size does
* not move the payload pointer in front of the start of the buffer.
* @return non-zero on failure, zero on success.
*
*/
u8_t
pbuf_header(struct pbuf *p, s16_t header_size_increment)
{
u16_t type;
void *payload;
u16_t increment_magnitude;
LWIP_ASSERT("p != NULL", p != NULL);
if ((header_size_increment == 0) || (p == NULL)) {
return 0;
}
if (header_size_increment < 0){
increment_magnitude = -header_size_increment;
/* Check that we aren't going to move off the end of the pbuf */
LWIP_ERROR("increment_magnitude <= p->len", (increment_magnitude <= p->len), return 1;);
} else {
increment_magnitude = header_size_increment;
#if 0
/* Can't assert these as some callers speculatively call
pbuf_header() to see if it's OK. Will return 1 below instead. */
/* Check that we've got the correct type of pbuf to work with */
LWIP_ASSERT("p->type == PBUF_RAM || p->type == PBUF_POOL",
p->type == PBUF_RAM || p->type == PBUF_POOL);
/* Check that we aren't going to move off the beginning of the pbuf */
LWIP_ASSERT("p->payload - increment_magnitude >= p + SIZEOF_STRUCT_PBUF",
(u8_t *)p->payload - increment_magnitude >= (u8_t *)p + SIZEOF_STRUCT_PBUF);
#endif
}
type = p->type;
/* remember current payload pointer */
payload = p->payload;
/* pbuf types containing payloads? */
if (type == PBUF_RAM || type == PBUF_POOL) {
/* set new payload pointer */
p->payload = (u8_t *)p->payload - header_size_increment;
/* boundary check fails? */
if ((u8_t *)p->payload < (u8_t *)p + SIZEOF_STRUCT_PBUF) {
LWIP_DEBUGF( PBUF_DEBUG | LWIP_DBG_LEVEL_SERIOUS,
("pbuf_header: failed as %p < %p (not enough space for new header size)\n",
(void *)p->payload, (void *)(p + 1)));
/* restore old payload pointer */
p->payload = payload;
/* bail out unsuccesfully */
return 1;
}
/* pbuf types refering to external payloads? */
} else if (type == PBUF_REF || type == PBUF_ROM) {
/* hide a header in the payload? */
if ((header_size_increment < 0) && (increment_magnitude <= p->len)) {
/* increase payload pointer */
p->payload = (u8_t *)p->payload - header_size_increment;
} else {
/* cannot expand payload to front (yet!)
* bail out unsuccesfully */
return 1;
}
} else {
/* Unknown type */
LWIP_ASSERT("bad pbuf type", 0);
return 1;
}
/* modify pbuf length fields */
p->len += header_size_increment;
p->tot_len += header_size_increment;
LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_header: old %p new %p (%"S16_F")\n",
(void *)payload, (void *)p->payload, header_size_increment));
return 0;
}
/**
* Dereference a pbuf chain or queue and deallocate any no-longer-used
* pbufs at the head of this chain or queue.
*
* Decrements the pbuf reference count. If it reaches zero, the pbuf is
* deallocated.
*
* For a pbuf chain, this is repeated for each pbuf in the chain,
* up to the first pbuf which has a non-zero reference count after
* decrementing. So, when all reference counts are one, the whole
* chain is free'd.
*
* @param p The pbuf (chain) to be dereferenced.
*
* @return the number of pbufs that were de-allocated
* from the head of the chain.
*
* @note MUST NOT be called on a packet queue (Not verified to work yet).
* @note the reference counter of a pbuf equals the number of pointers
* that refer to the pbuf (or into the pbuf).
*
* @internal examples:
*
* Assuming existing chains a->b->c with the following reference
* counts, calling pbuf_free(a) results in:
*
* 1->2->3 becomes ...1->3
* 3->3->3 becomes 2->3->3
* 1->1->2 becomes ......1
* 2->1->1 becomes 1->1->1
* 1->1->1 becomes .......
*
*/
u8_t
pbuf_free(struct pbuf *p)
{
u16_t type;
struct pbuf *q;
u8_t count;
if (p == NULL) {
LWIP_ASSERT("p != NULL", p != NULL);
/* if assertions are disabled, proceed with debug output */
LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_LEVEL_SERIOUS,
("pbuf_free(p == NULL) was called.\n"));
return 0;
}
LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_free(%p)\n", (void *)p));
PERF_START;
LWIP_ASSERT("pbuf_free: sane type",
p->type == PBUF_RAM || p->type == PBUF_ROM ||
p->type == PBUF_REF || p->type == PBUF_POOL);
count = 0;
/* de-allocate all consecutive pbufs from the head of the chain that
* obtain a zero reference count after decrementing*/
while (p != NULL) {
u16_t ref;
SYS_ARCH_DECL_PROTECT(old_level);
/* Since decrementing ref cannot be guaranteed to be a single machine operation
* we must protect it. We put the new ref into a local variable to prevent
* further protection. */
SYS_ARCH_PROTECT(old_level);
/* all pbufs in a chain are referenced at least once */
LWIP_ASSERT("pbuf_free: p->ref > 0", p->ref > 0);
/* decrease reference count (number of pointers to pbuf) */
ref = --(p->ref);
SYS_ARCH_UNPROTECT(old_level);
/* this pbuf is no longer referenced to? */
if (ref == 0) {
/* remember next pbuf in chain for next iteration */
q = p->next;
LWIP_DEBUGF( PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_free: deallocating %p\n", (void *)p));
type = p->type;
#if LWIP_SUPPORT_CUSTOM_PBUF
/* is this a custom pbuf? */
if ((p->flags & PBUF_FLAG_IS_CUSTOM) != 0) {
struct pbuf_custom *pc = (struct pbuf_custom*)p;
LWIP_ASSERT("pc->custom_free_function != NULL", pc->custom_free_function != NULL);
pc->custom_free_function(p);
} else
#endif /* LWIP_SUPPORT_CUSTOM_PBUF */
{
/* is this a pbuf from the pool? */
if (type == PBUF_POOL) {
memp_free(MEMP_PBUF_POOL, p);
/* is this a ROM or RAM referencing pbuf? */
} else if (type == PBUF_ROM || type == PBUF_REF) {
memp_free(MEMP_PBUF, p);
/* type == PBUF_RAM */
} else {
mem_free(p);
}
}
count++;
/* proceed to next pbuf */
p = q;
/* p->ref > 0, this pbuf is still referenced to */
/* (and so the remaining pbufs in chain as well) */
} else {
LWIP_DEBUGF( PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_free: %p has ref %"U16_F", ending here.\n", (void *)p, ref));
/* stop walking through the chain */
p = NULL;
}
}
PERF_STOP("pbuf_free");
/* return number of de-allocated pbufs */
return count;
}
/**
* Count number of pbufs in a chain
*
* @param p first pbuf of chain
* @return the number of pbufs in a chain
*/
u8_t
pbuf_clen(struct pbuf *p)
{
u8_t len;
len = 0;
while (p != NULL) {
++len;
p = p->next;
}
return len;
}
/**
* Increment the reference count of the pbuf.
*
* @param p pbuf to increase reference counter of
*
*/
void
pbuf_ref(struct pbuf *p)
{
SYS_ARCH_DECL_PROTECT(old_level);
/* pbuf given? */
if (p != NULL) {
SYS_ARCH_PROTECT(old_level);
++(p->ref);
SYS_ARCH_UNPROTECT(old_level);
}
}
/**
* Concatenate two pbufs (each may be a pbuf chain) and take over
* the caller's reference of the tail pbuf.
*
* @note The caller MAY NOT reference the tail pbuf afterwards.
* Use pbuf_chain() for that purpose.
*
* @see pbuf_chain()
*/
void
pbuf_cat(struct pbuf *h, struct pbuf *t)
{
struct pbuf *p;
LWIP_ERROR("(h != NULL) && (t != NULL) (programmer violates API)",
((h != NULL) && (t != NULL)), return;);
/* proceed to last pbuf of chain */
for (p = h; p->next != NULL; p = p->next) {
/* add total length of second chain to all totals of first chain */
p->tot_len += t->tot_len;
}
/* { p is last pbuf of first h chain, p->next == NULL } */
LWIP_ASSERT("p->tot_len == p->len (of last pbuf in chain)", p->tot_len == p->len);
LWIP_ASSERT("p->next == NULL", p->next == NULL);
/* add total length of second chain to last pbuf total of first chain */
p->tot_len += t->tot_len;
/* chain last pbuf of head (p) with first of tail (t) */
p->next = t;
/* p->next now references t, but the caller will drop its reference to t,
* so netto there is no change to the reference count of t.
*/
}
/**
* Chain two pbufs (or pbuf chains) together.
*
* The caller MUST call pbuf_free(t) once it has stopped
* using it. Use pbuf_cat() instead if you no longer use t.
*
* @param h head pbuf (chain)
* @param t tail pbuf (chain)
* @note The pbufs MUST belong to the same packet.
* @note MAY NOT be called on a packet queue.
*
* The ->tot_len fields of all pbufs of the head chain are adjusted.
* The ->next field of the last pbuf of the head chain is adjusted.
* The ->ref field of the first pbuf of the tail chain is adjusted.
*
*/
void
pbuf_chain(struct pbuf *h, struct pbuf *t)
{
pbuf_cat(h, t);
/* t is now referenced by h */
pbuf_ref(t);
LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_chain: %p references %p\n", (void *)h, (void *)t));
}
/**
* Dechains the first pbuf from its succeeding pbufs in the chain.
*
* Makes p->tot_len field equal to p->len.
* @param p pbuf to dechain
* @return remainder of the pbuf chain, or NULL if it was de-allocated.
* @note May not be called on a packet queue.
*/
struct pbuf *
pbuf_dechain(struct pbuf *p)
{
struct pbuf *q;
u8_t tail_gone = 1;
/* tail */
q = p->next;
/* pbuf has successor in chain? */
if (q != NULL) {
/* assert tot_len invariant: (p->tot_len == p->len + (p->next? p->next->tot_len: 0) */
LWIP_ASSERT("p->tot_len == p->len + q->tot_len", q->tot_len == p->tot_len - p->len);
/* enforce invariant if assertion is disabled */
q->tot_len = p->tot_len - p->len;
/* decouple pbuf from remainder */
p->next = NULL;
/* total length of pbuf p is its own length only */
p->tot_len = p->len;
/* q is no longer referenced by p, free it */
LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_dechain: unreferencing %p\n", (void *)q));
tail_gone = pbuf_free(q);
if (tail_gone > 0) {
LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE,
("pbuf_dechain: deallocated %p (as it is no longer referenced)\n", (void *)q));
}
/* return remaining tail or NULL if deallocated */
}
/* assert tot_len invariant: (p->tot_len == p->len + (p->next? p->next->tot_len: 0) */
LWIP_ASSERT("p->tot_len == p->len", p->tot_len == p->len);
return ((tail_gone > 0) ? NULL : q);
}
/**
*
* Create PBUF_RAM copies of pbufs.
*
* Used to queue packets on behalf of the lwIP stack, such as
* ARP based queueing.
*
* @note You MUST explicitly use p = pbuf_take(p);
*
* @note Only one packet is copied, no packet queue!
*
* @param p_to pbuf destination of the copy
* @param p_from pbuf source of the copy
*
* @return ERR_OK if pbuf was copied
* ERR_ARG if one of the pbufs is NULL or p_to is not big
* enough to hold p_from
*/
err_t
pbuf_copy(struct pbuf *p_to, struct pbuf *p_from)
{
u16_t offset_to=0, offset_from=0, len;
LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_copy(%p, %p)\n",
(void*)p_to, (void*)p_from));
/* is the target big enough to hold the source? */
LWIP_ERROR("pbuf_copy: target not big enough to hold source", ((p_to != NULL) &&
(p_from != NULL) && (p_to->tot_len >= p_from->tot_len)), return ERR_ARG;);
/* iterate through pbuf chain */
do
{
/* copy one part of the original chain */
if ((p_to->len - offset_to) >= (p_from->len - offset_from)) {
/* complete current p_from fits into current p_to */
len = p_from->len - offset_from;
} else {
/* current p_from does not fit into current p_to */
len = p_to->len - offset_to;
}
MEMCPY((u8_t*)p_to->payload + offset_to, (u8_t*)p_from->payload + offset_from, len);
offset_to += len;
offset_from += len;
LWIP_ASSERT("offset_to <= p_to->len", offset_to <= p_to->len);
LWIP_ASSERT("offset_from <= p_from->len", offset_from <= p_from->len);
if (offset_from >= p_from->len) {
/* on to next p_from (if any) */
offset_from = 0;
p_from = p_from->next;
}
if (offset_to == p_to->len) {
/* on to next p_to (if any) */
offset_to = 0;
p_to = p_to->next;
LWIP_ERROR("p_to != NULL", (p_to != NULL) || (p_from == NULL) , return ERR_ARG;);
}
if((p_from != NULL) && (p_from->len == p_from->tot_len)) {
/* don't copy more than one packet! */
LWIP_ERROR("pbuf_copy() does not allow packet queues!\n",
(p_from->next == NULL), return ERR_VAL;);
}
if((p_to != NULL) && (p_to->len == p_to->tot_len)) {
/* don't copy more than one packet! */
LWIP_ERROR("pbuf_copy() does not allow packet queues!\n",
(p_to->next == NULL), return ERR_VAL;);
}
} while (p_from);
LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_copy: end of chain reached.\n"));
return ERR_OK;
}
/**
* Copy (part of) the contents of a packet buffer
* to an application supplied buffer.
*
* @param buf the pbuf from which to copy data
* @param dataptr the application supplied buffer
* @param len length of data to copy (dataptr must be big enough). No more
* than buf->tot_len will be copied, irrespective of len
* @param offset offset into the packet buffer from where to begin copying len bytes
* @return the number of bytes copied, or 0 on failure
*/
u16_t
pbuf_copy_partial(struct pbuf *buf, void *dataptr, u16_t len, u16_t offset)
{
struct pbuf *p;
u16_t left;
u16_t buf_copy_len;
u16_t copied_total = 0;
LWIP_ERROR("pbuf_copy_partial: invalid buf", (buf != NULL), return 0;);
LWIP_ERROR("pbuf_copy_partial: invalid dataptr", (dataptr != NULL), return 0;);
left = 0;
if((buf == NULL) || (dataptr == NULL)) {
return 0;
}
/* Note some systems use byte copy if dataptr or one of the pbuf payload pointers are unaligned. */
for(p = buf; len != 0 && p != NULL; p = p->next) {
if ((offset != 0) && (offset >= p->len)) {
/* don't copy from this buffer -> on to the next */
offset -= p->len;
} else {
/* copy from this buffer. maybe only partially. */
buf_copy_len = p->len - offset;
if (buf_copy_len > len)
buf_copy_len = len;
/* copy the necessary parts of the buffer */
MEMCPY(&((char*)dataptr)[left], &((char*)p->payload)[offset], buf_copy_len);
copied_total += buf_copy_len;
left += buf_copy_len;
len -= buf_copy_len;
offset = 0;
}
}
return copied_total;
}
/**
* Copy application supplied data into a pbuf.
* This function can only be used to copy the equivalent of buf->tot_len data.
*
* @param buf pbuf to fill with data
* @param dataptr application supplied data buffer
* @param len length of the application supplied data buffer
*
* @return ERR_OK if successful, ERR_MEM if the pbuf is not big enough
*/
err_t
pbuf_take(struct pbuf *buf, const void *dataptr, u16_t len)
{
struct pbuf *p;
u16_t buf_copy_len;
u16_t total_copy_len = len;
u16_t copied_total = 0;
LWIP_ERROR("pbuf_take: invalid buf", (buf != NULL), return 0;);
LWIP_ERROR("pbuf_take: invalid dataptr", (dataptr != NULL), return 0;);
if ((buf == NULL) || (dataptr == NULL) || (buf->tot_len < len)) {
return ERR_ARG;
}
/* Note some systems use byte copy if dataptr or one of the pbuf payload pointers are unaligned. */
for(p = buf; total_copy_len != 0; p = p->next) {
LWIP_ASSERT("pbuf_take: invalid pbuf", p != NULL);
buf_copy_len = total_copy_len;
if (buf_copy_len > p->len) {
/* this pbuf cannot hold all remaining data */
buf_copy_len = p->len;
}
/* copy the necessary parts of the buffer */
MEMCPY(p->payload, &((char*)dataptr)[copied_total], buf_copy_len);
total_copy_len -= buf_copy_len;
copied_total += buf_copy_len;
}
LWIP_ASSERT("did not copy all data", total_copy_len == 0 && copied_total == len);
return ERR_OK;
}
/**
* Creates a single pbuf out of a queue of pbufs.
*
* @remark: Either the source pbuf 'p' is freed by this function or the original
* pbuf 'p' is returned, therefore the caller has to check the result!
*
* @param p the source pbuf
* @param layer pbuf_layer of the new pbuf
*
* @return a new, single pbuf (p->next is NULL)
* or the old pbuf if allocation fails
*/
struct pbuf*
pbuf_coalesce(struct pbuf *p, pbuf_layer layer)
{
struct pbuf *q;
err_t err;
if (p->next == NULL) {
return p;
}
q = pbuf_alloc(layer, p->tot_len, PBUF_RAM);
if (q == NULL) {
/* @todo: what do we do now? */
return p;
}
err = pbuf_copy(q, p);
LWIP_ASSERT("pbuf_copy failed", err == ERR_OK);
pbuf_free(p);
return q;
}
#if LWIP_CHECKSUM_ON_COPY
/**
* Copies data into a single pbuf (*not* into a pbuf queue!) and updates
* the checksum while copying
*
* @param p the pbuf to copy data into
* @param start_offset offset of p->payload where to copy the data to
* @param dataptr data to copy into the pbuf
* @param len length of data to copy into the pbuf
* @param chksum pointer to the checksum which is updated
* @return ERR_OK if successful, another error if the data does not fit
* within the (first) pbuf (no pbuf queues!)
*/
err_t
pbuf_fill_chksum(struct pbuf *p, u16_t start_offset, const void *dataptr,
u16_t len, u16_t *chksum)
{
u32_t acc;
u16_t copy_chksum;
char *dst_ptr;
LWIP_ASSERT("p != NULL", p != NULL);
LWIP_ASSERT("dataptr != NULL", dataptr != NULL);
LWIP_ASSERT("chksum != NULL", chksum != NULL);
LWIP_ASSERT("len != 0", len != 0);
if ((start_offset >= p->len) || (start_offset + len > p->len)) {
return ERR_ARG;
}
dst_ptr = ((char*)p->payload) + start_offset;
copy_chksum = LWIP_CHKSUM_COPY(dst_ptr, dataptr, len);
if ((start_offset & 1) != 0) {
copy_chksum = SWAP_BYTES_IN_WORD(copy_chksum);
}
acc = *chksum;
acc += copy_chksum;
*chksum = FOLD_U32T(acc);
return ERR_OK;
}
#endif /* LWIP_CHECKSUM_ON_COPY */
/** Get one byte from the specified position in a pbuf
* WARNING: returns zero for offset >= p->tot_len
*
* @param p pbuf to parse
* @param offset offset into p of the byte to return
* @return byte at an offset into p OR ZERO IF 'offset' >= p->tot_len
*/
u8_t
pbuf_get_at(struct pbuf* p, u16_t offset)
{
u16_t copy_from = offset;
struct pbuf* q = p;
/* get the correct pbuf */
while ((q != NULL) && (q->len <= copy_from)) {
copy_from -= q->len;
q = q->next;
}
/* return requested data if pbuf is OK */
if ((q != NULL) && (q->len > copy_from)) {
return ((u8_t*)q->payload)[copy_from];
}
return 0;
}
/** Compare pbuf contents at specified offset with memory s2, both of length n
*
* @param p pbuf to compare
* @param offset offset into p at wich to start comparing
* @param s2 buffer to compare
* @param n length of buffer to compare
* @return zero if equal, nonzero otherwise
* (0xffff if p is too short, diffoffset+1 otherwise)
*/
u16_t
pbuf_memcmp(struct pbuf* p, u16_t offset, const void* s2, u16_t n)
{
u16_t start = offset;
struct pbuf* q = p;
/* get the correct pbuf */
while ((q != NULL) && (q->len <= start)) {
start -= q->len;
q = q->next;
}
/* return requested data if pbuf is OK */
if ((q != NULL) && (q->len > start)) {
u16_t i;
for(i = 0; i < n; i++) {
u8_t a = pbuf_get_at(q, start + i);
u8_t b = ((u8_t*)s2)[i];
if (a != b) {
return i+1;
}
}
return 0;
}
return 0xffff;
}
/** Find occurrence of mem (with length mem_len) in pbuf p, starting at offset
* start_offset.
*
* @param p pbuf to search, maximum length is 0xFFFE since 0xFFFF is used as
* return value 'not found'
* @param mem search for the contents of this buffer
* @param mem_len length of 'mem'
* @param start_offset offset into p at which to start searching
* @return 0xFFFF if substr was not found in p or the index where it was found
*/
u16_t
pbuf_memfind(struct pbuf* p, const void* mem, u16_t mem_len, u16_t start_offset)
{
u16_t i;
u16_t max = p->tot_len - mem_len;
if (p->tot_len >= mem_len + start_offset) {
for(i = start_offset; i <= max; ) {
u16_t plus = pbuf_memcmp(p, i, mem, mem_len);
if (plus == 0) {
return i;
} else {
i += plus;
}
}
}
return 0xFFFF;
}
/** Find occurrence of substr with length substr_len in pbuf p, start at offset
* start_offset
* WARNING: in contrast to strstr(), this one does not stop at the first \0 in
* the pbuf/source string!
*
* @param p pbuf to search, maximum length is 0xFFFE since 0xFFFF is used as
* return value 'not found'
* @param substr string to search for in p, maximum length is 0xFFFE
* @return 0xFFFF if substr was not found in p or the index where it was found
*/
u16_t
pbuf_strstr(struct pbuf* p, const char* substr)
{
size_t substr_len;
if ((substr == NULL) || (substr[0] == 0) || (p->tot_len == 0xFFFF)) {
return 0xFFFF;
}
substr_len = strlen(substr);
if (substr_len >= 0xFFFF) {
return 0xFFFF;
}
return pbuf_memfind(p, substr, (u16_t)substr_len, 0);
}
| jnouyang/kitten | net/pbuf.c | C | gpl-2.0 | 39,009 | [
30522,
1013,
1008,
1008,
1008,
1030,
5371,
1008,
14771,
17698,
2968,
1008,
1008,
23730,
2024,
2328,
2013,
1996,
1052,
8569,
2546,
2951,
3252,
1012,
2009,
6753,
8790,
1008,
3638,
16169,
2005,
14771,
8417,
2030,
2064,
4431,
27223,
1008,
3266,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package com.itheima.c_inject.c_factory;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class TestFactory {
@Test
public void demo01(){
//自定义实例工厂
//1 创建工厂
MyBeanFactory myBeanFactory = new MyBeanFactory();
//2 通过工厂实例,获得对象
UserService userService = myBeanFactory.createService();
userService.addUser();
}
@Test
public void demo02(){
//spring 工厂
String xmlPath = "com/itheima/c_inject/c_factory/beans.xml";
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(xmlPath);
UserService userService = applicationContext.getBean("userServiceId" ,UserService.class);
userService.addUser();
}
}
| Nihility-Ming/note_for_Java_EE | Spring_day01/src/com/itheima/c_inject/c_factory/TestFactory.java | Java | mit | 831 | [
30522,
7427,
4012,
1012,
2009,
8049,
2050,
1012,
1039,
1035,
1999,
20614,
1012,
1039,
1035,
4713,
1025,
12324,
8917,
1012,
12022,
4183,
1012,
3231,
1025,
12324,
8917,
1012,
3500,
15643,
6198,
1012,
6123,
1012,
4646,
8663,
18209,
1025,
12324... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
---
title: ICompletionProposal.attributes - aesi-java
---
[aesi-java](../../index.html) / [com.virtlink.editorservices.codecompletion](../index.html) / [ICompletionProposal](index.html) / [attributes](.)
# attributes
`abstract val attributes: `[`EnumSet`](http://docs.oracle.com/javase/6/docs/api/java/util/EnumSet.html)`<`[`Attribute`](../-attribute/index.html)`>` | Virtlink/aesi | docs/aesi-java/com.virtlink.editorservices.codecompletion/-i-completion-proposal/attributes.md | Markdown | apache-2.0 | 368 | [
30522,
1011,
1011,
1011,
2516,
1024,
24582,
25377,
7485,
3258,
21572,
6873,
12002,
1012,
12332,
1011,
29347,
5332,
1011,
9262,
1011,
1011,
1011,
1031,
29347,
5332,
1011,
9262,
1033,
1006,
1012,
1012,
1013,
1012,
1012,
1013,
5950,
1012,
1612... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
---
layout: post
title: The Tsinghua University Library joins DataCite
author:
- lrueda
date: '2016-10-24'
tags:
- members
location: Beijing, China
doi: 10.5438/esys-f867
---
DataCite is delighted to welcome the [Tsinghua University Library](http://www.lib.tsinghua.edu.cn/english/) to the DataCite community! The Tsinghua University Library supports the University's mission of education and research. It engages with the ongoing environment to deliver world-class physical and digital content and services critical to research, education, and outreach, contributes to discover, preserve, and disseminate knowledge and creative expression worldwide.READMORE
The Tsinghua University Library has a long history of innovation and service. It was established in 1912, just one year after the university was built. During the last century, it has gone through multiple restructuring processes, changing focuses and amassing an amazing collection of almost 5 million items.

In the latest years, the Tsinghua University Library has made great progress in automation and networking. It provides access to an increasing number of electronic and virtual resources. These form a global open and multi-level information system for all its researchers and students, with more than 450 electronic databases, near 69,000 full-text e-journals, almost a million e-books and more than 35,000 multimedia collections.
Now, the Tsinghua University Library joins DataCite on a new effort to promote data culture by making it discoverable and citable. The Library has implemented many projects related to DOI successfully in the past, and it is currently working on the development of data management and data publishing in China.
| datacite/blog | source/posts/the-tsinghua-university-library-joins-datacite.html.md | Markdown | mit | 1,780 | [
30522,
1011,
1011,
1011,
9621,
1024,
2695,
2516,
1024,
1996,
24529,
2075,
14691,
2118,
3075,
9794,
2951,
17847,
3166,
1024,
1011,
1048,
28551,
2050,
3058,
1024,
1005,
2355,
1011,
2184,
1011,
2484,
1005,
22073,
1024,
1011,
2372,
3295,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
import {Component, ElementRef} from '@angular/core';
import { ProductionTileService } from '../../shared/services/productiontile.service';
import { Router } from '@angular/router';
import {Observable} from 'rxjs/Rx';
//import 'style-loader!./tiles.scss';
@Component({
selector: 'production-tiles',
styleUrls: ['./tiles.scss'],
templateUrl: './productiontiles.html'
})
export class ProductionTiles {
productions: Observable<Array<any>>
sub_prod: Observable<Array<any>>
summary:number=0;
constructor(private router: Router, protected service: ProductionTileService) {
}
ngOnInit() {
this.productions = this.service.getProductionTiles().map(response => response.json()["tiles"]);
this.sub_prod=this.productions;
}
button_details(id): void {
this.router.navigate(['pages/productiontiles/details', id]);
}
summary_details(id): void {
this.summary = 1;
document.getElementsByClassName('widgets')['0'].style.display = 'none';
document.getElementById("summary").style.display = 'block';
}
back_state():void{
this.summary = 0;
document.getElementsByClassName('widgets')['0'].style.display = 'block';
document.getElementById("summary").style.display = 'none';
}
} | NPM57/OPTOWeb2 | src/app/pages/productiontiles/productiontiles.component.ts | TypeScript | mit | 1,203 | [
30522,
12324,
1063,
6922,
1010,
5783,
2890,
2546,
1065,
2013,
1005,
1030,
16108,
1013,
4563,
1005,
1025,
12324,
1063,
2537,
15286,
8043,
7903,
2063,
1065,
2013,
1005,
1012,
1012,
1013,
1012,
1012,
1013,
4207,
1013,
2578,
1013,
2537,
15286,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package net.collaud.fablab.api.service.impl;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import net.collaud.fablab.api.dao.SupplyTypeRepository;
import net.collaud.fablab.api.data.SupplyTypeEO;
import net.collaud.fablab.api.security.Roles;
import net.collaud.fablab.api.service.SupplyTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.annotation.Secured;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* This is the service implementation class for a <tt>SupplyType</tt>.
* @author Fabien Vuilleumier
*/
@Service
@Transactional
@Secured({Roles.SUPPLY_MANAGE})
public class SupplyTypeServiceImpl implements SupplyTypeService {
@Autowired
private SupplyTypeRepository supplyTypeDAO;
@Override
@Secured({Roles.SUPPLY_MANAGE})
public List<SupplyTypeEO> findAll() {
return new ArrayList(new HashSet(supplyTypeDAO.findAll()));
}
@Override
@Secured({Roles.SUPPLY_MANAGE})
public Optional<SupplyTypeEO> getById(Integer id) {
return Optional.ofNullable(supplyTypeDAO.findOne(id));
}
@Override
@Secured({Roles.SUPPLY_MANAGE})
public SupplyTypeEO save(SupplyTypeEO supplyType) {
if (supplyType.getId() == null) {
supplyType.setId(0);
}
if (supplyType.getId() > 0) {
SupplyTypeEO old = supplyTypeDAO.findOne(supplyType.getId());
old.setLabel(supplyType.getLabel());
old.setSupplyList(supplyType.getSupplyList());
old.setActive(supplyType.isActive());
return supplyTypeDAO.saveAndFlush(old);
} else {
return supplyTypeDAO.saveAndFlush(supplyType);
}
}
@Override
@Secured({Roles.SUPPLY_MANAGE})
public void remove(Integer id) {
supplyTypeDAO.delete(id);
}
@Override
@Secured({Roles.SUPPLY_MANAGE})
public void softRemove(Integer id) {
SupplyTypeEO current = supplyTypeDAO.findOne(id);
current.setActive(false);
supplyTypeDAO.saveAndFlush(current);
}
}
| fabienvuilleumier/fb | src/main/java/net/collaud/fablab/api/service/impl/SupplyTypeServiceImpl.java | Java | mit | 2,211 | [
30522,
7427,
5658,
1012,
8902,
17298,
2094,
1012,
6904,
28522,
2497,
1012,
17928,
1012,
2326,
1012,
17727,
2140,
1025,
12324,
9262,
1012,
21183,
4014,
1012,
9140,
9863,
1025,
12324,
9262,
1012,
21183,
4014,
1012,
23325,
13462,
1025,
12324,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
import * as b from "bobril";
import { IRouteWithNavDefinition } from "../../../../common/routing";
import { Anchor } from "../../../../common/Anchor";
import { Example } from "../../../../common/Example";
import { Col, Form, margin, Row } from "../../../../../index";
import { Code } from "../../../../common/Code";
import { Lead } from "../../../../common/Lead";
export const formControlsRoute: IRouteWithNavDefinition = {
url: "form-controls",
name: "form-controls",
label: "Form controls",
handler: () => <FormsDoc />,
subs: [
{
url: "example",
name: "form-controls-example",
label: "Example",
subs: [],
},
{
url: "sizing",
name: "form-controls-sizing",
label: "Sizing",
subs: [],
},
{
url: "readonly",
name: "form-controls-readonly",
label: "Readonly",
subs: [],
},
{
url: "readonly-plain-text",
name: "form-controls-readonly-plain-text",
label: "Readonly plain text",
subs: [],
},
{
url: "file-input",
name: "form-controls-file-input",
label: "File input",
subs: [],
},
{
url: "color",
name: "form-controls-color",
label: "Color",
subs: [],
},
{
url: "datalist",
name: "form-controls-datalist",
label: "Datalist",
subs: [],
},
],
};
export function FormsDoc(): b.IBobrilNode {
return (
<>
<Anchor name="form-controls">
<h1>Form controls</h1>
</Anchor>
<Lead>
Give textual form controls like <code>{`<Form.Input>`}</code>s, <code>{`<Form.Select>`}</code>s, and{" "}
<code>{`<Form.Textarea>`}</code>s an upgrade with custom styles, sizing, focus states, and more.
</Lead>
<Anchor name="form-controls-example">
<h2>Form controls</h2>
</Anchor>
<Example>
<Form>
<div style={margin("b", 3)}>
<Form.Label for="exampleFormControlInput1">Email address</Form.Label>
<Form.Input type="email" id="exampleFormControlInput1" placeholder="name@example.com" />
</div>
<div style={margin("b", 3)}>
<Form.Label for="exampleFormControlTextarea1">Example textarea</Form.Label>
<Form.Textarea id="exampleFormControlTextarea1" rows="3" />
</div>
</Form>
</Example>
<Code language="tsx">{` <Form>
<div style={margin("b", 3)}>
<Form.Label for="exampleFormControlInput1">Email address</Form.Label>
<Form.Input type="email" id="exampleFormControlInput1" placeholder="name@example.com" />
</div>
<div style={margin("b", 3)}>
<Form.Label for="exampleFormControlTextarea1">Example textarea</Form.Label>
<Form.Textarea id="exampleFormControlTextarea1" rows="3" />
</div>
</Form>`}</Code>
<Anchor name="form-controls-sizing">
<h3>Sizing</h3>
</Anchor>
<p>
Set <code>size</code> prop.
</p>
<Example>
<Form.Input type="text" size="lg" placeholder="lg" />
<Form.Input type="text" placeholder="Default input" />
<Form.Input type="text" size="sm" placeholder="sm" />
</Example>
<Code language="tsx">{`<Form.Input type="text" size="lg" placeholder="lg" />
<Form.Input type="text" placeholder="Default input" />
<Form.Input type="text" size="sm" placeholder="sm" />`}</Code>
<Anchor name="form-controls-readonly">
<h3>Readonly</h3>
</Anchor>
<p>
Add the <code>readonly</code> boolean prop on an input to prevent modification of the input’s value. Read-only inputs appear
lighter (just like disabled inputs), but retain the standard cursor.
</p>
<Example>
<Form.Input type="text" placeholder="Readonly input here..." readonly />
</Example>
<Code language="tsx">{`<Form.Input type="text" placeholder="Readonly input here..." readonly />`}</Code>
<Anchor name="form-controls-readonly-plain-text">
<h3>Readonly plain text</h3>
</Anchor>
<p>
If you want to have <code>readonly</code> elements in your form styled as plain text, use the <code>plain-text</code> prop
to remove the default form field styling and preserve the correct margin and padding.
</p>
<Example>
<Form>
<Row style={margin("b", 3)}>
<Form.Label col sm={2} for="staticEmail">
Email
</Form.Label>
<Col sm={10}>
<Form.Input type="text" readonly plain-text id="staticEmail" value="email@example.com" />
</Col>
</Row>
<Row style={margin("b", 3)}>
<Form.Label col sm={2} for="inputPassword">
Password
</Form.Label>
<Col sm={10}>
<Form.Input type="password" id="inputPassword" />
</Col>
</Row>
</Form>
</Example>
<Code language="tsx">{`<Form>
<Row style={margin("b", 3)}>
<Form.Label col sm={2} for="staticEmail">
Email
</Form.Label>
<Col sm={10}>
<Form.Input type="text" readonly plain-text id="staticEmail" value="email@example.com" />
</Col>
</Row>
<Row style={margin("b", 3)}>
<Form.Label col sm={2} for="inputPassword">
Password
</Form.Label>
<Col sm={10}>
<Form.Input type="password" id="inputPassword" />
</Col>
</Row>
</Form>`}</Code>
<Anchor name="form-controls-file-input">
<h3>File input</h3>
</Anchor>
<Example>
<div style={margin("b", 3)}>
<Form.Label for="formFile">Default file input example</Form.Label>
<Form.Input type="file" id="formFile" />
</div>
<div style={margin("b", 3)}>
<Form.Label for="formFileMultiple">Multiple files input example</Form.Label>
<Form.Input type="file" id="formFileMultiple" multiple />
</div>
<div style={margin("b", 3)}>
<Form.Label for="formFileDisabled">Disabled file input example</Form.Label>
<Form.Input type="file" id="formFileDisabled" disabled />
</div>
<div style={margin("b", 3)}>
<Form.Label for="formFileSm">Small file input example</Form.Label>
<Form.Input size="sm" id="formFileSm" type="file" />
</div>
<div>
<Form.Label for="formFileLg">Large file input example</Form.Label>
<Form.Input size="lg" id="formFileLg" type="file" />
</div>
</Example>
<Code language="tsx">{`<div style={margin("b", 3)}>
<Form.Label for="formFile">Default file input example</Form.Label>
<Form.Input type="file" id="formFile" />
</div>
<div style={margin("b", 3)}>
<Form.Label for="formFileMultiple">Multiple files input example</Form.Label>
<Form.Input type="file" id="formFileMultiple" multiple />
</div>
<div style={margin("b", 3)}>
<Form.Label for="formFileDisabled">Disabled file input example</Form.Label>
<Form.Input type="file" id="formFileDisabled" disabled />
</div>
<div style={margin("b", 3)}>
<Form.Label for="formFileSm">
Small file input example
</Form.Label>
<Form.Input size="sm" id="formFileSm" type="file" />
</div>
<div>
<Form.Label for="formFileLg">Large file input example</Form.Label>
<Form.Input size="lg" id="formFileLg" type="file" />
</div>`}</Code>
<Anchor name="form-controls-color">
<h3>Color</h3>
</Anchor>
<Example>
<Form.Label for="exampleColorInput">Color picker</Form.Label>
<Form.Input type="color" id="exampleColorInput" value="#563d7c" title="Choose your color" />
</Example>
<Code language="tsx">{`<Form.Label for="exampleColorInput">Color picker</Form.Label>
<Form.Input type="color" id="exampleColorInput" value="#563d7c" title="Choose your color" />`}</Code>
<Anchor name="form-controls-datalist">
<h3>Datalist</h3>
</Anchor>
<p>
Datalists allow you to create a group of <code>{`<Form.Option>`}</code>s that can be accessed (and autocompleted) from
within an <code>{`<Form.Input>`}</code>. These are similar to <code>{`<Form.Select>`}</code>s, but come with more menu
styling limitations and differences. While most browsers and operating systems include some support for{" "}
<code>{`<Form.Datalist>`}</code>s, their styling is inconsistent at best.
</p>
<Example>
<Form.Label for="exampleDataList">Datalist example</Form.Label>
<Form.Input type="datalist" list="datalistOptions" id="exampleDataList" placeholder="Type to search..." />
<Form.Datalist id="datalistOptions">
<Form.Option value="San Francisco" />
<Form.Option value="New York" />
<Form.Option value="Seattle" />
<Form.Option value="Los Angeles" />
<Form.Option value="Chicago" />
</Form.Datalist>
</Example>
<Code language="tsx">{`<Form.Label for="exampleDataList">Datalist example</Form.Label>
<Form.Input type="datalist" list="datalistOptions" id="exampleDataList" placeholder="Type to search..." />
<Form.Datalist id="datalistOptions">
<Form.Option value="San Francisco" />
<Form.Option value="New York" />
<Form.Option value="Seattle" />
<Form.Option value="Los Angeles" />
<Form.Option value="Chicago" />
</Form.Datalist>`}</Code>
</>
);
}
| keeema/bobrilstrap | example/documentation/content/forms/parts/FormsControls.tsx | TypeScript | mit | 10,921 | [
30522,
12324,
1008,
2004,
1038,
2013,
1000,
3960,
15928,
1000,
1025,
12324,
1063,
20868,
5833,
7974,
8939,
2532,
16872,
12879,
5498,
3508,
1065,
2013,
1000,
1012,
1012,
1013,
1012,
1012,
1013,
1012,
1012,
1013,
1012,
1012,
1013,
2691,
1013,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ignite.ml.multiclass;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.TreeMap;
import org.apache.ignite.ml.Exportable;
import org.apache.ignite.ml.Exporter;
import org.apache.ignite.ml.IgniteModel;
import org.apache.ignite.ml.math.primitives.vector.Vector;
/** Base class for multi-classification model for set of classifiers. */
public class MultiClassModel<M extends IgniteModel<Vector, Double>> implements IgniteModel<Vector, Double>, Exportable<MultiClassModel>, Serializable {
/** */
private static final long serialVersionUID = -114986533359917L;
/** List of models associated with each class. */
private Map<Double, M> models;
/** */
public MultiClassModel() {
this.models = new HashMap<>();
}
/**
* Adds a specific binary classifier to the bunch of same classifiers.
*
* @param clsLb The class label for the added model.
* @param mdl The model.
*/
public void add(double clsLb, M mdl) {
models.put(clsLb, mdl);
}
/**
* @param clsLb Class label.
* @return model for class label if it exists.
*/
public Optional<M> getModel(Double clsLb) {
return Optional.ofNullable(models.get(clsLb));
}
/** {@inheritDoc} */
@Override public Double predict(Vector input) {
TreeMap<Double, Double> maxMargins = new TreeMap<>();
models.forEach((k, v) -> maxMargins.put(v.predict(input), k));
// returns value the most closest to 1
return maxMargins.lastEntry().getValue();
}
/** {@inheritDoc} */
@Override public <P> void saveModel(Exporter<MultiClassModel, P> exporter, P path) {
exporter.save(this, path);
}
/** {@inheritDoc} */
@Override public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
MultiClassModel mdl = (MultiClassModel)o;
return Objects.equals(models, mdl.models);
}
/** {@inheritDoc} */
@Override public int hashCode() {
return Objects.hash(models);
}
/** {@inheritDoc} */
@Override public String toString() {
StringBuilder wholeStr = new StringBuilder();
models.forEach((clsLb, mdl) ->
wholeStr
.append("The class with label ")
.append(clsLb)
.append(" has classifier: ")
.append(mdl.toString())
.append(System.lineSeparator())
);
return wholeStr.toString();
}
/** {@inheritDoc} */
@Override public String toString(boolean pretty) {
return toString();
}
}
| ptupitsyn/ignite | modules/ml/src/main/java/org/apache/ignite/ml/multiclass/MultiClassModel.java | Java | apache-2.0 | 3,594 | [
30522,
1013,
1008,
1008,
7000,
2000,
1996,
15895,
4007,
3192,
1006,
2004,
2546,
1007,
2104,
2028,
2030,
2062,
1008,
12130,
6105,
10540,
1012,
2156,
1996,
5060,
5371,
5500,
2007,
1008,
2023,
2147,
2005,
3176,
2592,
4953,
9385,
6095,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<html xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<head>
<meta content="en-us" http-equiv="Content-Language" />
<meta content="text/html; charset=utf-16" http-equiv="Content-Type" />
<title _locid="PortabilityAnalysis0">.NET Portability Report</title>
<style>
/* Body style, for the entire document */
body {
background: #F3F3F4;
color: #1E1E1F;
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
padding: 0;
margin: 0;
}
/* Header1 style, used for the main title */
h1 {
padding: 10px 0px 10px 10px;
font-size: 21pt;
background-color: #E2E2E2;
border-bottom: 1px #C1C1C2 solid;
color: #201F20;
margin: 0;
font-weight: normal;
}
/* Header2 style, used for "Overview" and other sections */
h2 {
font-size: 18pt;
font-weight: normal;
padding: 15px 0 5px 0;
margin: 0;
}
/* Header3 style, used for sub-sections, such as project name */
h3 {
font-weight: normal;
font-size: 15pt;
margin: 0;
padding: 15px 0 5px 0;
background-color: transparent;
}
h4 {
font-weight: normal;
font-size: 12pt;
margin: 0;
padding: 0 0 0 0;
background-color: transparent;
}
/* Color all hyperlinks one color */
a {
color: #1382CE;
}
/* Paragraph text (for longer informational messages) */
p {
font-size: 10pt;
}
/* Table styles */
table {
border-spacing: 0 0;
border-collapse: collapse;
font-size: 10pt;
}
table th {
background: #E7E7E8;
text-align: left;
text-decoration: none;
font-weight: normal;
padding: 3px 6px 3px 6px;
}
table td {
vertical-align: top;
padding: 3px 6px 5px 5px;
margin: 0px;
border: 1px solid #E7E7E8;
background: #F7F7F8;
}
.NoBreakingChanges {
color: darkgreen;
font-weight:bold;
}
.FewBreakingChanges {
color: orange;
font-weight:bold;
}
.ManyBreakingChanges {
color: red;
font-weight:bold;
}
.BreakDetails {
margin-left: 30px;
}
.CompatMessage {
font-style: italic;
font-size: 10pt;
}
.GoodMessage {
color: darkgreen;
}
/* Local link is a style for hyperlinks that link to file:/// content, there are lots so color them as 'normal' text until the user mouse overs */
.localLink {
color: #1E1E1F;
background: #EEEEED;
text-decoration: none;
}
.localLink:hover {
color: #1382CE;
background: #FFFF99;
text-decoration: none;
}
/* Center text, used in the over views cells that contain message level counts */
.textCentered {
text-align: center;
}
/* The message cells in message tables should take up all avaliable space */
.messageCell {
width: 100%;
}
/* Padding around the content after the h1 */
#content {
padding: 0px 12px 12px 12px;
}
/* The overview table expands to width, with a max width of 97% */
#overview table {
width: auto;
max-width: 75%;
}
/* The messages tables are always 97% width */
#messages table {
width: 97%;
}
/* All Icons */
.IconSuccessEncoded, .IconInfoEncoded, .IconWarningEncoded, .IconErrorEncoded {
min-width: 18px;
min-height: 18px;
background-repeat: no-repeat;
background-position: center;
}
/* Success icon encoded */
.IconSuccessEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconSuccess#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABPElEQVR4Xp1Tv0vDUBi8FqeA4NpBcBLcWnQSApncOnTo4FSnjP0DsnXpH5CxiwbHDg4Zuj4oOEXiJgiC4FDcCkLWmIMc1Pfw+eMgQ77v3Xf3Pe51YKGqqisAEwCR1TIAsiAIblSo6xrdHeJR85Xle3mdmCQKb0PsfqyxxzM8K15HZADl/H5+sHpZwYfxyRjTs+kWwKBx8yoHd2mRiuzF8mkJniWH/13u3Fjrs/EdhsdDFHGB/DLXEJBDLh1MWPAhPo1BLB4WX5yQywHR+m3tVe/t97D52CB/ziG0nIgD/qDuYg8WuCcVZ2YGwlJ3YDugkpR/VNcAEx6GEKhERSr71FuO4YCM4XBdwKvecjIlkSnsO0Hyp/GxSeJAdzBKzpOtnPwyyiPdAZhpZptT04tU+zk7s8czeges//s5C5+CwqrR4/gw+AAAAABJRU5ErkJggg==);
}
/* Information icon encoded */
.IconInfoEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconInformation#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABHElEQVR4Xs2TsUoDQRRF7wwoziokjZUKadInhdhukR9YP8DMX1hYW+QvdsXa/QHBbcXC7W0CamWTQnclFutceIQJwwaWNLlwm5k5d94M76mmaeCrrmsLYOocY12FcxZFUeozCqKqqgYA8uevv1H6VuPxcwlfk5N92KHBxfFeCSAxxswlYAW/Xr989x/mv9gkhtyMDhcAxgzRsp7flj8B/HF1RsMXq+NZMkopaHe7lbKxQUEIGbKsYNoGn969060hZBkQex/W8oRQwsQaW2o3Ago2SVcJUzAgY3N0lTCZZm+zPS8HB51gMmS1DEYyOz9acKO1D8JWTlafKIMxdhvlfdyT94Vv5h7P8Ky7nQzACmhvKq3zk3PjW9asz9D/1oigecsioooAAAAASUVORK5CYII=);
}
/* Warning icon encoded */
.IconWarningEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconWarning#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAx0lEQVR4XpWSMQ7CMAxFf4xAyBMLCxMrO8dhaBcuwdCJS3RJBw7SA/QGTCxdWJgiQYWKXJWKIXHIlyw5lqr34tQgEOdcBsCOx5yZK3hCCKdYXneQkh4pEfqzLfu+wVDSyyzFoJjfz9NB+pAF+eizx2Vruts0k15mPgvS6GYvpVtQhB61IB/dk6AF6fS4Ben0uIX5odtFe8Q/eW1KvFeH4e8khT6+gm5B+t3juyDt7n0jpe+CANTd+oTUjN/U3yVaABnSUjFz/gFq44JaVSCXeQAAAABJRU5ErkJggg==);
}
/* Error icon encoded */
.IconErrorEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconError#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABQElEQVR4XqWTvUoEQRCE6wYPZUA80AfwAQz23uCMjA7MDRQEIzPBVEyNTQUFIw00vcQTTMzuAh/AxEQQT8HF/3G/oGGnEUGuoNnd6qoZuqltyKEsyzVJq5I6rnUp6SjGeGhESikzzlc1eL7opfuVbrqbU1Zw9NCgtQMaZpY0eNnaaL2fHusvTK5vKu7sjSS1Y4y3QUA6K3e3Mau5UFDyMP7tYF9o8cAHZv68vipoIJg971PZIZ5HiwdvYGGvFVFHmGmZ2MxwmQYPXubPl9Up0tfoMQGetXd6mRbvhBw+boZ6WF7Mbv1+GsHRk0fQmPAH1GfmZirbCfDJ61tw3Px8/8pZsPAG4jlVhcPgZ7adwNWBB68lkRQWFiTgFlbnLY3DGGM7izIJIyT/jjIvEJw6fdJTc6krDzh6aMwMP9bvDH4ADSsa9uSWVJkAAAAASUVORK5CYII=);
}
</style>
</head>
<body>
<h1 _locid="PortabilityReport">.NET Portability Report</h1>
<div id="content">
<div id="submissionId" style="font-size:8pt;">
<p>
<i>
Submission Id
0b2f79ae-1400-4357-ac70-04064d85feac
</i>
</p>
</div>
<h2 _locid="SummaryTitle">
<a name="Portability Summary"></a>Portability Summary
</h2>
<div id="summary">
<table>
<tbody>
<tr>
<th>Assembly</th>
<th>ASP.NET 5,Version=v1.0</th>
<th>Windows,Version=v8.1</th>
<th>.NET Framework,Version=v4.6</th>
<th>Windows Phone,Version=v8.1</th>
</tr>
<tr>
<td><strong><a href="#NPerf.Fixture.IDictionary">NPerf.Fixture.IDictionary</a></strong></td>
<td class="text-center">100.00 %</td>
<td class="text-center">100.00 %</td>
<td class="text-center">100.00 %</td>
<td class="text-center">100.00 %</td>
</tr>
</tbody>
</table>
</div>
<div id="details">
</div>
</div>
</body>
</html> | kuhlenh/port-to-core | Reports/np/nperf.fixtures.1.0.1/NPerf.Fixture.IDictionary-NET45.html | HTML | mit | 9,665 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
20950,
3619,
1024,
5796,
2595,
14540,
1027,
1000,
24471,
2078,
1024,
30524,
1000,
4372,
1011,
2149,
1000,
8299,
1011,
1041,
15549,
2615,
1027,
1000,
4180,
1011,
2653,
1000,
1013,
1028... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/******************************************************************************
*
* Module Name: exresnte - AML Interpreter object resolution
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2016, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* 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 MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES.
*/
#include <acpi/acpi.h>
#include "accommon.h"
#include "acdispat.h"
#include "acinterp.h"
#include "acnamesp.h"
#define _COMPONENT ACPI_EXECUTER
ACPI_MODULE_NAME("exresnte")
/*******************************************************************************
*
* FUNCTION: acpi_ex_resolve_node_to_value
*
* PARAMETERS: object_ptr - Pointer to a location that contains
* a pointer to a NS node, and will receive a
* pointer to the resolved object.
* walk_state - Current state. Valid only if executing AML
* code. NULL if simply resolving an object
*
* RETURN: Status
*
* DESCRIPTION: Resolve a Namespace node to a valued object
*
* Note: for some of the data types, the pointer attached to the Node
* can be either a pointer to an actual internal object or a pointer into the
* AML stream itself. These types are currently:
*
* ACPI_TYPE_INTEGER
* ACPI_TYPE_STRING
* ACPI_TYPE_BUFFER
* ACPI_TYPE_MUTEX
* ACPI_TYPE_PACKAGE
*
******************************************************************************/
acpi_status
acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
struct acpi_walk_state *walk_state)
{
acpi_status status = AE_OK;
union acpi_operand_object *source_desc;
union acpi_operand_object *obj_desc = NULL;
struct acpi_namespace_node *node;
acpi_object_type entry_type;
ACPI_FUNCTION_TRACE(ex_resolve_node_to_value);
/*
* The stack pointer points to a struct acpi_namespace_node (Node). Get the
* object that is attached to the Node.
*/
node = *object_ptr;
source_desc = acpi_ns_get_attached_object(node);
entry_type = acpi_ns_get_type((acpi_handle)node);
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Entry=%p SourceDesc=%p [%s]\n",
node, source_desc,
acpi_ut_get_type_name(entry_type)));
if ((entry_type == ACPI_TYPE_LOCAL_ALIAS) ||
(entry_type == ACPI_TYPE_LOCAL_METHOD_ALIAS))
{
/* There is always exactly one level of indirection */
node = ACPI_CAST_PTR(struct acpi_namespace_node, node->object);
source_desc = acpi_ns_get_attached_object(node);
entry_type = acpi_ns_get_type((acpi_handle)node);
*object_ptr = node;
}
/*
* Several object types require no further processing:
* 1) Device/Thermal objects don't have a "real" subobject, return Node
* 2) Method locals and arguments have a pseudo-Node
* 3) 10/2007: Added method type to assist with Package construction.
*/
if ((entry_type == ACPI_TYPE_DEVICE) ||
(entry_type == ACPI_TYPE_THERMAL) ||
(entry_type == ACPI_TYPE_METHOD) ||
(node->flags & (ANOBJ_METHOD_ARG | ANOBJ_METHOD_LOCAL)))
{
return_ACPI_STATUS(AE_OK);
}
if (!source_desc)
{
ACPI_ERROR((AE_INFO, "No object attached to node [%4.4s] %p",
node->name.ascii, node));
return_ACPI_STATUS(AE_AML_UNINITIALIZED_NODE);
}
/*
* Action is based on the type of the Node, which indicates the type
* of the attached object or pointer
*/
switch (entry_type)
{
case ACPI_TYPE_PACKAGE:
if (source_desc->common.type != ACPI_TYPE_PACKAGE)
{
ACPI_ERROR((AE_INFO, "Object not a Package, type %s",
acpi_ut_get_object_type_name(source_desc)));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
status = acpi_ds_get_package_arguments(source_desc);
if (ACPI_SUCCESS(status))
{
/* Return an additional reference to the object */
obj_desc = source_desc;
acpi_ut_add_reference(obj_desc);
}
break;
case ACPI_TYPE_BUFFER:
if (source_desc->common.type != ACPI_TYPE_BUFFER)
{
ACPI_ERROR((AE_INFO, "Object not a Buffer, type %s",
acpi_ut_get_object_type_name(source_desc)));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
status = acpi_ds_get_buffer_arguments(source_desc);
if (ACPI_SUCCESS(status))
{
/* Return an additional reference to the object */
obj_desc = source_desc;
acpi_ut_add_reference(obj_desc);
}
break;
case ACPI_TYPE_STRING:
if (source_desc->common.type != ACPI_TYPE_STRING)
{
ACPI_ERROR((AE_INFO, "Object not a String, type %s",
acpi_ut_get_object_type_name(source_desc)));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
/* Return an additional reference to the object */
obj_desc = source_desc;
acpi_ut_add_reference(obj_desc);
break;
case ACPI_TYPE_INTEGER:
if (source_desc->common.type != ACPI_TYPE_INTEGER)
{
ACPI_ERROR((AE_INFO, "Object not a Integer, type %s",
acpi_ut_get_object_type_name(source_desc)));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
/* Return an additional reference to the object */
obj_desc = source_desc;
acpi_ut_add_reference(obj_desc);
break;
case ACPI_TYPE_BUFFER_FIELD:
case ACPI_TYPE_LOCAL_REGION_FIELD:
case ACPI_TYPE_LOCAL_BANK_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
"FieldRead Node=%p SourceDesc=%p Type=%X\n",
node, source_desc, entry_type));
status =
acpi_ex_read_data_from_field(walk_state, source_desc,
&obj_desc);
break;
/* For these objects, just return the object attached to the Node */
case ACPI_TYPE_MUTEX:
case ACPI_TYPE_POWER:
case ACPI_TYPE_PROCESSOR:
case ACPI_TYPE_EVENT:
case ACPI_TYPE_REGION:
/* Return an additional reference to the object */
obj_desc = source_desc;
acpi_ut_add_reference(obj_desc);
break;
/* TYPE_ANY is untyped, and thus there is no object associated with it */
case ACPI_TYPE_ANY:
ACPI_ERROR((AE_INFO,
"Untyped entry %p, no attached object!", node));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE); /* Cannot be AE_TYPE */
case ACPI_TYPE_LOCAL_REFERENCE:
switch (source_desc->reference.class)
{
case ACPI_REFCLASS_TABLE: /* This is a ddb_handle */
case ACPI_REFCLASS_REFOF:
case ACPI_REFCLASS_INDEX:
/* Return an additional reference to the object */
obj_desc = source_desc;
acpi_ut_add_reference(obj_desc);
break;
default:
/* No named references are allowed here */
ACPI_ERROR((AE_INFO,
"Unsupported Reference type 0x%X",
source_desc->reference.class));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
break;
default:
/* Default case is for unknown types */
ACPI_ERROR((AE_INFO,
"Node %p - Unknown object type 0x%X",
node, entry_type));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
} /* switch (entry_type) */
/* Return the object descriptor */
*object_ptr = (void *)obj_desc;
return_ACPI_STATUS(status);
}
| williamfdevine/PrettyLinux | drivers/acpi/acpica/exresnte.c | C | gpl-3.0 | 8,730 | [
30522,
1013,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package com.test.ipetrov.start;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
@SpringBootApplication
@EnableWebMvc
@ComponentScan(basePackages = {"com.test.ipetrov.configuration",
"com.test.ipetrov.portal"})
@EnableJpaRepositories(basePackages = "com.test.ipetrov")
public class Application {
public static void main(String[] args) {
ApplicationContext context = SpringApplication.run(Application.class, args);
}
}
| 081krieger/rps | src/main/java/com/test/ipetrov/start/Application.java | Java | gpl-3.0 | 804 | [
30522,
7427,
4012,
1012,
3231,
1012,
12997,
3388,
12298,
1012,
2707,
1025,
12324,
8917,
1012,
3500,
15643,
6198,
1012,
9573,
1012,
3500,
29098,
19341,
3508,
1025,
12324,
8917,
1012,
3500,
15643,
6198,
1012,
9573,
1012,
8285,
8663,
8873,
273... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<html>
<head>
<title>zlib~Examples documentation</title>
<link rel="stylesheet" type="text/css" href="../../../../index.css" />
<link rel="stylesheet" type="text/css" href="../../../../highlight.css" />
<script type="text/javascript" src="../../../../index.js"></script>
</head>
<body class="spare" id="component_787">
<div id="outer">
<div id="header">
<a class="ctype" href="../../../../index.html">spare</a>
<span></span>
<span class="breadcrumbs">
<span class="delimiter">:</span><a href="../../index.html" class="breadcrumb module">zlib</a><span class="delimiter">~</span><a href="https://nodejs.org/api/zlib.html#zlib_examples" class="breadcrumb spare">Examples</a>
</span>
</div>
<div id="content">
<!-- basic document info -->
<div id="details">
<div class="clear"></div>
</div>
<div class="children">
</div>
</div>
</div>
<div id="footer">
This document was generated with
<a href="https://github.com/shenanigans/node-doczar">doczar</a>
at <span class="time">3:55pm</span> on <span class="date">8/14/2015</span>
</div>
</body>
</html>
| shenanigans/node-sublayer | static/docs/generated/module/zlib/spare/examples/index.html | HTML | mit | 1,329 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
1028,
1026,
2132,
1028,
1026,
2516,
1028,
1062,
29521,
1066,
4973,
12653,
1026,
1013,
2516,
1028,
1026,
4957,
2128,
2140,
1027,
1000,
6782,
21030,
2102,
1000,
2828,
1027,
1000,
3793,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# deplate.rb -- support for ActionPack's action_view
# @Author: Tom Link (micathom AT gmail com)
# @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
# @Created: 13-Apr-2006.
# @Last Change: 2009-11-09.
# @Revision: 0.17
module ActionView
module Helpers #:nodoc:
module TextHelper
begin
require_library_or_gem 'deplate/deplate-string'
unless defined?(DEPLATE_AUXBASEURL)
DEPLATE_AUXBASEURL = 'http://localhost:2500/'
end
o = DeplateString.deplate_options
o.input_def = 'deplate-restricted'
o.variables['headings'] = 'plain'
o.variables['htmlAuxUrl'] = [DEPLATE_AUXBASEURL, 'files/%s'].join
# Returns the text with all the deplate/viki codes turned into HTML-tags.
# <i>This method is only available if deplate/deplate-string can be required</i>.
def deplate(text, page_name=nil)
if text.blank?
''
else
out = DeplateString.new(text)
if page_name
pn = page_name.gsub(/[^a-zA-Z0-9_]/, '_')
out.deplate_options.variables['auxiliaryDir'] = 'public/files/%s' % pn
out.deplate_options.variables['mandatoryID'] = false
else
out.deplate_options.variables['auxiliaryDir'] = 'public/files'
out.deplate_options.variables['mandatoryID'] = true
end
out.to_html
end
end
rescue LoadError
# We can't really help what's not there
end
end
end
end
| tomtom/deplate | lib/action_view/helpers/deplate.rb | Ruby | gpl-2.0 | 1,860 | [
30522,
1001,
2139,
15725,
1012,
21144,
1011,
1011,
2490,
2005,
2895,
23947,
1005,
1055,
2895,
1035,
3193,
1001,
1030,
3166,
1024,
3419,
4957,
1006,
23025,
8988,
5358,
2012,
20917,
4014,
4012,
1007,
1001,
1030,
6105,
1024,
14246,
2140,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package com.michaelfotiadis.crossyscore.ui.components.addplayer.avatar;
import android.view.View;
import android.widget.ImageView;
import com.michaelfotiadis.crossyscore.R;
import com.michaelfotiadis.crossyscore.ui.core.common.viewholder.BaseViewHolder;
import butterknife.Bind;
public final class ListAvatarViewHolder extends BaseViewHolder {
private static final int LAYOUT_ID = R.layout.list_item_single_image;
@Bind(R.id.image)
protected ImageView image;
public ListAvatarViewHolder(final View view) {
super(view);
}
public static int getLayoutId() {
return LAYOUT_ID;
}
} | MikeFot/android-crossy-score | app/src/main/java/com/michaelfotiadis/crossyscore/ui/components/addplayer/avatar/ListAvatarViewHolder.java | Java | apache-2.0 | 629 | [
30522,
7427,
4012,
1012,
2745,
14876,
10711,
10521,
1012,
2892,
7274,
17345,
1012,
21318,
1012,
6177,
1012,
5587,
13068,
2121,
1012,
22128,
1025,
12324,
11924,
1012,
3193,
1012,
3193,
1025,
12324,
11924,
1012,
15536,
24291,
1012,
3746,
8584,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* Copyright (C) 2007-2021 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
Under Section 7 of GPL version 3, you are granted additional
permissions described in the GCC Runtime Library Exception, version
3.1, as published by the Free Software Foundation.
You should have received a copy of the GNU General Public License and
a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
#define __L0_Normalize_10to18( X_hi, X_lo ) \
{ \
UINT64 L0_tmp; \
L0_tmp = (X_lo) + Twoto60_m_10to18; \
if (L0_tmp & Twoto60) \
{(X_hi)=(X_hi)+1;(X_lo)=((L0_tmp<<4)>>4);} \
}
#define __L0_Normalize_10to9( X_hi, X_lo ) \
{ \
UINT32 L0_tmp; \
L0_tmp = (X_lo) + Twoto30_m_10to9; \
if (L0_tmp & 0x40000000) \
{(X_hi)=(X_hi)+1;(X_lo)=((L0_tmp<<2)>>2);} \
}
#define __L0_Split_MiDi_2( X, ptr ) \
{ \
UINT32 L0_head, L0_tail, L0_tmp; \
L0_head = (X) >> 10; \
L0_tail = ((X)&(0x03FF))+(L0_head<<5)-(L0_head<<3); \
L0_tmp = (L0_tail)>>10; L0_head += L0_tmp; \
L0_tail = (L0_tail&(0x03FF))+(L0_tmp<<5)-(L0_tmp<<3); \
if (L0_tail > 999){L0_tail -= 1000; L0_head += 1;} \
*((ptr)++) = L0_head; *((ptr)++) = L0_tail; \
}
#define __L0_Split_MiDi_3( X, ptr ) \
{ \
UINT32 L0_X, L0_head, L0_mid, L0_tail, L0_tmp; \
L0_X = (UINT32)((X)); \
L0_head = ((L0_X>>17)*34359)>>18; \
L0_X -= L0_head*1000000; \
if (L0_X >= 1000000){L0_X -= 1000000;L0_head+=1;} \
L0_mid = L0_X >> 10; \
L0_tail = (L0_X & (0x03FF))+(L0_mid<<5)-(L0_mid<<3); \
L0_tmp = (L0_tail)>>10; L0_mid += L0_tmp; \
L0_tail = (L0_tail&(0x3FF))+(L0_tmp<<5)-(L0_tmp<<3); \
if (L0_tail>999){L0_tail-=1000;L0_mid+=1;} \
*((ptr)++)=L0_head;*((ptr)++)=L0_mid; \
*((ptr)++)=L0_tail; \
}
#define __L1_Split_MiDi_6( X, ptr ) \
{ \
UINT32 L1_X_hi, L1_X_lo; \
UINT64 L1_Xhi_64, L1_Xlo_64; \
L1_Xhi_64 = ( ((X)>>28)*Inv_Tento9 ) >> 33; \
L1_Xlo_64 = (X) - L1_Xhi_64*(UINT64)Tento9; \
if (L1_Xlo_64 >= (UINT64)Tento9) \
{L1_Xlo_64-=(UINT64)Tento9;L1_Xhi_64+=1;} \
L1_X_hi=(UINT32)L1_Xhi_64; L1_X_lo=(UINT32)L1_Xlo_64; \
__L0_Split_MiDi_3(L1_X_hi,(ptr)); \
__L0_Split_MiDi_3(L1_X_lo,(ptr)); \
}
#define __L1_Split_MiDi_6_Lead( X, ptr ) \
{ \
UINT32 L1_X_hi, L1_X_lo; \
UINT64 L1_Xhi_64, L1_Xlo_64; \
if ((X)>=(UINT64)Tento9){ \
L1_Xhi_64 = ( ((X)>>28)*Inv_Tento9 ) >> 33; \
L1_Xlo_64 = (X) - L1_Xhi_64*(UINT64)Tento9; \
if (L1_Xlo_64 >= (UINT64)Tento9) \
{L1_Xlo_64-=(UINT64)Tento9;L1_Xhi_64+=1;} \
L1_X_hi=(UINT32)L1_Xhi_64; \
L1_X_lo=(UINT32)L1_Xlo_64; \
if (L1_X_hi>=Tento6){ \
__L0_Split_MiDi_3(L1_X_hi,(ptr)); \
__L0_Split_MiDi_3(L1_X_lo,(ptr)); \
} \
else if (L1_X_hi>=Tento3){ \
__L0_Split_MiDi_2(L1_X_hi,(ptr)); \
__L0_Split_MiDi_3(L1_X_lo,(ptr)); \
} \
else { \
*((ptr)++) = L1_X_hi; \
__L0_Split_MiDi_3(L1_X_lo,(ptr)); \
} \
} \
else { \
L1_X_lo = (UINT32)(X); \
if (L1_X_lo>=Tento6){ \
__L0_Split_MiDi_3(L1_X_lo,(ptr)); \
} \
else if (L1_X_lo>=Tento3){ \
__L0_Split_MiDi_2(L1_X_lo,(ptr)); \
} \
else { \
*((ptr)++) = L1_X_lo; \
} \
} \
}
#define __L0_MiDi2Str( X, c_ptr ) \
{ \
char *L0_src; \
L0_src = midi_tbl[(X)]; \
*((c_ptr)++) = *(L0_src++); \
*((c_ptr)++) = *(L0_src++); \
*((c_ptr)++) = *(L0_src); \
}
#define __L0_MiDi2Str_Lead( X, c_ptr ) \
{ \
char *L0_src; \
L0_src = midi_tbl[(X)]; \
if ((X)>=100){ \
*((c_ptr)++) = *(L0_src++); \
*((c_ptr)++) = *(L0_src++); \
*((c_ptr)++) = *(L0_src); \
} \
else if ((X)>=10){ \
L0_src++; \
*((c_ptr)++) = *(L0_src++); \
*((c_ptr)++) = *(L0_src); \
} \
else { \
L0_src++;L0_src++; \
*((c_ptr)++) = *(L0_src); \
} \
}
| Gurgel100/gcc | libgcc/config/libbid/bid128_2_str_macros.h | C | gpl-2.0 | 6,882 | [
30522,
1013,
1008,
9385,
1006,
1039,
1007,
2289,
1011,
25682,
2489,
4007,
3192,
1010,
4297,
1012,
2023,
5371,
2003,
2112,
1997,
1043,
9468,
1012,
1043,
9468,
2003,
2489,
4007,
1025,
2017,
2064,
2417,
2923,
3089,
8569,
2618,
2009,
1998,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5007.25751)
// Copyright (C) 1995-2014 IMS MAXIMS. All rights reserved.
// WARNING: DO NOT MODIFY the content of this file
package ims.RefMan.vo;
/**
* Linked to RefMan.CatsReferral business object (ID: 1004100035).
*/
public class CatsReferralForSessionManagementVo extends ims.RefMan.vo.CatsReferralRefVo implements ims.vo.ImsCloneable, Comparable
{
private static final long serialVersionUID = 1L;
public CatsReferralForSessionManagementVo()
{
}
public CatsReferralForSessionManagementVo(Integer id, int version)
{
super(id, version);
}
public CatsReferralForSessionManagementVo(ims.RefMan.vo.beans.CatsReferralForSessionManagementVoBean bean)
{
this.id = bean.getId();
this.version = bean.getVersion();
this.referraldetails = bean.getReferralDetails() == null ? null : bean.getReferralDetails().buildVo();
this.currentstatus = bean.getCurrentStatus() == null ? null : bean.getCurrentStatus().buildVo();
}
public void populate(ims.vo.ValueObjectBeanMap map, ims.RefMan.vo.beans.CatsReferralForSessionManagementVoBean bean)
{
this.id = bean.getId();
this.version = bean.getVersion();
this.referraldetails = bean.getReferralDetails() == null ? null : bean.getReferralDetails().buildVo(map);
this.currentstatus = bean.getCurrentStatus() == null ? null : bean.getCurrentStatus().buildVo(map);
}
public ims.vo.ValueObjectBean getBean()
{
return this.getBean(new ims.vo.ValueObjectBeanMap());
}
public ims.vo.ValueObjectBean getBean(ims.vo.ValueObjectBeanMap map)
{
ims.RefMan.vo.beans.CatsReferralForSessionManagementVoBean bean = null;
if(map != null)
bean = (ims.RefMan.vo.beans.CatsReferralForSessionManagementVoBean)map.getValueObjectBean(this);
if (bean == null)
{
bean = new ims.RefMan.vo.beans.CatsReferralForSessionManagementVoBean();
map.addValueObjectBean(this, bean);
bean.populate(map, this);
}
return bean;
}
public Object getFieldValueByFieldName(String fieldName)
{
if(fieldName == null)
throw new ims.framework.exceptions.CodingRuntimeException("Invalid field name");
fieldName = fieldName.toUpperCase();
if(fieldName.equals("REFERRALDETAILS"))
return getReferralDetails();
if(fieldName.equals("CURRENTSTATUS"))
return getCurrentStatus();
return super.getFieldValueByFieldName(fieldName);
}
public boolean getReferralDetailsIsNotNull()
{
return this.referraldetails != null;
}
public ims.RefMan.vo.ReferralLetterForSessionManagementVo getReferralDetails()
{
return this.referraldetails;
}
public void setReferralDetails(ims.RefMan.vo.ReferralLetterForSessionManagementVo value)
{
this.isValidated = false;
this.referraldetails = value;
}
public boolean getCurrentStatusIsNotNull()
{
return this.currentstatus != null;
}
public ims.RefMan.vo.CatsReferralStatusLiteVo getCurrentStatus()
{
return this.currentstatus;
}
public void setCurrentStatus(ims.RefMan.vo.CatsReferralStatusLiteVo value)
{
this.isValidated = false;
this.currentstatus = value;
}
public boolean isValidated()
{
if(this.isBusy)
return true;
this.isBusy = true;
if(!this.isValidated)
{
this.isBusy = false;
return false;
}
this.isBusy = false;
return true;
}
public String[] validate()
{
return validate(null);
}
public String[] validate(String[] existingErrors)
{
if(this.isBusy)
return null;
this.isBusy = true;
java.util.ArrayList<String> listOfErrors = new java.util.ArrayList<String>();
if(existingErrors != null)
{
for(int x = 0; x < existingErrors.length; x++)
{
listOfErrors.add(existingErrors[x]);
}
}
int errorCount = listOfErrors.size();
if(errorCount == 0)
{
this.isBusy = false;
this.isValidated = true;
return null;
}
String[] result = new String[errorCount];
for(int x = 0; x < errorCount; x++)
result[x] = (String)listOfErrors.get(x);
this.isBusy = false;
this.isValidated = false;
return result;
}
public void clearIDAndVersion()
{
this.id = null;
this.version = 0;
}
public Object clone()
{
if(this.isBusy)
return this;
this.isBusy = true;
CatsReferralForSessionManagementVo clone = new CatsReferralForSessionManagementVo(this.id, this.version);
if(this.referraldetails == null)
clone.referraldetails = null;
else
clone.referraldetails = (ims.RefMan.vo.ReferralLetterForSessionManagementVo)this.referraldetails.clone();
if(this.currentstatus == null)
clone.currentstatus = null;
else
clone.currentstatus = (ims.RefMan.vo.CatsReferralStatusLiteVo)this.currentstatus.clone();
clone.isValidated = this.isValidated;
this.isBusy = false;
return clone;
}
public int compareTo(Object obj)
{
return compareTo(obj, true);
}
public int compareTo(Object obj, boolean caseInsensitive)
{
if (obj == null)
{
return -1;
}
if(caseInsensitive); // this is to avoid eclipse warning only.
if (!(CatsReferralForSessionManagementVo.class.isAssignableFrom(obj.getClass())))
{
throw new ClassCastException("A CatsReferralForSessionManagementVo object cannot be compared an Object of type " + obj.getClass().getName());
}
if (this.id == null)
return 1;
if (((CatsReferralForSessionManagementVo)obj).getBoId() == null)
return -1;
return this.id.compareTo(((CatsReferralForSessionManagementVo)obj).getBoId());
}
public synchronized static int generateValueObjectUniqueID()
{
return ims.vo.ValueObject.generateUniqueID();
}
public int countFieldsWithValue()
{
int count = 0;
if(this.referraldetails != null)
count++;
if(this.currentstatus != null)
count++;
return count;
}
public int countValueObjectFields()
{
return 2;
}
protected ims.RefMan.vo.ReferralLetterForSessionManagementVo referraldetails;
protected ims.RefMan.vo.CatsReferralStatusLiteVo currentstatus;
private boolean isValidated = false;
private boolean isBusy = false;
}
| open-health-hub/openMAXIMS | openmaxims_workspace/ValueObjects/src/ims/RefMan/vo/CatsReferralForSessionManagementVo.java | Java | agpl-3.0 | 5,952 | [
30522,
1013,
1013,
2023,
3642,
2001,
7013,
2011,
6437,
24185,
20941,
2478,
10047,
2015,
2458,
4044,
1006,
2544,
1015,
1012,
3770,
3857,
3156,
2581,
1012,
24368,
22203,
1007,
1013,
1013,
9385,
1006,
1039,
1007,
2786,
1011,
2297,
10047,
2015,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package com.ecochain.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ecochain.service.AclResourcesService;
import com.ecochain.user.entity.AclResources;
import com.ecochain.user.entity.AclResourcesExample;
import com.ecochain.user.entity.Auth;
import com.ecochain.user.mapper.AclResourcesMapper;
/**
* Created by Athos on 2016-07-12.
*/
@Service
public class AclResourcesServiceImpl implements AclResourcesService {
@Autowired
AclResourcesMapper resourcesMapper;
protected AclResourcesMapper getMapper() {
return resourcesMapper;
}
@Override
public List<AclResources> selectAclResourcesTypeOfRequest() {
return getMapper().selectAclResourcesTypeOfRequest();
}
@Override
public List<AclResources> selectAclResourcesByResourceIds(String resourceIds) {
return getMapper().selectAclResourcesByResourceIds(resourceIds.split(","));
}
@Override
public List<Auth> findResourcesByResourceIds(String ids) {
return resourcesMapper.findResourcesByResourceIds(ids.split(","));
}
@Override
public List<AclResources> selectAllResources() {
return resourcesMapper.selectByExample(new AclResourcesExample());
}
}
| xionggit/BootLoginService | src/main/java/com/ecochain/service/impl/AclResourcesServiceImpl.java | Java | apache-2.0 | 1,374 | [
30522,
7427,
4012,
30524,
2862,
1025,
12324,
8917,
1012,
3500,
15643,
6198,
1012,
13435,
1012,
4713,
1012,
5754,
17287,
3508,
1012,
8285,
20357,
2094,
1025,
12324,
8917,
1012,
3500,
15643,
6198,
1012,
12991,
13874,
1012,
2326,
1025,
12324,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Copyright 2005-2010 Gallio Project - http://www.gallio.org/
// Portions Copyright 2000-2004 Jonathan de Halleux
//
// 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.
using System;
using Gallio.VisualStudio.Shell.Core;
namespace Gallio.VisualStudio.Shell.UI.ToolWindows
{
/// <summary>
/// Default tool window manager.
/// </summary>
public class DefaultToolWindowManager : IToolWindowManager
{
private readonly DefaultShell shell;
/// <summary>
/// Initializes the tool window manager.
/// </summary>
/// <param name="shell">The shell.</param>
public DefaultToolWindowManager(IShell shell)
{
this.shell = (DefaultShell)shell;
}
/// <inheritdoc />
public ToolWindow FindToolWindow(string id)
{
if (id == null)
throw new ArgumentNullException("id");
int internalId = GenerateWindowId(id);
var pane = (ShellToolWindowPane)shell.ShellPackage.FindToolWindow(typeof(ShellToolWindowPane), internalId, false);
return pane.ToolWindowContainer.ToolWindow;
}
/// <inheritdoc />
public void OpenToolWindow(string id, ToolWindow window)
{
if (id == null)
throw new ArgumentNullException("id");
if (window == null)
throw new ArgumentNullException("window");
int internalId = GenerateWindowId(id);
var pane = (ShellToolWindowPane) shell.ShellPackage.FindToolWindow(typeof(ShellToolWindowPane), internalId, true);
if (pane == null)
throw new ShellException("Could not create an instance of the Shell tool window pane.");
pane.ToolWindowContainer.ToolWindow = window;
window.Show();
}
/// <inheritdoc />
public void CloseToolWindow(string id)
{
if (id == null)
throw new ArgumentNullException("id");
ToolWindow window = FindToolWindow(id);
if (window != null)
window.Close();
}
private static int GenerateWindowId(string id)
{
return id.GetHashCode() & 0x7fffffff;
}
}
}
| citizenmatt/gallio | src/Extensions/VisualStudio/Gallio.VisualStudio.Shell/UI/ToolWindows/DefaultToolWindowManager.cs | C# | apache-2.0 | 2,771 | [
30522,
1013,
1013,
9385,
2384,
1011,
2230,
26033,
3695,
2622,
1011,
8299,
1024,
1013,
1013,
7479,
1012,
26033,
3695,
1012,
8917,
1013,
1013,
1013,
8810,
9385,
2456,
1011,
2432,
5655,
2139,
19769,
5602,
1013,
1013,
1013,
1013,
7000,
2104,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
import * as frame from '@nativescript/core/ui/frame';
export function navigate(args) {
frame.topmost().goBack();
}
| NativeScript/NativeScript | apps/ui/src/action-bar/clean-page.ts | TypeScript | mit | 120 | [
30522,
12324,
1008,
2004,
4853,
2013,
1005,
1030,
12493,
23235,
1013,
4563,
1013,
21318,
1013,
4853,
1005,
1025,
9167,
3853,
22149,
1006,
12098,
5620,
1007,
1063,
4853,
1012,
2327,
11800,
1006,
1007,
1012,
2175,
5963,
1006,
1007,
1025,
1065... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */
/**
* 1. Change the default font family in all browsers (opinionated).
* 2. Correct the line height in all browsers.
* 3. Prevent adjustments of font size after orientation changes in
* IE on Windows Phone and in iOS.
*/
/* Document
========================================================================== */
html {
font-family: sans-serif;
/* 1 */
line-height: 1.15;
/* 2 */
-ms-text-size-adjust: 100%;
/* 3 */
-webkit-text-size-adjust: 100%;
/* 3 */
}
/* Sections
========================================================================== */
/**
* Remove the margin in all browsers (opinionated).
*/
body {
margin: 0;
}
/**
* Add the correct display in IE 9-.
*/
article,
aside,
footer,
header,
nav,
section {
display: block;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/* Grouping content
========================================================================== */
/**
* Add the correct display in IE 9-.
* 1. Add the correct display in IE.
*/
figcaption,
figure,
main {
/* 1 */
display: block;
}
/**
* Add the correct margin in IE 8.
*/
figure {
margin: 1em 40px;
}
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box;
/* 1 */
height: 0;
/* 1 */
overflow: visible;
/* 2 */
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: monospace, monospace;
/* 1 */
font-size: 1em;
/* 2 */
}
/* Text-level semantics
========================================================================== */
/**
* 1. Remove the gray background on active links in IE 10.
* 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
*/
a {
background-color: transparent;
/* 1 */
-webkit-text-decoration-skip: objects;
/* 2 */
}
/**
* Remove the outline on focused links when they are also active or hovered
* in all browsers (opinionated).
*/
a:active,
a:hover {
outline-width: 0;
}
/**
* 1. Remove the bottom border in Firefox 39-.
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none;
/* 1 */
text-decoration: underline;
/* 2 */
text-decoration: underline dotted;
/* 2 */
}
/**
* Prevent the duplicate application of `bolder` by the next rule in Safari 6.
*/
b,
strong {
font-weight: inherit;
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp {
font-family: monospace, monospace;
/* 1 */
font-size: 1em;
/* 2 */
}
/**
* Add the correct font style in Android 4.3-.
*/
dfn {
font-style: italic;
}
/**
* Add the correct background and color in IE 9-.
*/
mark {
background-color: #ff0;
color: #000;
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
========================================================================== */
/**
* Add the correct display in IE 9-.
*/
audio,
video {
display: inline-block;
}
/**
* Add the correct display in iOS 4-7.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Remove the border on images inside links in IE 10-.
*/
img {
border-style: none;
}
/**
* Hide the overflow in IE.
*/
svg:not(:root) {
overflow: hidden;
}
/* Forms
========================================================================== */
/**
* 1. Change the font styles in all browsers (opinionated).
* 2. Remove the margin in Firefox and Safari.
*/
button,
input,
optgroup,
select,
textarea {
font-family: sans-serif;
/* 1 */
font-size: 100%;
/* 1 */
line-height: 1.15;
/* 1 */
margin: 0;
/* 2 */
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input {
/* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select {
/* 1 */
text-transform: none;
}
/**
* 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
* controls in Android 4.
* 2. Correct the inability to style clickable types in iOS and Safari.
*/
button,
html [type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
/* 2 */
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* Change the border, margin, and padding in all browsers (opinionated).
*/
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
box-sizing: border-box;
/* 1 */
color: inherit;
/* 2 */
display: table;
/* 1 */
max-width: 100%;
/* 1 */
padding: 0;
/* 3 */
white-space: normal;
/* 1 */
}
/**
* 1. Add the correct display in IE 9-.
* 2. Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
display: inline-block;
/* 1 */
vertical-align: baseline;
/* 2 */
}
/**
* Remove the default vertical scrollbar in IE.
*/
textarea {
overflow: auto;
}
/**
* 1. Add the correct box sizing in IE 10-.
* 2. Remove the padding in IE 10-.
*/
[type="checkbox"],
[type="radio"] {
box-sizing: border-box;
/* 1 */
padding: 0;
/* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type="search"] {
-webkit-appearance: textfield;
/* 1 */
outline-offset: -2px;
/* 2 */
}
/**
* Remove the inner padding and cancel buttons in Chrome and Safari on macOS.
*/
[type="search"]::-webkit-search-cancel-button,
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button;
/* 1 */
font: inherit;
/* 2 */
}
/* Interactive
========================================================================== */
/*
* Add the correct display in IE 9-.
* 1. Add the correct display in Edge, IE, and Firefox.
*/
details,
menu {
display: block;
}
/*
* Add the correct display in all browsers.
*/
summary {
display: list-item;
}
/* Scripting
========================================================================== */
/**
* Add the correct display in IE 9-.
*/
canvas {
display: inline-block;
}
/**
* Add the correct display in IE.
*/
template {
display: none;
}
/* Hidden
========================================================================== */
/**
* Add the correct display in IE 10-.
*/
[hidden] {
display: none;
}
header {
font-family: 'Unica One', cursive;
font-size: 2.5em;
background-color: transparent;
color: white;
text-align: center;
position: absolute;
z-index: 10;
width: 100%;
padding-top: 200px;
}
header h1 {
margin: auto 0px;
padding: 20px;
}
header h2 {
margin: auto 0px;
padding: 20px;
}
/*universal styles*/
*,
*:before,
*:after {
margin: 0;
padding: 0;
}
html {
height: 100%;
overflow: hidden;
font-family: 'Lato', sans-serif;
}
/*parallax styles*/
.parallax {
height: 100vh;
overflow-x: hidden;
overflow-y: auto;
-webkit-perspective: 300px;
perspective: 300px;
}
.parallaxLayer {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.group {
position: relative;
min-height: 100vh;
width: 100vw;
transform-style: inherit;
background: 50% 50% / cover;
-webkit-transition: -webkit-transform 0.5s;
transition: transform 0.5s;
}
.group:before {
content: " ";
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: 50% 50% / cover;
}
p {
width: 400px;
}
/*base styles*/
.base {
-webkit-transform: translateZ(0);
transform: translateZ(0) scale(1);
z-index: 5;
}
.base2 {
-webkit-transform: translateZ(-50px) scale(1.2);
transform: translateZ(-50px) scale(1.2);
z-index: 6;
}
/*group styles*/
/* slide over group 2 */
#group1 {
z-index: 8;
}
#group1 .base {
background: url("../img/space.png") center center no-repeat;
background-size: cover;
}
#group1 .base2 {
background: url("../img/surface.png") center bottom no-repeat;
background-size: cover;
}
/* slide under groups 1 and 3 */
#group2 {
z-index: 6;
}
/* slide over group 2*/
#group3 {
z-index: 7;
}
| kipr2395/dev | parallax/css/main.css | CSS | mit | 9,762 | [
30522,
1013,
1008,
999,
3671,
4697,
1012,
20116,
2015,
1058,
2629,
1012,
1014,
1012,
1014,
1064,
10210,
6105,
1064,
21025,
2705,
12083,
1012,
4012,
1013,
26785,
6030,
2015,
1013,
3671,
4697,
1012,
20116,
2015,
1008,
1013,
1013,
1008,
1008,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* Cabal - Legacy Game Implementations
*
* Cabal is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
// Based on the ScummVM (GPLv2+) file of the same name
#include "backends/graphics/opengl/opengl-graphics.h"
#include "backends/graphics/opengl/texture.h"
#include "backends/graphics/opengl/debug.h"
#include "backends/graphics/opengl/extensions.h"
#include "common/textconsole.h"
#include "common/translation.h"
#include "common/algorithm.h"
#include "common/file.h"
#ifdef USE_OSD
#include "common/tokenizer.h"
#include "common/rect.h"
#endif
#include "graphics/conversion.h"
#ifdef USE_OSD
#include "graphics/fontman.h"
#include "graphics/font.h"
#endif
namespace OpenGL {
OpenGLGraphicsManager::OpenGLGraphicsManager()
: _currentState(), _oldState(), _transactionMode(kTransactionNone), _screenChangeID(1 << (sizeof(int) * 8 - 2)),
_outputScreenWidth(0), _outputScreenHeight(0), _displayX(0), _displayY(0),
_displayWidth(0), _displayHeight(0), _defaultFormat(), _defaultFormatAlpha(),
_gameScreen(nullptr), _gameScreenShakeOffset(0), _overlay(nullptr),
_overlayVisible(false), _cursor(nullptr),
_cursorX(0), _cursorY(0), _cursorDisplayX(0),_cursorDisplayY(0), _cursorHotspotX(0), _cursorHotspotY(0),
_cursorHotspotXScaled(0), _cursorHotspotYScaled(0), _cursorWidthScaled(0), _cursorHeightScaled(0),
_cursorKeyColor(0), _cursorVisible(false), _cursorDontScale(false), _cursorPaletteEnabled(false),
_forceRedraw(false), _scissorOverride(3)
#ifdef USE_OSD
, _osdAlpha(0), _osdFadeStartTime(0), _osd(nullptr)
#endif
{
memset(_gamePalette, 0, sizeof(_gamePalette));
}
OpenGLGraphicsManager::~OpenGLGraphicsManager() {
delete _gameScreen;
delete _overlay;
delete _cursor;
#ifdef USE_OSD
delete _osd;
#endif
}
bool OpenGLGraphicsManager::hasFeature(OSystem::Feature f) {
switch (f) {
case OSystem::kFeatureAspectRatioCorrection:
case OSystem::kFeatureCursorPalette:
return true;
case OSystem::kFeatureOverlaySupportsAlpha:
return _defaultFormatAlpha.aBits() > 3;
default:
return false;
}
}
void OpenGLGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
switch (f) {
case OSystem::kFeatureAspectRatioCorrection:
assert(_transactionMode != kTransactionNone);
_currentState.aspectRatioCorrection = enable;
break;
case OSystem::kFeatureCursorPalette:
_cursorPaletteEnabled = enable;
updateCursorPalette();
break;
default:
break;
}
}
bool OpenGLGraphicsManager::getFeatureState(OSystem::Feature f) {
switch (f) {
case OSystem::kFeatureAspectRatioCorrection:
return _currentState.aspectRatioCorrection;
case OSystem::kFeatureCursorPalette:
return _cursorPaletteEnabled;
default:
return false;
}
}
namespace {
const OSystem::GraphicsMode glGraphicsModes[] = {
{ "opengl_linear", _s("OpenGL"), GFX_LINEAR },
{ "opengl_nearest", _s("OpenGL (No filtering)"), GFX_NEAREST },
{ nullptr, nullptr, 0 }
};
} // End of anonymous namespace
const OSystem::GraphicsMode *OpenGLGraphicsManager::getSupportedGraphicsModes() const {
return glGraphicsModes;
}
int OpenGLGraphicsManager::getDefaultGraphicsMode() const {
return GFX_LINEAR;
}
bool OpenGLGraphicsManager::setGraphicsMode(int mode) {
assert(_transactionMode != kTransactionNone);
switch (mode) {
case GFX_LINEAR:
case GFX_NEAREST:
_currentState.graphicsMode = mode;
if (_gameScreen) {
_gameScreen->enableLinearFiltering(mode == GFX_LINEAR);
}
if (_cursor) {
_cursor->enableLinearFiltering(mode == GFX_LINEAR);
}
return true;
default:
warning("OpenGLGraphicsManager::setGraphicsMode(%d): Unknown graphics mode", mode);
return false;
}
}
int OpenGLGraphicsManager::getGraphicsMode() const {
return _currentState.graphicsMode;
}
Graphics::PixelFormat OpenGLGraphicsManager::getScreenFormat() const {
return _currentState.gameFormat;
}
void OpenGLGraphicsManager::beginGFXTransaction() {
assert(_transactionMode == kTransactionNone);
// Start a transaction.
_oldState = _currentState;
_transactionMode = kTransactionActive;
}
OSystem::TransactionError OpenGLGraphicsManager::endGFXTransaction() {
assert(_transactionMode == kTransactionActive);
uint transactionError = OSystem::kTransactionSuccess;
bool setupNewGameScreen = false;
if ( _oldState.gameWidth != _currentState.gameWidth
|| _oldState.gameHeight != _currentState.gameHeight) {
setupNewGameScreen = true;
}
if (_oldState.gameFormat != _currentState.gameFormat) {
setupNewGameScreen = true;
}
// Check whether the requested format can actually be used.
Common::List<Graphics::PixelFormat> supportedFormats = getSupportedFormats();
// In case the requested format is not usable we will fall back to CLUT8.
if (Common::find(supportedFormats.begin(), supportedFormats.end(), _currentState.gameFormat) == supportedFormats.end()) {
_currentState.gameFormat = Graphics::PixelFormat::createFormatCLUT8();
transactionError |= OSystem::kTransactionFormatNotSupported;
}
do {
uint requestedWidth = _currentState.gameWidth;
uint requestedHeight = _currentState.gameHeight;
const uint desiredAspect = getDesiredGameScreenAspect();
requestedHeight = intToFrac(requestedWidth) / desiredAspect;
if (!loadVideoMode(requestedWidth, requestedHeight, _currentState.gameFormat)
// HACK: This is really nasty but we don't have any guarantees of
// a context existing before, which means we don't know the maximum
// supported texture size before this. Thus, we check whether the
// requested game resolution is supported over here.
|| ( _currentState.gameWidth > (uint)Texture::getMaximumTextureSize()
|| _currentState.gameHeight > (uint)Texture::getMaximumTextureSize())) {
if (_transactionMode == kTransactionActive) {
// Try to setup the old state in case its valid and is
// actually different from the new one.
if (_oldState.valid && _oldState != _currentState) {
// Give some hints on what failed to set up.
if ( _oldState.gameWidth != _currentState.gameWidth
|| _oldState.gameHeight != _currentState.gameHeight) {
transactionError |= OSystem::kTransactionSizeChangeFailed;
}
if (_oldState.gameFormat != _currentState.gameFormat) {
transactionError |= OSystem::kTransactionFormatNotSupported;
}
if (_oldState.aspectRatioCorrection != _currentState.aspectRatioCorrection) {
transactionError |= OSystem::kTransactionAspectRatioFailed;
}
if (_oldState.graphicsMode != _currentState.graphicsMode) {
transactionError |= OSystem::kTransactionModeSwitchFailed;
}
// Roll back to the old state.
_currentState = _oldState;
_transactionMode = kTransactionRollback;
// Try to set up the old state.
continue;
}
}
// DON'T use error(), as this tries to bring up the debug
// console, which WON'T WORK now that we might no have a
// proper screen.
warning("OpenGLGraphicsManager::endGFXTransaction: Could not load any graphics mode!");
g_system->quit();
}
// In case we reach this we have a valid state, yay.
_transactionMode = kTransactionNone;
_currentState.valid = true;
} while (_transactionMode == kTransactionRollback);
if (setupNewGameScreen) {
delete _gameScreen;
_gameScreen = nullptr;
_gameScreen = createTexture(_currentState.gameFormat);
assert(_gameScreen);
if (_gameScreen->hasPalette()) {
_gameScreen->setPalette(0, 256, _gamePalette);
}
_gameScreen->allocate(_currentState.gameWidth, _currentState.gameHeight);
_gameScreen->enableLinearFiltering(_currentState.graphicsMode == GFX_LINEAR);
// We fill the screen to all black or index 0 for CLUT8.
if (_currentState.gameFormat.bytesPerPixel == 1) {
_gameScreen->fill(0);
} else {
_gameScreen->fill(_gameScreen->getSurface()->getFormat().RGBToColor(0, 0, 0));
}
}
// Update our display area and cursor scaling. This makes sure we pick up
// aspect ratio correction and game screen changes correctly.
recalculateDisplayArea();
recalculateCursorScaling();
// Something changed, so update the screen change ID.
++_screenChangeID;
// Since transactionError is a ORd list of TransactionErrors this is
// clearly wrong. But our API is simply broken.
return (OSystem::TransactionError)transactionError;
}
int OpenGLGraphicsManager::getScreenChangeID() const {
return _screenChangeID;
}
void OpenGLGraphicsManager::initSize(uint width, uint height, const Graphics::PixelFormat *format) {
Graphics::PixelFormat requestedFormat;
if (!format) {
requestedFormat = Graphics::PixelFormat::createFormatCLUT8();
} else {
requestedFormat = *format;
}
_currentState.gameFormat = requestedFormat;
_currentState.gameWidth = width;
_currentState.gameHeight = height;
}
int16 OpenGLGraphicsManager::getWidth() {
return _currentState.gameWidth;
}
int16 OpenGLGraphicsManager::getHeight() {
return _currentState.gameHeight;
}
void OpenGLGraphicsManager::copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) {
_gameScreen->copyRectToTexture(x, y, w, h, buf, pitch);
}
void OpenGLGraphicsManager::fillScreen(uint32 col) {
// FIXME: This does not conform to the OSystem specs because fillScreen
// is always taking CLUT8 color values and use color indexed mode. This is,
// however, plain odd and probably was a forgotten when we introduced
// RGB support. Thus, we simply do the "sane" thing here and hope OSystem
// gets fixed one day.
_gameScreen->fill(col);
}
void OpenGLGraphicsManager::setShakePos(int shakeOffset) {
if (_gameScreenShakeOffset != shakeOffset) {
_gameScreenShakeOffset = shakeOffset;
_forceRedraw = true;
}
}
void OpenGLGraphicsManager::updateScreen() {
if (!_gameScreen) {
return;
}
// We only update the screen when there actually have been any changes.
if ( !_forceRedraw
&& !_gameScreen->isDirty()
&& !(_overlayVisible && _overlay->isDirty())
&& !(_cursorVisible && _cursor && _cursor->isDirty())
&& _osdAlpha == 0) {
return;
}
_forceRedraw = false;
// Clear the screen buffer.
if (_scissorOverride && !_overlayVisible) {
// In certain cases we need to assure that the whole screen area is
// cleared. For example, when switching from overlay visible to
// invisible, we need to assure that all contents are cleared to
// properly remove all overlay contents.
GLCALL(glDisable(GL_SCISSOR_TEST));
GLCALL(glClear(GL_COLOR_BUFFER_BIT));
GLCALL(glEnable(GL_SCISSOR_TEST));
--_scissorOverride;
} else {
GLCALL(glClear(GL_COLOR_BUFFER_BIT));
}
const GLfloat shakeOffset = _gameScreenShakeOffset * (GLfloat)_displayHeight / _gameScreen->getHeight();
// First step: Draw the (virtual) game screen.
_gameScreen->draw(_displayX, _displayY + shakeOffset, _displayWidth, _displayHeight);
// Second step: Draw the overlay if visible.
if (_overlayVisible) {
_overlay->draw(0, 0, _outputScreenWidth, _outputScreenHeight);
}
// Third step: Draw the cursor if visible.
if (_cursorVisible && _cursor) {
// Adjust game screen shake position, but only when the overlay is not
// visible.
const GLfloat cursorOffset = _overlayVisible ? 0 : shakeOffset;
_cursor->draw(_cursorDisplayX - _cursorHotspotXScaled,
_cursorDisplayY - _cursorHotspotYScaled + cursorOffset,
_cursorWidthScaled, _cursorHeightScaled);
}
#ifdef USE_OSD
// Fourth step: Draw the OSD.
if (_osdAlpha > 0) {
Common::StackLock lock(_osdMutex);
// Update alpha value.
const int diff = g_system->getMillis() - _osdFadeStartTime;
if (diff > 0) {
if (diff >= kOSDFadeOutDuration) {
// Back to full transparency.
_osdAlpha = 0;
} else {
// Do a fade out.
_osdAlpha = kOSDInitialAlpha - diff * kOSDInitialAlpha / kOSDFadeOutDuration;
}
}
// Set the OSD transparency.
GLCALL(glColor4f(1.0f, 1.0f, 1.0f, _osdAlpha / 100.0f));
// Draw the OSD texture.
_osd->draw(0, 0, _outputScreenWidth, _outputScreenHeight);
// Reset color.
GLCALL(glColor4f(1.0f, 1.0f, 1.0f, 1.0f));
}
#endif
refreshScreen();
}
Graphics::Surface *OpenGLGraphicsManager::lockScreen() {
return _gameScreen->getSurface();
}
void OpenGLGraphicsManager::unlockScreen() {
_gameScreen->flagDirty();
}
void OpenGLGraphicsManager::setFocusRectangle(const Common::Rect& rect) {
}
void OpenGLGraphicsManager::clearFocusRectangle() {
}
int16 OpenGLGraphicsManager::getOverlayWidth() {
if (_overlay) {
return _overlay->getWidth();
} else {
return 0;
}
}
int16 OpenGLGraphicsManager::getOverlayHeight() {
if (_overlay) {
return _overlay->getHeight();
} else {
return 0;
}
}
void OpenGLGraphicsManager::showOverlay() {
_overlayVisible = true;
_forceRedraw = true;
// Allow drawing inside full screen area.
GLCALL(glDisable(GL_SCISSOR_TEST));
// Update cursor position.
setMousePosition(_cursorX, _cursorY);
}
void OpenGLGraphicsManager::hideOverlay() {
_overlayVisible = false;
_forceRedraw = true;
// Limit drawing to screen area.
GLCALL(glEnable(GL_SCISSOR_TEST));
_scissorOverride = 3;
// Update cursor position.
setMousePosition(_cursorX, _cursorY);
}
Graphics::PixelFormat OpenGLGraphicsManager::getOverlayFormat() const {
return _overlay->getFormat();
}
void OpenGLGraphicsManager::copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) {
_overlay->copyRectToTexture(x, y, w, h, buf, pitch);
}
void OpenGLGraphicsManager::clearOverlay() {
_overlay->fill(0);
}
void OpenGLGraphicsManager::grabOverlay(void *buf, int pitch) {
const Graphics::Surface *overlayData = _overlay->getSurface();
const byte *src = (const byte *)overlayData->getPixels();
byte *dst = (byte *)buf;
for (uint h = overlayData->getHeight(); h > 0; --h) {
memcpy(dst, src, overlayData->getWidth() * overlayData->getFormat().bytesPerPixel);
dst += pitch;
src += overlayData->getPitch();
}
}
bool OpenGLGraphicsManager::showMouse(bool visible) {
// In case the mouse cursor visibility changed we need to redraw the whole
// screen even when nothing else changed.
if (_cursorVisible != visible) {
_forceRedraw = true;
}
bool last = _cursorVisible;
_cursorVisible = visible;
return last;
}
void OpenGLGraphicsManager::warpMouse(int x, int y) {
int16 currentX = _cursorX;
int16 currentY = _cursorY;
adjustMousePosition(currentX, currentY);
// Check whether the (virtual) coordinate actually changed. If not, then
// simply do nothing. This avoids ugly "jittering" due to the actual
// output screen having a bigger resolution than the virtual coordinates.
if (currentX == x && currentY == y) {
return;
}
// Scale the virtual coordinates into actual physical coordinates.
if (_overlayVisible) {
if (!_overlay) {
return;
}
// It might be confusing that we actually have to handle something
// here when the overlay is visible. This is because for very small
// resolutions we have a minimal overlay size and have to adjust
// for that.
x = (x * _outputScreenWidth) / _overlay->getWidth();
y = (y * _outputScreenHeight) / _overlay->getHeight();
} else {
if (!_gameScreen) {
return;
}
x = (x * _outputScreenWidth) / _gameScreen->getWidth();
y = (y * _outputScreenHeight) / _gameScreen->getHeight();
}
setMousePosition(x, y);
setInternalMousePosition(x, y);
}
namespace {
template<typename DstPixel, typename SrcPixel>
void applyColorKey(DstPixel *dst, const SrcPixel *src, uint w, uint h, uint dstPitch, uint srcPitch, SrcPixel keyColor, DstPixel alphaMask) {
const uint srcAdd = srcPitch - w * sizeof(SrcPixel);
const uint dstAdd = dstPitch - w * sizeof(DstPixel);
while (h-- > 0) {
for (uint x = w; x > 0; --x, ++dst, ++src) {
if (*src == keyColor) {
*dst &= ~alphaMask;
}
}
dst = (DstPixel *)((byte *)dst + dstAdd);
src = (const SrcPixel *)((const byte *)src + srcAdd);
}
}
} // End of anonymous namespace
void OpenGLGraphicsManager::setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format) {
Graphics::PixelFormat inputFormat;
if (format) {
inputFormat = *format;
} else {
inputFormat = Graphics::PixelFormat::createFormatCLUT8();
}
// In case the color format has changed we will need to create the texture.
if (!_cursor || _cursor->getFormat() != inputFormat) {
delete _cursor;
_cursor = nullptr;
GLenum glIntFormat, glFormat, glType;
Graphics::PixelFormat textureFormat;
if (inputFormat.bytesPerPixel == 1 || (inputFormat.aBits() && getGLPixelFormat(inputFormat, glIntFormat, glFormat, glType))) {
// There is two cases when we can use the cursor format directly.
// The first is when it's CLUT8, here color key handling can
// always be applied because we use the alpha channel of
// _defaultFormatAlpha for that.
// The other is when the input format has alpha bits and
// furthermore is directly supported.
textureFormat = inputFormat;
} else {
textureFormat = _defaultFormatAlpha;
}
_cursor = createTexture(textureFormat, true);
assert(_cursor);
_cursor->enableLinearFiltering(_currentState.graphicsMode == GFX_LINEAR);
}
_cursorKeyColor = keycolor;
_cursorHotspotX = hotspotX;
_cursorHotspotY = hotspotY;
_cursorDontScale = dontScale;
_cursor->allocate(w, h);
if (inputFormat.bytesPerPixel == 1) {
// For CLUT8 cursors we can simply copy the input data into the
// texture.
_cursor->copyRectToTexture(0, 0, w, h, buf, w * inputFormat.bytesPerPixel);
} else {
// Otherwise it is a bit more ugly because we have to handle a key
// color properly.
Graphics::Surface *dst = _cursor->getSurface();
const uint srcPitch = w * inputFormat.bytesPerPixel;
// Copy the cursor data to the actual texture surface. This will make
// sure that the data is also converted to the expected format.
Graphics::crossBlit((byte *)dst->getPixels(), (const byte *)buf, dst->getPitch(), srcPitch,
w, h, dst->getFormat(), inputFormat);
// We apply the color key by setting the alpha bits of the pixels to
// fully transparent.
const uint32 aMask = (0xFF >> dst->getFormat().aLoss) << dst->getFormat().aShift;
if (dst->getFormat().bytesPerPixel == 2) {
if (inputFormat.bytesPerPixel == 2) {
applyColorKey<uint16, uint16>((uint16 *)dst->getPixels(), (const uint16 *)buf, w, h,
dst->getPitch(), srcPitch, keycolor, aMask);
} else if (inputFormat.bytesPerPixel == 4) {
applyColorKey<uint16, uint32>((uint16 *)dst->getPixels(), (const uint32 *)buf, w, h,
dst->getPitch(), srcPitch, keycolor, aMask);
}
} else {
if (inputFormat.bytesPerPixel == 2) {
applyColorKey<uint32, uint16>((uint32 *)dst->getPixels(), (const uint16 *)buf, w, h,
dst->getPitch(), srcPitch, keycolor, aMask);
} else if (inputFormat.bytesPerPixel == 4) {
applyColorKey<uint32, uint32>((uint32 *)dst->getPixels(), (const uint32 *)buf, w, h,
dst->getPitch(), srcPitch, keycolor, aMask);
}
}
// Flag the texture as dirty.
_cursor->flagDirty();
}
// In case we actually use a palette set that up properly.
if (inputFormat.bytesPerPixel == 1) {
updateCursorPalette();
}
// Update the scaling.
recalculateCursorScaling();
}
void OpenGLGraphicsManager::setCursorPalette(const byte *colors, uint start, uint num) {
// FIXME: For some reason client code assumes that usage of this function
// automatically enables the cursor palette.
_cursorPaletteEnabled = true;
memcpy(_cursorPalette + start * 3, colors, num * 3);
updateCursorPalette();
}
void OpenGLGraphicsManager::displayMessageOnOSD(const char *msg) {
#ifdef USE_OSD
// HACK: Actually no client code should use graphics functions from
// another thread. But the MT-32 emulator still does, thus we need to
// make sure this doesn't happen while a updateScreen call is done.
Common::StackLock lock(_osdMutex);
// Slip up the lines.
Common::Array<Common::String> osdLines;
Common::StringTokenizer tokenizer(msg, "\n");
while (!tokenizer.empty()) {
osdLines.push_back(tokenizer.nextToken());
}
// Do the actual drawing like the SDL backend.
const Graphics::Font *font = getFontOSD();
Graphics::Surface *dst = _osd->getSurface();
_osd->fill(0);
_osd->flagDirty();
// Determine a rect which would contain the message string (clipped to the
// screen dimensions).
const int vOffset = 6;
const int lineSpacing = 1;
const int lineHeight = font->getFontHeight() + 2 * lineSpacing;
int width = 0;
int height = lineHeight * osdLines.size() + 2 * vOffset;
for (uint i = 0; i < osdLines.size(); i++) {
width = MAX(width, font->getStringWidth(osdLines[i]) + 14);
}
// Clip the rect
width = MIN<int>(width, dst->getWidth());
height = MIN<int>(height, dst->getHeight());
int dstX = (dst->getWidth() - width) / 2;
int dstY = (dst->getHeight() - height) / 2;
// Draw a dark gray rect.
const uint32 color = dst->getFormat().RGBToColor(40, 40, 40);
dst->fillRect(Common::Rect(dstX, dstY, dstX + width, dstY + height), color);
// Render the message, centered, and in white
const uint32 white = dst->getFormat().RGBToColor(255, 255, 255);
for (uint i = 0; i < osdLines.size(); ++i) {
font->drawString(dst, osdLines[i],
dstX, dstY + i * lineHeight + vOffset + lineSpacing, width,
white, Graphics::kTextAlignCenter);
}
// Init the OSD display parameters.
_osdAlpha = kOSDInitialAlpha;
_osdFadeStartTime = g_system->getMillis() + kOSDFadeOutDelay;
#endif
}
void OpenGLGraphicsManager::setPalette(const byte *colors, uint start, uint num) {
assert(_gameScreen->hasPalette());
memcpy(_gamePalette + start * 3, colors, num * 3);
_gameScreen->setPalette(start, num, colors);
// We might need to update the cursor palette here.
updateCursorPalette();
}
void OpenGLGraphicsManager::grabPalette(byte *colors, uint start, uint num) {
assert(_gameScreen->hasPalette());
memcpy(colors, _gamePalette + start * 3, num * 3);
}
void OpenGLGraphicsManager::setActualScreenSize(uint width, uint height) {
_outputScreenWidth = width;
_outputScreenHeight = height;
// Setup coordinates system.
GLCALL(glViewport(0, 0, _outputScreenWidth, _outputScreenHeight));
GLCALL(glMatrixMode(GL_PROJECTION));
GLCALL(glLoadIdentity());
#ifdef USE_GLES
GLCALL(glOrthof(0, _outputScreenWidth, _outputScreenHeight, 0, -1, 1));
#else
GLCALL(glOrtho(0, _outputScreenWidth, _outputScreenHeight, 0, -1, 1));
#endif
GLCALL(glMatrixMode(GL_MODELVIEW));
GLCALL(glLoadIdentity());
uint overlayWidth = width;
uint overlayHeight = height;
// WORKAROUND: We can only support surfaces up to the maximum supported
// texture size. Thus, in case we encounter a physical size bigger than
// this maximum texture size we will simply use an overlay as big as
// possible and then scale it to the physical display size. This sounds
// bad but actually all recent chips should support full HD resolution
// anyway. Thus, it should not be a real issue for modern hardware.
if ( overlayWidth > (uint)Texture::getMaximumTextureSize()
|| overlayHeight > (uint)Texture::getMaximumTextureSize()) {
const frac_t outputAspect = intToFrac(_outputScreenWidth) / _outputScreenHeight;
if (outputAspect > (frac_t)FRAC_ONE) {
overlayWidth = Texture::getMaximumTextureSize();
overlayHeight = intToFrac(overlayWidth) / outputAspect;
} else {
overlayHeight = Texture::getMaximumTextureSize();
overlayWidth = fracToInt(overlayHeight * outputAspect);
}
}
// HACK: We limit the minimal overlay size to 256x200, which is the
// minimum of the dimensions of the two resolutions 256x240 (NES) and
// 320x200 (many DOS games use this). This hopefully assure that our
// GUI has working layouts.
overlayWidth = MAX<uint>(overlayWidth, 256);
overlayHeight = MAX<uint>(overlayHeight, 200);
if (!_overlay || _overlay->getFormat() != _defaultFormatAlpha) {
delete _overlay;
_overlay = nullptr;
_overlay = createTexture(_defaultFormatAlpha);
assert(_overlay);
// We always filter the overlay with GL_LINEAR. This assures it's
// readable in case it needs to be scaled and does not affect it
// otherwise.
_overlay->enableLinearFiltering(true);
}
_overlay->allocate(overlayWidth, overlayHeight);
_overlay->fill(0);
#ifdef USE_OSD
if (!_osd || _osd->getFormat() != _defaultFormatAlpha) {
delete _osd;
_osd = nullptr;
_osd = createTexture(_defaultFormatAlpha);
assert(_osd);
// We always filter the osd with GL_LINEAR. This assures it's
// readable in case it needs to be scaled and does not affect it
// otherwise.
_osd->enableLinearFiltering(true);
}
_osd->allocate(_overlay->getWidth(), _overlay->getHeight());
_osd->fill(0);
#endif
// Re-setup the scaling for the screen and cursor
recalculateDisplayArea();
recalculateCursorScaling();
// Something changed, so update the screen change ID.
++_screenChangeID;
}
void OpenGLGraphicsManager::notifyContextCreate(const Graphics::PixelFormat &defaultFormat, const Graphics::PixelFormat &defaultFormatAlpha) {
// Initialize all extensions.
initializeGLExtensions();
// Disable 3D properties.
GLCALL(glDisable(GL_CULL_FACE));
GLCALL(glDisable(GL_DEPTH_TEST));
GLCALL(glDisable(GL_LIGHTING));
GLCALL(glDisable(GL_FOG));
GLCALL(glDisable(GL_DITHER));
GLCALL(glShadeModel(GL_FLAT));
GLCALL(glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST));
// Default to black as clear color.
GLCALL(glClearColor(0.0f, 0.0f, 0.0f, 0.0f));
GLCALL(glColor4f(1.0f, 1.0f, 1.0f, 1.0f));
// Setup alpha blend (for overlay and cursor).
GLCALL(glEnable(GL_BLEND));
GLCALL(glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA));
// Enable rendering with vertex and coord arrays.
GLCALL(glEnableClientState(GL_VERTEX_ARRAY));
GLCALL(glEnableClientState(GL_TEXTURE_COORD_ARRAY));
GLCALL(glEnable(GL_TEXTURE_2D));
// Setup scissor state accordingly.
if (_overlayVisible) {
GLCALL(glDisable(GL_SCISSOR_TEST));
} else {
GLCALL(glEnable(GL_SCISSOR_TEST));
}
// Clear the whole screen for the first three frames to assure any
// leftovers are cleared.
_scissorOverride = 3;
// We use a "pack" alignment (when reading from textures) to 4 here,
// since the only place where we really use it is the BMP screenshot
// code and that requires the same alignment too.
GLCALL(glPixelStorei(GL_PACK_ALIGNMENT, 4));
// Query information needed by textures.
Texture::queryTextureInformation();
// Refresh the output screen dimensions if some are set up.
if (_outputScreenWidth != 0 && _outputScreenHeight != 0) {
setActualScreenSize(_outputScreenWidth, _outputScreenHeight);
}
// TODO: Should we try to convert textures into one of those formats if
// possible? For example, when _gameScreen is CLUT8 we might want to use
// defaultFormat now.
_defaultFormat = defaultFormat;
_defaultFormatAlpha = defaultFormatAlpha;
if (_gameScreen) {
_gameScreen->recreateInternalTexture();
}
if (_overlay) {
_overlay->recreateInternalTexture();
}
if (_cursor) {
_cursor->recreateInternalTexture();
}
#ifdef USE_OSD
if (_osd) {
_osd->recreateInternalTexture();
}
#endif
}
void OpenGLGraphicsManager::notifyContextDestroy() {
if (_gameScreen) {
_gameScreen->releaseInternalTexture();
}
if (_overlay) {
_overlay->releaseInternalTexture();
}
if (_cursor) {
_cursor->releaseInternalTexture();
}
#ifdef USE_OSD
if (_osd) {
_osd->releaseInternalTexture();
}
#endif
}
void OpenGLGraphicsManager::adjustMousePosition(int16 &x, int16 &y) {
if (_overlayVisible) {
// It might be confusing that we actually have to handle something
// here when the overlay is visible. This is because for very small
// resolutions we have a minimal overlay size and have to adjust
// for that.
// This can also happen when the overlay is smaller than the actual
// display size because of texture size limitations.
if (_overlay) {
x = (x * _overlay->getWidth()) / _outputScreenWidth;
y = (y * _overlay->getHeight()) / _outputScreenHeight;
}
} else if (_gameScreen) {
const int16 width = _gameScreen->getWidth();
const int16 height = _gameScreen->getHeight();
x = (x * width) / (int)_outputScreenWidth;
y = (y * height) / (int)_outputScreenHeight;
}
}
void OpenGLGraphicsManager::setMousePosition(int x, int y) {
// Whenever the mouse position changed we force a screen redraw to reflect
// changes properly.
if (_cursorX != x || _cursorY != y) {
_forceRedraw = true;
}
_cursorX = x;
_cursorY = y;
if (_overlayVisible) {
_cursorDisplayX = x;
_cursorDisplayY = y;
} else {
_cursorDisplayX = _displayX + (x * _displayWidth) / _outputScreenWidth;
_cursorDisplayY = _displayY + (y * _displayHeight) / _outputScreenHeight;
}
}
Texture *OpenGLGraphicsManager::createTexture(const Graphics::PixelFormat &format, bool wantAlpha) {
GLenum glIntFormat, glFormat, glType;
if (format.bytesPerPixel == 1) {
const Graphics::PixelFormat &virtFormat = wantAlpha ? _defaultFormatAlpha : _defaultFormat;
const bool supported = getGLPixelFormat(virtFormat, glIntFormat, glFormat, glType);
if (!supported) {
return nullptr;
} else {
return new TextureCLUT8(glIntFormat, glFormat, glType, virtFormat);
}
} else {
const bool supported = getGLPixelFormat(format, glIntFormat, glFormat, glType);
if (!supported) {
return nullptr;
} else {
return new Texture(glIntFormat, glFormat, glType, format);
}
}
}
bool OpenGLGraphicsManager::getGLPixelFormat(const Graphics::PixelFormat &pixelFormat, GLenum &glIntFormat, GLenum &glFormat, GLenum &glType) const {
#ifdef SCUMM_LITTLE_ENDIAN
if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24)) { // ABGR8888
#else
if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0)) { // RGBA8888
#endif
glIntFormat = GL_RGBA;
glFormat = GL_RGBA;
glType = GL_UNSIGNED_BYTE;
return true;
} else if (pixelFormat == Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0)) { // RGB565
glIntFormat = GL_RGB;
glFormat = GL_RGB;
glType = GL_UNSIGNED_SHORT_5_6_5;
return true;
} else if (pixelFormat == Graphics::PixelFormat(2, 5, 5, 5, 1, 11, 6, 1, 0)) { // RGBA5551
glIntFormat = GL_RGBA;
glFormat = GL_RGBA;
glType = GL_UNSIGNED_SHORT_5_5_5_1;
return true;
} else if (pixelFormat == Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0)) { // RGBA4444
glIntFormat = GL_RGBA;
glFormat = GL_RGBA;
glType = GL_UNSIGNED_SHORT_4_4_4_4;
return true;
#ifndef USE_GLES
#ifdef SCUMM_LITTLE_ENDIAN
} else if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0)) { // RGBA8888
glIntFormat = GL_RGBA;
glFormat = GL_RGBA;
glType = GL_UNSIGNED_INT_8_8_8_8;
return true;
#endif
} else if (pixelFormat == Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0)) { // RGB555
// GL_BGRA does not exist in every GLES implementation so should not be configured if
// USE_GLES is set.
glIntFormat = GL_RGB;
glFormat = GL_BGRA;
glType = GL_UNSIGNED_SHORT_1_5_5_5_REV;
return true;
} else if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24)) { // ARGB8888
glIntFormat = GL_RGBA;
glFormat = GL_BGRA;
glType = GL_UNSIGNED_INT_8_8_8_8_REV;
return true;
} else if (pixelFormat == Graphics::PixelFormat(2, 4, 4, 4, 4, 8, 4, 0, 12)) { // ARGB4444
glIntFormat = GL_RGBA;
glFormat = GL_BGRA;
glType = GL_UNSIGNED_SHORT_4_4_4_4_REV;
return true;
#ifdef SCUMM_BIG_ENDIAN
} else if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24)) { // ABGR8888
glIntFormat = GL_RGBA;
glFormat = GL_RGBA;
glType = GL_UNSIGNED_INT_8_8_8_8_REV;
return true;
#endif
} else if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 8, 16, 24, 0)) { // BGRA8888
glIntFormat = GL_RGBA;
glFormat = GL_BGRA;
glType = GL_UNSIGNED_INT_8_8_8_8;
return true;
} else if (pixelFormat == Graphics::PixelFormat(2, 5, 6, 5, 0, 0, 5, 11, 0)) { // BGR565
glIntFormat = GL_RGB;
glFormat = GL_BGR;
glType = GL_UNSIGNED_SHORT_5_6_5;
return true;
} else if (pixelFormat == Graphics::PixelFormat(2, 5, 5, 5, 1, 1, 6, 11, 0)) { // BGRA5551
glIntFormat = GL_RGBA;
glFormat = GL_BGRA;
glType = GL_UNSIGNED_SHORT_5_5_5_1;
return true;
} else if (pixelFormat == Graphics::PixelFormat(2, 4, 4, 4, 4, 0, 4, 8, 12)) { // ABGR4444
glIntFormat = GL_RGBA;
glFormat = GL_RGBA;
glType = GL_UNSIGNED_SHORT_4_4_4_4_REV;
return true;
} else if (pixelFormat == Graphics::PixelFormat(2, 4, 4, 4, 4, 4, 8, 12, 0)) { // BGRA4444
glIntFormat = GL_RGBA;
glFormat = GL_BGRA;
glType = GL_UNSIGNED_SHORT_4_4_4_4;
return true;
#endif
} else {
return false;
}
}
frac_t OpenGLGraphicsManager::getDesiredGameScreenAspect() const {
const uint width = _currentState.gameWidth;
const uint height = _currentState.gameHeight;
if (_currentState.aspectRatioCorrection) {
// In case we enable aspect ratio correction we force a 4/3 ratio.
// But just for 320x200 and 640x400 games, since other games do not need
// this.
if ((width == 320 && height == 200) || (width == 640 && height == 400)) {
return intToFrac(4) / 3;
}
}
return intToFrac(width) / height;
}
void OpenGLGraphicsManager::recalculateDisplayArea() {
if (!_gameScreen || _outputScreenHeight == 0) {
return;
}
const frac_t outputAspect = intToFrac(_outputScreenWidth) / _outputScreenHeight;
const frac_t desiredAspect = getDesiredGameScreenAspect();
_displayWidth = _outputScreenWidth;
_displayHeight = _outputScreenHeight;
// Adjust one dimension for mantaining the aspect ratio.
if (outputAspect < desiredAspect) {
_displayHeight = intToFrac(_displayWidth) / desiredAspect;
} else if (outputAspect > desiredAspect) {
_displayWidth = fracToInt(_displayHeight * desiredAspect);
}
// We center the screen in the middle for now.
_displayX = (_outputScreenWidth - _displayWidth ) / 2;
_displayY = (_outputScreenHeight - _displayHeight) / 2;
// Setup drawing limitation for game graphics.
// This invovles some trickery because OpenGL's viewport coordinate system
// is upside down compared to ours.
GLCALL(glScissor(_displayX,
_outputScreenHeight - _displayHeight - _displayY,
_displayWidth,
_displayHeight));
// Clear the whole screen for the first three frames to remove leftovers.
_scissorOverride = 3;
// Update the cursor position to adjust for new display area.
setMousePosition(_cursorX, _cursorY);
// Force a redraw to assure screen is properly redrawn.
_forceRedraw = true;
}
void OpenGLGraphicsManager::updateCursorPalette() {
if (!_cursor || !_cursor->hasPalette()) {
return;
}
if (_cursorPaletteEnabled) {
_cursor->setPalette(0, 256, _cursorPalette);
} else {
_cursor->setPalette(0, 256, _gamePalette);
}
// We remove all alpha bits from the palette entry of the color key.
// This makes sure its properly handled as color key.
const Graphics::PixelFormat &hardwareFormat = _cursor->getHardwareFormat();
const uint32 aMask = (0xFF >> hardwareFormat.aLoss) << hardwareFormat.aShift;
if (hardwareFormat.bytesPerPixel == 2) {
uint16 *palette = (uint16 *)_cursor->getPalette() + _cursorKeyColor;
*palette &= ~aMask;
} else if (hardwareFormat.bytesPerPixel == 4) {
uint32 *palette = (uint32 *)_cursor->getPalette() + _cursorKeyColor;
*palette &= ~aMask;
} else {
warning("OpenGLGraphicsManager::updateCursorPalette: Unsupported pixel depth %d", hardwareFormat.bytesPerPixel);
}
}
void OpenGLGraphicsManager::recalculateCursorScaling() {
if (!_cursor || !_gameScreen) {
return;
}
// By default we use the unscaled versions.
_cursorHotspotXScaled = _cursorHotspotX;
_cursorHotspotYScaled = _cursorHotspotY;
_cursorWidthScaled = _cursor->getWidth();
_cursorHeightScaled = _cursor->getHeight();
// In case scaling is actually enabled we will scale the cursor according
// to the game screen.
if (!_cursorDontScale) {
const frac_t screenScaleFactorX = intToFrac(_displayWidth) / _gameScreen->getWidth();
const frac_t screenScaleFactorY = intToFrac(_displayHeight) / _gameScreen->getHeight();
_cursorHotspotXScaled = fracToInt(_cursorHotspotXScaled * screenScaleFactorX);
_cursorWidthScaled = fracToInt(_cursorWidthScaled * screenScaleFactorX);
_cursorHotspotYScaled = fracToInt(_cursorHotspotYScaled * screenScaleFactorY);
_cursorHeightScaled = fracToInt(_cursorHeightScaled * screenScaleFactorY);
}
}
#ifdef USE_OSD
const Graphics::Font *OpenGLGraphicsManager::getFontOSD() {
return FontMan.getFontByUsage(Graphics::FontManager::kLocalizedFont);
}
#endif
void OpenGLGraphicsManager::saveScreenshot(const Common::String &filename) const {
const uint width = _outputScreenWidth;
const uint height = _outputScreenHeight;
// A line of a BMP image must have a size divisible by 4.
// We calculate the padding bytes needed here.
// Since we use a 3 byte per pixel mode, we can use width % 4 here, since
// it is equal to 4 - (width * 3) % 4. (4 - (width * Bpp) % 4, is the
// usual way of computing the padding bytes required).
const uint linePaddingSize = width % 4;
const uint lineSize = width * 3 + linePaddingSize;
// Allocate memory for screenshot
uint8 *pixels = new uint8[lineSize * height];
// Get pixel data from OpenGL buffer
GLCALL(glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, pixels));
// BMP stores as BGR. Since we can't assume that GL_BGR is supported we
// will swap the components from the RGB we read to BGR on our own.
for (uint y = height; y-- > 0;) {
uint8 *line = pixels + y * lineSize;
for (uint x = width; x > 0; --x, line += 3) {
SWAP(line[0], line[2]);
}
}
// Open file
Common::DumpFile out;
out.open(filename);
// Write BMP header
out.writeByte('B');
out.writeByte('M');
out.writeUint32LE(height * lineSize + 54);
out.writeUint32LE(0);
out.writeUint32LE(54);
out.writeUint32LE(40);
out.writeUint32LE(width);
out.writeUint32LE(height);
out.writeUint16LE(1);
out.writeUint16LE(24);
out.writeUint32LE(0);
out.writeUint32LE(0);
out.writeUint32LE(0);
out.writeUint32LE(0);
out.writeUint32LE(0);
out.writeUint32LE(0);
// Write pixel data to BMP
out.write(pixels, lineSize * height);
// Free allocated memory
delete[] pixels;
}
} // End of namespace OpenGL
| project-cabal/cabal | backends/graphics/opengl/opengl-graphics.cpp | C++ | gpl-2.0 | 39,193 | [
30522,
1013,
1008,
9298,
2389,
1011,
8027,
2208,
24977,
1008,
1008,
9298,
2389,
2003,
1996,
3423,
3200,
1997,
2049,
9797,
1010,
3005,
3415,
1008,
2024,
2205,
3365,
2000,
2862,
2182,
1012,
3531,
6523,
2000,
1996,
9385,
1008,
5371,
5500,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#ifndef _Voice
#define _Voice
#include <jack/jack.h>
#include <iostream>
#include <math.h>
//#include <rubberband/RubberBandStretcher.h>
#include <oscpack/osc/OscTypes.h>
#include "def.hpp"
#include "sound.hpp"
using namespace osc;
enum VoiceStatus {VOICE_IDLE, VOICE_PLAYING, VOICE_LOOPING};
class Voice {
public:
Voice(int channels, int buffer_size, int samplerate);
~Voice();
// control
int play(Sound *sound, jack_nframes_t when);
int reset();
int advance();
bool write(sample** buffers, jack_nframes_t frame_time);
VoiceStatus get_status();
private:
Sound *m_sound;
uint64 start_timestamp;
int m_samplerate;
int m_buffer_size;
int m_channels;
int m_offset;
jack_nframes_t m_when;
VoiceStatus m_status;
// RubberBand::RubberBandStretcher *m_rubber;
// here be envelopes etc...
};
#endif
| krl/sampler | voice.hpp | C++ | gpl-3.0 | 841 | [
30522,
1001,
2065,
13629,
2546,
1035,
2376,
1001,
9375,
1035,
2376,
1001,
2421,
1026,
2990,
1013,
2990,
1012,
1044,
1028,
1001,
2421,
1026,
16380,
25379,
1028,
1001,
2421,
1026,
8785,
1012,
1044,
1028,
1013,
1013,
1001,
2421,
1026,
8903,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<table width="90%" border="0"><tr><td><script>function openfile(url) {fullwin = window.open(url, "fulltext", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");}</script><div class="flayoutclass"><div class="flayoutclass_first"><table class="tableoutfmt2"><tr><th class="std1"><b>條目 </b></th><td class="std2">軟硬兼施</td></tr>
<tr><th class="std1"><b>注音 </b></th><td class="std2">ㄖㄨㄢ<sup class="subfont">ˇ</sup> |ㄥ<sup class="subfont">ˋ</sup> ㄐ|ㄢ ㄕ</td></tr>
<tr><th class="std1"><b>漢語拼音 </b></th><td class="std2"><font class="english_word">ruǎn yìng jiān shī</font></td></tr>
<tr><th class="std1"><b>釋義 </b></th><td class="std2">委婉和強硬的手段一齊用上。如:<img src=/cydic/dicword/fa40.gif border=0 alt=* class=fontimg valign=center>這次會議我方代表軟硬兼施,終於使對方代表讓步而達成協議。<img src=/cydic/dicword/fa41.gif border=0 alt=* class=fontimg valign=center></td></tr>
<tr><th class="std1"><b><font class="fltypefont">附錄</font> </b></th><td class="std2">修訂本參考資料</td></tr>
</td></tr></table></div> <!-- flayoutclass_first --><div class="flayoutclass_second"></div> <!-- flayoutclass_second --></div> <!-- flayoutclass --></td></tr></table>
| BuzzAcademy/idioms-moe-unformatted-data | all-data/10000-10999/10691-22.html | HTML | mit | 1,330 | [
30522,
1026,
2795,
9381,
1027,
1000,
3938,
1003,
1000,
3675,
1027,
1000,
1014,
1000,
1028,
1026,
19817,
1028,
1026,
14595,
1028,
1026,
5896,
1028,
3853,
2330,
8873,
2571,
1006,
24471,
2140,
1007,
1063,
2440,
10105,
1027,
3332,
1012,
2330,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package com.l.smartcityuniversalmarket.loader;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.l.smartcityuniversalmarket.R;
public class LoadAdapter extends BaseAdapter {
private Activity activity;
private String[] data;
private static LayoutInflater inflater = null;
private ImageLoader imageLoader;
public LoadAdapter(Activity activity, String[] d) {
this.activity = activity;
data = d;
inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
imageLoader = new ImageLoader(activity.getApplicationContext());
}
public View getView(int position, View convertView, ViewGroup parent) {
View view = convertView;
if (convertView == null)
view = inflater.inflate(R.layout.item, null);
TextView text = (TextView) view.findViewById(R.id.text);
ImageView image = (ImageView) view.findViewById(R.id.image);
String str = "item" + position;
text.setText(str);
// imageLoader.displayImage(data[position], image);
return view;
}
public int getCount() {
return data.length;
}
public Object getItem(int position) {
return position;
}
public long getItemId(int position) {
return position;
}
public ImageLoader getImageLoader(){
return imageLoader;
}
}
| chacha1337/SmartCityUniversalMarket | SmartCityUniversalMarket/app/src/main/java/com/l/smartcityuniversalmarket/loader/LoadAdapter.java | Java | apache-2.0 | 1,599 | [
30522,
7427,
4012,
1012,
1048,
1012,
6047,
12972,
19496,
14028,
2389,
20285,
1012,
7170,
2121,
1025,
12324,
11924,
1012,
10439,
1012,
4023,
1025,
12324,
11924,
1012,
4180,
1012,
6123,
1025,
12324,
11924,
1012,
3193,
1012,
9621,
2378,
10258,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
///////////// Copyright � 2013, Goldeneye: Source. All rights reserved. /////////////
//
// File: ge_gameplay.cpp
// Description:
// Gameplay Manager Definition
//
// Created By: Jonathan White <killermonkey>
/////////////////////////////////////////////////////////////////////////////
#include "cbase.h"
#include "ge_shareddefs.h"
#include "ge_utils.h"
#include "ge_playerresource.h"
#include "ge_radarresource.h"
#include "ge_gameplayresource.h"
#include "ge_tokenmanager.h"
#include "ge_loadoutmanager.h"
#include "ge_stats_recorder.h"
#include "gemp_player.h"
#include "gemp_gamerules.h"
#include "ge_mapmanager.h"
#include "team.h"
#include "script_parser.h"
#include "filesystem.h"
#include "viewport_panel_names.h"
#include "ge_gameplay.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
extern bool g_bInGameplayReload;
extern CGEBaseGameplayManager *g_GamePlay;
CGEBaseGameplayManager *GEGameplay()
{
return g_GamePlay;
}
CGEBaseScenario *GetScenario()
{
Assert( g_GamePlay );
return g_GamePlay->GetScenario();
}
void GEGameplay_Callback( IConVar *var, const char *pOldString, float flOldValue )
{
if ( !GEMPRules() && !g_bInGameplayReload )
return;
ConVar *cVar = static_cast<ConVar*>(var);
GEGameplay()->LoadMainScenario( cVar->GetString() ); // Cancel warmup status if applicable.
}
void GEGPCVar_Callback( IConVar *var, const char *pOldString, float flOldValue )
{
if ( !GEGameplay() || !GEGameplay()->GetScenario() )
return;
ConVar *cVar = static_cast<ConVar*>(var);
GEGameplay()->GetScenario()->OnCVarChanged( cVar->GetName(), pOldString, cVar->GetString() );
}
ConVar ge_gp_cyclefile( "ge_gp_cyclefile", "gameplaycycle.txt", FCVAR_GAMEDLL, "The gameplay cycle to use for random gameplay or ordered gameplay" );
ConVar ge_autoteam( "ge_autoteam", "0", FCVAR_REPLICATED|FCVAR_NOTIFY, "Automatically toggles teamplay based on the player count (supplied value) [4-32]", true, 0, true, MAX_PLAYERS );
ConVar ge_autoautoteam("ge_autoautoteam", "1", FCVAR_GAMEDLL, "If set to 1, server will set ge_autoteam to the value specified in the current map script file.");
ConVar ge_gameplay_mode( "ge_gameplay_mode", "1", FCVAR_GAMEDLL, "Mode to choose next gameplay: \n\t0=Same as last map, \n\t1=Random from current map file, \n\t2=Ordered from Gameplay Cycle file" );
ConVar ge_gameplay( "ge_gameplay", "DeathMatch", FCVAR_GAMEDLL, "Sets the current gameplay mode.\nDefault is 'deathmatch'", GEGameplay_Callback );
ConVar ge_gameplay_threshold("ge_gameplay_threshold", "4", FCVAR_GAMEDLL, "Playercount that must be exceeded before gamemodes other than ge_gameplay_default will be randomly chosen.");
ConVar ge_gameplay_default("ge_gameplay_default", "deathmatch", FCVAR_GAMEDLL, "Gamemode that is always chosen when the playercount is below ge_gameplay_threshold.");
ConVar ge_gameplay_check_warmup("ge_gameplay_check_warmup", "1", FCVAR_GAMEDLL, "Set to 0 to disable automatic warmup behavior for all gamemodes.");
ConVar ge_gameplay_warmup_time("ge_gameplay_warmup_time", "0.0", FCVAR_GAMEDLL, "Warmup time before actual gamemode is loaded.");
ConVar ge_gameplay_warmup_mode("ge_gameplay_warmup_mode", "Warmup", FCVAR_GAMEDLL, "Mode to use as warmup for a single round before loading the actual gameplay.");
ConVar ge_gameplay_modebuffercount("ge_gameplay_modebuffercount", "5", FCVAR_GAMEDLL, "How many other maps need to be played since the last time a map was played before it can be selected randomly without penalties.");
ConVar ge_gameplay_modebufferpenalty("ge_gameplay_modebufferpenalty", "500", FCVAR_GAMEDLL, "How much to take off of the weight of a mode for each time it appears in the buffer.");
#define GAMEPLAY_MODE_FIXED 0
#define GAMEPLAY_MODE_RANDOM 1
#define GAMEPLAY_MODE_CYCLE 2
extern ConVar ge_rounddelay;
extern ConVar ge_teamplay;
// TODO: Replace this with ge_matchtime at some point
extern ConVar mp_timelimit;
extern ConVar mp_chattime;
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
CGEBaseScenario::CGEBaseScenario()
{
m_bIsOfficial = false;
}
void CGEBaseScenario::LoadConfig()
{
char szCommand[255];
// Warmup modes use a different base config file.
if ( GEGameplay()->IsInWarmupMode() )
{
Msg("Executing gameplay_warmup_base.cfg config file\n");
engine->ServerCommand("exec gameplay_warmup_base.cfg\n");
}
else
{
Msg("Executing gameplay_base.cfg config file\n");
engine->ServerCommand("exec gameplay_base.cfg\n");
}
Msg( "Executing gamemode [%s.cfg] config file\n", GetIdent() );
Q_snprintf( szCommand,sizeof(szCommand), "exec %s.cfg\n", GetIdent() );
engine->ServerCommand( szCommand );
}
void CGEBaseScenario::CreateCVar( const char* name, const char* defValue, const char* help )
{
if ( !name || !defValue || !help )
{
Warning( "[GES GP] Failed to create ConVar due to invalid parameters!\n" );
return;
}
ConVar *var = g_pCVar->FindVar( name );
if ( var )
{
Warning( "[GES GP] Attempting to create CVAR %s twice!\n", name );
m_vCVarList.FindAndRemove( var );
g_pCVar->UnregisterConCommand( var );
}
// Create the CVar (registers it) and set the value to invoke OnCVarChanged
var = new ConVar( name, defValue, FCVAR_GAMEDLL|FCVAR_NOTIFY, help, GEGPCVar_Callback );
var->SetValue( defValue );
m_vCVarList.AddToTail( var );
}
void CGEBaseScenario::UnloadConfig()
{
// Unregister each ConVar we are tracking
for( int i=0; i < m_vCVarList.Size(); i++ )
g_pCVar->UnregisterConCommand( m_vCVarList[i] );
m_vCVarList.PurgeAndDeleteElements();
}
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
// Main container for Gameplay Event Listeners
CUtlVector<CGEGameplayEventListener*> g_GameplayEventListeners;
// Convienance Macro for Gameplay Events
#define GP_EVENT( event ) \
for ( int i=0; i < g_GameplayEventListeners.Count(); i++ ) { \
Assert( g_GameplayEventListeners[i] ); \
g_GameplayEventListeners[i]->OnGameplayEvent( event ); \
}
CGEGameplayEventListener::CGEGameplayEventListener()
{
if ( !g_GameplayEventListeners.HasElement( this ) )
{
g_GameplayEventListeners.AddToTail( this );
return;
}
DevWarning( "[GPEventListener] Event listener attempted double registration!\n" );
}
CGEGameplayEventListener::~CGEGameplayEventListener()
{
int idx = g_GameplayEventListeners.Find( this );
if ( idx != -1 )
g_GameplayEventListeners.Remove( idx );
}
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
int g_iScenarioIndex = -1;
CGEBaseGameplayManager::CGEBaseGameplayManager()
{
ResetState();
Q_strcpy(m_sNextGameplayIdent, "\0"); // Can't stick this in ResetState as that executes on loading a new gamemode.
}
CGEBaseGameplayManager::~CGEBaseGameplayManager()
{
m_vScenarioCycle.Purge();
m_vScenarioList.PurgeAndDeleteElements();
}
void CGEBaseGameplayManager::Init()
{
// Prepare our lists
LoadGamePlayList( "python\\ges\\GamePlay\\*.py" );
LoadScenarioCycle();
// Load our past gameplays
ParseLogData();
if (ge_gameplay_check_warmup.GetBool())
LoadWarmupScenario(); // Check to see if we want to load our warmup scenario first.
else
LoadScenario(); // Legacy behavior
}
void CGEBaseGameplayManager::Shutdown()
{
// Shutdown the scenario
ShutdownScenario();
}
void CGEBaseGameplayManager::ParseLogData()
{
char *contents = (char*)UTIL_LoadFileForMe("gamesetuprecord.txt", NULL);
if (!contents)
{
Msg("No rotation log!\n");
return;
}
CUtlVector<char*> lines;
char linebuffer[64];
Q_SplitString(contents, "\n", lines);
bool readingmodes = false;
for (int i = 0; i < lines.Count(); i++)
{
// Ignore comments
if (!Q_strncmp(lines[i], "//", 2))
continue;
if (readingmodes)
{
if (!Q_strncmp(lines[i], "-", 1)) // Our symbol for the end of a block.
break;
Q_StrLeft(lines[i], -1, linebuffer, 64); // Take off the newline character.
// We could create a bunch of new strings, or we could just make use of the scenario list which already exists.
for (int i = 0; i < m_vScenarioList.Count(); i++)
{
if (!Q_strcmp(linebuffer, m_vScenarioList[i]))
{
m_vRecentScenarioList.AddToTail(m_vScenarioList[i]);
break;
}
}
}
if (!Q_strncmp(lines[i], "Modes:", 6))
readingmodes = true;
}
// NOTE: We do not purge the data!
ClearStringVector(lines);
delete[] contents;
}
const char *CGEBaseGameplayManager::GetMainModeIdent()
{
if ( !GetScenario() )
return "__NONAME__";
const char *currIdent = GetScenario()->GetIdent();
if ( IsInWarmupMode() )
currIdent = m_sNextGameplayIdent;
return currIdent;
}
const char *CGEBaseGameplayManager::GetPostWarmupModeIdent()
{
if ( GetScenario() && IsInWarmupMode() )
return m_sNextGameplayIdent;
return "__NONAME__";
}
void CGEBaseGameplayManager::GetRecentModes(CUtlVector<const char*> &modenames)
{
modenames.RemoveAll();
int buffercount = min(ge_gameplay_modebuffercount.GetInt(), m_vRecentScenarioList.Count());
for (int i = 0; i < buffercount; i++)
{
modenames.AddToTail(m_vRecentScenarioList[i]);
}
}
void CGEBaseGameplayManager::BroadcastMatchStart()
{
// Let all the clients know what game mode we are in now
IGameEvent* pEvent = gameeventmanager->CreateEvent("gamemode_change");
if ( pEvent )
{
pEvent->SetString( "ident", GetScenario()->GetIdent() );
pEvent->SetBool( "official", GetScenario()->IsOfficial() );
gameeventmanager->FireEvent(pEvent);
}
const char *modeName = GetScenario()->GetIdent(); // We're garunteed to have an identifier.
// First check if we're a compound printname, containing multiple localized strings.
// Our localization infastructure can't actually handle nested localized strings built on the server
// Ex: "The gamemode is now + ( (Next Gamemode Title) + Warmup )"
// but this is the only area where it's a problem for gamemode titles...luckily we have the external printname
// to fall back on, and if that doesn't exist we can just use the identifier itself.
if ( !Q_strrchr(GetScenario()->GetPrintName(), '\r') )
{
modeName = GetScenario()->GetPrintName(); // We're a normal printname.
}
else
{
const char *externalPrintName = GetModeExternalPrintName( GetScenario()->GetIdent() );
if ( Q_strcmp(externalPrintName, "__NONAME__") )
modeName = externalPrintName; // Our normal printname is too fancy, but luckily we have a fallback option.
}
// Print our selected title to the chat.
UTIL_ClientPrintAll(HUD_PRINTTALK, "#GES_Gameplay_Changed", modeName);
}
void CGEBaseGameplayManager::BroadcastRoundStart()
{
// Let all the clients know that the round started
IGameEvent* pEvent = gameeventmanager->CreateEvent("round_start");
if ( pEvent )
{
pEvent->SetString( "gameplay", GetScenario()->GetIdent() );
pEvent->SetBool( "teamplay", GEMPRules()->IsTeamplay() );
pEvent->SetInt( "roundcount", m_iRoundCount );
gameeventmanager->FireEvent(pEvent);
}
// Print it to the chat
UTIL_ClientPrintAll( HUD_PRINTTALK, "#GES_RoundRestart" );
}
void CGEBaseGameplayManager::BroadcastRoundEnd( bool showreport )
{
// Let all the clients know that the round ended
IGameEvent* pEvent = gameeventmanager->CreateEvent("round_end");
if ( pEvent )
{
int winnerindex = GEMPRules()->GetRoundWinner();
int winnerscore = -1;
CBasePlayer *pPlayer = UTIL_PlayerByIndex(winnerindex);
if (pPlayer)
winnerscore = ToGEMPPlayer(pPlayer)->GetRoundScore();
pEvent->SetInt( "winnerid", GEMPRules()->GetRoundWinner() );
pEvent->SetInt( "winnerscore", winnerscore );
pEvent->SetInt( "teamid", GEMPRules()->GetRoundTeamWinner() );
pEvent->SetBool( "isfinal", false );
pEvent->SetBool( "showreport", showreport );
pEvent->SetInt( "roundlength", gpGlobals->curtime - m_flRoundStart );
pEvent->SetInt( "roundcount", m_iRoundCount );
GEStats()->SetAwardsInEvent( pEvent );
gameeventmanager->FireEvent(pEvent);
}
// Fire off an event that tells plugins the exact placement of each player in the round, primarily for ranking systems.
IGameEvent *event = gameeventmanager->CreateEvent("round_ranks");
if (event)
{
CUtlVector<CGEMPPlayer*> rankedPlayers;
GEMPRules()->GetRankSortedPlayers(rankedPlayers);
event->SetBool("isfinal", false);
for (int i = 0; i < 16; i++)
{
char strbuffer[8];
Q_snprintf(strbuffer, 8, "id%d", i + 1);
if ( i < rankedPlayers.Count() )
event->SetInt(strbuffer, rankedPlayers[i]->GetUserID());
else
event->SetInt(strbuffer, -1);
Q_snprintf(strbuffer, 8, "sc%d", i + 1);
if (i < rankedPlayers.Count())
event->SetInt(strbuffer, rankedPlayers[i]->GetRoundScore());
else
event->SetInt(strbuffer, -1);
}
gameeventmanager->FireEvent(event);
}
// Print it to the chat
UTIL_ClientPrintAll( HUD_PRINTTALK, "#GES_RoundEnd" );
}
void CGEBaseGameplayManager::BroadcastMatchEnd()
{
// TODO: This should be replaced with "match_end" event
// Let all the clients know that the round ended
IGameEvent* pEvent = gameeventmanager->CreateEvent("round_end");
if ( pEvent )
{
int winnerindex = GEMPRules()->GetRoundWinner();
int winnerscore = -1;
CBasePlayer *pPlayer = UTIL_PlayerByIndex(winnerindex);
if (pPlayer)
winnerscore = ToGEMPPlayer(pPlayer)->GetMatchScore();
pEvent->SetInt( "winnerid", GEMPRules()->GetRoundWinner() );
pEvent->SetInt( "winnerscore", winnerscore );
pEvent->SetInt( "teamid", GEMPRules()->GetRoundTeamWinner() );
pEvent->SetBool( "isfinal", true );
pEvent->SetBool( "showreport", true );
pEvent->SetInt( "roundlength", gpGlobals->curtime - m_flRoundStart );
pEvent->SetInt( "roundcount", m_iRoundCount );
GEStats()->SetAwardsInEvent( pEvent );
gameeventmanager->FireEvent(pEvent);
}
// Fire off an event that tells plugins the exact placement of each player in the round, primarily for ranking systems.
IGameEvent *event = gameeventmanager->CreateEvent("round_ranks");
if (event)
{
CUtlVector<CGEMPPlayer*> rankedPlayers;
GEMPRules()->GetRankSortedPlayers(rankedPlayers);
event->SetBool("isfinal", true);
for (int i = 0; i < 16; i++)
{
char strbuffer[8];
Q_snprintf(strbuffer, 8, "id%d", i + 1);
if (i < rankedPlayers.Count())
event->SetInt(strbuffer, rankedPlayers[i]->GetUserID());
else
event->SetInt(strbuffer, -1);
Q_snprintf(strbuffer, 8, "sc%d", i + 1);
if (i < rankedPlayers.Count())
event->SetInt( strbuffer, rankedPlayers[i]->GetMatchScore() );
else
event->SetInt( strbuffer, -1 );
}
gameeventmanager->FireEvent(event);
}
// Print it to the chat
UTIL_ClientPrintAll( HUD_PRINTTALK, "#GES_MatchEnd" );
}
bool CGEBaseGameplayManager::LoadWarmupScenario()
{
// Record the ident of our next gamemode so we know what to switch to when our warmup time is over, if we use it.
// Otherwise this will serve as the ident of the gamemode we'll be switching to immediately.
Q_strncpy(m_sNextGameplayIdent, GetNextScenario(), sizeof(m_sNextGameplayIdent) / sizeof(char));
// We don't want to prematurely execute a gameplay's config file before its unique CVar values exist...so instead
// let's just manually search for the config values we care about.
char szConfigName[255];
Q_snprintf( szConfigName, sizeof(szConfigName), "cfg/%s.cfg", m_sNextGameplayIdent );
// WARMUP TIME
char warmupTimeStr[64];
float warmupTime;
// First try to load the gamemode specific config file, but if the value doesn't exist there then try loading it from the general gamemode file.
if ( !ExtractConfigConvarValue(szConfigName, ge_gameplay_warmup_time.GetName(), warmupTimeStr, sizeof(warmupTimeStr)) &&
!ExtractConfigConvarValue("cfg/gameplay_base.cfg", ge_gameplay_warmup_time.GetName(), warmupTimeStr, sizeof(warmupTimeStr)))
{
warmupTime = ge_gameplay_warmup_time.GetFloat();
}
else // We found it, update our CVar value and convert it to a format we can use.
{
warmupTime = strtof(warmupTimeStr, NULL);
ge_gameplay_warmup_time.SetValue(warmupTime);
}
// WARMUP MODE NAME
char warmupModeName[64];
// First try to load the gamemode specific config file, but if the value doesn't exist there then try loading it from the general gamemode file.
if ( !ExtractConfigConvarValue(szConfigName, ge_gameplay_warmup_mode.GetName(), warmupModeName, sizeof(warmupModeName)) &&
!ExtractConfigConvarValue("cfg/gameplay_base.cfg", ge_gameplay_warmup_mode.GetName(), warmupModeName, sizeof(warmupModeName)) )
{
Q_strncpy( warmupModeName, ge_gameplay_warmup_mode.GetString(), 64 ); // Didn't find it, just use the CVar value
}
else // We found it. Update our CVar value.
{
ge_gameplay_warmup_mode.SetValue( warmupModeName );
}
// Load the warmup scenario if we have any warmup time. Otherwise load the base scenario.
if ( warmupTime > 0.0f )
{
Msg( "Loading warmup mode %s for gamemode %s!\n", warmupModeName, m_sNextGameplayIdent );
char pyDir[128];
Q_snprintf( pyDir, 128, "python\\ges\\GamePlay\\%s.py", warmupModeName );
if (filesystem->FileExists(pyDir))
return LoadScenario( warmupModeName );
else
return LoadScenario( "Warmup" );
}
else
{
// Load our selected scenario as the main scenario.
return LoadMainScenario( m_sNextGameplayIdent );
}
}
bool CGEBaseGameplayManager::LoadMainScenario()
{
if ( IsInWarmupMode() )
{
char newGameplayIdent[128];
Q_strcpy(newGameplayIdent, m_sNextGameplayIdent); // Move our new gameplay ident into a temporary holding value.
Q_strcpy(m_sNextGameplayIdent, "\0"); // Mark that we're no longer in warmup for the new gameplay load.
return LoadScenario( newGameplayIdent );
}
else // We don't have a main scenario queued so just pick a random one as the main scenario.
{
return LoadScenario();
}
}
bool CGEBaseGameplayManager::LoadMainScenario(const char *ident)
{
// Just in case we pass m_sNextGameplayIdent into this function.
char newGameplayIdent[128];
Q_strcpy(newGameplayIdent, ident); // Move our new gameplay ident into a temporary holding value.
Q_strcpy(m_sNextGameplayIdent, "\0"); // Mark that we're no longer in warmup for the new gameplay load.
return LoadScenario( newGameplayIdent );
}
bool CGEBaseGameplayManager::LoadScenario()
{
Q_strcpy( m_sNextGameplayIdent, "\0" ); // Make sure we know this is our main scenario.
return LoadScenario( GetNextScenario() );
}
bool CGEBaseGameplayManager::LoadScenario( const char *ident )
{
char prev_ident[32] = "DeathMatch";
// Shutdown any current scenario
if ( IsValidScenario() ) {
Q_strncpy( prev_ident, GetScenario()->GetIdent(), 32 );
ShutdownScenario();
}
Msg( "Attempting to load scenario: %s\n", ident );
// Call up to load the new scenario
// If this fails, we will continue with the previously loaded scenario
if ( !DoLoadScenario( ident ) ) {
Warning( "Scenario load failed for %s! Reverting back to %s.\n", ident, prev_ident );
if ( !DoLoadScenario( prev_ident ) )
Warning( "A catastrophic error occurred while reverting back to %s! Exit and restart the game!\n", prev_ident );
else
Msg( "Successfully reverted back to %s\n", prev_ident );
} else {
Msg( "Successfully loaded scenario %s!\n", ident );
}
// Set up the world and notify Python
InitScenario();
// Start the match
StartMatch();
return true;
}
extern ConVar ge_bot_threshold;
const char *CGEBaseGameplayManager::GetNextScenario()
{
int mode = ge_gameplay_mode.GetInt();
int count = m_vScenarioCycle.Count();
// Figure out teamplay related stuff here since it factors into the gamemode we choose.
MapSelectionData *pMapData = GEMPRules()->GetMapManager()->GetCurrentMapSelectionData();
int teamthresh = -1;
if (ge_autoautoteam.GetBool() && pMapData)
{
teamthresh = pMapData->teamthreshold;
ge_autoteam.SetValue(teamthresh);
}
else if (!ge_autoautoteam.GetBool())
teamthresh = ge_autoteam.GetInt();
int iNumConnections = 0;
// Find out how many people are actually connected to the server.
for (int i = 0; i < gpGlobals->maxClients; i++)
{
if (engine->GetPlayerNetInfo(i))
iNumConnections++;
}
// Consider bots too.
iNumConnections = max(iNumConnections, ge_bot_threshold.GetInt());
if (ge_teamplay.GetInt() != 1)
{
if (iNumConnections >= teamthresh)
ge_teamplay.SetValue(2); // Premptively go into teamplay if we've got enough players for it.
else
ge_teamplay.SetValue(0);
}
if (mode == GAMEPLAY_MODE_RANDOM)
{
CUtlVector<char*> gamemodes;
CUtlVector<int> weights;
CUtlVector<const char*> recentgamemodes;
// Random game mode according to map script.
GEMPRules()->GetMapManager()->GetMapGameplayList(gamemodes, weights, iNumConnections >= teamthresh);
// Don't select random modes when we're below a certain playercount, and our default mode is a valid mode for the map.
if (iNumConnections <= ge_gameplay_threshold.GetInt())
{
const char *defaultMode = ge_gameplay_default.GetString();
for (int i = 0; i < gamemodes.Count(); i++)
{
if (weights[i] > 0 && !Q_stricmp(gamemodes[i], defaultMode))
{
return defaultMode;
}
}
}
// Adjust the weight of gamemodes we just played.
GetRecentModes(recentgamemodes);
int deductionamount = ge_gameplay_modebufferpenalty.GetInt();
int totalweight = 0;
for (int i = 0; i < gamemodes.Count(); i++)
{
totalweight += weights[i];
}
if (recentgamemodes.Count())
{
for (int b = 0; b < recentgamemodes.Count(); b++)
{
if (totalweight <= deductionamount)
break; // Make sure we'll have at least one gamemode with above 0 weight.
for (int l = 0; l < gamemodes.Count(); l++)
{
if (!Q_stricmp(gamemodes[l], recentgamemodes[b]))
{
int deduction = min(weights[l], deductionamount);
weights[l] -= deduction;
totalweight -= deduction;
break;
}
}
}
}
if (gamemodes.Count())
{
return GERandomWeighted<char*>(gamemodes.Base(), weights.Base(), gamemodes.Count());
}
else
{
Warning("No gamemodes found in map script, defaulting to first gameplay in scenariocycle!\n");
return m_vScenarioCycle[0].ToCStr();
}
}
else if (mode == GAMEPLAY_MODE_CYCLE)
{
// Ordered game mode, get the next scenario in our list
if (count > 0)
{
// Increment our index, rolling over if we exceed our count
if (++g_iScenarioIndex >= count)
g_iScenarioIndex = 0;
return m_vScenarioCycle[g_iScenarioIndex].ToCStr();
}
}
// Fixed game mode, load the scenario set in our ConVar
return ge_gameplay.GetString();
}
void CGEBaseGameplayManager::InitScenario()
{
// Reset our state
ResetState();
// Call our listeners before Python init
GP_EVENT( SCENARIO_INIT );
// Enable precache during scenario load
bool precache = CBaseEntity::IsPrecacheAllowed();
CBaseEntity::SetAllowPrecache( true );
// Let the scenario initialize everything
GetScenario()->Init();
// Reset our precache state
CBaseEntity::SetAllowPrecache( precache );
// Load the configuration for the scenario
GetScenario()->LoadConfig();
// Call into reconnect each player again to run initializations
FOR_EACH_MPPLAYER( pPlayer )
GetScenario()->ClientConnect( pPlayer );
END_OF_PLAYER_LOOP()
// Only record this scenario if it's not a warmup mode.
if (!IsInWarmupMode())
m_vRecentScenarioList.AddToHead(GetScenario()->GetIdent());
// Now let anyone who is interested know we are finished initilazing.
// Added to fix the help bug and avoid making any more by switching the order of things, but should be useful in its own right.
GP_EVENT(SCENARIO_POST_INIT);
}
void CGEBaseGameplayManager::ShutdownScenario()
{
// Disconnect all players for cleanup
FOR_EACH_PLAYER( pPlayer )
GetScenario()->ClientDisconnect( pPlayer );
END_OF_PLAYER_LOOP()
// Unload the configuration variables
GetScenario()->UnloadConfig();
// Tell everyone we are shutting down the scenario
GP_EVENT( SCENARIO_SHUTDOWN );
// Final shutdown with Python
GetScenario()->Shutdown();
}
void CGEBaseGameplayManager::ResetState()
{
m_bGameOver = false;
m_bRoundLocked = false;
m_iRoundState = CGEBaseGameplayManager::NONE;
m_iRoundCount = 0;
m_flNextThink = 0;
m_flIntermissionEndTime = -1.0f;
m_flRoundStart = -1.0f;
m_flMatchStart = -1.0f;
}
// Various checks for round state
bool CGEBaseGameplayManager::IsInRound()
{
return m_iRoundState == PLAYING;
}
bool CGEBaseGameplayManager::IsInIntermission()
{
return IsInRoundIntermission() || IsInFinalIntermission();
}
bool CGEBaseGameplayManager::IsInRoundIntermission()
{
return m_iRoundState == INTERMISSION;
}
bool CGEBaseGameplayManager::IsInFinalIntermission()
{
return m_iRoundState == GAME_OVER;
}
// Controls the lifecycle of the scenario to include
// starting and ending rounds, ending the match and
// triggering level transitions
void CGEBaseGameplayManager::OnThink()
{
// If we aren't ready to think don't do it
if( m_flNextThink > gpGlobals->curtime )
return;
m_flNextThink = gpGlobals->curtime + 0.1f;
// Check for round pre start
if ( m_iRoundState == PRE_START )
{
StartRound();
return;
}
// Check if the game over time is over
if ( IsGameOver() && IsInFinalIntermission() && GetRemainingIntermission() <= 0 )
{
GEMPRules()->SetupChangeLevel();
return;
}
// Check if the round intermission is over
if ( IsInRoundIntermission() && GetRemainingIntermission() <= 0 )
{
// Check if the match should end instead of starting a new round
if ( ShouldEndMatch() )
EndMatch();
else
StartRoundIfNotWarmup();
return;
}
// Check if we are in a round
if ( IsInRound() )
{
// Check if we need to end the match (ends round first)
if ( ShouldEndMatch() )
EndMatch();
// Otherwise, check if we need to end the round
else if ( ShouldEndRound() )
EndRound();
// Otherwise, let the scenario think
else
GetScenario()->OnThink();
}
}
void CGEBaseGameplayManager::StartMatch()
{
// Set our match time
m_flMatchStart = gpGlobals->curtime;
// Set us up to start the round on the next think cycle
m_bGameOver = false;
m_iRoundState = PRE_START;
// Let our listeners know we are starting a new match
GP_EVENT( MATCH_START );
// Let our clients know what scenario we are playing
BroadcastMatchStart();
}
void CGEBaseGameplayManager::StartRoundIfNotWarmup()
{
// See if we're in warmup mode and it's time to switch to our normal mode.
if ( IsInWarmupMode() )
{
LoadMainScenario(); // Time to load the main scenario.
return; // Don't actually start this round since we just started a new gamemode instead.
}
StartRound(); // Start the round as normal.
}
void CGEBaseGameplayManager::StartRound()
{
if ( ge_autoteam.GetInt() > 0 && ge_teamplay.GetInt() != 1 ) // If teamplay is 1 then it is forced on.
{
int iNumConnections = 0;
// Find out how many people are actually connected to the server.
for (int i = 0; i < gpGlobals->maxClients; i++)
{
if (engine->GetPlayerNetInfo(i))
iNumConnections++;
}
// Consider bots too.
iNumConnections = max(iNumConnections, ge_bot_threshold.GetInt());
// If the number of connections is greater than our teamthresh, go into teamplay.
if ( iNumConnections >= ge_autoteam.GetInt() )
ge_teamplay.SetValue(2);
else
ge_teamplay.SetValue(0);
}
GetScenario()->BeforeSetupRound();
// Reload the world sparing only level designer placed entities
// This must be called before the ROUND_START event
GEMPRules()->SetupRound();
// Officially start this round
m_iRoundCount++;
m_iRoundState = PLAYING;
m_flRoundStart = gpGlobals->curtime;
// Let everyone setup for the round
GP_EVENT( ROUND_START );
// Call into our scenario before spawning players
GetScenario()->OnRoundBegin();
// Respawn all active players
GEMPRules()->SpawnPlayers();
// Let everything know we are starting a new round
BroadcastRoundStart();
}
void CGEBaseGameplayManager::EndRound( bool showreport /*=true*/ )
{
// Ignore this call if we are not playing a round
if ( !IsInRound() )
return;
// Call into python to do post round cleanup and score setting
GetScenario()->OnRoundEnd();
// Set us in intermission
m_iRoundState = INTERMISSION;
if ( showreport )
// Delay enough so that the scores don't get reset before the round report is visible
m_flIntermissionEndTime = gpGlobals->curtime + max( ge_rounddelay.GetInt(), 0.5f );
else
// Only give 3 second delay if we didn't count this round
m_flIntermissionEndTime = gpGlobals->curtime + 3.0f;
GP_EVENT( ROUND_END );
// Tell players we finished the round
BroadcastRoundEnd( showreport );
}
void CGEBaseGameplayManager::EndMatch()
{
// Set this upfront
m_bGameOver = true;
// If we are currently in a round, we need to end it first
if ( IsInRound() )
{
if ( m_iRoundCount > 1 )
{
// Do a full round ending since we played more than 1 round
EndRound();
return;
}
else
{
// Only perform a score calculation since we haven't played more than 1 round
// We'll only show the match report to players
// Call into python to do post round cleanup and score setting
GetScenario()->OnRoundEnd();
// Cleanup the round (does scores)
GP_EVENT( ROUND_END );
}
}
// Set our game over status
m_iRoundState = GAME_OVER;
m_flIntermissionEndTime = gpGlobals->curtime + mp_chattime.GetInt();
GP_EVENT( MATCH_END );
// Tell clients we finished the round
BroadcastMatchEnd();
}
float CGEBaseGameplayManager::GetRemainingIntermission()
{
return max(m_flIntermissionEndTime - gpGlobals->curtime, 0 );
}
bool CGEBaseGameplayManager::ShouldEndRound()
{
bool timerExpired = false;
bool scoreExpired = false;
// Check time constraints
if ( GEMPRules()->IsRoundTimeRunning() && GEMPRules()->GetRoundTimeRemaining() <= 0 )
timerExpired = true;
// Check score constraints
if (!GEMPRules()->IsTeamplay())
{
if ( GEMPRules()->GetGoalScore() != 0 && GEMPRules()->GetGoalScore() <= GEMPRules()->GetHighestRoundScore() )
scoreExpired = true;
}
else
{
if ( GEMPRules()->GetTeamGoalScore() != 0 && GEMPRules()->GetTeamGoalScore() <= GEMPRules()->GetHighestTeamRoundScore() )
scoreExpired = true;
}
// Make sure the gameplay says we can end, only asking once the normal checks have passed.
// This gives the gameplay the final say on if the round will end or not, and lets it know that
// if this callback gets triggered the round would normally be ending.
if ( scoreExpired || timerExpired )
return GetScenario()->CanRoundEnd();
// We still have remaining time and score, no need to try and end the round yet.
return false;
}
bool CGEBaseGameplayManager::ShouldEndMatch()
{
// We are already over!
if ( IsGameOver() )
return true;
// We must be able to end our round to end the match.
// IsInRound() and IsRoundTimeRunning() are not redundant. IsInRound() can be true when ge_roundtime is 0 but mp_timelimit is not.
if ( IsInRound() && GEMPRules()->IsRoundTimeRunning() && !ShouldEndRound() )
return false;
// Check time constraints
if ( GEMPRules()->IsMatchTimeRunning() && GEMPRules()->GetMatchTimeRemaining() <= 0 )
{
// We ran out of time and our scenario says we can end
if ( GetScenario()->CanMatchEnd() )
return true;
}
return false;
}
void CGEBaseGameplayManager::LoadScenarioCycle()
{
// Clear out the existing cycle and index
m_vScenarioCycle.Purge();
const char *curr_scenario = ge_gameplay.GetString();
const char *cycle_file = ge_gp_cyclefile.GetString();
Assert(cycle_file != NULL);
CUtlBuffer buf;
buf.SetBufferType(true, false);
if (filesystem->ReadFile(cycle_file, "MOD", buf))
{
char line[32];
buf.GetLine(line, 32);
while (line[0])
{
// Strip out the spaces in the name
GEUTIL_StripWhitespace(line);
if (!IsValidGamePlay(line))
{ Warning("Invalid scenario '%s' included in gameplay cycle file. Ignored.\n", line); }
else if (!Q_strncmp(line, "//", 2))
{ /* Ignore this line */ }
else
{ m_vScenarioCycle.AddToTail(AllocPooledString(line)); }
// Load next line
buf.GetLine(line, 32);
}
// TODO: This might cause issues when running random or cycled scenarios on first load...
// Reset the gameplay index
if (g_iScenarioIndex < 0 || g_iScenarioIndex >= m_vScenarioCycle.Count())
{
for (int i = 0; i < m_vScenarioCycle.Count(); i++)
{
// Find the first match for our current game mode if it exists in the list
if (curr_scenario && Q_stricmp(m_vScenarioCycle[i].ToCStr(), curr_scenario) == 0)
{
g_iScenarioIndex = i;
break;
}
}
}
}
// Check if we loaded any scenarios at all
if (m_vScenarioCycle.Count() == 0)
{
m_vScenarioCycle.AddToTail(AllocPooledString(curr_scenario));
}
}
bool CGEBaseGameplayManager::IsValidGamePlay( const char *ident )
{
for ( int i=0; ident != NULL && i < m_vScenarioList.Count(); i++ )
{
if ( !Q_stricmp( ident, m_vScenarioList[i] ) )
return true;
}
return false;
}
void CGEBaseGameplayManager::PrintGamePlayList()
{
Msg("Available Game Modes: \n");
for (int i=0; i < m_vScenarioList.Count(); i++)
{
Msg( "%s\n", m_vScenarioList[i] );
}
}
void CGEBaseGameplayManager::LoadGamePlayList(const char* path)
{
for ( int i=0; i < m_vScenarioList.Count(); i++ )
delete [] m_vScenarioList[i];
m_vScenarioList.RemoveAll();
// TODO: This is on a fast-track to deletion. This stuff should be handled in Python...
FileFindHandle_t finder;
const char *fileName = filesystem->FindFirstEx( path, "MOD", &finder );
while ( fileName )
{
if ( Q_strncmp( fileName, "__", 2 ) )
{
char *fileNameNoExt = new char[64];
Q_StripExtension( fileName, fileNameNoExt, 64 );
m_vScenarioList.AddToTail( fileNameNoExt );
}
fileName = filesystem->FindNext( finder );
}
filesystem->FindClose( finder );
}
extern ConVar nextlevel;
static CUtlVector<char*> gMapList;
static void LoadMapList() {
FileFindHandle_t findHandle; // note: FileFINDHandle
char *file;
const char *pFilename = filesystem->FindFirstEx( "maps\\*.bsp", "MOD", &findHandle );
while ( pFilename )
{
file = new char[32];
Q_strncpy( file, pFilename, min( Q_strlen(pFilename) - 3, 32 ) );
gMapList.AddToTail( file );
pFilename = filesystem->FindNext( findHandle );
}
filesystem->FindClose( findHandle );
}
// Map auto completion for ge_endmatch entries
static int MapAutoComplete( char const *partial, char commands[ COMMAND_COMPLETION_MAXITEMS ][ COMMAND_COMPLETION_ITEM_LENGTH ] )
{
int i, k;
CUtlVector<char*> tokens;
Q_SplitString( partial, " ", tokens );
if ( tokens.Count() < 2 )
return 0;
if ( gMapList.Count() == 0 )
LoadMapList();
for ( i=0, k=0; (i < gMapList.Count() && k < COMMAND_COMPLETION_MAXITEMS); i++ )
{
if ( StringHasPrefix( gMapList[i], tokens[1] ) ) {
Q_strncpy( commands[k], tokens[0], COMMAND_COMPLETION_ITEM_LENGTH );
Q_strncat( commands[k], " ", COMMAND_COMPLETION_ITEM_LENGTH );
Q_strncat( commands[k], gMapList[i], COMMAND_COMPLETION_ITEM_LENGTH );
k++;
}
}
ClearStringVector( tokens );
return k; // number of entries
}
// Override for changelevel, this calls ge_endmatch
CON_COMMAND_F_COMPLETION(__ovr_changelevel, "Change the current level after ending the current round/match. Use `changelevel [mapname] 0` to change immediately.", 0, MapAutoComplete)
{
if ( !UTIL_IsCommandIssuedByServerAdmin() )
{
Msg( "You must be a server admin to use that command\n" );
return;
}
if ( !GEMPRules() || !GEGameplay() )
{
Warning( "Failed to run command, not playing a game!\n" );
return;
}
if ( !engine->IsMapValid(args[1]) )
{
Warning( "Failed to run command, invalid map name supplied!\n" );
return;
}
// If we are in the final intermission or supplied a second argument, change immediately
if ( GEGameplay()->IsInFinalIntermission() || args.ArgC() > 2 )
{
GEMPRules()->SetupChangeLevel( args[1] );
}
else
{
// Let ge_endmatch command handle the sequencing
engine->ServerCommand( UTIL_VarArgs( "ge_endmatch %s\n", args[1] ) );
}
}
CON_COMMAND(ge_gameplaylistrefresh, "Refreshes the list of known gameplays, useful for servers who add gameplays while the server is still running")
{
if ( !UTIL_IsCommandIssuedByServerAdmin() )
{
Msg( "You must be a server admin to use that command\n" );
return;
}
if ( !GEGameplay() )
{
Warning( "Failed to run command, not playing a game!\n" );
return;
}
// Reload the gameplay without using the cache
GEGameplay()->LoadGamePlayList( "scripts/python/GamePlay/*.py" );
}
// WARNING: Deprecated! Use ge_endround instead!
CON_COMMAND(ge_restartround, "Restart the current round showing scores always")
{
if ( !UTIL_IsCommandIssuedByServerAdmin() || !GEGameplay() )
{
Msg( "You must be a server admin to use that command\n" );
return;
}
if ( !GEMPRules() || !GEGameplay() )
{
Warning( "Failed to run command, not playing a game!\n" );
return;
}
Msg( "Warning! This command is deprecated, use ge_endround instead!\n" );
engine->ServerCommand( "ge_endround\n" );
}
CON_COMMAND(ge_endround, "End the current round, use `ge_endround 0` to skip scores" )
{
if ( !UTIL_IsCommandIssuedByServerAdmin() )
{
Msg( "You must be a server admin to use that command\n" );
return;
}
if ( !GEMPRules() || !GEGameplay() )
{
Warning( "Failed to run command, not playing a game!\n" );
return;
}
// Ignore if we are not in a round
if ( !GEGameplay()->IsInRound() )
return;
bool showreport = true;
if ( args.ArgC() > 1 && args[1][0] == '0' )
showreport = false;
GEGameplay()->EndRound( showreport );
}
CON_COMMAND(ge_endround_keepweapons, "End the current round but keep the same weapon set even if randomized.")
{
if ( !UTIL_IsCommandIssuedByServerAdmin() )
{
Msg( "You must be a server admin to use that command\n" );
return;
}
if ( !GEMPRules() || !GEGameplay() )
{
Warning( "Failed to run command, not playing a game!\n" );
return;
}
// Ignore if we are not in a round
if ( !GEGameplay()->IsInRound() )
return;
// This is where the magic happens
GEMPRules()->GetLoadoutManager()->KeepLoadoutOnNextChange();
bool showreport = true;
if ( args.ArgC() > 1 && args[1][0] == '0' )
showreport = false;
GEGameplay()->EndRound( showreport );
}
CON_COMMAND_F_COMPLETION(ge_endmatch, "Ends the match loading the next map or one specified (eg ge_endmatch [mapname]).", 0, MapAutoComplete)
{
if ( !UTIL_IsCommandIssuedByServerAdmin() )
{
Msg( "You must be a server admin to use that command\n" );
return;
}
// Don't do anything if we are already game over
if ( GEGameplay()->IsGameOver() )
return;
// Set the next level if given
if ( args.ArgC() > 1 ) {
if ( engine->IsMapValid( args[1] ) )
nextlevel.SetValue( args[1] );
else
Warning( "Invalid map provided to ge_endmatch, ignoring.\n" );
}
GEGameplay()->EndMatch();
}
CON_COMMAND(ge_gameplaylist, "Lists the possible gameplay selections.")
{
if ( !UTIL_IsCommandIssuedByServerAdmin() )
{
Msg( "You must be a server admin to use that command\n" );
return;
}
if ( !GEGameplay() )
{
Warning( "Failed to run command, not playing a game!\n" );
return;
}
GEGameplay()->PrintGamePlayList();
}
#ifdef _DEBUG
CON_COMMAND( ge_cyclegameplay, "Simulates a map transition" )
{
GEGameplay()->LoadScenario();
}
#endif
| Entropy-Soldier/ges-legacy-code | game/ges/server/mp/ge_gameplay.cpp | C++ | gpl-3.0 | 39,815 | [
30522,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
9385,
2286,
1010,
3585,
17683,
1024,
3120,
1012,
2035,
2916,
9235,
1012,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# Kirchneriella irregularis (G.M. Smith) Korshikov SPECIES
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Chlorophyta/Chlorophyceae/Chlorococcales/Oocystaceae/Kirchneriella/Kirchneriella irregularis/README.md | Markdown | apache-2.0 | 206 | [
30522,
1001,
11382,
11140,
3678,
9257,
2721,
12052,
2483,
1006,
1043,
1012,
1049,
1012,
3044,
1007,
12849,
2869,
22204,
2615,
2427,
1001,
1001,
1001,
1001,
3570,
3970,
1001,
1001,
1001,
1001,
2429,
2000,
1996,
10161,
1997,
2166,
1010,
3822,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# -*- coding: UTF-8 -*-
import logging
unicode_string = u"Татьяна"
utf8_string = "'Татьяна' is an invalid string value"
logging.warning(unicode_string)
logging.warning(utf8_string)
try:
raise Exception(utf8_string)
except Exception,e:
print "--- (Log a traceback of the exception):"
logging.exception(e)
print "--- Everything okay until here, but now we run into trouble:"
logging.warning(u"1 Deferred %s : %s",unicode_string,e)
logging.warning(u"2 Deferred %s : %s",unicode_string,utf8_string)
print "--- some workarounds:"
logging.warning(u"3 Deferred %s : %s",unicode_string,utf8_string.decode('UTF-8'))
from django.utils.encoding import force_unicode
logging.warning(u"4 Deferred %s : %s",unicode_string,force_unicode(utf8_string))
| lsaffre/blog | docs/blog/2011/0527.py | Python | agpl-3.0 | 806 | [
30522,
1001,
1011,
1008,
1011,
16861,
1024,
21183,
2546,
1011,
1022,
1011,
1008,
1011,
12324,
15899,
27260,
1035,
5164,
1027,
1057,
1000,
1197,
10260,
22919,
23742,
17432,
19865,
1000,
21183,
2546,
2620,
1035,
5164,
1027,
1000,
1005,
1197,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# swio
--
import "github.com/shipwire/swutil/swio"
Package swio provides additional utilities on top of the standard io package.
## Usage
```go
var DummyReader = newDummy(time.Now().Unix())
```
DummyReader is a reader of pseudo-random data. It is meant to be more efficient
than cryptographically random data, but is useful only in limited cases such as
testing other readers.
#### func ForkReader
```go
func ForkReader(r io.Reader, n int) (head, tail io.Reader)
```
ForkReader accepts a reader and forks it at a given point. It returns two
readers, one that continues from the beginning of the original reader, and
another that reads from the nth byte. Readers are a FIFO stream, so reads from
the second reader can't actually jump ahead. To solve this problem, reads from
the tail cause the entire remaining contents of the head to be transparently
read into memory.
#### func NewReadCloser
```go
func NewReadCloser(r io.Reader, c CloseFunc) io.ReadCloser
```
NewReadCloser wraps r with CloseFunc c.
#### func SeekerPosition
```go
func SeekerPosition(r io.Seeker) (int64, error)
```
SekerPosition returns the current offset of an io.Seeker
#### func TeeReadCloser
```go
func TeeReadCloser(r io.ReadCloser, w io.Writer) io.ReadCloser
```
TeeReadCloser returns a ReadCloser that writes everything read from it to w. Its
content is read from r. All writes must return before anything can be read. Any
write error will be returned from Read. The Close method on the returned
ReadCloser is called derived from r.
#### type CloseFunc
```go
type CloseFunc func() error
```
CloseFunc documents a function that satisfies io.Closer.
#### type ReadCounter
```go
type ReadCounter interface {
io.Reader
BytesRead() int64
}
```
ReadCounter is a reader that keeps track of the total number of bytes read.
#### func NewReadCounter
```go
func NewReadCounter(r io.Reader) ReadCounter
```
NewReadCounter wraps a Reader in a ReadCounter.
#### type ReadSeekerAt
```go
type ReadSeekerAt interface {
io.ReadSeeker
io.ReaderAt
}
```
ReadSeekerAt is the interface that groups io.ReadSeeker and io.ReaderAt.
#### type ReadSeekerCloser
```go
type ReadSeekerCloser interface {
io.Reader
io.Seeker
io.Closer
}
```
ReadSeekerCloser wraps the io.Reader, io.Seeker, and io.Closer types.
#### func NewReadSeekerCloser
```go
func NewReadSeekerCloser(r io.ReadSeeker, c CloseFunc) ReadSeekerCloser
```
NewReadSeekerCloser wraps r with the close function c.
#### func NewSeekBufferCloser
```go
func NewSeekBufferCloser(r io.ReadCloser, l int64) ReadSeekerCloser
```
NewSeekBufferCloser creates a new SeekBuffer using ReadCloser r. l is the
initial capacity of the internal buffer. The close method from r is forwarded to
the returned ReadSeekerCloser.
#### func NopReadSeekerCloser
```go
func NopReadSeekerCloser(r io.ReadSeeker) ReadSeekerCloser
```
NopReadSeekerCloser wraps r with a no-op close function.
#### type SeekBuffer
```go
type SeekBuffer struct {
}
```
SeekBuffer contains a reader where all data read from it is buffered, and thus
both readable and seekable. It essentially augments bytes.Reader so that all
data does not need to be read at once.
#### func NewSeekBuffer
```go
func NewSeekBuffer(r io.Reader, l int64) *SeekBuffer
```
NewSeekBuffer creates a new SeekBuffer using reader r. l is the initial capacity
of the internal buffer. If r happens to be a ReadSeeker already, r is used
directly without any additional copies of the data.
#### func (*SeekBuffer) Read
```go
func (s *SeekBuffer) Read(b []byte) (int, error)
```
Read reads from the internal buffer or source reader until b is filled or an
error occurs.
#### func (*SeekBuffer) ReadAt
```go
func (s *SeekBuffer) ReadAt(b []byte, off int64) (int, error)
```
ReadAt implements io.ReaderAt for SeekBuffer.
#### func (*SeekBuffer) Seek
```go
func (s *SeekBuffer) Seek(offset int64, whence int) (int64, error)
```
Seek implements io.Seeker for SeekBuffer. If the new offset goes beyond what is
buffered, SeekBuffer will read from the source reader until offset can be
reached or an error is returned. If whence is 2, SeekBuffer will read until EOF
or an error is reached.
#### type WriteCounter
```go
type WriteCounter interface {
io.Writer
BytesWritten() int64
}
```
WriteCounter is a writer that keeps track of the total number of bytes written.
#### func NewWriteCounter
```go
func NewWriteCounter(w io.Writer) WriteCounter
```
NewWriteCounter wraps a Writer in a WriteCounter
| shipwire/swutil | swio/readme.md | Markdown | mit | 4,492 | [
30522,
1001,
25430,
3695,
1011,
1011,
12324,
1000,
21025,
2705,
12083,
1012,
4012,
1013,
2911,
20357,
1013,
25430,
21823,
2140,
1013,
25430,
30524,
1036,
24369,
16416,
4063,
2003,
1037,
8068,
1997,
18404,
1011,
6721,
2951,
1012,
2009,
2003,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ChromeTabDisguise
=================
A simple tool to disguise Chrome Tab's favicon and title.
| jromer94/ChromeTabDisguise | README.md | Markdown | apache-2.0 | 95 | [
30522,
18546,
2696,
2497,
10521,
25698,
3366,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1037,
3722,
6994,
2000,
14249,
18546,
21628,
1005,
1055,
6904,
7903,
2239,
1998,
2516,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#include <gbVk/Fence.hpp>
#include <gbVk/Exceptions.hpp>
#include <gbBase/Assert.hpp>
namespace GHULBUS_VULKAN_NAMESPACE
{
Fence::Fence(VkDevice logical_device, VkFence fence)
:m_fence(fence), m_device(logical_device)
{
}
Fence::~Fence()
{
if(m_fence) { vkDestroyFence(m_device, m_fence, nullptr); }
}
Fence::Fence(Fence&& rhs)
:m_fence(rhs.m_fence), m_device(rhs.m_device)
{
rhs.m_fence = nullptr;
rhs.m_device = nullptr;
}
VkFence Fence::getVkFence()
{
return m_fence;
}
Fence::Status Fence::getStatus()
{
VkResult res = vkGetFenceStatus(m_device, m_fence);
if(res == VK_NOT_READY) { return Status::NotReady; }
checkVulkanError(res, "Error in vkGetFenceStatus.");
return Status::Ready;
}
void Fence::wait()
{
auto const status = wait_for(std::chrono::nanoseconds::max());
GHULBUS_ASSERT(status == Status::Ready);
}
Fence::Status Fence::wait_for(std::chrono::nanoseconds timeout)
{
VkResult res = vkWaitForFences(m_device, 1, &m_fence, VK_TRUE, timeout.count());
if(res == VK_NOT_READY) { return Status::NotReady; }
checkVulkanError(res, "Error in vkWaitForFences.");
return Status::Ready;
}
void Fence::reset()
{
VkResult res = vkResetFences(m_device, 1, &m_fence);
checkVulkanError(res, "Error in vkResetFences.");
}
}
| ComicSansMS/GhulbusVulkan | src/Fence.cpp | C++ | mit | 1,304 | [
30522,
1001,
2421,
1026,
16351,
2615,
2243,
1013,
8638,
1012,
6522,
2361,
1028,
1001,
2421,
1026,
16351,
2615,
2243,
1013,
11790,
1012,
6522,
2361,
1028,
1001,
2421,
1026,
16351,
15058,
1013,
20865,
1012,
6522,
2361,
1028,
3415,
15327,
1043... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
using FlaUI.Core.AutomationElements.Infrastructure;
using FlaUI.Core.Patterns;
namespace FlaUI.Core.AutomationElements.PatternElements
{
/// <summary>
/// An element which supports the <see cref="ISelectionItemPattern" />.
/// </summary>
public class SelectionItemAutomationElement : AutomationElement
{
/// <summary>
/// Creates a <see cref="SelectionItemAutomationElement"/> element.
/// </summary>
public SelectionItemAutomationElement(BasicAutomationElementBase basicAutomationElement) : base(basicAutomationElement)
{
}
/// <summary>
/// Pattern object for the <see cref="ISelectionItemPattern"/>.
/// </summary>
protected ISelectionItemPattern SelectionItemPattern => Patterns.SelectionItem.Pattern;
/// <summary>
/// Value to get/set if this element is selected.
/// </summary>
public virtual bool IsSelected
{
get => SelectionItemPattern.IsSelected;
set
{
if (IsSelected == value) return;
if (value && !IsSelected)
{
Select();
}
}
}
/// <summary>
/// Selects the element.
/// </summary>
public virtual SelectionItemAutomationElement Select()
{
ExecuteInPattern(SelectionItemPattern, true, pattern => pattern.Select());
return this;
}
/// <summary>
/// Adds the element to the selection.
/// </summary>
public virtual SelectionItemAutomationElement AddToSelection()
{
ExecuteInPattern(SelectionItemPattern, true, pattern => pattern.AddToSelection());
return this;
}
/// <summary>
/// Removes the element from the selection.
/// </summary>
public virtual SelectionItemAutomationElement RemoveFromSelection()
{
ExecuteInPattern(SelectionItemPattern, true, pattern => pattern.RemoveFromSelection());
return this;
}
}
}
| maxinfet/FlaUI | src/FlaUI.Core/AutomationElements/PatternElements/SelectionItemAutomationElement.cs | C# | mit | 2,132 | [
30522,
2478,
13109,
4887,
2072,
1012,
4563,
1012,
19309,
12260,
8163,
1012,
6502,
1025,
2478,
13109,
4887,
2072,
1012,
4563,
1012,
7060,
1025,
3415,
15327,
13109,
4887,
2072,
1012,
4563,
1012,
19309,
12260,
8163,
1012,
5418,
12260,
8163,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
using System;
using System.Linq;
namespace Altitude
{
public class altitude
{
public static void Main()
{
string[] comands = Console.ReadLine().Split(' ').ToArray();
int ctr = int.Parse(comands[0]);
double result = ctr;
double diff = 0;
for (int i = 1; i < comands.Length - 1; i += 2)
{
if(comands[i] == "up")
{
result += double.Parse(comands[i + 1]);
diff += double.Parse(comands[i + 1]);
}
if (comands[i] == "down")
{
result -= double.Parse(comands[i + 1]);
diff -= double.Parse(comands[i + 1]);
}
if (result <= 0)
{
break;
}
}
Console.WriteLine(result > 0 ? $"got through safely. current altitude: {ctr + diff}m" :
$"crashed");
}
}
}
| spzvtbg/C-Sharp-ProgrammingFundamentals | 04.SimpleArrayExercises/Altitude/altitude.cs | C# | mit | 1,035 | [
30522,
2478,
2291,
1025,
2478,
2291,
1012,
11409,
4160,
1025,
3415,
15327,
7998,
1063,
2270,
2465,
7998,
1063,
2270,
10763,
11675,
2364,
1006,
1007,
1063,
5164,
1031,
1033,
16571,
18376,
1027,
10122,
1012,
3191,
4179,
1006,
1007,
1012,
3975... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.client;
import org.elasticsearch.client.http.entity.ContentType;
import org.elasticsearch.client.http.entity.StringEntity;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.ElasticsearchStatusException;
import org.elasticsearch.action.DocWriteRequest;
import org.elasticsearch.action.DocWriteResponse;
import org.elasticsearch.action.bulk.BulkItemResponse;
import org.elasticsearch.action.bulk.BulkProcessor;
import org.elasticsearch.action.bulk.BulkRequest;
import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.action.delete.DeleteRequest;
import org.elasticsearch.action.delete.DeleteResponse;
import org.elasticsearch.action.get.GetRequest;
import org.elasticsearch.action.get.GetResponse;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.action.update.UpdateRequest;
import org.elasticsearch.action.update.UpdateResponse;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeUnit;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.index.VersionType;
import org.elasticsearch.index.get.GetResult;
import org.elasticsearch.rest.RestStatus;
import org.elasticsearch.script.Script;
import org.elasticsearch.script.ScriptType;
import org.elasticsearch.search.fetch.subphase.FetchSourceContext;
import org.elasticsearch.threadpool.ThreadPool;
import java.io.IOException;
import java.util.Collections;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import static java.util.Collections.singletonMap;
public class CrudIT extends ESRestHighLevelClientTestCase {
public void testDelete() throws IOException {
{
// Testing deletion
String docId = "id";
highLevelClient().index(new IndexRequest("index", "type", docId).source(Collections.singletonMap("foo", "bar")));
DeleteRequest deleteRequest = new DeleteRequest("index", "type", docId);
if (randomBoolean()) {
deleteRequest.version(1L);
}
DeleteResponse deleteResponse = execute(deleteRequest, highLevelClient()::delete, highLevelClient()::deleteAsync);
assertEquals("index", deleteResponse.getIndex());
assertEquals("type", deleteResponse.getType());
assertEquals(docId, deleteResponse.getId());
assertEquals(DocWriteResponse.Result.DELETED, deleteResponse.getResult());
}
{
// Testing non existing document
String docId = "does_not_exist";
DeleteRequest deleteRequest = new DeleteRequest("index", "type", docId);
DeleteResponse deleteResponse = execute(deleteRequest, highLevelClient()::delete, highLevelClient()::deleteAsync);
assertEquals("index", deleteResponse.getIndex());
assertEquals("type", deleteResponse.getType());
assertEquals(docId, deleteResponse.getId());
assertEquals(DocWriteResponse.Result.NOT_FOUND, deleteResponse.getResult());
}
{
// Testing version conflict
String docId = "version_conflict";
highLevelClient().index(new IndexRequest("index", "type", docId).source(Collections.singletonMap("foo", "bar")));
DeleteRequest deleteRequest = new DeleteRequest("index", "type", docId).version(2);
ElasticsearchException exception = expectThrows(ElasticsearchException.class,
() -> execute(deleteRequest, highLevelClient()::delete, highLevelClient()::deleteAsync));
assertEquals(RestStatus.CONFLICT, exception.status());
assertEquals("Elasticsearch exception [type=version_conflict_engine_exception, reason=[type][" + docId + "]: " +
"version conflict, current version [1] is different than the one provided [2]]", exception.getMessage());
assertEquals("index", exception.getMetadata("es.index").get(0));
}
{
// Testing version type
String docId = "version_type";
highLevelClient().index(new IndexRequest("index", "type", docId).source(Collections.singletonMap("foo", "bar"))
.versionType(VersionType.EXTERNAL).version(12));
DeleteRequest deleteRequest = new DeleteRequest("index", "type", docId).versionType(VersionType.EXTERNAL).version(13);
DeleteResponse deleteResponse = execute(deleteRequest, highLevelClient()::delete, highLevelClient()::deleteAsync);
assertEquals("index", deleteResponse.getIndex());
assertEquals("type", deleteResponse.getType());
assertEquals(docId, deleteResponse.getId());
assertEquals(DocWriteResponse.Result.DELETED, deleteResponse.getResult());
}
{
// Testing version type with a wrong version
String docId = "wrong_version";
highLevelClient().index(new IndexRequest("index", "type", docId).source(Collections.singletonMap("foo", "bar"))
.versionType(VersionType.EXTERNAL).version(12));
ElasticsearchStatusException exception = expectThrows(ElasticsearchStatusException.class, () -> {
DeleteRequest deleteRequest = new DeleteRequest("index", "type", docId).versionType(VersionType.EXTERNAL).version(10);
execute(deleteRequest, highLevelClient()::delete, highLevelClient()::deleteAsync);
});
assertEquals(RestStatus.CONFLICT, exception.status());
assertEquals("Elasticsearch exception [type=version_conflict_engine_exception, reason=[type][" +
docId + "]: version conflict, current version [12] is higher or equal to the one provided [10]]", exception.getMessage());
assertEquals("index", exception.getMetadata("es.index").get(0));
}
{
// Testing routing
String docId = "routing";
highLevelClient().index(new IndexRequest("index", "type", docId).source(Collections.singletonMap("foo", "bar")).routing("foo"));
DeleteRequest deleteRequest = new DeleteRequest("index", "type", docId).routing("foo");
DeleteResponse deleteResponse = execute(deleteRequest, highLevelClient()::delete, highLevelClient()::deleteAsync);
assertEquals("index", deleteResponse.getIndex());
assertEquals("type", deleteResponse.getType());
assertEquals(docId, deleteResponse.getId());
assertEquals(DocWriteResponse.Result.DELETED, deleteResponse.getResult());
}
}
public void testExists() throws IOException {
{
GetRequest getRequest = new GetRequest("index", "type", "id");
assertFalse(execute(getRequest, highLevelClient()::exists, highLevelClient()::existsAsync));
}
String document = "{\"field1\":\"value1\",\"field2\":\"value2\"}";
StringEntity stringEntity = new StringEntity(document, ContentType.APPLICATION_JSON);
Response response = client().performRequest("PUT", "/index/type/id", Collections.singletonMap("refresh", "wait_for"), stringEntity);
assertEquals(201, response.getStatusLine().getStatusCode());
{
GetRequest getRequest = new GetRequest("index", "type", "id");
assertTrue(execute(getRequest, highLevelClient()::exists, highLevelClient()::existsAsync));
}
{
GetRequest getRequest = new GetRequest("index", "type", "does_not_exist");
assertFalse(execute(getRequest, highLevelClient()::exists, highLevelClient()::existsAsync));
}
{
GetRequest getRequest = new GetRequest("index", "type", "does_not_exist").version(1);
assertFalse(execute(getRequest, highLevelClient()::exists, highLevelClient()::existsAsync));
}
}
public void testGet() throws IOException {
{
GetRequest getRequest = new GetRequest("index", "type", "id");
ElasticsearchException exception = expectThrows(ElasticsearchException.class,
() -> execute(getRequest, highLevelClient()::get, highLevelClient()::getAsync));
assertEquals(RestStatus.NOT_FOUND, exception.status());
assertEquals("Elasticsearch exception [type=index_not_found_exception, reason=no such index]", exception.getMessage());
assertEquals("index", exception.getMetadata("es.index").get(0));
}
String document = "{\"field1\":\"value1\",\"field2\":\"value2\"}";
StringEntity stringEntity = new StringEntity(document, ContentType.APPLICATION_JSON);
Response response = client().performRequest("PUT", "/index/type/id", Collections.singletonMap("refresh", "wait_for"), stringEntity);
assertEquals(201, response.getStatusLine().getStatusCode());
{
GetRequest getRequest = new GetRequest("index", "type", "id").version(2);
ElasticsearchException exception = expectThrows(ElasticsearchException.class,
() -> execute(getRequest, highLevelClient()::get, highLevelClient()::getAsync));
assertEquals(RestStatus.CONFLICT, exception.status());
assertEquals("Elasticsearch exception [type=version_conflict_engine_exception, " + "reason=[type][id]: " +
"version conflict, current version [1] is different than the one provided [2]]", exception.getMessage());
assertEquals("index", exception.getMetadata("es.index").get(0));
}
{
GetRequest getRequest = new GetRequest("index", "type", "id");
if (randomBoolean()) {
getRequest.version(1L);
}
GetResponse getResponse = execute(getRequest, highLevelClient()::get, highLevelClient()::getAsync);
assertEquals("index", getResponse.getIndex());
assertEquals("type", getResponse.getType());
assertEquals("id", getResponse.getId());
assertTrue(getResponse.isExists());
assertFalse(getResponse.isSourceEmpty());
assertEquals(1L, getResponse.getVersion());
assertEquals(document, getResponse.getSourceAsString());
}
{
GetRequest getRequest = new GetRequest("index", "type", "does_not_exist");
GetResponse getResponse = execute(getRequest, highLevelClient()::get, highLevelClient()::getAsync);
assertEquals("index", getResponse.getIndex());
assertEquals("type", getResponse.getType());
assertEquals("does_not_exist", getResponse.getId());
assertFalse(getResponse.isExists());
assertEquals(-1, getResponse.getVersion());
assertTrue(getResponse.isSourceEmpty());
assertNull(getResponse.getSourceAsString());
}
{
GetRequest getRequest = new GetRequest("index", "type", "id");
getRequest.fetchSourceContext(new FetchSourceContext(false, Strings.EMPTY_ARRAY, Strings.EMPTY_ARRAY));
GetResponse getResponse = execute(getRequest, highLevelClient()::get, highLevelClient()::getAsync);
assertEquals("index", getResponse.getIndex());
assertEquals("type", getResponse.getType());
assertEquals("id", getResponse.getId());
assertTrue(getResponse.isExists());
assertTrue(getResponse.isSourceEmpty());
assertEquals(1L, getResponse.getVersion());
assertNull(getResponse.getSourceAsString());
}
{
GetRequest getRequest = new GetRequest("index", "type", "id");
if (randomBoolean()) {
getRequest.fetchSourceContext(new FetchSourceContext(true, new String[]{"field1"}, Strings.EMPTY_ARRAY));
} else {
getRequest.fetchSourceContext(new FetchSourceContext(true, Strings.EMPTY_ARRAY, new String[]{"field2"}));
}
GetResponse getResponse = execute(getRequest, highLevelClient()::get, highLevelClient()::getAsync);
assertEquals("index", getResponse.getIndex());
assertEquals("type", getResponse.getType());
assertEquals("id", getResponse.getId());
assertTrue(getResponse.isExists());
assertFalse(getResponse.isSourceEmpty());
assertEquals(1L, getResponse.getVersion());
Map<String, Object> sourceAsMap = getResponse.getSourceAsMap();
assertEquals(1, sourceAsMap.size());
assertEquals("value1", sourceAsMap.get("field1"));
}
}
public void testIndex() throws IOException {
final XContentType xContentType = randomFrom(XContentType.values());
{
IndexRequest indexRequest = new IndexRequest("index", "type");
indexRequest.source(XContentBuilder.builder(xContentType.xContent()).startObject().field("test", "test").endObject());
IndexResponse indexResponse = execute(indexRequest, highLevelClient()::index, highLevelClient()::indexAsync);
assertEquals(RestStatus.CREATED, indexResponse.status());
assertEquals(DocWriteResponse.Result.CREATED, indexResponse.getResult());
assertEquals("index", indexResponse.getIndex());
assertEquals("type", indexResponse.getType());
assertTrue(Strings.hasLength(indexResponse.getId()));
assertEquals(1L, indexResponse.getVersion());
assertNotNull(indexResponse.getShardId());
assertEquals(-1, indexResponse.getShardId().getId());
assertEquals("index", indexResponse.getShardId().getIndexName());
assertEquals("index", indexResponse.getShardId().getIndex().getName());
assertEquals("_na_", indexResponse.getShardId().getIndex().getUUID());
assertNotNull(indexResponse.getShardInfo());
assertEquals(0, indexResponse.getShardInfo().getFailed());
assertTrue(indexResponse.getShardInfo().getSuccessful() > 0);
assertTrue(indexResponse.getShardInfo().getTotal() > 0);
}
{
IndexRequest indexRequest = new IndexRequest("index", "type", "id");
indexRequest.source(XContentBuilder.builder(xContentType.xContent()).startObject().field("version", 1).endObject());
IndexResponse indexResponse = execute(indexRequest, highLevelClient()::index, highLevelClient()::indexAsync);
assertEquals(RestStatus.CREATED, indexResponse.status());
assertEquals("index", indexResponse.getIndex());
assertEquals("type", indexResponse.getType());
assertEquals("id", indexResponse.getId());
assertEquals(1L, indexResponse.getVersion());
indexRequest = new IndexRequest("index", "type", "id");
indexRequest.source(XContentBuilder.builder(xContentType.xContent()).startObject().field("version", 2).endObject());
indexResponse = execute(indexRequest, highLevelClient()::index, highLevelClient()::indexAsync);
assertEquals(RestStatus.OK, indexResponse.status());
assertEquals("index", indexResponse.getIndex());
assertEquals("type", indexResponse.getType());
assertEquals("id", indexResponse.getId());
assertEquals(2L, indexResponse.getVersion());
ElasticsearchStatusException exception = expectThrows(ElasticsearchStatusException.class, () -> {
IndexRequest wrongRequest = new IndexRequest("index", "type", "id");
wrongRequest.source(XContentBuilder.builder(xContentType.xContent()).startObject().field("field", "test").endObject());
wrongRequest.version(5L);
execute(wrongRequest, highLevelClient()::index, highLevelClient()::indexAsync);
});
assertEquals(RestStatus.CONFLICT, exception.status());
assertEquals("Elasticsearch exception [type=version_conflict_engine_exception, reason=[type][id]: " +
"version conflict, current version [2] is different than the one provided [5]]", exception.getMessage());
assertEquals("index", exception.getMetadata("es.index").get(0));
}
{
ElasticsearchStatusException exception = expectThrows(ElasticsearchStatusException.class, () -> {
IndexRequest indexRequest = new IndexRequest("index", "type", "missing_parent");
indexRequest.source(XContentBuilder.builder(xContentType.xContent()).startObject().field("field", "test").endObject());
indexRequest.parent("missing");
execute(indexRequest, highLevelClient()::index, highLevelClient()::indexAsync);
});
assertEquals(RestStatus.BAD_REQUEST, exception.status());
assertEquals("Elasticsearch exception [type=illegal_argument_exception, " +
"reason=can't specify parent if no parent field has been configured]", exception.getMessage());
}
{
ElasticsearchStatusException exception = expectThrows(ElasticsearchStatusException.class, () -> {
IndexRequest indexRequest = new IndexRequest("index", "type", "missing_pipeline");
indexRequest.source(XContentBuilder.builder(xContentType.xContent()).startObject().field("field", "test").endObject());
indexRequest.setPipeline("missing");
execute(indexRequest, highLevelClient()::index, highLevelClient()::indexAsync);
});
assertEquals(RestStatus.BAD_REQUEST, exception.status());
assertEquals("Elasticsearch exception [type=illegal_argument_exception, " +
"reason=pipeline with id [missing] does not exist]", exception.getMessage());
}
{
IndexRequest indexRequest = new IndexRequest("index", "type", "external_version_type");
indexRequest.source(XContentBuilder.builder(xContentType.xContent()).startObject().field("field", "test").endObject());
indexRequest.version(12L);
indexRequest.versionType(VersionType.EXTERNAL);
IndexResponse indexResponse = execute(indexRequest, highLevelClient()::index, highLevelClient()::indexAsync);
assertEquals(RestStatus.CREATED, indexResponse.status());
assertEquals("index", indexResponse.getIndex());
assertEquals("type", indexResponse.getType());
assertEquals("external_version_type", indexResponse.getId());
assertEquals(12L, indexResponse.getVersion());
}
{
final IndexRequest indexRequest = new IndexRequest("index", "type", "with_create_op_type");
indexRequest.source(XContentBuilder.builder(xContentType.xContent()).startObject().field("field", "test").endObject());
indexRequest.opType(DocWriteRequest.OpType.CREATE);
IndexResponse indexResponse = execute(indexRequest, highLevelClient()::index, highLevelClient()::indexAsync);
assertEquals(RestStatus.CREATED, indexResponse.status());
assertEquals("index", indexResponse.getIndex());
assertEquals("type", indexResponse.getType());
assertEquals("with_create_op_type", indexResponse.getId());
ElasticsearchStatusException exception = expectThrows(ElasticsearchStatusException.class, () -> {
execute(indexRequest, highLevelClient()::index, highLevelClient()::indexAsync);
});
assertEquals(RestStatus.CONFLICT, exception.status());
assertEquals("Elasticsearch exception [type=version_conflict_engine_exception, reason=[type][with_create_op_type]: " +
"version conflict, document already exists (current version [1])]", exception.getMessage());
}
}
public void testUpdate() throws IOException {
{
UpdateRequest updateRequest = new UpdateRequest("index", "type", "does_not_exist");
updateRequest.doc(singletonMap("field", "value"), randomFrom(XContentType.values()));
ElasticsearchStatusException exception = expectThrows(ElasticsearchStatusException.class, () ->
execute(updateRequest, highLevelClient()::update, highLevelClient()::updateAsync));
assertEquals(RestStatus.NOT_FOUND, exception.status());
assertEquals("Elasticsearch exception [type=document_missing_exception, reason=[type][does_not_exist]: document missing]",
exception.getMessage());
}
{
IndexRequest indexRequest = new IndexRequest("index", "type", "id");
indexRequest.source(singletonMap("field", "value"));
IndexResponse indexResponse = highLevelClient().index(indexRequest);
assertEquals(RestStatus.CREATED, indexResponse.status());
UpdateRequest updateRequest = new UpdateRequest("index", "type", "id");
updateRequest.doc(singletonMap("field", "updated"), randomFrom(XContentType.values()));
UpdateResponse updateResponse = execute(updateRequest, highLevelClient()::update, highLevelClient()::updateAsync);
assertEquals(RestStatus.OK, updateResponse.status());
assertEquals(indexResponse.getVersion() + 1, updateResponse.getVersion());
UpdateRequest updateRequestConflict = new UpdateRequest("index", "type", "id");
updateRequestConflict.doc(singletonMap("field", "with_version_conflict"), randomFrom(XContentType.values()));
updateRequestConflict.version(indexResponse.getVersion());
ElasticsearchStatusException exception = expectThrows(ElasticsearchStatusException.class, () ->
execute(updateRequestConflict, highLevelClient()::update, highLevelClient()::updateAsync));
assertEquals(RestStatus.CONFLICT, exception.status());
assertEquals("Elasticsearch exception [type=version_conflict_engine_exception, reason=[type][id]: version conflict, " +
"current version [2] is different than the one provided [1]]", exception.getMessage());
}
{
ElasticsearchStatusException exception = expectThrows(ElasticsearchStatusException.class, () -> {
UpdateRequest updateRequest = new UpdateRequest("index", "type", "id");
updateRequest.doc(singletonMap("field", "updated"), randomFrom(XContentType.values()));
if (randomBoolean()) {
updateRequest.parent("missing");
} else {
updateRequest.routing("missing");
}
execute(updateRequest, highLevelClient()::update, highLevelClient()::updateAsync);
});
assertEquals(RestStatus.NOT_FOUND, exception.status());
assertEquals("Elasticsearch exception [type=document_missing_exception, reason=[type][id]: document missing]",
exception.getMessage());
}
{
IndexRequest indexRequest = new IndexRequest("index", "type", "with_script");
indexRequest.source(singletonMap("counter", 12));
IndexResponse indexResponse = highLevelClient().index(indexRequest);
assertEquals(RestStatus.CREATED, indexResponse.status());
UpdateRequest updateRequest = new UpdateRequest("index", "type", "with_script");
Script script = new Script(ScriptType.INLINE, "painless", "ctx._source.counter += params.count", singletonMap("count", 8));
updateRequest.script(script);
updateRequest.fetchSource(true);
UpdateResponse updateResponse = execute(updateRequest, highLevelClient()::update, highLevelClient()::updateAsync);
assertEquals(RestStatus.OK, updateResponse.status());
assertEquals(DocWriteResponse.Result.UPDATED, updateResponse.getResult());
assertEquals(2L, updateResponse.getVersion());
assertEquals(20, updateResponse.getGetResult().sourceAsMap().get("counter"));
}
{
IndexRequest indexRequest = new IndexRequest("index", "type", "with_doc");
indexRequest.source("field_1", "one", "field_3", "three");
indexRequest.version(12L);
indexRequest.versionType(VersionType.EXTERNAL);
IndexResponse indexResponse = highLevelClient().index(indexRequest);
assertEquals(RestStatus.CREATED, indexResponse.status());
assertEquals(12L, indexResponse.getVersion());
UpdateRequest updateRequest = new UpdateRequest("index", "type", "with_doc");
updateRequest.doc(singletonMap("field_2", "two"), randomFrom(XContentType.values()));
updateRequest.fetchSource("field_*", "field_3");
UpdateResponse updateResponse = execute(updateRequest, highLevelClient()::update, highLevelClient()::updateAsync);
assertEquals(RestStatus.OK, updateResponse.status());
assertEquals(DocWriteResponse.Result.UPDATED, updateResponse.getResult());
assertEquals(13L, updateResponse.getVersion());
GetResult getResult = updateResponse.getGetResult();
assertEquals(13L, updateResponse.getVersion());
Map<String, Object> sourceAsMap = getResult.sourceAsMap();
assertEquals("one", sourceAsMap.get("field_1"));
assertEquals("two", sourceAsMap.get("field_2"));
assertFalse(sourceAsMap.containsKey("field_3"));
}
{
IndexRequest indexRequest = new IndexRequest("index", "type", "noop");
indexRequest.source("field", "value");
IndexResponse indexResponse = highLevelClient().index(indexRequest);
assertEquals(RestStatus.CREATED, indexResponse.status());
assertEquals(1L, indexResponse.getVersion());
UpdateRequest updateRequest = new UpdateRequest("index", "type", "noop");
updateRequest.doc(singletonMap("field", "value"), randomFrom(XContentType.values()));
UpdateResponse updateResponse = execute(updateRequest, highLevelClient()::update, highLevelClient()::updateAsync);
assertEquals(RestStatus.OK, updateResponse.status());
assertEquals(DocWriteResponse.Result.NOOP, updateResponse.getResult());
assertEquals(1L, updateResponse.getVersion());
updateRequest.detectNoop(false);
updateResponse = execute(updateRequest, highLevelClient()::update, highLevelClient()::updateAsync);
assertEquals(RestStatus.OK, updateResponse.status());
assertEquals(DocWriteResponse.Result.UPDATED, updateResponse.getResult());
assertEquals(2L, updateResponse.getVersion());
}
{
UpdateRequest updateRequest = new UpdateRequest("index", "type", "with_upsert");
updateRequest.upsert(singletonMap("doc_status", "created"));
updateRequest.doc(singletonMap("doc_status", "updated"));
updateRequest.fetchSource(true);
UpdateResponse updateResponse = execute(updateRequest, highLevelClient()::update, highLevelClient()::updateAsync);
assertEquals(RestStatus.CREATED, updateResponse.status());
assertEquals("index", updateResponse.getIndex());
assertEquals("type", updateResponse.getType());
assertEquals("with_upsert", updateResponse.getId());
GetResult getResult = updateResponse.getGetResult();
assertEquals(1L, updateResponse.getVersion());
assertEquals("created", getResult.sourceAsMap().get("doc_status"));
}
{
UpdateRequest updateRequest = new UpdateRequest("index", "type", "with_doc_as_upsert");
updateRequest.doc(singletonMap("field", "initialized"));
updateRequest.fetchSource(true);
updateRequest.docAsUpsert(true);
UpdateResponse updateResponse = execute(updateRequest, highLevelClient()::update, highLevelClient()::updateAsync);
assertEquals(RestStatus.CREATED, updateResponse.status());
assertEquals("index", updateResponse.getIndex());
assertEquals("type", updateResponse.getType());
assertEquals("with_doc_as_upsert", updateResponse.getId());
GetResult getResult = updateResponse.getGetResult();
assertEquals(1L, updateResponse.getVersion());
assertEquals("initialized", getResult.sourceAsMap().get("field"));
}
{
UpdateRequest updateRequest = new UpdateRequest("index", "type", "with_scripted_upsert");
updateRequest.fetchSource(true);
updateRequest.script(new Script(ScriptType.INLINE, "painless", "ctx._source.level = params.test", singletonMap("test", "C")));
updateRequest.scriptedUpsert(true);
updateRequest.upsert(singletonMap("level", "A"));
UpdateResponse updateResponse = execute(updateRequest, highLevelClient()::update, highLevelClient()::updateAsync);
assertEquals(RestStatus.CREATED, updateResponse.status());
assertEquals("index", updateResponse.getIndex());
assertEquals("type", updateResponse.getType());
assertEquals("with_scripted_upsert", updateResponse.getId());
GetResult getResult = updateResponse.getGetResult();
assertEquals(1L, updateResponse.getVersion());
assertEquals("C", getResult.sourceAsMap().get("level"));
}
{
IllegalStateException exception = expectThrows(IllegalStateException.class, () -> {
UpdateRequest updateRequest = new UpdateRequest("index", "type", "id");
updateRequest.doc(new IndexRequest().source(Collections.singletonMap("field", "doc"), XContentType.JSON));
updateRequest.upsert(new IndexRequest().source(Collections.singletonMap("field", "upsert"), XContentType.YAML));
execute(updateRequest, highLevelClient()::update, highLevelClient()::updateAsync);
});
assertEquals("Update request cannot have different content types for doc [JSON] and upsert [YAML] documents",
exception.getMessage());
}
}
public void testBulk() throws IOException {
int nbItems = randomIntBetween(10, 100);
boolean[] errors = new boolean[nbItems];
XContentType xContentType = randomFrom(XContentType.JSON, XContentType.SMILE);
BulkRequest bulkRequest = new BulkRequest();
for (int i = 0; i < nbItems; i++) {
String id = String.valueOf(i);
boolean erroneous = randomBoolean();
errors[i] = erroneous;
DocWriteRequest.OpType opType = randomFrom(DocWriteRequest.OpType.values());
if (opType == DocWriteRequest.OpType.DELETE) {
if (erroneous == false) {
assertEquals(RestStatus.CREATED,
highLevelClient().index(new IndexRequest("index", "test", id).source("field", -1)).status());
}
DeleteRequest deleteRequest = new DeleteRequest("index", "test", id);
bulkRequest.add(deleteRequest);
} else {
BytesReference source = XContentBuilder.builder(xContentType.xContent()).startObject().field("id", i).endObject().bytes();
if (opType == DocWriteRequest.OpType.INDEX) {
IndexRequest indexRequest = new IndexRequest("index", "test", id).source(source, xContentType);
if (erroneous) {
indexRequest.version(12L);
}
bulkRequest.add(indexRequest);
} else if (opType == DocWriteRequest.OpType.CREATE) {
IndexRequest createRequest = new IndexRequest("index", "test", id).source(source, xContentType).create(true);
if (erroneous) {
assertEquals(RestStatus.CREATED, highLevelClient().index(createRequest).status());
}
bulkRequest.add(createRequest);
} else if (opType == DocWriteRequest.OpType.UPDATE) {
UpdateRequest updateRequest = new UpdateRequest("index", "test", id)
.doc(new IndexRequest().source(source, xContentType));
if (erroneous == false) {
assertEquals(RestStatus.CREATED,
highLevelClient().index(new IndexRequest("index", "test", id).source("field", -1)).status());
}
bulkRequest.add(updateRequest);
}
}
}
BulkResponse bulkResponse = execute(bulkRequest, highLevelClient()::bulk, highLevelClient()::bulkAsync);
assertEquals(RestStatus.OK, bulkResponse.status());
assertTrue(bulkResponse.getTook().getMillis() > 0);
assertEquals(nbItems, bulkResponse.getItems().length);
validateBulkResponses(nbItems, errors, bulkResponse, bulkRequest);
}
public void testBulkProcessorIntegration() throws IOException, InterruptedException {
int nbItems = randomIntBetween(10, 100);
boolean[] errors = new boolean[nbItems];
XContentType xContentType = randomFrom(XContentType.JSON, XContentType.SMILE);
AtomicReference<BulkResponse> responseRef = new AtomicReference<>();
AtomicReference<BulkRequest> requestRef = new AtomicReference<>();
AtomicReference<Throwable> error = new AtomicReference<>();
BulkProcessor.Listener listener = new BulkProcessor.Listener() {
@Override
public void beforeBulk(long executionId, BulkRequest request) {
}
@Override
public void afterBulk(long executionId, BulkRequest request, BulkResponse response) {
responseRef.set(response);
requestRef.set(request);
}
@Override
public void afterBulk(long executionId, BulkRequest request, Throwable failure) {
error.set(failure);
}
};
ThreadPool threadPool = new ThreadPool(Settings.builder().put("node.name", getClass().getName()).build());
// Pull the client to a variable to work around https://bugs.eclipse.org/bugs/show_bug.cgi?id=514884
RestHighLevelClient hlClient = highLevelClient();
try(BulkProcessor processor = new BulkProcessor.Builder(hlClient::bulkAsync, listener, threadPool)
.setConcurrentRequests(0)
.setBulkSize(new ByteSizeValue(5, ByteSizeUnit.GB))
.setBulkActions(nbItems + 1)
.build()) {
for (int i = 0; i < nbItems; i++) {
String id = String.valueOf(i);
boolean erroneous = randomBoolean();
errors[i] = erroneous;
DocWriteRequest.OpType opType = randomFrom(DocWriteRequest.OpType.values());
if (opType == DocWriteRequest.OpType.DELETE) {
if (erroneous == false) {
assertEquals(RestStatus.CREATED,
highLevelClient().index(new IndexRequest("index", "test", id).source("field", -1)).status());
}
DeleteRequest deleteRequest = new DeleteRequest("index", "test", id);
processor.add(deleteRequest);
} else {
if (opType == DocWriteRequest.OpType.INDEX) {
IndexRequest indexRequest = new IndexRequest("index", "test", id).source(xContentType, "id", i);
if (erroneous) {
indexRequest.version(12L);
}
processor.add(indexRequest);
} else if (opType == DocWriteRequest.OpType.CREATE) {
IndexRequest createRequest = new IndexRequest("index", "test", id).source(xContentType, "id", i).create(true);
if (erroneous) {
assertEquals(RestStatus.CREATED, highLevelClient().index(createRequest).status());
}
processor.add(createRequest);
} else if (opType == DocWriteRequest.OpType.UPDATE) {
UpdateRequest updateRequest = new UpdateRequest("index", "test", id)
.doc(new IndexRequest().source(xContentType, "id", i));
if (erroneous == false) {
assertEquals(RestStatus.CREATED,
highLevelClient().index(new IndexRequest("index", "test", id).source("field", -1)).status());
}
processor.add(updateRequest);
}
}
}
assertNull(responseRef.get());
assertNull(requestRef.get());
}
BulkResponse bulkResponse = responseRef.get();
BulkRequest bulkRequest = requestRef.get();
assertEquals(RestStatus.OK, bulkResponse.status());
assertTrue(bulkResponse.getTook().getMillis() > 0);
assertEquals(nbItems, bulkResponse.getItems().length);
assertNull(error.get());
validateBulkResponses(nbItems, errors, bulkResponse, bulkRequest);
terminate(threadPool);
}
private void validateBulkResponses(int nbItems, boolean[] errors, BulkResponse bulkResponse, BulkRequest bulkRequest) {
for (int i = 0; i < nbItems; i++) {
BulkItemResponse bulkItemResponse = bulkResponse.getItems()[i];
assertEquals(i, bulkItemResponse.getItemId());
assertEquals("index", bulkItemResponse.getIndex());
assertEquals("test", bulkItemResponse.getType());
assertEquals(String.valueOf(i), bulkItemResponse.getId());
DocWriteRequest.OpType requestOpType = bulkRequest.requests().get(i).opType();
if (requestOpType == DocWriteRequest.OpType.INDEX || requestOpType == DocWriteRequest.OpType.CREATE) {
assertEquals(errors[i], bulkItemResponse.isFailed());
assertEquals(errors[i] ? RestStatus.CONFLICT : RestStatus.CREATED, bulkItemResponse.status());
} else if (requestOpType == DocWriteRequest.OpType.UPDATE) {
assertEquals(errors[i], bulkItemResponse.isFailed());
assertEquals(errors[i] ? RestStatus.NOT_FOUND : RestStatus.OK, bulkItemResponse.status());
} else if (requestOpType == DocWriteRequest.OpType.DELETE) {
assertFalse(bulkItemResponse.isFailed());
assertEquals(errors[i] ? RestStatus.NOT_FOUND : RestStatus.OK, bulkItemResponse.status());
}
}
}
}
| sneivandt/elasticsearch | client/rest-high-level/src/test/java/org/elasticsearch/client/CrudIT.java | Java | apache-2.0 | 40,072 | [
30522,
1013,
1008,
1008,
7000,
2000,
21274,
17310,
11140,
2104,
2028,
2030,
2062,
12130,
1008,
6105,
10540,
1012,
2156,
1996,
5060,
5371,
5500,
2007,
1008,
2023,
2147,
2005,
3176,
2592,
4953,
9385,
1008,
6095,
1012,
21274,
17310,
11140,
159... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* A flexible rogue-like engine with easy-to-use mouse interface, editor,
* solo, hotseat, network multiplayer and E-Mail game functionality in mind.
* Copyright (C) 2013 Ryoga Unryu
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SHOW_DESCRIPTION_H
#define SHOW_DESCRIPTION_H
#include "Command/Backend/Object/ObjectCommand.h"
/** \addtogroup Commands
* \{
* \class ShowDescription
*
* \brief Shows the description of a given object.
*
* \author RyogaU
*
* \version 0.5
*
* Contact: RyogaU@googlemail.com
* \}
*/
class ShowDescription : public ObjectCommand
{
public:
ShowDescription(const ObjectBase *object, QObject *parent = 0);
virtual bool execute();
};
#endif // SHOW_DESCRIPTION_H
| Ryoga-Unryu/pidgirl-engine | Command/Backend/Object/ShowDescription.h | C | gpl-3.0 | 1,344 | [
30522,
1013,
1008,
1008,
1037,
12379,
12406,
1011,
2066,
3194,
2007,
3733,
1011,
2000,
1011,
2224,
8000,
8278,
1010,
3559,
1010,
1008,
3948,
1010,
2980,
17310,
2102,
1010,
2897,
17762,
1998,
1041,
1011,
5653,
2208,
15380,
1999,
2568,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* file_wrappers.h
*
* $Id$
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef __FILE_H__
#define __FILE_H__
#include <glib.h>
#include <wtap.h>
#include <wsutil/file_util.h>
#include "ws_symbol_export.h"
extern FILE_T file_open(const char *path);
extern FILE_T file_fdopen(int fildes);
extern void file_set_random_access(FILE_T stream, gboolean random_flag, GPtrArray *seek);
WS_DLL_PUBLIC gint64 file_seek(FILE_T stream, gint64 offset, int whence, int *err);
extern gboolean file_skip(FILE_T file, gint64 delta, int *err);
WS_DLL_PUBLIC gint64 file_tell(FILE_T stream);
extern gint64 file_tell_raw(FILE_T stream);
extern int file_fstat(FILE_T stream, ws_statb64 *statb, int *err);
extern gboolean file_iscompressed(FILE_T stream);
WS_DLL_PUBLIC int file_read(void *buf, unsigned int count, FILE_T file);
WS_DLL_PUBLIC int file_getc(FILE_T stream);
WS_DLL_PUBLIC char *file_gets(char *buf, int len, FILE_T stream);
WS_DLL_PUBLIC int file_eof(FILE_T stream);
WS_DLL_PUBLIC int file_error(FILE_T fh, gchar **err_info);
extern void file_clearerr(FILE_T stream);
extern void file_fdclose(FILE_T file);
extern int file_fdreopen(FILE_T file, const char *path);
extern void file_close(FILE_T file);
#ifdef HAVE_LIBZ
typedef struct wtap_writer *GZWFILE_T;
extern GZWFILE_T gzwfile_open(const char *path);
extern GZWFILE_T gzwfile_fdopen(int fd);
extern guint gzwfile_write(GZWFILE_T state, const void *buf, guint len);
extern int gzwfile_flush(GZWFILE_T state);
extern int gzwfile_close(GZWFILE_T state);
extern int gzwfile_geterr(GZWFILE_T state);
#endif /* HAVE_LIBZ */
#endif /* __FILE_H__ */
| slowfranklin/wireshark | wiretap/file_wrappers.h | C | gpl-2.0 | 2,364 | [
30522,
1013,
1008,
5371,
1035,
10236,
7347,
1012,
1044,
1008,
30524,
2009,
1998,
1013,
2030,
1008,
19933,
2009,
2104,
1996,
3408,
1997,
1996,
27004,
2236,
2270,
6105,
1008,
2004,
2405,
2011,
1996,
2489,
4007,
3192,
1025,
2593,
2544,
1016,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
declare(strict_types = 1);
namespace ctr;
use sys\Ctr;
class middle extends Ctr {
public function _load() {
if (PATH !== 'test/middle') {
return true;
}
return '_action: ' . $this->_action . '<br><br>In fact, the middle method does not exist in the test controller, which uses Mutton\'s middle structure to preprocess requests.';
}
}
| yunbookf/Chameleon | ctr/middle.php | PHP | apache-2.0 | 390 | [
30522,
1026,
1029,
25718,
13520,
1006,
9384,
1035,
4127,
1027,
1015,
1007,
1025,
3415,
15327,
14931,
2099,
1025,
2224,
25353,
2015,
1032,
14931,
2099,
1025,
2465,
2690,
8908,
14931,
2099,
1063,
2270,
3853,
1035,
7170,
1006,
1007,
1063,
2065... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
class AddTollTo<%= table_name.camelize %> < ActiveRecord::Migration
def self.up
change_table(:<%= table_name %>) do |t|
<%= migration_data -%>
<% attributes.each do |attribute| -%>
t.<%= attribute.type %> :<%= attribute.name %>
<% end -%>
# Uncomment below if timestamps were not included in your original model.
# t.timestamps
end
end
def self.down
# By default, we don't want to make any assumption about how to roll back a migration when your
# model already existed. Please edit below which fields you would like to remove in this migration.
raise ActiveRecord::IrreversibleMigration
end
end
| IcaliaLabs/toll | lib/generators/active_record/templates/existing_migration.rb | Ruby | mit | 664 | [
30522,
2465,
5587,
3406,
3363,
3406,
1026,
1003,
1027,
2795,
1035,
2171,
1012,
19130,
4697,
1003,
1028,
1026,
3161,
2890,
27108,
2094,
1024,
1024,
9230,
13366,
2969,
1012,
2039,
2689,
1035,
2795,
1006,
1024,
1026,
1003,
1027,
2795,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<footer id="footer" role="contentinfo">
<a href="#" class="gotop js-gotop"><i class="icon-arrow-up2"></i></a>
<div class="container">
<div class="">
<div class="col-md-12 text-center">
<p>{{ with .Site.Params.footer.copyright }}{{ . | markdownify }}{{ end }}</p>
</div>
</div>
<div class="row">
<div class="col-md-12 text-center">
<ul class="social social-circle">
{{ range .Site.Params.footer.links }}
<li><a href="{{ with index . 1}}{{ . }}{{ end }}"><i class="{{ with index . 0}}{{ . }}{{ end }}"></i></a></li>
{{ end }}
</ul>
</div>
</div>
</div>
</footer>
| saey55/hugo-elate-theme | layouts/partials/footer.html | HTML | mit | 647 | [
30522,
1026,
3329,
2121,
8909,
1027,
1000,
3329,
2121,
1000,
2535,
1027,
1000,
4180,
2378,
14876,
1000,
1028,
1026,
1037,
17850,
12879,
1027,
1000,
1001,
1000,
2465,
1027,
1000,
2288,
7361,
1046,
2015,
1011,
2288,
7361,
1000,
1028,
1026,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
namespace RubenVerweij\PHPShuntingMathParser {
/**
* Class Parenthesis
* @package PHPShuntingMathParser
*/
class Parenthesis extends Operator
{
/**
*
*/
const LEFT_PARENTHESIS = '(';
/**
*
*/
const RIGHT_PARENTHESIS = ')';
/**
* @return bool
*/
public function isLeftParenthesis(){
return $this->getRawInput() == self::LEFT_PARENTHESIS;
}
/**
* @return bool
*/
public function isRightParenthesis(){
return $this->getRawInput() == self::RIGHT_PARENTHESIS;
}
/**
* @return bool
*/
public function isOperator(){
return false;
}
}
} | rbnvrw/PHPShuntingMathParser | lib/RubenVerweij/PHPShuntingMathParser/Parenthesis.php | PHP | mit | 803 | [
30522,
1026,
1029,
25718,
3415,
15327,
19469,
6299,
19845,
3501,
1032,
25718,
14235,
24360,
18900,
22269,
11650,
2121,
1063,
1013,
1008,
1008,
1008,
2465,
6687,
24124,
1008,
1030,
7427,
25718,
14235,
24360,
18900,
22269,
11650,
2121,
1008,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
@import url('../../../assets/css/app.css');
@font-face {
font-family: 'Muli';
font-style: normal;
font-weight: 400;
src: local('Muli'), url(../fonts/Muli.woff) format('woff');
}
body {
background-color: #e7a279;
color: #434343;
font-family: 'Muli', sans-serif;
font-size: 14px;
max-width: 800px;
padding-bottom: 20px;
}
q,blockquote {
font-family: 'Muli', sans-serif;
}
a {
color: #cf7c4b;
text-decoration: underline;
}
a:hover {
color: #cf7c4b;
text-decoration: none;
}
a:visited {
color: #cf7c4b;
text-decoration: line-through;
}
h1, h2, h3 {
color: #9b6d51;
margin: 0;
}
h3 {
margin-top: 5px;
margin-bottom: 5px;
}
header {
margin: 0;
padding-top: 10px;
padding-bottom: 10px;
border-left: 1px solid #9b6d51;
border-right: 1px solid #9b6d51;
border-bottom: 1px solid #9b6d51;
background: #434343;
}
.logo {
color: #CCC;
}
a.logo {
margin-left: 8px;
}
a.logo:hover {
color: #000;
}
header li a {
color: #CCC;
text-decoration: none;
padding-top: 3px;
padding-left: 9px;
padding-right: 9px;
padding-bottom: 3px;
}
header li a:hover {
color: #cf7c4b;
text-decoration: underline;
}
header li {
padding-left: 0;
}
nav .active a {
border: 1px solid #9b6d51;
-moz-border-radius: 8px;
border-radius: 8px;
background-color: #e7a279;
margin-left: 6px;
margin-right: 6px;
font-weight: normal;
}
section.page {
background-color: #FFF;
border-left: 1px solid #CCC;
border-right: 1px solid #CCC;
border-bottom: 1px solid #CCC;
border-radius: 0px 0px 8px 8px;
padding-bottom: 5px;
padding-top: 15px;
}
.page-header {
margin-bottom: 15px;
}
.page-header ul {
margin-right: 5px;
}
.page-header li {
margin: 0;
padding: 0;
padding-right: 5px;
}
.page-header h2, .page-section h2 {
border-bottom: 1px dotted #CCC;
font-family: 'Muli', sans-serif;
font-size: 20px;
font-weight: normal;
margin: 0;
padding: 6px 10px;
}
.items article {
border: none;
border-bottom: 1px dotted #CCC;
background-color: inherit;
margin-bottom: 0;
padding-bottom: 10px;
}
.items #current-item {
border: #9b6d51;
}
.items article:last-child {
border-bottom: none;
padding-bottom: 0;
}
.items a:hover {
color: #cf7c4b;
}
#items-paging {
margin-top: 10px;
font-size: 100%;
}
.items .preview {
font-family: 'Muli', sans-serif;
}
form {
border: none;
padding-left: 10px;
}
.form-actions {
margin-top: 20px;
}
input[type='email'],
input[type='tel'],
input[type='password'],
input[type='text'],
textarea,
select {
-webkit-border-radius: 4px;
border-radius: 4px;
border: 1px solid #CCC;
margin-top: 3px;
padding: 5px;
font-family: 'Muli', sans-serif;
font-size: 15px;
}
input[type='email']:focus,
input[type='tel']:focus,
input[type='password']:focus,
input[type='text']:focus,
textarea:focus {
border: 1px solid #cf7c4b;
box-shadow: none;
}
/* alerts */
.alert {
padding: 8px 35px 8px 14px;
margin-left: 10px;
margin-right: 10px;
margin-bottom: 10px;
color: #cf7c4b;
background-color: #434343;
border: 1px solid #cf7c4b;
border-radius: 4px;
}
.alert-success {
color: #cf7c4b;
background-color: #434343;
border-color: #cf7c4b;
}
.alert-error {
color: #cf7c4b;
background-color: #434343;
border-color: #cf7c4b;
}
.alert-info {
color: #cf7c4b;
background-color: #434343;
border-color: #cf7c4b;
}
.alert-normal {
color: #cf7c4b;
background-color: #434343;
border-color: #cf7c4b;
}
/* buttons */
.btn {
-webkit-appearance: none;
appearance: none;
display: inline-block;
color: #cf7c4b;
border: 1px solid #cf7c4b;
background: #434343;
padding: 5px;
padding-left: 15px;
padding-right: 15px;
font-size: 90%;
cursor: pointer;
border-radius: 2px;
}
a.btn {
text-decoration: none;
font-weight: bold;
}
.btn-red {
border-color: #cf7c4b;
background: #434343;
color: #cf7c4b;
}
a.btn-red:hover,
.btn-red:hover,
.btn-red:focus {
color: #cf7c4b;
background: #e7a279;
}
.btn-blue {
border-color: #cf7c4b;
background: #434343;
color: #cf7c4b;
}
.btn-blue:hover,
.btn-blue:focus {
border-color: #cf7c4b;
background: #e7a279;
}
.item {
padding-bottom: 0;
font-family: 'Muli', sans-serif;
}
.item nav span, .item nav a, .item nav a:visited {
color: #cf7c4b;
}
.item nav.top {
margin-bottom: 20px;
}
#login {
border-radius: 8px;
}
@media only screen and (max-width: 480px) {
body {
border-left: 1px solid #CCC;
border-right: 1px solid #CCC;
padding-bottom: 0;
}
#login-page {
border: none;
}
header {
padding: 0;
border: none;
}
header li {
background-color: #FFF;
}
section.page {
border: none;
border-radius: 0;
}
.item {
padding-bottom: 0;
font-family: 'Muli', sans-serif;
}
} | mat-mo/miniflux_ynh | sources/themes/copper/css/app.css | CSS | apache-2.0 | 5,154 | [
30522,
1030,
12324,
24471,
2140,
1006,
1005,
1012,
1012,
1013,
1012,
1012,
1013,
1012,
1012,
1013,
7045,
1013,
20116,
2015,
1013,
10439,
1012,
20116,
2015,
1005,
1007,
1025,
1030,
15489,
1011,
2227,
1063,
15489,
1011,
2155,
1024,
1005,
1416... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#!/bin/bash
### Variables in the data table are already mean centered
cd /data/sanDiego/rsfcGraphAnalysis/data//Group.results
3dMVM \
-prefix restingstate.Attempter.and.Non-attempter.L_BLA.weight.3mm.3dmvm.bucket.20150825-1449PDT -mask mask.grey.Attempter.and.Non-attempter.union.masked+tlrc.HEAD \
-jobs 8 \
-ranEff '~1' \
-SS_type 3 \
-qVars 'Full' \
-bsVars 'Group' \
-wsVars 'Gender,age.in.years' \
-num_glt <n> \
-gltLabel 1 '< add GLT here>' \
-gltLabel 2 '< add GLT here>' \
-dataTable @/data/sanDiego/rsfcGraphAnalysis/data//Group.data/dataTable.Attempter.and.Non-attempter.L_BLA.weight.3mm.txt
| colmconn/rsfcGraphAnalysis | 07-3dmvm.withCovariates.Attempter.and.Non-attempter.L_BLA.weight.3mm.sh | Shell | gpl-2.0 | 672 | [
30522,
1001,
999,
1013,
8026,
1013,
24234,
1001,
1001,
1001,
10857,
1999,
1996,
2951,
2795,
2024,
2525,
2812,
8857,
3729,
1013,
2951,
1013,
5472,
28872,
2080,
1013,
12667,
11329,
14413,
25902,
1013,
2951,
1013,
1013,
2177,
1012,
3463,
7605,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
"use strict";
/**
* Copyright 2017 Google 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.
*/
Object.defineProperty(exports, "__esModule", { value: true });
var util_1 = require("./util/util");
/**
* Abstraction around FirebaseApp's token fetching capabilities.
*/
var AuthTokenProvider = /** @class */ (function () {
/**
* @param {!FirebaseApp} app_
*/
function AuthTokenProvider(app_) {
this.app_ = app_;
}
/**
* @param {boolean} forceRefresh
* @return {!Promise<FirebaseAuthTokenData>}
*/
AuthTokenProvider.prototype.getToken = function (forceRefresh) {
return this.app_['INTERNAL']['getToken'](forceRefresh).then(null,
// .catch
function (error) {
// TODO: Need to figure out all the cases this is raised and whether
// this makes sense.
if (error && error.code === 'auth/token-not-initialized') {
util_1.log('Got auth/token-not-initialized error. Treating as null token.');
return null;
}
else {
return Promise.reject(error);
}
});
};
AuthTokenProvider.prototype.addTokenChangeListener = function (listener) {
// TODO: We might want to wrap the listener and call it with no args to
// avoid a leaky abstraction, but that makes removing the listener harder.
this.app_['INTERNAL']['addAuthTokenListener'](listener);
};
AuthTokenProvider.prototype.removeTokenChangeListener = function (listener) {
this.app_['INTERNAL']['removeAuthTokenListener'](listener);
};
AuthTokenProvider.prototype.notifyForInvalidToken = function () {
var errorMessage = 'Provided authentication credentials for the app named "' +
this.app_.name +
'" are invalid. This usually indicates your app was not ' +
'initialized correctly. ';
if ('credential' in this.app_.options) {
errorMessage +=
'Make sure the "credential" property provided to initializeApp() ' +
'is authorized to access the specified "databaseURL" and is from the correct ' +
'project.';
}
else if ('serviceAccount' in this.app_.options) {
errorMessage +=
'Make sure the "serviceAccount" property provided to initializeApp() ' +
'is authorized to access the specified "databaseURL" and is from the correct ' +
'project.';
}
else {
errorMessage +=
'Make sure the "apiKey" and "databaseURL" properties provided to ' +
'initializeApp() match the values provided for your app at ' +
'https://console.firebase.google.com/.';
}
util_1.warn(errorMessage);
};
return AuthTokenProvider;
}());
exports.AuthTokenProvider = AuthTokenProvider;
//# sourceMappingURL=AuthTokenProvider.js.map
| aggiedefenders/aggiedefenders.github.io | node_modules/@firebase/database/dist/cjs/src/core/AuthTokenProvider.js | JavaScript | mit | 3,512 | [
30522,
1000,
2224,
9384,
1000,
1025,
1013,
1008,
1008,
1008,
9385,
2418,
8224,
4297,
1012,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1008,
2017,
2089,
2025,
2224,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
from src.interfacing.ogs.connect import Authentication
import codecs
import sys
import os
from time import sleep
def loadList(pNameFile):
iList = []
with codecs.open(pNameFile, "r", "utf-8") as f:
for line in f:
iList.append(line)
return iList
if __name__ == "__main__":
a = Authentication("Kuksu League", "", testing=False);
iGroupNames = loadList("E:/Project/OGS/OGS-League/group_names.txt");
iGroupIDs = loadList("E:/Project/OGS/OGS-League/group_ids.txt");
nGroups = len(iGroupNames);
for i in range(nGroups):
iGroupNames[i] = iGroupNames[i].replace("\r\n", "");
iGroupNames[i] = iGroupNames[i].replace("\n", "");
iGroupIDs[i] = iGroupIDs[i].replace("\r\n", "");
iGroupIDs[i] = iGroupIDs[i].replace("\n", "");
iGroupIDs[i] = int(iGroupIDs[i]);
iDescription = """
Kuksu Main Title Tournament 9th Cycle Group %s
Title Holder: <a href='https://online-go.com/user/view/35184/vitality'>vitality (5d)</a>
Previous cycles:
<table style="text-align:center;" border='2'>
<tr><th rowspan=2>Cycle</th><td colspan=3><b>Title Match</b></td><td colspan=3><b>Title Tournament</b></td></tr>
<tr>
<th>Winner</th><th>Score</th><th>Runner-up</th>
<th>Winner<img src='https://a00ce0086bda2213e89f-570db0116da8eb5fdc3ce95006e46d28.ssl.cf1.rackcdn.com/4.2/img/trophies/gold_title_19.png' alt='Gold'></img></th>
<th>Runner-up<img src='https://a00ce0086bda2213e89f-570db0116da8eb5fdc3ce95006e46d28.ssl.cf1.rackcdn.com/4.2/img/trophies/silver_title_19.png' alt='Silver'></img></th>
<th>3rd Place<img src='https://a00ce0086bda2213e89f-570db0116da8eb5fdc3ce95006e46d28.ssl.cf1.rackcdn.com/4.2/img/trophies/bronze_title_19.png' alt='Bronze'></img></th>
</tr>
<tr>
<td><a href='https://online-go.com/tournament/2375'>1</a></td>
<td><b>luke</b></td><td></td><td></td>
<td><b>luke (2d)</b></td><td>davos</td><td>gomad361</td>
</tr>
<tr>
<td><a href='https://online-go.com/tournament/2384'>2</a></td>
<td><b>gomad361</b></td><td>3-2</td><td>luke</td>
<td><b>luke (2d)</b></td><td>gomad361</td><td>hotspur</td>
</tr>
<tr>
<td><a href='https://online-go.com/tournament/2391'>3</a></td>
<td><b>Uberdude</b></td><td>∗</td><td>gomad361</td>
<td><b>Uberdude (6d)</b></td><td>KyuT</td><td>marigo</td>
</tr>
<tr>
<td><a href='https://online-go.com/tournament/2406'>4</a></td>
<td><b>Uberdude</b></td><td>5-0</td><td>KyuT</td>
<td><b>KyuT (4d)</b></td><td>quiller</td><td>morituri</td>
</tr>
<tr>
<td><a href='https://online-go.com/tournament/2424'>5</a></td>
<td><b>Uberdude</b></td><td>5-0</td><td>gomad361</td>
<td><b>gomad361 (2d)</b></td><td>morituri</td><td>betterlife</td>
</tr>
<tr>
<td><a href='https://online-go.com/tournament/2439'>6</a></td>
<td><b>Uberdude</b></td><td>5-0</td><td>Elin</td>
<td><b>Elin (3d)</b></td><td>gomad361</td><td>morituri</td>
</tr>
<tr>
<td><a href='https://online-go.com/tournament/2460'>7</a></td>
<td><b>Uberdude</b></td><td>3-2</td><td>vitality</td>
<td><b>vitality (5d)</b></td><td>Elin</td><td>gomad361</td>
</tr>
<tr>
<td><a href='https://online-go.com/tournament/2475'>8</a></td>
<td><b>vitality</b></td><td>∗</td><td>Uberdude</td>
<td><b>vitality (5d)</b></td><td>nrx</td><td>gojohn</td>
</tr>
<tr>
<td rowspan=5><a href='#'>9</a></td>
<td rowspan=5 colspan=3></td>
<td colspan=3>
<a href='https://online-go.com/tournament/12653'>[A]</a>
</td>
</tr>
<tr>
<td colspan=3>
<a href='https://online-go.com/tournament/12654'>[B1]</a>
<a href='https://online-go.com/tournament/12655'>[B2]</a>
</td>
</tr>
<tr>
<td colspan=3>
<a href='https://online-go.com/tournament/12656'>[C1]</a>
<a href='https://online-go.com/tournament/12657'>[C2]</a>
<a href='https://online-go.com/tournament/12658'>[C3]</a>
<a href='https://online-go.com/tournament/12659'>[C4]</a>
</td>
</tr>
<tr>
<td colspan=3>
<a href='https://online-go.com/tournament/12660'>[D1]</a>
<a href='https://online-go.com/tournament/12661'>[D2]</a>
<a href='https://online-go.com/tournament/12662'>[D3]</a>
<a href='https://online-go.com/tournament/12663'>[D4]</a>
<a href='https://online-go.com/tournament/12664'>[D5]</a>
<a href='https://online-go.com/tournament/12665'>[D6]</a>
<a href='https://online-go.com/tournament/12666'>[D7]</a>
<a href='https://online-go.com/tournament/12667'>[D8]</a>
</td>
</tr>
<tr>
<td colspan=3>
<a href='https://online-go.com/tournament/12668'>[E1]</a>
<a href='https://online-go.com/tournament/12669'>[E2]</a>
<a href='https://online-go.com/tournament/12670'>[E3]</a>
<a href='https://online-go.com/tournament/12671'>[E4]</a>
<a href='https://online-go.com/tournament/12672'>[E5]</a>
<a href='https://online-go.com/tournament/12673'>[E6]</a>
</td>
</tr>
</table>
∗ means the games were finished by timeout or retiring.
Rules could be found <a href='https://forums.online-go.com/t/league-format-kuksu-title-tournament-rules-and-discussion/5191'>here</a>.
""" % iGroupNames[i];
a.put(['tournaments', iGroupIDs[i]], {"description": iDescription
});
print("Tournament %s with id %d updated.\n" % (iGroupNames[i], iGroupIDs[i]));
sleep(2);
# tourney id 7370
"""
iTournament = a.post(['tournaments'],{
"id":12650,
"name":"Test Tournament 2",
"group":515,
"tournament_type":"roundrobin",
"description":"<b>Test 3</b>",
"board_size":19,
"handicap":0, #default -1 for auto
"time_start": "2015-12-01T00:00:00Z",
"time_control_parameters":{
"time_control":"fischer",
"initial_time":604800,
"max_time":604800,
"time_increment":86400
},
"rules": "korean",
"exclusivity": "invite", # open, group. default
"exclude_provisional": False, # default
"auto_start_on_max": True, # default
"analysis_enabled": True, #default
"settings":{
"maximum_players":10,
},
"players_start": 6, #default
"first_pairing_method": "slide", #slaughter, random, slide, strength . default
"subsequent_pairing_method": "slide", # default
"min_ranking":0,
"max_ranking":36
});
#print("Hello");
print(iTournament["id"]);
"""
#print "Tournament %s is created." % iTournament["id"];
# r= a.post (['tournaments', 12642, 'players'], app_param= {"player_id":40318} )
# print (r)
| juanchodepisa/sbtk | SBTK_League_Helper/update_tournaments.py | Python | mit | 6,552 | [
30522,
2013,
5034,
2278,
1012,
6970,
7011,
6129,
1012,
13958,
2015,
1012,
7532,
12324,
27280,
12324,
3642,
6169,
12324,
25353,
2015,
12324,
9808,
2013,
2051,
12324,
3637,
13366,
7170,
9863,
1006,
1052,
18442,
8873,
2571,
1007,
1024,
6335,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/*
Template Name: Page - Contact Us
*/
?>
<?php
if($_POST)
{
if($_POST['your-email'])
{
$toEmailName = get_option('blogname');
$toEmail = get_site_emailId();
$subject = $_POST['your-subject'];
$message = '';
$message .= '<p>Dear '.$toEmailName.',</p>';
$message .= '<p>Name : '.$_POST['your-name'].',</p>';
$message .= '<p>Email : '.$_POST['your-email'].',</p>';
$message .= '<p>Message : '.nl2br($_POST['your-message']).'</p>';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
// Additional headers
$headers .= 'To: '.$toEmailName.' <'.$toEmail.'>' . "\r\n";
$headers .= 'From: '.$_POST['your-name'].' <'.$_POST['your-email'].'>' . "\r\n";
// Mail it
wp_mail($toEmail, $subject, $message, $headers);
if(strstr($_REQUEST['request_url'],'?'))
{
$url = $_REQUEST['request_url'].'&msg=success' ;
}else
{
$url = $_REQUEST['request_url'].'?msg=success' ;
}
echo "<script type='text/javascript'>location.href='".$url."';</script>";
}
}
?>
<?php get_header(); ?>
<div class="<?php templ_content_css();?>" >
<div class="content_top"></div>
<div class="content_bg">
<!-- CONTENT AREA START -->
<?php if (function_exists('dynamic_sidebar')){ dynamic_sidebar('page_content_above'); }?>
<!-- contact -->
<?php global $is_home; ?>
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<div class="entry">
<div <?php post_class('single clear'); ?> id="post_<?php the_ID(); ?>">
<div class="post-meta">
<?php templ_page_title_above(); //page title above action hook?>
<?php echo templ_page_title_filter(get_the_title()); //page tilte filter?>
<?php templ_page_title_below(); //page title below action hook?>
</div>
<div class="post-content">
<?php the_content(); ?>
</div>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
<?php
if($_REQUEST['msg'] == 'success')
{
?>
<p class="success_msg">
<?php _e('Your message is sent successfully.','templatic');?>
</p>
<?php
}
?>
<form action="<?php echo get_permalink($post->ID);?>" method="post" id="contact_frm" name="contact_frm" class="wpcf7-form">
<input type="hidden" name="request_url" value="<?php echo $_SERVER['REQUEST_URI'];?>" />
<div class="form_row ">
<label>
<?php _e('Name','templatic');?>
<span class="indicates">*</span></label>
<input type="text" name="your-name" id="your-name" value="" class="textfield" size="40" />
<span id="your_name_Info" class="error"></span> </div>
<div class="form_row ">
<label>
<?php _e('Email','templatic');?>
<span class="indicates">*</span></label>
<input type="text" name="your-email" id="your-email" value="" class="textfield" size="40" />
<span id="your_emailInfo" class="error"></span> </div>
<div class="form_row ">
<label>
<?php _e('Subject','templatic');?>
<span class="indicates">*</span></label>
<input type="text" name="your-subject" id="your-subject" value="" size="40" class="textfield" />
<span id="your_subjectInfo"></span> </div>
<div class="form_row">
<label>
<?php _e('Message','templatic');?>
<span class="indicates">*</span></label>
<textarea name="your-message" id="your-message" cols="40" class="textarea textarea2" rows="10"></textarea>
<span id="your_messageInfo" class="error"></span> </div>
<input type="submit" value="Send" class="b_submit" />
</form>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/contact_us_validation.js"></script>
</div> <!-- content bg #end -->
<div class="content_bottom"></div>
</div> <!-- content end -->
<?php get_sidebar(); ?>
<?php get_footer(); ?> | vapvarun/MicrocerptBIZ | wp-content/plugins/PlusOnett/tpl_contact.php | PHP | gpl-2.0 | 3,853 | [
30522,
1026,
1029,
25718,
1013,
1008,
23561,
2171,
1024,
3931,
1011,
3967,
2149,
1008,
1013,
1029,
1028,
1026,
1029,
25718,
2065,
1006,
1002,
1035,
2695,
1007,
1063,
2065,
1006,
1002,
1035,
2695,
1031,
1005,
2115,
1011,
10373,
1005,
1033,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
//===- RegionPass.cpp - Region Pass and Region Pass Manager ---------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file implements RegionPass and RGPassManager. All region optimization
// and transformation passes are derived from RegionPass. RGPassManager is
// responsible for managing RegionPasses.
// Most of this code has been COPIED from LoopPass.cpp
//
//===----------------------------------------------------------------------===//
#include "llvm/Analysis/RegionPass.h"
#include "llvm/Analysis/RegionIterator.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Timer.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
#define DEBUG_TYPE "regionpassmgr"
//===----------------------------------------------------------------------===//
// RGPassManager
//
char RGPassManager::ID = 0;
RGPassManager::RGPassManager()
: FunctionPass(ID), PMDataManager() {
skipThisRegion = false;
redoThisRegion = false;
RI = nullptr;
CurrentRegion = nullptr;
}
// Recurse through all subregions and all regions into RQ.
static void addRegionIntoQueue(Region &R, std::deque<Region *> &RQ) {
RQ.push_back(&R);
for (const auto &E : R)
addRegionIntoQueue(*E, RQ);
}
/// Pass Manager itself does not invalidate any analysis info.
void RGPassManager::getAnalysisUsage(AnalysisUsage &Info) const {
Info.addRequired<RegionInfoPass>();
Info.setPreservesAll();
}
/// run - Execute all of the passes scheduled for execution. Keep track of
/// whether any of the passes modifies the function, and if so, return true.
bool RGPassManager::runOnFunction(Function &F) {
RI = &getAnalysis<RegionInfoPass>().getRegionInfo();
bool Changed = false;
// Collect inherited analysis from Module level pass manager.
populateInheritedAnalysis(TPM->activeStack);
addRegionIntoQueue(*RI->getTopLevelRegion(), RQ);
if (RQ.empty()) // No regions, skip calling finalizers
return false;
// Initialization
for (Region *R : RQ) {
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
RegionPass *RP = (RegionPass *)getContainedPass(Index);
Changed |= RP->doInitialization(R, *this);
}
}
// Walk Regions
while (!RQ.empty()) {
CurrentRegion = RQ.back();
skipThisRegion = false;
redoThisRegion = false;
// Run all passes on the current Region.
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
RegionPass *P = (RegionPass*)getContainedPass(Index);
if (isPassDebuggingExecutionsOrMore()) {
dumpPassInfo(P, EXECUTION_MSG, ON_REGION_MSG,
CurrentRegion->getNameStr());
dumpRequiredSet(P);
}
initializeAnalysisImpl(P);
{
PassManagerPrettyStackEntry X(P, *CurrentRegion->getEntry());
TimeRegion PassTimer(getPassTimer(P));
Changed |= P->runOnRegion(CurrentRegion, *this);
}
if (isPassDebuggingExecutionsOrMore()) {
if (Changed)
dumpPassInfo(P, MODIFICATION_MSG, ON_REGION_MSG,
skipThisRegion ? "<deleted>" :
CurrentRegion->getNameStr());
dumpPreservedSet(P);
}
if (!skipThisRegion) {
// Manually check that this region is still healthy. This is done
// instead of relying on RegionInfo::verifyRegion since RegionInfo
// is a function pass and it's really expensive to verify every
// Region in the function every time. That level of checking can be
// enabled with the -verify-region-info option.
{
TimeRegion PassTimer(getPassTimer(P));
CurrentRegion->verifyRegion();
}
// Then call the regular verifyAnalysis functions.
verifyPreservedAnalysis(P);
}
removeNotPreservedAnalysis(P);
recordAvailableAnalysis(P);
removeDeadPasses(P,
(!isPassDebuggingExecutionsOrMore() || skipThisRegion) ?
"<deleted>" : CurrentRegion->getNameStr(),
ON_REGION_MSG);
if (skipThisRegion)
// Do not run other passes on this region.
break;
}
// If the region was deleted, release all the region passes. This frees up
// some memory, and avoids trouble with the pass manager trying to call
// verifyAnalysis on them.
if (skipThisRegion)
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
Pass *P = getContainedPass(Index);
freePass(P, "<deleted>", ON_REGION_MSG);
}
// Pop the region from queue after running all passes.
RQ.pop_back();
if (redoThisRegion)
RQ.push_back(CurrentRegion);
// Free all region nodes created in region passes.
RI->clearNodeCache();
}
// Finalization
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
RegionPass *P = (RegionPass*)getContainedPass(Index);
Changed |= P->doFinalization();
}
// Print the region tree after all pass.
DEBUG(
dbgs() << "\nRegion tree of function " << F.getName()
<< " after all region Pass:\n";
RI->dump();
dbgs() << "\n";
);
return Changed;
}
/// Print passes managed by this manager
void RGPassManager::dumpPassStructure(unsigned Offset) {
errs().indent(Offset*2) << "Region Pass Manager\n";
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
Pass *P = getContainedPass(Index);
P->dumpPassStructure(Offset + 1);
dumpLastUses(P, Offset+1);
}
}
namespace {
//===----------------------------------------------------------------------===//
// PrintRegionPass
class PrintRegionPass : public RegionPass {
private:
std::string Banner;
raw_ostream &Out; // raw_ostream to print on.
public:
static char ID;
PrintRegionPass(const std::string &B, raw_ostream &o)
: RegionPass(ID), Banner(B), Out(o) {}
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
}
bool runOnRegion(Region *R, RGPassManager &RGM) override {
Out << Banner;
for (const auto *BB : R->blocks()) {
if (BB)
BB->print(Out);
else
Out << "Printing <null> Block";
}
return false;
}
};
char PrintRegionPass::ID = 0;
} //end anonymous namespace
//===----------------------------------------------------------------------===//
// RegionPass
// Check if this pass is suitable for the current RGPassManager, if
// available. This pass P is not suitable for a RGPassManager if P
// is not preserving higher level analysis info used by other
// RGPassManager passes. In such case, pop RGPassManager from the
// stack. This will force assignPassManager() to create new
// LPPassManger as expected.
void RegionPass::preparePassManager(PMStack &PMS) {
// Find RGPassManager
while (!PMS.empty() &&
PMS.top()->getPassManagerType() > PMT_RegionPassManager)
PMS.pop();
// If this pass is destroying high level information that is used
// by other passes that are managed by LPM then do not insert
// this pass in current LPM. Use new RGPassManager.
if (PMS.top()->getPassManagerType() == PMT_RegionPassManager &&
!PMS.top()->preserveHigherLevelAnalysis(this))
PMS.pop();
}
/// Assign pass manager to manage this pass.
void RegionPass::assignPassManager(PMStack &PMS,
PassManagerType PreferredType) {
// Find RGPassManager
while (!PMS.empty() &&
PMS.top()->getPassManagerType() > PMT_RegionPassManager)
PMS.pop();
RGPassManager *RGPM;
// Create new Region Pass Manager if it does not exist.
if (PMS.top()->getPassManagerType() == PMT_RegionPassManager)
RGPM = (RGPassManager*)PMS.top();
else {
assert (!PMS.empty() && "Unable to create Region Pass Manager");
PMDataManager *PMD = PMS.top();
// [1] Create new Region Pass Manager
RGPM = new RGPassManager();
RGPM->populateInheritedAnalysis(PMS);
// [2] Set up new manager's top level manager
PMTopLevelManager *TPM = PMD->getTopLevelManager();
TPM->addIndirectPassManager(RGPM);
// [3] Assign manager to manage this new manager. This may create
// and push new managers into PMS
TPM->schedulePass(RGPM);
// [4] Push new manager into PMS
PMS.push(RGPM);
}
RGPM->add(this);
}
/// Get the printer pass
Pass *RegionPass::createPrinterPass(raw_ostream &O,
const std::string &Banner) const {
return new PrintRegionPass(Banner, O);
}
| ensemblr/llvm-project-boilerplate | include/llvm/lib/Analysis/RegionPass.cpp | C++ | mit | 8,720 | [
30522,
1013,
1013,
1027,
1027,
1027,
1011,
2555,
15194,
1012,
18133,
2361,
1011,
2555,
3413,
1998,
2555,
3413,
3208,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1027,
1027,
1027,
1013,
1013,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>珠峰培训-DOM2事件</title>
<style type="text/css">
* {
margin: 0;
padding: 0;
}
#box {
margin: 20px auto;
width: 200px;
height: 200px;
background: #ff6600;
}
</style>
</head>
<body>
<div id="box"></div>
<script type="text/javascript" src="js/event.js"></script>
<script type="text/javascript">
var box = document.getElementById("box");
// var n = 0;
// function fn1() {
// n++;
// if (n >= 3) {
// unbind(box, "click", fn1);
// return;
// }
// console.log(1);
// }
//
// function fn2() {
// console.log(2, this === box);
// }
//box.attachEvent("onclick",fn1.call(box));//->在给box绑定事件的时候,首先执行fn1方法,让方法中的this变为box,然后把fn1执行的返回结果绑定给onclick
// box.attachEvent("onclick", function () {
// fn1.call(box);
// });
//->这样虽然解决了this的问题,但是又抛出了一个新的问题,不知道该如何删除了(我们不知道匿名函数是谁)
var tempFn=function(){
fn1.call(box);
};
box.attachEvent("onclick", tempFn);
box.detachEvent("onclick", tempFn);
bind(box, "click", fn1);
bind(box, "click", fn1);
bind(box, "click", fn1);
bind(box, "click", fn2);
// function fn1() {
// console.log(1);
// }
// function fn2() {
// console.log(2);
// }
// function fn3() {
// console.log(3);
// }
//
// var n = 0;
// function fn4() {
// console.log(4);
// n++;
// if (n === 2) {
// off(box, "click", fn1);
// off(box, "click", fn2);
// off(box, "click", fn3);
// off(box, "click", fn4);
// }
// }
// function fn5() {
// console.log(5);
// }
// function fn6() {
// console.log(6);
// }
// function fn7() {
// console.log(7);
// }
// function fn8() {
// console.log(8);
// }
// function fn9() {
// console.log(9);
// }
// function fn10() {
// console.log(10);
// }
// function fn11() {
// console.log(11);
// }
//
// function fn12() {
// console.log(12);
// }
//
// on(box, "click", fn1);
// on(box, "click", fn2);
// on(box, "click", fn3);
// on(box, "click", fn4);
// on(box, "click", fn5);
// on(box, "click", fn6);
// on(box, "click", fn7);
// on(box, "click", fn8);
// on(box, "click", fn9);
// on(box, "click", fn10);
// on(box, "click", fn11);
// on(box, "click", fn12);
// on(box, "click", fn12);
// on(box, "click", fn12);
// on(box, "click", fn12);
</script>
</body>
</html> | zouyang2015/node-test | Nodes201509_new/前五周/20160221_周末班第五周第二天/6、兼容解决.html | HTML | mit | 2,945 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
1028,
1026,
2132,
1028,
1026,
18804,
25869,
13462,
1027,
1000,
21183,
2546,
1011,
1022,
1000,
1028,
1026,
2516,
1028,
100,
100,
100,
100,
1011,
14383,
2475,
1751,
100,
1026,
1013,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
@*
* Copyright 2021 HM Revenue & Customs
*
* 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.
*@
@import iht.utils.tnrb.TnrbHelperFixture
@import iht.models.application.ApplicationDetails
@import iht.config.AppConfig
@import iht.utils._
@this(
implicit val appConfig: AppConfig,
ihtMainTemplateApplication: iht_main_template_application,
form: FormWithCSRF
)
@( kickoutReason: String,
applicationDetails: ApplicationDetails,
applicationLastSection: Option[String],
applicationLastID: Option[String],
summaryParameter1:String,
deceasedName: String)(implicit request:Request[_], messages: Messages)
@ihtMainTemplateApplication(title = Messages("iht.notPossibleToUseService"),
browserTitle = Some(Messages("iht.notPossibleToUseService"))) {
<div class="panel panel-border-wide">
@ApplicationKickOutSummaryHelper.summary.find( _._1 == kickoutReason).map{summary =>
<p id="kickout-message">
@TnrbHelperFixture().mutateContent(Messages(summary._2, summaryParameter1, deceasedName), messages.lang.code)
</p>}
@if(ApplicationKickOutSummaryHelper.summaryBullets(kickoutReason).nonEmpty) {
<ul class="bullets" id="summary-bullets">
@ApplicationKickOutSummaryHelper.summaryBullets(kickoutReason).map{txt=>
<li>@txt</li>
}
</ul>
}
</div>
@if(ApplicationKickOutHelper.shoulddisplayEstateValueAndThreshold(kickoutReason)){
<div class="alert alert--info alert--slim">
<div class="grid-layout">
<div class="grid-layout__column--3-4">@Messages("page.iht.application.overview.value")
</div>
<div class="grid-layout__column--1-4">
@if(applicationDetails.allAssets.isDefined || applicationDetails.allGifts.isDefined ||
applicationDetails.allLiabilities.isDefined || applicationDetails.propertyList.nonEmpty) {
@if(applicationDetails.allExemptions.isDefined && applicationDetails.totalExemptionsValue > 0) {
£@CommonHelper.numberWithCommas(if(applicationDetails.totalNetValue<0) 0 else applicationDetails.totalNetValue)
} else {
£@CommonHelper.numberWithCommas(applicationDetails.totalValue)
}
}
</div>
</div>
<div class="grid-layout">
<div class="grid-layout__column--3-4">@Messages("iht.estateReport.ihtThreshold")</div>
<div class="grid-layout__column--1-4">@Messages("site.threshold.value.display")</div>
</div>
</div>
}
<div class="subsection">
<h2 id="iht.nextSteps" class="heading-medium">@Messages("iht.nextSteps")</h2>
@AppKickoutFixture().nextSteps1.find( _._1 == kickoutReason).map{nextSteps1=><p>@nextSteps1._2</p>}
@AppKickoutFixture().nextSteps2.find( _._1 == kickoutReason).map{nextSteps2=><p>
@nextSteps2._2@Messages("iht.comma") @ApplicationKickOutHelper.returnLinkUrl( kickoutReason, applicationDetails.ihtRef.fold("")(identity), applicationLastSection, applicationLastID ).map{ url=>
<a id="back-button" href=@url>@AppKickoutFixture().nextSteps2ReturnLinkText.find( _._1 == kickoutReason).map{linkText => @linkText._2}</a>.
}</p>}
</div>
<div id="continue-button" class="form-field form-field--submit">
@form(action = iht.controllers.application.routes.KickoutAppController.onSubmit) {
<p><input id="finish" class='button' name="action" type='submit' value='@Messages("site.button.details.correct")'></p>
}
</div>
}
| hmrc/iht-frontend | app/iht/views/application/iht_kickout_application.scala.html | HTML | apache-2.0 | 4,185 | [
30522,
1030,
1008,
1008,
9385,
25682,
20287,
6599,
1004,
8205,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1008,
2017,
2089,
2025,
2224,
2023,
5371,
3272,
1999,
12646,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/**
* @file
* Address widget and GMap geocoder routines.
*/
/*global jQuery, Drupal, GClientGeocoder */
/**
* Provide a shared geocoder.
* Lazy initialize it so it's not resident until needed.
*/
Drupal.gmap.geocoder = function () {
var theGeocoder;
if (!theGeocoder) {
theGeocoder = new google.maps.Geocoder();
}
return theGeocoder;
};
Drupal.gmap.addHandler('gmap', function (elem) {
var obj = this;
obj.bind('geocode_pan', function (addr) {
Drupal.gmap.geocoder().geocode({'address': addr}, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
obj.vars.latitude = results[0].geometry.location.lat();
obj.vars.longitude = results[0].geometry.location.lng();
obj.change("move", -1);
}
else {
// Error condition?
}
});
});
obj.bind('geocode_panzoom', function (addr) {
Drupal.gmap.geocoder().geocode({'address': addr}, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var place = results[0];
obj.vars.latitude = results[0].geometry.location.lat();
obj.vars.longitude = results[0].geometry.location.lng();
// This is, of course, temporary.
switch (place.AddressDetails.Accuracy) {
case 1: // Country level
obj.vars.zoom = 4;
break;
case 2: // Region (state, province, prefecture, etc.) level
obj.vars.zoom = 6;
break;
case 3: // Sub-region (county, municipality, etc.) level
obj.vars.zoom = 8;
break;
case 4: // Town (city, village) level accuracy. (Since 2.59)
case 5: // Post code (zip code) level accuracy. (Since 2.59)
case 6: // Street level accuracy. (Since 2.59)
case 7: // Intersection level accuracy. (Since 2.59)
case 8: // Address level accuracy. (Since 2.59)
obj.vars.zoom = 12;
}
obj.change('move', -1);
}
});
});
obj.bind('preparemarker', function (marker) {
if (marker.address && (!marker.latitude || !marker.longitude)) {
Drupal.gmap.geocoder().geocode({'address': marker.address}, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
marker.latitude = results[0].geometry.lat();
marker.longitude = results[0].geometry.lng();
}
});
}
});
});
////////////////////////////////////////
// Address widget //
////////////////////////////////////////
Drupal.gmap.addHandler('address', function (elem) {
var obj = this;
// Respond to focus event.
jQuery(elem).focus(function () {
this.value = '';
});
// Respond to incoming movements.
// Clear the box when the coords change...
var binding = obj.bind("move", function () {
elem.value = 'Enter an address';
});
// Send out outgoing movements.
// This happens ASYNC!!!
jQuery(elem).change(function () {
if (elem.value.length > 0) {
Drupal.gmap.geocoder().geocode({'address': elem.value}, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
obj.vars.latitude = results[0].geometry.location.lat();
obj.vars.longitude = results[0].geometry.location.lng();
obj.change("move", binding);
}
else {
// Todo: Get translated value using settings.
elem.value = 'Geocoder error: Address not found';
}
});
}
else {
// Was empty. Ignore.
elem.value = 'Enter an address';
}
});
});
////////////////////////////////////////
// Locpick address handler (testing) //
////////////////////////////////////////
Drupal.gmap.addHandler('locpick_address', function (elem) {
var obj = this;
// Respond to focus event.
jQuery(elem).focus(function () {
this.value = '';
});
// Respond to incoming movements.
// Clear the box when the coords change...
var binding = obj.bind("locpickchange", function () {
elem.value = 'Enter an address';
});
// Send out outgoing movements.
// This happens ASYNC!!!
jQuery(elem).change(function () {
if (elem.value.length > 0) {
Drupal.gmap.geocoder().geocode({'address': elem.value}, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
obj.locpick_coord = results[0];
obj.change("locpickchange", binding);
}
else {
// Todo: Get translated value using settings.
elem.value = 'Geocoder error: Address not found';
}
});
}
else {
// Was empty. Ignore.
elem.value = 'Enter an address';
}
});
});
| BalloonIndustries/nufios | sites/all/modules/gmap/js/address.js | JavaScript | gpl-2.0 | 5,541 | [
30522,
1013,
1008,
1008,
1008,
1030,
5371,
1008,
4769,
15536,
24291,
1998,
20917,
2361,
20248,
16044,
2099,
23964,
1012,
1008,
1013,
1013,
1008,
3795,
1046,
4226,
2854,
1010,
2852,
6279,
2389,
1010,
1043,
20464,
11638,
3351,
24163,
4063,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
//-----------------------------------------------------------------------------
// Class: DummyAnimInstance
// Authors: Li, Xizhi
// Emails: LiXizhi@yeah.net
// Company: ParaEngine
// Date: 2014.9.21
//-----------------------------------------------------------------------------
#include "ParaEngine.h"
#include "ParaXModel/AnimTable.h"
#include "DummyAnimInstance.h"
/** @def default walking speed when no model is found. */
#define DEFAULT_WALK_SPEED 4.f
using namespace ParaEngine;
ParaEngine::CDummyAnimInstance::CDummyAnimInstance()
{
// since it is a singleton, we will never reference count it.
addref();
}
CDummyAnimInstance* ParaEngine::CDummyAnimInstance::GetInstance()
{
static CDummyAnimInstance s_instance;
return &s_instance;
}
void ParaEngine::CDummyAnimInstance::LoadAnimation(int nAnimID, float * fSpeed, bool bAppend /*= false*/)
{
if (fSpeed)
{
if (nAnimID == ANIM_STAND)
*fSpeed = 0.f;
else if (nAnimID == ANIM_WALK)
*fSpeed = DEFAULT_WALK_SPEED;
else if (nAnimID == ANIM_RUN)
*fSpeed = DEFAULT_WALK_SPEED*1.5f;
else if (nAnimID == ANIM_FLY)
*fSpeed = DEFAULT_WALK_SPEED*2.f;
else
*fSpeed = 0.f;
}
}
bool ParaEngine::CDummyAnimInstance::HasAnimId(int nAnimID)
{
return (nAnimID == ANIM_STAND || nAnimID == ANIM_WALK || nAnimID == ANIM_RUN || nAnimID == ANIM_FLY);
}
void ParaEngine::CDummyAnimInstance::GetSpeedOf(const char * sName, float * fSpeed)
{
int nAnimID = CAnimTable::GetAnimIDByName(sName);
if (fSpeed)
{
if (nAnimID == ANIM_STAND)
*fSpeed = 0.f;
else if (nAnimID == ANIM_WALK)
*fSpeed = DEFAULT_WALK_SPEED;
else if (nAnimID == ANIM_RUN)
*fSpeed = DEFAULT_WALK_SPEED*1.5f;
else if (nAnimID == ANIM_FLY)
*fSpeed = DEFAULT_WALK_SPEED*2.f;
else
*fSpeed = 0.f;
}
}
| hetter/NPLRuntime | Client/trunk/ParaEngineClient/3dengine/DummyAnimInstance.cpp | C++ | gpl-2.0 | 1,763 | [
30522,
1013,
1013,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
Theme Name: Fifteen
Theme URI: http://inkhive.com/product/fifteen/
Author: Rohit Tripathi
Author URI: http://inkhive.com/
Description: Fifteen is the Photography or Portfolio based WordPress theme, best suitable for Professional Artists. This theme is built on the HTML5 and CSS3 Framework, Bootstrap 3.0 From Twitter. With a Very Modern Design, this theme is 100% Responsive. 3 Column Grid Layout for Home and Archive Pages, make it look very stunning. It supports Featured images, Custom Widgets, Cool Animations, Full Width Pages and much more.
Version: 1.0.0.3
License: GNU General Public License
License URI: license.txt
Text Domain: fifteen
Domain Path: /languages/
Tags: light, custom-background, two-columns, right-sidebar, responsive-layout, custom-menu, sticky-post, theme-options, threaded-comments, translation-ready, gray, left-sidebar, custom-menu, editor-style, featured-images, full-width-template, sticky-post, theme-options, threaded-comments, photoblogging
Fifteen is based on Underscores http://underscores.me/, (C) 2012-2013 Automattic, Inc.
Fifteen WordPress Theme, Copyright 2013 Rohit Tripathi.
Fifteen WordPress Theme is distributed under the terms of the GNU GPL v3.
*/
/* =Reset
-------------------------------------------------------------- */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
border: 0;
font-family: inherit;
font-size: 100%;
font-style: inherit;
font-weight: inherit;
margin: 0;
outline: 0;
padding: 0;
vertical-align: baseline;
}
html {
font-size: 62.5%; /* Corrects text resizing oddly in IE6/7 when body font-size is set using em units http://clagnut.com/blog/348/#c790 */
overflow-y: scroll; /* Keeps page centred in all browsers regardless of content height */
-webkit-text-size-adjust: 100%; /* Prevents iOS text size adjust after orientation change, without disabling user zoom */
-ms-text-size-adjust: 100%; /* www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/ */
}
body {
word-wrap: break-word;
-ms-word-wrap: break-word;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
main,
nav,
section {
display: block;
}
ol, ul {
list-style: none;
}
table { /* tables still need 'cellspacing="0"' in the markup */
border-collapse: separate;
border-spacing: 0;
}
caption, th, td {
font-weight: normal;
text-align: left;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: "";
}
blockquote, q {
quotes: "" "";
}
a:focus {
outline: thin dotted;
}
a:hover,
a:active { /* Improves readability when focused and also mouse hovered in all browsers people.opera.com/patrickl/experiments/keyboard/test */
outline: 0;
}
a img {
border: 0;
margin-top: 0.7em;
margin-bottom: 0.7em;
}
/* =Global
----------------------------------------------- */
body,
button,
input,
select,
textarea {
color: #404040;
font-family: sans-serif;
font-size: 16px;
font-size: 1.6rem;
line-height: 1.5;
}
/* Headings */
h1, h2, h3, h4, h5, h6 {
clear: both;
}
hr {
background-color: #ccc;
border: 0;
height: 1px;
margin-bottom: 1.5em;
}
/* Text elements */
p {
margin-bottom: 1.5em;
}
ul, ol {
margin: 0 0 1.5em 3em;
}
ul {
list-style: disc;
}
ol {
list-style: decimal;
}
li > ul,
li > ol {
margin-bottom: 0;
margin-left: 1.5em;
}
dt {
font-weight: bold;
}
dd {
margin: 0 1.5em 1.5em;
}
b, strong {
font-weight: bold;
}
dfn, cite, em, i {
font-style: italic;
}
blockquote {
margin: 0 1.5em;
}
address {
margin: 0 0 1.5em;
}
pre {
background: #eee;
font-family: "Courier 10 Pitch", Courier, monospace;
font-size: 15px;
font-size: 1.5rem;
line-height: 1.6;
margin-bottom: 1.6em;
max-width: 100%;
overflow: auto;
padding: 1.6em;
}
code, kbd, tt, var {
font: 15px Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
}
abbr, acronym {
border-bottom: 1px dotted #666;
cursor: help;
}
mark, ins {
background: #fff9c0;
text-decoration: none;
}
sup,
sub {
font-size: 75%;
height: 0;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
bottom: 1ex;
}
sub {
top: .5ex;
}
small {
font-size: 75%;
}
big {
font-size: 125%;
}
figure {
margin: 0;
}
table {
margin: 0 0 1.5em;
width: 100%;
}
th {
font-weight: bold;
}
img {
height: auto; /* Make sure images are scaled correctly. */
max-width: 100%; /* Adhere to container width. */
}
button,
input,
select,
textarea {
font-size: 100%; /* Corrects font size not being inherited in all browsers */
margin: 0; /* Addresses margins set differently in IE6/7, F3/4, S5, Chrome */
vertical-align: baseline; /* Improves appearance and consistency in all browsers */
*vertical-align: middle; /* Improves appearance and consistency in all browsers */
}
button,
input {
line-height: normal; /* Addresses FF3/4 setting line-height using !important in the UA stylesheet */
}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
border: 1px solid #ccc;
border-color: #ccc #ccc #bbb #ccc;
border-radius: 3px;
background: #e6e6e6;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 15px 17px rgba(255, 255, 255, 0.5), inset 0 -5px 12px rgba(0, 0, 0, 0.05);
color: rgba(0, 0, 0, .8);
cursor: pointer; /* Improves usability and consistency of cursor style between image-type 'input' and others */
-webkit-appearance: button; /* Corrects inability to style clickable 'input' types in iOS */
font-size: 12px;
font-size: 1.2rem;
line-height: 1;
padding: .6em 1em .4em;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}
button:hover,
html input[type="button"]:hover,
input[type="reset"]:hover,
input[type="submit"]:hover {
border-color: #ccc #bbb #aaa #bbb;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 15px 17px rgba(255, 255, 255, 0.8), inset 0 -5px 12px rgba(0, 0, 0, 0.02);
}
button:focus,
html input[type="button"]:focus,
input[type="reset"]:focus,
input[type="submit"]:focus,
button:active,
html input[type="button"]:active,
input[type="reset"]:active,
input[type="submit"]:active {
border-color: #aaa #bbb #bbb #bbb;
box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.5), inset 0 2px 5px rgba(0, 0, 0, 0.15);
}
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box; /* Addresses box sizing set to content-box in IE8/9 */
padding: 0; /* Addresses excess padding in IE8/9 */
}
input[type="search"] {
-webkit-appearance: textfield; /* Addresses appearance set to searchfield in S5, Chrome */
-webkit-box-sizing: content-box; /* Addresses box sizing set to border-box in S5, Chrome (include -moz to future-proof) */
-moz-box-sizing: content-box;
box-sizing: content-box;
}
input[type="search"]::-webkit-search-decoration { /* Corrects inner padding displayed oddly in S5, Chrome on OSX */
-webkit-appearance: none;
}
button::-moz-focus-inner,
input::-moz-focus-inner { /* Corrects inner padding and border displayed oddly in FF3/4 www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/ */
border: 0;
padding: 0;
}
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
textarea {
color: #666;
border: 1px solid #ccc;
border-radius: 3px;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus {
color: #111;
}
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"] {
padding: 3px;
}
textarea {
overflow: auto; /* Removes default vertical scrollbar in IE6/7/8/9 */
padding-left: 3px;
vertical-align: top; /* Improves readability and alignment in all browsers */
width: 98%;
}
/* Alignment */
.alignleft {
display: inline;
float: left;
margin-right: 1.5em;
}
.alignright {
display: inline;
float: right;
margin-left: 1.5em;
}
.aligncenter {
clear: both;
display: block;
margin: 0 auto;
}
/* Text meant only for screen readers */
.screen-reader-text {
clip: rect(1px, 1px, 1px, 1px);
position: absolute !important;
}
.screen-reader-text:hover,
.screen-reader-text:active,
.screen-reader-text:focus {
background-color: #f1f1f1;
border-radius: 3px;
box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
clip: auto !important;
color: #21759b;
display: block;
font-size: 14px;
font-weight: bold;
height: auto;
left: 5px;
line-height: normal;
padding: 15px 23px 14px;
text-decoration: none;
top: 5px;
width: auto;
z-index: 100000; /* Above WP toolbar */
}
/* Clearing */
.clear:before,
.clear:after,
.entry-content:before,
.entry-content:after,
.comment-content:before,
.comment-content:after,
.site-header:before,
.site-header:after,
.site-content:before,
.site-content:after,
.site-footer:before,
.site-footer:after {
content: '';
display: table;
}
.clear:after,
.entry-content:after,
.comment-content:after,
.site-header:after,
.site-content:after,
.site-footer:after {
clear: both;
}
/* =Content
----------------------------------------------- */
.sticky {
}
.hentry {
margin: 0 0 1.5em;
}
.byline,
.updated {
display: none;
}
.single .byline,
.group-blog .byline {
display: inline;
}
.page-content,
.entry-content,
.entry-summary {
margin: 1.5em 0 0;
}
.page-links {
clear: both;
margin: 0 0 1.5em;
}
/* =Asides
----------------------------------------------- */
.blog .format-aside .entry-title,
.archive .format-aside .entry-title {
display: none;
}
/* =Media
----------------------------------------------- */
.page-content img.wp-smiley,
.entry-content img.wp-smiley,
.comment-content img.wp-smiley {
border: none;
margin-bottom: 0;
margin-top: 0;
padding: 0;
}
.wp-caption {
border: 1px solid #ccc;
margin-bottom: 1.5em;
max-width: 100%;
}
.wp-caption img[class*="wp-image-"] {
display: block;
margin: 1.2% auto 0;
max-width: 98%;
}
.wp-caption-text {
text-align: center;
}
.wp-caption .wp-caption-text {
margin: 0.8075em 0;
}
.site-main .gallery {
margin-bottom: 1.5em;
}
.gallery-caption {
}
.site-main .gallery a img {
border: none;
height: auto;
max-width: 90%;
}
.site-main .gallery dd {
margin: 0;
}
.site-main .gallery-columns-4 .gallery-item {
}
.site-main .gallery-columns-4 .gallery-item img {
}
/* Make sure embeds and iframes fit their containers */
embed,
iframe,
object {
max-width: 100%;
}
/* =Navigation
----------------------------------------------- */
.site-main [class*="navigation"] {
margin: 0 0 1.5em;
overflow: hidden;
}
[class*="navigation"] .nav-previous {
float: left;
width: 50%;
}
[class*="navigation"] .nav-next {
float: right;
text-align: right;
width: 50%;
}
/* =Comments
----------------------------------------------- */
.comment-content a {
word-wrap: break-word;
}
.bypostauthor {
}
/* =Widgets
----------------------------------------------- */
.widget {
margin: 0 0 1.5em;
}
/* Make sure select elements fit in widgets */
.widget select {
max-width: 100%;
}
/* Search widget */
.widget_search .search-submit {
display: none;
}
/* =Infinite Scroll
----------------------------------------------- */
/* Globally hidden elements when Infinite Scroll is supported and in use. */
.infinite-scroll .paging-navigation, /* Older / Newer Posts Navigation (always hidden) */
.infinite-scroll.neverending .site-footer { /* Theme Footer (when set to scrolling) */
display: none;
}
/* When Infinite Scroll has reached its end we need to re-display elements that were hidden (via .neverending) before */
.infinity-end.neverending .site-footer {
display: block;
}
.byline {
display: inline !important;
}
ol.comment-list {
margin-left: 0;
}
/* = Fix for equalHeights
----------------------------------------------- */
@media screen and (min-width: 1200px) {
.featured-thumb {
min-height: 207px !important;
overflow: hidden;
}
}
@media screen and (min-width: 992px) and (max-width: 1199px) {
.featured-thumb {
min-height: 170px !important;
overflow: hidden;
}
}
| emelielindstrom/wordpress | wp-content/themes/fifteen/style.css | CSS | gpl-2.0 | 12,146 | [
30522,
1013,
1008,
4323,
2171,
1024,
5417,
4323,
24471,
2072,
1024,
8299,
1024,
1013,
1013,
10710,
4048,
3726,
1012,
4012,
1013,
4031,
1013,
5417,
1013,
3166,
1024,
20996,
16584,
4440,
25457,
3166,
24471,
2072,
1024,
8299,
1024,
1013,
1013,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
/**
* @requires OpenLayers/BaseTypes/Class.js
*/
/**
* Class: OpenLayers.Protocol
* Abstract vector layer protocol class. Not to be instantiated directly. Use
* one of the protocol subclasses instead.
*/
OpenLayers.Protocol = OpenLayers.Class({
/**
* Property: format
* {<OpenLayers.Format>} The format used by this protocol.
*/
format: null,
/**
* Property: options
* {Object} Any options sent to the constructor.
*/
options: null,
/**
* Property: autoDestroy
* {Boolean} The creator of the protocol can set autoDestroy to false
* to fully control when the protocol is destroyed. Defaults to
* true.
*/
autoDestroy: true,
/**
* Property: defaultFilter
* {<OpenLayers.Filter>} Optional default filter to read requests
*/
defaultFilter: null,
/**
* Constructor: OpenLayers.Protocol
* Abstract class for vector protocols. Create instances of a subclass.
*
* Parameters:
* options - {Object} Optional object whose properties will be set on the
* instance.
*/
initialize: function(options) {
options = options || {};
OpenLayers.Util.extend(this, options);
this.options = options;
},
/**
* Method: mergeWithDefaultFilter
* Merge filter passed to the read method with the default one
*
* Parameters:
* filter - {<OpenLayers.Filter>}
*/
mergeWithDefaultFilter: function(filter) {
var merged;
if (filter && this.defaultFilter) {
merged = new OpenLayers.Filter.Logical({
type: OpenLayers.Filter.Logical.AND,
filters: [this.defaultFilter, filter]
});
} else {
merged = filter || this.defaultFilter || undefined;
}
return merged;
},
/**
* APIMethod: destroy
* Clean up the protocol.
*/
destroy: function() {
this.options = null;
this.format = null;
},
/**
* APIMethod: read
* Construct a request for reading new features.
*
* Parameters:
* options - {Object} Optional object for configuring the request.
*
* Returns:
* {<OpenLayers.Protocol.Response>} An <OpenLayers.Protocol.Response>
* object, the same object will be passed to the callback function passed
* if one exists in the options object.
*/
read: function(options) {
options = options || {};
options.filter = this.mergeWithDefaultFilter(options.filter);
},
/**
* APIMethod: create
* Construct a request for writing newly created features.
*
* Parameters:
* features - {Array({<OpenLayers.Feature.Vector>})} or
* {<OpenLayers.Feature.Vector>}
* options - {Object} Optional object for configuring the request.
*
* Returns:
* {<OpenLayers.Protocol.Response>} An <OpenLayers.Protocol.Response>
* object, the same object will be passed to the callback function passed
* if one exists in the options object.
*/
create: function() {
},
/**
* APIMethod: update
* Construct a request updating modified features.
*
* Parameters:
* features - {Array({<OpenLayers.Feature.Vector>})} or
* {<OpenLayers.Feature.Vector>}
* options - {Object} Optional object for configuring the request.
*
* Returns:
* {<OpenLayers.Protocol.Response>} An <OpenLayers.Protocol.Response>
* object, the same object will be passed to the callback function passed
* if one exists in the options object.
*/
update: function() {
},
/**
* APIMethod: delete
* Construct a request deleting a removed feature.
*
* Parameters:
* feature - {<OpenLayers.Feature.Vector>}
* options - {Object} Optional object for configuring the request.
*
* Returns:
* {<OpenLayers.Protocol.Response>} An <OpenLayers.Protocol.Response>
* object, the same object will be passed to the callback function passed
* if one exists in the options object.
*/
"delete": function() {
},
/**
* APIMethod: commit
* Go over the features and for each take action
* based on the feature state. Possible actions are create,
* update and delete.
*
* Parameters:
* features - {Array({<OpenLayers.Feature.Vector>})}
* options - {Object} Object whose possible keys are "create", "update",
* "delete", "callback" and "scope", the values referenced by the
* first three are objects as passed to the "create", "update", and
* "delete" methods, the value referenced by the "callback" key is
* a function which is called when the commit operation is complete
* using the scope referenced by the "scope" key.
*
* Returns:
* {Array({<OpenLayers.Protocol.Response>})} An array of
* <OpenLayers.Protocol.Response> objects.
*/
commit: function() {
},
/**
* Method: abort
* Abort an ongoing request.
*
* Parameters:
* response - {<OpenLayers.Protocol.Response>}
*/
abort: function(response) {
},
/**
* Method: createCallback
* Returns a function that applies the given public method with resp and
* options arguments.
*
* Parameters:
* method - {Function} The method to be applied by the callback.
* response - {<OpenLayers.Protocol.Response>} The protocol response object.
* options - {Object} Options sent to the protocol method
*/
createCallback: function(method, response, options) {
return OpenLayers.Function.bind(function() {
method.apply(this, [response, options]);
}, this);
},
CLASS_NAME: "OpenLayers.Protocol"
});
/**
* Class: OpenLayers.Protocol.Response
* Protocols return Response objects to their users.
*/
OpenLayers.Protocol.Response = OpenLayers.Class({
/**
* Property: code
* {Number} - OpenLayers.Protocol.Response.SUCCESS or
* OpenLayers.Protocol.Response.FAILURE
*/
code: null,
/**
* Property: requestType
* {String} The type of request this response corresponds to. Either
* "create", "read", "update" or "delete".
*/
requestType: null,
/**
* Property: last
* {Boolean} - true if this is the last response expected in a commit,
* false otherwise, defaults to true.
*/
last: true,
/**
* Property: features
* {Array({<OpenLayers.Feature.Vector>})} or {<OpenLayers.Feature.Vector>}
* The features returned in the response by the server. Depending on the
* protocol's read payload, either features or data will be populated.
*/
features: null,
/**
* Property: data
* {Object}
* The data returned in the response by the server. Depending on the
* protocol's read payload, either features or data will be populated.
*/
data: null,
/**
* Property: reqFeatures
* {Array({<OpenLayers.Feature.Vector>})} or {<OpenLayers.Feature.Vector>}
* The features provided by the user and placed in the request by the
* protocol.
*/
reqFeatures: null,
/**
* Property: priv
*/
priv: null,
/**
* Property: error
* {Object} The error object in case a service exception was encountered.
*/
error: null,
/**
* Constructor: OpenLayers.Protocol.Response
*
* Parameters:
* options - {Object} Optional object whose properties will be set on the
* instance.
*/
initialize: function(options) {
OpenLayers.Util.extend(this, options);
},
/**
* Method: success
*
* Returns:
* {Boolean} - true on success, false otherwise
*/
success: function() {
return this.code > 0;
},
CLASS_NAME: "OpenLayers.Protocol.Response"
});
OpenLayers.Protocol.Response.SUCCESS = 1;
OpenLayers.Protocol.Response.FAILURE = 0;
| savchukoleksii/beaversteward | www/settings/tools/mysql/js/openlayers/src/openlayers/lib/OpenLayers/Protocol.js | JavaScript | mit | 8,407 | [
30522,
1013,
1008,
9385,
1006,
1039,
1007,
2294,
1011,
2286,
2011,
2330,
24314,
2015,
16884,
1006,
2156,
6048,
1012,
19067,
2102,
2005,
1008,
2440,
2862,
1997,
16884,
1007,
1012,
2405,
2104,
1996,
1016,
1011,
11075,
18667,
2094,
6105,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>The page you were looking for doesn't exist (404)</title>
<style type="text/css">
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
div.dialog {
width: 25em;
padding: 0 4em;
margin: 4em auto 0 auto;
border: 1px solid #ccc;
border-right-color: #999;
border-bottom-color: #999;
}
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
</style>
</head>
<body>
<div class="dialog">
<h1>Bad Request</h1>
<p>The request to this resource was malformed.</p>
</div>
</body>
</html>
| mwangiann/RapidFTR | public/400.html | HTML | agpl-3.0 | 851 | [
30522,
1026,
999,
9986,
13874,
16129,
2270,
1000,
1011,
1013,
1013,
1059,
2509,
2278,
1013,
1013,
26718,
2094,
1060,
11039,
19968,
1015,
1012,
1014,
17459,
1013,
1013,
4372,
1000,
1000,
8299,
1024,
1013,
1013,
7479,
1012,
1059,
2509,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package io.github.dousha.randomCraft.randomcraft;
import java.util.HashMap;
// WHY DOESN'T JAVA HAVE A STRUCT
public class ItemDescription implements Cloneable{
public boolean type; // false = in, true = out, I would use #define in c/c++!
public String itemname;
@Deprecated
public int itemid;
public boolean isMajor;
public int leastAmount;
public double base;
public String formula;
public double arg1, arg2, arg3;
public boolean isMagic;
// TODO: make it works
public HashMap<String, String> enchantments; // <name, level>
// ----^-----------------------^-----------
public String giveMethod;
@Override
public Object clone(){
ItemDescription o = null;
try{
o = (ItemDescription) super.clone();
}
catch(CloneNotSupportedException ex){
ex.printStackTrace();
}
return o;
}
}
| dousha/MySpigotPlugins | RandomCraft/src/main/java/io/github/dousha/randomCraft/randomcraft/ItemDescription.java | Java | gpl-2.0 | 815 | [
30522,
7427,
22834,
1012,
21025,
2705,
12083,
1012,
2079,
20668,
2050,
1012,
6721,
10419,
1012,
6721,
10419,
1025,
12324,
9262,
1012,
21183,
4014,
1012,
23325,
2863,
2361,
1025,
1013,
1013,
2339,
2987,
1005,
1056,
9262,
2031,
1037,
2358,
68... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
"use strict";
var async = require('async');
var fs = require('fs');
var util = require('util');
var prompt = require('prompt');
var httpRequest = require('emsoap').subsystems.httpRequest;
var common = require('./common');
var mms = require('./mms');
var mmscmd = require('./mmscmd');
var deploy = require('./deploy');
var session; // MMS session
var modelFile = "sfmodel.json";
var externalSystemType = 'NODEX';
var externalSystem;
var accessAddress;
var credentials;
var mappedObjects;
var verboseLoggingForExternalSystem;
function afterAuth(cb) {
// munge mappedObjects as required
for (var name in mappedObjects) {
var map = mappedObjects[name];
if (!map.typeBindingProperties) {
map.typeBindingProperties = {};
for (var propName in map) {
switch(propName) {
case "target":
case "properties":
;
default:
map.typeBindingProperties[name] = map[name];
}
}
}
}
// invoke op to create model
session.directive(
{
op : "INVOKE",
targetType: "CdmExternalSystem",
name: "invokeExternal",
params: {
externalSystem: externalSystem,
opName : "createSfModel",
params : {
sfVersion : credentials.sfVersion,
externalSystem : externalSystem,
typeDescs : mappedObjects
}
}
},
function (err, result) {
if (err) {
return cb(err);
}
fs.writeFileSync(modelFile, JSON.stringify(result.results, null, 2));
mmscmd.execFile(modelFile,session, deploy.outputWriter, cb);
}
);
}
exports.deployModel = function deployModel(externalSystemName,mmsSession,cb) {
session = mmsSession;
externalSystem = externalSystemName;
var text;
if(!session.creds.externalCredentials) {
console.log("Profile must include externalCredentials");
process.exit(1);
}
credentials = session.creds.externalCredentials[externalSystemName];
if(!credentials) {
console.log("Profile does not provide externalCredentials for " + externalSystemName);
process.exit(1);
}
if(!credentials.oauthKey || !credentials.oauthSecret) {
console.log("externalSystemName for " + externalSystemName + " must contain the oAuth key and secret.");
}
accessAddress = credentials.host;
try {
text = fs.readFileSync("salesforce.json");
} catch(err) {
console.log('Error reading file salesforce.json:' + err);
process.exit(1);
}
try {
mappedObjects = JSON.parse(text);
} catch(err) {
console.log('Error parsing JSON in salesforce.json:' + err);
process.exit(1);
}
if(mappedObjects._verbose_logging_) {
verboseLoggingForExternalSystem = mappedObjects._verbose_logging_;
}
delete mappedObjects._verbose_logging_;
createExternalSystem(function(err) {
if (err) {
return cb(err);
}
var addr = common.global.session.creds.server + "/oauth/" + externalSystem + "/authenticate";
if (common.global.argv.nonInteractive) {
console.log("Note: what follows will fail unless Emotive has been authorized at " + addr);
afterAuth(cb);
}
else {
console.log("Please navigate to " + addr.underline + " with your browser");
prompt.start();
prompt.colors = false;
prompt.message = 'Press Enter when done';
prompt.delimiter = '';
var props = {
properties: {
q: {
description : ":"
}
}
}
prompt.get(props, function (err, result) {
if (err) {
return cb(err);
}
afterAuth(cb);
});
}
});
}
function createExternalSystem(cb) {
if (!session.creds.username)
{
console.log("session.creds.username was null");
process.exit(1);
}
if(verboseLoggingForExternalSystem) console.log('VERBOSE LOGGING IS ON FOR ' + externalSystem);
session.directive({
op: 'INVOKE',
targetType: 'CdmExternalSystem',
name: "updateOAuthExternalSystem",
params: {
name: externalSystem,
typeName: externalSystemType,
"oauthCredentials" : {
"oauthType": "salesforce",
"oauthKey": credentials.oauthKey,
"oauthSecret": credentials.oauthSecret
},
properties: {
proxyConfiguration: {verbose: verboseLoggingForExternalSystem, sfVersion: credentials.sfVersion},
globalPackageName : "sfProxy"
}
}
},
cb);
}
| emote/tools | lib/sfsetup.js | JavaScript | mit | 5,142 | [
30522,
1000,
2224,
9384,
1000,
1025,
13075,
2004,
6038,
2278,
1027,
5478,
1006,
1005,
2004,
6038,
2278,
1005,
1007,
1025,
13075,
1042,
2015,
1027,
5478,
1006,
1005,
1042,
2015,
1005,
1007,
1025,
13075,
21183,
4014,
1027,
5478,
1006,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
@charset "UTF-8";
/*******************************************
*** SO Framework: Sass ***
*******************************************/
/* [2] */
/* [8] */
/*===============================================
[SASS DIRECTORY ]
[1] Minxin Link
[2] Minxin Button
[3] Minxin Triangle
[4] Minxin LABEL PRODUCT
[5] Minxin Scrollbars
[6] Minxin Dev Custom
==============================================*/
.no-margin {
margin: 0 !important; }
/*Dev Custom */
.lib-list-item-product2 {
border: none; }
.lib-list-item-product2 .image-dev .list-button-dev {
position: absolute;
top: 50%;
left: 50%;
z-index: 10;
transform: translate3d(-50%, -50%, 0);
-moz-transform: translate3d(-50%, -50%, 0);
-webkit-transform: translate3d(-50%, -50%, 0);
-ms-transform: translate3d(-50%, -50%, 0); }
.lib-list-item-product2 .image-dev .list-button-dev li {
display: inline-block;
float: left;
height: 40px;
width: 40px;
background: #fff;
position: relative;
border-width: 0 1px 0 0;
border-style: solid;
border-color: #ddd;
opacity: 0;
transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out; }
.lib-list-item-product2 .image-dev .list-button-dev li:nth-child(1) {
transform: translateX(40px);
-moz-transform: translateX(40px);
-webkit-transform: translateX(40px);
-ms-transform: translateX(40px);
z-index: 1;
transition-delay: 0s; }
.lib-list-item-product2 .image-dev .list-button-dev li:nth-child(2) {
transition-delay: 0.2s;
z-index: 2; }
.lib-list-item-product2 .image-dev .list-button-dev li:nth-child(3) {
transition-delay: 0.2s;
z-index: 2; }
.lib-list-item-product2 .image-dev .list-button-dev li:nth-child(4) {
transform: translateX(-40px);
-moz-transform: translateX(-40px);
-webkit-transform: translateX(-40px);
-ms-transform: translateX(-40px);
z-index: 1;
transition-delay: 0s; }
.lib-list-item-product2 .image-dev .list-button-dev li:first-child {
border-left: 1px solid #ddd; }
.lib-list-item-product2 .image-dev .list-button-dev li a, .lib-list-item-product2 .image-dev .list-button-dev li button {
background: none;
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
line-height: 40px;
text-align: center;
box-shadow: none;
border: none;
color: #555;
width: 40px;
padding: 0; }
.lib-list-item-product2 .image-dev .list-button-dev li:hover {
background: #6e8f04; }
.lib-list-item-product2 .image-dev .list-button-dev li:hover a, .lib-list-item-product2 .image-dev .list-button-dev li:hover button {
color: #fff; }
.lib-list-item-product2 .caption-dev {
text-align: center;
padding: 0 15px; }
.lib-list-item-product2 .caption-dev .rating-dev {
margin: 5px 0; }
.lib-list-item-product2 .caption-dev .rating-dev .fa-stack-2x {
font-size: 11px; }
.lib-list-item-product2 .caption-dev .title-dev {
color: #444;
font-size: 13px; }
.lib-list-item-product2 .caption-dev .price-dev .price.product-price {
font-size: 16px; }
.lib-list-item-product2 .caption-dev .price-dev .price-new {
font-size: 16px; }
.lib-list-item-product2 .caption-dev .price-dev .price-old {
font-size: 12px; }
.lib-list-item-product2 .caption-dev .add-cart-dev {
background: #fff;
border: 1px solid #ddd;
font-size: 12px;
text-transform: uppercase;
color: #999;
font-weight: bold;
box-shadow: none;
border-radius: 0;
padding: 6px 20px;
margin: 0 0 30px;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out; }
.lib-list-item-product-over2 .image-dev .list-button-dev li {
opacity: 1;
transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out; }
.lib-list-item-product-over2 .image-dev .list-button-dev li:nth-child(1) {
transform: translateX(0);
-moz-transform: translateX(0);
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
transition-delay: 0.2s; }
.lib-list-item-product-over2 .image-dev .list-button-dev li:nth-child(2) {
transition-delay: 0s; }
.lib-list-item-product-over2 .image-dev .list-button-dev li:nth-child(3) {
transition-delay: 0s; }
.lib-list-item-product-over2 .image-dev .list-button-dev li:nth-child(4) {
transform: translateX(0);
-moz-transform: translateX(0);
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
transition-delay: 0.2s; }
/*EFECT PRODUCT NUMBER*/
.lib-two-img, .best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-left .item-image .lt-image, .products-list .product-layout .product-item-container .left-block .product-image-container.second_img {
position: relative;
display: block; }
.lib-two-img .img-1, .best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-left .item-image .lt-image .img-1, .products-list .product-layout .product-item-container .left-block .product-image-container.second_img .img-1 {
position: relative;
/*@include transform(rotateY(0deg));*/
transition: all 0.5s ease-in-out; }
.lib-two-img .img-2, .best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-left .item-image .lt-image .img-2, .products-list .product-layout .product-item-container .left-block .product-image-container.second_img .img-2 {
position: absolute;
z-index: 0;
top: 0;
opacity: 0;
width: 100%;
display: block;
/*@include transform(rotateY(90deg));*/
transition: all 0.5s ease-in-out;
left: 0; }
.lib-two-img-over .img-1, .best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1:hover .media-left .item-image .lt-image .img-1, .products-list .product-layout .product-item-container:hover .left-block .product-image-container.second_img .img-1 {
opacity: 0;
/*transform-style: inherit;
@include transform(rotateY(90deg));*/
transition: all 0.5s ease-in-out; }
.lib-two-img-over .img-2, .best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1:hover .media-left .item-image .lt-image .img-2, .products-list .product-layout .product-item-container:hover .left-block .product-image-container.second_img .img-2 {
opacity: 1;
/*@include transform(rotateY(0deg));*/
transition: all 0.5s ease-in-out; }
/*EFFECT SLIDERHOME*/
@keyframes myeffect-slideshow {
0% {
opacity: 0;
transform: translateY(-300px);
-webkit-transform: translateY(-300px);
-moz-transform: translateY(-300px);
-ms-transform: translateY(-300px);
-o-transform: translateY(-300px); }
100% {
opacity: 1;
transform: translateY(0);
-moz-transform: translateY(0);
-webkit-transform: translateY(0);
-ms-transform: translateY(0);
-o-transform: translateY(0); } }
@-webkit-keyframes myeffect-slideshow {
0% {
opacity: 0;
transform: translateY(-300px);
-webkit-transform: translateY(-300px);
-moz-transform: translateY(-300px);
-ms-transform: translateY(-300px);
-o-transform: translateY(-300px); }
100% {
opacity: 1;
transform: translateY(0);
-moz-transform: translateY(0);
-webkit-transform: translateY(0);
-ms-transform: translateY(0);
-o-transform: translateY(0); } }
@-moz-keyframes myeffect-slideshow {
0% {
opacity: 0;
transform: translateY(-300px);
-webkit-transform: translateY(-300px);
-moz-transform: translateY(-300px);
-ms-transform: translateY(-300px);
-o-transform: translateY(-300px); }
100% {
opacity: 1;
transform: translateY(0);
-moz-transform: translateY(0);
-webkit-transform: translateY(0);
-ms-transform: translateY(0);
-o-transform: translateY(0); } }
/*===============================================
[SASS DIRECTORY ]
[1] BACK TO TOP
[2] SOCIAL ACCOUNTS
[3] TOP PANEL
[4] LARY LOADER
[5] NO RESPONSIVE BOOTSTRAP
[6] PRELOADING SCREEN
==============================================*/
/*============BACK TO TOP ==================*/
.back-to-top {
position: fixed;
bottom: 20px;
cursor: pointer;
background-color: #666;
border: 4px solid #ddd;
color: #ddd;
display: inline-block;
line-height: 44px;
text-align: center;
width: 48px;
height: 48px;
z-index: 30;
border-radius: 50%;
-webkit-border-radius: 50%;
opacity: 1;
right: 20px;
-webkit-transition: all 0.3s ease-in-out 0s;
-moz-transition: all 0.3s ease-in-out 0s;
transition: all 0.3s ease-in-out 0s;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-ms-transform: scale(1);
-o-transform: scale(1);
transform: scale(1); }
.back-to-top.hidden-top {
bottom: -100px;
opacity: 0;
-webkit-transform: scale(0);
-moz-transform: scale(0);
-ms-transform: scale(0);
-o-transform: scale(0);
transform: scale(0); }
.back-to-top:hover {
background-color: #444; }
.back-to-top i {
font-size: 20px;
margin: 1px 0 0 0 !important;
color: #ddd;
display: inline-block; }
.back-to-top i:before {
content: '\f062'; }
/*============SOCIAL ACCOUNTS ==================*/
.social-widgets {
position: fixed;
z-index: 999;
top: 50%;
height: 0;
width: 0;
right: 0; }
.account-register .buttons input[type=checkbox] {
position: relative;
top: 3px; }
.social-widgets .item, .social-widgets .items {
margin: 0;
padding: 0;
list-style-type: none; }
.social-widgets .items {
top: -100px;
position: relative; }
.social-widgets .item {
position: absolute;
top: 0;
left: 120px; }
.social-widgets .active {
z-index: 100;
left: -310px; }
.social-widgets .item-01, .social-widgets .item-02, .social-widgets .item-03, .social-widgets .item-04, .social-widgets .item-05, .social-widgets .item-06, .social-widgets .item-07, .social-widgets .item-08, .social-widgets .item-09 {
left: 0; }
.social-widgets .item-01 {
top: 0;
z-index: 99; }
.social-widgets .item-02 {
top: 45px;
z-index: 98; }
.social-widgets .item-03 {
top: 90px;
z-index: 97; }
.social-widgets .item-04 {
top: 150px;
z-index: 96; }
.social-widgets .item-05 {
top: 200px;
z-index: 95; }
.social-widgets .tab-icon .fa {
font-size: 18px;
line-height: 45px; }
.social-widgets .tab-icon {
position: absolute;
top: 0;
left: -45px;
display: block;
width: 45px;
height: 45px;
background: #fff;
text-align: center;
font-size: 1.54em; }
.social-widgets .tab-icon:hover {
text-decoration: none; }
.social-widgets .active .tab-icon {
border-color: #e9e9e9;
background: #fff; }
.social-widgets .facebook .tab-icon {
background: #3b5998;
background-clip: content-box;
color: white; }
.social-widgets .twitter .tab-icon {
background: #07779a;
background-clip: content-box;
color: white; }
.social-widgets .youtube .tab-icon {
background: #da2723;
background-clip: content-box;
color: white; }
.social-widgets .tab-content {
background: #fff;
width: 310px;
padding: 10px; }
.social-widgets .active .tab-content {
box-shadow: 0 0 4px rgba(0, 0, 0, .15); }
.social-widgets .title {
margin: -10px -10px 10px;
padding: 0px 10px;
background-color: #ccc;
text-transform: uppercase;
line-height: 45px;
color: #000;
font-weight: bold; }
.social-widgets .title h5 {
line-height: 45px;
margin: 0; }
.social-widgets .facebook.active {
left: -260px; }
.social-widgets .facebook .tab-content {
width: 260px; }
.social-widgets .twitter.active {
left: -300px; }
.social-widgets .twitter .tab-content {
width: 300px; }
.social-widgets .twitter-widget {
padding-top: 10px; }
.social-widgets .youtube.active {
left: -450px; }
.social-widgets .youtube .tab-content {
width: 450px; }
.social-widgets .youtube .tab-content iframe {
width: 100%; }
.social-widgets .loading {
min-height: 200px;
position: relative;
z-index: 100; }
.social-widgets .loading img.ajaxloader {
position: absolute;
top: 45%;
left: 45%;
width: 32px;
height: 32px; }
/*============TOP PANEL ==================*/
.wrapper-boxed header.navbar-compact, .wrapper-iframed header.navbar-compact, .wrapper-rounded header.navbar-compact {
width: auto; }
header.navbar-compact .compact-hidden {
display: none; }
.navbar-compact .header-center {
padding: 20px 0; }
.navbar-compact .header-bottom {
margin: 0 0 10px; }
.navbar-switcher {
text-align: center;
float: right;
display: none;
width: 45px;
height: 45px;
margin-bottom: -47px;
background: #6e8f04 !important;
padding: 6px 7px;
border-radius: 0 0 3px 3px;
cursor: pointer;
color: #fff; }
.navbar-switcher.active {
background: #333 !important; }
.navbar-switcher .i-active, .navbar-switcher.active .i-inactive {
display: none; }
.navbar-switcher.active .i-active, .navbar-switcher .fa-caret-down {
display: inline;
font-size: 1.8em;
line-height: 1.5em; }
/*============LARY LOADER ==================*/
.lazy {
display: block;
overflow: hidden;
background: transparent url(../../images/lazy-loader.gif) no-repeat center center; }
@media (min-width: 1200px) {
.lazy.lazy-loaded {
background: none;
height: auto; }
.lazy img {
transition: 1s all ease;
opacity: 0;
-webkit-backface-visibility: hidden;
display: inline-block; }
.lazy.lazy-loaded img {
opacity: 1; } }
/*============NONE RESPONSIVE BOOTSTRAP ==================*/
@media (max-width: 1024px) {
.no-res {
width: 1190px; } }
.wrapper-boxed, .wrapper-iframed, .wrapper-rounded {
max-width: 1200px;
margin: 0 auto;
background: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, .2); }
.wrapper-iframed {
margin: 20px auto; }
.wrapper-rounded {
margin: 20px auto;
border-radius: 10px;
overflow: hidden; }
/*============Preloading Screen==================*/
/*============Preloading Screen==================*/
.loader-content {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1000111;
background-color: #fff;
opacity: 1;
transition: all 500ms linear 0s; }
.loader-content.loader-off, body.loaded .loader-content {
opacity: 0;
visibility: hidden;
transition: all 500ms linear 0s; }
/* The loader container */
/*#loader {
position: absolute;
top: 50%;
left: 50%;
width: 200px;
height: 200px;
margin-top: -100px;
margin-left: -100px;
perspective: 400px;
transform-type: preserve-3d;
}*/
/* The dot */
/* Preloader Css */
.loader-content {
background-color: #fff;
height: 100%;
width: 100%;
position: fixed;
z-index: 1;
margin-top: 0px;
top: 0px;
z-index: 99999999; }
#loader {
height: 100px;
left: 50%;
margin-left: -50px;
margin-top: -50px;
position: absolute;
text-align: center;
top: 50%;
width: 100px; }
.cssload-thecube {
width: 50px;
height: 50px;
margin: 0 auto;
margin-top: 49px;
position: relative;
transform: rotateZ(45deg);
-o-transform: rotateZ(45deg);
-ms-transform: rotateZ(45deg);
-webkit-transform: rotateZ(45deg);
-moz-transform: rotateZ(45deg); }
.cssload-thecube .cssload-cube {
position: relative;
transform: rotateZ(45deg);
-o-transform: rotateZ(45deg);
-ms-transform: rotateZ(45deg);
-webkit-transform: rotateZ(45deg);
-moz-transform: rotateZ(45deg); }
.cssload-thecube .cssload-cube {
float: left;
width: 50%;
height: 50%;
position: relative;
transform: scale(1.1);
-o-transform: scale(1.1);
-ms-transform: scale(1.1);
-webkit-transform: scale(1.1);
-moz-transform: scale(1.1); }
.cssload-thecube .cssload-cube:before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #6e8f04;
animation: cssload-fold-thecube 2.76s infinite linear both;
-o-animation: cssload-fold-thecube 2.76s infinite linear both;
-ms-animation: cssload-fold-thecube 2.76s infinite linear both;
-webkit-animation: cssload-fold-thecube 2.76s infinite linear both;
-moz-animation: cssload-fold-thecube 2.76s infinite linear both;
transform-origin: 100% 100%;
-o-transform-origin: 100% 100%;
-ms-transform-origin: 100% 100%;
-webkit-transform-origin: 100% 100%;
-moz-transform-origin: 100% 100%; }
.cssload-thecube .cssload-c2 {
transform: scale(1.1) rotateZ(90deg);
-o-transform: scale(1.1) rotateZ(90deg);
-ms-transform: scale(1.1) rotateZ(90deg);
-webkit-transform: scale(1.1) rotateZ(90deg);
-moz-transform: scale(1.1) rotateZ(90deg); }
.cssload-thecube .cssload-c3 {
transform: scale(1.1) rotateZ(180deg);
-o-transform: scale(1.1) rotateZ(180deg);
-ms-transform: scale(1.1) rotateZ(180deg);
-webkit-transform: scale(1.1) rotateZ(180deg);
-moz-transform: scale(1.1) rotateZ(180deg); }
.cssload-thecube .cssload-c4 {
transform: scale(1.1) rotateZ(270deg);
-o-transform: scale(1.1) rotateZ(270deg);
-ms-transform: scale(1.1) rotateZ(270deg);
-webkit-transform: scale(1.1) rotateZ(270deg);
-moz-transform: scale(1.1) rotateZ(270deg); }
.cssload-thecube .cssload-c2:before {
animation-delay: 0.35s;
-o-animation-delay: 0.35s;
-ms-animation-delay: 0.35s;
-webkit-animation-delay: 0.35s;
-moz-animation-delay: 0.35s; }
.cssload-thecube .cssload-c3:before {
animation-delay: 0.69s;
-o-animation-delay: 0.69s;
-ms-animation-delay: 0.69s;
-webkit-animation-delay: 0.69s;
-moz-animation-delay: 0.69s; }
.cssload-thecube .cssload-c4:before {
animation-delay: 1.04s;
-o-animation-delay: 1.04s;
-ms-animation-delay: 1.04s;
-webkit-animation-delay: 1.04s;
-moz-animation-delay: 1.04s; }
@keyframes cssload-fold-thecube {
0%, 10% {
transform: perspective(136px) rotateX(-180deg);
opacity: 0; }
25%, 75% {
transform: perspective(136px) rotateX(0deg);
opacity: 1; }
90%, 100% {
transform: perspective(136px) rotateY(180deg);
opacity: 0; } }
@-ms-keyframes cssload-fold-thecube {
0%, 10% {
-ms-transform: perspective(136px) rotateX(-180deg);
opacity: 0; }
25%, 75% {
-ms-transform: perspective(136px) rotateX(0deg);
opacity: 1; }
90%, 100% {
-ms-transform: perspective(136px) rotateY(180deg);
opacity: 0; } }
@-webkit-keyframes cssload-fold-thecube {
0%, 10% {
-webkit-transform: perspective(136px) rotateX(-180deg);
opacity: 0; }
25%, 75% {
-webkit-transform: perspective(136px) rotateX(0deg);
opacity: 1; }
90%, 100% {
-webkit-transform: perspective(136px) rotateY(180deg);
opacity: 0; } }
/*============@group Banners hover effect ==================*/
.banners-effect-1 .banners > div img {
-webkit-transition: all 0.2s ease-in;
-moz-transition: all 0.2s ease-in;
transition: all 0.2s ease-in; }
.banners-effect-1 .banners > div img:hover {
opacity: 0.8; }
.banners-effect-2 .banners > div a {
display: block;
position: relative;
overflow: hidden; }
.banners-effect-2 .banners > div a:hover:before, .banners-effect-2 .banners > div a:hover:after {
left: 0;
opacity: 1; }
.banners-effect-2 .banners > div a:before, .banners-effect-2 .banners > div a:after {
background-color: rgba(255, 255, 255, 0.4);
display: block;
width: 100%;
height: 100%;
left: -100%;
opacity: 0;
filter: alpha(opacity=0);
position: absolute;
top: 0;
-webkit-transition: all 0.3s ease-in;
-moz-transition: all 0.3s ease-in;
transition: all 0.3s ease-in;
content: "";
z-index: 1; }
.banners-effect-3 .banners > div a {
display: block;
position: relative;
overflow: hidden; }
.banners-effect-3 .banners > div a:hover:before, .banners-effect-3 .banners > div a:hover:after {
border: 0 solid rgba(0, 0, 0, 0.7);
opacity: 0;
filter: alpha(opacity=0); }
.banners-effect-3 .banners > div a:before, .banners-effect-3 .banners > div a:after {
border: 50px solid transparent;
border-top-right-radius: 50px;
border-top-left-radius: 50px;
border-bottom-right-radius: 50px;
border-bottom-left-radius: 50px;
box-sizing: border-box;
cursor: pointer;
display: inline-block;
left: 0;
right: 0;
bottom: 0;
margin: auto;
position: absolute;
top: 0;
content: "";
opacity: 1;
filter: alpha(opacity=100);
width: 100px;
height: 100px;
-webkit-transform: scale(7);
-moz-transform: scale(7);
-ms-transform: scale(7);
-o-transform: scale(7);
transform: scale(7);
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
visibility: visible;
z-index: 1; }
.banners-effect-4 .banners > div a {
display: block;
position: relative;
overflow: hidden; }
.banners-effect-4 .banners > div a:hover:before, .banners-effect-4 .banners > div a:hover:after {
opacity: 1;
-webkit-transform: rotate3d(0, 0, 1, 45deg) scale3d(1, 4, 1);
-moz-transform: rotate3d(0, 0, 1, 45deg) scale3d(1, 4, 1);
-ms-transform: rotate3d(0, 0, 1, 45deg) scale3d(1, 4, 1);
-o-transform: rotate3d(0, 0, 1, 45deg) scale3d(1, 4, 1);
transform: rotate3d(0, 0, 1, 45deg) scale3d(1, 4, 1); }
.banners-effect-4 .banners > div a:before, .banners-effect-4 .banners > div a:after {
border-bottom: 50px solid rgba(0, 0, 0, 0.2);
border-top: 50px solid rgba(0, 0, 0, 0.2);
content: "";
height: 100%;
left: 0;
opacity: 0;
filter: alpha(opacity=0);
position: absolute;
top: 0;
transform-origin: 50% 50% 0;
width: 100%;
-webkit-transform: rotate3d(0, 0, 1, 45deg) scale3d(1, 0, 1);
-moz-transform: rotate3d(0, 0, 1, 45deg) scale3d(1, 0, 1);
-ms-transform: rotate3d(0, 0, 1, 45deg) scale3d(1, 0, 1);
-o-transform: rotate3d(0, 0, 1, 45deg) scale3d(1, 0, 1);
transform: rotate3d(0, 0, 1, 45deg) scale3d(1, 0, 1);
-webkit-transition: opacity 0.4s ease 0s, -webkit-transform 0.35s ease 0s;
-moz-transition: opacity 0.4s ease 0s, -moz-transform 0.35s ease 0s;
transition: opacity 0.4s ease 0s, transform 0.35s ease 0s;
visibility: visible;
z-index: 1; }
.banners-effect-5 .banners > div a {
display: block;
position: relative;
overflow: hidden; }
.banners-effect-5 .banners > div a:before {
content: "";
height: 100%;
width: 100%;
position: absolute;
border: 70px solid rgba(255, 255, 255, 0);
top: 0;
left: 0;
transition: all 0.5s ease-in-out; }
.banners-effect-5 .banners > div a:after {
content: "";
height: 100%;
width: 100%;
position: absolute;
opacity: 0.5;
border: 30px solid #fff;
top: 0;
left: 0;
transform: scale(0);
-moz-transform: scale(0);
-webkit-transform: scale(0);
-ms-transform: scale(0);
transition: all 0.5s ease-in-out; }
.banners-effect-5 .banners > div a:hover:before {
border: 0 solid rgba(255, 255, 255, 0.7); }
.banners-effect-5 .banners > div a:hover:after {
transform: scale(0.8);
-moz-transform: scale(0.8);
-webkit-transform: scale(0.8);
-ms-transform: scale(0.8);
opacity: 0;
transition-delay: 0.1s; }
.banners-effect-6 .banners > div a {
display: inline-block;
position: relative;
overflow: hidden;
background: #000;
vertical-align: top; }
.banners-effect-6 .banners > div a img {
backface-visibility: hidden;
opacity: 1;
filter: alpha(opacity=100);
-webkit-transition: opacity 1s ease 0s, transform 1s ease 0s;
-o-transition: opacity 1s ease 0s, transform 1s ease 0s;
transition: opacity 1s ease 0s, transform 1s ease 0s; }
.banners-effect-6 .banners > div a:hover img {
opacity: 0.8;
filter: alpha(opacity=80);
transform: scale3d(1.1, 1.1, 1); }
.banners-effect-7 .banners > div a {
display: block;
position: relative;
overflow: hidden; }
.banners-effect-7 .banners > div a:before {
position: absolute;
background: rgba(0, 0, 0, 0.3);
width: 0;
top: 0;
left: 50%;
content: "";
transition: all 0.3s ease-in-out 0s; }
.banners-effect-7 .banners > div a:hover:before {
width: 100%;
left: 0;
top: 0;
height: 100%; }
.banners-effect-8 .banners > div a {
display: inline-block;
position: relative;
overflow: hidden;
background: #000;
vertical-align: top; }
.banners-effect-8 .banners > div a:before, .banners-effect-8 .banners > div a:after {
bottom: 20px;
content: "";
left: 20px;
opacity: 0;
position: absolute;
right: 20px;
top: 20px;
-webkit-transition: opacity 0.35s ease 0s, transform 0.35s ease 0s;
-o-transition: opacity 0.35s ease 0s, transform 0.35s ease 0s;
transition: opacity 0.35s ease 0s, transform 0.35s ease 0s;
z-index: 1; }
.banners-effect-8 .banners > div a:before {
border-bottom: 1px solid #fff;
border-top: 1px solid #fff;
-webkit-transform: scale(0, 1);
-ms-transform: scale(0, 1);
-o-transform: scale(0, 1);
transform: scale(0, 1); }
.banners-effect-8 .banners > div a:after {
border-left: 1px solid #fff;
border-right: 1px solid #fff;
-webkit-transform: scale(1, 0);
-ms-transform: scale(1, 0);
-o-transform: scale(1, 0);
transform: scale(1, 0); }
.banners-effect-8 .banners > div img {
opacity: 1;
filter: alpha(opacity=100);
-webkit-transition: opacity 0.35s ease 0s;
-o-transition: opacity 0.35s ease 0s;
transition: opacity 0.35s ease 0s; }
.banners-effect-8 .banners > div a:hover:before, .banners-effect-8 .banners > div a:hover:after {
opacity: 1;
filter: alpha(opacity=100);
-webkit-transform: scale(1);
-ms-transform: scale(1);
-o-transform: scale(1);
transform: scale(1); }
.banners-effect-8 .banners > div a:hover img {
opacity: 0.5;
filter: alpha(opacity=50); }
.banners-effect-9 .banners > div a {
display: block;
position: relative;
z-index: 10; }
.banners-effect-9 .banners > div a:before {
position: absolute;
top: 0;
left: 0;
z-index: 0;
width: 100%;
height: 100%;
background: #000;
content: '';
-webkit-transition: opacity 0.35s;
transition: opacity 0.35s;
box-shadow: 0 3px 30px rgba(0, 0, 0, 0.2);
opacity: 0; }
.banners-effect-9 .banners > div a:hover:before {
opacity: 1; }
.banners-effect-9 .banners > div a img {
opacity: 1;
-webkit-transition: -webkit-transform 0.35s;
transition: transform 0.35s;
-webkit-transform: perspective(1000px) translate3d(0, 0, 0);
transform: perspective(1000px) translate3d(0, 0, 0); }
.banners-effect-9 .banners > div a:hover img {
-webkit-transform: perspective(1000px) translate3d(0, 0, 21px);
transform: perspective(1000px) translate3d(0, 0, 21px); }
.banners-effect-10 .banners > div a {
display: block;
position: relative;
overflow: hidden; }
.banners-effect-10 .banners > div a:before {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: -webkit-linear-gradient(top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.2) 75%);
background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.2) 75%);
content: '';
opacity: 0;
-webkit-transform: translate3d(0, 50%, 0);
transform: translate3d(0, 50%, 0);
-webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
transition: opacity 0.35s, transform 0.35s; }
.banners-effect-10 .banners > div a:hover:before {
opacity: 1;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0); }
.banners-effect-11 .banners > div a {
display: block;
position: relative;
overflow: hidden; }
.banners-effect-11 .banners > div a:hover:before, .banners-effect-11 .banners > div a:hover:after {
width: 100%;
height: 100%; }
.banners-effect-11 .banners > div a:before, .banners-effect-11 .banners > div a:after {
background-color: rgba(0, 0, 0, 0.15);
content: "";
height: 0;
left: 0;
margin: auto;
position: absolute;
width: 0;
-webkit-transition: all 0.3s ease-out 0s;
-moz-transition: all 0.3s ease-out 0s;
transition: all 0.3s ease-out 0s; }
.banners-effect-11 .banners > div a:after {
left: auto;
right: 0;
bottom: 0; }
.banners-effect-12 .banners > div img {
-webkit-transition: all 0.3s ease-in;
-moz-transition: all 0.3s ease-in;
transition: all 0.3s ease-in; }
.banners-effect-12 .banners > div img:hover {
-webkit-filter: grayscale(100%);
filter: grayscale(100%); }
/*===============================================
[SASS DIRECTORY ]
[1] Pre-Loader
==============================================*/
/*============START Pre-Loader CSS ==================*/
.so-pre-loader {
background: #6e8f04;
height: 100%;
left: 0;
position: fixed;
top: 0;
width: 100%;
z-index: 99999; }
.so-pre-loader .so-loader-background {
background: #777;
display: block;
height: 100%; }
.so-pre-loader .so-loader-center {
position: absolute;
left: 50%;
top: 50%;
margin: -25px 0 0 -25px; }
.so-pre-loader .spinner {
width: 50px;
height: 50px;
background-color: white;
-webkit-animation: sk-rotateplane 1.2s infinite ease-in-out;
animation: sk-rotateplane 1.2s infinite ease-in-out; }
.so-pre-loader .spinner-bounce {
width: 60px;
height: 60px;
position: relative; }
.so-pre-loader .double-bounce1, .so-pre-loader .double-bounce2 {
width: 100%;
height: 100%;
border-radius: 50%;
background-color: white;
opacity: 0.6;
position: absolute;
top: 0;
left: 0;
-webkit-animation: sk-bounce 2s infinite ease-in-out;
animation: sk-bounce 2s infinite ease-in-out; }
.so-pre-loader .double-bounce2 {
-webkit-animation-delay: -1s;
animation-delay: -1s; }
.so-pre-loader .spinner-wave {
width: 50px;
height: 50px;
text-align: center;
font-size: 10px; }
.so-pre-loader .spinner-wave > div {
background-color: white;
height: 100%;
width: 6px;
margin: 0 2px;
display: inline-block;
-webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;
animation: sk-stretchdelay 1.2s infinite ease-in-out; }
.so-pre-loader .spinner-wave .rect2 {
-webkit-animation-delay: -1.1s;
animation-delay: -1.1s; }
.so-pre-loader .spinner-wave .rect3 {
-webkit-animation-delay: -1s;
animation-delay: -1s; }
.so-pre-loader .spinner-wave .rect4 {
-webkit-animation-delay: -0.9s;
animation-delay: -0.9s; }
.so-pre-loader .spinner-wave .rect5 {
-webkit-animation-delay: -0.8s;
animation-delay: -0.8s; }
.so-pre-loader .spinner-cube {
width: 40px;
height: 40px;
position: relative; }
.so-pre-loader .cube1, .so-pre-loader .cube2 {
background-color: white;
width: 15px;
height: 15px;
position: absolute;
top: 0;
left: 0;
-webkit-animation: sk-cubemove 1.8s infinite ease-in-out;
animation: sk-cubemove 1.8s infinite ease-in-out; }
.so-pre-loader .cube2 {
-webkit-animation-delay: -0.9s;
animation-delay: -0.9s; }
.so-pre-loader .spinner-bounce2 {
width: 80px;
text-align: center; }
.so-pre-loader .spinner-bounce2 > div {
width: 18px;
height: 18px;
background-color: white;
border-radius: 100%;
display: inline-block;
margin: 0 3px;
-webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
animation: sk-bouncedelay 1.4s infinite ease-in-out both; }
.so-pre-loader .spinner-bounce2 .bounce1 {
-webkit-animation-delay: -0.32s;
animation-delay: -0.32s; }
.so-pre-loader .spinner-bounce2 .bounce2 {
-webkit-animation-delay: -0.16s;
animation-delay: -0.16s; }
.so-pre-loader .spinner-circle {
width: 60px;
height: 60px;
position: relative; }
.so-pre-loader .spinner-circle .sk-child {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0; }
.so-pre-loader .spinner-circle .sk-child:before {
content: '';
display: block;
margin: 0 auto;
width: 15%;
height: 15%;
background-color: white;
border-radius: 100%;
-webkit-animation: sk-circleBounceDelay 1.2s infinite ease-in-out both;
animation: sk-circleBounceDelay 1.2s infinite ease-in-out both; }
.so-pre-loader .spinner-circle .sk-circle2 {
-webkit-transform: rotate(30deg);
-ms-transform: rotate(30deg);
transform: rotate(30deg); }
.so-pre-loader .spinner-circle .sk-circle3 {
-webkit-transform: rotate(60deg);
-ms-transform: rotate(60deg);
transform: rotate(60deg); }
.so-pre-loader .spinner-circle .sk-circle4 {
-webkit-transform: rotate(90deg);
-ms-transform: rotate(90deg);
transform: rotate(90deg); }
.so-pre-loader .spinner-circle .sk-circle5 {
-webkit-transform: rotate(120deg);
-ms-transform: rotate(120deg);
transform: rotate(120deg); }
.so-pre-loader .spinner-circle .sk-circle6 {
-webkit-transform: rotate(150deg);
-ms-transform: rotate(150deg);
transform: rotate(150deg); }
.so-pre-loader .spinner-circle .sk-circle7 {
-webkit-transform: rotate(180deg);
-ms-transform: rotate(180deg);
transform: rotate(180deg); }
.so-pre-loader .spinner-circle .sk-circle8 {
-webkit-transform: rotate(210deg);
-ms-transform: rotate(210deg);
transform: rotate(210deg); }
.so-pre-loader .spinner-circle .sk-circle9 {
-webkit-transform: rotate(240deg);
-ms-transform: rotate(240deg);
transform: rotate(240deg); }
.so-pre-loader .spinner-circle .sk-circle10 {
-webkit-transform: rotate(270deg);
-ms-transform: rotate(270deg);
transform: rotate(270deg); }
.so-pre-loader .spinner-circle .sk-circle11 {
-webkit-transform: rotate(300deg);
-ms-transform: rotate(300deg);
transform: rotate(300deg); }
.so-pre-loader .spinner-circle .sk-circle12 {
-webkit-transform: rotate(330deg);
-ms-transform: rotate(330deg);
transform: rotate(330deg); }
.so-pre-loader .spinner-circle .sk-circle2:before {
-webkit-animation-delay: -1.1s;
animation-delay: -1.1s; }
.so-pre-loader .spinner-circle .sk-circle3:before {
-webkit-animation-delay: -1s;
animation-delay: -1s; }
.so-pre-loader .spinner-circle .sk-circle4:before {
-webkit-animation-delay: -0.9s;
animation-delay: -0.9s; }
.so-pre-loader .spinner-circle .sk-circle5:before {
-webkit-animation-delay: -0.8s;
animation-delay: -0.8s; }
.so-pre-loader .spinner-circle .sk-circle6:before {
-webkit-animation-delay: -0.7s;
animation-delay: -0.7s; }
.so-pre-loader .spinner-circle .sk-circle7:before {
-webkit-animation-delay: -0.6s;
animation-delay: -0.6s; }
.so-pre-loader .spinner-circle .sk-circle8:before {
-webkit-animation-delay: -0.5s;
animation-delay: -0.5s; }
.so-pre-loader .spinner-circle .sk-circle9:before {
-webkit-animation-delay: -0.4s;
animation-delay: -0.4s; }
.so-pre-loader .spinner-circle .sk-circle10:before {
-webkit-animation-delay: -0.3s;
animation-delay: -0.3s; }
.so-pre-loader .spinner-circle .sk-circle11:before {
-webkit-animation-delay: -0.2s;
animation-delay: -0.2s; }
.so-pre-loader .spinner-circle .sk-circle12:before {
-webkit-animation-delay: -0.1s;
animation-delay: -0.1s; }
.so-pre-loader .spinner-cube-grid {
width: 60px;
height: 60px; }
.so-pre-loader .spinner-cube-grid .sk-cube {
width: 33%;
height: 33%;
background-color: white;
float: left;
-webkit-animation: sk-cubeGridScaleDelay 1.3s infinite ease-in-out;
animation: sk-cubeGridScaleDelay 1.3s infinite ease-in-out; }
.so-pre-loader .spinner-cube-grid .sk-cube1 {
-webkit-animation-delay: 0.2s;
animation-delay: 0.2s; }
.so-pre-loader .spinner-cube-grid .sk-cube2 {
-webkit-animation-delay: 0.3s;
animation-delay: 0.3s; }
.so-pre-loader .spinner-cube-grid .sk-cube3 {
-webkit-animation-delay: 0.4s;
animation-delay: 0.4s; }
.so-pre-loader .spinner-cube-grid .sk-cube4 {
-webkit-animation-delay: 0.1s;
animation-delay: 0.1s; }
.so-pre-loader .spinner-cube-grid .sk-cube5 {
-webkit-animation-delay: 0.2s;
animation-delay: 0.2s; }
.so-pre-loader .spinner-cube-grid .sk-cube6 {
-webkit-animation-delay: 0.3s;
animation-delay: 0.3s; }
.so-pre-loader .spinner-cube-grid .sk-cube7 {
-webkit-animation-delay: 0s;
animation-delay: 0s; }
.so-pre-loader .spinner-cube-grid .sk-cube8 {
-webkit-animation-delay: 0.1s;
animation-delay: 0.1s; }
.so-pre-loader .spinner-cube-grid .sk-cube9 {
-webkit-animation-delay: 0.2s;
animation-delay: 0.2s; }
.so-pre-loader .spinner-folding-cube {
width: 50px;
height: 50px;
position: relative;
-webkit-transform: rotateZ(45deg);
transform: rotateZ(45deg); }
.so-pre-loader .spinner-folding-cube .sk-cube {
float: left;
width: 50%;
height: 50%;
position: relative;
-webkit-transform: scale(1.1);
-ms-transform: scale(1.1);
transform: scale(1.1); }
.so-pre-loader .spinner-folding-cube .sk-cube:before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: white;
-webkit-animation: sk-foldCubeAngle 2.4s infinite linear both;
animation: sk-foldCubeAngle 2.4s infinite linear both;
-webkit-transform-origin: 100% 100%;
-ms-transform-origin: 100% 100%;
transform-origin: 100% 100%; }
.so-pre-loader .spinner-folding-cube .sk-cube2 {
-webkit-transform: scale(1.1) rotateZ(90deg);
transform: scale(1.1) rotateZ(90deg); }
.so-pre-loader .spinner-folding-cube .sk-cube3 {
-webkit-transform: scale(1.1) rotateZ(180deg);
transform: scale(1.1) rotateZ(180deg); }
.so-pre-loader .spinner-folding-cube .sk-cube4 {
-webkit-transform: scale(1.1) rotateZ(270deg);
transform: scale(1.1) rotateZ(270deg); }
.so-pre-loader .spinner-folding-cube .sk-cube2:before {
-webkit-animation-delay: 0.3s;
animation-delay: 0.3s; }
.so-pre-loader .spinner-folding-cube .sk-cube3:before {
-webkit-animation-delay: 0.6s;
animation-delay: 0.6s; }
.so-pre-loader .spinner-folding-cube .sk-cube4:before {
-webkit-animation-delay: 0.9s;
animation-delay: 0.9s; }
.so-pre-loader .so-loader-with-logo {
top: 0;
left: 0;
width: 100%;
height: 150px;
right: 0;
bottom: 0;
margin: auto;
text-align: center;
position: absolute; }
.so-pre-loader .so-loader-with-logo .logo {
display: block;
width: auto; }
.so-pre-loader .so-loader-with-logo .line {
background: #ccc;
bottom: 0;
height: 5px; }
.so-pre-loader .so-loader-with-logo .run-number {
color: #fff;
font-size: 50px;
font-weight: 600;
line-height: 80px; }
/* ************* END:: Pre-Loader CSS ************* */
/* **************************************************** */
/* ************ START Loader Animation ************ */
/* **************************************************** */
@-webkit-keyframes sk-rotateplane {
0% {
-webkit-transform: perspective(120px); }
50% {
-webkit-transform: perspective(120px) rotateY(180deg); }
100% {
-webkit-transform: perspective(120px) rotateY(180deg) rotateX(180deg); } }
@keyframes sk-rotateplane {
0% {
transform: perspective(120px) rotateX(0deg) rotateY(0deg);
-webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg); }
50% {
transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
-webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg); }
100% {
transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
-webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg); } }
@-webkit-keyframes sk-bounce {
0%, 100% {
-webkit-transform: scale(0); }
50% {
-webkit-transform: scale(1); } }
@keyframes sk-bounce {
0%, 100% {
transform: scale(0);
-webkit-transform: scale(0); }
50% {
transform: scale(1);
-webkit-transform: scale(1); } }
@-webkit-keyframes sk-stretchdelay {
0%, 40%, 100% {
-webkit-transform: scaleY(0.4); }
20% {
-webkit-transform: scaleY(1); } }
@keyframes sk-stretchdelay {
0%, 40%, 100% {
transform: scaleY(0.4);
-webkit-transform: scaleY(0.4); }
20% {
transform: scaleY(1);
-webkit-transform: scaleY(1); } }
@-webkit-keyframes sk-cubemove {
25% {
-webkit-transform: translateX(42px) rotate(-90deg) scale(0.5); }
50% {
-webkit-transform: translateX(42px) translateY(42px) rotate(-180deg); }
75% {
-webkit-transform: translateX(0px) translateY(42px) rotate(-270deg) scale(0.5); }
100% {
-webkit-transform: rotate(-360deg); } }
@keyframes sk-cubemove {
25% {
transform: translateX(42px) rotate(-90deg) scale(0.5);
-webkit-transform: translateX(42px) rotate(-90deg) scale(0.5); }
50% {
transform: translateX(42px) translateY(42px) rotate(-179deg);
-webkit-transform: translateX(42px) translateY(42px) rotate(-179deg); }
50.1% {
transform: translateX(42px) translateY(42px) rotate(-180deg);
-webkit-transform: translateX(42px) translateY(42px) rotate(-180deg); }
75% {
transform: translateX(0px) translateY(42px) rotate(-270deg) scale(0.5);
-webkit-transform: translateX(0px) translateY(42px) rotate(-270deg) scale(0.5); }
100% {
transform: rotate(-360deg);
-webkit-transform: rotate(-360deg); } }
@-webkit-keyframes sk-bouncedelay {
0%, 80%, 100% {
-webkit-transform: scale(0); }
40% {
-webkit-transform: scale(1); } }
@keyframes sk-bouncedelay {
0%, 80%, 100% {
-webkit-transform: scale(0);
transform: scale(0); }
40% {
-webkit-transform: scale(1);
transform: scale(1); } }
@-webkit-keyframes sk-circleBounceDelay {
0%, 80%, 100% {
-webkit-transform: scale(0);
transform: scale(0); }
40% {
-webkit-transform: scale(1);
transform: scale(1); } }
@keyframes sk-circleBounceDelay {
0%, 80%, 100% {
-webkit-transform: scale(0);
transform: scale(0); }
40% {
-webkit-transform: scale(1);
transform: scale(1); } }
@-webkit-keyframes sk-cubeGridScaleDelay {
0%, 70%, 100% {
-webkit-transform: scale3D(1, 1, 1);
transform: scale3D(1, 1, 1); }
35% {
-webkit-transform: scale3D(0, 0, 1);
transform: scale3D(0, 0, 1); } }
@keyframes sk-cubeGridScaleDelay {
0%, 70%, 100% {
-webkit-transform: scale3D(1, 1, 1);
transform: scale3D(1, 1, 1); }
35% {
-webkit-transform: scale3D(0, 0, 1);
transform: scale3D(0, 0, 1); } }
@-webkit-keyframes sk-foldCubeAngle {
0%, 10% {
-webkit-transform: perspective(140px) rotateX(-180deg);
transform: perspective(140px) rotateX(-180deg);
opacity: 0; }
25%, 75% {
-webkit-transform: perspective(140px) rotateX(0deg);
transform: perspective(140px) rotateX(0deg);
opacity: 1; }
90%, 100% {
-webkit-transform: perspective(140px) rotateY(180deg);
transform: perspective(140px) rotateY(180deg);
opacity: 0; } }
@keyframes sk-foldCubeAngle {
0%, 10% {
-webkit-transform: perspective(140px) rotateX(-180deg);
transform: perspective(140px) rotateX(-180deg);
opacity: 0; }
25%, 75% {
-webkit-transform: perspective(140px) rotateX(0deg);
transform: perspective(140px) rotateX(0deg);
opacity: 1; }
90%, 100% {
-webkit-transform: perspective(140px) rotateY(180deg);
transform: perspective(140px) rotateY(180deg);
opacity: 0; } }
/* *********** END:: Loader Animation ************* */
/* **************************************************** */
/*===============================================
[SASS DIRECTORY ]
[1] OVERLAY PATTER
==============================================*/
/*============OVERLAY PATTERN ==================*/
/* 1. Overlay pattern ---------------------*/
body.no-bgbody {
background-image: none; }
.pattern-1 {
background-image: url(../../images/patterns/1.png); }
.pattern-2 {
background-image: url(../../images/patterns/2.png); }
.pattern-3 {
background-image: url(../../images/patterns/3.png); }
.pattern-4 {
background-image: url(../../images/patterns/4.png); }
.pattern-5 {
background-image: url(../../images/patterns/5.png); }
.pattern-6 {
background-image: url(../../images/patterns/6.png); }
.pattern-7 {
background-image: url(../../images/patterns/7.png); }
.pattern-8 {
background-image: url(../../images/patterns/8.png); }
.pattern-9 {
background-image: url(../../images/patterns/9.png); }
.pattern-10 {
background-image: url(../../images/patterns/10.png); }
.pattern-11 {
background-image: url(../../images/patterns/11.png); }
.pattern-12 {
background-image: url(../../images/patterns/12.png); }
.pattern-13 {
background-image: url(../../images/patterns/13.png); }
.pattern-14 {
background-image: url(../../images/patterns/14.png); }
.pattern-15 {
background-image: url(../../images/patterns/15.png); }
.pattern-16 {
background-image: url(../../images/patterns/16.png); }
.pattern-17 {
background-image: url(../../images/patterns/17.png); }
.pattern-18 {
background-image: url(../../images/patterns/18.png); }
.pattern-19 {
background-image: url(../../images/patterns/19.png); }
.pattern-20 {
background-image: url(../../images/patterns/20.png); }
.pattern-21 {
background-image: url(../../images/patterns/21.png); }
.pattern-22 {
background-image: url(../../images/patterns/22.png); }
.pattern-23 {
background-image: url(../../images/patterns/23.png); }
.pattern-24 {
background-image: url(../../images/patterns/24.png); }
.pattern-25 {
background-image: url(../../images/patterns/25.png); }
.pattern-26 {
background-image: url(../../images/patterns/26.png); }
.pattern-27 {
background-image: url(../../images/patterns/27.png); }
.pattern-28 {
background-image: url(../../images/patterns/28.png); }
.pattern-29 {
background-image: url(../../images/patterns/29.png); }
.pattern-30 {
background-image: url(../../images/patterns/30.png); }
.pattern-31 {
background-image: url(../../images/patterns/31.png); }
.pattern-32 {
background-image: url(../../images/patterns/32.png); }
.pattern-33 {
background-image: url(../../images/patterns/33.png); }
.pattern-34 {
background-image: url(../../images/patterns/34.png); }
.pattern-35 {
background-image: url(../../images/patterns/35.png); }
.pattern-36 {
background-image: url(../../images/patterns/36.png); }
.pattern-37 {
background-image: url(../../images/patterns/37.png); }
.pattern-38 {
background-image: url(../../images/patterns/38.png); }
.pattern-39 {
background-image: url(../../images/patterns/39.png); }
.pattern-40 {
background-image: url(../../images/patterns/40.png); }
.pattern-41 {
background-image: url(../../images/patterns/41.png); }
.pattern-42 {
background-image: url(../../images/patterns/42.png); }
.pattern-43 {
background-image: url(../../images/patterns/43.png); }
.pattern-44 {
background-image: url(../../images/patterns/44.png); }
.pattern-45 {
background-image: url(../../images/patterns/45.png); }
.divider {
clear: both;
height: 40px; }
.alert {
border-radius: 0; }
.alert .fa {
font-size: 20px;
vertical-align: middle;
margin-right: 10px; }
.tab-content {
padding: 15px 15px 10px;
margin-bottom: 20px;
z-index: 2;
border: 1px solid #ddd;
border-top: 0px; }
.simple-ul {
margin: 0 0 15px 0;
padding: 0;
list-style: none; }
.simple-ul li {
position: relative;
padding-left: 15px;
margin-bottom: 5px; }
.simple-ul li:before {
position: absolute;
top: 0;
left: 0;
display: block;
content: "\f105";
font-family: 'FontAwesome';
font-size: 14px; }
.simple-ul li ul {
margin: 10px 0 10px 0;
padding: 0;
list-style: none; }
.simple-ul li ul li:before {
content: "\f111";
font-size: 7px;
top: 7px; }
.decimal-list {
margin: 0px 0 15px 20px;
padding: 0;
list-style: decimal outside; }
.decimal-list li {
padding-left: 0;
margin-bottom: 5px;
text-indent: 0; }
blockquote {
font-size: 12px; }
.well {
border-radius: 0; }
ul, ol {
list-style: none;
margin: 0;
padding: 0; }
.feature-box {
border-radius: 0;
margin-bottom: 20px; }
.feature-box .feature-icon {
color: #6e8f04;
display: inline-block;
font-size: 64px;
height: 65px;
text-align: center;
width: 65px;
float: left; }
.feature-box .feature-content {
padding-left: 80px; }
.featured-icon {
border-radius: 50%;
color: #fff;
background-color: #6e8f04;
display: inline-block;
font-size: 40px;
height: 110px;
line-height: 110px;
margin: 5px;
position: relative;
text-align: center;
width: 110px;
z-index: 1; }
.common-home .default-nav .owl2-nav div {
width: 28px;
height: 28px;
display: inline-block;
top: -34px;
cursor: pointer; }
.common-home .default-nav .owl2-nav div.owl2-prev {
background: url("../../images/icon/icon_general.png") no-repeat -20px -1111px; }
.common-home .default-nav .owl2-nav div.owl2-prev:hover {
background: url("../../images/icon/icon_general.png") no-repeat -20px -1063px transparent; }
.common-home .default-nav .owl2-nav div.owl2-next {
background: url("../../images/icon/icon_general.png") no-repeat -20px -1015px; }
.common-home .default-nav .owl2-nav div.owl2-next:hover {
background: url("../../images/icon/icon_general.png") -20px -967px transparent; }
.common-home .h3-nav .owl2-nav div {
width: 28px;
height: 28px;
display: inline-block;
top: -34px;
cursor: pointer; }
.common-home .h3-nav .owl2-nav div.owl2-prev {
background: url("../../images/icon/icon_general.png") no-repeat -20px -647px; }
.common-home .h3-nav .owl2-nav div.owl2-prev:hover {
background: url("../../images/icon/icon_general.png") no-repeat -20px -586px transparent; }
.common-home .h3-nav .owl2-nav div.owl2-next {
background: url("../../images/icon/icon_general.png") no-repeat -20px -403px; }
.common-home .h3-nav .owl2-nav div.owl2-next:hover {
background: url("../../images/icon/icon_general.png") -20px -342px transparent; }
.common-home .owl2-nav div {
width: 41px;
height: 41px;
display: inline-block;
top: 50%;
margin-top: -20px;
cursor: pointer;
transition: inherit; }
.common-home .owl2-nav div.owl2-prev {
background: url("../../images/icon/icon_general.png") no-repeat -20px -525px; }
.common-home .owl2-nav div.owl2-prev:hover {
background: url("../../images/icon/icon_general.png") no-repeat -20px -464px; }
.common-home .owl2-nav div.owl2-next {
background: url("../../images/icon/icon_general.png") no-repeat -20px -281px; }
.common-home .owl2-nav div.owl2-next:hover {
background: url("../../images/icon/icon_general.png") no-repeat -20px -220px; }
.common-home .owl2-nav div:before {
display: none; }
/*===============================================
[SASS DIRECTORY ]
[1] PAGE ACCOUNT
[2] PAGE INFORMATION
[3] PAGE CHECKOUT
[4] LANGUAGE CURENTY
[5] CSS FEAFURE MENU DEMO
==============================================*/
/*============PAGE ACCOUNT ==================*/
.account-login .well, .affiliate-login .well {
min-height: 395px;
background: #fff; }
.account-account #content > h2, .affiliate-account #content > h2 {
/* [4] */
/* [6] */
/* [6] */
/* [7] */
font-size: 16px;
font-size: 1.6rem;
/* [8] */ }
.account-account #content .list-unstyled, .affiliate-account #content .list-unstyled {
margin-bottom: 30px; }
.account-address #content .table-responsive .table > tbody > tr > td {
line-height: 24px;
padding: 10px; }
.custom-border {
border: 1px solid #eee;
padding: 10px 20px; }
/* @group List Box */
.list-box {
list-style: none;
margin: 0px;
padding: 0px; }
.rtl .wrapper-full {
overflow-x: hidden; }
.btn-link:focus, .btn-link:hover {
text-decoration: none; }
.dropdown-menu > li > button {
padding: 5px 15px; }
.list-box li {
border-bottom: 1px solid #ececec; }
.list-box li:last-child {
border-bottom: 0; }
.list-box li a {
display: inline-block;
word-wrap: break-word;
padding: 8px 0;
margin-right: 5px;
color: #555; }
.list-box li a:hover {
color: #6e8f04; }
/* @end */
/*============PAGE INFORMATION ==================*/
.simple-list {
margin: 0;
padding: 0;
list-style-type: none; }
.bold-list > li > a {
font-weight: 700;
text-transform: uppercase;
color: #555; }
.bold-list > li > a:hover {
color: #6e8f04; }
.simple-list ul {
margin: 0;
padding: 0;
list-style-type: none;
position: relative;
bottom: -0.8em; }
.simple-list li {
margin: 0;
padding: 0 0 12px; }
.simple-list ul a {
color: #555; }
.simple-list ul a:hover {
color: #6e8f04; }
.simple-list .checkbox {
padding-left: 0; }
.simple-list .checkbox input[type=checkbox] {
margin-right: 10px; }
.simple-list .icon {
margin-right: 9px; }
.arrow-list li {
padding-left: 12px;
position: relative; }
.arrow-list li:before {
margin-right: 10px;
font-size: 14px;
font-family: 'FontAwesome';
display: inline-block;
content: '\f105'; }
/*============PAGE CHECKOUT ==================*/
.checkout-cart .panel-group .panel, .checkout-checkout .panel-group .panel {
border-radius: 0; }
.checkout-cart .content_404 .item-left {
visibility: hidden; }
.table-responsive .table thead > * {
background-color: rgba(51, 51, 51, 0.1);
font-weight: bold; }
.table-responsive .table tbody td.text-left a {
font-weight: bold;
color: #7d7d7d; }
.table-responsive .table tbody td.text-left:hover a {
color: #6e8f04; }
/*============LANGUAGE CURENTY ==================*/
.btn-group .btn-link {
text-align: left;
background: transparent;
text-decoration: none;
padding: 5px 10px;
color: #2d2d2d;
font-weight: normal;
position: relative;
z-index: 1; }
.btn-group .btn-link:hover {
color: #6e8f04; }
.dropdown-menu .btn-block {
border: none;
background: transparent;
text-align: left; }
/*============ CSS FEAFURE MENU DEMO ==================*/
.feature-layout .image-link {
color: #555; }
.feature-layout .image-link:hover {
color: #6e8f04; }
.feature-layout .image-link .thumbnail {
position: relative;
overflow: hidden;
border-radius: 0;
background: #333;
padding: 0; }
.feature-layout .image-link .btn {
position: absolute;
top: -100px;
left: calc(50% - 50px);
padding: 9px 20px;
background: #555;
color: #fff;
border-radius: 3px;
border: none;
background: #6e8f04;
border-color: #6e8f04;
-webkit-transition: all 0.3s ease-in-out 0s;
-moz-transition: all 0.3s ease-in-out 0s;
transition: all 0.3s ease-in-out 0s;
border-radius: 2px; }
.feature-layout .image-link .btn:hover {
background: #6e8f04;
border-color: #6e8f04;
color: #fff; }
.feature-layout .image-link .btn:hover {
background: #555;
border-color: #555; }
.feature-layout .image-link:hover .thumbnail {
border: 1px solid #ccc; }
.feature-layout .image-link:hover .thumbnail img {
opacity: 0.7; }
.feature-layout .image-link:hover .btn {
top: calc(50% - 25px); }
.feature-layout .image-link .figcaption {
font-size: 13px;
text-align: center;
font-weight: 600;
text-transform: uppercase; }
.with-sub-menu .feafure-dr {
text-align: left; }
.with-sub-menu .feafure-dr h3.title-feature {
display: block;
font-weight: 700;
font-size: 14px;
line-height: 1em;
text-transform: uppercase;
color: #444;
margin-bottom: 15px; }
.with-sub-menu .feafure-dr ul.row-list {
list-style: none;
padding: 0; }
.with-sub-menu .feafure-dr li {
line-height: 30px; }
.with-sub-menu .feafure-dr li a {
font-size: 14px;
position: relative;
color: #7d7d7d; }
.with-sub-menu .feafure-dr li a:hover {
color: #6e8f04; }
.with-sub-menu .feafure-dr .layout-color li a {
text-transform: capitalize; }
.with-sub-menu .feafure-dr .layout-color li a:before {
content: "";
display: inline-block;
width: 20px;
height: 20px;
position: relative;
background-color: #e1e1e1;
margin-right: 10px;
vertical-align: middle;
left: 0; }
.with-sub-menu .feafure-dr .layout-color li.orange a:before {
background: #fe5621; }
.with-sub-menu .feafure-dr .layout-color li.blue a:before {
background: #02a8f3; }
.with-sub-menu .feafure-dr .layout-color li.brown a:before {
background: #beae59; }
.with-sub-menu .feafure-dr .layout-color li.green a:before {
background: #8ac249; }
.with-sub-menu .feafure-dr .layout-color li.red a:before {
background: #df1f26; }
.with-sub-menu .feafure-dr .layout-color li.pink a:before {
background: #e81d62; }
/*===============================================
[SASS DIRECTORY ]
[1] MODULE DEFAULT
[2] BLOCK SEARCH
[3] SOCIAL FOOTER
==============================================*/
/*============MODULE DEFAULT ==================*/
.module {
margin-bottom: 40px; }
.module:before, .module:after {
content: " ";
display: table; }
.module:after {
clear: both; }
.module.fa-hidden h3.modtitle:before {
display: none; }
.module h3.modtitle {
background: #f2f2f2;
line-height: 100%;
padding: 10px 0 9px 15px;
border-bottom: 1px solid #e8e8e8;
margin-bottom: 0; }
.module h3.modtitle .fa {
color: #6e8f04;
margin-right: 5px; }
.module h3.modtitle:before {
color: #6e8f04;
content: '\f219';
font-family: FontAwesome;
font-size: 18px;
display: inline-block;
margin-right: 7px; }
.module h3.modtitle span {
font-size: 16px;
text-transform: uppercase;
color: #222;
font-weight: 700;
display: inline-block; }
.top-brand.arrow-default .owl2-nav {
position: static; }
.yt-content-slider.arrow-default .owl2-nav {
position: static; }
.module.sohomepage-slider .so-homeslider img {
transform-style: initial; }
.title-margin h3.modtitle {
margin-bottom: 15px; }
.title-underline h3.modtitle {
font-size: 16px;
text-transform: uppercase;
font-weight: bold;
position: relative; }
.title-underline h3.modtitle:after {
content: " ";
width: 125px;
height: 1px;
background: #6e8f04;
display: block;
position: absolute;
bottom: 0;
margin-bottom: -1px; }
.title-cart-h6 {
display: none; }
.bordered_content {
border-radius: 3px;
border: 1px solid #eaeaea;
background: #fff; }
.yt-content-slider .owl2-controls {
margin: 0; }
body .block-popup-login .tt_popup_login strong {
background-color: #6e8f04; }
body .block-popup-login .block-content .btn-reg-popup {
background-color: #6e8f04; }
body .block-popup-login .block-content .btn-reg-popup:hover {
background: #485d03; }
body .block-popup-login .tt_popup_login strong:before {
border-bottom: 37px solid #6e8f04; }
body .block-popup-login .tt_popup_login {
border-color: #6e8f04; }
/************************************************************************************************
EXTRASLIDER BESTSELER
*************************************************************************************************/
.best-seller-custom.best-seller {
position: relative;
margin: 0;
border: 1px solid #e8e8e8; }
.best-seller-custom.best-seller .so-extraslider {
margin: 0; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner {
padding-bottom: 0;
border: none; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item-wrap-inner {
margin: 18px 0 8px; }
@media (min-width: 1200px) {
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item-wrap-inner {
padding-left: 10px; } }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 {
border-bottom: none;
margin-bottom: 2px; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1:last-child {
border-bottom: 0;
margin-bottom: 0; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-left {
float: left;
width: 100px; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-left .item-image {
border: 0; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-left .item-image:hover {
box-shadow: none;
opacity: 0.8; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-body .item-info {
background: transparent;
position: static;
color: #222; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-body .item-info a {
color: #222; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-body .item-info .item-title {
padding: 0 0 5px 0; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-body .item-info .item-title a {
text-transform: capitalize;
font-size: 14px;
font-weight: normal; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-body .item-info .item-title a:hover {
color: #6e8f04; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-body .item-info .rating {
display: none; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-body .item-info .item-content {
margin-left: 0; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-body .item-info .item-content .content_price span {
color: #ff5e00;
font-size: 16px;
font-weight: bold; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-body .item-info .item-content .content_price span.price-old {
font-size: 13px;
color: #999;
font-weight: 600; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-body .item-info .rating {
padding: 0; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1:hover .item-title a {
color: #6e8f04; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item-wrap .item-info .item-content .content_price {
margin-bottom: 0; }
.best-seller-custom.best-seller .so-extraslider .owl2-controls {
margin-bottom: 8px;
text-align: right;
position: absolute;
top: 4px;
vertical-align: middle;
right: 5px; }
.best-seller-custom.best-seller .so-extraslider .owl2-controls .owl2-nav > div {
width: 17px;
height: 30px;
text-align: center;
display: inline-block;
line-height: 30px;
font-size: 0;
cursor: pointer;
color: #999;
background-color: transparent;
margin-top: 0;
position: static;
float: left; }
.best-seller-custom.best-seller .so-extraslider .owl2-controls .owl2-nav > div:hover {
color: #6e8f04; }
.best-seller-custom.best-seller .so-extraslider .owl2-controls .owl2-prev:before {
content: "\f104";
font-family: FontAwesome;
font-size: 28px; }
.best-seller-custom.best-seller .so-extraslider .owl2-controls .owl2-next:before {
content: "\f105";
font-family: FontAwesome;
font-size: 28px; }
/*============MODULE NEWLETTER POPUP ==================*/
.main-newsleter-popup .so-custom-popup {
background-color: #fff; }
@media (min-width: 768px) and (max-width: 991px) {
.main-newsleter-popup .so-custom-popup {
width: 85% !important; }
.main-newsleter-popup .so-custom-popup:before {
content: "";
position: absolute;
z-index: 2;
background: rgba(255, 255, 255, 0.9);
width: 100%;
height: 100%;
top: 0;
right: 0; } }
@media (max-width: 767px) {
.main-newsleter-popup .so-custom-popup:before {
content: "";
position: absolute;
z-index: 2;
background: rgba(255, 255, 255, 0.9);
width: 100%;
height: 100%;
top: 0;
right: 0; } }
.main-newsleter-popup .modcontent {
position: relative;
z-index: 9; }
.main-newsleter-popup .modcontent:before {
position: absolute;
content: "";
bottom: 0;
left: 0;
background: #6e8f04;
width: 100%;
height: 110px;
opacity: 0.7; }
.main-newsleter-popup .so-custom-popup .oca_popup .popup-content {
padding: 15px 10px 0;
text-align: left; }
@media (min-width: 1200px) {
.main-newsleter-popup .so-custom-popup .oca_popup .popup-content {
padding: 65px 45px 0;
margin: 0 20px; } }
@media (min-width: 992px) and (max-width: 1199px) {
.main-newsleter-popup .so-custom-popup .oca_popup .popup-content {
padding: 60px 30px 0;
margin: 0 20px; } }
.main-newsleter-popup .so-custom-popup .oca_popup .popup-content .popup-title {
color: #222;
font-size: 30px;
text-transform: uppercase;
font-weight: 700;
letter-spacing: 3px;
line-height: 100%; }
.main-newsleter-popup .so-custom-popup .oca_popup .popup-content .newsletter_promo {
color: #555;
padding-top: 8px;
padding-bottom: 16px;
font-size: 16px; }
.main-newsleter-popup .so-custom-popup .oca_popup .popup-content .newsletter_promo span {
font-size: 30px;
color: #6e8f04; }
.main-newsleter-popup .so-custom-popup .oca_popup .popup-content .email {
margin: 0; }
.main-newsleter-popup .so-custom-popup .oca_popup .popup-content .input-control {
position: relative;
width: 400px;
display: inline-block;
margin-top: 20px; }
.main-newsleter-popup .so-custom-popup .oca_popup .popup-content .form-control {
background: white;
border: 1px solid #ebebeb;
display: inline-block;
width: 100%;
height: 44px; }
.main-newsleter-popup .so-custom-popup .oca_popup .popup-content .hidden-popup {
font-weight: normal; }
.main-newsleter-popup .so-custom-popup .oca_popup .popup-content .btn-default {
font-size: 20px;
height: 40px;
background: #fff;
color: #6e8f04;
border: none;
position: absolute;
padding: 0 10px;
top: 2px;
margin: 0;
right: 2px; }
.main-newsleter-popup .so-custom-popup .oca_popup .popup-content .newsletter_promo {
padding: 15px 0 10px; }
.main-newsleter-popup .socials-popup {
position: relative;
z-index: 1;
padding: 30px 0;
text-align: center; }
@media (min-width: 1200px) {
.main-newsleter-popup .socials-popup {
padding: 65px 0 30px; } }
.main-newsleter-popup .socials-popup p {
color: #fff;
text-transform: uppercase;
font-size: 16px;
font-weight: 700; }
.main-newsleter-popup .socials-popup li {
display: inline-block; }
.main-newsleter-popup .socials-popup li a {
display: inline-block;
line-height: 34px;
text-align: center;
width: 34px;
height: 34px;
color: #222;
border-radius: 100%;
font-size: 16px;
background-color: #fff;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
margin: 0 3px; }
.main-newsleter-popup .socials-popup li a:hover {
color: #6e8f04; }
.custom-pop .popup-close {
background: #000;
border-radius: 100%;
width: 30px;
height: 30px;
color: #fff;
text-align: center;
font-size: 18px;
line-height: 26px;
opacity: 1;
top: -15px;
border: 2px solid #fff;
right: -15px;
left: auto; }
/*============MODULE BREADCRUMB ==================*/
.breadcrumb {
margin: 0;
background-color: #fff;
padding: 36px 0 31px; }
.breadcrumb li a {
color: #7d7d7d;
text-transform: uppercase;
font-size: 13px;
font-weight: 600; }
.breadcrumb > li + li:before {
padding: 0 5px;
content: '\f105';
display: inline-block;
font-family: FontAwesome;
color: #666;
font-size: 14px; }
/*============ MODULE MEGAMENU HORIZOL ==================*/
.container-megamenu.horizontal .feafute h4.title-feature, .container-megamenu.horizontal .title-feature, .container-megamenu.horizontal ul.megamenu .title-submenu, .container-megamenu.horizontal ul.megamenu li .sub-menu .content .static-menu a.main-menu, .container-megamenu.horizontal ul.megamenu .subcategory a.title-submenu {
font-size: 16px;
color: #222;
text-transform: uppercase;
padding: 15px 0;
border-bottom: 1px solid #eaeaea;
margin-bottom: 5px;
font-weight: bold; }
.container-megamenu.horizontal .best-sellers-menu {
margin-top: 20px; }
.container-megamenu.horizontal .best-sellers-menu h4 a {
color: #222;
display: inline-block;
clear: both;
margin-top: 20px;
margin-bottom: 0px; }
.container-megamenu.horizontal .best-sellers-menu h4 a:hover {
color: #6e8f04; }
.container-megamenu.horizontal .content-feature li a {
padding: 5px 0;
display: inline-block;
text-transform: capitalize;
font-size: 13px;
color: #7d7d7d; }
.container-megamenu.horizontal .content-feature li a:hover {
color: #6e8f04; }
.container-megamenu.horizontal ul.megamenu li .sub-menu .content .html a.subcategory_item {
display: inline-block;
padding: 3px 0;
text-transform: capitalize;
font-size: 13px;
color: #7d7d7d; }
.container-megamenu.horizontal ul.megamenu li .sub-menu .content .html a.subcategory_item:hover {
color: #6e8f04; }
.container-megamenu.horizontal ul.megamenu li .sub-menu .content .static-menu .menu ul ul li a, .container-megamenu.horizontal ul.megamenu .sub-menu .content .hover-menu .menu ul a.main-menu {
padding: 9px 0;
text-transform: capitalize;
font-size: 13px;
color: #7d7d7d; }
.container-megamenu.horizontal ul.megamenu li .sub-menu .content .static-menu .menu ul ul li a:hover, .container-megamenu.horizontal ul.megamenu .sub-menu .content .hover-menu .menu ul a.main-menu:hover {
color: #6e8f04; }
.container-megamenu.horizontal ul.megamenu > li > a strong img {
position: absolute;
top: -15px;
right: 30px; }
/*============ MODULE MEGAMENU VERTICAL ==================*/
.container-megamenu.vertical a {
color: #555;
font-size: 13px;
display: block; }
.container-megamenu.vertical a:hover {
color: #6e8f04; }
.container-megamenu.vertical #menuHeading {
margin-top: 0;
height: 58px;
cursor: pointer; }
.container-megamenu.vertical #menuHeading .megamenuToogle-wrapper {
background-color: #6e8f04;
height: 58px;
cursor: pointer;
-webkit-transition: 0.3s all ease 0s;
-moz-transition: 0.3s all ease 0s;
transition: 0.3s all ease 0s;
border-radius: 0; }
.container-megamenu.vertical #menuHeading .megamenuToogle-wrapper .container {
font-size: 13px;
text-transform: uppercase;
font-weight: bold;
padding: 0 0 0 15px !important;
line-height: 58px;
background: #2d2d2d; }
.container-megamenu.vertical #menuHeading .megamenuToogle-wrapper .container:before {
width: 19px;
height: 14px;
display: inline-block;
background: url("../../images/icon/icon_general.png") no-repeat -20px -1379px;
margin-right: 10px; }
.container-megamenu.vertical #menuHeading .megamenuToogle-wrapper .container > div {
margin: 3px 9px 0 0;
float: left !important;
display: none; }
.container-megamenu.vertical:after {
content: "\f0d7";
font-family: fontawesome;
font-size: 12px;
position: absolute;
top: 22px;
z-index: 10;
color: #fff;
line-height: 13px;
text-align: center;
width: 15px;
border-radius: 100%;
border: 1px solid #fff;
right: 13px; }
.container-megamenu.vertical .vertical-wrapper {
width: 100%;
background: white;
position: relative;
border-top: 0; }
.container-megamenu.vertical .vertical-wrapper ul li {
border-top: 0;
min-height: 37px; }
.container-megamenu.vertical .vertical-wrapper ul li > a {
color: #444;
padding: 0 18px;
line-height: 48px;
border-bottom: 0; }
.container-megamenu.vertical .vertical-wrapper ul li > a:hover {
color: #6e8f04; }
.container-megamenu.vertical .vertical-wrapper ul li > a strong {
font-weight: 600;
padding-left: 30px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu {
border: 1px solid #efefef;
border-top: none;
background: #fff; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .sub-menu .content .img-banner img {
width: 100%; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .sub-menu .content .img-banner {
padding-right: 15px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu > li .sub-menu .content .banner {
margin-top: -21px;
margin-bottom: -22px;
margin-right: -21px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu > li > a img {
height: auto;
margin: 0;
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 2px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu > li {
padding: 0 15px;
background: none;
border: 0;
position: relative;
z-index: 1;
cursor: pointer; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu > li b.fa {
float: right;
line-height: 50px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu > li > a {
padding: 0;
font-size: 14px;
color: #222;
border-bottom: 1px solid #e1e1e1; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu > li > a strong i {
font-size: 9px;
padding-right: 5px;
color: #222; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu > li.active > a, .container-megamenu.vertical .vertical-wrapper ul.megamenu > li:hover > a {
background: transparent !important;
color: #6e8f04; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu > li.active > a i, .container-megamenu.vertical .vertical-wrapper ul.megamenu > li:hover > a i {
color: #6e8f04; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .title-submenu {
color: #444; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .fa-caret-right {
float: right;
margin-top: 5px;
color: #999;
padding: 0; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style1 .content {
padding: 20px 0 0 20px;
overflow: hidden; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style1 .content .col-sm-4 {
padding: 0; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style1 .content .col-sm-4 img {
margin-top: 45px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style1 .content > .border {
border: none;
padding: 0; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style1 .content .row:nth-child(3) {
padding: 12px 0px;
background: #eee;
margin: 0 -20px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style2 .content {
padding-right: 0;
padding-bottom: 0;
padding-top: 0; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style2 .content .static-menu .menu ul li {
padding: 0;
line-height: 26px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style2 .content .static-menu .menu ul li a.main-menu {
margin: 0 0 10px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style2 .content .static-menu .menu > ul {
margin-top: 20px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style2 .content .static-menu .menu > ul ul li {
padding: 1px 0; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style2 .content .static-menu .menu > ul > li {
margin: 0 0 20px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style2 .content .static-menu .menu > ul > li:last-child {
margin: 0; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style3 .content > .border {
border: none;
padding: 0; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style3 .content .image-position {
position: absolute;
bottom: 30%;
right: -20px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.css-menu .content {
padding: 0; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.css-menu .content .menu > ul {
padding: 0; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.css-menu .content .menu > ul > li {
padding: 0 15px;
position: relative;
border-bottom: 1px solid #ddd;
line-height: 26px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.css-menu .content .menu > ul > li:last-child {
border: none; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.css-menu .content .menu > ul > li > a {
line-height: 37px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.css-menu .content .menu > ul > li b {
line-height: 37px;
font-size: 16px;
margin: 0; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.css-menu .content .menu > ul > li:hover > a {
color: #6e8f04; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.css-menu .content .menu > ul > li ul {
padding: 0;
top: -4px;
margin: 0;
box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.2);
border: 1px solid #e6e6e6;
left: 100%; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.css-menu .content .menu > ul > li ul:before, .container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.css-menu .content .menu > ul > li ul:after {
display: none; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.css-menu .content .menu > ul > li ul li {
line-height: 22px;
padding: 0 15px;
border-bottom: 1px solid #ddd; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.css-menu .content .menu > ul > li ul li:last-child {
border: none; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.css-menu .content .menu > ul > li ul li > a {
font-weight: normal;
line-height: 37px;
font-size: 13px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu li .sub-menu .content {
border: 1px solid #e6e6e6;
padding: 20px 30px;
box-shadow: 3px 1px 4px 0 rgba(0, 0, 0, 0.1); }
.container-megamenu.vertical .vertical-wrapper ul.megamenu li .sub-menu .content .hover-menu a:before {
display: none; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu li .sub-menu .content .hover-menu a:hover:before {
color: #6e8f04; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu li .sub-menu .content .static-menu .menu ul li a.main-menu {
margin: 0 0 10px;
border-bottom: 1px solid #eaeaea;
padding: 0 0 10px;
font-size: 16px;
color: #222;
text-transform: uppercase; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu li .sub-menu .content .static-menu .menu ul ul {
padding: 0; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu li .sub-menu .content .static-menu .menu ul ul li {
padding: 0; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu li .sub-menu .content .static-menu .menu ul ul li a {
padding: 0;
line-height: 38px;
display: block;
font-size: 13px;
color: #7d7d7d; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu li .sub-menu .content .static-menu .menu ul ul li:before {
display: none; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu li .sub-menu .content .static-menu .menu ul ul li:hover a {
color: #6e8f04; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .loadmore {
text-align: left;
background-position: top left;
padding: 12px 20px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .loadmore i.fa {
padding: 0;
font-size: 10px;
border: 1px solid #999;
width: 15px;
color: #999;
height: 15px;
line-height: 13px;
text-align: center;
border-radius: 100%;
position: relative;
top: -1px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .loadmore span.more-view {
font-weight: 600;
color: #222;
padding-left: 12px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .loadmore span.more-view:hover {
color: #6e8f04; }
/*============CATEGORY SIMPLE BLOG==================*/
.blog-category {
border-radius: 0;
border: 0;
box-shadow: none;
margin: 0; }
.blog-category .blog-cate {
border: 1px solid #e8e8e8; }
.blog-category .box-content {
margin-bottom: 30px; }
.blog-category .box-content ul {
margin-bottom: 0; }
.blog-category #blog-search input {
border-radius: 0; }
.blog-category ul.list-group {
padding: 0;
margin: 0; }
.blog-category ul li.list-group-item {
border-radius: 0;
border: 0;
border-bottom: 1px solid #e8e8e8;
margin: 0;
padding: 10px 0; }
.blog-category ul li.list-group-item a {
color: #7d7d7d;
padding: 0 20px; }
.blog-category ul li.list-group-item a:hover, .blog-category ul li.list-group-item a.active, .blog-category ul li.list-group-item a.active:hover {
color: #6e8f04; }
.blog-category ul li.list-group-item:last-child {
border: none; }
ul.megamenu .best-sellers-menu {
padding: 0; }
ul.megamenu .best-sellers-menu .image {
overflow: hidden; }
ul.megamenu .best-sellers-menu .caption {
overflow: hidden; }
ul.megamenu .best-sellers-menu .caption h4 a {
font-size: 14px;
font-weight: normal; }
ul.megamenu .best-sellers-menu .caption p {
display: none; }
ul.megamenu .best-sellers-menu .caption .price {
display: inline-block; }
ul.megamenu .best-sellers-menu .caption .price .price-old, ul.megamenu .best-sellers-menu .caption .price .price-tax {
display: none; }
ul.megamenu li.buy_color a strong {
color: #6e8f04; }
ul.megamenu .layout-color .content-feature li a {
position: relative; }
ul.megamenu .layout-color .content-feature li a:before {
content: "";
display: inline-block;
width: 20px;
height: 20px;
position: relative;
background-color: #e1e1e1;
vertical-align: middle;
left: 0;
margin-right: 10px; }
ul.megamenu .layout-color .content-feature li.red a:before {
background: #ea3a3c; }
ul.megamenu .layout-color .content-feature li.orange a:before {
background: #f4a137; }
ul.megamenu .layout-color .content-feature li.green a:before {
background: #20bc5a; }
ul.megamenu .layout-color .content-feature li.cyan a:before {
background: #009688; }
ul.megamenu .layout-color .content-feature li.blue a:before {
background: #5f87d1; }
/*============MODULE FILTER ==================*/
.module.so_filter_wrap {
border: 1px solid #e8e8e8; }
.module.so_filter_wrap .modcontent {
border: none;
background: #fff;
border-radius: 0; }
.module.so_filter_wrap .modcontent .so-filter-heading {
padding: 0 20px; }
.module.so_filter_wrap .modcontent .so-filter-heading i {
padding: 18px 0 0; }
.module.so_filter_wrap .modcontent .so-filter-heading .so-filter-heading-text {
float: left;
padding: 15px 0 0px;
color: #444;
font-weight: 700;
text-transform: uppercase; }
.module.so_filter_wrap .modcontent .so-filter-content-opts {
padding: 0 20px; }
.module.so_filter_wrap .modcontent #text_search {
height: 30px; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container {
padding-top: 5px;
padding-left: 0px;
padding-right: 0px;
padding-bottom: 15px; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .so-filter-option label {
font-size: 12px; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .opt-select {
border: none; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .noUi-horizontal .noUi-handle {
border-radius: 100%;
/* &.noUi-handle-lower{left: 0;}
&.noUi-handle-upper{right: 15px; left: initial;}*/ }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .noUi-horizontal .noUi-handle:before, .module.so_filter_wrap .modcontent .so-filter-content-opts-container .noUi-horizontal .noUi-handle:after {
display: none; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .put-min_max {
display: inline-block;
background: #fff;
border: 1px solid #ddd;
width: 49%;
padding: 0 5px;
float: left; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .put-min_max.put-min {
margin-right: 2%; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .put-min_max input {
background: transparent; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .option-input img {
display: none; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .option-input .fa-check-square-o, .module.so_filter_wrap .modcontent .so-filter-content-opts-container .option-input .fa-square-o {
display: none; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .option-count.opt_close {
background: #6e8f04; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .input-group {
border: 1px solid #ddd; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .input-group .form-control {
background: transparent; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .input-group .btn.btn-default {
padding: 7px;
color: #555;
background: transparent;
border-radius: 0; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .input-group .btn.btn-default:hover {
background: #6e8f04;
color: #fff; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .so-filter-option:hover .option-input:before {
background-color: transparent;
border: 2px solid #999; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .so-filter-option .option-input:before {
margin-top: -7px !important; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .so-filter-option.opt_active .option-input:before {
background-color: transparent;
border: 2px solid #999; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .so-filter-option .option-input, .module.so_filter_wrap .modcontent .so-filter-content-opts-container .so-filter-option-sub {
position: relative;
padding-left: 14px; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .so-filter-option .option-input:before, .module.so_filter_wrap .modcontent .so-filter-content-opts-container .so-filter-option-sub:before {
display: inline-block;
content: "";
width: 12px;
height: 12px;
position: absolute;
top: 50%;
margin-top: -10px;
left: 0;
background-color: #999;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .so-filter-option .option-input:hover:before, .module.so_filter_wrap .modcontent .so-filter-content-opts-container .so-filter-option-sub:hover:before {
background-color: transparent;
border: 2px solid #999; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .so-filter-option .option-input .fa-circle, .module.so_filter_wrap .modcontent .so-filter-content-opts-container .so-filter-option-sub .fa-circle {
display: none; }
.module.so_filter_wrap .modcontent .noUi-horizontal .noUi-handle {
top: -5px; }
.module.so_filter_wrap .modcontent li.so-filter-options {
border-bottom: 1px solid #e8e8e8;
margin-bottom: 7px; }
.module.so_filter_wrap .modcontent .so-filter-option.so-filter-price {
text-align: left;
padding: 0; }
.module.so_filter_wrap .modcontent .so-filter-option.so-filter-price .content_scroll {
margin: 30px 15px 20px; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container ul li {
float: left; }
.module.so_filter_wrap .modcontent .so-filter-option.so-filter-price .content_min_max {
display: block; }
.module.so_filter_wrap .modcontent .so-filter-option.so-filter-price .content_min_max .txt-price-shopby {
min-width: 60px;
width: 49%;
padding: 0 5px;
display: inline-block;
float: left;
border: 1px solid #ddd;
display: inline-block; }
.module.so_filter_wrap .modcontent .so-filter-option.so-filter-price .content_min_max .txt-price-shopby.txt-price-shopby-fisrt {
margin-right: 2%; }
.module.so_filter_wrap .modcontent .so-filter-option.so-filter-price .content_min_max .txt-price-shopby span {
display: table-cell;
vertical-align: middle; }
.module.so_filter_wrap .modcontent .so-filter-option.so-filter-price .content_min_max .txt-price-shopby span.text-current {
position: relative;
top: 1px; }
.module.so_filter_wrap .modcontent .so-filter-option.so-filter-price .content_min_max .input_max, .module.so_filter_wrap .modcontent .so-filter-option.so-filter-price .content_min_max .input_min {
border: none;
box-shadow: none;
padding: 0;
margin: 0; }
.module.so_filter_wrap .modcontent .noUi-handle {
background-color: #fff;
border: 1px solid #e9e9e9;
width: 15px;
height: 15px; }
.module.so_filter_wrap .modcontent .noUi-connect {
box-shadow: none;
background-color: #555;
height: 8px;
border-radius: 5px; }
.module.so_filter_wrap .modcontent .noUi-background {
background: #6e8f04;
box-shadow: none;
height: 8px; }
.module.so_filter_wrap .modcontent .noUi-horizontal .noUi-handle-upper {
right: 15px; }
.module.so_filter_wrap .modcontent .noUi-target {
border: none; }
.module.so_filter_wrap .modcontent .noUi-background {
background: #ddd; }
.module.so_filter_wrap .modcontent #btn_resetAll {
padding: 8px 15px;
font-size: 14px;
font-weight: bold;
text-transform: uppercase;
color: #fff; }
.module.so_filter_wrap .modcontent #btn_resetAll .fa.fa-times {
color: #6e8f04; }
.so-filter-content-opts-container .option-count {
background: #999;
min-width: 24px;
text-align: center; }
.so-filter-content-opts-container .option-count:not(.opt_close):after {
border-right-color: #999; }
.so_filter_wrap .modcontent .so-filter-heading .so-filter-heading-text {
float: left;
font-size: 12px;
color: #222; }
.so_filter_wrap .modcontent .so-filter-heading i {
float: right; }
.so_filter_wrap .modcontent .so-filter-content-opts-container label {
font-weight: normal; }
.so_filter_wrap .modcontent .so-filter-content-opts-container .option-count {
float: right; }
#content .filter-horizontal .so-filter-heading {
padding: 0 15px; }
#content .filter-horizontal .so-filter-content-opts-container {
padding: 15px; }
#content .filter-horizontal ul {
display: -webkit-box;
display: -moz-box;
display: box;
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: flex; }
#content .filter-horizontal li.so-filter-options {
-webkit-box-flex: 1;
-moz-box-flex: 1;
box-flex: 1;
-webkit-flex: 1;
-moz-flex: 1;
-ms-flex: 1;
flex: 1;
border: none;
border-right: 1px solid #eaeaea;
margin: 0; }
#content .filter-horizontal li.so-filter-options:last-child {
border-right: none; }
#content .filter-horizontal .clear_filter {
border-top: 1px solid #eaeaea; }
/*============MODULE CATEGORY ==================*/
.category-style {
border: 1px solid #e8e8e8; }
.box-category ul {
list-style: none;
padding: 0px;
margin: 0px; }
.box-category > ul > li {
padding: 0px;
position: relative;
margin: 0;
box-shadow: none;
background: transparent;
border-bottom: 1px solid #e8e8e8; }
.box-category > ul > li:last-child {
border: none; }
.box-category ul li a {
padding: 10px 20px;
display: block;
color: #7d7d7d;
font-weight: 600;
font-family: Raleway; }
.box-category ul li a.active {
color: #6e8f04; }
.box-category ul li .head a:before {
content: "\f107";
display: inline-block;
font: normal normal normal 14px/1 'FontAwesome'; }
.box-category ul li .head .collapsed:before {
content: "\f105"; }
.box-category ul li .head {
display: block;
position: absolute;
top: 5px;
line-height: 20px;
right: 10px;
text-align: center; }
.box-category ul li .head a {
padding: 9px 20px;
background: #555;
color: #fff;
border-radius: 3px;
border: none;
background: #999;
width: 20px;
height: 20px;
padding: 0;
border-radius: 3px;
margin-top: 8px; }
.box-category ul li .head a:hover {
background: #6e8f04;
border-color: #6e8f04;
color: #fff; }
.box-category ul li .head a:hover {
background: #6e8f04; }
.box-category ul li ul li {
padding: 0px 0px 0px 15px; }
.box-category ul ul {
margin-bottom: 20px; }
.box-category ul ul li a {
padding: 3px 0; }
.box-category ul li ul li a:before {
font-family: 'FontAwesome';
transition: all 0.3s ease;
content: "\f105";
margin: 0 5px 0; }
.box-category ul li ul li a:hover:before {
margin-right: 10px; }
.basic-product-list .item-element {
margin-bottom: 20px; }
.basic-product-list .item-element:hover .image {
border-color: #6e8f04; }
.basic-product-list .image {
float: left;
border: 1px solid #ddd;
padding: 0;
margin-right: 20px; }
.basic-product-list .caption {
overflow: hidden; }
.basic-product-list h4 {
font-size: 15px;
margin: 0 0 5px; }
.basic-product-list h4 a {
color: #555; }
.basic-product-list h4 a:hover {
color: #6e8f04; }
.tag-button a {
padding: 9px 20px;
background: #eee;
color: #333;
border-radius: 3px;
border: none;
padding: 6px 10px;
display: inline-block;
margin: 0 4px 4px 0; }
.tag-button a:hover {
background: #6e8f04;
border-color: #6e8f04;
color: #fff; }
div.so-extraslider.grid {
border-left: 1px solid #ddd; }
div.so-extraslider.grid .extraslider-inner {
border: none;
padding: 0; }
div.so-extraslider.grid .owl2-dots .owl2-dot.active {
background: #6e8f04; }
div.so-extraslider.grid div.owl2-controls {
right: 10px; }
div.so-extraslider.grid div.owl2-controls .owl2-nav .owl2-next, div.so-extraslider.grid div.owl2-controls .owl2-nav .owl2-prev {
background: #fff;
border: 1px solid #a0a0a0;
opacity: 1; }
div.style-dev-so-listing-tabs {
position: relative;
z-index: 2; }
div.style-dev-so-listing-tabs h3.modtitle {
margin: 0; }
div.style-dev-so-listing-tabs .so-listing-tabs {
margin: 0; }
div.style-dev-so-listing-tabs .so-listing-tabs .ltabs-tabs-container {
margin: 0; }
div.style-dev-so-listing-tabs .so-listing-tabs .wap-listing-tabs {
border: none; }
div.style-dev-so-listing-tabs .so-listing-tabs .product-layout .product-item-container {
border: 1px solid #ddd;
margin-left: -1px; }
div.style-dev-so-listing-tabs .so-listing-tabs .product-layout .product-item-container .button-group {
margin-bottom: 12px; }
div.style-dev-so-listing-tabs .owl2-controls {
position: absolute;
top: 0;
right: 0;
width: 100%;
z-index: 45; }
div.style-dev-so-listing-tabs .owl2-controls .owl2-nav div.owl2-prev {
content: "\f104";
top: 7px;
left: auto;
right: 37px; }
div.style-dev-so-listing-tabs .owl2-controls .owl2-nav div.owl2-next {
content: "\f105";
top: 7px;
left: auto;
right: 7px; }
div.style-dev-so-listing-tabs .owl2-controls .owl2-nav div.owl2-prev, div.style-dev-so-listing-tabs .owl2-controls .owl2-nav div.owl2-next {
height: 25px;
width: 25px;
font-family: 'FontAwesome';
border-radius: 25px;
background: #fff;
opacity: 1;
border: 1px solid #a0a0a0;
color: #a0a0a0;
font-size: 0;
margin: 0;
padding: 0;
text-align: center; }
div.style-dev-so-listing-tabs .owl2-controls .owl2-nav div.owl2-prev:before, div.style-dev-so-listing-tabs .owl2-controls .owl2-nav div.owl2-next:before {
font-size: 17px;
line-height: 22px;
text-align: center; }
div.style-dev-so-listing-tabs .owl2-controls .owl2-nav div.owl2-prev:hover, div.style-dev-so-listing-tabs .owl2-controls .owl2-nav div.owl2-next:hover {
border-color: #6e8f04;
color: #6e8f04; }
div.style-dev-so-listing-tabs .list-sub-cat {
border-width: 0 0 1px 1px;
border-style: solid;
border-color: #ddd;
margin: 0 0 30px; }
div.style-dev-so-listing-tabs .list-sub-cat li.item-cate {
width: 10%;
float: left;
border-width: 0 1px 0 0;
border-color: #ddd;
border-style: solid;
text-align: center;
padding: 10px 0;
margin: 0; }
div.style-dev-so-listing-tabs .list-sub-cat li.item-cate .ltabs-tab-img {
margin: 0;
float: none;
height: auto; }
div.style-dev-so-listing-tabs .list-sub-cat li.item-cate .ltabs-tab-img img {
margin: 10px auto;
background: none !important; }
div.style-dev-so-listing-tabs .list-sub-cat li.item-cate .title-sub-cate {
font-size: 13px;
font-weight: bold;
text-transform: capitalize;
color: #555; }
div.style-dev-so-listing-tabs .list-sub-cat li.item-cate.tab-sel, div.style-dev-so-listing-tabs .list-sub-cat li.item-cate:hover {
background: #eee; }
div.style-dev-so-listing-tabs .list-sub-cat li.item-cate.tab-sel .title-sub-cate, div.style-dev-so-listing-tabs .list-sub-cat li.item-cate:hover .title-sub-cate {
color: #6e8f04; }
.rtl .block-popup-login .fa-times-circle:before {
display: none; }
.shopping_cart .dropdown-menu .content-item {
max-height: 320px;
overflow: auto; }
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
.so-search#sosearchpro .select_category select {
padding-right: 0 !important; }
.so-search#sosearchpro .select_category::after {
display: none; } }
/*===============================================
[SASS DIRECTORY ]
[1] SO LATSET BLOG
[2] SIMPLE BLOG
[3] ARTICLE INFO
==============================================*/
/*============SO LATSET BLOG ==================*/
/*============SIMPLE BLOG ==================*/
.blog-header {
margin-bottom: 35px; }
.blog-header h3 {
color: #222;
font-weight: bold;
text-transform: uppercase;
margin: 0;
/* [4] */
/* [6] */
/* [6] */
/* [7] */
font-size: 18px;
font-size: 1.8rem;
/* [8] */ }
.blog-listitem.grid .itemBlogImg.left-block {
display: block;
position: relative; }
.so-latest-blog .media-content .media-author {
padding: 0 10px 0 0; }
.so-latest-blog .content-detail {
text-align: left; }
.so-latest-blog .media-content .readmore {
padding-right: 15px;
padding-left: 0; }
.blog-listitem.list .blog-item .itemBlogImg .article-image {
margin: 0; }
.blog-listitem {
margin: 0 -15px;
display: inline-block; }
.blog-listitem .blog-item {
padding: 0;
margin-bottom: 30px; }
.blog-listitem .blog-item .itemBlogImg .article-image {
position: relative; }
.blog-listitem .blog-item .itemBlogImg .article-image:before {
content: '';
width: 0;
height: 0;
border-bottom: 85px solid transparent;
top: 0;
position: absolute;
z-index: 2;
border-left: 80px solid #fff;
left: 0; }
.blog-listitem .blog-item .itemBlogImg .article-image .article-date {
position: absolute;
z-index: 2;
top: 0;
left: 0; }
.blog-listitem .blog-item .itemBlogImg .article-image .article-date .date {
font-size: 14px;
color: #909090;
display: block; }
.blog-listitem .blog-item .itemBlogImg .article-image .article-date .date b {
font-size: 24px;
color: #909090;
font-family: 'Raleway';
display: block; }
.blog-listitem .blog-item .readmore a {
display: block;
width: 100%;
padding: 15px 0 0;
font-size: 13px;
font-weight: 600;
color: #6e8f04;
text-align: left; }
.blog-listitem .blog-item .readmore a i {
padding-right: 5px; }
.blog-listitem .blog-item .article-image {
margin-bottom: 15px; }
.blog-listitem .blog-item .itemBlogContent .article-title h4 {
margin-bottom: 5px;
/* [4] */
/* [6] */
/* [6] */
/* [7] */
font-size: 16px;
font-size: 1.6rem;
/* [8] */ }
.blog-listitem .blog-item .itemBlogContent .article-title h4 a {
color: #222;
font-size: 16px;
font-weight: bold; }
.blog-listitem .blog-item .itemBlogContent .article-title h4 a:hover {
color: #6e8f04; }
.blog-listitem .blog-item .itemBlogContent .blog-meta {
display: inline-block;
padding: 15px 0 20px;
border-bottom: 1px solid #ebebeb;
vertical-align: top;
width: 100%; }
.blog-listitem .blog-item .itemBlogContent .blog-meta i {
padding-right: 5px; }
.blog-listitem .blog-item .itemBlogContent .blog-meta > span {
line-height: 15px;
font-weight: normal;
/* [4] */
/* [6] */
/* [6] */
/* [7] */
font-size: 13px;
font-size: 1.3rem;
/* [8] */
color: #909090;
float: left;
padding-right: 20px; }
.blog-listitem .blog-item .itemBlogContent .blog-meta > span.comment_count {
padding-left: 0;
color: #909090; }
.blog-listitem .blog-item .itemBlogContent .blog-meta > span.comment_count a {
color: #999;
/* [4] */
/* [6] */
/* [6] */
/* [7] */
font-size: 13px;
font-size: 1.3rem;
/* [8] */ }
.blog-listitem .blog-item .itemBlogContent .blog-meta > span.comment_count a:hover {
color: #6e8f04; }
.blog-listitem.list .article-description {
border-bottom: 1px solid #ebebeb;
padding-bottom: 20px;
margin-bottom: 0; }
.blog-listitem.list .blog-item {
margin-bottom: 40px; }
.blog-listitem.list .blog-item .itemBlogContent .blog-meta {
padding: 15px 0 20px;
border: none; }
.product-filter-bottom.filters-blog {
display: inline-block;
float: none;
width: 100%;
padding: 15px;
margin: 10px 0 0 !important;
text-align: center;
background-color: #f2f2f2;
border: 1px solid #ebebeb; }
.product-filter-bottom.filters-blog .view-mode {
text-align: left; }
.product-filter-bottom.filters-blog .pagination {
margin-top: 5px; }
.product-filter-bottom.filters-blog .pagination > li span, .product-filter-bottom.filters-blog .pagination > li a {
width: 32px;
height: 32px;
padding: 0;
line-height: 30px;
border-radius: 100%; }
.simple-blog-product h4 {
/* [4] */
/* [6] */
/* [6] */
/* [7] */
font-size: 14px;
font-size: 1.4rem;
/* [8] */ }
/*============ARTICLE INFO==================*/
div.article-info .article-title h3 {
font-size: 20px;
text-transform: uppercase;
color: #1e1e1e;
font-weight: bold;
margin: 0 0 15px; }
div.article-info .article-sub-title {
display: inline-block;
width: 100%; }
div.article-info .article-sub-title span {
display: block;
float: left;
color: #999;
padding: 0 10px;
font-size: 13px; }
div.article-info .article-sub-title span.article-author {
padding-left: 0; }
div.article-info .article-sub-title span.article-author a {
color: #999;
font-size: 13px; }
div.article-info .article-sub-title span.article-author a:hover {
color: #6e8f04; }
div.article-info .article-sub-title span.article-comment {
border-right: 0; }
div.article-info .article-sub-title .article-share {
display: none; }
div.article-info .article-image {
margin-bottom: 30px; }
div.article-info .related-comment {
border-radius: 0;
border: 0;
border-top: 1px solid #e6e6e6;
padding-top: 40px;
box-shadow: none;
margin-top: 40px; }
div.article-info .related-comment .article-reply {
border: none;
background: #f9f9f9; }
div.article-info .related-comment .article-reply .author {
font-weight: bold;
font-size: 16px; }
div.article-info .related-comment .article-reply .article-reply {
background: #f4f3f3; }
div.article-info .related-comment .panel-body {
padding: 0;
border: 0; }
div.article-info .related-comment .panel-body .form-group #comments {
padding: 0;
border: 0;
overflow: hidden; }
div.article-info .related-comment .panel-body .form-group #comments h2#review-title {
margin: 0 0 30px;
padding: 0;
font-weight: bold;
text-transform: uppercase;
font-size: 18px;
color: #121212; }
div.article-info .related-comment #button-comment {
background: #6e8f04;
border-color: #6e8f04;
text-transform: uppercase; }
@media (min-width: 992px) {
div.article-info .related-comment #button-comment {
padding: 10px 52px; } }
div.article-info .related-comment #button-comment:hover {
background: #444;
border-color: #444; }
div.article-info .itemFullText {
text-align: justify; }
/*============ARTICLE COMMENTS==================*/
.comments {
margin-bottom: 30px; }
.comments.comments-level-1 {
margin-left: 136px; }
.comments .pull-left {
width: 100px;
height: 100px;
display: block;
background-color: #f5f5f5;
margin-right: 30px;
position: relative;
padding: 0; }
.comments .pull-left .fa {
font-size: 46px;
display: block;
text-align: center;
margin: 25px 0; }
.comments .pull-left img {
width: 100%;
height: auto;
position: relative;
z-index: 2; }
.comments .pull-left span {
position: absolute;
display: inline-block;
top: 15%; }
.comments .media-body .media-title {
color: #1fc0a0;
padding-bottom: 14px; }
.comments .media-body .media-title .username {
font-size: 18px;
font-style: italic;
font-family: Georgia, sans-serif;
display: inline-block;
margin-right: 14px; }
.comments .media-body .media-title .time {
font-size: 16px; }
.comments .media-body .media-title .time .fa {
font-size: 20px;
margin-right: 13px;
position: relative;
top: 3px; }
.comments .media-body .media-title .link:hover {
text-decoration: none; }
@media (max-width: 745px) {
.comments {
margin-bottom: 28px; }
.comments.comments-level-1 {
margin-left: 70px; }
.comments .pull-left {
width: 70px;
height: 70px;
margin-right: 20px; }
.comments .pull-left:before {
font-size: 46px;
line-height: 1em;
top: 10px; }
.comments .media-body .media-title time {
display: block; }
.comments .media-body .media-title time .icon {
font-size: 20px;
margin: 0 6px 0 0;
position: relative;
top: 3px; } }
/*===============================================
[SASS DIRECTORY ]
[1] HEADING
[2] LINK & COLUMN
[3] BLOCK FORM
[4] BLOCK TABLE
==============================================*/
/*================ HEADING ===================*/
html {
width: 100%;
outline: 0 !important;
direction: ltr; }
body {
color: #7d7d7d;
font-size: 13px;
line-height: 25px; }
.owl2-carousel .owl2-item img {
transform-style: inherit; }
h1 {
font-size: 33px; }
h2 {
font-size: 27px; }
h3 {
font-size: 23px; }
h4 {
font-size: 17px; }
h5 {
font-size: 13px; }
h6 {
font-size: 12px; }
.h1, .h2, .h3, h1, h2, h3, .h4, .h5, .h6, h4, h5, h6 {
margin: 0 0 15px 0; }
::-webkit-scrollbar {
width: 0.5em;
height: 0.5em; }
::-webkit-scrollbar-thumb {
background: #777; }
::-webkit-scrollbar-track {
background: #d6d6d6; }
body {
scrollbar-face-color: #777;
scrollbar-track-color: #d6d6d6; }
@media only screen and (max-width: 992px) {
::-webkit-scrollbar {
width: 0.3em;
height: 0.3em; }
::-webkit-scrollbar-thumb {
background: #777; }
::-webkit-scrollbar-track {
background: #d6d6d6; }
body {
scrollbar-face-color: #777;
scrollbar-track-color: #d6d6d6; } }
/*================ LINK & COLUMN ===================*/
.textColor {
color: #6e8f04; }
ul.menu, ol.menu, ul.blank {
list-style: none;
margin: 0;
padding: 0; }
option {
padding: 2px 5px;
border-width: 1px; }
.alert ol li {
list-style-type: decimal;
margin: 0 0 5px 15px; }
img {
max-width: 100%; }
.over {
overflow: visible; }
.align-center {
display: table;
margin: 0 auto; }
.text-danger {
color: #fff;
display: inline-block;
background-color: #a94442;
padding: 0 5px;
margin: 5px 0;
border-radius: 3px;
font-size: 11px; }
a {
color: #666; }
a:hover {
color: #354502;
text-decoration: none; }
a, a:visited, a:active, a:link, a:focus {
cursor: pointer;
text-decoration: none;
outline: none; }
ol {
counter-reset: item;
padding: 0 0 0 15px; }
sup {
color: #f00;
font-size: 100%;
top: -4px; }
.list-inline {
display: inline-block;
margin: 0; }
.container-megamenu .list-inline a {
display: inline-block; }
.clearfix {
clear: both; }
.img-thumbnail.pull-left {
margin-right: 30px; }
.img-thumbnail.pull-right {
margin-left: 30px; }
.margin-zero {
margin: 0; }
.col-xs-15, .col-sm-15, .col-md-15, .col-lg-15 {
position: relative;
min-height: 1px;
padding-right: 15px;
padding-left: 15px; }
.col-xs-15 {
width: 20%;
float: left; }
@media (min-width: 768px) {
.col-sm-15 {
width: 20%;
float: left; } }
@media (min-width: 992px) {
.col-md-15 {
width: 20%;
float: left; } }
@media (min-width: 1200px) {
.col-lg-15 {
width: 20%;
float: left; } }
/*================ FORM ===================*/
legend {
font-size: 18px;
padding: 7px 0px; }
/* @group 2. Inputs
-------------------*/
textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input, .form-control, select {
border-radius: 3px;
border: none;
color: #3d3d3d;
padding: 9px;
/* [4] */
/* [6] */
/* [6] */
/* [7] */
font-size: 12px;
font-size: 1.2rem;
/* [8] */
box-shadow: none !important;
transition: all 0.3s ease; }
input#input-captcha {
margin-bottom: 15px; }
textarea:focus, textarea:hover, input[type="text"]:focus, input[type="text"]:hover, input[type="password"]:focus, input[type="password"]:hover, input[type="datetime"]:focus, input[type="datetime"]:hover, input[type="datetime-local"]:focus, input[type="datetime-local"]:hover, input[type="date"]:focus, input[type="date"]:hover, input[type="month"]:focus, input[type="month"]:hover, input[type="time"]:focus, input[type="time"]:hover, input[type="week"]:focus, input[type="week"]:hover, input[type="number"]:focus, input[type="number"]:hover, input[type="email"]:focus, input[type="email"]:hover, input[type="url"]:focus, input[type="url"]:hover, input[type="search"]:focus, input[type="search"]:hover, input[type="tel"]:focus, input[type="tel"]:hover, input[type="color"]:focus, input[type="color"]:hover, .uneditable-input:focus, .uneditable-input:hover {
outline: 0;
outline: thin dotted \9;
background-color: #e9e9e9;
/* IE6-9 */ }
textarea {
max-width: 100%; }
.form-control {
height: 38px; }
/* @end */
/* @group 3. Dropdown
-------------------*/
.header-top-right .top-link > li {
position: relative; }
header .dropdown-menu {
display: block;
opacity: 0;
filter: alpha(opacity=0);
visibility: hidden;
transition: all 0.2s ease-out;
margin-top: 20px;
min-width: 120px;
padding: 0;
border: 1px solid rgba(0, 0, 0, .15);
right: 0;
left: auto;
-webkit-background-clip: padding-box;
background-clip: padding-box; }
header .open > .dropdown-menu {
margin-top: 0;
opacity: 1;
filter: alpha(opacity=100);
visibility: visible; }
.size-img-cart {
width: 80px; }
.dropdown-menu {
background: #fff;
padding: 5px 0;
margin-top: 0;
border-radius: 0px;
border: none;
box-shadow: 0px 0px 25px rgba(0, 0, 0, 0.15);
font-size: 12px; }
#sosearchpro .dropdown-menu {
top: 100%;
display: none; }
@media (min-width: 1200px) {
#sosearchpro .dropdown-menu {
min-width: 300px; } }
#sosearchpro .dropdown-menu .media-left {
float: left; }
#sosearchpro .dropdown-menu .media-body a {
color: #555;
float: none; }
#sosearchpro .dropdown-menu .media-body a:hover {
color: #6e8f04; }
#sosearchpro .dropdown-menu:after {
display: none; }
.dropdown-menu > li > a {
padding: 5px 15px;
color: #555; }
.dropdown-menu > li > a:hover {
color: #6e8f04; }
.dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus {
background: #f7f7f7; }
.nav-header {
color: #667280; }
/* @end */
/* @group 4. Buttons
------------------*/
.input-group .form-control:last-child, .input-group-addon:last-child, .input-group-btn:last-child > .btn, .input-group-btn:last-child > .dropdown-toggle, .input-group-btn:first-child > .btn:not(:first-child) {
border-bottom-left-radius: 0;
border-top-left-radius: 0; }
.button, .btn {
padding: 9px 20px;
background: #555;
color: #fff;
border-radius: 3px;
border: none;
background: #6e8f04;
border-color: #6e8f04; }
.button:hover, .btn:hover {
background: #6e8f04;
border-color: #6e8f04;
color: #fff; }
.button:hover, .btn:hover {
background: #555;
border-color: #555; }
.btn-warning {
background: #f0ad4e; }
.btn-success {
background: #5cb85c; }
.btn-info {
background: #999;
border-radius: 0;
text-transform: uppercase; }
.btn-primary {
background: #999;
border-radius: 0;
text-transform: uppercase; }
.btn-danger {
background: #d9534f;
border-radius: 0; }
.btn-revo {
background: #6e8f04;
height: 40px;
line-height: 40px;
color: #fff;
font-size: 14px;
border-radius: 20px;
padding: 0 35px;
display: inline-block;
vertical-align: top;
font-weight: bold;
text-transform: uppercase;
margin: 0 20px 0 0px;
-webkit-transition: all 0.3s ease 0s;
-moz-transition: all 0.3s ease 0s;
transition: all 0.3s ease 0s; }
.btn-revo:hover {
background: #999; }
.button .fa, .btn .fa {
margin: 0 5px; }
.button.inverse, .btn.inverse {
background-color: #555; }
.button.inverse:hover, .btn.inverse:hover {
background-color: #6e8f04; }
.button-continue-shopping {
display: block;
float: left; }
.button-checkout {
display: block;
float: right; }
.btn-lg, .btn-group-lg > .btn {
padding: 10px 16px;
font-size: 18px;
line-height: 1.33333; }
.btn-sm, .btn-group-sm > .btn {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5; }
.btn-xs, .btn-group-xs > .btn {
padding: 1px 5px;
font-size: 12px;
line-height: 1.5; }
/* @end */
.btn-inline {
display: inline-block; }
/*================ TABLE ===================*/
.table thead > tr > th {
background: #eee; }
table.std th, table.std td {
vertical-align: middle;
border: #ddd;
padding: 10px;
text-align: center; }
table.std th {
white-space: nowrap;
background: #f5f5f5; }
table.std tfoot td {
color: #333;
text-align: right;
white-space: nowrap; }
table.std {
background: #fdfdfd;
border-spacing: 0;
vertical-align: middle;
border: #ddd;
width: 100%; }
table th {
border: #ddd;
color: #7a7a7a;
font-size: 13px;
font-weight: bold;
padding: 10px;
text-align: center;
vertical-align: middle;
text-transform: uppercase; }
.delivery_option table td {
text-align: center; }
table tfoot td {
text-align: right; }
table.table-bordered thead > * {
background-color: rgba(51, 51, 51, 0.1);
font-weight: bold; }
/*================ PAGINATION ===================*/
.pagination > li {
display: inline-block;
margin: 0 2px;
vertical-align: top; }
.pagination > li span, .pagination > li a {
padding: 3px 8px; }
.pagination > li a:hover, .pagination > li span:hover {
color: #fff;
background: #6e8f04;
border-color: #6e8f04; }
.pagination > li.active, .pagination > li:hover {
background: transparent;
border-color: #6e8f04; }
.pagination > li.active span, .pagination > li:hover span {
color: #6e8f04;
background: transparent;
border-color: #6e8f04; }
.pagination > li.active span:hover, .pagination > li:hover span:hover {
background: #6e8f04;
border-color: #6e8f04; }
.pagination > li:last-child {
margin-right: 0; }
.pagination > li:first-child > a, .pagination > li:first-child > span {
border-radius: 0; }
.pagination > li > a, .pagination > li > span {
color: #666; }
.pagination > li:last-child > a, .pagination > li:last-child > span {
border-radius: 0; }
.checkout-cart .btn-block input {
min-width: 40px;
text-align: center; }
.checkout-cart .table-responsive {
direction: ltr; }
/*===============================================
[SASS DIRECTORY ]
[1] CONTACT PAGE
[2] PAEG ABOUT US
[3] PAGE BLOG
[4] PAGE 404
==============================================*/
/*============ CONTACT PAGE ==============*/
#map-canvas {
height: 550px;
width: 100%;
margin: 0px 0 10px; }
.info-contact {
padding-top: 30px; }
.info-contact .name-store h3 {
font-size: 16px;
color: #222;
text-transform: uppercase; }
.info-contact .text {
padding-left: 30px; }
.info-contact .comment {
padding-bottom: 15px;
border-bottom: 1px solid #e9e9e9;
margin-bottom: 25px; }
.module.page_contact_custom {
margin-bottom: 0; }
.module.page_contact_custom .block-contact .item .item-wrap {
background-color: #f2f2f2;
font-size: 14px;
color: #222;
overflow: hidden;
text-align: left;
padding: 17px 20px; }
.module.page_contact_custom .image-about-us img {
cursor: pointer;
-webkit-transition: all 0.3s ease 0s;
-moz-transition: all 0.3s ease 0s;
transition: all 0.3s ease 0s; }
.module.page_contact_custom .image-about-us img:hover {
opacity: 0.7; }
.module.page_contact_custom .block-contact .item .item-wrap .icon {
display: inline-block;
height: 66px;
width: 66px;
border-radius: 50%;
border: 1px solid #b7b7b7;
float: left;
margin-right: 10px; }
.module.page_contact_custom .block-contact .item .item-wrap .info {
padding: 20px 0;
line-height: 20px;
white-space: nowrap; }
.module.page_contact_custom .block-contact .item.address .item-wrap .info {
padding: 13px 0; }
.module.page_contact_custom .block-contact .item.phone .item-wrap .icon {
background: url("../../images/icon/icon_general.png") no-repeat -9px -1761px #f2f2f2; }
.module.page_contact_custom .block-contact .item.address .item-wrap .icon {
background: url("../../images/icon/icon_general.png") no-repeat -9px -1818px #f2f2f2; }
.module.page_contact_custom .block-contact .item.support .item-wrap .icon {
background: url("../../images/icon/icon_general.png") no-repeat -9px -1706px #f2f2f2; }
.contact-form legend {
border: none;
padding: 0;
text-transform: uppercase;
font-weight: 600;
text-align: center; }
.contact-form legend h2 {
font-size: 18px;
color: #222;
text-transform: uppercase;
margin-bottom: 20px;
text-align: center;
font-weight: bold; }
.contact-form p {
text-align: center; }
/*============ PAEG ABOUT US ==============*/
.about_us {
text-align: center; }
.about_us .title-page {
font-size: 18px;
color: #222;
text-transform: uppercase;
margin-bottom: 20px;
font-weight: bold; }
.about_us .content-page {
text-align: center; }
/*============ PAGE 404 ==============*/
.button-404 > a {
margin: 0 10px; }
.content_404 {
margin: 40px 0 30px;
overflow: hidden; }
.content_404 .block-top h2 {
color: #222;
font-size: 24px;
font-weight: bold;
text-transform: uppercase;
margin-bottom: 25px; }
.content_404 .block-top .warning-code {
font-size: 14px;
color: #7d7d7d;
margin-bottom: 40px; }
/*============ PAGE COMMING SOON ==============*/
.page-comingsoon {
background: url("../../images//bg-comingsoon.jpg") no-repeat center center;
text-align: center;
min-height: 600px; }
/*INFOMATION*/
.module-content {
background: #fff;
border: 1px solid #ddd;
padding: 0 20px; }
.module-content .list-box li {
position: relative;
padding-left: 15px; }
.module-content .list-box li:before {
position: absolute;
display: block;
top: 16px;
background: #999;
content: "";
width: 6px;
height: 6px;
border-radius: 100%;
left: 0; }
.panel-default > .panel-heading {
background: #fff; }
.title-under {
position: relative;
margin-bottom: 50px; }
.title-under:after {
content: "";
position: absolute;
display: block;
height: 4px;
width: 68px;
background: #6e8f04;
bottom: -10px; }
.owl2-carousel .owl2-item img {
transform-style: initial !important; }
.title-under.text-center:after {
left: 50%;
margin-left: -34px; }
.media-box-link--arrow .icon {
font-size: 30px; }
.media-box-link--figure .icon {
font-size: 70px; }
.media-box-link {
display: table-row;
width: 100%;
height: 100%;
background-color: #6e8f04;
cursor: pointer;
color: #fff;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out; }
.btn-default {
background: #6e8f04;
border-radius: 0; }
.btn-default:hover {
background: #6e8f04; }
.media-box-link h4 {
color: #fff;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out; }
.media-box-link .icon {
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out; }
.media-box-link--figure, .media-box-link--content, .media-box-link--arrow {
display: table-cell;
padding: 6% 0;
vertical-align: middle; }
.media-box-link--figure {
width: 23%; }
.media-box-link--content {
padding-right: 5%;
width: 67%; }
.media-box-link--arrow {
width: 10%;
vertical-align: middle; }
.media-box-link:hover {
background-color: #f5f5f5;
color: #777; }
.media-box-link:hover h4 {
color: #333; }
.media-box-link:hover .icon {
color: #6e8f04; }
.page_warranity {
color: #777; }
.page_warranity .title-under {
color: #333; }
.page_warranity .icon.icon-error {
font-size: 30px;
vertical-align: middle; }
.page_warranity .media-icon--content .color-dark.font18 {
color: #333;
font-size: 500; }
.color {
color: #6e8f04; }
.title-decimal {
font-size: 20px;
position: relative;
padding: 4px 0 9px 69px; }
@media (min-width: 1200px) {
.title-decimal {
font-size: 30px; } }
.title-decimal:before {
content: attr(data-content);
display: table-cell;
vertical-align: middle;
position: absolute;
top: 0px;
line-height: 40px;
background: #6e8f04;
width: 44px;
height: 44px;
color: #fff;
text-align: center;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
left: 0; }
.decimal-list {
padding: 0;
margin: 10px 0 0 0;
list-style-type: none;
counter-reset: myCounter; }
.decimal-list li {
font-size: 14px;
font-weight: bold;
color: #333;
padding: 0 0 0 18px;
margin-bottom: 7px;
text-indent: 0;
position: relative; }
.decimal-list li:before {
content: counter(myCounter);
counter-increment: myCounter;
position: absolute;
top: 0;
z-index: 1;
-webkit-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
color: #6e8f04;
font-weight: 500;
left: 0; }
/*===============================================
[SASS DIRECTORY ]
[1] BOX SALE,NEW
[2] RATE
[3] TODAY'S DEALS
[4] PRODUCT CATEGORY
[5] TOOLBAR
[6] PRODUCT LIST SIMPLE
[7] QUICKVIEW
==============================================*/
/*============ BOX SALE,NEW ==============*/
.label-product {
font-size: 12px;
font-weight: bold;
color: #fff;
text-align: center;
display: inline-block;
width: 38px;
height: 38px;
z-index: 7;
border-radius: 50%;
line-height: 38px;
position: absolute; }
.label-product.label-sale {
background: #ff5c00;
top: 10px;
right: 15px; }
.label-product.label-new {
background: #00abf0;
top: 10px;
left: 15px; }
.label-percent {
padding: 2px 5px;
background: #6e8f04;
font-size: 13px;
font-weight: normal; }
.product-options label {
padding: 0;
color: #666; }
.product-options .label {
font-weight: normal;
font-size: 11px; }
.product-options .radio {
position: relative;
z-index: 2;
text-transform: capitalize;
cursor: pointer; }
.product-options .radio .fa {
display: none; }
.product-options .active .fa {
display: block; }
.product-options .fa {
position: absolute;
top: 0;
z-index: 2;
width: 22px;
height: 22px;
color: white;
line-height: 22px;
text-align: center;
left: 0; }
/*============ BOX RATE ==============*/
.rating, .ratings {
font-size: 13px;
margin-bottom: 5px; }
.rating span.fa-stack .fa-star-o:before, .ratings span.fa-stack .fa-star-o:before {
content: "\f006";
color: #ff5c00; }
.rating span.fa-stack .fa-star.fa-stack-1x, .ratings span.fa-stack .fa-star.fa-stack-1x {
z-index: 1; }
.rating span.fa-stack .fa-star.fa-stack-1x:before, .ratings span.fa-stack .fa-star.fa-stack-1x:before {
content: "\f005";
color: #ebdb2c; }
span.fa-stack {
width: 14px;
height: 14px;
line-height: 14px; }
span.fa-stack .fa-star-o:before {
content: "\f006";
color: #ff5c00; }
span.fa-stack .fa-stack-2x {
font-size: 1em; }
span.fa-stack .fa-star.fa-stack-2x {
position: relative;
z-index: 1; }
span.fa-stack .fa-star.fa-stack-2x:before {
content: "\f005";
color: #ebdb2c; }
.price {
margin: 0 0 10px 0;
line-height: normal;
color: #ff5c00;
font-size: 16px;
font-weight: 700; }
.price .price-old {
line-height: normal;
padding: 0 5px;
display: inline-block;
text-decoration: line-through;
color: #999;
font-size: 13px;
font-weight: normal; }
.price .price-new, .price span.price {
color: #ff5c00;
font-size: 16px;
font-weight: 700; }
/*====================TODAY'S DEALS ====================*/
.countdown_box {
position: absolute;
top: 50%;
margin-top: -28px;
left: 50%;
width: 170px;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
-webkit-transform: scale(1) translateX(-50%);
-moz-transform: scale(1) translateX(-50%);
-ms-transform: scale(1) translateX(-50%);
-o-transform: scale(1) translateX(-50%);
transform: scale(1) translateX(-50%); }
.countdown_box .countdown_inner {
display: table;
background: #555;
width: 100%;
text-align: center; }
.countdown_box .title {
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
color: #fff;
padding: 8px;
display: none; }
.countdown_box .time-item {
display: inline-block;
color: #fff;
font-size: 12px;
border-right: 1px solid rgba(255, 255, 255, 0.2);
width: 25%; }
.countdown_box .time-item .num-time {
font-size: 14px;
font-weight: 700;
background: rgba(255, 255, 255, 0.06); }
.countdown_box .time-item .num-time, .countdown_box .time-item .name-time {
padding: 0 10px; }
.countdown_box .time-item:last-child {
border: none; }
.today_deals .title-category {
padding: 0;
padding-bottom: 20px; }
.today_deals .product-item-container .left-block {
text-align: center; }
.today_deals .product-item-container .left-block .product-image-container {
display: inline-block; }
.deals_module_wrapper .product-item-container {
border: 1px solid #e6e6e6;
padding: 20px;
overflow: hidden; }
.deals_module_wrapper .product-item-container .left-block {
position: relative;
z-index: 2; }
.deals_module_wrapper .product-item-container .box-label .label-product {
margin-left: 15px; }
.deals_module_wrapper button.btn-default {
border: 1px solid #6e8f04;
height: 32px;
line-height: 30px;
color: #6e8f04;
background: #fff;
border-radius: 0;
min-width: 32px;
padding: 0;
border-radius: 50%; }
.deals_module_wrapper button.btn-default:hover {
background: #6e8f04;
color: #fff; }
.deals_module_wrapper button.btn-default.addToCart {
padding: 0 10px;
background: #6e8f04;
color: #fff;
border-radius: 18px; }
.deals_module_wrapper .price .price-new {
font-size: 18px; }
.deals_module_wrapper .product-box-desc {
margin-top: 5px; }
.deals_module_wrapper .product-box-desc span {
min-width: 100px;
display: inline-block; }
.deals_module_wrapper .product-box-desc .status-stock {
color: #5dbe45; }
.deals_module_wrapper .title-product {
font-size: 18px;
margin-bottom: 10px; }
.deals_module_wrapper .title-product a {
color: #555; }
.deals_module_wrapper .title-product a:hover {
color: #6e8f04; }
.deals_module_wrapper .short_description {
margin: 10px 0; }
.deals_module_wrapper .countdown_box {
position: static;
-webkit-transform: scale(1) translateX(0);
-moz-transform: scale(1) translateX(0);
-ms-transform: scale(1) translateX(0);
-o-transform: scale(1) translateX(0);
transform: scale(1) translateX(0);
margin: -50px auto 0;
width: 210px; }
.deals_module_wrapper .owl2-controls {
position: absolute;
z-index: 1;
right: 0;
top: -35px; }
.deals_module_wrapper .owl2-controls .owl2-prev, .deals_module_wrapper .owl2-controls .owl2-next {
vertical-align: top;
margin: 0 3px;
padding: 9px 20px;
background: #555;
color: #fff;
border-radius: 3px;
border: none;
background: #999;
float: left;
border-radius: 0;
padding: 3px 10px;
line-height: 20px;
font-size: 18px; }
.deals_module_wrapper .owl2-controls .owl2-prev:hover, .deals_module_wrapper .owl2-controls .owl2-next:hover {
background: #6e8f04;
border-color: #6e8f04;
color: #fff; }
.deals_module_wrapper .owl2-controls .owl2-prev:hover, .deals_module_wrapper .owl2-controls .owl2-next:hover {
background: #6e8f04; }
/*====================PRODUCT CATEGORY ====================*/
.title-category {
color: #222;
text-transform: uppercase;
font-size: 18px;
margin: 0;
font-weight: bold;
padding-bottom: 22px; }
.products-category .form-group.clearfix {
margin: 0; }
.products-category .filter_group {
width: 25%;
display: inline-block;
vertical-align: top; }
.products-category .category-info img {
margin-bottom: 10px; }
.refine-search .thumbnail {
margin-bottom: 10px; }
.refine-search a {
color: #555;
display: block; }
.refine-search a:hover {
color: #6e8f04; }
/*SIDEBAR LISTING - RESPONSIVE*/
.open-sidebar {
line-height: 25px;
display: inline-block;
border: 2px solid #999;
margin-bottom: 20px;
padding: 0px 15px;
letter-spacing: 1px;
font-size: 10px;
text-transform: uppercase; }
#close-sidebar {
display: none; }
@media only screen and (max-width: 992px) {
body.open-sboff {
height: 100%;
overflow: hidden; }
.open-sidebar i.fa {
margin-right: 5px; }
.product-detail .sidebar-overlay, .page-category .sidebar-overlay {
background: rgba(0, 0, 0, 0.5);
display: none;
height: 100%;
opacity: 1;
position: fixed;
top: 0;
left: 0px;
right: 0px;
width: 100%;
z-index: 9998; }
.product-detail .sidebar-offcanvas, .page-category .sidebar-offcanvas {
background: #fff;
width: 300px;
position: fixed;
top: 0px;
bottom: 0px;
z-index: 9999;
height: 100%;
overflow-x: scroll;
box-shadow: 0 0 5px 0 rgba(50, 50, 50, 0.75);
transition: all 300ms ease-in-out;
padding-top: 30px;
margin: 0px;
left: -100%;
padding-left: 15px !important;
padding-right: 10px !important; }
.product-detail .sidebar-offcanvas.active, .page-category .sidebar-offcanvas.active {
left: 0; }
.product-detail .sidebar-offcanvas #close-sidebar, .page-category .sidebar-offcanvas #close-sidebar {
position: absolute;
top: 10px;
right: 20px;
font-size: 16px;
display: block; }
.product-detail .sidebar-offcanvas #close-sidebar:hover, .page-category .sidebar-offcanvas #close-sidebar:hover {
cursor: pointer;
color: #f00; } }
/*TOOLBAR LISTING TOP*/
#content.col-sm-6 .product-compare {
display: none; }
.filters-panel {
margin-bottom: 25px; }
.filters-panel:before, .filters-panel:after {
content: " ";
display: table; }
.filters-panel:after {
clear: both; }
.filters-panel.product-filter-bottom {
margin: 25px 0 0; }
.filters-panel.product-filter-bottom .short-by-show {
line-height: 40px; }
.filters-panel .pagination {
margin: 0; }
.filters-panel .list-view button.btn {
border-radius: 0;
padding: 9px;
color: #fff;
border: none;
background: #252525;
width: 40px;
height: 40px;
font-size: 14px; }
.filters-panel .list-view button.btn.grid {
margin-right: -3px; }
.filters-panel .list-view button.btn.active {
background: #6e8f04;
color: #fff;
box-shadow: none; }
.filters-panel .list-view button.btn.active:hover {
background: #6e8f04;
color: #fff; }
.filters-panel .list-view button.btn:hover {
color: #fff;
background: #6e8f04; }
.filters-panel .list-view button.btn:focus {
border-radius: 0;
border-color: #6e8f04;
outline: none; }
.filters-panel .list-view .fa {
margin: 0; }
.filters-panel label {
font-weight: normal;
line-height: 40px; }
.filters-panel .btn-default {
padding: 9px 20px;
background: #eee;
color: #333;
border-radius: 3px;
border: none;
font-size: 13px; }
.filters-panel .btn-default:hover {
background: #6e8f04;
border-color: #6e8f04;
color: #fff; }
.filters-panel .form-control, .filters-panel .btn {
color: #6b6b6b;
height: 38px;
padding: 9px 15px;
border: 1px solid #e8e8e8;
background: transparent;
border-radius: 0; }
@media (min-width: 1200px) {
.filters-panel .form-inline .form-group {
margin-left: 20px; } }
.box-pagination .pagination > li span, .box-pagination .pagination > li a {
padding: 0;
width: 27px;
height: 28px;
line-height: 28px;
text-align: center; }
.box-pagination .pagination {
display: block; }
/*================ PRODUCT LIST ===================*/
.product-layout .second_img .img_0 {
right: 50%;
top: 0;
transform: translate(50%, 0); }
.products-list {
/*------------------PRODUCT GRID ====================*/
/*----------------PRODUCT LIST ------------------*/ }
.products-list .product-layout {
overflow: hidden; }
.products-list .product-layout .product-item-container .left-block .countdown_box .countdown_inner {
background: transparent;
box-shadow: none; }
.products-list .product-layout .product-item-container .left-block .countdown_box .countdown_inner .time-item {
padding: 1px 0;
background: #444;
border: none;
margin-right: 2px;
width: 23.5%; }
.products-list .product-layout .product-item-container .left-block .countdown_box .countdown_inner .time-item .num-time {
font-size: 14px;
color: #fff;
margin: 0;
border: none;
height: 18px;
line-height: 20px;
font-weight: bold; }
.products-list .product-layout .product-item-container .left-block .countdown_box .countdown_inner .time-item .name-time {
font-size: 10px;
color: #fff;
margin: 0;
height: 20px;
line-height: 20px;
text-transform: uppercase; }
.products-list .product-layout .product-item-container .left-block .quickview {
height: 32px;
width: 32px;
text-align: center;
line-height: 32px;
background: #6e8f04;
color: #fff;
cursor: pointer;
z-index: 99; }
.products-list .product-layout .product-item-container .left-block .quickview:hover {
background-color: #485d03;
color: #fff; }
.products-list .product-layout .product-item-container .button-group button.addToCart, .products-list .product-layout .product-item-container .button-group button.wishlist, .products-list .product-layout .product-item-container .button-group button.compare {
background-color: #fff;
border: 1px solid #6e8f04; }
.products-list .product-layout .product-item-container .button-group button:hover {
background: #6e8f04;
color: #6e8f04;
border-color: #6e8f04; }
.products-list .product-layout .product-item-container .button-group .quickview {
width: 30px;
height: 30px;
text-indent: -99999px;
background: #999 url("../../images/icon/icon_quickview.png") no-repeat center center; }
.products-list .product-layout .product-item-container:hover .countdown_box {
-webkit-transform: scale(0);
-moz-transform: scale(0);
-ms-transform: scale(0);
-o-transform: scale(0);
transform: scale(0); }
.products-list.list-masonry .product-layout .product-item-container, .products-list.grid .product-layout .product-item-container {
padding: 15px 0;
margin: 15px 0;
position: relative;
border: 1px solid #e8e8e8;
overflow: hidden; }
.products-list.list-masonry .product-layout .product-item-container iframe, .products-list.grid .product-layout .product-item-container iframe {
width: 100%; }
.products-list.list-masonry .product-layout .product-item-container .quickview, .products-list.grid .product-layout .product-item-container .quickview {
opacity: 1;
position: absolute;
top: 30%;
margin: 0;
background-color: #6e8f04;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
opacity: 0;
border-radius: 50%;
left: 50%;
margin-left: -16px; }
.products-list.list-masonry .product-layout .product-item-container .left-block, .products-list.grid .product-layout .product-item-container .left-block {
position: relative;
width: 100%;
float: left; }
.products-list.list-masonry .product-layout .product-item-container .left-block .countdown_box .countdown_inner .time-item, .products-list.grid .product-layout .product-item-container .left-block .countdown_box .countdown_inner .time-item {
background: rgba(0, 0, 0, 0.7); }
.products-list.list-masonry .product-layout .product-item-container .right-block, .products-list.grid .product-layout .product-item-container .right-block {
margin-top: 20px;
width: 100%;
text-align: center;
clear: both; }
.products-list.list-masonry .product-layout .product-item-container .right-block .caption, .products-list.grid .product-layout .product-item-container .right-block .caption {
padding: 0;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out; }
.products-list.list-masonry .product-layout .product-item-container .right-block .caption h4, .products-list.grid .product-layout .product-item-container .right-block .caption h4 {
margin-bottom: 10px; }
.products-list.list-masonry .product-layout .product-item-container .right-block .caption h4 a, .products-list.grid .product-layout .product-item-container .right-block .caption h4 a {
font-size: 15px;
color: #222;
font-weight: 600;
text-transform: capitalize; }
.products-list.list-masonry .product-layout .product-item-container .right-block .caption h4 a:hover, .products-list.grid .product-layout .product-item-container .right-block .caption h4 a:hover {
color: #6e8f04; }
.products-list.list-masonry .product-layout .product-item-container .right-block .caption .ratings, .products-list.grid .product-layout .product-item-container .right-block .caption .ratings {
display: none; }
.products-list.list-masonry .product-layout .product-item-container .button-group, .products-list.grid .product-layout .product-item-container .button-group {
position: absolute;
font-size: 15px;
bottom: 15px;
right: 0;
left: 0;
z-index: 2;
opacity: 0;
visibility: hidden; }
.products-list.list-masonry .product-layout .product-item-container .button-group button, .products-list.grid .product-layout .product-item-container .button-group button {
bottom: -70px;
position: relative;
border: none;
height: 32px;
line-height: 30px;
border-radius: 100%;
color: #6e8f04;
border: 1px solid #6e8f04;
min-width: 32px;
text-align: center; }
.products-list.list-masonry .product-layout .product-item-container .button-group button:hover, .products-list.grid .product-layout .product-item-container .button-group button:hover {
border-color: #6e8f04;
color: #fff !important; }
.products-list.list-masonry .product-layout .product-item-container .button-group button.addToCart, .products-list.grid .product-layout .product-item-container .button-group button.addToCart {
padding: 0 10px;
color: #fff;
border-radius: 16px;
background: #6e8f04;
-webkit-transition: bottom 0.2s ease-in-out;
-moz-transition: bottom 0.2s ease-in-out;
transition: bottom 0.2s ease-in-out; }
.products-list.list-masonry .product-layout .product-item-container .button-group button.wishlist, .products-list.grid .product-layout .product-item-container .button-group button.wishlist {
padding: 0;
width: 32px;
-webkit-transition: bottom 0.4s ease-in-out;
-moz-transition: bottom 0.4s ease-in-out;
transition: bottom 0.4s ease-in-out;
color: #6e8f04; }
.products-list.list-masonry .product-layout .product-item-container .button-group button.compare, .products-list.grid .product-layout .product-item-container .button-group button.compare {
padding: 0;
width: 32px;
-webkit-transition: bottom 0.6s ease-in-out;
-moz-transition: bottom 0.6s ease-in-out;
transition: bottom 0.6s ease-in-out;
color: #6e8f04; }
.products-list.list-masonry .product-layout .product-item-container:hover .button-group, .products-list.grid .product-layout .product-item-container:hover .button-group {
opacity: 1;
visibility: visible; }
.products-list.list-masonry .product-layout .product-item-container:hover .button-group button, .products-list.grid .product-layout .product-item-container:hover .button-group button {
bottom: 0;
margin: 0 1px; }
.products-list.list-masonry .product-layout .product-item-container:hover .caption, .products-list.grid .product-layout .product-item-container:hover .caption {
opacity: 0;
visibility: hidden; }
.products-list.list-masonry .product-layout .product-item-container:hover .quickview, .products-list.grid .product-layout .product-item-container:hover .quickview {
opacity: 1;
top: 40%; }
.products-list.list-masonry .product-layout .product-item-container:hover .quickview:hover, .products-list.grid .product-layout .product-item-container:hover .quickview:hover {
background-color: #6e8f04; }
.products-list.list .product-layout .product-item-container {
float: left;
width: 100%;
margin: 15px 0;
overflow: hidden; }
.products-list.list .product-layout .product-item-container .left-block {
padding: 0;
overflow: hidden;
text-align: center; }
.products-list.list .product-layout .product-item-container .left-block .quickview {
border-radius: 100%;
top: 0;
opacity: 0;
top: 30%;
opacity: 0;
position: absolute;
left: 50%;
margin-left: -16px; }
.products-list.list .product-layout .product-item-container .left-block .product-image-container {
border: 1px solid #e8e8e8; }
.products-list.list .product-layout .product-item-container .left-block .countdown_box {
padding: 10px; }
.products-list.list .product-layout .product-item-container .countdown_box {
width: 100%; }
.products-list.list .product-layout .product-item-container .label-new {
top: 8px;
right: 8px;
left: auto; }
.products-list.list .product-layout .product-item-container .label-sale {
top: 8px;
left: 8px;
right: auto; }
.products-list.list .product-layout .product-item-container .right-block .caption {
padding: 0 10px; }
.products-list.list .product-layout .product-item-container .right-block .caption h4 {
margin-top: 0; }
.products-list.list .product-layout .product-item-container .right-block .caption h4 a {
color: #222;
font-size: 18px; }
.products-list.list .product-layout .product-item-container .right-block .description {
padding: 0; }
.products-list.list .product-layout .product-item-container .right-block .button-group {
margin: 20px 0 0 0;
padding: 0 10px; }
.products-list.list .product-layout .product-item-container .button-group button {
background-color: #6e8f04;
color: #fff;
font-size: 13px;
transition: all 0.3s;
height: 32px;
line-height: 30px;
border: 1px solid #6e8f04;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
border-radius: 50%;
min-width: 32px; }
.products-list.list .product-layout .product-item-container .button-group button:hover {
border-color: #6e8f04;
color: #fff !important;
background: #6e8f04 !important; }
.products-list.list .product-layout .product-item-container .button-group button.addToCart {
padding: 0 10px;
color: #fff;
border-radius: 16px;
background: #6e8f04; }
.products-list.list .product-layout .product-item-container .button-group button.wishlist {
color: #6e8f04;
background: transparent;
margin-left: 2px; }
.products-list.list .product-layout .product-item-container .button-group button.compare {
color: #6e8f04;
background: transparent;
margin-left: 2px; }
.products-list.list .product-layout .product-item-container:hover .left-block .quickview {
top: 46%;
opacity: 1;
z-index: 1;
-webkit-transition: all 0.3s ease-in-out 0s;
-moz-transition: all 0.3s ease-in-out 0s;
transition: all 0.3s ease-in-out 0s;
background-color: #6e8f04;
color: #fff;
border-color: #6e8f04; }
.products-list.list .product-layout .product-item-container:hover .left-block .quickview:hover {
background-color: #444;
border-color: #444; }
.products-list.list .product-layout .product-item-container:hover .left-block .countdown_box {
transform: scale(0); }
.products-list.list .product-layout .product-item-container:hover .left-block .product-image-container.second_img .img_0 {
top: 0;
opacity: 1;
z-index: 0; }
.products-list.list .product-layout .product-item-container:hover .right-block .caption h4 a {
color: #6e8f04; }
/*============ QUICKVIEW ==============*/
#product-quick .title-product {
width: 50%; }
#product-quick .title-product h1 {
font-size: 16px; }
#product-quick .product-view .content-product-right .product-box-desc {
padding: 15px;
border: 1px dotted #eee;
margin: -25px 0 0px;
font-style: italic;
color: #999; }
#product-quick .product-view .content-product-right .product-box-desc span {
font-weight: normal; }
/*===============================================
[SASS DIRECTORY ]
[1] CONTENT PRODUCT OTHER
[2] PRODUCT INFO
[3] PRODUCT TABS
[3] RELATED PRODUCT
==============================================*/
/*============CONTENT PRODUCT OTHER ==================*/
/*.zoomContainer{z-index: 450;}*/
.lightSlider {
padding: 0; }
left-content-product.product-view .flexslider-thumb.not_full_slider {
padding: 0;
margin-bottom: 30px; }
.product_page_price {
margin-bottom: 10px;
margin-top: 5px; }
.product_page_price .price-new {
font-size: 22px; }
.product_page_price .price-old {
vertical-align: top; }
.product_page_price .price-tax {
margin-bottom: 10px;
color: #555;
font-size: 12px;
font-weight: normal; }
.product-search input[type=checkbox], .product-search input[type=radio] {
margin: 7px 0 0 -20px;
margin-top: 1px \9;
line-height: normal; }
.product-detail .producttab .tab-content ul, .product-detail .producttab .tab-content ol {
display: block;
list-style-type: disc;
-webkit-margin-before: 1em;
-webkit-margin-after: 1em;
-webkit-margin-start: 0px;
-webkit-margin-end: 0px;
-webkit-padding-start: 40px; }
.product-detail .best-seller {
margin-bottom: 30px; }
#tab-review input[type=radio] {
position: relative;
top: 2px; }
#tab-review .contacts-form span span.text-danger {
margin-right: 15px;
margin-top: 0; }
#tab-review .form-group textarea {
height: 150px; }
/*============PRODUCT INFO ==================*/
.product-view {
margin-bottom: 30px; }
.product-view .content-product-left .large-image {
cursor: pointer;
display: block;
padding: 1px;
overflow: hidden;
position: relative;
border: 1px solid #eee; }
.product-view .content-product-left .thumb-video {
bottom: 10px;
position: absolute;
z-index: 950;
font-size: 32px;
right: 20px; }
.product-view .content-product-left .full_slider, .product-view .content-product-left .not_full_slider {
margin-top: 10px; }
.product-view .content-product-left .full_slider .thumbnail, .product-view .content-product-left .not_full_slider .thumbnail {
border-radius: 0;
margin-bottom: 0; }
.product-view .content-product-left .full_slider .thumbnail:hover, .product-view .content-product-left .not_full_slider .thumbnail:hover {
border-color: #6e8f04; }
.product-view .content-product-left .full_slider .thumbnail.active, .product-view .content-product-left .not_full_slider .thumbnail.active {
border-color: #6e8f04; }
.product-view .content-product-left .full_slider:hover .owl2-nav div, .product-view .content-product-left .not_full_slider:hover .owl2-nav div {
opacity: 1; }
.product-view .content-product-left .full_slider:hover .owl2-nav div.owl2-prev, .product-view .content-product-left .not_full_slider:hover .owl2-nav div.owl2-prev {
left: -14px; }
.product-view .content-product-left .full_slider:hover .owl2-nav div.owl2-next, .product-view .content-product-left .not_full_slider:hover .owl2-nav div.owl2-next {
right: -14px; }
.product-view .content-product-left .full_slider .owl2-nav div, .product-view .content-product-left .not_full_slider .owl2-nav div {
display: block;
width: 28px;
text-align: center;
background: #fff;
color: #e8e8e8;
z-index: 9;
line-height: 24px;
border-radius: 50%;
border: 2px solid #e8e8e8;
cursor: pointer;
transition: 0.2s;
position: absolute;
height: 28px;
top: 50%;
margin-top: -14px;
-webkit-transition: all 0.3s ease 0s;
-moz-transition: all 0.3s ease 0s;
transition: all 0.3s ease 0s;
opacity: 0; }
.product-view .content-product-left .full_slider .owl2-nav div .fa, .product-view .content-product-left .not_full_slider .owl2-nav div .fa {
font-size: 14px;
-webkit-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-ms-transform: translateY(-50%);
-o-transform: translateY(-50%);
transform: translateY(-50%);
position: relative;
top: 50%;
display: block; }
.product-view .content-product-left .full_slider .owl2-nav div:hover, .product-view .content-product-left .not_full_slider .owl2-nav div:hover {
border-color: #6e8f04;
color: #6e8f04; }
.product-view .content-product-left .full_slider .owl2-nav div.owl2-prev, .product-view .content-product-left .not_full_slider .owl2-nav div.owl2-prev {
left: -30px; }
.product-view .content-product-left .full_slider .owl2-nav div.owl2-next, .product-view .content-product-left .not_full_slider .owl2-nav div.owl2-next {
right: -30px; }
.product-view .content-product-right {
overflow: hidden; }
.product-view .content-product-right .title-product h1 {
font-size: 18px;
color: #222;
font-weight: bold;
text-transform: capitalize;
margin-bottom: 7px; }
.product-view .content-product-right .box-review .ratings {
display: inline-block;
margin: 0 20px 0 0;
z-index: 0;
position: relative; }
.product-view .content-product-right .box-review a {
color: #7d7d7d;
display: inline-block; }
.product-view .content-product-right .box-review a:hover {
color: #6e8f04; }
.product-view .content-product-right .product-box-desc {
float: left;
width: 100%;
padding: 10px 20px;
position: relative;
font-weight: bold;
display: inline-block;
min-width: 120px;
text-transform: uppercase;
font-size: 12px;
font-weight: normal;
color: #525252; }
.product-view .content-product-right .product-box-desc span {
padding-right: 5px; }
.product-view .content-product-right .product-box-desc .inner-box-desc {
width: 100%;
position: relative; }
.product-view .content-product-right .product-box-desc .inner-box-desc:before {
content: "";
width: 4px;
background: #6e8f04;
height: 100%;
position: absolute;
left: -20px;
top: 0; }
.product-view .content-product-right .product-box-desc .brand a {
color: #525252; }
.product-view .content-product-right .product-box-desc .brand a:hover {
color: #6e8f04; }
.product-view .content-product-right .product-label {
line-height: 24px;
margin-top: 12px;
float: left;
width: 100%; }
.product-view .content-product-right .product-label .price {
float: left;
margin-top: 0; }
.product-view .content-product-right .product-label .price .list-unstyled {
font-size: 12px;
font-weight: bold;
color: #444; }
.product-view .content-product-right .short_description {
display: block;
padding-top: 20px;
clear: both; }
.product-view .content-product-right .short_description h3 {
margin-bottom: 5px; }
.product-view .content-product-right .countdown_box {
position: static;
margin: 0;
-webkit-transform: scale(1) translateX(0);
-moz-transform: scale(1) translateX(0);
-ms-transform: scale(1) translateX(0);
-o-transform: scale(1) translateX(0);
transform: scale(1) translateX(0);
width: 100%;
margin-bottom: 20px; }
@media (min-width: 1200px) {
.product-view .content-product-right .countdown_box {
width: 420px; } }
.product-view .content-product-right .countdown_box .countdown_inner .title {
padding: 10px;
display: table-cell;
vertical-align: top;
border-right: 1px solid rgba(255, 255, 255, 0.2); }
.product-view .content-product-right h3 {
text-transform: uppercase;
font-size: 14px;
color: #222;
font-weight: 700; }
.product-view .content-product-right .box-info-product {
float: left;
width: 100%;
margin: 0 -10px 20px; }
.product-view .content-product-right .box-info-product .quantity .quantity-control {
float: left;
margin: 0;
padding: 0 10px 0;
position: relative; }
.product-view .content-product-right .box-info-product .quantity .quantity-control label {
font-weight: bold;
margin-bottom: 5px;
font-size: 11px;
text-transform: uppercase;
color: #545454;
font-family: Raleway;
float: left;
display: none;
margin: 0;
line-height: 30px;
padding-right: 8px; }
.product-view .content-product-right .box-info-product .quantity .quantity-control input.form-control {
background: #fff;
float: left;
height: 32px;
line-height: 30px;
margin: 0;
padding: 0 10px;
width: 38px;
border: 1px solid #ddd;
border-radius: 0;
z-index: 0;
box-shadow: none;
text-align: center;
margin-right: 17px; }
.product-view .content-product-right .box-info-product .quantity .quantity-control span {
border: 0 none;
color: white;
float: left;
font-size: 10px;
font-weight: normal;
border-radius: 0;
cursor: pointer;
line-height: 16px;
margin-left: 5px; }
.product-view .content-product-right .box-info-product .quantity .quantity-control span.product_quantity_up {
font-size: 14px;
background: none repeat scroll 0 0 #999;
padding: 0 4px;
position: absolute;
top: 0;
height: 16px;
width: 15px;
right: 13px; }
.product-view .content-product-right .box-info-product .quantity .quantity-control span.product_quantity_down {
font-size: 14px;
background: none repeat scroll 0 0 #999;
font-size: 13px;
padding: 0 4px;
position: absolute;
top: 15px;
width: 15px;
height: 17px;
line-height: 15px;
right: 13px; }
.product-view .content-product-right .box-info-product .quantity .quantity-control span:hover {
background: #6e8f04 !important; }
.product-view .content-product-right .box-info-product .cart {
float: left;
overflow: hidden;
margin-right: 5px; }
@media (min-width: 1200px) {
.product-view .content-product-right .box-info-product .cart {
padding-left: 10px; } }
.product-view .content-product-right .box-info-product .cart a {
font-size: 12px;
font-weight: bold;
text-transform: uppercase; }
.product-view .content-product-right .box-info-product .cart a i {
margin-right: 5px; }
.product-view .content-product-right .box-info-product .cart input {
height: 33px;
line-height: 33px;
padding: 0 10px;
font-weight: normal;
font-size: 13px;
text-transform: capitalize;
border-radius: 18px; }
.product-view .content-product-right .box-info-product .cart input:hover {
background-color: #6e8f04; }
.product-view .content-product-right .box-info-product .add-to-links li {
display: inline-block; }
.product-view .content-product-right .box-info-product .add-to-links li.wishlist a {
margin-right: 2px; }
.product-view .content-product-right .box-info-product .add-to-links ul li a {
height: 32px;
width: 32px;
line-height: 30px;
text-align: center;
padding: 0;
border-radius: 50%;
border: 1px solid #6e8f04;
display: inline-block;
background-color: #fff;
color: #6e8f04; }
.product-view .content-product-right .box-info-product .add-to-links ul li a.text {
display: none; }
.product-view .content-product-right .box-info-product .add-to-links ul li a:hover {
border-color: #6e8f04;
background: #6e8f04;
color: #fff; }
.product-view .content-product-right .share {
margin-top: 10px; }
.social-share .title-share {
text-transform: uppercase;
float: left;
font-size: 14px;
color: #222;
line-height: 35px;
font-family: 'Raleway';
font-weight: bold;
padding-right: 25px; }
.social-share a {
display: inline-block;
vertical-align: top;
margin: 0 5px;
width: 35px;
-webkit-transition: all 0.3s ease 0s;
-moz-transition: all 0.3s ease 0s;
transition: all 0.3s ease 0s;
height: 35px;
text-align: center;
border-radius: 50%;
color: #fff;
font-size: 16px;
background-color: #6e8f04; }
.social-share a i {
line-height: 35px; }
.social-share a:hover {
background: #485d03; }
.product-attribute .table-responsive {
border: 1px solid #e1e1e1; }
.product-attribute .table-responsive .title-attribute {
font-size: 14px;
text-transform: uppercase;
color: #222;
font-family: Raleway;
padding: 13px 17px; }
.product-attribute .table-responsive .table {
margin-bottom: 0; }
.product-attribute .table-responsive .name-attribute {
text-transform: uppercase;
color: #222;
font-family: Raleway;
border-right: 1px solid #e1e1e1;
padding: 8px 15px;
font-weight: bold; }
.product-attribute .table-responsive .text-attribute {
padding: 8px 15px; }
#product {
margin-top: 15px; }
#product .image_option_type .product-options {
display: inline-block; }
#product .control-label {
font-weight: bold;
margin-bottom: 5px;
font-size: 11px;
text-transform: uppercase;
color: #545454;
font-family: Raleway;
min-width: 65px;
float: left;
padding-right: 5px; }
#product .product-options .img-thumbnail {
width: 22px;
height: 22px;
border-radius: 0;
padding: 1px; }
#product .radio-type-button {
display: inline-block;
vertical-align: top;
width: auto;
margin: 0 7px 5px 0px;
padding: 0px; }
#product .radio-type-button label {
padding: 0;
font-size: 14px; }
#product .radio-type-button input {
visibility: hidden; }
#product .radio-type-button .option-content-box {
background: #999;
border: 1px solid #999;
display: block;
text-align: center;
border-radius: 0;
padding: 0;
color: #fff;
font-weight: bold;
min-width: 28px;
min-height: 28px; }
#product .radio-type-button .option-content-box.active, #product .radio-type-button .option-content-box.active:hover {
background: #666;
color: white; }
#product .radio-type-button .option-content-box:hover {
background: #6e8f04;
border-color: #6e8f04;
color: white; }
#product .radio-type-button .option-name {
padding: 0 5px; }
#product .radio-type-button.option_image .option-content-box {
display: block;
text-align: center;
border-radius: 0;
padding: 0;
border: none; }
#product .radio-type-button.option_image .option-content-box img {
padding: 2px;
border: 1px solid #ddd;
width: 30px;
border-radius: 0; }
#product .radio-type-button.option_image .option-content-box img:hover {
border-color: #6e8f04; }
#product .radio-type-button.option_image .option-content-box.active, #product .radio-type-button.option_image .option-content-box.active:hover {
background: transparent;
color: white; }
#product .radio-type-button.option_image .option-content-box:hover {
background: transparent; }
#product .radio-type-button.option_image .option-name {
display: none; }
#product .option_image label {
padding: 0; }
#product .option_image input {
visibility: hidden; }
#product .option_image .option-name {
padding: 0 5px; }
#product .option_image .option-content-box {
padding: 1px; }
#product .box-date {
padding-left: 0; }
#product .box-date label {
margin-right: 10px;
width: 80px; }
#product .box-date input {
width: 200px; }
#product .box-date input, #product .box-date button {
border-radius: 0;
position: relative;
z-index: 0;
margin-left: 0; }
#product .box-date .input-group-btn {
float: left; }
#product .box-date button:hover {
background: #6e8f04;
color: #fff; }
#product .icheckbox.checked:before, #product .iradio.checked:before {
background-color: #6e8f04;
border-color: #6e8f04; }
.thumb-vertical-outer {
width: 94px;
position: relative;
padding: 20px 0;
float: left;
margin-right: 15px; }
.thumb-vertical-outer .lSAction {
display: none !important; }
.thumb-vertical-outer .thumbnail {
border-color: #ddd; }
.thumb-vertical-outer .btn-more {
display: block;
height: 20px;
width: 20px;
line-height: 20px;
color: #999;
background: transparent;
text-align: center;
position: absolute;
font-size: 18px;
cursor: pointer;
margin-left: -10px;
left: 50%;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out; }
.thumb-vertical-outer .btn-more:hover {
color: #6e8f04; }
.thumb-vertical-outer .btn-more.prev-thumb {
top: -5px; }
.thumb-vertical-outer .btn-more.next-thumb {
bottom: -5px; }
.thumb-vertical-outer .prev {
margin-bottom: 5px; }
.thumb-vertical-outer .prev, .thumb-vertical-outer .next {
cursor: pointer; }
.thumb-vertical-outer .prev.disabled, .thumb-vertical-outer .next.disabled {
visibility: hidden; }
.thumb-vertical-outer .prev .fa, .thumb-vertical-outer .next .fa {
font-size: 16px;
display: block;
text-align: center; }
.thumb-vertical-outer ul li {
cursor: pointer;
margin-bottom: 10px; }
.thumb-vertical-outer ul li a {
-webkit-transform: scale(1) translate3d(0px, 0px, 0px);
-moz-transform: scale(1) translate3d(0px, 0px, 0px);
-ms-transform: scale(1) translate3d(0px, 0px, 0px);
-o-transform: scale(1) translate3d(0px, 0px, 0px);
transform: scale(1) translate3d(0px, 0px, 0px); }
.thumb-vertical-outer ul li .thumbnail {
border-radius: 0;
padding: 0;
margin: 0; }
.thumb-vertical-outer ul li .thumbnail img {
padding: 0px;
-webkit-transition: all 0.3s ease;
transition: all 0.3s ease;
position: relative;
padding: 4px; }
.thumb-vertical-outer ul li .thumbnail:hover {
border-color: #6e8f04; }
.thumb-vertical-outer ul li .thumbnail.active {
border-color: #6e8f04; }
/*============PRODUCT TABS==================*/
.producttab .tabsslider {
margin-bottom: 30px;
padding: 0; }
.producttab .tabsslider .nav-tabs {
border: 1px solid #e1e1e1;
background: #f2f2f2; }
.producttab .tabsslider .nav-tabs li {
margin: -1px 0 0 -1px;
list-style: none;
cursor: pointer;
float: left;
font-size: 16px;
text-transform: uppercase;
border-right: 1px solid #e1e1e1; }
.producttab .tabsslider .nav-tabs li a {
font-weight: bold;
border: none;
padding: 0;
color: #222;
padding: 11px 30px;
margin: 0;
border-radius: 0;
font-family: Raleway;
font-size: 14px; }
.producttab .tabsslider .nav-tabs li.active, .producttab .tabsslider .nav-tabs li:hover {
border-color: #6e8f04; }
.producttab .tabsslider .nav-tabs li.active a, .producttab .tabsslider .nav-tabs li:hover a {
color: #fff;
background: #6e8f04; }
.producttab .tabsslider .tab-content {
padding: 30px;
display: block;
margin: 0;
border-style: solid;
margin-top: -1px;
border-width: 1px;
border-color: #e6e6e6;
line-height: 22px; }
.producttab .tabsslider.vertical-tabs {
border: 1px solid #e6e6e6;
padding: 0;
border-bottom: 1px solid #ddd; }
.producttab .tabsslider.vertical-tabs ul.nav-tabs {
border: medium none;
margin: 0;
padding: 0; }
.producttab .tabsslider.vertical-tabs ul.nav-tabs li {
border: none;
border-bottom: 1px solid #ddd;
clear: both;
position: relative;
width: 100%;
padding: 5px 0;
border-right: none; }
.producttab .tabsslider.vertical-tabs ul.nav-tabs li a {
padding: 5px 30px; }
.producttab .tabsslider.vertical-tabs ul.nav-tabs li:hover {
border-color: #ddd; }
.producttab .tabsslider.vertical-tabs ul.nav-tabs li:hover a {
background: transparent; }
.producttab .tabsslider.vertical-tabs ul.nav-tabs li:last-child {
border: none; }
.producttab .tabsslider.vertical-tabs ul.nav-tabs li:before {
content: "";
width: 5px;
height: 100%;
left: -1px;
position: absolute;
top: 0;
-webkit-transition: all 0.3s ease-in-out 0s;
-moz-transition: all 0.3s ease-in-out 0s;
transition: all 0.3s ease-in-out 0s;
z-index: 99; }
.producttab .tabsslider.vertical-tabs ul.nav-tabs li:hover {
border-left-color: #6e8f04; }
.producttab .tabsslider.vertical-tabs ul.nav-tabs li:hover a {
color: #6e8f04; }
.producttab .tabsslider.vertical-tabs ul.nav-tabs li:hover:before {
background-color: #6e8f04; }
.producttab .tabsslider.vertical-tabs ul.nav-tabs li.active {
border-left-color: #6e8f04; }
.producttab .tabsslider.vertical-tabs ul.nav-tabs li.active:before {
background-color: #6e8f04; }
.producttab .tabsslider.vertical-tabs ul.nav-tabs li.active a {
background: transparent;
color: #6e8f04; }
.producttab .tabsslider.vertical-tabs .tab-content {
border: 0;
border-left: 1px solid #e6e6e6;
min-height: 200px; }
#product-accordion {
border: 1px solid #ddd;
border-top: 4px solid #6e8f04; }
#product-accordion .panel {
padding: 0 20px 0 20px;
border-bottom: 0;
box-shadow: none;
margin: 0; }
#product-accordion .panel .panel-heading {
border-bottom: 1px solid #eee;
padding: 0 0 10px 0; }
#product-accordion .panel .panel-heading a {
text-transform: uppercase;
font-weight: bold;
margin: 0;
color: #7d7d7d;
width: 100%;
display: inline-block;
position: relative; }
#product-accordion .panel .panel-heading a.title-head.collapsed {
color: #7d7d7d; }
#product-accordion .panel .panel-heading a.title-head.collapsed span.arrow-up:before {
content: "\f077"; }
#product-accordion .panel .panel-heading a.title-head {
color: #6e8f04; }
#product-accordion .panel .panel-heading a.title-head span.arrow-up:before {
content: "\f078"; }
#product-accordion .panel .panel-heading a span.arrow-up {
display: block;
position: absolute;
right: 0;
top: -2px;
cursor: pointer;
z-index: 10;
font-size: 0;
text-align: center; }
#product-accordion .panel .panel-heading a span.arrow-up:before {
content: "\f078";
font-family: 'FontAwesome';
display: block;
vertical-align: middle;
width: 30px;
height: 30px;
line-height: 30px;
font-size: 14px; }
#product-accordion .panel .panel-heading:hover a {
color: #6e8f04; }
#product-accordion .panel:first-child .panel-heading {
padding-top: 10px; }
#product-accordion .panel:last-child .panel-heading {
border-bottom: 0; }
#product-accordion .panel-heading + .panel-collapse > .list-group, #product-accordion .panel-heading + .panel-collapse > .panel-body {
border: none;
padding: 15px 0; }
/*============RELATED PRODUCT==================*/
.releate-products .owl2-controls .owl2-nav .owl2-next, div.so-extraslider.grid .owl2-controls .owl2-nav .owl2-next, .releate-products .owl2-controls .owl2-nav .owl2-prev, div.so-extraslider.grid .owl2-controls .owl2-nav .owl2-prev {
height: 36px;
width: 36px;
line-height: 34px;
text-align: center;
font-size: 28px;
display: inline-block;
background: #fff;
position: absolute;
top: 50%;
margin-top: -18px;
border: 1px solid #ddd; }
.releate-products .owl2-controls .owl2-nav .owl2-next:hover, div.so-extraslider.grid .owl2-controls .owl2-nav .owl2-next:hover, .releate-products .owl2-controls .owl2-nav .owl2-prev:hover, div.so-extraslider.grid .owl2-controls .owl2-nav .owl2-prev:hover {
background: #6e8f04;
color: #fff;
border-color: #6e8f04; }
.releate-products .owl2-controls .owl2-nav .owl2-next, div.so-extraslider.grid .owl2-controls .owl2-nav .owl2-next {
right: -18px; }
.releate-products .owl2-controls .owl2-nav .owl2-prev, div.so-extraslider.grid .owl2-controls .owl2-nav .owl2-prev {
left: -18px; }
.releate-products .modtitle, div.so-extraslider.grid .modtitle {
margin-bottom: 20px; }
.releate-products .item-element, div.so-extraslider.grid .item-element {
border: 1px solid #ddd;
border-bottom: none;
padding: 15px 15px 0;
margin: 0; }
.releate-products .item-element:last-child, div.so-extraslider.grid .item-element:last-child {
border: 1px solid #ddd; }
.releate-products .image, div.so-extraslider.grid .image {
width: 90px;
border: none;
margin-right: 15px; }
.releate-products .releate-products-slider, div.so-extraslider.grid .releate-products-slider {
position: relative;
z-index: 2; }
.module.banner-left {
margin-top: 30px; }
.releate-horizontal {
border: 1px solid #e8e8e8; }
.releate-horizontal .releate-products .item-element, .releate-horizontal div.so-extraslider.grid .item-element {
border-width: 1px 0 0 0; }
.releate-horizontal .releate-products .item-element:first-child, .releate-horizontal div.so-extraslider.grid .item-element:first-child {
border: none; }
.releate-horizontal.module h3.modtitle span {
font-size: 14px; }
.releate-horizontal:hover .releate-products .owl2-controls .owl2-nav .owl2-prev, .releate-horizontal:hover div.so-extraslider.grid .owl2-controls .owl2-nav .owl2-prev {
opacity: 1;
left: -18px; }
.releate-horizontal:hover .releate-products .owl2-controls .owl2-nav .owl2-next, .releate-horizontal:hover div.so-extraslider.grid .owl2-controls .owl2-nav .owl2-next {
opacity: 1;
right: -18px; }
.releate-horizontal .releate-products .owl2-controls .owl2-nav .owl2-prev, .releate-horizontal div.so-extraslider.grid .owl2-controls .owl2-nav .owl2-prev {
opacity: 0;
left: -30px;
-webkit-transition: all 0.3s ease 0s;
-moz-transition: all 0.3s ease 0s;
transition: all 0.3s ease 0s; }
.releate-horizontal .releate-products .owl2-controls .owl2-nav .owl2-next, .releate-horizontal div.so-extraslider.grid .owl2-controls .owl2-nav .owl2-next {
opacity: 0;
right: -30px;
-webkit-transition: all 0.3s ease 0s;
-moz-transition: all 0.3s ease 0s;
transition: all 0.3s ease 0s; }
.releate-horizontal .image {
width: 80px;
float: left; }
.releate-horizontal .ratings {
display: none; }
.releate-horizontal .caption h4 a {
font-size: 14px;
font-weight: 600;
color: #222; }
.releate-horizontal .caption h4 a:hover {
color: #6e8f04; }
/*Related Hozilzol*/
#product-related .owl2-controls {
display: none; }
/*Upsell*/
.ex_upsell.custom-extra {
position: relative; }
.ex_upsell.custom-extra .so-extraslider {
margin: 0; }
.ex_upsell.custom-extra .so-extraslider .extraslider-inner {
border: none;
padding: 0; }
.ex_upsell.custom-extra .so-extraslider .owl2-controls {
float: none; }
.ex_upsell.custom-extra .owl2-nav div {
display: inline-block;
width: 36px;
height: 36px;
background-repeat: no-repeat;
background-position: center center;
overflow: hidden;
font-family: FontAwesome;
font-size: 0;
color: #c0c0c0;
opacity: 1;
position: absolute;
top: 73%;
margin-top: -85px;
z-index: 501;
-webkit-transition: 0.2s;
-moz-transition: 0.2s;
transition: 0.2s;
cursor: pointer;
background: #fff !important;
border: 1px solid #ddd;
transition: all 0.3s ease 0s;
transform: scale(0);
text-align: center; }
.ex_upsell.custom-extra .owl2-nav div.owl2-prev {
left: 0px; }
.ex_upsell.custom-extra .owl2-nav div.owl2-prev:before {
content: "\f104";
line-height: 35px;
padding: 10px;
font-size: 28px; }
.ex_upsell.custom-extra .owl2-nav div.owl2-next {
right: 0; }
.ex_upsell.custom-extra .owl2-nav div.owl2-next:before {
content: "\f105";
line-height: 35px;
padding: 10px;
font-size: 28px; }
.ex_upsell.custom-extra .owl2-nav div:hover {
background-color: #6e8f04;
border-color: #6e8f04;
color: #fff; }
.ex_upsell.custom-extra:hover .owl2-nav div {
transform: scale(1); }
.bottom-product {
padding: 0 15px; }
.bottom-product .nav-tabs {
display: block;
vertical-align: top;
margin: 0 0 10px;
border-bottom: 1px solid #e8e8e8;
background-color: transparent; }
.bottom-product .nav-tabs li {
background-color: transparent;
border: 0; }
.bottom-product .nav-tabs li:first-child a {
padding-left: 0; }
.bottom-product .nav-tabs li:first-child a:before {
content: '';
width: 1px;
height: 16px;
background-color: #ebebeb;
position: absolute;
top: 16px;
right: 0; }
.bottom-product .nav-tabs li:last-child:before {
display: none; }
.bottom-product .nav-tabs li a {
margin: 0;
border: 0;
display: inline-block;
padding: 12px 20px;
background-color: transparent;
font-size: 18px;
color: #222;
font-weight: bold;
font-family: 'Raleway';
text-transform: uppercase;
position: relative; }
.bottom-product .nav-tabs li a:after {
content: '';
position: absolute;
bottom: 0px;
width: 0;
height: 2px;
-webkit-transition: all 0.2s ease 0s;
-moz-transition: all 0.2s ease 0s;
transition: all 0.2s ease 0s;
background-color: #6e8f04;
left: 0; }
.bottom-product .nav-tabs > li > a:hover, .bottom-product .nav-tabs > li.active > a, .bottom-product .nav-tabs > li.active > a:focus, .bottom-product .nav-tabs > li.active > a:hover {
border: none;
color: #6e8f04;
background: transparent; }
.bottom-product .nav-tabs > li > a:hover:after, .bottom-product .nav-tabs > li.active > a:after, .bottom-product .nav-tabs > li.active > a:focus:after, .bottom-product .nav-tabs > li.active > a:hover:after {
width: 100px; }
.bottom-product .tab-content {
border: none;
padding: 0;
margin: 0; }
.bottom-product .active.tab-pane {
height: auto !important; }
.bottom-product .tab-pane {
height: 0;
display: block;
overflow: hidden; }
/*============ HEADER ==================*/
.horizontal ul.megamenu > li > .sub-menu {
border-top: 2px solid #6e8f04; }
.horizontal ul.megamenu > li > a {
padding: 10px 15px;
text-transform: uppercase; }
.horizontal ul.megamenu > li > a .fa {
padding-right: 10px; }
.horizontal ul.megamenu > li {
margin-right: 1px;
float: left; }
.horizontal ul.megamenu li .sub-menu .content .fa {
margin: 0 10px; }
.horizontal ul.megamenu > li.active > a, .horizontal ul.megamenu > li.home > a, .horizontal ul.megamenu > li:hover > a {
background: transparent;
color: #6e8f04; }
.horizontal .subcategory li a {
color: #555; }
.horizontal .subcategory li a:hover {
color: #6e8f04; }
.header-top .header-top-left .welcome-msg .owl2-carousel .owl2-stage-outer {
direction: ltr; }
.mega-horizontal .navbar-default {
border: none;
background: transparent; }
@media (max-width: 991px) {
.responsive ul.megamenu > li.click:before, .responsive ul.megamenu > li.hover:before {
right: 0;
left: auto; }
.responsive ul.megamenu > li.active .close-menu {
right: 0;
left: auto; } }
.header-bottom .content_menu .container {
overflow: visible; }
@media (min-width: 1200px) {
.btn-shopping-cart:before {
content: "";
width: 38px;
height: 25px;
position: absolute;
bottom: -9px;
background: transparent;
right: 0;
z-index: 99; } }
.btn-shopping-cart .dropdown-menu {
min-width: 350px;
border: none; }
.btn-shopping-cart .dropdown-menu:before {
content: "";
background: #485d03;
height: 3px;
width: 100%;
left: 0;
right: 0;
top: 0;
position: absolute; }
.btn-shopping-cart .dropdown-menu:after {
border-color: transparent transparent #6e8f04 transparent;
border-width: 10px;
top: -21px; }
.btn-shopping-cart .dropdown-menu .cart_product_name {
color: #555; }
.btn-shopping-cart .dropdown-menu .cart_product_name:hover {
color: #6e8f04; }
.btn-shopping-cart .dropdown-menu .empty {
padding: 15px; }
.btn-shopping-cart .table > tbody > tr > td {
border: none;
border-bottom: 1px solid #eee;
vertical-align: middle; }
.btn-shopping-cart .checkout {
padding: 0 20px 10px; }
.btn-shopping-cart .added_items {
padding: 10px; }
.typeheader-5 #sosearchpro.so-search .autosearch-input {
border-color: #0f8db3 !important; }
.megamenu-style-dev {
position: relative; }
.megamenu-style-dev .vertical ul.megamenu {
position: absolute;
width: 100%;
background: #222;
z-index: 999; }
.megamenu-style-dev .vertical ul.megamenu > li > a {
font-size: 11px; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li {
margin: 0;
border-right: 0;
background: #222; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li strong i {
display: none; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li > a {
padding-left: 15px;
padding-right: 12px;
color: #fff; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li > a:hover {
color: #fff; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.css-menu .sub-menu .content {
padding: 0; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.css-menu .hover-menu .menu > ul {
padding: 0;
margin: 0; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.css-menu .hover-menu .menu > ul li {
border-bottom: 1px solid #eee; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.css-menu .hover-menu .menu > ul li:hover {
background: #eee; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.css-menu .hover-menu .menu > ul li:hover > a {
color: #6e8f04; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.css-menu .hover-menu .menu > ul li a {
line-height: 37px; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.css-menu .hover-menu .menu > ul li a b {
line-height: 37px;
font-size: 16px;
margin: 0 20px; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.css-menu .hover-menu .menu > ul li:last-child {
border: none; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.css-menu .hover-menu .menu > ul ul {
padding: 0;
left: 100%;
margin: 0;
box-shadow: none;
border: 1px solid #eee;
min-width: 200px; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.css-menu .hover-menu .menu > ul ul:before, .megamenu-style-dev .vertical .vertical ul.megamenu > li.css-menu .hover-menu .menu > ul ul:after {
display: none; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.item-style3 .sub-menu .content {
padding-right: 0; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.with-sub-menu > a:after {
content: "\f105";
color: #fff;
font-family: Fontawesome;
font-size: 13px;
float: right;
margin: 0; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.with-sub-menu:hover > a:after {
position: static;
border-color: transparent; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li:hover {
background-color: #444; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li:hover > a {
color: #fff; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.active > a {
background: transparent !important; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li .sub-menu .content {
border-top: 1px solid #ddd; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li .sub-menu .content .banner {
margin-top: -21px;
margin-bottom: -22px;
margin-right: -1px; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li .sub-menu .content .static-menu .menu ul a.main-menu {
padding: 0; }
.megamenu-style-dev .vertical ul.megamenu .sub-menu .content .static-menu .menu ul {
padding-bottom: 0; }
.megamenu-style-dev .vertical ul.megamenu .sub-menu .content .static-menu .menu ul li > a {
line-height: inherit;
padding-bottom: 0;
border-bottom: none;
min-height: auto; }
.megamenu-style-dev .vertical ul.megamenu .sub-menu .content .static-menu .menu ul li > a:hover {
color: #6e8f04; }
.megamenu-style-dev .vertical ul.megamenu .sub-menu .content .static-menu .menu ul ul a {
padding: 0; }
.megamenu-style-dev .vertical ul.megamenu .sub-menu .content .static-menu .menu ul ul a:hover {
color: #6e8f04; }
header.typeheader-1 .header-bottom {
background: #6e8f04; }
.typeheader-2 .shopping_cart {
background: #6e8f04; }
.typeheader-2 .shopping_cart:after {
border-right: 15px solid #6e8f04; }
.typeheader-2 .shopping_cart .total-shopping-cart {
background-color: #485d03; }
.typeheader-1 .header-top .header-top-left .link-lg, .typeheader-1 .header-top .header-top-right ul.top-link > li:hover > a, .typeheader-1 .megamenu-style-dev .horizontal ul.megamenu > li:hover > a {
color: #6e8f04 !important; }
.typeheader-1 #sosearchpro.so-search .autosearch-input {
border-color: #6e8f04; }
.typeheader-2 .header-top-right ul.top-link > li:hover > a {
color: #6e8f04; }
.typeheader-2 #sosearchpro.so-search .button-search i {
color: #6e8f04; }
.typeheader-2 #sosearchpro.so-search .button-search:hover i {
color: #485d03; }
.typeheader-2 .header-top .header-top-right ul.top-link > li:hover > a, .typeheader-2 .header-top .header-top-left .link-lg {
color: #6e8f04 !important; }
.typeheader-2 .shopping_cart, .typeheader-2 .header-bottom .header_custom_link li a, .typeheader-2 #sosearchpro.so-search .autosearch-input, .typeheader-2 #sosearchpro.so-search .select_category {
border-color: #6e8f04 !important; }
.typeheader-2 .header-center .phone-header a:hover, .typeheader-2 .header-center .phone-header .phone, .typeheader-2 .megamenu-style-dev .horizontal ul.megamenu > li.active > a, .typeheader-2 .megamenu-style-dev .horizontal ul.megamenu > li:hover > a {
color: #6e8f04 !important; }
.typeheader-2 #sosearchpro.so-search .button-search:hover {
background: #6e8f04 !important; }
.typeheader-2 #sosearchpro.so-search .button-search:hover i {
color: #fff !important; }
.typeheader-2 .shopping_cart .btn-shopping-cart .total-shopping-cart, .typeheader-2 .container-megamenu.vertical #menuHeading .megamenuToogle-wrapper {
background: #6e8f04 !important; }
header.typeheader-3 .header-top-right ul.top-link > li:hover > a {
color: #6e8f04 !important; }
header.typeheader-3 #sosearchpro.so-search .button-search:hover i {
color: #485d03; }
header.typeheader-4 .container-megamenu.vertical .vertical-wrapper {
border-color: #6e8f04; }
.typeheader-4 .header-top-right ul.top-link > li:hover > a {
color: #6e8f04; }
.typeheader-4 #sosearchpro.so-search .button-search i {
color: #6e8f04; }
.typeheader-4 #sosearchpro.so-search .button-search:hover i {
color: #485d03; }
.typeheader-5 .header-top-right ul.top-link > li:hover > a {
color: #6e8f04; }
.typeheader-5 #sosearchpro.so-search .button-search i {
color: #6e8f04; }
.typeheader-5 #sosearchpro.so-search .button-search:hover i {
color: #485d03; }
.typeheader-5 .header-top {
background: #6e8f04;
border-color: #6e8f04; }
.typeheader-5 .header-top .header-top-left .welcome-msg .label-msg {
background: #94c105; }
header.typeheader-6 .header-center .block_link a {
background: #6e8f04; }
header.typeheader-6 .header-bottom {
background-color: #6e8f04; }
header.typeheader-6 .header-top .header-top-right ul.top-link > li .btn-group .btn-link:hover {
color: #6e8f04; }
header.typeheader-6 .header-top .header-top-right ul.top-link > li:hover > a {
color: #6e8f04; }
header.typeheader-6 #sosearchpro.so-search .select_category, header.typeheader-6 #sosearchpro.so-search .autosearch-input {
border: 1px solid #6e8f04; }
header.typeheader-6 #sosearchpro.so-search .button-search {
background: #6e8f04; }
header.typeheader-6 #sosearchpro.so-search .button-search:hover {
background: #485d03; }
header.typeheader-7 .header-top .header-top-right ul.top-link > li:hover > a {
color: #6e8f04; }
header.typeheader-7 .header-top .header-top-right ul.top-link > li .btn-group .btn-link:hover {
color: #6e8f04; }
header.typeheader-7 .megamenu-style-dev .horizontal ul.megamenu > li.active > a, header.typeheader-7 .megamenu-style-dev .horizontal ul.megamenu > li:hover > a {
color: #6e8f04; }
header.typeheader-7 .shopping_cart .total-shopping-cart {
background: #6e8f04; }
header.typeheader-7 #sosearchpro.so-search .button-search {
background: #6e8f04; }
header.typeheader-7 #sosearchpro.so-search .button-search:hover {
background: #485d03; }
/************************************************************************************************
FOOTER DEFFAULT
*************************************************************************************************/
footer {
/* [4] */
/* [6] */
/* [6] */
/* [7] */
font-size: 13px;
font-size: 1.3rem;
/* [8] */
color: #7d7d7d;
background: #f0f0f0;
/*FOOTER BOTTOM*/
/*HTML SOCIAL*/
/*NEWLETTER*/ }
footer a {
color: #7d7d7d; }
footer .module {
margin: 0; }
footer .module h3.footertitle {
/* [4] */
/* [6] */
/* [6] */
/* [7] */
font-size: 16px;
font-size: 1.6rem;
/* [8] */
font-weight: bold;
border: none;
color: #222;
letter-spacing: 1.2px;
text-transform: uppercase;
margin: 0 0 12px 0;
line-height: inherit;
height: auto; }
footer .footer-top {
background-color: #6e8f04;
padding: 18px 0 19px; }
footer .footer-top .block-infos .info {
width: 20%;
float: left; }
footer .footer-top .block-infos .info .inner {
float: left;
width: 100%;
border-left: 1px solid rgba(255, 255, 255, 0.3);
padding-left: 35px; }
footer .footer-top .block-infos .info .inner i {
float: left;
font-size: 36px;
padding-top: 1px;
color: #fff; }
footer .footer-top .block-infos .info .inner .info-cont {
padding-left: 50px; }
footer .footer-top .block-infos .info .inner .info-cont span {
font-size: 13px;
color: #fff;
text-transform: uppercase;
margin-bottom: 2px;
font-weight: 600; }
footer .footer-top .block-infos .info .inner .info-cont p {
text-transform: capitalize;
color: #fff;
padding-top: 0;
margin-bottom: 0px;
line-height: normal; }
footer .footer-top .block-infos .info.info1 .inner {
border-left: 0;
padding-left: 0px; }
footer .footer-center {
padding-top: 25px; }
@media (min-width: 1200px) {
footer .footer-center {
padding-top: 44px; }
footer .footer-center .footer-extra {
padding: 0 0 0 40px; }
footer .footer-center .footer-contact {
padding-left: 50px; }
footer .footer-center .footer-newsletter {
width: 70%; }
footer .footer-center .footer-socials {
width: 30%; } }
footer .footer-center .module ul.menu li a {
position: relative;
color: #7d7d7d;
text-transform: capitalize;
font-size: 13px;
position: relative;
padding: 4px 0px 5px 0px;
-webkit-transition: all 0.3s ease 0s;
-moz-transition: all 0.3s ease 0s;
transition: all 0.3s ease 0s;
display: inline-block;
vertical-align: top; }
footer .footer-center .module ul.menu li a:before {
content: '\f105';
font-family: FontAwesome;
font-size: 14px;
margin-right: 8px; }
footer .footer-center .module ul.menu li a:hover {
color: #6e8f04;
padding-left: 10px; }
footer .footer-center .footer-contact ul > li {
list-style: none;
overflow: hidden;
line-height: 24px;
margin-top: 23px; }
footer .footer-center .footer-contact ul > li .fa {
width: 31px;
height: 31px;
background-color: #9d9d9d;
color: #fff;
line-height: 31px;
font-size: 16px;
text-align: center;
float: left;
border-radius: 2px;
margin-right: 10px; }
footer .footer-center .footer-contact ul > li span {
display: block;
overflow: hidden;
line-height: 15px;
color: #7d7d7d;
font-size: 13px; }
footer .footer-center .footer-contact ul > li.email {
margin-bottom: 22px;
line-height: 32px;
font-size: 13px; }
footer .footer-center .custom_categories {
border-top: 1px solid #e0e0e0;
text-align: center;
clear: both;
padding: 28px 0 30px 0;
margin-top: 36px; }
footer .footer-center .custom_categories nav a {
color: #222;
font-weight: 700;
text-transform: uppercase;
padding: 0 15px;
-webkit-transition: all 0.3s ease 0s;
-moz-transition: all 0.3s ease 0s;
transition: all 0.3s ease 0s; }
footer .footer-center .custom_categories nav a:hover {
color: #6e8f04; }
footer .footer-center .custom_categories p {
padding: 0 25%;
line-height: 28px;
margin: 10px 13px 0; }
footer .footer-center .footer-center-2 {
border-top: 1px solid #e0e0e0;
padding: 30px 0; }
footer .footer-bottom {
background-color: #3b3b3b;
text-align: center;
padding: 22px 0; }
footer .footer-bottom .copyright {
margin-bottom: 7px; }
footer .footer-bottom .copyright a {
color: #6e8f04; }
footer .socials-wrap {
display: inline-block;
float: right; }
footer .socials-wrap .title-follow {
white-space: nowrap;
display: table-cell;
vertical-align: top;
padding-top: 8px; }
footer .socials-wrap ul {
display: table-cell;
padding-top: 5px;
padding-left: 5px; }
footer .socials-wrap ul li {
float: left;
margin-left: 9px; }
footer .socials-wrap ul li a {
font-size: 18px;
display: block;
width: 34px;
height: 34px;
text-align: center;
line-height: 34px;
background-color: #fff;
color: #222;
border-radius: 50%;
-webkit-border-radius: 50%;
-webkit-transition: all 0.3s ease 0s;
-moz-transition: all 0.3s ease 0s;
transition: all 0.3s ease 0s; }
footer .socials-wrap ul li a:hover {
color: #6e8f04; }
footer .socials-wrap ul li a i {
font-size: 16px; }
footer .socials-wrap ul li a .name-social {
display: none; }
footer .news-letter {
overflow: hidden;
float: left;
color: #222;
padding-right: 0; }
footer .news-letter .title-block {
display: table-cell;
line-height: 100%;
padding: 15px 0;
white-space: nowrap; }
footer .news-letter .page-heading {
font-size: 16px;
text-transform: uppercase;
font-weight: bold;
color: #222; }
footer .news-letter .pre-text {
margin: 0;
line-height: 12px;
font-size: 12px;
display: none; }
footer .news-letter .block_content {
padding: 0 30px 0 27px;
display: table-cell;
margin-top: 0;
vertical-align: top; }
footer .news-letter .block_content form {
margin: 0px; }
footer .news-letter .block_content form .form-group {
margin: 0px;
overflow: hidden; }
footer .news-letter .block_content .input-box {
float: left; }
footer .news-letter .block_content .input-box input {
border-radius: 20px 0 0 20px;
height: 42px;
padding: 5px 15px;
background: #fff;
color: #999;
font-size: 12px;
float: left;
width: 515px;
transition: 0.3s all ease 0s;
border: solid 1px #fff;
border-right: none;
margin-right: 20px; }
footer .news-letter .block_content .subcribe {
right: 0;
position: absolute; }
footer .news-letter .block_content .subcribe button {
border-radius: 0 20px 20px 0;
height: 42px;
text-transform: uppercase;
font-size: 14px;
transition: 0.3s all ease 0s;
font-weight: bold;
background-color: #6e8f04;
border-color: #6e8f04;
color: #fff; }
@media (min-width: 1200px) {
footer .news-letter .block_content .subcribe button {
padding: 0 25px; } }
footer .news-letter .block_content .subcribe button:hover {
background-color: #485d03;
border-color: #485d03; }
footer.typefooter-6 div.footer-top {
background-color: #6e8f04; }
footer.typefooter-6 div.footer-top .bf-right a:hover {
color: #6e8f04; }
footer.typefooter-6 .footer-center .footer-newletter .subcribe .btn:hover {
background: #485d03; }
footer.typefooter-6 div.footer-center .module ul.menu li a:hover {
color: #6e8f04; }
footer.typefooter-7 .footer-center ul li a:hover {
color: #6e8f04; }
/*===============================================
[SASS DIRECTORY ]
[1] MODULE DEFAULT
[2] BLOCK SEARCH
[3] SOCIAL FOOTER
==============================================*/
#content {
margin-bottom: 40px; }
.sohomepage-slider .so-homeslider {
border: none; }
.container-megamenu.vertical .vertical-wrapper {
display: none; }
.container-megamenu.vertical:hover .vertical-wrapper {
position: absolute;
width: 100%;
display: block;
z-index: 9; }
@media (min-width: 1200px) {
.common-home .block-slide {
padding-left: 0; }
.common-home .block-slide .block-left {
padding: 0;
width: 71%; }
.common-home .block-slide .block-right {
padding-left: 0;
width: 29%; }
.common-home .block-slide .block-right .module {
margin: 0; }
.common-home .module h3.modtitle span {
font-size: 18px; } }
.common-home .module h3.modtitle {
padding: 15px 0 13px;
border: 0;
position: relative;
font-size: 18px;
color: #222;
text-transform: uppercase;
text-align: center;
background: transparent; }
.common-home .module h3.modtitle span {
font-weight: 800;
text-transform: uppercase;
line-height: 100%;
padding-bottom: 5px; }
.common-home .module h3.modtitle:before {
content: '';
height: 2px;
width: 100px;
background-color: #0f8db3;
position: absolute;
bottom: -1px;
left: 50%;
margin-left: -50px; }
.common-home .module h3.modtitle:after {
display: none; }
.common-home .block.block_1 {
margin-top: 0; }
.common-home .block.block_2 {
margin-top: 0; }
.common-home .block.block_3 {
margin-top: 12px; }
.common-home .block.block_4 {
margin-top: 34px; }
.common-home .block.block_5 {
margin-top: 41px; }
.common-home .block.block_6 {
margin-top: 29px; }
.common-home .block.block_7 {
margin-top: 26px; }
.common-home .block.block_8 {
margin-top: 20px; }
.common-home .block.block_9 {
margin-top: 40px; }
.common-home .block.block_10 {
margin-top: 31px; }
.common-home .block.block_11 {
margin-top: 6px; }
/************************************************************************************************
MODULE HOME SLIDER
*************************************************************************************************/
.module.sohomepage-slider {
margin: 0; }
.module.sohomepage-slider .owl2-controls .owl2-nav div {
position: absolute;
margin: 0;
top: 50%;
-webkit-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-ms-transform: translateY(-50%);
-o-transform: translateY(-50%);
transform: translateY(-50%);
outline: 0;
width: 36px;
height: 36px;
font-size: 0;
z-index: 9;
transition: all 0.3s ease; }
.module.sohomepage-slider .owl2-controls .owl2-nav div.owl2-prev {
left: 0px;
background: #444 url("../../images/icon/arrow-slider-left.png") no-repeat center;
border: none; }
.module.sohomepage-slider .owl2-controls .owl2-nav div.owl2-prev:hover {
background-color: #6e8f04; }
.module.sohomepage-slider .owl2-controls .owl2-nav div.owl2-prev:before, .module.sohomepage-slider .owl2-controls .owl2-nav div.owl2-prev:after {
display: none; }
.module.sohomepage-slider .owl2-controls .owl2-nav div.owl2-next {
right: 0px;
background: #444 url("../../images/icon/arrow-slider-right.png") no-repeat center;
border: none; }
.module.sohomepage-slider .owl2-controls .owl2-nav div.owl2-next:hover {
background-color: #6e8f04; }
.module.sohomepage-slider .owl2-controls .owl2-nav div.owl2-next:before, .module.sohomepage-slider .owl2-controls .owl2-nav div.owl2-next:after {
display: none; }
.module.sohomepage-slider .owl2-dots {
position: absolute;
bottom: 50px;
width: 100%;
line-height: 100%;
left: 30px; }
.module.sohomepage-slider .owl2-dots .owl2-dot {
display: inline-block; }
.module.sohomepage-slider .owl2-dots .owl2-dot span {
width: 8px;
height: 8px;
background-color: #7d7d7d;
border: none;
margin: 0 2px;
opacity: 1;
display: block;
border-radius: 50%;
-webkit-border-radius: 50%;
-webkit-transition: all 0.2s ease 0s;
-moz-transition: all 0.2s ease 0s;
transition: all 0.2s ease 0s; }
.module.sohomepage-slider .owl2-dots .owl2-dot.active span {
background-color: #6e8f04;
width: 25px;
border-radius: 4px; }
.module.sohomepage-slider .owl2-dots .owl2-dot:hover span {
background-color: #6e8f04; }
.module.sohomepage-slider .owl2-item.active .sohomeslider-description .title-slider {
opacity: 1;
animation: myeffect-slideshow 2s ease-in-out;
-webkit-animation: myeffect-slideshow 2s ease-in-out;
/* Chrome, Safari, Opera */
-moz-animation: myeffect-slideshow 2s ease-in-out;
-o-animation: myeffect-slideshow 2s ease-in-out;
-ms-animation: myeffect-slideshow 2s ease-in-out; }
.module.sohomepage-slider .owl2-item.active .sohomeslider-description h3.tilte {
opacity: 1;
animation: myeffect-slideshow 1.5s ease-in-out;
-webkit-animation: myeffect-slideshow 1.5s ease-in-out;
/* Chrome, Safari, Opera */
-moz-animation: myeffect-slideshow 1.5s ease-in-out;
-o-animation: myeffect-slideshow 1.5s ease-in-out;
-ms-animation: myeffect-slideshow 1.5s ease-in-out; }
.module.sohomepage-slider .owl2-item.active .sohomeslider-description h4 {
opacity: 1;
animation: myeffect-slideshow 1s ease-in-out;
-webkit-animation: myeffect-slideshow 1s ease-in-out;
/* Chrome, Safari, Opera */
-moz-animation: myeffect-slideshow 1s ease-in-out;
-o-animation: myeffect-slideshow 1s ease-in-out; }
.module.sohomepage-slider .owl2-item.active .sohomeslider-description .des {
opacity: 1;
animation: myeffect-slideshow 0.8s ease-in-out;
-webkit-animation: myeffect-slideshow 0.8s ease-in-out;
/* Chrome, Safari, Opera */
-moz-animation: myeffect-slideshow 0.8s ease-in-out;
-o-animation: myeffect-slideshow 0.8s ease-in-out; }
.module.sohomepage-slider .sohomeslider-description {
position: static;
padding: 0; }
.module.sohomepage-slider .sohomeslider-description p {
width: 100%;
color: #fff;
font-size: 14px;
padding: 0;
padding: 0;
margin: 0; }
.module.sohomepage-slider .sohomeslider-description .title-slider {
position: absolute;
width: auto;
opacity: 0;
top: 31%;
font-size: 20px;
color: #3b3b3b;
text-transform: uppercase; }
.module.sohomepage-slider .sohomeslider-description .title-slider.pos-right {
right: 30px; }
.module.sohomepage-slider .sohomeslider-description .title-slider.pos-left {
left: 30px; }
.module.sohomepage-slider .sohomeslider-description .title-slider.image-sl12 {
left: 35px; }
.module.sohomepage-slider .sohomeslider-description .text {
position: absolute;
top: 49%;
-webkit-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-ms-transform: translateY(-50%);
-o-transform: translateY(-50%);
transform: translateY(-50%); }
.module.sohomepage-slider .sohomeslider-description .text h3.tilte, .module.sohomepage-slider .sohomeslider-description .text h4, .module.sohomepage-slider .sohomeslider-description .text .des {
opacity: 0; }
.module.sohomepage-slider .sohomeslider-description .text.pos-right {
right: 70px; }
.module.sohomepage-slider .sohomeslider-description .text.pos-left {
left: 30px; }
.module.sohomepage-slider .sohomeslider-description .text .modtitle-sl11 {
font-size: 34px;
font-weight: bold;
text-transform: uppercase;
color: #fff;
letter-spacing: 2px; }
.module.sohomepage-slider .sohomeslider-description .text.text-sl11 {
left: 30px; }
.module.sohomepage-slider .sohomeslider-description .text.text-sl12 h3.tilte {
font-size: 30px;
color: #444;
font-weight: 700;
margin: 0; }
.module.sohomepage-slider .sohomeslider-description .text.text-sl12.pos-left {
left: 150px;
top: 65%; }
.module.sohomepage-slider .sohomeslider-description .text.text-sl12.pos-left i {
margin-right: 5px; }
.module.sohomepage-slider .sohomeslider-description .text.text-sl12.pos-left:hover {
color: #222; }
.module.sohomepage-slider .sohomeslider-description .text.text-sl12.pos-left a {
font-weight: 600;
color: #6e8f04;
font-size: 14px; }
.module.sohomepage-slider .sohomeslider-description .text.text-sl12 h4 {
font-size: 84px;
color: #6e8f04;
font-weight: 700;
margin: 0; }
.module.sohomepage-slider .sohomeslider-description .text.text-sl12 .des {
font-size: 27px;
color: #444; }
.module.sohomepage-slider .sohomeslider-description .text.text-sl13 h3.tilte {
font-size: 26px;
font-weight: 700;
color: #fff; }
.module.sohomepage-slider .sohomeslider-description .text.text-sl13 h4 {
font-size: 80px;
font-weight: 700;
color: #6e8f04; }
.module.sohomepage-slider .sohomeslider-description .des.des-sl11 {
margin-top: 15px;
color: #fff;
font-size: 14px; }
.module.sohomepage-slider .sohomeslider-description .des.des-sl11 i {
margin-right: 5px; }
.module.sohomepage-slider .sohomeslider-description .des.des-sl11:hover {
color: #222; }
#Section-featute {
position: relative;
margin-top: 43px; }
#Section-featute:before {
background: url("../../images/bg-featured.jpg") no-repeat center;
content: "";
position: absolute;
min-height: 400px;
width: 100%; }
#Section-featute .owl2-stage-outer {
direction: ltr; }
#Section-featute .module {
margin: 0; }
#Section-featute .cate-content-home5 {
padding: 30px 30px 0;
background-color: #fff;
margin-top: 25px; }
#Section-featute .cate-content-home5 .inner {
cursor: pointer; }
#Section-featute .cate-content-home5 .inner a {
box-shadow: 0px 2px 3px 0px rgba(100, 100, 100, 0.3);
display: block;
height: 52px;
line-height: 52px;
text-align: center;
color: #222;
font-weight: bold;
text-transform: uppercase;
font-size: 16px;
background-color: #fff;
margin-bottom: 10px; }
#Section-featute .cate-content-home5 .inner:hover img {
opacity: 0.9; }
#Section-featute .cate-content-home5 .inner:hover a {
background-color: #222;
color: #fff; }
/************************************************************************************************
SHORT CODE CONTENT SLIDER BRAND
*************************************************************************************************/
.top-brand.arrow-default {
padding: 15px;
direction: ltr;
padding: 14px 20px;
border: 1px solid #ebebeb;
border-radius: 8px; }
@media (min-width: 1200px) {
.top-brand.arrow-default {
padding: 14px 80px; } }
.top-brand.arrow-default .owl2-nav div {
width: 41px;
height: 41px;
transition: inherit; }
.top-brand.arrow-default .owl2-nav div.owl2-prev {
left: 16px;
opacity: 1; }
.top-brand.arrow-default .owl2-nav div.owl2-next {
right: 16px;
opacity: 1; }
.top-brand.arrow-default img:hover {
opacity: 0.9; }
/************************************************************************************************
HTML SERVICES
*************************************************************************************************/
.policy-w {
padding: 15px 0 14px 0; }
.policy-w .policy {
font-size: 14px;
line-height: 100%; }
.policy-w .policy i {
font-size: 16px;
color: #222;
margin-right: 10px; }
.policy-w .policy span {
font-weight: 700;
color: #222; }
/************************************************************************************************
Mod Listing Tab
*************************************************************************************************/
.module.custom_listingtab_h5 {
margin-bottom: 0; }
.module.custom_listingtab_h5 .so-listing-tabs {
margin: 0; }
.module.custom_listingtab_h5 .so-listing-tabs .ltabs-wrap .ltabs-items-container {
border-width: 1px 1px 0 0;
border-color: #ebebeb;
border-style: solid; }
.module.custom_listingtab_h5 .description {
margin-bottom: 33px !important; }
.module.custom_listingtab_h5 .products-list.grid .product-layout .product-item-container {
padding: 0;
margin: 0;
border-width: 0 0 1px 1px;
border-color: #ebebeb; }
.module.custom_listingtab_h5 .products-list.grid .product-layout .product-item-container .right-block {
margin-top: 18px;
display: inline-block; }
.module.custom_listingtab_h5 .products-list.grid .product-layout .product-item-container .button-group button {
border-color: #222;
color: #222; }
.module.custom_listingtab_h5 .products-list.grid .product-layout .product-item-container .button-group button.addToCart {
background: #222;
color: #fff; }
.module.custom_listingtab_h5 .products-list.grid .product-layout .product-item-container .button-group button:hover {
background: #6e8f04;
color: #fff;
border-color: #6e8f04; }
.module.custom_listingtab_h5 .products-list.grid .product-layout .product-item-container .quickview {
border-color: #222;
color: #fff;
background: #222; }
.module.custom_listingtab_h5 .products-list.grid .product-layout .product-item-container .quickview:hover {
background: #6e8f04;
border-color: #6e8f04; }
.module.custom_listingtab_h5 .wap-listing-tabs {
margin-top: 23px; }
.module.custom_listingtab_h5 .owl2-controls {
position: absolute;
top: 21px;
right: 15px; }
.module.custom_listingtab_h5 .owl2-controls .owl2-nav > div {
border: none;
width: 28px;
height: 28px;
background-color: transparent;
opacity: 1;
visibility: visible;
position: relative;
top: 0; }
.module.custom_listingtab_h5 .owl2-controls .owl2-nav > div.owl2-prev {
right: 5px;
left: auto; }
.module.custom_listingtab_h5 .owl2-controls .owl2-nav > div:hover {
border: none; }
.module.custom_listingtab_h5 .ltabs-wrap .ltabs-tabs-container {
margin: 0;
text-align: center; }
.module.custom_listingtab_h5 .ltabs-wrap .ltabs-tabs-container .ltabs-tabs {
display: inline-block; }
.module.custom_listingtab_h5 .ltabs-wrap .ltabs-tabs-container .ltabs-tabs li {
float: left;
padding: 0;
border: none;
margin: 0;
position: relative; }
.module.custom_listingtab_h5 .ltabs-wrap .ltabs-tabs-container .ltabs-tabs li span {
display: inline-block;
height: 40px;
text-align: center;
line-height: 40px;
font-weight: bold;
text-transform: uppercase;
border-radius: 0;
font-size: 18px;
color: #222;
padding: 0 15px 10px;
position: relative;
-webkit-transition: all 0.2s ease 0s;
-moz-transition: all 0.2s ease 0s;
transition: all 0.2s ease 0s; }
.module.custom_listingtab_h5 .ltabs-wrap .ltabs-tabs-container .ltabs-tabs li:hover {
background: transparent; }
.module.custom_listingtab_h5 .ltabs-wrap .ltabs-tabs-container .ltabs-tabs li:hover span {
color: #6e8f04; }
.module.custom_listingtab_h5 .ltabs-wrap .ltabs-tabs-container .ltabs-tabs li.tab-sel {
background: transparent; }
.module.custom_listingtab_h5 .ltabs-wrap .ltabs-tabs-container .ltabs-tabs li.tab-sel span {
color: #6e8f04; }
.module.custom_listingtab_h5 .ltabs-wrap .ltabs-tabs-container .ltabs-tabs li.tab-sel span:before {
content: '';
width: 100px;
height: 2px;
display: inline-block;
position: absolute;
opacity: 1;
bottom: 0;
background-color: #6e8f04;
margin-left: -50px;
left: 50%; }
.module.custom_listingtab_h5 .ltabs-wrap .ltabs-tabs-container .ltabs-tabs li:first-child:after {
position: absolute;
z-index: 5;
top: 8px;
content: '';
width: 1px;
height: 22px;
background-color: #efefef;
transform: rotate(20deg);
right: 0; }
/************************************************************************************************
MODULE LASTET BLOG
*************************************************************************************************/
.module.custom-ourblog {
margin-bottom: 6px;
position: relative; }
.module.custom-ourblog h3.modtitle {
position: relative;
background: transparent;
padding-left: 0; }
.module.custom-ourblog h3.modtitle:before {
display: none; }
.module.custom-ourblog h3.modtitle:after {
content: '';
height: 2px;
width: 100px;
background-color: #6e8f04;
position: absolute;
bottom: -1px;
left: 0; }
.module.custom-ourblog .so-blog-external.button-type2 .owl2-nav {
position: absolute;
top: 10px;
right: 0; }
.module.custom-ourblog .owl2-carousel .owl2-stage-outer {
direction: ltr; }
.module.custom-ourblog .so-blog-external .blog-external .media .so-block {
float: none; }
.module.custom-ourblog .blog-external {
border: none;
margin-top: 8px; }
.module.custom-ourblog .blog-external .content-img {
position: relative; }
.module.custom-ourblog .blog-external .content-img:before {
content: '';
width: 0;
height: 0;
border-bottom: 85px solid transparent;
top: 0;
position: absolute;
z-index: 2;
border-left: 80px solid #fff;
left: 0; }
.module.custom-ourblog .blog-external .content-img .entry-date {
position: absolute;
top: 0;
z-index: 2;
left: 0; }
.module.custom-ourblog .blog-external .content-img .entry-date .day-time {
font-size: 24px;
color: #909090;
font-weight: bold; }
.module.custom-ourblog .blog-external .content-img .entry-date .month-time {
font-size: 14px;
color: #909090; }
.module.custom-ourblog .blog-external .content-img img:hover {
opacity: 0.9; }
.module.custom-ourblog .blog-external .content-detail h4 a {
color: #222;
font-size: 14px;
text-transform: capitalize;
display: block;
padding: 0; }
.module.custom-ourblog .blog-external .content-detail h4 a:hover {
color: #6e8f04; }
.module.custom-ourblog .blog-external .content-detail .media-heading {
margin: 15px 0 10px; }
.module.custom-ourblog .blog-external .content-detail .media-subcontent .media-author {
border: none;
color: #909090; }
.module.custom-ourblog .blog-external .content-detail .media-subcontent i {
font-size: 14px;
margin-right: 5px; }
.module.custom-ourblog .blog-external .content-detail .readmore {
border-top: 1px solid #ddd;
padding-top: 14px;
margin-top: 14px;
width: 100%;
display: block; }
.module.custom-ourblog .blog-external .content-detail .readmore a {
color: #6e8f04;
font-weight: 600; }
.module.custom-ourblog .blog-external .content-detail .readmore i {
margin-right: 5px; }
/************************************************************************************************
DEFFAULT BESTSELLER HOME
*************************************************************************************************/
.bestseller {
clear: inherit; }
.bestseller h3 {
font-size: 18px;
font-weight: bold;
margin-bottom: 20px;
margin-top: 12px;
color: #222;
text-transform: uppercase; }
.bestseller .description, .bestseller .button-group {
display: none; }
.bestseller .product-layout {
margin-bottom: 15px;
display: inline-block;
width: 100%; }
.bestseller .product-layout .image {
float: left;
border: 1px solid #eee;
width: 70px;
padding: 10px;
margin-right: 20px; }
.bestseller .product-layout .image:hover {
border-color: #6e8f04; }
.bestseller .product-layout .caption {
float: left;
display: block;
margin-top: -5px; }
.bestseller .product-layout .caption h4 {
margin: 0 0 2px; }
.bestseller .product-layout .caption h4 a {
font-size: 14px;
font-weight: bold;
color: #222; }
.bestseller .product-layout .caption h4 a:hover {
color: #6e8f04; }
.bestseller .product-layout .caption .ratings {
margin-top: -5px;
margin-bottom: 6px; }
.bestseller .product-layout .caption .price {
margin-bottom: 0; }
.bestseller .product-layout .price .price-new, .bestseller .product-layout .price span.price {
font-size: 16px; }
/************************************************************************************************
DEFFAULT custom_bestseler
*************************************************************************************************/
.module.custom_bestseler {
position: relative;
margin: 0; }
.module.custom_bestseler.h3.modtitle {
border: none; }
.module.custom_bestseler .products-list.grid .product-layout .product-item-container .button-group {
bottom: 20px; }
.module.custom_bestseler .products-list.grid .product-layout .product-item-container {
margin: 0;
padding: 0;
border-width: 0 0 1px 1px;
border-color: #ebebeb;
margin-bottom: 1px; }
.module.custom_bestseler .so-extraslider {
margin: 0;
margin-top: 24px; }
.module.custom_bestseler .extraslider-inner {
padding: 0;
border-width: 1px 1px 0 0;
border-color: #ebebeb;
border-style: solid; }
.module.custom_bestseler .extraslider-inner .right-block {
float: left;
padding-top: 15px; }
.module.custom_bestseler .extraslider-inner .left-block {
float: none; }
.module.custom_bestseler .extraslider-inner .item-wrap .item-image {
border: none; }
.module.custom_bestseler .extraslider-inner .item-wrap.style1 .item-info {
background: transparent;
position: relative; }
.module.custom_bestseler .extraslider-inner .item-wrap.style1 .item-info .item-title, .module.custom_bestseler .extraslider-inner .item-wrap.style2 .item-info .item-title {
padding: 0;
font-weight: normal; }
.module.custom_bestseler .extraslider-inner .item-wrap.style1 .item-info .item-title a, .module.custom_bestseler .extraslider-inner .item-wrap.style2 .item-info .item-title a {
font-size: 14px;
color: #222;
text-transform: capitalize; }
.module.custom_bestseler .extraslider-inner .item-wrap.style1 .item-info .item-title a:hover, .module.custom_bestseler .extraslider-inner .item-wrap.style2 .item-info .item-title a:hover {
color: #6e8f04; }
.module.custom_bestseler .extraslider-inner .item-wrap-inner {
margin: 0;
padding: 0; }
.module.custom_bestseler .extraslider-inner .item-wrap .item-info .item-content {
margin: 0; }
.module.custom_bestseler .extraslider-inner .item-wrap .item-info .item-content .content_price span {
font-size: 16px;
color: #ff5c00;
font-weight: 700; }
.module.custom_bestseler .extraslider-inner .item-wrap .item-image img {
box-shadow: none; }
.module.custom_bestseler .extraslider-inner .item-wrap .item-image .img-2 {
position: absolute;
top: 0;
-webkit-transition: all 0.2s ease 0s;
-moz-transition: all 0.2s ease 0s;
transition: all 0.2s ease 0s;
opacity: 0;
visibility: hidden; }
.module.custom_bestseler .extraslider-inner .item-wrap .item-image:hover {
box-shadow: none; }
.module.custom_bestseler .extraslider-inner .item-wrap .item-image:hover img {
box-shadow: none;
opacity: 0.7; }
.module.custom_bestseler .extraslider-inner .item-wrap .item-image:hover .img-2 {
opacity: 1;
visibility: visible; }
.module.custom_bestseler .extraslider-inner .item-wrap {
margin-bottom: 25px; }
.module.custom_bestseler .owl2-controls {
position: absolute;
top: 21px;
right: 0; }
.module.custom_bestseler .owl2-controls .owl2-nav > div {
border: none;
width: 28px;
height: 28px;
background-color: transparent;
opacity: 1;
visibility: visible;
position: relative;
top: 13px; }
.module.custom_bestseler .owl2-controls .owl2-nav > div.owl2-prev {
right: 5px;
left: auto; }
.module.custom_bestseler .owl2-controls .owl2-nav > div:hover {
border: none; }
| yannicksade/SAV8817 | web/Shop/catalog/view/theme/so-revo/css/layout5/green.css | CSS | mit | 220,986 | [
30522,
1030,
25869,
13462,
1000,
21183,
2546,
1011,
1022,
1000,
1025,
1013,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// This file is part of MLDB. Copyright 2015 mldb.ai inc. All rights reserved.
/** git.cc
Jeremy Barnes, 14 November 2015
Copyright (c) mldb.ai inc. All rights reserved.
*/
#include "mldb/core/procedure.h"
#include "mldb/core/dataset.h"
#include "mldb/base/per_thread_accumulator.h"
#include "mldb/types/url.h"
#include "mldb/types/structure_description.h"
#include "mldb/types/vector_description.h"
#include "mldb/types/any_impl.h"
#include "mldb/vfs/fs_utils.h"
#include "mldb/base/scope.h"
#include "mldb/utils/distribution.h"
#include "mldb/base/parallel.h"
#include <boost/algorithm/string.hpp>
#include "mldb/types/annotated_exception.h"
#include "mldb/utils/log.h"
#include "mldb/ext/libgit2/include/git2.h"
#include "mldb/ext/libgit2/include/git2/revwalk.h"
#include "mldb/ext/libgit2/include/git2/commit.h"
#include "mldb/ext/libgit2/include/git2/diff.h"
struct GitFileOperation {
GitFileOperation()
: insertions(0), deletions(0)
{
}
int insertions;
int deletions;
std::string op;
};
struct GitFileStats {
GitFileStats()
: insertions(0), deletions(0)
{
}
std::map<std::string, GitFileOperation> files;
int insertions;
int deletions;
};
int stats_by_file_each_file_cb(const git_diff_delta *delta,
float progress,
void *payload)
{
GitFileStats & stats = *((GitFileStats *)payload);
GitFileOperation op;
switch (delta->status) {
case GIT_DELTA_UNMODIFIED: /** no changes */
return 0;
case GIT_DELTA_ADDED: /** entry does not exist in old version */
op.op = "added";
break;
case GIT_DELTA_DELETED: /** entry does not exist in new version */
op.op = "deleted";
break;
case GIT_DELTA_MODIFIED: /** entry content changed between old and new */
op.op = "modified";
break;
case GIT_DELTA_RENAMED: /** entry was renamed between old and new */
op.op = "renamed";
break;
case GIT_DELTA_COPIED: /** entry was copied from another old entry */
op.op = "copied";
break;
case GIT_DELTA_IGNORED: /** entry is ignored item in workdir */
return 0;
case GIT_DELTA_UNTRACKED: /** entry is untracked item in workdir */
return 0;
case GIT_DELTA_TYPECHANGE: /** type of entry changed between old and new */
return 0;
default:
throw std::logic_error("git status");
}
if (delta->old_file.path)
stats.files[delta->old_file.path] = op;
return 0;
}
int stats_by_file_each_hunk_cb(const git_diff_delta *delta,
const git_diff_hunk * hunk,
void *payload)
{
GitFileStats & stats = *((GitFileStats *)payload);
if (delta->old_file.path)
stats.files[delta->old_file.path].deletions += hunk->old_lines;
if (delta->new_file.path)
stats.files[delta->new_file.path].insertions += hunk->new_lines;
stats.insertions += hunk->new_lines;
stats.deletions += hunk->old_lines;
return 0;
}
GitFileStats git_diff_by_file(git_diff *diff)
{
GitFileStats result;
int error = git_diff_foreach(diff,
stats_by_file_each_file_cb,
nullptr, /* binary callback */
stats_by_file_each_hunk_cb,
nullptr, /* line callback */
&result);
if (error < 0) {
throw MLDB::AnnotatedException(400, "Error traversing diff: "
+ std::string(giterr_last()->message));
}
return result;
}
using namespace std;
namespace MLDB {
/*****************************************************************************/
/* GIT IMPORTER */
/*****************************************************************************/
struct GitImporterConfig : ProcedureConfig {
static constexpr const char * name = "import.git";
GitImporterConfig()
: revisions({"HEAD"}), importStats(false), importTree(false),
ignoreUnknownEncodings(true)
{
outputDataset.withType("sparse.mutable");
}
Url repository;
PolyConfigT<Dataset> outputDataset;
std::vector<std::string> revisions;
bool importStats;
bool importTree;
bool ignoreUnknownEncodings;
// TODO
// when
// where
// limit
// offset
// select (instead of importStats, importTree)
};
DECLARE_STRUCTURE_DESCRIPTION(GitImporterConfig);
DEFINE_STRUCTURE_DESCRIPTION(GitImporterConfig);
GitImporterConfigDescription::
GitImporterConfigDescription()
{
addField("repository", &GitImporterConfig::repository,
"Git repository to load from. This is currently limited to "
"file:// urls which point to an already cloned repository on "
"local disk. Remote repositories will need to be checked out "
"beforehand using the git command line tools.");
addField("outputDataset", &GitImporterConfig::outputDataset,
"Output dataset for result. One row will be produced per commit. "
"See the documentation for the output format.",
PolyConfigT<Dataset>().withType("sparse.mutable"));
std::vector<std::string> defaultRevisions = { "HEAD" };
addField("revisions", &GitImporterConfig::revisions,
"Revisions to load from Git (eg, HEAD, HEAD~20..HEAD, tags/*). "
"See the gitrevisions (7) documentation. Default is all revisions "
"reachable from HEAD", defaultRevisions);
addField("importStats", &GitImporterConfig::importStats,
"If true, then import the stats (number of files "
"changed, lines added and lines deleted)", false);
addField("importTree", &GitImporterConfig::importTree,
"If true, then import the tree (names of files changed)", false);
addField("ignoreUnknownEncodings",
&GitImporterConfig::ignoreUnknownEncodings,
"If true (default), ignore commit messages with unknown encodings "
"(supported are ISO-8859-1 and UTF-8) and replace with a "
"placeholder. If false, messages with unknown encodings will "
"cause the commit to abort.");
addParent<ProcedureConfig>();
}
struct GitImporter: public Procedure {
GitImporter(MldbEngine * owner,
PolyConfig config_,
const std::function<bool (const Json::Value &)> & onProgress)
: Procedure(owner)
{
config = config_.params.convert<GitImporterConfig>();
}
GitImporterConfig config;
std::string encodeOid(const git_oid & oid) const
{
char shortsha[10] = {0};
git_oid_tostr(shortsha, 9, &oid);
return string(shortsha);
};
// Process an individual commit
std::vector<std::tuple<ColumnPath, CellValue, Date> >
processCommit(git_repository * repo, const git_oid & oid) const
{
string sha = encodeOid(oid);
auto checkError = [&] (int error, const char * msg)
{
if (error < 0)
throw AnnotatedException(500, string(msg) + ": "
+ giterr_last()->message,
"repository", config.repository,
"commit", string(sha));
};
git_commit *commit;
int error = git_commit_lookup(&commit, repo, &oid);
checkError(error, "Error getting commit");
Scope_Exit(git_commit_free(commit));
const char *encoding = git_commit_message_encoding(commit);
const char *messageStr = git_commit_message(commit);
git_time_t time = git_commit_time(commit);
int offset_in_min = git_commit_time_offset(commit);
const git_signature *committer = git_commit_committer(commit);
const git_signature *author = git_commit_author(commit);
//const git_oid *tree_id = git_commit_tree_id(commit);
git_diff *diff = nullptr;
Scope_Exit(git_diff_free(diff));
Utf8String message;
if (!encoding || strcmp(encoding, "UTF-8") == 0) {
message = Utf8String(messageStr);
}
else if (strcmp(encoding,"ISO-8859-1") == 0) {
message = Utf8String::fromLatin1(messageStr);
}
else if (config.ignoreUnknownEncodings) {
message = "<<<couldn't decode message in "
+ string(encoding) + " character set>>>";
}
else {
throw AnnotatedException(500,
"Can't decode unknown commit message encoding",
"repository", config.repository,
"commit", string(sha),
"encoding", encoding);
}
vector<string> parents;
unsigned int parentCount = git_commit_parentcount(commit);
for (unsigned i = 0; i < parentCount; ++i) {
const git_oid *nth_parent_id = git_commit_parent_id(commit, i);
git_commit *nth_parent = nullptr;
int error = git_commit_parent(&nth_parent, commit, i);
checkError(error, "Error getting commit parent");
Scope_Exit(git_commit_free(nth_parent));
parents.emplace_back(encodeOid(*nth_parent_id));
if (i == 0 && parentCount == 1
&& (config.importStats || config.importTree)) {
const git_oid * parent_tree_id = git_commit_tree_id(nth_parent);
if (parent_tree_id) {
git_tree * tree = nullptr;
git_tree * parentTree = nullptr;
error = git_commit_tree(&tree, commit);
checkError(error, "Error getting commit tree");
Scope_Exit(git_tree_free(tree));
error = git_commit_tree(&parentTree, nth_parent);
checkError(error, "Error getting parent tree");
Scope_Exit(git_tree_free(parentTree));
error = git_diff_tree_to_tree(&diff, repo, tree, parentTree, NULL);
checkError(error, "Error diffing commits");
git_diff_find_options opts = GIT_DIFF_FIND_OPTIONS_INIT;
opts.flags = GIT_DIFF_FIND_RENAMES |
GIT_DIFF_FIND_COPIES |
GIT_DIFF_FIND_FOR_UNTRACKED;
error = git_diff_find_similar(diff, &opts);
checkError(error, "Error detecting renames");
}
}
}
Date timestamp = Date::fromSecondsSinceEpoch(time + 60 * offset_in_min);
Utf8String committerName(committer->name);
Utf8String committerEmail(committer->email);
Utf8String authorName(author->name);
Utf8String authorEmail(author->email);
std::vector<std::tuple<ColumnPath, CellValue, Date> > row;
row.emplace_back(ColumnPath("committer"), committerName, timestamp);
row.emplace_back(ColumnPath("committerEmail"), committerEmail, timestamp);
row.emplace_back(ColumnPath("author"), authorName, timestamp);
row.emplace_back(ColumnPath("authorEmail"), authorEmail, timestamp);
row.emplace_back(ColumnPath("message"), message, timestamp);
row.emplace_back(ColumnPath("parentCount"), parentCount, timestamp);
for (auto & p: parents)
row.emplace_back(ColumnPath("parent"), p, timestamp);
int filesChanged = 0;
int insertions = 0;
int deletions = 0;
if (diff) {
GitFileStats stats = git_diff_by_file(diff);
filesChanged = stats.files.size();
insertions = stats.insertions;
deletions = stats.deletions;
row.emplace_back(ColumnPath("insertions"), insertions, timestamp);
row.emplace_back(ColumnPath("deletions"), deletions, timestamp);
row.emplace_back(ColumnPath("filesChanged"), filesChanged, timestamp);
for (auto & f: stats.files) {
if (!config.importTree) break;
Utf8String filename(f.first);
row.emplace_back(ColumnPath("file"), filename, timestamp);
if (f.second.insertions > 0)
row.emplace_back(ColumnPath("file." + filename + ".insertions"),
f.second.insertions, timestamp);
if (f.second.deletions > 0)
row.emplace_back(ColumnPath("file." + filename + ".deletions"),
f.second.deletions, timestamp);
if (!f.second.op.empty())
row.emplace_back(ColumnPath("file." + filename + ".op"),
f.second.op, timestamp);
}
}
DEBUG_MSG(logger)
<< "id " << sha << " had " << filesChanged << " changes, "
<< insertions << " insertions and " << deletions << " deletions "
<< message << " parents " << parentCount;
return row;
}
virtual RunOutput run(const ProcedureRunConfig & run,
const std::function<bool (const Json::Value &)> & onProgress) const
{
auto runProcConf = applyRunConfOverProcConf(config, run);
auto checkError = [&] (int error, const char * msg)
{
if (error < 0)
throw AnnotatedException(500, string(msg) + ": "
+ giterr_last()->message,
"repository", runProcConf.repository);
};
git_libgit2_init();
Scope_Exit(git_libgit2_shutdown());
git_repository * repo;
Utf8String repoName(runProcConf.repository.toString());
repoName.removePrefix("file://");
int error = git_repository_open(&repo, repoName.rawData());
checkError(error, "Error opening git repository");
Scope_Exit(git_repository_free(repo));
// Create the output dataset
std::shared_ptr<Dataset> output;
if (!runProcConf.outputDataset.type.empty()
|| !runProcConf.outputDataset.id.empty()) {
output = createDataset(engine, runProcConf.outputDataset,
nullptr, true /*overwrite*/);
}
git_revwalk *walker;
error = git_revwalk_new(&walker, repo);
checkError(error, "Error creating commit walker");
Scope_Exit(git_revwalk_free(walker));
for (auto & r: runProcConf.revisions) {
if (r.find("*") != string::npos)
error = git_revwalk_push_glob(walker, r.c_str());
else if (r.find("..") != string::npos)
error = git_revwalk_push_range(walker, r.c_str());
else error = git_revwalk_push_ref(walker, r.c_str());
if (error < 0)
throw AnnotatedException(500, "Error adding revision: "
+ string(giterr_last()->message),
"repository", runProcConf.repository,
"revision", r);
}
vector<git_oid> oids;
git_oid oid;
while (!git_revwalk_next(&oid, walker)) {
oids.push_back(oid);
}
struct Accum {
Accum(const Utf8String & filename)
{
rows.reserve(1000);
int error = git_repository_open(&repo, filename.rawData());
if (error < 0)
throw AnnotatedException(400, "Error opening Git repo: "
+ string(giterr_last()->message));
}
~Accum()
{
git_repository_free(repo);
}
std::vector<std::pair<RowPath, std::vector<std::tuple<ColumnPath, CellValue, Date> > > > rows;
git_repository * repo;
};
PerThreadAccumulator<Accum> accum([&] () { return new Accum(repoName); });
INFO_MSG(logger) << "processing " << oids.size() << " commits";
auto doProcessCommit = [&] (int i)
{
if (i && i % 100 == 0)
INFO_MSG(logger)
<< "imported commit " << i << " of " << oids.size();
Accum & threadAccum = accum.get();
auto row = processCommit(repo, oids[i]);
threadAccum.rows.emplace_back(RowPath(encodeOid(oids[i])),
std::move(row));
if (threadAccum.rows.size() == 1000) {
output->recordRows(threadAccum.rows);
threadAccum.rows.clear();
}
};
parallelMap(0, oids.size(), doProcessCommit);
for (auto & t: accum.threads) {
output->recordRows(t->rows);
}
output->commit();
RunOutput result;
return result;
}
virtual Any getStatus() const
{
return Any();
}
GitImporterConfig procConfig;
};
RegisterProcedureType<GitImporter, GitImporterConfig>
regGit(builtinPackage(),
"Import a Git repository's metadata into MLDB",
"procedures/GitImporter.md.html");
} // namespace MLDB
| mldbai/mldb | plugins/git/git.cc | C++ | apache-2.0 | 17,692 | [
30522,
1013,
1013,
2023,
5371,
2003,
2112,
1997,
19875,
18939,
1012,
9385,
2325,
19875,
18939,
1012,
9932,
4297,
1012,
2035,
2916,
9235,
1012,
1013,
1008,
1008,
21025,
2102,
1012,
10507,
7441,
9957,
1010,
2403,
2281,
2325,
9385,
1006,
1039,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jisrael
=======
JIsrael is a brand new FREE Joomla Administrator Template that has been developed for Joomla 3.x.
It is based on ISIS Template (by Kyle Ledbetter) and have full responsive capabilities.
What we were trying to achive is making Joomla! administrator view more welcomeing while putting our focuses on optimizing usability, improving efficiency, and maintaining functionality and customizability.
demo website: http://demo.j-guru.com/jisrael/administrator/
When we started the work on JIsrael, it was made as an open source project for the Israeli Joomla! community, so we decided to put our effort on these key points:
* Full RTL Support
* Responsive/mobile/tablet Support
* Easy-to-Use
* Full control on colors from Template manager
* Option to change the login page
* No images - only CSS, if you dont count the logo image :P
* Font Selection, Alef, Open-Sans
Supported Languages:
* English
* Hebrew
* Arabic - Special thanks to Majdi Halabi
* if you want to contribute another language it will be great.
JIsrael package installation file include
* Template
* CPanel Icon module - new module which handle the admin homepage display
* AdminTask Component - a simple component for admin side only that manage tasks by categories
* AsminTasks module - latest tasks module
* Template override for - com_cpanel on admin homepage
* Template override for - mod_latest
Download the full package here: http://www.j-guru.com/index.php?option=com_jgextensions&view=downloads&Itemid=142#JIsrael%20Admin%20Template
| eitamar/jisrael | README.md | Markdown | gpl-2.0 | 1,528 | [
30522,
10147,
21338,
21147,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
10147,
21338,
21147,
2003,
1037,
4435,
2047,
2489,
28576,
19968,
2050,
8911,
23561,
2008,
2038,
2042,
2764,
2005,
28576,
19968,
2050,
1017,
1012,
1060,
1012,
2009,
2003,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
Colorbox Core Style:
The following CSS is consistent between example themes and should not be altered.
*/
#colorbox, #cboxOverlay, #cboxWrapper {
position: absolute;
top: 0;
left: 0;
z-index: 9999;
overflow: hidden;
}
#cboxOverlay {
position: fixed;
width: 100%;
height: 100%;
}
#cboxMiddleLeft, #cboxBottomLeft {
clear: left;
}
#cboxContent {
position: relative;
}
#cboxLoadedContent {
overflow: auto;
-webkit-overflow-scrolling: touch;
}
#cboxTitle {
margin: 0;
}
#cboxLoadingOverlay, #cboxLoadingGraphic {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow {
cursor: pointer;
}
.cboxPhoto {
float: left;
margin: auto;
border: 0;
display: block;
max-width: none;
-ms-interpolation-mode: bicubic;
}
.cboxIframe {
width: 100%;
height: 100%;
display: block;
border: 0;
}
#colorbox, #cboxContent, #cboxLoadedContent {
box-sizing: content-box;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
}
/*
User Style:
Change the following styles to modify the appearance of Colorbox. They are
ordered & tabbed in a way that represents the nesting of the generated HTML.
*/
#cboxOverlay {
background: #000;
}
#colorbox {
outline: 0;
}
#cboxTopLeft {
width: 14px;
height: 14px;
background: url(images/controls.png) no-repeat 0 0;
}
#cboxTopCenter {
height: 14px;
background: url(images/border.png) repeat-x top left;
}
#cboxTopRight {
width: 14px;
height: 14px;
background: url(images/controls.png) no-repeat -36px 0;
}
#cboxBottomLeft {
width: 14px;
height: 43px;
background: url(images/controls.png) no-repeat 0 -32px;
}
#cboxBottomCenter {
height: 43px;
background: url(images/border.png) repeat-x bottom left;
}
#cboxBottomRight {
width: 14px;
height: 43px;
background: url(images/controls.png) no-repeat -36px -32px;
}
#cboxMiddleLeft {
width: 14px;
background: url(images/controls.png) repeat-y -175px 0;
}
#cboxMiddleRight {
width: 14px;
background: url(images/controls.png) repeat-y -211px 0;
}
#cboxContent {
background: #FFF;
overflow: visible;
}
.cboxIframe {
background: #FFF;
}
#cboxError {
padding: 50px;
border: 1px solid #CCC;
}
#cboxLoadedContent {
margin-bottom: 5px;
}
#cboxLoadingOverlay {
background: url(images/loading_background.png) no-repeat center center;
}
#cboxLoadingGraphic {
background: url(images/loading.gif) no-repeat center center;
}
#cboxTitle {
position: absolute;
bottom: -25px;
left: 0;
text-align: center;
width: 100%;
font-weight: bold;
color: #7C7C7C;
}
#cboxCurrent {
position: absolute;
bottom: -25px;
left: 58px;
font-weight: bold;
color: #7C7C7C;
}
/* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
#cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {
border: 0;
padding: 0;
margin: 0;
overflow: visible;
position: absolute;
bottom: -29px;
background: url(images/controls.png) no-repeat 0px 0px;
width: 23px;
height: 23px;
text-indent: -9999px;
}
/* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
#cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {
outline: 0;
}
#cboxPrevious {
left: 0px;
background-position: -51px -25px;
}
#cboxPrevious:hover {
background-position: -51px 0px;
}
#cboxNext {
left: 27px;
background-position: -75px -25px;
}
#cboxNext:hover {
background-position: -75px 0px;
}
#cboxClose {
right: 0;
background-position: -100px -25px;
}
#cboxClose:hover {
background-position: -100px 0px;
}
.cboxSlideshow_on #cboxSlideshow {
background-position: -125px 0px;
right: 27px;
}
.cboxSlideshow_on #cboxSlideshow:hover {
background-position: -150px 0px;
}
.cboxSlideshow_off #cboxSlideshow {
background-position: -150px -25px;
right: 27px;
}
.cboxSlideshow_off #cboxSlideshow:hover {
background-position: -125px 0px;
}
| Sina30/PHP-Fusion-9.00 | includes/jquery/colorbox/colorbox.css | CSS | agpl-3.0 | 4,250 | [
30522,
1013,
1008,
3609,
8758,
4563,
2806,
1024,
1996,
2206,
20116,
2015,
2003,
8335,
2090,
2742,
6991,
1998,
2323,
2025,
2022,
8776,
1012,
1008,
1013,
1001,
3609,
8758,
1010,
1001,
17324,
11636,
7840,
8485,
1010,
1001,
17324,
11636,
13088,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Omnom App
=========
This is the example app for Omnom. See [Omnom](https://github.com/tombenner/omnom) for details.
License
-------
Omnom App is released under the MIT License. Please see the MIT-LICENSE file for details.
| tombenner/omnom-app | README.md | Markdown | mit | 225 | [
30522,
18168,
3630,
2213,
10439,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
2023,
2003,
1996,
2742,
10439,
2005,
18168,
3630,
2213,
1012,
2156,
1031,
18168,
3630,
2213,
1033,
1006,
16770,
1024,
1013,
1013,
21025,
2705,
12083,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
using NUnit.Framework;
using TestStack.FluentMVCTesting.Tests.TestControllers;
namespace TestStack.FluentMVCTesting.Tests
{
class AsyncControllersShould
{
private AsyncController _controller;
[SetUp]
public void Setup()
{
_controller = new AsyncController();
}
[Test]
public void Work_correctly_for_valid_check()
{
_controller.WithCallTo(c => c.AsyncViewAction())
.ShouldRenderDefaultView();
}
[Test]
public void Work_correctly_for_invalid_check()
{
Assert.Throws<ActionResultAssertionException>(
() => _controller.WithCallTo(c => c.AsyncViewAction()).ShouldGiveHttpStatus()
);
}
[Test]
public void Work_correctly_for_valid_child_action_check()
{
_controller.WithCallToChild(c => c.AsyncChildViewAction())
.ShouldRenderDefaultView();
}
[Test]
public void Work_correctly_for_invalid_child_action_check()
{
Assert.Throws<InvalidControllerActionException>(
() => _controller.WithCallToChild(c => c.AsyncViewAction())
);
}
}
}
| TestStack/TestStack.FluentMVCTesting | TestStack.FluentMVCTesting.Tests/AsyncControllerTests.cs | C# | mit | 1,304 | [
30522,
2478,
16634,
4183,
1012,
7705,
1025,
2478,
5852,
2696,
3600,
1012,
19376,
2213,
25465,
22199,
2075,
1012,
5852,
1012,
3231,
8663,
13181,
10820,
2015,
1025,
3415,
15327,
5852,
2696,
3600,
1012,
19376,
2213,
25465,
22199,
2075,
1012,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
WakaTime#

[](https://ci.appveyor.com/project/salaros/wakatime-sharp/branch/master)

==========


[](https://social.msdn.microsoft.com/Forums/vstudio/en-US/7035edc6-97fc-49ee-8eee-2fa4d040a63b/)
[](https://social.msdn.microsoft.com/Forums/vstudio/en-US/7035edc6-97fc-49ee-8eee-2fa4d040a63b/)
A core implementation of all WakaTime C#-driven plugins for IDE such as Xamarin Studio, Monodevelop, Visual Studio, Visual Studio for Mac, Notepad++, Unity etc
These plugins will help to collect metrics, insights and time tracking automatically generated directly from your programming activity.
https://wakatime.com
| CodeCavePro/wakatime-sharp | README.md | Markdown | bsd-3-clause | 1,158 | [
30522,
11333,
24498,
14428,
1001,
999,
1031,
6105,
1033,
1006,
16770,
1024,
1013,
1013,
10047,
2290,
1012,
11824,
1012,
22834,
1013,
21025,
2705,
12083,
1013,
6105,
1013,
16137,
3270,
5051,
1013,
17928,
9153,
5809,
1012,
17917,
2290,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
\hypertarget{namespacecpp_1_1utils}{}\section{cpp.\+utils Namespace Reference}
\label{namespacecpp_1_1utils}\index{cpp.\+utils@{cpp.\+utils}}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item
def \hyperlink{namespacecpp_1_1utils_a4258aa53673d101d6f57320ec9a3c3a2}{Read\+File} (filename, print\+\_\+error=True)
\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item
bool \hyperlink{namespacecpp_1_1utils_aa59cfd61e9b0495b717753e45fe9d201}{D\+E\+B\+UG} = True
\end{DoxyCompactItemize}
\subsection{Function Documentation}
\index{cpp\+::utils@{cpp\+::utils}!Read\+File@{Read\+File}}
\index{Read\+File@{Read\+File}!cpp\+::utils@{cpp\+::utils}}
\subsubsection[{\texorpdfstring{Read\+File(filename, print\+\_\+error=\+True)}{ReadFile(filename, print_error=True)}}]{\setlength{\rightskip}{0pt plus 5cm}def cpp.\+utils.\+Read\+File (
\begin{DoxyParamCaption}
\item[{}]{filename, }
\item[{}]{print\+\_\+error = {\ttfamily True}}
\end{DoxyParamCaption}
)}\hypertarget{namespacecpp_1_1utils_a4258aa53673d101d6f57320ec9a3c3a2}{}\label{namespacecpp_1_1utils_a4258aa53673d101d6f57320ec9a3c3a2}
\begin{DoxyVerb}Returns the contents of a file.\end{DoxyVerb}
Definition at line 30 of file utils.\+py.
\subsection{Variable Documentation}
\index{cpp\+::utils@{cpp\+::utils}!D\+E\+B\+UG@{D\+E\+B\+UG}}
\index{D\+E\+B\+UG@{D\+E\+B\+UG}!cpp\+::utils@{cpp\+::utils}}
\subsubsection[{\texorpdfstring{D\+E\+B\+UG}{DEBUG}}]{\setlength{\rightskip}{0pt plus 5cm}bool cpp.\+utils.\+D\+E\+B\+UG = True}\hypertarget{namespacecpp_1_1utils_aa59cfd61e9b0495b717753e45fe9d201}{}\label{namespacecpp_1_1utils_aa59cfd61e9b0495b717753e45fe9d201}
Definition at line 27 of file utils.\+py.
| bhargavipatel/808X_VO | docs/latex/namespacecpp_1_1utils.tex | TeX | mit | 1,695 | [
30522,
1032,
23760,
7559,
18150,
1063,
3415,
15327,
21906,
2361,
1035,
1015,
1035,
1015,
21823,
4877,
1065,
1063,
1065,
1032,
2930,
1063,
18133,
2361,
1012,
1032,
1009,
21183,
12146,
3415,
15327,
4431,
1065,
1032,
3830,
1063,
3415,
15327,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
'use strict'
// const foo = (msg) => { // Função anónima... MAS o this tem outro significado
// const foo = function(msg) { // Função anónima
function foo(msg) {
// if(msg == undefined) return console.log('Empty msg')
if(!msg) return console.log('Empty msg')
let str = ''
for(let i = 0; i < arguments.length; i++){
str += arguments[i] + ', '
}
console.log('this = ' + this + '; ' + msg + ' (args = ' + str + ')')
}
foo()
foo('ola mundo')
foo(3,4,4,5)
foo.apply(null, [3,4,4,5])
foo.call(null, 'ola', 87364, 22, 'abc', 2, 3)
const d = new foo(89) // !!!!!! NÃO FAZER
const g = foo
g('Calling foo through g')
new g(76) // !!!!!! NÃO FAZER
const obj = {} // <=> new Object()
obj.xpto = foo
obj.xpto(345) // this = obj
obj.xpto.call(d, 6328) // this = d
/* Cenas malucas !!!!
foo.bar = foo
foo.bar(6666)
*/ | isel-leic-pi/1617v-LI51N | aula02-functions-and-objects/app02-functions.js | JavaScript | gpl-3.0 | 872 | [
30522,
1005,
2224,
9384,
1005,
1013,
1013,
9530,
3367,
29379,
1027,
1006,
5796,
2290,
1007,
1027,
1028,
1063,
1013,
1013,
4569,
20808,
2019,
10698,
2863,
1012,
1012,
1012,
16137,
1051,
2023,
8915,
2213,
2041,
3217,
3696,
18513,
9365,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
////////////////////////////////////////////////////////////////////////////////
// Name: autocomplete.h
// Purpose: Declaration of class wex::autocomplete
// Author: Anton van Wezenbeek
// Copyright: (c) 2018 Anton van Wezenbeek
////////////////////////////////////////////////////////////////////////////////
#pragma once
#include <set>
#include <string>
#include <wex/ctags-entry.h>
namespace wex
{
class stc;
/// Offers a class for autocompletion on wex::stc.
class autocomplete
{
public:
/// Constructor.
autocomplete(stc* stc);
/// Activates the autocompleted text.
/// This might setup a filter for next
/// autocomplete list.
bool activate(const std::string& text);
/// Builds and shows autocomplete lists on the
/// stc component. This can be a list
/// according to CTags, previously inserted text,
/// or keywords for current lexer.
bool apply(char c);
/// Clears filter.
void reset();
/// Returns true if active.
bool use() const;
/// Sets autocomplete on or off.
void use(bool on) {m_Use = on;};
private:
void clear();
bool ShowCTags(bool show) const;
bool ShowInserts(bool show) const;
bool ShowKeywords(bool show) const;
const size_t m_MinSize;
bool m_Use {true};
std::string m_Text;
std::set< std:: string > m_Inserts;
ctags_entry m_Filter;
stc* m_STC;
};
};
| antonvw/wxExtension | src/include/wex/autocomplete.h | C | mit | 1,425 | [
30522,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
// $Id$
/**
* @file
* general functions for mothership
*/
function mothership_id_safe($string, $vars = "default") {
// Replace with dashes anything that isn't A-Z, numbers, dashes, or underscores.
if($vars == "remove-numbers"){
$string = strtolower(preg_replace('/[^a-zA-Z_-]+/', '-', $string));
}else{
$string = strtolower(preg_replace('/[^a-zA-Z0-9_-]+/', '-', $string));
}
// change the "_" to "-"
$string = strtolower(str_replace('_', '-', $string));
// If the first character is not a-z, add 'n' in front.
if (function_exists('ctype_lower')) {
if (!ctype_lower($string{0})) { // Don't use ctype_alpha since its locale aware.
$string = 'id' . $string;
}
}
else {
preg_match('/[a-z]+/', $string{0}, $matches);
if (count($matches) == 0) {
$string = 'id' . $string;
}
}
return $string;
}
/*
getting some of the userprofile data into a single function
*/
function mothership_userprofile($user){
if ($user->uid) {
// global $user;
// $profile = profile_load_profile($user);
//$user->profile_name
//user picture
if ($user->picture) {
$userimage = '<img src="/' . $user->picture . '">';
print '<div class="profile-image">' . l($userimage, 'user/' . $user->uid, $options = array('html' => TRUE)) . '</div>';
}
print '<ul class="profile">';
print '<li class="profile-name">' . l($user->name, 'user/' . $user->uid . '') . '</li>';
print '<li class="profile-edit">' . l(t('edit'), 'user/' . $user->uid . '/edit') . '</li>';
print '<li class="profile-logout">' . l(t('Sign out'), 'logout') . '</li>';
print '</ul>';
}
}
/*
Quick & handy function for adding time ago
*/
function mothership_time_ago($timestamp,$granularity = 2, $langcode = NULL){
$difference = time() - $timestamp;
$text = format_interval($difference, $granularity, $langcode) ." ". t("ago");
return $text;
}
/*
return only the terms from a vocabulary in the node
*/
function return_terms_from_vocabulary($node, $vid){
$terms = taxonomy_node_get_terms_by_vocabulary($node, $vid, $key = 'tid');
// $vocabulary = taxonomy_vocabulary_load($vid);
// $content .='<div class="vocabulary">'.$vocabulary->name.'</div>';
$termslist = '';
if ($terms) {
$content .= '<span class="terms">';
foreach ($terms as $term) {
$termslist = $termslist . '<span class="term-icon-'. mothership_id_safe($term->name) .'">' . l($term->name, 'taxonomy/term/'.$term->tid) .'</span> | ';
}
//TODO make a better split option hardcoded is kinda sad ;)
$content.= trim ($termslist," |").'</span>';
}
return $content;
}
| aakb/sport-aarhus-events | sites/all/themes/mothership/template/template.functions.php | PHP | gpl-2.0 | 2,637 | [
30522,
1026,
1029,
25718,
1013,
1013,
1002,
8909,
1002,
1013,
1008,
1008,
1008,
1030,
5371,
1008,
2236,
4972,
2005,
10756,
5605,
1008,
1013,
3853,
10756,
5605,
1035,
8909,
1035,
3647,
1006,
1002,
5164,
1010,
1002,
13075,
2015,
1027,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
.cont {
position: relative;
width: 50%;
}
.ima {
display: block;
width: 100%;
height: auto;
}
.overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: #008CBA;
overflow: hidden;
width: 100%;
height: 0;
transition: .3s ease;
}
.cont:hover .overlay {
height: 100%;
}
.text {
white-space: nowrap;
color: white;
font-size: 20px;
position: absolute;
overflow: hidden;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
}
.ddd{
margin-top: 6%;
}
.icon{
margin: 10px;
filter: alpha(opacity=50);
opacity: 0.5;
-webkit-transition: opacity .3s ease-in-out;
-moz-transition: opacity .3s ease-in-out;
-ms-transition: opacity .3s ease-in-out;
-o-transition: opacity .3s ease-in-out;
transition: opacity .3s ease-in-out;
}
.icon:hover{
zoom: 1;
filter: alpha(opacity=100);
opacity: 100;
}
.icon-wrap{
margin-top: -40px;
}
.bclear{
filter: alpha(opacity=50);
opacity: 0.5;
}
.spaced{
margin:20px;
}
| ferceballos/4conTodo | css/icons.css | CSS | apache-2.0 | 1,036 | [
30522,
1012,
9530,
2102,
1063,
2597,
1024,
5816,
1025,
9381,
1024,
2753,
1003,
1025,
1065,
1012,
10047,
2050,
1063,
4653,
1024,
3796,
1025,
9381,
1024,
2531,
1003,
1025,
4578,
1024,
8285,
1025,
1065,
1012,
2058,
8485,
1063,
2597,
1024,
76... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package Various;
import java.util.Random;
public class RandomString {
private static final Random r = new Random(System.currentTimeMillis());
public static String randomAlphanumericString(int l){
StringBuilder sb = new StringBuilder();
for (int j = 0; j < l; j++) {
sb.append((char)('a'+r.nextInt('z'-'a')));
}
return sb.toString();
}
}
| knotman90/IGPE2017 | code/src/Various/RandomString.java | Java | mit | 357 | [
30522,
7427,
2536,
1025,
12324,
9262,
1012,
21183,
4014,
1012,
6721,
1025,
2270,
2465,
6721,
3367,
4892,
1063,
2797,
10763,
2345,
6721,
1054,
1027,
2047,
6721,
1006,
2291,
1012,
2783,
7292,
19912,
2483,
1006,
1007,
1007,
1025,
2270,
10763,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*******************************************************************************
* Copyright (c) 2006 Oracle Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Oracle Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.bpel.common.ui.assist;
import org.eclipse.jface.fieldassist.IContentProposalProvider;
import org.eclipse.jface.fieldassist.IControlContentAdapter;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.fieldassist.ContentAssistCommandAdapter;
/**
* This is a field assist adapter which extends the core SWT content
* assist adapter and allows programmatic opening of the assist dialog
* as well as automatic width sizing.
*
* @author Michal Chmielewski (michal.chmielewski@oracle.com)
* @date Aug 9, 2006
*
*/
public class FieldAssistAdapter extends ContentAssistCommandAdapter {
/**
* @param control
* @param controlContentAdapter
* @param proposalProvider
* @param commandId
* @param autoActivationCharacters
*/
public FieldAssistAdapter(Control control, IControlContentAdapter controlContentAdapter, IContentProposalProvider proposalProvider, String commandId, char[] autoActivationCharacters) {
super(control, controlContentAdapter, proposalProvider, commandId,
autoActivationCharacters);
}
/**
* @param control
* @param controlContentAdapter
* @param proposalProvider
* @param commandId
* @param autoActivationCharacters
* @param installDecoration
*/
public FieldAssistAdapter(Control control, IControlContentAdapter controlContentAdapter, IContentProposalProvider proposalProvider, String commandId, char[] autoActivationCharacters, boolean installDecoration) {
super(control, controlContentAdapter, proposalProvider, commandId,
autoActivationCharacters, installDecoration);
}
public void openProposals () {
openProposalPopup();
getControl().setFocus();
}
@Override
protected void openProposalPopup () {
Point popupSize = getPopupSize();
popupSize.x = getProposalWidth();
super.openProposalPopup();
}
public int getProposalWidth () {
Point size = getControl().getSize();
return size.x + 20;
}
}
| Drifftr/devstudio-tooling-bps | plugins/org.eclipse.bpel.common.ui/src/org/eclipse/bpel/common/ui/assist/FieldAssistAdapter.java | Java | apache-2.0 | 2,503 | [
30522,
1013,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef MANGOS_MAP_H
#define MANGOS_MAP_H
#include "Common.h"
#include "Platform/Define.h"
#include "Policies/ThreadingModel.h"
#include "ace/RW_Thread_Mutex.h"
#include "ace/Thread_Mutex.h"
#include "DBCStructure.h"
#include "GridDefines.h"
#include "Cell.h"
#include "Object.h"
#include "Timer.h"
#include "SharedDefines.h"
#include "GridMap.h"
#include "GameSystem/GridRefManager.h"
#include "MapRefManager.h"
#include "Utilities/TypeList.h"
#include "ScriptMgr.h"
#include "CreatureLinkingMgr.h"
#include "vmap/DynamicTree.h"
#include <bitset>
#include <list>
struct CreatureInfo;
class Creature;
class Unit;
class WorldPacket;
class InstanceData;
class Group;
class MapPersistentState;
class WorldPersistentState;
class DungeonPersistentState;
class BattleGroundPersistentState;
struct ScriptInfo;
class BattleGround;
class GridMap;
class GameObjectModel;
// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform
#if defined( __GNUC__ )
#pragma pack(1)
#else
#pragma pack(push,1)
#endif
struct InstanceTemplate
{
uint32 map; // instance map
uint32 parent; // non-continent parent instance (for instance with entrance in another instances)
// or 0 (not related to continent 0 map id)
uint32 levelMin;
uint32 levelMax;
uint32 script_id;
};
struct WorldTemplate
{
uint32 map; // non-instance map
uint32 script_id;
};
enum LevelRequirementVsMode
{
LEVELREQUIREMENT_HEROIC = 70
};
#if defined( __GNUC__ )
#pragma pack()
#else
#pragma pack(pop)
#endif
#define MIN_UNLOAD_DELAY 1 // immediate unload
class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>
{
friend class MapReference;
friend class ObjectGridLoader;
friend class ObjectWorldLoader;
protected:
Map(uint32 id, time_t, uint32 InstanceId, uint8 SpawnMode);
public:
virtual ~Map();
// currently unused for normal maps
bool CanUnload(uint32 diff)
{
if (!m_unloadTimer) return false;
if (m_unloadTimer <= diff) return true;
m_unloadTimer -= diff;
return false;
}
virtual bool Add(Player*);
virtual void Remove(Player*, bool);
template<class T> void Add(T*);
template<class T> void Remove(T*, bool);
static void DeleteFromWorld(Player* player); // player object will deleted at call
virtual void Update(const uint32&);
void MessageBroadcast(Player*, WorldPacket*, bool to_self);
void MessageBroadcast(WorldObject*, WorldPacket*);
void MessageDistBroadcast(Player*, WorldPacket*, float dist, bool to_self, bool own_team_only = false);
void MessageDistBroadcast(WorldObject*, WorldPacket*, float dist);
float GetVisibilityDistance() const { return m_VisibleDistance; }
// function for setting up visibility distance for maps on per-type/per-Id basis
virtual void InitVisibilityDistance();
void PlayerRelocation(Player*, float x, float y, float z, float angl);
void CreatureRelocation(Creature* creature, float x, float y, float z, float orientation);
template<class T, class CONTAINER> void Visit(const Cell& cell, TypeContainerVisitor<T, CONTAINER>& visitor);
bool IsRemovalGrid(float x, float y) const
{
GridPair p = MaNGOS::ComputeGridPair(x, y);
return(!getNGrid(p.x_coord, p.y_coord) || getNGrid(p.x_coord, p.y_coord)->GetGridState() == GRID_STATE_REMOVAL);
}
bool IsLoaded(float x, float y) const
{
GridPair p = MaNGOS::ComputeGridPair(x, y);
return loaded(p);
}
bool GetUnloadLock(const GridPair& p) const { return getNGrid(p.x_coord, p.y_coord)->getUnloadLock(); }
void SetUnloadLock(const GridPair& p, bool on) { getNGrid(p.x_coord, p.y_coord)->setUnloadExplicitLock(on); }
void LoadGrid(const Cell& cell, bool no_unload = false);
bool UnloadGrid(const uint32& x, const uint32& y, bool pForce);
virtual void UnloadAll(bool pForce);
void ResetGridExpiry(NGridType& grid, float factor = 1) const
{
grid.ResetTimeTracker((time_t)((float)i_gridExpiry * factor));
}
time_t GetGridExpiry(void) const { return i_gridExpiry; }
uint32 GetId(void) const { return i_id; }
// some calls like isInWater should not use vmaps due to processor power
// can return INVALID_HEIGHT if under z+2 z coord not found height
virtual void RemoveAllObjectsInRemoveList();
bool CreatureRespawnRelocation(Creature* c); // used only in CreatureRelocation and ObjectGridUnloader
bool CheckGridIntegrity(Creature* c, bool moved) const;
uint32 GetInstanceId() const { return i_InstanceId; }
virtual bool CanEnter(Player* player);
const char* GetMapName() const;
// have meaning only for instanced map (that have set real difficulty), NOT USE its for BaseMap
// _currently_ spawnmode == difficulty, but this can be changes later, so use appropriate spawmmode/difficult functions
// for simplify later code support
// regular difficulty = continent/dungeon normal/first raid normal difficulty
uint8 GetSpawnMode() const { return (i_spawnMode); }
Difficulty GetDifficulty() const { return Difficulty(GetSpawnMode()); }
bool IsRegularDifficulty() const { return GetDifficulty() == REGULAR_DIFFICULTY; }
uint32 GetMaxPlayers() const; // dependent from map difficulty
uint32 GetMaxResetDelay() const; // dependent from map difficulty
MapDifficultyEntry const* GetMapDifficulty() const; // dependent from map difficulty
bool Instanceable() const { return i_mapEntry && i_mapEntry->Instanceable(); }
// NOTE: this duplicate of Instanceable(), but Instanceable() can be changed when BG also will be instanceable
bool IsDungeon() const { return i_mapEntry && i_mapEntry->IsDungeon(); }
bool IsRaid() const { return i_mapEntry && i_mapEntry->IsRaid(); }
bool IsNonRaidDungeon() const { return i_mapEntry && i_mapEntry->IsNonRaidDungeon(); }
bool IsRaidOrHeroicDungeon() const { return IsRaid() || GetDifficulty() > DUNGEON_DIFFICULTY_NORMAL; }
bool IsBattleGround() const { return i_mapEntry && i_mapEntry->IsBattleGround(); }
bool IsBattleArena() const { return i_mapEntry && i_mapEntry->IsBattleArena(); }
bool IsBattleGroundOrArena() const { return i_mapEntry && i_mapEntry->IsBattleGroundOrArena(); }
// can't be NULL for loaded map
MapPersistentState* GetPersistentState() const { return m_persistentState; }
void AddObjectToRemoveList(WorldObject* obj);
void UpdateObjectVisibility(WorldObject* obj, Cell cell, CellPair cellpair);
void resetMarkedCells() { marked_cells.reset(); }
bool isCellMarked(uint32 pCellId) { return marked_cells.test(pCellId); }
void markCell(uint32 pCellId) { marked_cells.set(pCellId); }
bool HavePlayers() const { return !m_mapRefManager.isEmpty(); }
uint32 GetPlayersCountExceptGMs() const;
bool ActiveObjectsNearGrid(uint32 x, uint32 y) const;
void SendToPlayers(WorldPacket const* data) const;
typedef MapRefManager PlayerList;
PlayerList const& GetPlayers() const { return m_mapRefManager; }
// per-map script storage
bool ScriptsStart(ScriptMapMapName const& scripts, uint32 id, Object* source, Object* target);
void ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* source, Object* target);
// must called with AddToWorld
void AddToActive(WorldObject* obj);
// must called with RemoveFromWorld
void RemoveFromActive(WorldObject* obj);
Player* GetPlayer(ObjectGuid guid);
Creature* GetCreature(ObjectGuid guid);
Pet* GetPet(ObjectGuid guid);
Creature* GetAnyTypeCreature(ObjectGuid guid); // normal creature or pet or vehicle
GameObject* GetGameObject(ObjectGuid guid);
DynamicObject* GetDynamicObject(ObjectGuid guid);
Corpse* GetCorpse(ObjectGuid guid); // !!! find corpse can be not in world
Unit* GetUnit(ObjectGuid guid); // only use if sure that need objects at current map, specially for player case
WorldObject* GetWorldObject(ObjectGuid guid); // only use if sure that need objects at current map, specially for player case
typedef TypeUnorderedMapContainer<AllMapStoredObjectTypes, ObjectGuid> MapStoredObjectTypesContainer;
MapStoredObjectTypesContainer& GetObjectsStore() { return m_objectsStore; }
void AddUpdateObject(Object* obj)
{
i_objectsToClientUpdate.insert(obj);
}
void RemoveUpdateObject(Object* obj)
{
i_objectsToClientUpdate.erase(obj);
}
// DynObjects currently
uint32 GenerateLocalLowGuid(HighGuid guidhigh);
// get corresponding TerrainData object for this particular map
const TerrainInfo* GetTerrain() const { return m_TerrainData; }
void CreateInstanceData(bool load);
InstanceData* GetInstanceData() { return i_data; }
uint32 GetScriptId() const { return i_script_id; }
void MonsterYellToMap(ObjectGuid guid, int32 textId, uint32 language, Unit* target);
void MonsterYellToMap(CreatureInfo const* cinfo, int32 textId, uint32 language, Unit* target, uint32 senderLowGuid = 0);
void PlayDirectSoundToMap(uint32 soundId, uint32 zoneId = 0);
// Dynamic VMaps
float GetHeight(uint32 phasemask, float x, float y, float z) const;
bool IsInLineOfSight(float x1, float y1, float z1, float x2, float y2, float z2, uint32 phasemask) const;
bool GetHitPosition(float srcX, float srcY, float srcZ, float& destX, float& destY, float& destZ, uint32 phasemask, float modifyDist) const;
// Object Model insertion/remove/test for dynamic vmaps use
void InsertGameObjectModel(const GameObjectModel& mdl);
void RemoveGameObjectModel(const GameObjectModel& mdl);
bool ContainsGameObjectModel(const GameObjectModel& mdl) const;
// Get Holder for Creature Linking
CreatureLinkingHolder* GetCreatureLinkingHolder() { return &m_creatureLinkingHolder; }
private:
void LoadMapAndVMap(int gx, int gy);
void SetTimer(uint32 t) { i_gridExpiry = t < MIN_GRID_DELAY ? MIN_GRID_DELAY : t; }
void SendInitSelf(Player* player);
void SendInitTransports(Player* player);
void SendRemoveTransports(Player* player);
bool CreatureCellRelocation(Creature* creature, Cell new_cell);
bool loaded(const GridPair&) const;
void EnsureGridCreated(const GridPair&);
bool EnsureGridLoaded(Cell const&);
void EnsureGridLoadedAtEnter(Cell const&, Player* player = NULL);
void buildNGridLinkage(NGridType* pNGridType) { pNGridType->link(this); }
template<class T> void AddType(T* obj);
template<class T> void RemoveType(T* obj, bool);
NGridType* getNGrid(uint32 x, uint32 y) const
{
MANGOS_ASSERT(x < MAX_NUMBER_OF_GRIDS);
MANGOS_ASSERT(y < MAX_NUMBER_OF_GRIDS);
return i_grids[x][y];
}
bool isGridObjectDataLoaded(uint32 x, uint32 y) const { return getNGrid(x, y)->isGridObjectDataLoaded(); }
void setGridObjectDataLoaded(bool pLoaded, uint32 x, uint32 y) { getNGrid(x, y)->setGridObjectDataLoaded(pLoaded); }
void setNGrid(NGridType* grid, uint32 x, uint32 y);
void ScriptsProcess();
void SendObjectUpdates();
std::set<Object*> i_objectsToClientUpdate;
protected:
MapEntry const* i_mapEntry;
uint8 i_spawnMode;
uint32 i_id;
uint32 i_InstanceId;
uint32 m_unloadTimer;
float m_VisibleDistance;
MapPersistentState* m_persistentState;
MapRefManager m_mapRefManager;
MapRefManager::iterator m_mapRefIter;
typedef std::set<WorldObject*> ActiveNonPlayers;
ActiveNonPlayers m_activeNonPlayers;
ActiveNonPlayers::iterator m_activeNonPlayersIter;
MapStoredObjectTypesContainer m_objectsStore;
private:
time_t i_gridExpiry;
NGridType* i_grids[MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS];
// Shared geodata object with map coord info...
TerrainInfo* const m_TerrainData;
bool m_bLoadedGrids[MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS];
std::bitset<TOTAL_NUMBER_OF_CELLS_PER_MAP* TOTAL_NUMBER_OF_CELLS_PER_MAP> marked_cells;
std::set<WorldObject*> i_objectsToRemove;
typedef std::multimap<time_t, ScriptAction> ScriptScheduleMap;
ScriptScheduleMap m_scriptSchedule;
InstanceData* i_data;
uint32 i_script_id;
// Map local low guid counters
ObjectGuidGenerator<HIGHGUID_UNIT> m_CreatureGuids;
ObjectGuidGenerator<HIGHGUID_GAMEOBJECT> m_GameObjectGuids;
ObjectGuidGenerator<HIGHGUID_DYNAMICOBJECT> m_DynObjectGuids;
ObjectGuidGenerator<HIGHGUID_PET> m_PetGuids;
ObjectGuidGenerator<HIGHGUID_VEHICLE> m_VehicleGuids;
// Type specific code for add/remove to/from grid
template<class T>
void AddToGrid(T*, NGridType*, Cell const&);
template<class T>
void RemoveFromGrid(T*, NGridType*, Cell const&);
// Holder for information about linked mobs
CreatureLinkingHolder m_creatureLinkingHolder;
// Dynamic Map tree object
DynamicMapTree m_dyn_tree;
};
class MANGOS_DLL_SPEC WorldMap : public Map
{
private:
using Map::GetPersistentState; // hide in subclass for overwrite
public:
WorldMap(uint32 id, time_t expiry) : Map(id, expiry, 0, REGULAR_DIFFICULTY) {}
~WorldMap() {}
// can't be NULL for loaded map
WorldPersistentState* GetPersistanceState() const;
};
class MANGOS_DLL_SPEC DungeonMap : public Map
{
private:
using Map::GetPersistentState; // hide in subclass for overwrite
public:
DungeonMap(uint32 id, time_t, uint32 InstanceId, uint8 SpawnMode);
~DungeonMap();
bool Add(Player*) override;
void Remove(Player*, bool) override;
void Update(const uint32&) override;
bool Reset(InstanceResetMethod method);
void PermBindAllPlayers(Player* player);
void UnloadAll(bool pForce) override;
void SendResetWarnings(uint32 timeLeft) const;
void SetResetSchedule(bool on);
// can't be NULL for loaded map
DungeonPersistentState* GetPersistanceState() const;
virtual void InitVisibilityDistance() override;
private:
bool m_resetAfterUnload;
bool m_unloadWhenEmpty;
};
class MANGOS_DLL_SPEC BattleGroundMap : public Map
{
private:
using Map::GetPersistentState; // hide in subclass for overwrite
public:
BattleGroundMap(uint32 id, time_t, uint32 InstanceId, uint8 spawnMode);
~BattleGroundMap();
void Update(const uint32&) override;
bool Add(Player*) override;
void Remove(Player*, bool) override;
bool CanEnter(Player* player) override;
void SetUnload();
void UnloadAll(bool pForce) override;
virtual void InitVisibilityDistance() override;
BattleGround* GetBG() { return m_bg; }
void SetBG(BattleGround* bg) { m_bg = bg; }
// can't be NULL for loaded map
BattleGroundPersistentState* GetPersistanceState() const;
private:
BattleGround* m_bg;
};
template<class T, class CONTAINER>
inline void
Map::Visit(const Cell& cell, TypeContainerVisitor<T, CONTAINER>& visitor)
{
const uint32 x = cell.GridX();
const uint32 y = cell.GridY();
const uint32 cell_x = cell.CellX();
const uint32 cell_y = cell.CellY();
if (!cell.NoCreate() || loaded(GridPair(x, y)))
{
EnsureGridLoaded(cell);
getNGrid(x, y)->Visit(cell_x, cell_y, visitor);
}
}
#endif
| blueboy/gmguy | src/game/Map.h | C | gpl-2.0 | 17,335 | [
30522,
1013,
1008,
1008,
9385,
1006,
1039,
1007,
2384,
1011,
2262,
24792,
2015,
1026,
8299,
1024,
1013,
1013,
2131,
2386,
12333,
1012,
4012,
1013,
1028,
1008,
1008,
2023,
2565,
2003,
2489,
4007,
1025,
2017,
2064,
2417,
2923,
3089,
8569,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package be.kwakeroni.workshop.java9.solution.language;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Supplier;
// Examples
// V1 - Replace type declarations with var
// V2 - Inference of generic parameters (to Object)
// V3 - Inference of intersection types
// V4 - var in loops
// V5 - var as variable name
// V6 - var not as class name
// V7 - var not without type inference
// Style guidelines http://openjdk.java.net/projects/amber/LVTIstyle.html
// Principles
// 1. Reading code is more important than writing code.
// 2. Code should be clear from local reasoning.
// 3. Code readability shouldn't depend on IDEs.
// 4. Explicit types are a tradeoff.
// @since 10
public class Var {
public String var;
public void test() {
var var = "var";
List<String> diamond = new ArrayList<>();
var stringList = new ArrayList<String>();
ArrayList<String> sl = stringList;
var varList = new ArrayList<>();
ArrayList<Object> ao = varList;
// Serializable & Comparable<?> x = getSomeX();
doSomeY(this::getSomeX);
doSomeX(getSomeX());
var runnableComparable = getSomeX();
doSomeY(() -> runnableComparable);
for (var i=0; i<10; i++){
// in old loops
}
for (var element : varList){
// or new loops
}
var myRunnable = new Runnable() {
@Override
public void run() {
throw new UnsupportedOperationException();
}
public void setTimeout(long millis) {
}
};
myRunnable.run();
myRunnable.setTimeout(1000);
List<? extends Number> numList = null;
var num = numList.get(0);
Number number = num;
var c = this.getClass();
var t = getT();
// 1. Choose variable names that provide useful information.
// In a var declaration, information about the meaning and use of the variable can be conveyed using the variable's name.
// Instead of the exact type, it's sometimes better for a variable's name to express the role or the nature of the variable
// 2. Minimize the scope of local variables.
// 3. Consider var when the initializer provides sufficient information to the reader.
// 4. Use var to break up chained or nested expressions with local variables.
// Using var allows us to express the the code more naturally without paying the high price of explicitly declaring the types of the intermediate variables
// As with many other situations, the correct use of var might involve both taking something out (explicit types) and adding something back (better variable names, better structuring of code.)
// 6. Take care when using var with diamond or generic methods.
// 7. Take care when using var with literals.
}
private <T> T getT() {
return null;
}
private <X extends Runnable & Comparable<?>> X getSomeX() {
return null;
}
private <X extends Runnable & Comparable<?>> void doSomeX(X x) {
}
private <Y extends Runnable & Comparable<?>> void doSomeY(Supplier<Y> runnableComparable){
var y = runnableComparable.get();
}
// Cannot be used as a class name
// public static final class var {
//
// private var noFields;
//
// private var noMethods(var norArguments){
// try {
// var norWithoutInitializer;
// var nil = null;
// var notWhenTargetTypeIsNeeded = () -> 42;
// String[] s1 = {"A", "B"};
// var notForArrayInitializers = {"A", "B"};
// } catch (var orWithCaughtExceptions){
//
// }
// }
// }
}
| kwakeroni/workshops | java9/solution/src/test/java/be/kwakeroni/workshop/java9/solution/language/Var.java | Java | lgpl-3.0 | 3,850 | [
30522,
7427,
2022,
1012,
6448,
22626,
10698,
1012,
8395,
1012,
9262,
2683,
1012,
5576,
1012,
2653,
1025,
12324,
9262,
1012,
22834,
1012,
7642,
21335,
3468,
1025,
12324,
9262,
1012,
21183,
4014,
1012,
9140,
9863,
1025,
12324,
9262,
1012,
211... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
namespace PragmaRX\Sdk\Services\Billing\Data\Entities;
use PragmaRX\Sdk\Core\Database\Eloquent\Model;
class InvoiceDebtor extends Model {
protected $fillable = [
'invoice_id',
'debtor_id',
];
}
| antonioribeiro/sdk | src/Services/Billing/Data/Entities/InvoiceDebtor.php | PHP | mit | 211 | [
30522,
1026,
1029,
25718,
3415,
15327,
10975,
8490,
7849,
2595,
1032,
17371,
2243,
1032,
2578,
1032,
25640,
1032,
2951,
1032,
11422,
1025,
2224,
10975,
8490,
7849,
2595,
1032,
17371,
2243,
1032,
4563,
1032,
7809,
1032,
3449,
2080,
15417,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# --
# Kernel/Modules/CustomerPreferences.pm - provides agent preferences
# Copyright (C) 2001-2015 OTRS AG, http://otrs.com/
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --
package Kernel::Modules::CustomerPreferences;
use strict;
use warnings;
sub new {
my ( $Type, %Param ) = @_;
# allocate new hash for object
my $Self = {%Param};
bless( $Self, $Type );
# check all needed objects
for (
qw(ParamObject DBObject QueueObject LayoutObject ConfigObject LogObject SessionObject UserObject)
)
{
if ( !$Self->{$_} ) {
$Self->{LayoutObject}->FatalError( Message => "Got no $_!" );
}
}
# get params
$Self->{Want} = $Self->{ParamObject}->GetParam( Param => 'Want' ) || '';
return $Self;
}
sub Run {
my ( $Self, %Param ) = @_;
# ------------------------------------------------------------ #
# update preferences
# ------------------------------------------------------------ #
if ( $Self->{Subaction} eq 'Update' ) {
# challenge token check for write action
$Self->{LayoutObject}->ChallengeTokenCheck( Type => 'Customer' );
# check group param
my $Group = $Self->{ParamObject}->GetParam( Param => 'Group' ) || '';
if ( !$Group ) {
return $Self->{LayoutObject}->ErrorScreen( Message => 'Param Group is required!' );
}
# check preferences setting
my %Preferences = %{ $Self->{ConfigObject}->Get('CustomerPreferencesGroups') };
if ( !$Preferences{$Group} ) {
return $Self->{LayoutObject}->ErrorScreen( Message => "No such config for $Group" );
}
# get user data
my %UserData = $Self->{UserObject}->CustomerUserDataGet( User => $Self->{UserLogin} );
my $Module = $Preferences{$Group}->{Module};
if ( !$Self->{MainObject}->Require($Module) ) {
return $Self->{LayoutObject}->FatalError();
}
my $Object = $Module->new(
%{$Self},
ConfigItem => $Preferences{$Group},
Debug => $Self->{Debug},
);
# log loaded module
if ( $Self->{Debug} > 1 ) {
$Self->{LogObject}->Log(
Priority => 'debug',
Message => "Module: $Module loaded!",
);
}
my @Params = $Object->Param( UserData => \%UserData );
my %GetParam;
for my $ParamItem (@Params) {
my @Array = $Self->{ParamObject}->GetArray(
Param => $ParamItem->{Name},
Raw => $ParamItem->{Raw} || 0,
);
$GetParam{ $ParamItem->{Name} } = \@Array;
}
my $Message = '';
my $Priority = '';
if (
$Object->Run(
GetParam => \%GetParam,
UserData => \%UserData
)
)
{
$Message = $Object->Message();
}
else {
$Priority = 'Error';
$Message = $Object->Error();
}
# check redirect
my $RedirectURL = $Self->{ParamObject}->GetParam( Param => 'RedirectURL' );
if ($RedirectURL) {
return $Self->{LayoutObject}->Redirect(
OP => $RedirectURL,
);
}
# redirect
return $Self->{LayoutObject}->Redirect(
OP => "Action=CustomerPreferences;Priority=$Priority;Message=$Message",
);
}
# ------------------------------------------------------------ #
# show preferences
# ------------------------------------------------------------ #
else {
my $Output = $Self->{LayoutObject}->CustomerHeader( Title => 'Preferences' );
$Output .= $Self->{LayoutObject}->CustomerNavigationBar();
# get param
my $Message = $Self->{ParamObject}->GetParam( Param => 'Message' ) || '';
my $Priority = $Self->{ParamObject}->GetParam( Param => 'Priority' ) || '';
# add notification
if ( $Message && $Priority eq 'Error' ) {
$Output .= $Self->{LayoutObject}->Notify(
Priority => $Priority,
Info => $Message,
);
}
elsif ($Message) {
$Output .= $Self->{LayoutObject}->Notify(
Priority => 'Success',
Info => $Message,
);
}
# get user data
my %UserData = $Self->{UserObject}->CustomerUserDataGet( User => $Self->{UserLogin} );
$Output .= $Self->CustomerPreferencesForm( UserData => \%UserData );
$Output .= $Self->{LayoutObject}->CustomerFooter();
return $Output;
}
}
sub CustomerPreferencesForm {
my ( $Self, %Param ) = @_;
$Self->{LayoutObject}->Block(
Name => 'Body',
Data => \%Param,
);
my @Groups = @{ $Self->{ConfigObject}->Get('CustomerPreferencesView') };
COLUMN:
for my $Column (@Groups) {
next COLUMN if !$Column;
my %Data;
my %Preferences = %{ $Self->{ConfigObject}->Get('CustomerPreferencesGroups') };
GROUP:
for my $Group ( sort keys %Preferences ) {
next GROUP if !$Group;
my $PreferencesGroup = $Preferences{$Group};
next GROUP if !$PreferencesGroup;
next GROUP if ref $PreferencesGroup ne 'HASH';
$PreferencesGroup->{Column} ||= '';
$PreferencesGroup->{Prio} ||= 9999;
next GROUP if $PreferencesGroup->{Column} ne $Column;
if ( $Data{ $PreferencesGroup->{Prio} } ) {
COUNT:
for ( 1 .. 151 ) {
$PreferencesGroup->{Prio}++;
if ( !$Data{ $PreferencesGroup->{Prio} } ) {
$Data{ $PreferencesGroup->{Prio} } = $Group;
last COUNT;
}
}
}
$Data{ $PreferencesGroup->{Prio} } = $Group;
}
$Self->{LayoutObject}->Block(
Name => 'Head',
Data => {
Header => $Column,
},
);
# sort
for my $Key ( sort keys %Data ) {
$Data{ sprintf( "%07d", $Key ) } = $Data{$Key};
delete $Data{$Key};
}
# show each preferences setting
PRIO:
for my $Prio ( sort keys %Data ) {
my $Group = $Data{$Prio};
next PRIO if !$Self->{ConfigObject}->{CustomerPreferencesGroups}->{$Group};
my %Preference = %{ $Self->{ConfigObject}->{CustomerPreferencesGroups}->{$Group} };
next PRIO if !$Preference{Active};
# load module
my $Module = $Preference{Module} || 'Kernel::Output::HTML::CustomerPreferencesGeneric';
if ( !$Self->{MainObject}->Require($Module) ) {
return $Self->{LayoutObject}->FatalError();
}
my $Object = $Module->new(
%{$Self},
ConfigItem => $Preferences{$Group},
Debug => $Self->{Debug},
);
my @Params = $Object->Param( UserData => $Param{UserData} );
next PRIO if !@Params;
# show item
$Self->{LayoutObject}->Block(
Name => 'Item',
Data => {
Group => $Group,
%Preference,
},
);
for my $ParamItem (@Params) {
if ( ref $ParamItem->{Data} eq 'HASH' || ref $Preference{Data} eq 'HASH' ) {
$ParamItem->{Option} = $Self->{LayoutObject}->BuildSelection(
%Preference, %{$ParamItem},
);
}
$Self->{LayoutObject}->Block(
Name => 'Block',
Data => { %Preference, %{$ParamItem}, },
);
$Self->{LayoutObject}->Block(
Name => $ParamItem->{Block} || $Preference{Block} || 'Option',
Data => { %Preference, %{$ParamItem}, },
);
}
}
}
# create & return output
return $Self->{LayoutObject}->Output(
TemplateFile => 'CustomerPreferences',
Data => \%Param
);
}
1;
| StCyr/otrs | Kernel/Modules/CustomerPreferences.pm | Perl | agpl-3.0 | 8,496 | [
30522,
1001,
1011,
1011,
1001,
16293,
1013,
14184,
1013,
8013,
28139,
25523,
2015,
1012,
7610,
1011,
3640,
4005,
18394,
1001,
9385,
1006,
1039,
1007,
2541,
1011,
2325,
27178,
2869,
12943,
1010,
8299,
1024,
1013,
1013,
27178,
2869,
1012,
401... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>statsmodels.tsa.vector_ar.var_model.VARResults.pvalues — statsmodels 0.9.0 documentation</title>
<link rel="stylesheet" href="../_static/nature.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript" src="../_static/documentation_options.js"></script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="shortcut icon" href="../_static/statsmodels_hybi_favico.ico"/>
<link rel="author" title="About these documents" href="../about.html" />
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="statsmodels.tsa.vector_ar.var_model.VARResults.pvalues_dt" href="statsmodels.tsa.vector_ar.var_model.VARResults.pvalues_dt.html" />
<link rel="prev" title="statsmodels.tsa.vector_ar.var_model.VARResults.plotsim" href="statsmodels.tsa.vector_ar.var_model.VARResults.plotsim.html" />
<link rel="stylesheet" href="../_static/examples.css" type="text/css" />
<link rel="stylesheet" href="../_static/facebox.css" type="text/css" />
<script type="text/javascript" src="../_static/scripts.js">
</script>
<script type="text/javascript" src="../_static/facebox.js">
</script>
<script type="text/javascript">
$.facebox.settings.closeImage = "../_static/closelabel.png"
$.facebox.settings.loadingImage = "../_static/loading.gif"
</script>
</head><body>
<div class="headerwrap">
<div class = "header">
<a href = "../index.html">
<img src="../_static/statsmodels_hybi_banner.png" alt="Logo"
style="padding-left: 15px"/></a>
</div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="statsmodels.tsa.vector_ar.var_model.VARResults.pvalues_dt.html" title="statsmodels.tsa.vector_ar.var_model.VARResults.pvalues_dt"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="statsmodels.tsa.vector_ar.var_model.VARResults.plotsim.html" title="statsmodels.tsa.vector_ar.var_model.VARResults.plotsim"
accesskey="P">previous</a> |</li>
<li><a href ="../install.html">Install</a></li> |
<li><a href="https://groups.google.com/forum/?hl=en#!forum/pystatsmodels">Support</a></li> |
<li><a href="https://github.com/statsmodels/statsmodels/issues">Bugs</a></li> |
<li><a href="../dev/index.html">Develop</a></li> |
<li><a href="../examples/index.html">Examples</a></li> |
<li><a href="../faq.html">FAQ</a></li> |
<li class="nav-item nav-item-1"><a href="../tsa.html" >Time Series analysis <code class="docutils literal notranslate"><span class="pre">tsa</span></code></a> |</li>
<li class="nav-item nav-item-2"><a href="statsmodels.tsa.vector_ar.var_model.VARResults.html" accesskey="U">statsmodels.tsa.vector_ar.var_model.VARResults</a> |</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="statsmodels-tsa-vector-ar-var-model-varresults-pvalues">
<h1>statsmodels.tsa.vector_ar.var_model.VARResults.pvalues<a class="headerlink" href="#statsmodels-tsa-vector-ar-var-model-varresults-pvalues" title="Permalink to this headline">¶</a></h1>
<dl class="method">
<dt id="statsmodels.tsa.vector_ar.var_model.VARResults.pvalues">
<code class="descclassname">VARResults.</code><code class="descname">pvalues</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/statsmodels/tsa/vector_ar/var_model.html#VARResults.pvalues"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#statsmodels.tsa.vector_ar.var_model.VARResults.pvalues" title="Permalink to this definition">¶</a></dt>
<dd><p>Two-sided p-values for model coefficients from Student t-distribution</p>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="statsmodels.tsa.vector_ar.var_model.VARResults.plotsim.html"
title="previous chapter">statsmodels.tsa.vector_ar.var_model.VARResults.plotsim</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="statsmodels.tsa.vector_ar.var_model.VARResults.pvalues_dt.html"
title="next chapter">statsmodels.tsa.vector_ar.var_model.VARResults.pvalues_dt</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/generated/statsmodels.tsa.vector_ar.var_model.VARResults.pvalues.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
© Copyright 2009-2017, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.4.
</div>
</body>
</html> | statsmodels/statsmodels.github.io | 0.9.0/generated/statsmodels.tsa.vector_ar.var_model.VARResults.pvalues.html | HTML | bsd-3-clause | 6,727 | [
30522,
1026,
999,
9986,
13874,
16129,
2270,
1000,
1011,
1013,
1013,
1059,
2509,
2278,
1013,
1013,
26718,
2094,
1060,
11039,
19968,
1015,
1012,
1014,
17459,
1013,
1013,
4372,
1000,
1000,
8299,
1024,
1013,
1013,
7479,
1012,
1059,
2509,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
require 'rails_helper'
RSpec.describe "amazon_pay/login.html.slim", type: :view do
pending "add some examples to (or delete) #{__FILE__}"
end
| Samemura/TryAmazonPayments | spec/views/amazon_pay/login.html.slim_spec.rb | Ruby | mit | 145 | [
30522,
5478,
1005,
15168,
1035,
2393,
2121,
1005,
12667,
5051,
2278,
1012,
6235,
1000,
9733,
1035,
3477,
1013,
8833,
2378,
1012,
16129,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
function getCalendar() {
$ts_cal_today = date(d);
$ts_cal_days = date(t);
$ts_cal_month = date(m);
$ts_cal_year = date(Y);
$ts_cal_firstday = mktime(0, 0, 1, $ts_cal_month,1, $ts_cal_year);
$ts_cal_lastday = mktime(0, 0, 1,$ts_cal_month, $ts_cal_days, $ts_cal_year);
$ts_cal_first = date(w, $ts_cal_firstday);
$ts_cal_last = date(w, $ts_cal_lastday);
$ts_cal_diff = 7 - $ts_cal_last;
$ts_cal_jahr = date(Y);
$ts_cal_months = array("Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember");
$ts_cal_monat = $ts_cal_months[date("n", time())-1];
if($ts_cal_first == 0) $ts_cal_first = 7;
if($ts_cal_last == 0) $ts_cal_last = 7;
for($ts_cal_i=1; $ts_cal_i<$ts_cal_first; $ts_cal_i++) {
$ts_cal_begin.= "<td><p></td>";
}
for($ts_cal_i=0; $ts_cal_i<$diff; $ts_cal_i++) {
$ts_cal_end.= "<td><p></td>";
}
if(strlen($ts_cal_monat) > "7") { $ts_cal_mfsize = "15pt;"; } else { $ts_cal_mfsize = "17pt;"; }
echo "<div id='leftcal'>
<p style='display: block; width: 100%; text-align: center; font-weight: bold;'>$ts_cal_monat $ts_cal_jahr</p>
</div>";
echo "<div id='rightcal'>
<table>
<thead>
<tr style='text-align: center;'>
<td><p>Mo</p></td>
<td><p>Di</p></td>
<td><p>Mi</p></td>
<td><p>Do</p></td>
<td><p>Fr</p></td>
<td><p>Sa</p></td>
<td><p>So</p></td>
</tr>
</thead>
<tr>
$ts_cal_begin";
for($ts_cal_i=1; $ts_cal_i<($ts_cal_days+1); $ts_cal_i++) {
if($ts_cal_first == 0):
echo "<tr>";
endif;
if(strlen($ts_cal_i)=="1") $ts_cal_i = "0$ts_cal_i";
if($_GET['tzone']=="$ts_cal_i.$ts_cal_month.$ts_cal_year") {
echo "<td align='center'><p>$ts_cal_i</p></td>";
}
else {
echo "<td align='center'><p><a href=\"?tzone=$ts_cal_i.$ts_cal_month.$ts_cal_year\">$ts_cal_i</a></p></td>";
}
if($ts_cal_first==7):
echo "</tr><tr>";
$ts_cal_first=0;
endif;
$ts_cal_first++;
}
echo "$ts_cal_end</tr>";
echo "</table></div>";
}
function getOverview() {
}
?> | symbla/symStats | bin/php/gui.lib.php | PHP | gpl-2.0 | 2,670 | [
30522,
1026,
1029,
25718,
3853,
2131,
9289,
10497,
2906,
1006,
1007,
1063,
1002,
24529,
1035,
10250,
1035,
2651,
1027,
3058,
1006,
1040,
1007,
1025,
1002,
24529,
1035,
10250,
1035,
2420,
1027,
3058,
1006,
1056,
1007,
1025,
1002,
24529,
1035... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright (C) 2014-present The openSourcLibrary-2015 Authors
*
* https://github.com/sdcuike
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.doctor.java8;
import java.util.Arrays;
import java.util.stream.Stream;
/**
* Convert Stream to Array in Java 8
*
* @author doctor
*
* @see http://www.programcreek.com/2014/01/convert-stream-to-array-in-java-8/
*
* @time 2015年8月5日 上午10:38:41
*
*/
public class ConvertStreamToArrayInJava8 {
public static void main(String[] args) {
String[] strings = {"hello","doctor","who are you"};
String[] array = Stream.of(strings).toArray(String[]::new);
System.out.println(Arrays.toString(array));
String[] array2 = Stream.of(strings).toArray(size -> new String[size]);
System.out.println(Arrays.toString(array2));
}
}
| sdcuike/openSourcLibrary-2015 | src/main/java/com/doctor/java8/ConvertStreamToArrayInJava8.java | Java | apache-2.0 | 1,326 | [
30522,
1013,
1008,
1008,
9385,
1006,
1039,
1007,
2297,
1011,
2556,
1996,
7480,
8162,
20464,
12322,
19848,
2100,
1011,
2325,
6048,
1008,
1008,
16770,
1024,
1013,
1013,
21025,
2705,
12083,
1012,
4012,
1013,
17371,
10841,
17339,
1008,
1008,
70... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
const LogTestPlugin = require("../../helpers/LogTestPlugin");
/** @type {import("../../../").Configuration} */
module.exports = {
mode: "production",
entry: "./index",
stats: "normal",
plugins: [new LogTestPlugin()]
};
| webpack/webpack | test/statsCases/preset-normal/webpack.config.js | JavaScript | mit | 224 | [
30522,
9530,
3367,
8833,
22199,
24759,
15916,
2378,
1027,
5478,
1006,
1000,
1012,
1012,
1013,
1012,
1012,
1013,
2393,
2545,
1013,
8833,
22199,
24759,
15916,
2378,
1000,
1007,
1025,
1013,
1008,
1008,
1030,
2828,
1063,
12324,
1006,
1000,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
function commpress_init() {
$labels = array(
'name' => __('Casts', 'easel'),
'singular_name' => __('Cast', 'easel'),
'add_new' => __('Add New', 'easel'),
'add_new_item' => __('Add New Cast', 'easel'),
'edit_item' => __('Edit Cast', 'easel'),
'edit' => _x('Edit', 'casts', 'easel'),
'new_item' => __('New Cast', 'easel'),
'view_item' => __('View Cast', 'easel'),
'search_items' => __('Search Casts', 'easel'),
'not_found' => __('No casts found', 'easel'),
'not_found_in_trash' => __('No casts found in Trash', 'easel'),
'view' => __('View Cast', 'easel'),
'parent_item_colon' => ''
);
register_post_type(
'casts',
array(
'labels' => $labels,
'public' => true,
'public_queryable' => true,
'show_ui' => true,
'query_var' => true,
'_edit_link' => 'post.php?post=%d',
'capability_type' => 'post',
'rewrite' => true,
'hierarchical' => false,
'menu_position' => null,
'supports' => array( 'title', 'editor', 'excerpt', 'author', 'trackbacks', 'comments', 'thumbnail' )
)
);
$labels = array(
'name' => __( 'Tags', 'easel' ),
'singular_name' => __( 'Tag', 'easel' ),
'search_items' => __( 'Search Tags', 'easel' ),
'popular_items' => __( 'Popular Tags', 'easel' ),
'all_items' => __( 'All Tags', 'easel' ),
'parent_item' => __( 'Parent Tag', 'easel' ),
'parent_item_colon' => __( 'Parent Tag:', 'easel' ),
'edit_item' => __( 'Edit Tag', 'easel' ),
'update_item' => __( 'Update Tag', 'easel' ),
'add_new_item' => __( 'Add New Tag', 'easel' ),
'new_item_name' => __( 'New Tag Name', 'easel' ),
);
register_taxonomy('cast-tag',array('casts'), array(
'hierarchical' => false,
'labels' => $labels,
'public' => true,
'show_ui' => true,
'query_var' => true,
'show_tagcloud' => true,
'rewrite' => array( 'slug' => 'cast-tag' ),
));
$labels = array(
'name' => __( 'Guests', 'easel' ),
'singular_name' => __( 'Guest', 'easel' ),
'search_items' => __( 'Search Guests', 'easel' ),
'popular_items' => __( 'Popular Guests', 'easel' ),
'all_items' => __( 'All Guests', 'easel' ),
'parent_item' => __( 'Parent Guest', 'easel' ),
'parent_item_colon' => __( 'Parent Guest:', 'easel' ),
'edit_item' => __( 'Edit Guest', 'easel' ),
'update_item' => __( 'Update Guest', 'easel' ),
'add_new_item' => __( 'Add New Guest', 'easel' ),
'new_item_name' => __( 'New Guest Name', 'easel' ),
);
register_taxonomy('cast-guest',array('casts'), array(
'hierarchical' => false,
'labels' => $labels,
'public' => true,
'show_ui' => true,
'query_var' => true,
'show_tagcloud' => true,
'rewrite' => array( 'slug' => 'cast-guest' ),
));
$labels = array(
'name' => __( 'Audience', 'easel' ),
'singular_name' => __( 'Audience', 'easel' ),
'search_items' => __( 'Search Audience', 'easel' ),
'popular_items' => __( 'Popular Audience', 'easel' ),
'all_items' => __( 'All Audience', 'easel' ),
'parent_item' => __( 'Parent Audience', 'easel' ),
'parent_item_colon' => __( 'Parent Audience:', 'easel' ),
'edit_item' => __( 'Edit Audience', 'easel' ),
'update_item' => __( 'Update Audience', 'easel' ),
'add_new_item' => __( 'Add New Audience', 'easel' ),
'new_item_name' => __( 'New Audience Name', 'easel' ),
);
register_taxonomy('cast-audience',array('casts'), array(
'hierarchical' => false,
'labels' => $labels,
'public' => true,
'show_ui' => true,
'query_var' => true,
'show_tagcloud' => true,
'rewrite' => array( 'slug' => 'cast-audience' ),
));
$labels = array(
'name' => __( 'Hosts', 'easel' ),
'singular_name' => __( 'Host', 'easel' ),
'search_items' => __( 'Search Hosts', 'easel' ),
'popular_items' => __( 'Popular Host', 'easel' ),
'all_items' => __( 'All Hosts', 'easel' ),
'parent_item' => __( 'Parent Host', 'easel' ),
'parent_item_colon' => __( 'Parent Host:', 'easel' ),
'edit_item' => __( 'Edit Host', 'easel' ),
'update_item' => __( 'Update Host', 'easel' ),
'add_new_item' => __( 'Add New Host', 'easel' ),
'new_item_name' => __( 'New Host Name', 'easel' ),
);
register_taxonomy('cast-host',array('casts'), array(
'hierarchical' => false,
'public' => true,
'labels' => $labels,
'show_ui' => true,
'query_var' => true,
'show_tagcloud' => true,
'rewrite' => array( 'slug' => 'host' ),
));
$labels = array(
'name' => __( 'Show', 'easel' ),
'singular_name' => __( 'Show', 'easel' ),
'search_items' => __( 'Search Shows', 'easel' ),
'popular_items' => __( 'Popular Shows', 'easel' ),
'all_items' => __( 'All Shows', 'easel' ),
'parent_item' => __( 'Parent Show', 'easel' ),
'parent_item_colon' => __( 'Parent Show:', 'easel' ),
'edit_item' => __( 'Edit Show', 'easel' ),
'update_item' => __( 'Update Show', 'easel' ),
'add_new_item' => __( 'Add New Show', 'easel' ),
'new_item_name' => __( 'New Show Name', 'easel' ),
);
register_taxonomy('cast-show',array('casts'), array(
'hierarchical' => true,
'labels' => $labels,
'public' => true,
'show_ui' => true,
'query_var' => true,
'show_tagcloud' => true,
'rewrite' => array( 'slug' => 'cast-show' ),
));
register_taxonomy_for_object_type('cast-host', 'casts');
register_taxonomy_for_object_type('cast-guest', 'casts');
register_taxonomy_for_object_type('cast-tag', 'casts');
register_taxonomy_for_object_type('cast-audience', 'casts');
register_taxonomy_for_object_type('cast-show', 'casts');
}
add_action('init', 'commpress_init');
add_action('easel-post-info', 'commpress_display_hosts');
if (!function_exists('commpress_display_hosts')) {
function commpress_display_hosts() {
global $post;
if ($post->post_type == 'casts') {
$before = '<div class="casts-hosts">With Host(s): ';
$sep = ', ';
$after = '</div>';
$output = get_the_term_list( $post->ID, 'cast-host', $before, $sep, $after );
if (!empty($output)) echo $output;
}
}
}
add_action('easel-post-info', 'commpress_display_guests');
if (!function_exists('commpress_display_guests')) {
function commpress_display_guests() {
global $post;
if ($post->post_type == 'casts') {
$before = '<div class="casts-guests">With Guest(s): ';
$sep = ', ';
$after = '</div>';
$output = get_the_term_list( $post->ID, 'cast-guest', $before, $sep, $after );
if (!empty($output)) echo $output;
}
}
}
add_action('easel-post-extras', 'commpress_display_audience');
if (!function_exists('commpress_display_audience')) {
function commpress_display_audience() {
global $post;
if ($post->post_type == 'casts') {
$before = '<div class="casts-audience">Audience: ';
$sep = ', ';
$after = '</div>';
$output = get_the_term_list( $post->ID, 'cast-audience', $before, $sep, $after );
if (!empty($output)) echo $output;
}
}
}
// Injections
add_filter('easel_display_post_category', 'commpress_display_cast_show');
// TODO: Make this actually output a chapter set that the comic is in, instead of the post-type
function commpress_display_cast_show($post_show) {
global $post;
if ($post->post_type == 'casts') {
$before = '<div class="casts-show"> ';
$sep = ', ';
$after = '</div>';
$post_show = get_the_term_list( $post->ID, 'cast-show', $before, $sep, $after );
}
return $post_show;
}
add_action('easel-post-extras', 'commpress_display_cast_tags');
if (!function_exists('commpress_display_cast_tags')) {
function commpress_display_cast_tags() {
global $post;
if ($post->post_type == 'casts') {
$before = '<div class="cast-tags">'.__('└ Tags: ','easel');
$sep = ",";
$after = '</div>';
$output = get_the_term_list( $post->ID, 'cast-tag', $before, $sep, $after );
if (!empty($output)) echo $output;
}
}
}
add_action('easel-narrowcolumn-area', 'commpress_display_cast');
function commpress_display_cast() {
global $wp_query, $post;
if (!is_paged() && is_home()) {
Protect();
$cast_args = array(
'posts_per_page' => 1,
'post_type' => 'casts'
);
$wp_query->in_the_loop = true; $castFrontpage = new WP_Query(); $castFrontpage->query($cast_args);
while ($castFrontpage->have_posts()) : $castFrontpage->the_post();
easel_display_post();
endwhile;
UnProtect();
}
}
// Navigation
function easel_commpress_get_first_cast() {
return easel_commpress_get_terminal_post_of_casts(true);
}
function easel_commpress_get_first_cast_permalink() {
$terminal = easel_commpress_get_first_cast();
return !empty($terminal) ? get_permalink($terminal->ID) : false;
}
function easel_commpress_get_last_cast() {
return easel_commpress_get_terminal_post_of_casts(false);
}
function easel_commpress_get_last_cast_permalink() {
$terminal = easel_commpress_get_last_cast();
return !empty($terminal) ? get_permalink($terminal->ID) : false;
}
function easel_commpress_get_previous_cast() {
return easel_get_adjacent_post_type(true, 'casts');
}
function easel_commpress_get_previous_cast_permalink() {
$prev_cast = easel_commpress_get_previous_cast();
if (is_object($prev_cast)) {
if (isset($prev_cast->ID)) {
return get_permalink($prev_cast->ID);
}
}
return false;
}
function easel_commpress_get_next_cast() {
return easel_get_adjacent_post_type(false, 'casts');
}
function easel_commpress_get_next_cast_permalink() {
$next_cast = easel_commpress_get_next_cast();
if (is_object($next_cast)) {
if (isset($next_cast->ID)) {
return get_permalink($next_cast->ID);
}
}
return false;
}
function easel_commpress_get_terminal_post_of_casts($first = true) {
$sortOrder = $first ? "asc" : "desc";
$args = array(
'order' => $sortOrder,
'posts_per_page' => 1,
'post_type' => 'casts'
);
$terminalComicQuery = new WP_Query($args);
$terminalPost = false;
if ($terminalComicQuery->have_posts()) {
$terminalPost = reset($terminalComicQuery->posts);
}
return $terminalPost;
}
add_action('easel-post-foot', 'easel_commpress_display_navigation');
if (!function_exists('easel_commpress_display_navigation')) {
function easel_commpress_display_navigation() {
global $post, $wp_query;
if ($post->post_type == 'casts' && !is_archive() && !is_search()) {
$first_cast = easel_commpress_get_first_cast_permalink();
$first_text = __('‹‹ First','easel');
$last_cast = easel_commpress_get_last_cast_permalink();
$last_text = __('Last ››','easel');
$next_cast = easel_commpress_get_next_cast_permalink();
$next_text = __('Next ›','easel');
$prev_cast = easel_commpress_get_previous_cast_permalink();
$prev_text = __('‹ Prev','easel');
?>
<div id="casts-nav-wrapper">
<div class="casts-nav">
<div class="casts-nav-base casts-nav-first"><?php if ( get_permalink() != $first_cast ) { ?><a href="<?php echo $first_cast ?>"><?php echo $first_text; ?></a><?php } else { echo $first_text; } ?></div>
<div class="casts-nav-base casts-nav-previous"><?php if ($prev_cast) { ?><a href="<?php echo $prev_cast ?>"><?php echo $prev_text; ?></a><?php } else { echo $prev_text; } ?></div>
<div class="casts-nav-base casts-nav-last"><?php if ( get_permalink() != $last_cast ) { ?><a href="<?php echo $last_cast ?>"><?php echo $last_text; ?></a><?php } else { echo $last_text; } ?></div>
<div class="casts-nav-base casts-nav-next"><?php if ($next_cast) { ?><a href="<?php echo $next_cast ?>"><?php echo $next_text; ?></a><?php } else { echo $next_text; } ?></div>
<div class="clear"></div>
</div>
</div>
<?php
}
}
}
add_action('easel-post-foot', 'commpress_display_edit_link');
function commpress_display_edit_link() {
global $post;
if ($post->post_type == 'casts') {
edit_post_link(__('<br />Edit Cast','comiceasel'), '', '');
}
}
// Widgets
class easel_latest_casts_widget extends WP_Widget {
function easel_latest_casts_widget($skip_widget_init = false) {
if (!$skip_widget_init) {
$widget_ops = array('classname' => __CLASS__, 'description' => __('Display a list of the latest Media Casts','easel') );
$this->WP_Widget(__CLASS__, __('Latest Media Casts','easel'), $widget_ops);
}
}
function widget($args, $instance) {
global $post;
extract($args, EXTR_SKIP);
Protect();
echo $before_widget;
$title = empty($instance['title']) ? __('Latest Media Cast','easel') : apply_filters('widget_title', $instance['title']);
if ( !empty( $title ) ) { echo $before_title . $title . $after_title; };
$latestmusic = get_posts('numberposts=5&post_type=casts'); ?>
<ul>
<?php foreach($latestmusic as $post) : ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
<?php
UnProtect();
echo $after_widget;
}
function update($new_instance, $old_instance) {
$instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']);
return $instance;
}
function form($instance) {
$instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
$title = strip_tags($instance['title']);
?>
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:','easel'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></label></p>
<?php
}
}
register_widget('easel_latest_casts_widget');
?> | zadav/wp_test | wp-content/themes/easel/addons/commpress.php | PHP | gpl-2.0 | 13,769 | [
30522,
1026,
1029,
25718,
3853,
4012,
8737,
8303,
1035,
1999,
4183,
1006,
1007,
1063,
1002,
10873,
1027,
9140,
1006,
1005,
2171,
1005,
1027,
1028,
1035,
1035,
1006,
1005,
23942,
1005,
1010,
1005,
7496,
2140,
1005,
1007,
1010,
1005,
13048,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright (C) 2019 Contentful GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.contentful.java.cma;
import com.contentful.java.cma.model.CMAArray;
import com.contentful.java.cma.model.CMATag;
import io.reactivex.Flowable;
import retrofit2.Response;
import retrofit2.http.GET;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.QueryMap;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import java.util.Map;
/**
* Spaces Service.
*/
interface ServiceContentTags {
@GET("/spaces/{space_id}/environments/{environment_id}/tags")
Flowable<CMAArray<CMATag>> fetchAll(
@Path("space_id") String spaceId,
@Path("environment_id") String environmentID,
@QueryMap Map<String, String> query
);
@PUT("/spaces/{space_id}/environments/{environment_id}/tags/{tag_id}")
Flowable<CMATag> create(
@Path("space_id") String spaceId,
@Path("environment_id") String environmentID,
@Path("tag_id") String tagId,
@Body CMATag tag);
@GET("/spaces/{space_id}/environments/{environment_id}/tags/{tag_id}")
Flowable<CMATag> fetchOne(
@Path("space_id") String spaceId,
@Path("environment_id") String environmentID,
@Path("tag_id") String tagId
);
@PUT("/spaces/{space_id}/environments/{environment_id}/tags/{tag_id}")
Flowable<CMATag> update(
@Path("space_id") String spaceId,
@Path("environment_id") String environmentID,
@Path("tag_id") String tagId,
@Body CMATag tag);
@DELETE("/spaces/{space_id}/environments/{environment_id}/tags/{tag_id}")
Flowable<Response<Void>> delete(
@Path("space_id") String spaceId,
@Path("environment_id") String environmentID,
@Path("tag_id") String tagId);
}
| contentful/contentful-management.java | src/main/java/com/contentful/java/cma/ServiceContentTags.java | Java | apache-2.0 | 2,309 | [
30522,
1013,
1008,
1008,
9385,
1006,
1039,
1007,
10476,
4180,
3993,
18289,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1008,
2017,
2089,
2025,
2224,
2023,
5371,
3272,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#include "guiutil.h"
#include "bitcoinaddressvalidator.h"
#include "walletmodel.h"
#include "bitcoinunits.h"
#include "util.h"
#include "init.h"
#include "base58.h"
#include <QString>
#include <QDateTime>
#include <QDoubleValidator>
#include <QFont>
#include <QLineEdit>
#include <QUrl>
#include <QTextDocument> // For Qt::escape
#include <QAbstractItemView>
#include <QApplication>
#include <QClipboard>
#include <QFileDialog>
#include <QDesktopServices>
#include <QThread>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#ifdef WIN32
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT 0x0501
#ifdef _WIN32_IE
#undef _WIN32_IE
#endif
#define _WIN32_IE 0x0501
#define WIN32_LEAN_AND_MEAN 1
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include "shlwapi.h"
#include "shlobj.h"
#include "shellapi.h"
#endif
namespace GUIUtil {
QString dateTimeStr(const QDateTime &date)
{
return date.date().toString(Qt::SystemLocaleShortDate) + QString(" ") + date.toString("hh:mm");
}
QString dateTimeStr(qint64 nTime)
{
return dateTimeStr(QDateTime::fromTime_t((qint32)nTime));
}
QFont bitcoinAddressFont()
{
QFont font("Monospace");
font.setStyleHint(QFont::TypeWriter);
return font;
}
void setupAddressWidget(QLineEdit *widget, QWidget *parent)
{
widget->setMaxLength(BitcoinAddressValidator::MaxAddressLength);
widget->setValidator(new BitcoinAddressValidator(parent));
widget->setFont(bitcoinAddressFont());
}
void setupAmountWidget(QLineEdit *widget, QWidget *parent)
{
QDoubleValidator *amountValidator = new QDoubleValidator(parent);
amountValidator->setDecimals(8);
amountValidator->setBottom(0.0);
widget->setValidator(amountValidator);
widget->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
}
bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out)
{
if(uri.scheme() != QString("litebar"))
return false;
// check if the address is valid
CBitcoinAddress addressFromUri(uri.path().toStdString());
if (!addressFromUri.IsValid())
return false;
SendCoinsRecipient rv;
rv.address = uri.path();
rv.amount = 0;
QList<QPair<QString, QString> > items = uri.queryItems();
for (QList<QPair<QString, QString> >::iterator i = items.begin(); i != items.end(); i++)
{
bool fShouldReturnFalse = false;
if (i->first.startsWith("req-"))
{
i->first.remove(0, 4);
fShouldReturnFalse = true;
}
if (i->first == "label")
{
rv.label = i->second;
fShouldReturnFalse = false;
}
else if (i->first == "amount")
{
if(!i->second.isEmpty())
{
if(!BitcoinUnits::parse(BitcoinUnits::BTC, i->second, &rv.amount))
{
return false;
}
}
fShouldReturnFalse = false;
}
if (fShouldReturnFalse)
return false;
}
if(out)
{
*out = rv;
}
return true;
}
bool parseBitcoinURI(QString uri, SendCoinsRecipient *out)
{
// Convert litebar:// to litebar:
//
// Cannot handle this later, because litebar:// will cause Qt to see the part after // as host,
// which will lowercase it (and thus invalidate the address).
if(uri.startsWith("litebar://"))
{
uri.replace(0, 11, "litebar:");
}
QUrl uriInstance(uri);
return parseBitcoinURI(uriInstance, out);
}
QString HtmlEscape(const QString& str, bool fMultiLine)
{
QString escaped = Qt::escape(str);
if(fMultiLine)
{
escaped = escaped.replace("\n", "<br>\n");
}
return escaped;
}
QString HtmlEscape(const std::string& str, bool fMultiLine)
{
return HtmlEscape(QString::fromStdString(str), fMultiLine);
}
void copyEntryData(QAbstractItemView *view, int column, int role)
{
if(!view || !view->selectionModel())
return;
QModelIndexList selection = view->selectionModel()->selectedRows(column);
if(!selection.isEmpty())
{
// Copy first item
QApplication::clipboard()->setText(selection.at(0).data(role).toString());
}
}
QString getSaveFileName(QWidget *parent, const QString &caption,
const QString &dir,
const QString &filter,
QString *selectedSuffixOut)
{
QString selectedFilter;
QString myDir;
if(dir.isEmpty()) // Default to user documents location
{
myDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
}
else
{
myDir = dir;
}
QString result = QFileDialog::getSaveFileName(parent, caption, myDir, filter, &selectedFilter);
/* Extract first suffix from filter pattern "Description (*.foo)" or "Description (*.foo *.bar ...) */
QRegExp filter_re(".* \\(\\*\\.(.*)[ \\)]");
QString selectedSuffix;
if(filter_re.exactMatch(selectedFilter))
{
selectedSuffix = filter_re.cap(1);
}
/* Add suffix if needed */
QFileInfo info(result);
if(!result.isEmpty())
{
if(info.suffix().isEmpty() && !selectedSuffix.isEmpty())
{
/* No suffix specified, add selected suffix */
if(!result.endsWith("."))
result.append(".");
result.append(selectedSuffix);
}
}
/* Return selected suffix if asked to */
if(selectedSuffixOut)
{
*selectedSuffixOut = selectedSuffix;
}
return result;
}
Qt::ConnectionType blockingGUIThreadConnection()
{
if(QThread::currentThread() != QCoreApplication::instance()->thread())
{
return Qt::BlockingQueuedConnection;
}
else
{
return Qt::DirectConnection;
}
}
bool checkPoint(const QPoint &p, const QWidget *w)
{
QWidget *atW = qApp->widgetAt(w->mapToGlobal(p));
if (!atW) return false;
return atW->topLevelWidget() == w;
}
bool isObscured(QWidget *w)
{
return !(checkPoint(QPoint(0, 0), w)
&& checkPoint(QPoint(w->width() - 1, 0), w)
&& checkPoint(QPoint(0, w->height() - 1), w)
&& checkPoint(QPoint(w->width() - 1, w->height() - 1), w)
&& checkPoint(QPoint(w->width() / 2, w->height() / 2), w));
}
void openDebugLogfile()
{
boost::filesystem::path pathDebug = GetDataDir() / "debug.log";
/* Open debug.log with the associated application */
if (boost::filesystem::exists(pathDebug))
QDesktopServices::openUrl(QUrl::fromLocalFile(QString::fromStdString(pathDebug.string())));
}
ToolTipToRichTextFilter::ToolTipToRichTextFilter(int size_threshold, QObject *parent) :
QObject(parent), size_threshold(size_threshold)
{
}
bool ToolTipToRichTextFilter::eventFilter(QObject *obj, QEvent *evt)
{
if(evt->type() == QEvent::ToolTipChange)
{
QWidget *widget = static_cast<QWidget*>(obj);
QString tooltip = widget->toolTip();
if(tooltip.size() > size_threshold && !tooltip.startsWith("<qt/>") && !Qt::mightBeRichText(tooltip))
{
// Prefix <qt/> to make sure Qt detects this as rich text
// Escape the current message as HTML and replace \n by <br>
tooltip = "<qt/>" + HtmlEscape(tooltip, true);
widget->setToolTip(tooltip);
return true;
}
}
return QObject::eventFilter(obj, evt);
}
#ifdef WIN32
boost::filesystem::path static StartupShortcutPath()
{
return GetSpecialFolderPath(CSIDL_STARTUP) / "LiteBar.lnk";
}
bool GetStartOnSystemStartup()
{
// check for LiteBar.lnk
return boost::filesystem::exists(StartupShortcutPath());
}
bool SetStartOnSystemStartup(bool fAutoStart)
{
// If the shortcut exists already, remove it for updating
boost::filesystem::remove(StartupShortcutPath());
if (fAutoStart)
{
CoInitialize(NULL);
// Get a pointer to the IShellLink interface.
IShellLink* psl = NULL;
HRESULT hres = CoCreateInstance(CLSID_ShellLink, NULL,
CLSCTX_INPROC_SERVER, IID_IShellLink,
reinterpret_cast<void**>(&psl));
if (SUCCEEDED(hres))
{
// Get the current executable path
TCHAR pszExePath[MAX_PATH];
GetModuleFileName(NULL, pszExePath, sizeof(pszExePath));
TCHAR pszArgs[5] = TEXT("-min");
// Set the path to the shortcut target
psl->SetPath(pszExePath);
PathRemoveFileSpec(pszExePath);
psl->SetWorkingDirectory(pszExePath);
psl->SetShowCmd(SW_SHOWMINNOACTIVE);
psl->SetArguments(pszArgs);
// Query IShellLink for the IPersistFile interface for
// saving the shortcut in persistent storage.
IPersistFile* ppf = NULL;
hres = psl->QueryInterface(IID_IPersistFile,
reinterpret_cast<void**>(&ppf));
if (SUCCEEDED(hres))
{
WCHAR pwsz[MAX_PATH];
// Ensure that the string is ANSI.
MultiByteToWideChar(CP_ACP, 0, StartupShortcutPath().string().c_str(), -1, pwsz, MAX_PATH);
// Save the link by calling IPersistFile::Save.
hres = ppf->Save(pwsz, TRUE);
ppf->Release();
psl->Release();
CoUninitialize();
return true;
}
psl->Release();
}
CoUninitialize();
return false;
}
return true;
}
#elif defined(LINUX)
// Follow the Desktop Application Autostart Spec:
// http://standards.freedesktop.org/autostart-spec/autostart-spec-latest.html
boost::filesystem::path static GetAutostartDir()
{
namespace fs = boost::filesystem;
char* pszConfigHome = getenv("XDG_CONFIG_HOME");
if (pszConfigHome) return fs::path(pszConfigHome) / "autostart";
char* pszHome = getenv("HOME");
if (pszHome) return fs::path(pszHome) / ".config" / "autostart";
return fs::path();
}
boost::filesystem::path static GetAutostartFilePath()
{
return GetAutostartDir() / "litebar.desktop";
}
bool GetStartOnSystemStartup()
{
boost::filesystem::ifstream optionFile(GetAutostartFilePath());
if (!optionFile.good())
return false;
// Scan through file for "Hidden=true":
std::string line;
while (!optionFile.eof())
{
getline(optionFile, line);
if (line.find("Hidden") != std::string::npos &&
line.find("true") != std::string::npos)
return false;
}
optionFile.close();
return true;
}
bool SetStartOnSystemStartup(bool fAutoStart)
{
if (!fAutoStart)
boost::filesystem::remove(GetAutostartFilePath());
else
{
char pszExePath[MAX_PATH+1];
memset(pszExePath, 0, sizeof(pszExePath));
if (readlink("/proc/self/exe", pszExePath, sizeof(pszExePath)-1) == -1)
return false;
boost::filesystem::create_directories(GetAutostartDir());
boost::filesystem::ofstream optionFile(GetAutostartFilePath(), std::ios_base::out|std::ios_base::trunc);
if (!optionFile.good())
return false;
// Write a litebar.desktop file to the autostart directory:
optionFile << "[Desktop Entry]\n";
optionFile << "Type=Application\n";
optionFile << "Name=LiteBar\n";
optionFile << "Exec=" << pszExePath << " -min\n";
optionFile << "Terminal=false\n";
optionFile << "Hidden=false\n";
optionFile.close();
}
return true;
}
#else
// TODO: OSX startup stuff; see:
// https://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPSystemStartup/Articles/CustomLogin.html
bool GetStartOnSystemStartup() { return false; }
bool SetStartOnSystemStartup(bool fAutoStart) { return false; }
#endif
HelpMessageBox::HelpMessageBox(QWidget *parent) :
QMessageBox(parent)
{
header = tr("LiteBar-Qt") + " " + tr("version") + " " +
QString::fromStdString(FormatFullVersion()) + "\n\n" +
tr("Usage:") + "\n" +
" litebar-qt [" + tr("command-line options") + "] " + "\n";
coreOptions = QString::fromStdString(HelpMessage());
uiOptions = tr("UI options") + ":\n" +
" -lang=<lang> " + tr("Set language, for example \"de_DE\" (default: system locale)") + "\n" +
" -min " + tr("Start minimized") + "\n" +
" -splash " + tr("Show splash screen on startup (default: 1)") + "\n";
setWindowTitle(tr("LiteBar-Qt"));
setTextFormat(Qt::PlainText);
// setMinimumWidth is ignored for QMessageBox so put in nonbreaking spaces to make it wider.
setText(header + QString(QChar(0x2003)).repeated(50));
setDetailedText(coreOptions + "\n" + uiOptions);
}
void HelpMessageBox::printToConsole()
{
// On other operating systems, the expected action is to print the message to the console.
QString strUsage = header + "\n" + coreOptions + "\n" + uiOptions;
fprintf(stderr, "%s", strUsage.toStdString().c_str());
}
void HelpMessageBox::showOrPrint()
{
#if defined(WIN32)
// On windows, show a message box, as there is no stderr/stdout in windowed applications
exec();
#else
// On other operating systems, print help text to console
printToConsole();
#endif
}
} // namespace GUIUtil
| digiwhite/litebar | src/qt/guiutil.cpp | C++ | mit | 13,477 | [
30522,
1001,
2421,
1000,
26458,
21823,
2140,
1012,
1044,
1000,
1001,
2421,
1000,
2978,
3597,
3981,
14141,
8303,
10175,
8524,
4263,
1012,
1044,
1000,
1001,
2421,
1000,
15882,
5302,
9247,
1012,
1044,
1000,
1001,
2421,
1000,
2978,
3597,
2378,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#include "common.h"
#include "disassembler.h"
#include "dllimport.h"
#if USE_DISASSEMBLER
// TODO: Which contracts should be used where? Currently, everything is using LIMITED_METHOD_CONTRACT.
#if USE_COREDISTOOLS_DISASSEMBLER
HMODULE Disassembler::s_libraryHandle = nullptr;
InitDisasm_t *Disassembler::External_InitDisasm = nullptr;
FinishDisasm_t *Disassembler::External_FinishDisasm = nullptr;
DisasmInstruction_t *Disassembler::External_DisasmInstruction = nullptr;
#endif // USE_COREDISTOOLS_DISASSEMBLER
Disassembler::ExternalDisassembler *Disassembler::s_availableExternalDisassembler = nullptr;
#if defined(_TARGET_AMD64_) || defined(_TARGET_X86_)
// static
bool Disassembler::IsRexPrefix(UINT8 potentialRexByte)
{
LIMITED_METHOD_CONTRACT;
#ifdef _TARGET_AMD64_
return (potentialRexByte & 0xf0) == REX_PREFIX_BASE;
#else // !_TARGET_AMD64_
return false;
#endif // _TARGET_AMD64_
}
// static
UINT8 Disassembler::DecodeModFromModRm(UINT8 modRm)
{
LIMITED_METHOD_CONTRACT;
return modRm >> 6;
}
// static
UINT8 Disassembler::DecodeRegOrOpCodeFromModRm(UINT8 modRm)
{
LIMITED_METHOD_CONTRACT;
return (modRm >> 3) & 0x7;
}
// static
UINT8 Disassembler::DecodeRmFromModRm(UINT8 modRm)
{
LIMITED_METHOD_CONTRACT;
return modRm & 0x7;
}
#endif // defined(_TARGET_AMD64_) || defined(_TARGET_X86_)
// static
bool Disassembler::IsAvailable()
{
LIMITED_METHOD_CONTRACT;
#if USE_COREDISTOOLS_DISASSEMBLER
return s_libraryHandle != nullptr;
#else // !USE_COREDISTOOLS_DISASSEMBLER
return true;
#endif // USE_COREDISTOOLS_DISASSEMBLER
}
#if _DEBUG
#define DISPLAYERROR(FMT, ...) wprintf(FMT, __VA_ARGS__)
#else
#define DISPLAYERROR(FMT, ...) (void)0
#endif
namespace
{
HMODULE LoadCoreDisToolsModule(PathString &libPath)
{
LIMITED_METHOD_CONTRACT;
LPCWSTR sysDirectory = GetInternalSystemDirectory();
LPCWSTR libFileName = MAKEDLLNAME(W("coredistools"));
// Look for the coredistools module next to the clr binary
libPath.AppendPrintf(W("%s%s"), sysDirectory, libFileName);
LPCWSTR libraryName = libPath.GetUnicode();
return CLRLoadLibrary(libraryName);
}
}
void Disassembler::StaticInitialize()
{
LIMITED_METHOD_CONTRACT;
#if USE_COREDISTOOLS_DISASSEMBLER
_ASSERTE(!IsAvailable());
PathString libPath;
HMODULE libraryHandle = LoadCoreDisToolsModule(libPath);
if (libraryHandle == nullptr)
return;
External_InitDisasm =
reinterpret_cast<decltype(External_InitDisasm)>(GetProcAddress(libraryHandle, "InitDisasm"));
if (External_InitDisasm == nullptr)
{
DISPLAYERROR(
W("GetProcAddress failed for library '%s', function 'InitDisasm': error %u\n"),
libPath.GetUnicode(),
GetLastError());
return;
}
External_DisasmInstruction =
reinterpret_cast<decltype(External_DisasmInstruction)>(GetProcAddress(libraryHandle, "DisasmInstruction"));
if (External_DisasmInstruction == nullptr)
{
DISPLAYERROR(
W("GetProcAddress failed for library '%s', function 'DisasmInstruction': error %u\n"),
libPath.GetUnicode(),
GetLastError());
return;
}
External_FinishDisasm =
reinterpret_cast<decltype(External_FinishDisasm)>(GetProcAddress(libraryHandle, "FinishDisasm"));
if (External_FinishDisasm == nullptr)
{
DISPLAYERROR(
W("GetProcAddress failed for library '%s', function 'FinishDisasm': error %u\n"),
libPath.GetUnicode(),
GetLastError());
return;
}
// Set this last to indicate successful load of the library and all exports
s_libraryHandle = libraryHandle;
_ASSERTE(IsAvailable());
#endif // USE_COREDISTOOLS_DISASSEMBLER
}
// static
void Disassembler::StaticClose()
{
LIMITED_METHOD_CONTRACT;
if (!IsAvailable())
{
return;
}
#if USE_COREDISTOOLS_DISASSEMBLER
CLRFreeLibrary(s_libraryHandle);
s_libraryHandle = nullptr;
#endif
}
Disassembler::Disassembler()
{
LIMITED_METHOD_CONTRACT;
_ASSERTE(IsAvailable());
// TODO: Is it ok to save and reuse an instance of the LLVM-based disassembler? It may later be used from a different
// thread, and it may be deleted from a different thread than the one from which it was created.
// Try to get an external disassembler that is already available for use before creating one
ExternalDisassembler *externalDisassembler =
FastInterlockExchangePointer(&s_availableExternalDisassembler, static_cast<ExternalDisassembler *>(nullptr));
if (externalDisassembler == nullptr)
{
#if USE_COREDISTOOLS_DISASSEMBLER
// First parameter:
// - Empty string for the current architecture
// - A string of the form "x86_64-pc-win32"
externalDisassembler = External_InitDisasm(Target_Host);
#elif USE_MSVC_DISASSEMBLER
#ifdef _TARGET_X86_
externalDisassembler = ExternalDisassembler::PdisNew(ExternalDisassembler::distX86);
#elif defined(_TARGET_AMD64_)
externalDisassembler = ExternalDisassembler::PdisNew(ExternalDisassembler::distX8664);
#endif // defined(_TARGET_X86_) || defined(_TARGET_AMD64_)
#endif // USE_COREDISTOOLS_DISASSEMBLER || USE_MSVC_DISASSEMBLER
}
_ASSERTE(externalDisassembler != nullptr);
m_externalDisassembler = externalDisassembler;
}
Disassembler::~Disassembler()
{
LIMITED_METHOD_CONTRACT;
_ASSERTE(IsAvailable());
// Save the external disassembler for future use. We only save one instance, so delete a previously saved one.
ExternalDisassembler *externalDisassemblerToDelete =
FastInterlockExchangePointer(&s_availableExternalDisassembler, m_externalDisassembler);
if (externalDisassemblerToDelete == nullptr)
{
return;
}
#if USE_COREDISTOOLS_DISASSEMBLER
External_FinishDisasm(externalDisassemblerToDelete);
#elif USE_MSVC_DISASSEMBLER
delete externalDisassemblerToDelete;
#endif // USE_COREDISTOOLS_DISASSEMBLER || USE_MSVC_DISASSEMBLER
}
SIZE_T Disassembler::DisassembleInstruction(const UINT8 *code, SIZE_T codeLength, InstructionType *instructionTypeRef) const
{
LIMITED_METHOD_CONTRACT;
_ASSERTE(IsAvailable());
#if USE_COREDISTOOLS_DISASSEMBLER
SIZE_T instructionLength = External_DisasmInstruction(m_externalDisassembler, code, code, codeLength);
#elif USE_MSVC_DISASSEMBLER
SIZE_T instructionLength =
m_externalDisassembler->CbDisassemble(reinterpret_cast<ExternalDisassembler::ADDR>(code), code, codeLength);
#endif // USE_COREDISTOOLS_DISASSEMBLER || USE_MSVC_DISASSEMBLER
_ASSERTE(instructionLength <= codeLength);
if (instructionTypeRef != nullptr)
{
if (instructionLength == 0)
{
*instructionTypeRef = InstructionType::Unknown;
}
else
{
#if USE_COREDISTOOLS_DISASSEMBLER
*instructionTypeRef = DetermineInstructionType(code, instructionLength);
#elif USE_MSVC_DISASSEMBLER
*instructionTypeRef = DetermineInstructionType(m_externalDisassembler->Trmt());
#endif // USE_COREDISTOOLS_DISASSEMBLER || USE_MSVC_DISASSEMBLER
}
}
return instructionLength;
}
// static
InstructionType Disassembler::DetermineInstructionType(
#if USE_COREDISTOOLS_DISASSEMBLER
const UINT8 *instructionCode, SIZE_T instructionCodeLength
#elif USE_MSVC_DISASSEMBLER
ExternalDisassembler::TRMT terminationType
#endif // USE_COREDISTOOLS_DISASSEMBLER || USE_MSVC_DISASSEMBLER
)
{
LIMITED_METHOD_CONTRACT;
#if USE_COREDISTOOLS_DISASSEMBLER
_ASSERTE(instructionCodeLength != 0);
SIZE_T i = 0;
if (Disassembler::IsRexPrefix(instructionCode[i]))
{
++i;
}
switch (instructionCode[i])
{
case 0xe8: // call near rel
#ifdef _TARGET_X86_
case 0x9a: // call far ptr
#endif // _TARGET_X86_
return InstructionType::Call_DirectUnconditional;
case 0xff:
++i;
if (i >= instructionCodeLength)
{
break;
}
switch (Disassembler::DecodeRegOrOpCodeFromModRm(instructionCode[i]))
{
case 2: // call near r/m
case 3: // call far m
return InstructionType::Call_IndirectUnconditional;
case 4: // jmp near r/m
case 5: // jmp far m
return InstructionType::Branch_IndirectUnconditional;
}
break;
}
#elif USE_MSVC_DISASSEMBLER
switch (terminationType)
{
case ExternalDisassembler::trmtCall:
return InstructionType::Call_DirectUnconditional;
case ExternalDisassembler::trmtCallInd:
return InstructionType::Call_IndirectUnconditional;
case ExternalDisassembler::trmtBraInd:
return InstructionType::Branch_IndirectUnconditional;
}
#endif // USE_COREDISTOOLS_DISASSEMBLER || USE_MSVC_DISASSEMBLER
return InstructionType::Unknown;
}
#endif // USE_DISASSEMBLER
| poizan42/coreclr | src/vm/disassembler.cpp | C++ | mit | 9,333 | [
30522,
1013,
1013,
7000,
2000,
1996,
1012,
5658,
3192,
2104,
2028,
2030,
2062,
10540,
1012,
1013,
1013,
1996,
1012,
5658,
3192,
15943,
2023,
5371,
2000,
2017,
2104,
1996,
10210,
6105,
1012,
1013,
1013,
2156,
1996,
6105,
5371,
1999,
1996,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qtextcodec.cpp -->
<title>Qt 4.8: List of All Members for QTextDecoder</title>
<link rel="stylesheet" type="text/css" href="style/style.css" />
<script src="scripts/jquery.js" type="text/javascript"></script>
<script src="scripts/functions.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="style/superfish.css" />
<link rel="stylesheet" type="text/css" href="style/narrow.css" />
<!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->
<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>
</head>
<body class="" onload="CheckEmptyAndLoadList();">
<div class="header" id="qtdocheader">
<div class="content">
<div id="nav-logo">
<a href="index.html">Home</a></div>
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
<div id="narrowsearch"></div>
<div id="nav-topright">
<ul>
<li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
<li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
<li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
DOC</a></li>
<li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
</ul>
</div>
<div id="shortCut">
<ul>
<li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
<li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS </a></li>
</ul>
</div>
<ul class="sf-menu" id="narrowmenu">
<li><a href="#">API Lookup</a>
<ul>
<li><a href="classes.html">Class index</a></li>
<li><a href="functions.html">Function index</a></li>
<li><a href="modules.html">Modules</a></li>
<li><a href="namespaces.html">Namespaces</a></li>
<li><a href="qtglobal.html">Global Declarations</a></li>
<li><a href="qdeclarativeelements.html">QML elements</a></li>
</ul>
</li>
<li><a href="#">Qt Topics</a>
<ul>
<li><a href="qt-basic-concepts.html">Programming with Qt</a></li>
<li><a href="qtquick.html">Device UIs & Qt Quick</a></li>
<li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>
<li><a href="supported-platforms.html">Supported Platforms</a></li>
<li><a href="technology-apis.html">Qt and Key Technologies</a></li>
<li><a href="best-practices.html">How-To's and Best Practices</a></li>
</ul>
</li>
<li><a href="#">Examples</a>
<ul>
<li><a href="all-examples.html">Examples</a></li>
<li><a href="tutorials.html">Tutorials</a></li>
<li><a href="demos.html">Demos</a></li>
<li><a href="qdeclarativeexamples.html">QML Examples</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="wrapper">
<div class="hd">
<span></span>
</div>
<div class="bd group">
<div class="sidebar">
<div class="searchlabel">
Search index:</div>
<div class="search" id="sidebarsearch">
<form id="qtdocsearch" action="" onsubmit="return false;">
<fieldset>
<input type="text" name="searchstring" id="pageType" value="" />
<div id="resultdialog">
<a href="#" id="resultclose">Close</a>
<p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p>
<p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span> results:</p>
<ul id="resultlist" class="all">
</ul>
</div>
</fieldset>
</form>
</div>
<div class="box first bottombar" id="lookup">
<h2 title="API Lookup"><span></span>
API Lookup</h2>
<div id="list001" class="list">
<ul id="ul001" >
<li class="defaultLink"><a href="classes.html">Class index</a></li>
<li class="defaultLink"><a href="functions.html">Function index</a></li>
<li class="defaultLink"><a href="modules.html">Modules</a></li>
<li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
<li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
<li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
</ul>
</div>
</div>
<div class="box bottombar" id="topics">
<h2 title="Qt Topics"><span></span>
Qt Topics</h2>
<div id="list002" class="list">
<ul id="ul002" >
<li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li>
<li class="defaultLink"><a href="qtquick.html">Device UIs & Qt Quick</a></li>
<li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li>
<li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>
<li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li>
<li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li>
</ul>
</div>
</div>
<div class="box" id="examples">
<h2 title="Examples"><span></span>
Examples</h2>
<div id="list003" class="list">
<ul id="ul003">
<li class="defaultLink"><a href="all-examples.html">Examples</a></li>
<li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
<li class="defaultLink"><a href="demos.html">Demos</a></li>
<li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
</ul>
</div>
</div>
</div>
<div class="wrap">
<div class="toolbar">
<div class="breadcrumb toolblock">
<ul>
<li class="first"><a href="index.html">Home</a></li>
<!-- Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtcore.html">QtCore</a></li>
<li>QTextDecoder</li>
</ul>
</div>
<div class="toolbuttons toolblock">
<ul>
<li id="smallA" class="t_button">A</li>
<li id="medA" class="t_button active">A</li>
<li id="bigA" class="t_button">A</li>
<li id="print" class="t_button"><a href="javascript:this.print();">
<span>Print</span></a></li>
</ul>
</div>
</div>
<div class="content mainContent">
<h1 class="title">List of All Members for QTextDecoder</h1>
<p>This is the complete list of members for <a href="qtextdecoder.html">QTextDecoder</a>, including inherited members.</p>
<ul>
<li class="fn"><span class="name"><b><a href="qtextdecoder.html#QTextDecoder">QTextDecoder</a></b></span> ( const QTextCodec * )</li>
<li class="fn"><span class="name"><b><a href="qtextdecoder.html#QTextDecoder-2">QTextDecoder</a></b></span> ( const QTextCodec *, QTextCodec::ConversionFlags )</li>
<li class="fn"><span class="name"><b><a href="qtextdecoder.html#dtor.QTextDecoder">~QTextDecoder</a></b></span> ()</li>
<li class="fn"><span class="name"><b><a href="qtextdecoder.html#toUnicode">toUnicode</a></b></span> ( const char *, int ) : QString</li>
<li class="fn"><span class="name"><b><a href="qtextdecoder.html#toUnicode-2">toUnicode</a></b></span> ( QString *, const char *, int )</li>
<li class="fn"><span class="name"><b><a href="qtextdecoder.html#toUnicode-3">toUnicode</a></b></span> ( const QByteArray & ) : QString</li>
</ul>
</div>
</div>
</div>
<div class="ft">
<span></span>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2012 Digia Plc and/or its
subsidiaries. Documentation contributions included herein are the copyrights of
their respective owners.</p>
<br />
<p>
The documentation provided herein is licensed under the terms of the
<a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
License version 1.3</a> as published by the Free Software Foundation.</p>
<p>
Documentation sources may be obtained from <a href="http://www.qt-project.org">
www.qt-project.org</a>.</p>
<br />
<p>
Digia, Qt and their respective logos are trademarks of Digia Plc
in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. <a title="Privacy Policy"
href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
<script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>
| sicily/qt4.8.4 | doc/html/qtextdecoder-members.html | HTML | lgpl-2.1 | 10,118 | [
30522,
1026,
1029,
20950,
2544,
1027,
1000,
1015,
1012,
1014,
1000,
17181,
1027,
1000,
21183,
2546,
1011,
1022,
1000,
1029,
1028,
1026,
999,
9986,
13874,
16129,
2270,
1000,
1011,
1013,
1013,
1059,
2509,
2278,
1013,
1013,
26718,
2094,
1060,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/**********************************************************************
Audacity: A Digital Audio Editor
VoiceKey.cpp
?? Dominic Mazzoni
?? Shane Muller
*******************************************************************//*!
\class VoiceKey
\brief
This implements a voice key, detecting either the next "ON"
or "OFF" point
*//*******************************************************************/
#include "Audacity.h"
#include "VoiceKey.h"
#include <wx/string.h>
#include <wx/msgdlg.h>
#include <math.h>
#include <stdio.h>
#include <wx/filedlg.h>
#include <wx/msgdlg.h>
#include <wx/textfile.h>
#include <wx/intl.h>
#include <iostream>
#include "WaveTrack.h"
using std::cout;
using std::endl;
VoiceKey::VoiceKey()
{
mWindowSize = 0.01; //size of analysis window in seconds
mEnergyMean = .0006; // reasonable initial levels assuming sampling rate of
mEnergySD = .0002; // 44100 hertz
mSignChangesMean = .08;
mSignChangesSD= .02;
mDirectionChangesMean = .25;
mDirectionChangesSD = .2;
AdjustThreshold(2);
mSilentWindowSize = .05; //Amount of time (in seconds) below threshold to call it silence
mSignalWindowSize = .05; //Amount of time (in seconds) above threshold to call it signal
mUseEnergy = true;
mUseSignChangesLow = false;
mUseSignChangesHigh = false;
mUseDirectionChangesLow = false;
mUseDirectionChangesHigh = false;
};
VoiceKey::~VoiceKey()
{
};
//---------------------------------------------------------------------------
// VoiceKey::On/Off Forward/Backward
// This operates in two phases:
// First, you take chunks of samples that are WindowSize big.
// If you have a run of them where something passes the threshold for SignalWindowSize seconds,
// you return to the last empty block and scan forward one sample at a time until you find the
// starting point of the speech.
//Move forward to find an ON region.
sampleCount VoiceKey::OnForward (
const WaveTrack & t, sampleCount start, sampleCount len)
{
if((mWindowSize) >= (len + 10).as_double() ){
/* i18n-hint: Voice key is an experimental/incomplete feature that
is used to navigate in vocal recordings, to move forwards and
backwards by words. So 'key' is being used in the sense of an index.
This error message means that you've selected too short
a region of audio to be able to use this feature.*/
wxMessageBox(_("Selection is too small to use voice key."));
return start;
}
else {
//Change the millisecond-based parameters into sample-based parameters
double rate = t.GetRate(); //Translates seconds to samples
size_t WindowSizeInt = (rate * mWindowSize); //Size of window to examine
size_t SignalWindowSizeInt = (rate * mSignalWindowSize); //This much signal is necessary to trip key
auto samplesleft = len - WindowSizeInt; //Indexes the number of samples remaining in the selection
auto lastsubthresholdsample = start; //start this off at the selection start
// keeps track of the sample number of the last sample to not exceed the threshold
int blockruns=0; //keeps track of the number of consecutive above-threshold blocks
//This loop goes through the selection a block at a time. If a long enough run
//of above-threshold blocks occur, we return to the last sub-threshold block and
//go through one sample at a time.
//If there are fewer than 10 samples leftover, don't bother.
for(auto i = start; samplesleft >= 10;
i += (WindowSizeInt - 1) , samplesleft -= (WindowSizeInt - 1)) {
//Set blocksize so that it is the right size
const auto blocksize = limitSampleBufferSize( WindowSizeInt, samplesleft);
//Test whether we are above threshold (the number of stats)
if(AboveThreshold(t,i,blocksize))
{
blockruns++; //Hit
} else {
blockruns=0; //Miss--start over
lastsubthresholdsample = i;
}
//If the blockrun is long enough, break out of the loop early:
if(blockruns > mSignalWindowSize/mWindowSize)
break;
}
//Now, if we broke out early (samplesleft > 10), go back to the lastsubthresholdsample and look more carefully
if(samplesleft > 10) {
//Calculate how many to scan through--we only have to go through (at most)
//the first window + 1 samples--but we need another window samples to draw from.
size_t remaining = 2*WindowSizeInt+1;
//To speed things up, create a local buffer to store things in, to avoid the costly t.Get();
//Only go through the first SignalWindowSizeInt samples, and choose the first that trips the key.
Floats buffer{ remaining };
t.Get((samplePtr)buffer.get(), floatSample,
lastsubthresholdsample, remaining);
//Initialize these trend markers atrend and ztrend. They keep track of the
//up/down trends at the start and end of the evaluation window.
int atrend = sgn(buffer[1]-buffer[0]);
int ztrend = sgn(buffer[WindowSizeInt+1]-buffer[WindowSizeInt]);
double erg=0;
double sc=0;
double dc=0;
//Get initial test statistic values.
if(mUseEnergy)
erg = TestEnergy(t, lastsubthresholdsample, WindowSizeInt);
if(mUseSignChangesLow || mUseSignChangesHigh)
sc = TestSignChanges(t,lastsubthresholdsample, WindowSizeInt);
if(mUseDirectionChangesLow || mUseDirectionChangesHigh)
dc = TestDirectionChanges(t,lastsubthresholdsample,WindowSizeInt);
//Now, go through the sound again, sample by sample.
wxASSERT(WindowSizeInt < SignalWindowSizeInt);
size_t i;
for(i = 0; i + WindowSizeInt < SignalWindowSizeInt; i++) {
int tests = 0;
int testThreshold = 0;
//Update the test statistics
if(mUseEnergy)
{
TestEnergyUpdate(erg, WindowSizeInt,buffer[i],buffer[i+WindowSizeInt+1]);
tests += (int)(erg>mThresholdEnergy);
testThreshold++;
}
if(mUseSignChangesLow)
{
TestSignChangesUpdate(sc,WindowSizeInt,buffer[i],buffer[i+1],buffer[i+WindowSizeInt],buffer[i+WindowSizeInt+1]);
tests += (int)(sc < mThresholdSignChangesLower);
testThreshold++;
}
if(mUseSignChangesHigh)
{
TestSignChangesUpdate(sc,WindowSizeInt,buffer[i],buffer[i+1],buffer[i+WindowSizeInt],buffer[i+WindowSizeInt+1]);
tests += (int)(sc > mThresholdSignChangesUpper);
testThreshold++;
}
if(mUseDirectionChangesLow)
{
TestDirectionChangesUpdate(dc,WindowSizeInt,atrend,buffer[i],buffer[i+1],ztrend,buffer[i+WindowSizeInt],buffer[i+WindowSizeInt+1]);
tests += (int)(dc < mThresholdDirectionChangesLower);
testThreshold++;
}
if(mUseDirectionChangesHigh)
{
TestDirectionChangesUpdate(dc,WindowSizeInt,atrend,buffer[i],buffer[i+1],ztrend,buffer[i+WindowSizeInt],buffer[i+WindowSizeInt+1]);
tests += (int)(dc > mThresholdDirectionChangesUpper);
testThreshold++;
}
if(tests >= testThreshold)
{ //Finish off on the first hit
break;
}
}
//When we get here, i+lastsubthresholdsample is the best guess for where the word starts
return i + lastsubthresholdsample;
}
else {
//If we failed to find anything, return the start position
return start ;
}
}
}
//Move backward from end to find an ON region.
sampleCount VoiceKey::OnBackward (
const WaveTrack & t, sampleCount end, sampleCount len)
{
if((mWindowSize) >= (len + 10).as_double() ){
wxMessageBox(_("Selection is too small to use voice key."));
return end;
}
else {
//Change the millisecond-based parameters into sample-based parameters
double rate = t.GetRate(); //Translates seconds to samples
size_t WindowSizeInt = (rate * mWindowSize); //Size of window to examine
//unsigned int SilentWindowSizeInt = (unsigned int)(rate * mSilentWindowSize); //This much signal is necessary to trip key
auto samplesleft = len - WindowSizeInt; //Indexes the number of samples remaining in the selection
auto lastsubthresholdsample = end; //start this off at the end
// keeps track of the sample number of the last sample to not exceed the threshold
int blockruns=0; //keeps track of the number of consecutive above-threshold blocks
//This loop goes through the selection a block at a time in reverse order. If a long enough run
//of above-threshold blocks occur, we return to the last sub-threshold block and
//go through one sample at a time.
//If there are fewer than 10 samples leftover, don't bother.
for(auto i = end - WindowSizeInt; samplesleft >= 10;
i -= (WindowSizeInt - 1) , samplesleft -= (WindowSizeInt - 1)) {
//Set blocksize so that it is the right size
const auto blocksize = limitSampleBufferSize( WindowSizeInt, samplesleft);
//Test whether we are above threshold
if(AboveThreshold(t,i,blocksize))
{
blockruns++; //Hit
}
else
{
blockruns=0; //Miss--start over
lastsubthresholdsample = i+WindowSizeInt;
}
//If the blockrun is long enough, break out of the loop early:
if(blockruns > mSilentWindowSize/mWindowSize)
break;
}
//Now, if we broke out early (samplesleft > 10), go back to the lastsubthresholdsample and look more carefully
if(samplesleft > 10) {
//Calculate how many to scan through--we only have to go through (at most)
//the first window + 1 samples--but we need another window samples to draw from.
size_t remaining = 2*WindowSizeInt+1;
//To speed things up, create a local buffer to store things in, to avoid the costly t.Get();
//Only go through the first mSilentWindowSizeInt samples, and choose the first that trips the key.
Floats buffer{ remaining };
t.Get((samplePtr)buffer.get(), floatSample,
lastsubthresholdsample - remaining, remaining);
//Initialize these trend markers atrend and ztrend. They keep track of the
//up/down trends at the start and end of the evaluation window.
int atrend = sgn(buffer[remaining - 2]-buffer[remaining - 1]);
int ztrend = sgn(buffer[remaining - WindowSizeInt - 2] -
buffer[remaining - WindowSizeInt - 2]);
double erg=0;
double sc = 0;
double dc = 0;
//Get initial test statistic values.
if(mUseEnergy)
erg = TestEnergy(t, lastsubthresholdsample, WindowSizeInt);
if(mUseSignChangesLow || mUseSignChangesHigh)
sc = TestSignChanges(t,lastsubthresholdsample, WindowSizeInt);
if(mUseDirectionChangesLow || mUseDirectionChangesHigh)
dc = TestDirectionChanges(t,lastsubthresholdsample,WindowSizeInt);
//Now, go through the sound again, sample by sample.
size_t i;
for(i = remaining - 1; i > WindowSizeInt; i--) {
int tests = 0;
int testThreshold = 0;
//Update the test statistics
if(mUseEnergy)
{
TestEnergyUpdate(erg, WindowSizeInt,buffer[i],buffer[i+WindowSizeInt+1]);
tests += (int)(erg>mThresholdEnergy);
testThreshold++;
}
if(mUseSignChangesLow)
{
TestSignChangesUpdate(sc,WindowSizeInt,buffer[i],buffer[i+1],buffer[i+WindowSizeInt],buffer[i+WindowSizeInt+1]);
tests += (int)(sc < mThresholdSignChangesLower);
testThreshold++;
}
if(mUseSignChangesHigh)
{
TestSignChangesUpdate(sc,WindowSizeInt,buffer[i],buffer[i+1],buffer[i+WindowSizeInt],buffer[i+WindowSizeInt+1]);
tests += (int)(sc > mThresholdSignChangesUpper);
testThreshold++;
}
if(mUseDirectionChangesLow)
{
TestDirectionChangesUpdate(dc,WindowSizeInt,atrend,buffer[i],buffer[i+1],ztrend,buffer[i+WindowSizeInt],buffer[i+WindowSizeInt+1]);
tests += (int)(dc < mThresholdDirectionChangesLower);
testThreshold++;
}
if(mUseDirectionChangesHigh)
{
TestDirectionChangesUpdate(dc,WindowSizeInt,atrend,buffer[i],buffer[i+1],ztrend,buffer[i+WindowSizeInt],buffer[i+WindowSizeInt+1]);
tests += (int)(dc > mThresholdDirectionChangesUpper);
testThreshold++;
}
if(tests >= testThreshold)
{ //Finish off on the first hit
break;
}
}
//When we get here, i+lastsubthresholdsample is the best guess for where the word starts
return lastsubthresholdsample - remaining + i;
}
else {
//If we failed to find anything, return the start position
return end ;
}
}
}
//Move froward from the start to find an OFF region.
sampleCount VoiceKey::OffForward (
const WaveTrack & t, sampleCount start, sampleCount len)
{
if((mWindowSize) >= (len + 10).as_double() ){
wxMessageBox(_("Selection is too small to use voice key."));
return start;
}
else {
//Change the millisecond-based parameters into sample-based parameters
double rate = t.GetRate(); //Translates seconds to samples
unsigned int WindowSizeInt = (unsigned int)(rate * mWindowSize); //Size of window to examine
unsigned int SilentWindowSizeInt = (unsigned int)(rate * mSilentWindowSize); //This much signal is necessary to trip key
sampleCount samplesleft ( len.as_double() - WindowSizeInt ); //Indexes the number of samples remaining in the selection
auto lastsubthresholdsample = start; //start this off at the selection start
// keeps track of the sample number of the last sample to not exceed the threshold
int blockruns=0; //keeps track of the number of consecutive above-threshold blocks
//This loop goes through the selection a block at a time. If a long enough run
//of above-threshold blocks occur, we return to the last sub-threshold block and
//go through one sample at a time.
//If there are fewer than 10 samples leftover, don't bother.
for(auto i = start; samplesleft >= 10;
i += (WindowSizeInt - 1) , samplesleft -= (WindowSizeInt - 1)) {
//Set blocksize so that it is the right size
const auto blocksize = limitSampleBufferSize( WindowSizeInt, samplesleft);
if(!AboveThreshold(t,i,blocksize))
{
blockruns++; //Hit
}
else
{
blockruns=0; //Above threshold--start over
lastsubthresholdsample = i;
}
//If the blockrun is long enough, break out of the loop early:
if(blockruns > mSilentWindowSize/mWindowSize)
break;
}
//Now, if we broke out early (samplesleft > 10), go back to the lastsubthresholdsample and look more carefully
if(samplesleft > 10) {
//Calculate how many to scan through--we only have to go through (at most)
//the first window + 1 samples--but we need another window samples to draw from.
size_t remaining = 2*WindowSizeInt+1;
//To speed things up, create a local buffer to store things in, to avoid the costly t.Get();
//Only go through the first SilentWindowSizeInt samples, and choose the first that trips the key.
Floats buffer{ remaining };
t.Get((samplePtr)buffer.get(), floatSample,
lastsubthresholdsample, remaining);
//Initialize these trend markers atrend and ztrend. They keep track of the
//up/down trends at the start and end of the evaluation window.
int atrend = sgn(buffer[1]-buffer[0]);
int ztrend = sgn(buffer[WindowSizeInt+1]-buffer[WindowSizeInt]);
double erg=0;
double sc=0;
double dc=0;
//Get initial test statistic values.
if(mUseEnergy)
erg = TestEnergy(t, lastsubthresholdsample, WindowSizeInt);
if(mUseSignChangesLow || mUseSignChangesHigh)
sc = TestSignChanges(t,lastsubthresholdsample, WindowSizeInt);
if(mUseDirectionChangesLow || mUseDirectionChangesHigh)
dc = TestDirectionChanges(t,lastsubthresholdsample,WindowSizeInt);
//Now, go through the sound again, sample by sample.
size_t i;
for(i = 0; i < SilentWindowSizeInt - WindowSizeInt; i++) {
int tests = 0;
int testThreshold = 0;
//Update the test statistics
if(mUseEnergy)
{
TestEnergyUpdate(erg, WindowSizeInt,buffer[i],buffer[i+WindowSizeInt+1]);
tests += (int)(erg>mThresholdEnergy);
testThreshold++;
}
if(mUseSignChangesLow)
{
TestSignChangesUpdate(sc,WindowSizeInt,buffer[i],buffer[i+1],buffer[i+WindowSizeInt],buffer[i+WindowSizeInt+1]);
tests += (int)(sc < mThresholdSignChangesLower);
testThreshold++;
}
if(mUseSignChangesHigh)
{
TestSignChangesUpdate(sc,WindowSizeInt,buffer[i],buffer[i+1],buffer[i+WindowSizeInt],buffer[i+WindowSizeInt+1]);
tests += (int)(sc > mThresholdSignChangesUpper);
testThreshold++;
}
if(mUseDirectionChangesLow)
{
TestDirectionChangesUpdate(dc,WindowSizeInt,atrend,buffer[i],buffer[i+1],ztrend,buffer[i+WindowSizeInt],buffer[i+WindowSizeInt+1]);
tests += (int)(dc < mThresholdDirectionChangesLower);
testThreshold++;
}
if(mUseDirectionChangesHigh)
{
TestDirectionChangesUpdate(dc,WindowSizeInt,atrend,buffer[i],buffer[i+1],ztrend,buffer[i+WindowSizeInt],buffer[i+WindowSizeInt+1]);
tests += (int)(dc > mThresholdDirectionChangesUpper);
testThreshold++;
}
if(tests < testThreshold)
{ //Finish off on the first below-threshold block
break;
}
}
//When we get here, i+lastsubthresholdsample is the best guess for where the word starts
return i + lastsubthresholdsample;
}
else {
//If we failed to find anything, return the start position
return start ;
}
}
}
//Move backward from the end to find an OFF region
sampleCount VoiceKey::OffBackward (
const WaveTrack & t, sampleCount end, sampleCount len)
{
if((mWindowSize) >= (len + 10).as_double() ){
wxMessageBox(_("Selection is too small to use voice key."));
return end;
}
else {
//Change the millisecond-based parameters into sample-based parameters
double rate = t.GetRate(); //Translates seconds to samples
unsigned int WindowSizeInt = (unsigned int)(rate * mWindowSize); //Size of window to examine
//unsigned int SilentWindowSizeInt = (unsigned int)(rate * mSilentWindowSize); //This much signal is necessary to trip key
auto samplesleft = len - WindowSizeInt; //Indexes the number of samples remaining in the selection
auto lastsubthresholdsample = end; //start this off at the end
// keeps track of the sample number of the last sample to not exceed the threshold
int blockruns=0; //keeps track of the number of consecutive above-threshold blocks
//This loop goes through the selection a block at a time in reverse order. If a long enough run
//of above-threshold blocks occur, we return to the last sub-threshold block and
//go through one sample at a time.
//If there are fewer than 10 samples leftover, don't bother.
for(auto i = end - WindowSizeInt; samplesleft >= 10;
i -= (WindowSizeInt - 1), samplesleft -= (WindowSizeInt -1 )) {
//Set blocksize so that it is the right size
const auto blocksize = limitSampleBufferSize( WindowSizeInt, samplesleft);
if(!AboveThreshold(t,i,blocksize))
{
blockruns++; //Hit
}
else
{
blockruns=0; //Miss--start over
lastsubthresholdsample = i+WindowSizeInt;
}
//If the blockrun is long enough, break out of the loop early:
if(blockruns > mSilentWindowSize/mWindowSize)
break;
}
//Now, if we broke out early (samplesleft > 10), go back to the lastsubthresholdsample and look more carefully
if(samplesleft > 10) {
//Calculate how many to scan through--we only have to go through (at most)
//the first window + 1 samples--but we need another window samples to draw from.
const size_t remaining = 2*WindowSizeInt+1;
//To speed things up, create a local buffer to store things in, to avoid the costly t.Get();
//Only go through the first SilentWindowSizeInt samples, and choose the first that trips the key.
Floats buffer{ remaining };
t.Get((samplePtr)buffer.get(), floatSample,
lastsubthresholdsample - remaining, remaining);
//Initialize these trend markers atrend and ztrend. They keep track of the
//up/down trends at the start and end of the remaining window.
int atrend = sgn(buffer[remaining - 2] - buffer[remaining - 1]);
int ztrend =
sgn(buffer[remaining - WindowSizeInt - 2] -
buffer[remaining - WindowSizeInt - 2]);
double erg=0;
double sc=0;
double dc=0;
//Get initial test statistic values.
if(mUseEnergy)
erg = TestEnergy(t, lastsubthresholdsample, WindowSizeInt);
if(mUseSignChangesLow || mUseSignChangesHigh)
sc = TestSignChanges(t,lastsubthresholdsample, WindowSizeInt);
if(mUseDirectionChangesLow || mUseDirectionChangesHigh)
dc = TestDirectionChanges(t,lastsubthresholdsample,WindowSizeInt);
//Now, go through the sound again, sample by sample.
size_t i;
for(i = remaining - 1; i > WindowSizeInt; i--) {
int tests = 0;
int testThreshold = 0;
//Update the test statistics
if(mUseEnergy)
{
TestEnergyUpdate(erg, WindowSizeInt,buffer[i],buffer[i+WindowSizeInt+1]);
tests += (int)(erg>mThresholdEnergy);
testThreshold++;
}
if(mUseSignChangesLow)
{
TestSignChangesUpdate(sc,WindowSizeInt,buffer[i],buffer[i+1],buffer[i+WindowSizeInt],buffer[i+WindowSizeInt+1]);
tests += (int)(sc < mThresholdSignChangesLower);
testThreshold++;
}
if(mUseSignChangesHigh)
{
TestSignChangesUpdate(sc,WindowSizeInt,buffer[i],buffer[i+1],buffer[i+WindowSizeInt],buffer[i+WindowSizeInt+1]);
tests += (int)(sc > mThresholdSignChangesUpper);
testThreshold++;
}
if(mUseDirectionChangesLow)
{
TestDirectionChangesUpdate(dc,WindowSizeInt,atrend,buffer[i],buffer[i+1],ztrend,buffer[i+WindowSizeInt],buffer[i+WindowSizeInt+1]);
tests += (int)(dc < mThresholdDirectionChangesLower);
testThreshold++;
}
if(mUseDirectionChangesHigh)
{
TestDirectionChangesUpdate(dc,WindowSizeInt,atrend,buffer[i],buffer[i+1],ztrend,buffer[i+WindowSizeInt],buffer[i+WindowSizeInt+1]);
tests += (int)(dc > mThresholdDirectionChangesUpper);
testThreshold++;
}
if(tests < testThreshold)
{ //Finish off on the first hit
break;
}
}
//When we get here, i+lastsubthresholdsample is the best guess for where the word starts
return lastsubthresholdsample - remaining + i;
}
else {
//If we failed to find anything, return the start position
return end ;
}
}
}
//This tests whether a specified block region is above or below threshold.
bool VoiceKey::AboveThreshold(
const WaveTrack & t, sampleCount start, sampleCount len)
{
double erg=0;
double sc=0;
double dc=0; //These store three statistics: energy, signchanges, and directionchanges
int tests =0; //Keeps track of how many statistics surpass the threshold.
int testThreshold=0; //Keeps track of the threshold.
//Calculate the test statistics
if(mUseEnergy)
{
testThreshold++;
erg = TestEnergy(t, start,len);
tests +=(int)(erg > mThresholdEnergy);
#if 0
std::cout << "Energy: " << erg << " " <<mThresholdEnergy << std::endl;
#endif
}
if(mUseSignChangesLow)
{
testThreshold++;
sc = TestSignChanges(t,start,len);
tests += (int)(sc < mThresholdSignChangesLower);
#if 0
std::cout << "SignChanges: " << sc << " " <<mThresholdSignChangesLower<< " < " << mThresholdSignChangesUpper << std::endl;
#endif
}
if(mUseSignChangesHigh)
{
testThreshold++;
sc = TestSignChanges(t,start,len);
tests += (int)(sc > mThresholdSignChangesUpper);
#if 0
std::cout << "SignChanges: " << sc << " " <<mThresholdSignChangesLower<< " < " << mThresholdSignChangesUpper << std::endl;
#endif
}
if(mUseDirectionChangesLow)
{
testThreshold++;
dc = TestDirectionChanges(t,start,len);
tests += (int)(dc < mThresholdDirectionChangesLower);
#if 0
std::cout << "DirectionChanges: " << dc << " " <<mThresholdDirectionChangesLower<< " < " << mThresholdDirectionChangesUpper << std::endl;
#endif
}
if(mUseDirectionChangesHigh)
{
testThreshold++;
dc = TestDirectionChanges(t,start,len);
tests += (int)(dc > mThresholdDirectionChangesUpper);
#if 0
std::cout << "DirectionChanges: " << dc << " " <<mThresholdDirectionChangesLower<< " < " << mThresholdDirectionChangesUpper << std::endl;
#endif
}
//Test whether we are above threshold (the number of stats)
return (tests >= testThreshold);
}
//This adjusts the threshold. Larger values of t expand the noise region,
//making more things be classified as noise (and requiring a stronger signal).
void VoiceKey::AdjustThreshold(double t)
{
mThresholdAdjustment = t;
mThresholdEnergy = mEnergyMean + mEnergySD * t;
mThresholdSignChangesUpper = mSignChangesMean + mSignChangesSD * t;
mThresholdSignChangesLower = mSignChangesMean - mSignChangesSD * t;
mThresholdDirectionChangesUpper = mDirectionChangesMean + mDirectionChangesSD * t;
mThresholdDirectionChangesLower = mDirectionChangesMean - mDirectionChangesSD * t;
};
//This 'calibrates' the voicekey to noise
void VoiceKey::CalibrateNoise(const WaveTrack & t, sampleCount start, sampleCount len)
{
//To calibrate the noise, we need to scan the sample block just like in the voicekey and
//calculate the mean and standard deviation of the test statistics.
//Then, we set the BaselineThreshold to be one
wxBusyCursor busy;
//initialize some sample statistics: sums of X and X^2
double sumerg, sumerg2;
double sumsc, sumsc2;
double sumdc, sumdc2;
double erg, sc, dc;
//Now, change the millisecond-based parameters into sample-based parameters
//(This depends on WaveTrack t)
double rate = t.GetRate();
unsigned int WindowSizeInt = (unsigned int)(rate * mWindowSize);
// unsigned int SignalWindowSizeInt = (unsigned int)(rate * mSignalWindowSize);
//Get the first test statistics
//Calibrate all of the statistic, because they might be
//changed later.
// if(mUseEnergy)
erg = TestEnergy(t, start, WindowSizeInt);
// if(mUseSignChanges)
sc = TestSignChanges(t,start, WindowSizeInt);
// if(mUseDirectionChanges)
dc = TestDirectionChanges(t,start,WindowSizeInt);
sumerg =0.0;
sumerg2 = 0.0;
sumsc =0.0;
sumsc2 = 0.0;
sumdc =0.0;
sumdc2 =0.0;
// int n = len - WindowSizeInt; //This is how many samples we have
auto samplesleft = len - WindowSizeInt;
int samples=0;
for(auto i = start; samplesleft >= 10;
i += (WindowSizeInt - 1), samplesleft -= (WindowSizeInt -1) ) {
//Take samples chunk-by-chunk.
//Normally, this should be in WindowSizeInt chunks, but at the end (if there are more than 10
//samples left) take a chunk that eats the rest of the samples.
samples++; //Increment the number of samples we have
const auto blocksize = limitSampleBufferSize( WindowSizeInt, samplesleft);
erg = TestEnergy(t, i, blocksize);
sumerg +=(double)erg;
sumerg2 += pow((double)erg,2);
sc = TestSignChanges(t,i, blocksize);
sumsc += (double)sc;
sumsc2 += pow((double)sc,2);
dc = TestDirectionChanges(t,i,blocksize);
sumdc += (double)dc;
sumdc2 += pow((double)dc,2);
}
mEnergyMean = sumerg / samples;
mEnergySD = sqrt(sumerg2/samples - mEnergyMean*mEnergyMean);
mSignChangesMean = sumsc / samples;
mSignChangesSD = sqrt(sumsc2 / samples - mSignChangesMean * mSignChangesMean);
mDirectionChangesMean = sumdc / samples;
mDirectionChangesSD =sqrt(sumdc2 / samples - mDirectionChangesMean * mDirectionChangesMean) ;
wxString text = wxString::Format(_("Calibration Results\n"));
/* i18n-hint: %1.4f is replaced by a number. sd stands for 'Standard Deviations'*/
text += wxString::Format(_("Energy -- mean: %1.4f sd: (%1.4f)\n"),mEnergyMean,mEnergySD);
text+= wxString::Format(_("Sign Changes -- mean: %1.4f sd: (%1.4f)\n"),mSignChangesMean,mSignChangesSD);
text += wxString::Format(_("Direction Changes -- mean: %1.4f sd: (%1.4f)\n"), mDirectionChangesMean, mDirectionChangesSD);
wxMessageDialog{ NULL, text,
wxT("Calibration Complete"),
wxOK | wxICON_INFORMATION,
wxPoint(-1, -1) }
.ShowModal();
AdjustThreshold(mThresholdAdjustment);
}
void VoiceKey::SetKeyType(bool erg, bool scLow , bool scHigh,
bool dcLow, bool dcHigh)
{
mUseEnergy = erg;
mUseSignChangesLow = scLow;
mUseSignChangesHigh = scHigh;
mUseDirectionChangesLow = dcLow;
mUseDirectionChangesHigh = dcHigh;
}
//This might continue over a number of blocks.
double VoiceKey::TestEnergy (
const WaveTrack & t, sampleCount start, sampleCount len)
{
double sum = 1;
auto s = start; //Keep track of start
auto originalLen = len; //Keep track of the length of block to process (its not the length of t)
const auto blockSize = limitSampleBufferSize(
t.GetMaxBlockSize(), len); //Determine size of sampling buffer
Floats buffer{ blockSize }; //Get a sampling buffer
while(len > 0)
{
//Figure out how much to grab
auto block = limitSampleBufferSize ( t.GetBestBlockSize(s), len );
t.Get((samplePtr)buffer.get(), floatSample, s,block); //grab the block;
//Now, go through the block and calculate energy
for(decltype(block) i = 0; i< block; i++)
{
sum += buffer[i]*buffer[i];
}
len -= block;
s += block;
}
return sum / originalLen.as_double();
}
//This will update RMSE by adding one element and subtracting another
void VoiceKey::TestEnergyUpdate (double & prevErg, int len, const float & drop, const float & add)
{
//This is an updating formula for RMSE. It will only recalculate what's changed.
prevErg = prevErg + (double)(fabs(add) - fabs(drop))/len;
}
double VoiceKey::TestSignChanges(
const WaveTrack & t, sampleCount start, sampleCount len)
{
auto s = start; //Keep track of start
auto originalLen = len; //Keep track of the length of block to process (its not the length of t)
const auto blockSize = limitSampleBufferSize(
t.GetMaxBlockSize(), len); //Determine size of sampling buffer
unsigned long signchanges = 1;
int currentsign=0;
Floats buffer{ blockSize }; //Get a sampling buffer
while(len > 0) {
//Figure out how much to grab
auto block = limitSampleBufferSize ( t.GetBestBlockSize(s), len );
t.Get((samplePtr)buffer.get(), floatSample, s, block); //grab the block;
if (len == originalLen)
{
//The first time through, set stuff up special.
currentsign = sgn(buffer[0]);
}
//Now, go through the block and calculate zero crossings
for(decltype(block) i = 0; i< block; i++)
{
if( sgn(buffer[i]) != currentsign)
{
currentsign = sgn(buffer[i]);
signchanges++;
}
}
len -= block;
s += block;
}
return (double)signchanges / originalLen.as_double();
}
void VoiceKey::TestSignChangesUpdate(double & currentsignchanges, int len,
const float & a1,
const float & a2,
const float & z1,
const float & z2)
{
if(sgn(a1)!=sgn(a2)) currentsignchanges -= 1.0/len;
if(sgn(z1)!=sgn(z2)) currentsignchanges += 1.0/len;
}
double VoiceKey::TestDirectionChanges(
const WaveTrack & t, sampleCount start, sampleCount len)
{
auto s = start; //Keep track of start
auto originalLen = len; //Keep track of the length of block to process (its not the length of t)
const auto blockSize = limitSampleBufferSize(
t.GetMaxBlockSize(), len); //Determine size of sampling buffer
unsigned long directionchanges = 1;
float lastval=float(0);
int lastdirection=1;
Floats buffer{ blockSize }; //Get a sampling buffer
while(len > 0) {
//Figure out how much to grab
auto block = limitSampleBufferSize ( t.GetBestBlockSize(s), len );
t.Get((samplePtr)buffer.get(), floatSample, s, block); //grab the block;
if (len == originalLen) {
//The first time through, set stuff up special.
lastval = buffer[0];
}
//Now, go through the block and calculate zero crossings
for(decltype(block) i = 0; i< block; i++){
if( sgn(buffer[i]-lastval) != lastdirection) {
directionchanges++;
lastdirection = sgn(buffer[i] - lastval);
}
lastval = buffer[i];
}
len -= block;
s += block;
}
return (double)directionchanges/originalLen.as_double();
}
// This method does an updating by looking at the trends
// This will change currentdirections and atrend/trend, so be warned.
void VoiceKey::TestDirectionChangesUpdate(double & currentdirectionchanges, int len,
int & atrend, const float & a1, const float & a2,
int & ztrend, const float & z1, const float & z2)
{
if(sgn(a2 - a1)!= atrend ) {
//Here, the direction shifted for the item we're dropping.
currentdirectionchanges -= 1.0/len;
atrend = sgn(a2-a1);
}
if(sgn(z2 - z1)!= ztrend){
//Here, the direction shifts when we add an item
currentdirectionchanges += 1.0/len;
ztrend = sgn(z2-z1);
}
}
| windinthew/audacity | src/VoiceKey.cpp | C++ | gpl-2.0 | 37,484 | [
30522,
1013,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package com.novaviper.tetracraft.common.init;
import net.minecraft.item.Item;
import com.novaviper.cryolib.lib.Registers;
import com.novaviper.tetracraft.common.item.ItemContinousBow;
import com.novaviper.tetracraft.common.item.ItemModGenericItem;
import com.novaviper.tetracraft.lib.ModReference;
/**
* @author NovaViper <nova.gamez15@gmail.com>
* @date 7/10/2016
* @purpose Main class for defining and loading all items
*/
public class ModItems {
public static Item ballisticBow;
public static Item triaxIngot;
public static Item breedingBone;
public static void load(){
ballisticBow = Registers.addItem(new ItemContinousBow("ballisticBow", ModCreativeTabs.tetraTab, "ballistic", 500, 10));
triaxIngot = Registers.addItem(new ItemModGenericItem("triaxIngot", ModCreativeTabs.tetraTab));
breedingBone = Registers.addItem(new ItemModGenericItem("breedingBone", ModCreativeTabs.tetraTab));
}
public static void loadRenderersAndVariants(){
addItemRender(ballisticBow, 0, "ballisticBow");
addItemRender(triaxIngot, 0, "triaxIngot");
addItemRender(breedingBone, 0, "breedingBone");
}
public static void addItemRender(Item item, int metadata, String itemString){
Registers.addItemRender(ModReference.MOD_ID, item, metadata, itemString);
}
} | NovaViper/TetraCraft | src-1.9.4/main/java/com/novaviper/tetracraft/common/init/ModItems.java | Java | gpl-3.0 | 1,268 | [
30522,
7427,
4012,
1012,
6846,
5737,
4842,
1012,
8915,
6494,
10419,
1012,
2691,
1012,
1999,
4183,
1025,
12324,
5658,
1012,
3067,
10419,
1012,
8875,
1012,
8875,
1025,
12324,
4012,
1012,
6846,
5737,
4842,
1012,
5390,
10893,
2497,
1012,
5622,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# frozen_string_literal: true
# Copyright 2022 Google LLC
#
# 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
#
# https://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.
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
# require "google/ads/google_ads/error"
require "google/ads/google_ads/v10/services/conversion_value_rule_service_pb"
module Google
module Ads
module GoogleAds
module V10
module Services
module ConversionValueRuleService
##
# Client for the ConversionValueRuleService service.
#
# Service to manage conversion value rules.
#
class Client
include Paths
# @private
attr_reader :conversion_value_rule_service_stub
##
# Configure the ConversionValueRuleService Client class.
#
# See {::Google::Ads::GoogleAds::V10::Services::ConversionValueRuleService::Client::Configuration}
# for a description of the configuration fields.
#
# @example
#
# # Modify the configuration for all ConversionValueRuleService clients
# ::Google::Ads::GoogleAds::V10::Services::ConversionValueRuleService::Client.configure do |config|
# config.timeout = 10.0
# end
#
# @yield [config] Configure the Client client.
# @yieldparam config [Client::Configuration]
#
# @return [Client::Configuration]
#
def self.configure
@configure ||= begin
default_config = Client::Configuration.new
default_config.timeout = 3600.0
default_config.retry_policy = {
initial_delay: 5.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
}
default_config
end
yield @configure if block_given?
@configure
end
##
# Configure the ConversionValueRuleService Client instance.
#
# The configuration is set to the derived mode, meaning that values can be changed,
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
# should be made on {Client.configure}.
#
# See {::Google::Ads::GoogleAds::V10::Services::ConversionValueRuleService::Client::Configuration}
# for a description of the configuration fields.
#
# @yield [config] Configure the Client client.
# @yieldparam config [Client::Configuration]
#
# @return [Client::Configuration]
#
def configure
yield @config if block_given?
@config
end
##
# Create a new ConversionValueRuleService client object.
#
# @example
#
# # Create a client using the default configuration
# client = ::Google::Ads::GoogleAds::V10::Services::ConversionValueRuleService::Client.new
#
# # Create a client using a custom configuration
# client = ::Google::Ads::GoogleAds::V10::Services::ConversionValueRuleService::Client.new do |config|
# config.timeout = 10.0
# end
#
# @yield [config] Configure the ConversionValueRuleService client.
# @yieldparam config [Client::Configuration]
#
def initialize
# These require statements are intentionally placed here to initialize
# the gRPC module only when it's required.
# See https://github.com/googleapis/toolkit/issues/446
require "gapic/grpc"
require "google/ads/google_ads/v10/services/conversion_value_rule_service_services_pb"
# Create the configuration object
@config = Configuration.new Client.configure
# Yield the configuration if needed
yield @config if block_given?
# Create credentials
credentials = @config.credentials
# Use self-signed JWT if the endpoint is unchanged from default,
# but only if the default endpoint does not have a region prefix.
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
!@config.endpoint.split(".").first.include?("-")
credentials ||= Credentials.default scope: @config.scope,
enable_self_signed_jwt: enable_self_signed_jwt
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
credentials = Credentials.new credentials, scope: @config.scope
end
@quota_project_id = @config.quota_project
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
@conversion_value_rule_service_stub = ::Gapic::ServiceStub.new(
::Google::Ads::GoogleAds::V10::Services::ConversionValueRuleService::Stub,
credentials: credentials,
endpoint: @config.endpoint,
channel_args: @config.channel_args,
interceptors: @config.interceptors
)
end
# Service calls
##
# Creates, updates, or removes conversion value rules. Operation statuses are
# returned.
#
# @overload mutate_conversion_value_rules(request, options = nil)
# Pass arguments to `mutate_conversion_value_rules` via a request object, either of type
# {::Google::Ads::GoogleAds::V10::Services::MutateConversionValueRulesRequest} or an equivalent Hash.
#
# @param request [::Google::Ads::GoogleAds::V10::Services::MutateConversionValueRulesRequest, ::Hash]
# A request object representing the call parameters. Required. To specify no
# parameters, or to keep all the default parameter values, pass an empty Hash.
# @param options [::Gapic::CallOptions, ::Hash]
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
#
# @overload mutate_conversion_value_rules(customer_id: nil, operations: nil, partial_failure: nil, validate_only: nil, response_content_type: nil)
# Pass arguments to `mutate_conversion_value_rules` via keyword arguments. Note that at
# least one keyword argument is required. To specify no parameters, or to keep all
# the default parameter values, pass an empty Hash as a request object (see above).
#
# @param customer_id [::String]
# Required. The ID of the customer whose conversion value rules are being modified.
# @param operations [::Array<::Google::Ads::GoogleAds::V10::Services::ConversionValueRuleOperation, ::Hash>]
# Required. The list of operations to perform on individual conversion value rules.
# @param partial_failure [::Boolean]
# If true, successful operations will be carried out and invalid
# operations will return errors. If false, all operations will be carried
# out in one transaction if and only if they are all valid.
# Default is false.
# @param validate_only [::Boolean]
# If true, the request is validated but not executed. Only errors are
# returned, not results.
# @param response_content_type [::Google::Ads::GoogleAds::V10::Enums::ResponseContentTypeEnum::ResponseContentType]
# The response content type setting. Determines whether the mutable resource
# or just the resource name should be returned post mutation.
#
# @yield [response, operation] Access the result along with the RPC operation
# @yieldparam response [::Google::Ads::GoogleAds::V10::Services::MutateConversionValueRulesResponse]
# @yieldparam operation [::GRPC::ActiveCall::Operation]
#
# @return [::Google::Ads::GoogleAds::V10::Services::MutateConversionValueRulesResponse]
#
# @raise [Google::Ads::GoogleAds::Error] if the RPC is aborted.
#
# @example Basic example
# require "google/ads/google_ads/v10/services"
#
# # Create a client object. The client can be reused for multiple calls.
# client = Google::Ads::GoogleAds::V10::Services::ConversionValueRuleService::Client.new
#
# # Create a request. To set request fields, pass in keyword arguments.
# request = Google::Ads::GoogleAds::V10::Services::MutateConversionValueRulesRequest.new
#
# # Call the mutate_conversion_value_rules method.
# result = client.mutate_conversion_value_rules request
#
# # The returned object is of type Google::Ads::GoogleAds::V10::Services::MutateConversionValueRulesResponse.
# p result
#
def mutate_conversion_value_rules request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
request = ::Gapic::Protobuf.coerce request,
to: ::Google::Ads::GoogleAds::V10::Services::MutateConversionValueRulesRequest
# Converts hash and nil to an options object
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
# Customize the options with defaults
metadata = @config.rpcs.mutate_conversion_value_rules.metadata.to_h
# Set x-goog-api-client and x-goog-user-project headers
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
lib_name: @config.lib_name, lib_version: @config.lib_version,
gapic_version: ::Google::Ads::GoogleAds::VERSION
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
header_params = {}
if request.customer_id
header_params["customer_id"] = request.customer_id
end
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.mutate_conversion_value_rules.timeout,
metadata: metadata,
retry_policy: @config.rpcs.mutate_conversion_value_rules.retry_policy
options.apply_defaults timeout: @config.timeout,
metadata: @config.metadata,
retry_policy: @config.retry_policy
@conversion_value_rule_service_stub.call_rpc :mutate_conversion_value_rules, request,
options: options do |response, operation|
yield response, operation if block_given?
return response
end
# rescue GRPC::BadStatus => grpc_error
# raise Google::Ads::GoogleAds::Error.new grpc_error.message
end
##
# Configuration class for the ConversionValueRuleService API.
#
# This class represents the configuration for ConversionValueRuleService,
# providing control over timeouts, retry behavior, logging, transport
# parameters, and other low-level controls. Certain parameters can also be
# applied individually to specific RPCs. See
# {::Google::Ads::GoogleAds::V10::Services::ConversionValueRuleService::Client::Configuration::Rpcs}
# for a list of RPCs that can be configured independently.
#
# Configuration can be applied globally to all clients, or to a single client
# on construction.
#
# @example
#
# # Modify the global config, setting the timeout for
# # mutate_conversion_value_rules to 20 seconds,
# # and all remaining timeouts to 10 seconds.
# ::Google::Ads::GoogleAds::V10::Services::ConversionValueRuleService::Client.configure do |config|
# config.timeout = 10.0
# config.rpcs.mutate_conversion_value_rules.timeout = 20.0
# end
#
# # Apply the above configuration only to a new client.
# client = ::Google::Ads::GoogleAds::V10::Services::ConversionValueRuleService::Client.new do |config|
# config.timeout = 10.0
# config.rpcs.mutate_conversion_value_rules.timeout = 20.0
# end
#
# @!attribute [rw] endpoint
# The hostname or hostname:port of the service endpoint.
# Defaults to `"googleads.googleapis.com"`.
# @return [::String]
# @!attribute [rw] credentials
# Credentials to send with calls. You may provide any of the following types:
# * (`String`) The path to a service account key file in JSON format
# * (`Hash`) A service account key as a Hash
# * (`Google::Auth::Credentials`) A googleauth credentials object
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
# * (`nil`) indicating no credentials
# @return [::Object]
# @!attribute [rw] scope
# The OAuth scopes
# @return [::Array<::String>]
# @!attribute [rw] lib_name
# The library name as recorded in instrumentation and logging
# @return [::String]
# @!attribute [rw] lib_version
# The library version as recorded in instrumentation and logging
# @return [::String]
# @!attribute [rw] channel_args
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
# `GRPC::Core::Channel` object is provided as the credential.
# @return [::Hash]
# @!attribute [rw] interceptors
# An array of interceptors that are run before calls are executed.
# @return [::Array<::GRPC::ClientInterceptor>]
# @!attribute [rw] timeout
# The call timeout in seconds.
# @return [::Numeric]
# @!attribute [rw] metadata
# Additional gRPC headers to be sent with the call.
# @return [::Hash{::Symbol=>::String}]
# @!attribute [rw] retry_policy
# The retry policy. The value is a hash with the following keys:
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
# trigger a retry.
# @return [::Hash]
# @!attribute [rw] quota_project
# A separate project against which to charge quota.
# @return [::String]
#
class Configuration
extend ::Gapic::Config
config_attr :endpoint, "googleads.googleapis.com", ::String
config_attr :credentials, nil do |value|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client,
nil]
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
allowed.any? { |klass| klass === value }
end
config_attr :scope, nil, ::String, ::Array, nil
config_attr :lib_name, nil, ::String, nil
config_attr :lib_version, nil, ::String, nil
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
config_attr :interceptors, nil, ::Array, nil
config_attr :timeout, nil, ::Numeric, nil
config_attr :metadata, nil, ::Hash, nil
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
config_attr :quota_project, nil, ::String, nil
# @private
def initialize parent_config = nil
@parent_config = parent_config unless parent_config.nil?
yield self if block_given?
end
##
# Configurations for individual RPCs
# @return [Rpcs]
#
def rpcs
@rpcs ||= begin
parent_rpcs = nil
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
Rpcs.new parent_rpcs
end
end
##
# Configuration RPC class for the ConversionValueRuleService API.
#
# Includes fields providing the configuration for each RPC in this service.
# Each configuration object is of type `Gapic::Config::Method` and includes
# the following configuration fields:
#
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
# include the following keys:
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
# trigger a retry.
#
class Rpcs
##
# RPC-specific configuration for `mutate_conversion_value_rules`
# @return [::Gapic::Config::Method]
#
attr_reader :mutate_conversion_value_rules
# @private
def initialize parent_rpcs = nil
mutate_conversion_value_rules_config = parent_rpcs.mutate_conversion_value_rules if parent_rpcs.respond_to? :mutate_conversion_value_rules
@mutate_conversion_value_rules = ::Gapic::Config::Method.new mutate_conversion_value_rules_config
yield self if block_given?
end
end
end
end
end
end
end
end
end
end
| googleads/google-ads-ruby | lib/google/ads/google_ads/v10/services/conversion_value_rule_service/client.rb | Ruby | apache-2.0 | 20,983 | [
30522,
1001,
7708,
1035,
5164,
1035,
18204,
1024,
2995,
1001,
9385,
16798,
2475,
8224,
11775,
1001,
1001,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1001,
2017,
2089,
2025,
2224,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
from __future__ import unicode_literals
import errno
import os
import re
import socket
import sys
from datetime import datetime
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import BaseCommand, CommandError
from django.core.servers.basehttp import get_internal_wsgi_application, run
from django.db import DEFAULT_DB_ALIAS, connections
from django.db.migrations.executor import MigrationExecutor
from django.utils import autoreload, six
from django.utils.encoding import force_text, get_system_encoding
naiveip_re = re.compile(r"""^(?:
(?P<addr>
(?P<ipv4>\d{1,3}(?:\.\d{1,3}){3}) | # IPv4 address
(?P<ipv6>\[[a-fA-F0-9:]+\]) | # IPv6 address
(?P<fqdn>[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*) # FQDN
):)?(?P<port>\d+)$""", re.X)
DEFAULT_PORT = "8000"
class Command(BaseCommand):
help = "Starts a lightweight Web server for development."
# Validation is called explicitly each time the server is reloaded.
requires_system_checks = False
def add_arguments(self, parser):
parser.add_argument('addrport', nargs='?',
help='Optional port number, or ipaddr:port')
parser.add_argument('--ipv6', '-6', action='store_true', dest='use_ipv6', default=False,
help='Tells Django to use an IPv6 address.')
parser.add_argument('--nothreading', action='store_false', dest='use_threading', default=True,
help='Tells Django to NOT use threading.')
parser.add_argument('--noreload', action='store_false', dest='use_reloader', default=True,
help='Tells Django to NOT use the auto-reloader.')
def execute(self, *args, **options):
if options.get('no_color'):
# We rely on the environment because it's currently the only
# way to reach WSGIRequestHandler. This seems an acceptable
# compromise considering `runserver` runs indefinitely.
os.environ[str("DJANGO_COLORS")] = str("nocolor")
super(Command, self).execute(*args, **options)
def get_handler(self, *args, **options):
"""
Returns the default WSGI handler for the runner.
"""
return get_internal_wsgi_application()
def handle(self, *args, **options):
from django.conf import settings
if not settings.DEBUG and not settings.ALLOWED_HOSTS:
raise CommandError('You must set settings.ALLOWED_HOSTS if DEBUG is False.')
self.use_ipv6 = options.get('use_ipv6')
if self.use_ipv6 and not socket.has_ipv6:
raise CommandError('Your Python does not support IPv6.')
self._raw_ipv6 = False
if not options.get('addrport'):
self.addr = ''
self.port = DEFAULT_PORT
else:
m = re.match(naiveip_re, options['addrport'])
if m is None:
raise CommandError('"%s" is not a valid port number '
'or address:port pair.' % options['addrport'])
self.addr, _ipv4, _ipv6, _fqdn, self.port = m.groups()
if not self.port.isdigit():
raise CommandError("%r is not a valid port number." % self.port)
if self.addr:
if _ipv6:
self.addr = self.addr[1:-1]
self.use_ipv6 = True
self._raw_ipv6 = True
elif self.use_ipv6 and not _fqdn:
raise CommandError('"%s" is not a valid IPv6 address.' % self.addr)
if not self.addr:
self.addr = '::1' if self.use_ipv6 else '127.0.0.1'
self._raw_ipv6 = bool(self.use_ipv6)
self.run(**options)
def run(self, **options):
"""
Runs the server, using the autoreloader if needed
"""
use_reloader = options.get('use_reloader')
if use_reloader:
autoreload.main(self.inner_run, None, options)
else:
self.inner_run(None, **options)
def inner_run(self, *args, **options):
from django.conf import settings
from django.utils import translation
# If an exception was silenced in ManagementUtility.execute in order
# to be raised in the child process, raise it now.
autoreload.raise_last_exception()
threading = options.get('use_threading')
shutdown_message = options.get('shutdown_message', '')
quit_command = 'CTRL-BREAK' if sys.platform == 'win32' else 'CONTROL-C'
self.stdout.write("Performing system checks...\n\n")
self.validate(display_num_errors=True)
try:
self.check_migrations()
except ImproperlyConfigured:
pass
now = datetime.now().strftime('%B %d, %Y - %X')
if six.PY2:
now = now.decode(get_system_encoding())
self.stdout.write((
"%(started_at)s\n"
"Django version %(version)s, using settings %(settings)r\n"
"Starting development server at http://%(addr)s:%(port)s/\n"
"Quit the server with %(quit_command)s.\n"
) % {
"started_at": now,
"version": self.get_version(),
"settings": settings.SETTINGS_MODULE,
"addr": '[%s]' % self.addr if self._raw_ipv6 else self.addr,
"port": self.port,
"quit_command": quit_command,
})
# django.core.management.base forces the locale to en-us. We should
# set it up correctly for the first request (particularly important
# in the "--noreload" case).
translation.activate(settings.LANGUAGE_CODE)
try:
handler = self.get_handler(*args, **options)
run(self.addr, int(self.port), handler,
ipv6=self.use_ipv6, threading=threading)
except socket.error as e:
# Use helpful error messages instead of ugly tracebacks.
ERRORS = {
errno.EACCES: "You don't have permission to access that port.",
errno.EADDRINUSE: "That port is already in use.",
errno.EADDRNOTAVAIL: "That IP address can't be assigned-to.",
}
try:
error_text = ERRORS[e.errno]
except KeyError:
error_text = force_text(e)
self.stderr.write("Error: %s" % error_text)
# Need to use an OS exit because sys.exit doesn't work in a thread
os._exit(1)
except KeyboardInterrupt:
if shutdown_message:
self.stdout.write(shutdown_message)
sys.exit(0)
def check_migrations(self):
"""
Checks to see if the set of migrations on disk matches the
migrations in the database. Prints a warning if they don't match.
"""
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
plan = executor.migration_plan(executor.loader.graph.leaf_nodes())
if plan:
self.stdout.write(self.style.NOTICE(
"\nYou have unapplied migrations; your app may not work properly until they are applied."
))
self.stdout.write(self.style.NOTICE("Run 'python manage.py migrate' to apply them.\n"))
# Kept for backward compatibility
BaseRunserverCommand = Command
| devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/django/core/management/commands/runserver.py | Python | agpl-3.0 | 7,307 | [
30522,
2013,
1035,
1035,
2925,
1035,
1035,
12324,
27260,
1035,
18204,
2015,
12324,
9413,
19139,
12324,
9808,
12324,
2128,
12324,
22278,
12324,
25353,
2015,
2013,
3058,
7292,
12324,
3058,
7292,
2013,
6520,
23422,
1012,
4563,
1012,
11790,
12324... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# MilkshakeAndMouse
An online store for organic/cruelty free merchandise.
| Wimsy113/MilkshakeAndMouse | README.md | Markdown | mit | 75 | [
30522,
1001,
6501,
7377,
3489,
5685,
27711,
2063,
2019,
3784,
3573,
2005,
7554,
1013,
18186,
2489,
16359,
1012,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
namespace Skypebot.Core.Notifications
{
using Skypebot.Core.Notifications.Abstract;
/// <summary>
/// The TeamCity builds notificator.
/// This feature is quite raw and in the protorype stage.
/// </summary>
public class TeamcityNotification : AbstractNotification
{
private string state;
public TeamcityNotification()
{
this.state = string.Empty;
}
public override bool HasChanged(out string message)
{
}
}
}
| nicklebedev37/eva-skypebot | src/Skypebot.Core/Notifications/TeamcityNotification.cs | C# | mit | 529 | [
30522,
3415,
15327,
3712,
5051,
18384,
1012,
4563,
1012,
26828,
2015,
1063,
2478,
3712,
5051,
18384,
1012,
4563,
1012,
26828,
2015,
1012,
10061,
1025,
1013,
1013,
1013,
1026,
12654,
1028,
1013,
1013,
1013,
1996,
2136,
12972,
16473,
2025,
18... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
# Copyright (C) 2011-15 Agile Business Group sagl (<http://www.agilebg.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from . import print_calendar_report
| mohamedhagag/community-addons | hr_attendance_analysis/wizard/__init__.py | Python | agpl-3.0 | 1,055 | [
30522,
1001,
1011,
1008,
1011,
16861,
1024,
21183,
2546,
1011,
1022,
1011,
1008,
1011,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
require 'open_food_network/referer_parser'
module Admin
class EnterprisesController < ResourceController
before_filter :load_enterprise_set, :only => :index
before_filter :load_countries, :except => [:index, :register, :check_permalink]
before_filter :load_methods_and_fees, :only => [:new, :edit, :update, :create]
before_filter :load_groups, :only => [:new, :edit, :update, :create]
before_filter :load_taxons, :only => [:new, :edit, :update, :create]
before_filter :check_can_change_sells, only: :update
before_filter :check_can_change_bulk_sells, only: :bulk_update
before_filter :override_owner, only: :create
before_filter :override_sells, only: :create
before_filter :check_can_change_owner, only: :update
before_filter :check_can_change_bulk_owner, only: :bulk_update
before_filter :check_can_change_managers, only: :update
before_filter :strip_new_properties, only: [:create, :update]
before_filter :load_properties, only: [:edit, :update]
before_filter :setup_property, only: [:edit]
helper 'spree/products'
include ActionView::Helpers::TextHelper
include OrderCyclesHelper
def index
respond_to do |format|
format.html
format.json do
render json: @collection, each_serializer: Api::Admin::IndexEnterpriseSerializer, spree_current_user: spree_current_user
end
end
end
def welcome
render layout: "spree/layouts/bare_admin"
end
def update
invoke_callbacks(:update, :before)
if @object.update_attributes(params[object_name])
invoke_callbacks(:update, :after)
flash[:success] = flash_message_for(@object, :successfully_updated)
respond_with(@object) do |format|
format.html { redirect_to location_after_save }
format.js { render :layout => false }
format.json { render json: @object, serializer: Api::Admin::IndexEnterpriseSerializer, spree_current_user: spree_current_user }
end
else
invoke_callbacks(:update, :fails)
respond_with(@object) do |format|
format.json { render json: { errors: @object.errors.messages }, status: :unprocessable_entity }
end
end
end
def register
if params[:sells] == 'unspecified'
flash[:error] = "Please select a package"
return render :welcome, layout: "spree/layouts/bare_admin"
end
attributes = { sells: params[:sells], visible: true }
if ['own', 'any'].include? params[:sells]
attributes[:shop_trial_start_date] = @enterprise.shop_trial_start_date || Time.now
end
if @enterprise.update_attributes(attributes)
flash[:success] = "Congratulations! Registration for #{@enterprise.name} is complete!"
redirect_to admin_path
else
flash[:error] = "Could not complete registration for #{@enterprise.name}"
render :welcome, layout: "spree/layouts/bare_admin"
end
end
def bulk_update
@enterprise_set = EnterpriseSet.new(collection, params[:enterprise_set])
touched_enterprises = @enterprise_set.collection.select(&:changed?)
if @enterprise_set.save
flash[:success] = "Enterprises updated successfully"
# 18-3-2015: It seems that the form for this action sometimes loads bogus values for
# the 'sells' field, and submitting that form results in a bunch of enterprises with
# values that have mysteriously changed. This statement is here to help debug that
# issue, and should be removed (along with its display in index.html.haml) when the
# issue has been resolved.
flash[:action] = "Updated #{pluralize(touched_enterprises.count, 'enterprise')}: #{touched_enterprises.map(&:name).join(', ')}"
redirect_to main_app.admin_enterprises_path
else
@enterprise_set.collection.select! { |e| touched_enterprises.include? e }
flash[:error] = 'Update failed'
render :index
end
end
def for_order_cycle
respond_to do |format|
format.json do
render json: ActiveModel::ArraySerializer.new( @collection,
each_serializer: Api::Admin::ForOrderCycle::EnterpriseSerializer, spree_current_user: spree_current_user
).to_json
end
end
end
protected
def build_resource_with_address
enterprise = build_resource_without_address
enterprise.address = Spree::Address.new
enterprise.address.country = Spree::Country.find_by_id(Spree::Config[:default_country_id])
enterprise
end
alias_method_chain :build_resource, :address
# Overriding method on Spree's resource controller,
# so that resources are found using permalink
def find_resource
Enterprise.find_by_permalink(params[:id])
end
private
def load_enterprise_set
@enterprise_set = EnterpriseSet.new(collection) if spree_current_user.admin?
end
def load_countries
@countries = Spree::Country.order(:name)
end
def collection
case action
when :for_order_cycle
order_cycle = OrderCycle.find_by_id(params[:order_cycle_id]) if params[:order_cycle_id]
coordinator = Enterprise.find_by_id(params[:coordinator_id]) if params[:coordinator_id]
order_cycle = OrderCycle.new(coordinator: coordinator) if order_cycle.nil? && coordinator.present?
return OpenFoodNetwork::OrderCyclePermissions.new(spree_current_user, order_cycle).visible_enterprises
when :index
if spree_current_user.admin?
OpenFoodNetwork::Permissions.new(spree_current_user).
editable_enterprises.
order('is_primary_producer ASC, name')
elsif json_request?
OpenFoodNetwork::Permissions.new(spree_current_user).editable_enterprises
else
Enterprise.where("1=0") unless json_request?
end
else
# TODO was ordered with is_distributor DESC as well, not sure why or how we want to sort this now
OpenFoodNetwork::Permissions.new(spree_current_user).
editable_enterprises.
order('is_primary_producer ASC, name')
end
end
def collection_actions
[:index, :for_order_cycle, :bulk_update]
end
def load_methods_and_fees
@payment_methods = Spree::PaymentMethod.managed_by(spree_current_user).sort_by!{ |pm| [(@enterprise.payment_methods.include? pm) ? 0 : 1, pm.name] }
@shipping_methods = Spree::ShippingMethod.managed_by(spree_current_user).sort_by!{ |sm| [(@enterprise.shipping_methods.include? sm) ? 0 : 1, sm.name] }
@enterprise_fees = EnterpriseFee.managed_by(spree_current_user).for_enterprise(@enterprise).order(:fee_type, :name).all
end
def load_groups
@groups = EnterpriseGroup.managed_by(spree_current_user) | @enterprise.groups
end
def load_taxons
@taxons = Spree::Taxon.order(:name)
end
def check_can_change_bulk_sells
unless spree_current_user.admin?
params[:enterprise_set][:collection_attributes].each do |i, enterprise_params|
enterprise_params.delete :sells unless spree_current_user == Enterprise.find_by_id(enterprise_params[:id]).owner
end
end
end
def check_can_change_sells
unless spree_current_user.admin? || spree_current_user == @enterprise.owner
params[:enterprise].delete :sells
end
end
def override_owner
params[:enterprise][:owner_id] = spree_current_user.id unless spree_current_user.admin?
end
def override_sells
unless spree_current_user.admin?
has_hub = spree_current_user.owned_enterprises.is_hub.any?
new_enterprise_is_producer = Enterprise.new(params[:enterprise]).is_primary_producer
params[:enterprise][:sells] = (has_hub && !new_enterprise_is_producer) ? 'any' : 'none'
end
end
def check_can_change_owner
unless ( spree_current_user == @enterprise.owner ) || spree_current_user.admin?
params[:enterprise].delete :owner_id
end
end
def check_can_change_bulk_owner
unless spree_current_user.admin?
params[:enterprise_set][:collection_attributes].each do |i, enterprise_params|
enterprise_params.delete :owner_id
end
end
end
def check_can_change_managers
unless ( spree_current_user == @enterprise.owner ) || spree_current_user.admin?
params[:enterprise].delete :user_ids
end
end
def strip_new_properties
unless spree_current_user.admin? || params[:enterprise][:producer_properties_attributes].nil?
names = Spree::Property.pluck(:name)
params[:enterprise][:producer_properties_attributes].each do |key, property|
params[:enterprise][:producer_properties_attributes].delete key unless names.include? property[:property_name]
end
end
end
def load_properties
@properties = Spree::Property.pluck(:name)
end
def setup_property
@enterprise.producer_properties.build
end
# Overriding method on Spree's resource controller
def location_after_save
referer_path = OpenFoodNetwork::RefererParser::path(request.referer)
refered_from_edit = referer_path == main_app.edit_admin_enterprise_path(@enterprise)
if params[:enterprise].key?(:producer_properties_attributes) && !refered_from_edit
main_app.admin_enterprises_path
else
main_app.edit_admin_enterprise_path(@enterprise)
end
end
end
end
| stveep/openfoodnetwork | app/controllers/admin/enterprises_controller.rb | Ruby | agpl-3.0 | 9,547 | [
30522,
5478,
1005,
2330,
1035,
2833,
1035,
2897,
1013,
6523,
2121,
1035,
11968,
8043,
1005,
11336,
4748,
10020,
2465,
9926,
8663,
13181,
10820,
1026,
7692,
8663,
13181,
10820,
2077,
1035,
11307,
1024,
7170,
1035,
6960,
1035,
2275,
1010,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package me.marcosassuncao.servsim.job;
import me.marcosassuncao.servsim.profile.RangeList;
import com.google.common.base.MoreObjects;
/**
* {@link Reservation} represents a resource reservation request
* made by a customer to reserve a given number of resources
* from a provider.
*
* @see WorkUnit
* @see DefaultWorkUnit
*
* @author Marcos Dias de Assuncao
*/
public class Reservation extends DefaultWorkUnit {
private long reqStartTime = WorkUnit.TIME_NOT_SET;
private RangeList rangeList;
/**
* Creates a reservation request to start at
* <code>startTime</code> and with the given duration.
* @param startTime the requested start time for the reservation
* @param duration the duration of the reservation
* @param numResources number of required resources
*/
public Reservation(long startTime,
long duration, int numResources) {
super(duration);
super.setNumReqResources(numResources);
this.reqStartTime = startTime;
}
/**
* Creates a reservation request to start at
* <code>startTime</code> and with the given duration and priority
* @param startTime the requested start time for the reservation
* @param duration the duration of the reservation
* @param numResources the number of resources to be reserved
* @param priority the reservation priority
*/
public Reservation(long startTime,
long duration, int numResources, int priority) {
super(duration, priority);
super.setNumReqResources(numResources);
this.reqStartTime = startTime;
}
/**
* Returns the start time requested by this reservation
* @return the requested start time
*/
public long getRequestedStartTime() {
return reqStartTime;
}
/**
* Sets the ranges of reserved resources
* @param ranges the ranges of resources allocated for the reservation
* @return <code>true</code> if the ranges have been set correctly,
* <code>false</code> otherwise.
*/
public boolean setResourceRanges(RangeList ranges) {
if (this.rangeList != null) {
return false;
}
this.rangeList = ranges;
return true;
}
/**
* Gets the ranges of reserved resources
* @return the ranges of reserved resources
*/
public RangeList getResourceRanges() {
return rangeList;
}
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("id", getId())
.add("submission time", getSubmitTime())
.add("start time", getStartTime())
.add("finish time", getFinishTime())
.add("duration", getDuration())
.add("priority", getPriority())
.add("status", getStatus())
.add("resources", rangeList)
.toString();
}
} | assuncaomarcos/servsim | src/main/java/me/marcosassuncao/servsim/job/Reservation.java | Java | apache-2.0 | 2,646 | [
30522,
7427,
2033,
1012,
14810,
12054,
4609,
20808,
1012,
14262,
15088,
5714,
1012,
3105,
1025,
12324,
2033,
1012,
14810,
12054,
4609,
20808,
1012,
14262,
15088,
5714,
1012,
6337,
1012,
2846,
9863,
1025,
12324,
4012,
1012,
8224,
1012,
2691,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
"use strict";
var sqlite3 = require('sqlite3');
var authHelper = require('./server/helpers/auth');
var db = new sqlite3.Database('./data/users.db');
db.serialize(function() {
db.run(
'CREATE TABLE "users" ('
+ '"id" INTEGER PRIMARY KEY AUTOINCREMENT,'
+ '"username" TEXT,'
+ '"password" TEXT'
+ ')'
);
db.run("INSERT INTO users('username', 'password') VALUES (?, ?)", ["admin", authHelper.hashPassword("teste")]);
});
db.close(); | fppgodinho/express-practice | install.js | JavaScript | mit | 512 | [
30522,
1000,
2224,
9384,
1000,
1025,
13075,
29296,
4221,
2509,
1027,
5478,
1006,
1005,
29296,
4221,
2509,
1005,
1007,
1025,
13075,
8740,
2705,
16001,
4842,
1027,
5478,
1006,
1005,
1012,
1013,
8241,
1013,
2393,
2545,
1013,
8740,
2705,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
export * from './application'
export * from './breakpoint'
export * from './goto'
export * from './icons'
export * from './lang'
export * from './theme'
| Webifi/vuetify | packages/vuetify/src/services/index.ts | TypeScript | mit | 153 | [
30522,
9167,
1008,
2013,
1005,
30524,
9167,
1008,
2013,
1005,
1012,
1013,
4323,
1005,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
File: TextServices.h
Contains: Text Services Manager Interfaces.
Version: Technology: System 8.2
Release: QuickTime 6.0.2
Copyright: (c) 1991-2001 by Apple Computer, Inc., all rights reserved.
Bugs?: For bug reports, consult the following page on
the World Wide Web:
http://developer.apple.com/bugreporter/
*/
#ifndef __TEXTSERVICES__
#define __TEXTSERVICES__
#ifndef __CONDITIONALMACROS__
#include "ConditionalMacros.h"
#endif
#ifndef __MACTYPES__
#include "MacTypes.h"
#endif
#ifndef __EVENTS__
#include "Events.h"
#endif
#ifndef __MENUS__
#include "Menus.h"
#endif
#ifndef __AEDATAMODEL__
#include "AEDataModel.h"
#endif
#ifndef __AEREGISTRY__
#include "AERegistry.h"
#endif
#ifndef __COMPONENTS__
#include "Components.h"
#endif
#if PRAGMA_ONCE
#pragma once
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if PRAGMA_IMPORT
#pragma import on
#endif
#if PRAGMA_STRUCT_ALIGN
#pragma options align=mac68k
#elif PRAGMA_STRUCT_PACKPUSH
#pragma pack(push, 2)
#elif PRAGMA_STRUCT_PACK
#pragma pack(2)
#endif
enum {
kTextService = FOUR_CHAR_CODE('tsvc'), /* component type for the component description */
kInputMethodService = FOUR_CHAR_CODE('inpm'), /* component subtype for the component description */
kTSMVersion = 0x0150 /* Version of the Text Services Manager is 1.5 */
};
enum {
kUnicodeDocument = FOUR_CHAR_CODE('udoc'), /* TSM Document type for Unicode-savvy application */
kUnicodeTextService = FOUR_CHAR_CODE('utsv') /* Component type for Unicode Text Service */
};
/* Language and Script constants*/
enum {
kUnknownLanguage = 0xFFFF,
kUnknownScript = 0xFFFF,
kNeutralScript = 0xFFFF
};
enum {
/* Component Flags in ComponentDescription */
bTakeActiveEvent = 15, /* bit set if the component takes active event */
bHandleAERecording = 16, /* bit set if the component takes care of recording Apple Events <new in vers2.0> */
bScriptMask = 0x00007F00, /* bit 8 - 14 */
bLanguageMask = 0x000000FF, /* bit 0 - 7 */
bScriptLanguageMask = bScriptMask + bLanguageMask /* bit 0 - 14 */
};
enum {
/* Typing method property constants for Input Methods */
kIMJaTypingMethodProperty = FOUR_CHAR_CODE('jtyp'), /* Typing method property for Japanese input methods*/
kIMJaTypingMethodRoman = FOUR_CHAR_CODE('roma'), /* Roman typing*/
kIMJaTypingMethodKana = FOUR_CHAR_CODE('kana') /* Kana typing*/
};
enum {
/* Low level routines which are dispatched directly to the Component Manager */
kCMGetScriptLangSupport = 0x0001, /* Component Manager call selector 1 */
kCMInitiateTextService = 0x0002, /* Component Manager call selector 2 */
kCMTerminateTextService = 0x0003, /* Component Manager call selector 3 */
kCMActivateTextService = 0x0004, /* Component Manager call selector 4 */
kCMDeactivateTextService = 0x0005, /* Component Manager call selector 5 */
kCMTextServiceEvent = 0x0006, /* Component Manager call selector 6 */
kCMGetTextServiceMenu = 0x0007, /* Component Manager call selector 7 */
kCMTextServiceMenuSelect = 0x0008, /* Component Manager call selector 8 */
kCMFixTextService = 0x0009, /* Component Manager call selector 9 */
kCMSetTextServiceCursor = 0x000A, /* Component Manager call selector 10 */
kCMHidePaletteWindows = 0x000B, /* Component Manager call selector 11 */
kCMGetTextServiceProperty = 0x000C, /* Component Manager call selector 12 */
kCMSetTextServiceProperty = 0x000D /* Component Manager call selector 13 */
};
enum {
/* New low level routines which are dispatched directly to the Component Manager */
kCMUCTextServiceEvent = 0x000E /* Component Manager call selector 14 */
};
/* extract Script/Language code from Component flag ... */
#define mGetScriptCode(cdRec) ((ScriptCode) ((cdRec.componentFlags & bScriptMask) >> 8))
#define mGetLanguageCode(cdRec) ((LangCode) cdRec.componentFlags & bLanguageMask)
/* New opaque definitions for types */
typedef struct OpaqueTSMDocumentID* TSMDocumentID;
typedef OSType InterfaceTypeList[1];
/* Text Service Info List */
struct TextServiceInfo {
Component fComponent;
Str255 fItemName;
};
typedef struct TextServiceInfo TextServiceInfo;
typedef TextServiceInfo * TextServiceInfoPtr;
struct TextServiceList {
short fTextServiceCount; /* number of entries in the 'fServices' array */
TextServiceInfo fServices[1]; /* Note: array of 'TextServiceInfo' records follows */
};
typedef struct TextServiceList TextServiceList;
typedef TextServiceList * TextServiceListPtr;
typedef TextServiceListPtr * TextServiceListHandle;
struct ScriptLanguageRecord {
ScriptCode fScript;
LangCode fLanguage;
};
typedef struct ScriptLanguageRecord ScriptLanguageRecord;
struct ScriptLanguageSupport {
short fScriptLanguageCount; /* number of entries in the 'fScriptLanguageArray' array */
ScriptLanguageRecord fScriptLanguageArray[1]; /* Note: array of 'ScriptLanguageRecord' records follows */
};
typedef struct ScriptLanguageSupport ScriptLanguageSupport;
typedef ScriptLanguageSupport * ScriptLanguageSupportPtr;
typedef ScriptLanguageSupportPtr * ScriptLanguageSupportHandle;
/* High level TSM Doucment routines */
EXTERN_API( OSErr )
NewTSMDocument (short numOfInterface,
InterfaceTypeList supportedInterfaceTypes,
TSMDocumentID * idocID,
long refcon) TWOWORDINLINE(0x7000, 0xAA54);
EXTERN_API( OSErr )
DeleteTSMDocument (TSMDocumentID idocID) TWOWORDINLINE(0x7001, 0xAA54);
EXTERN_API( OSErr )
ActivateTSMDocument (TSMDocumentID idocID) TWOWORDINLINE(0x7002, 0xAA54);
EXTERN_API( OSErr )
DeactivateTSMDocument (TSMDocumentID idocID) TWOWORDINLINE(0x7003, 0xAA54);
EXTERN_API( OSErr )
FixTSMDocument (TSMDocumentID idocID) TWOWORDINLINE(0x7007, 0xAA54);
EXTERN_API( OSErr )
GetServiceList (short numOfInterface,
OSType * supportedInterfaceTypes,
TextServiceListHandle * serviceInfo,
long * seedValue) TWOWORDINLINE(0x7008, 0xAA54);
EXTERN_API( OSErr )
OpenTextService (TSMDocumentID idocID,
Component aComponent,
ComponentInstance * aComponentInstance) TWOWORDINLINE(0x7009, 0xAA54);
EXTERN_API( OSErr )
CloseTextService (TSMDocumentID idocID,
ComponentInstance aComponentInstance) TWOWORDINLINE(0x700A, 0xAA54);
EXTERN_API( OSErr )
SendAEFromTSMComponent (const AppleEvent * theAppleEvent,
AppleEvent * reply,
AESendMode sendMode,
AESendPriority sendPriority,
long timeOutInTicks,
AEIdleUPP idleProc,
AEFilterUPP filterProc) TWOWORDINLINE(0x700B, 0xAA54);
EXTERN_API( OSErr )
SetDefaultInputMethod (Component ts,
ScriptLanguageRecord * slRecordPtr) TWOWORDINLINE(0x700C, 0xAA54);
EXTERN_API( OSErr )
GetDefaultInputMethod (Component * ts,
ScriptLanguageRecord * slRecordPtr) TWOWORDINLINE(0x700D, 0xAA54);
EXTERN_API( OSErr )
SetTextServiceLanguage (ScriptLanguageRecord * slRecordPtr) TWOWORDINLINE(0x700E, 0xAA54);
EXTERN_API( OSErr )
GetTextServiceLanguage (ScriptLanguageRecord * slRecordPtr) TWOWORDINLINE(0x700F, 0xAA54);
EXTERN_API( OSErr )
UseInputWindow (TSMDocumentID idocID,
Boolean useWindow) TWOWORDINLINE(0x7010, 0xAA54);
#if CALL_NOT_IN_CARBON
/* Following calls from Classic event loops not needed for Carbon clients. */
#if CALL_NOT_IN_CARBON
EXTERN_API( Boolean )
TSMEvent (EventRecord * event) TWOWORDINLINE(0x7004, 0xAA54);
EXTERN_API( Boolean )
TSMMenuSelect (long menuResult) TWOWORDINLINE(0x7005, 0xAA54);
EXTERN_API( Boolean )
SetTSMCursor (Point mousePos) TWOWORDINLINE(0x7006, 0xAA54);
/* Following ServiceWindow API replaced by Window Manager API in Carbon. */
EXTERN_API( OSErr )
NewServiceWindow (void * wStorage,
const Rect * boundsRect,
ConstStr255Param title,
Boolean visible,
short theProc,
WindowPtr behind,
Boolean goAwayFlag,
ComponentInstance ts,
WindowPtr * window) TWOWORDINLINE(0x7011, 0xAA54);
EXTERN_API( OSErr )
CloseServiceWindow (WindowPtr window) TWOWORDINLINE(0x7012, 0xAA54);
EXTERN_API( OSErr )
GetFrontServiceWindow (WindowPtr * window) TWOWORDINLINE(0x7013, 0xAA54);
EXTERN_API( short )
FindServiceWindow (Point thePoint,
WindowPtr * theWindow) TWOWORDINLINE(0x7017, 0xAA54);
EXTERN_API( OSErr )
NewCServiceWindow (void * wStorage,
const Rect * boundsRect,
ConstStr255Param title,
Boolean visible,
short theProc,
WindowPtr behind,
Boolean goAwayFlag,
ComponentInstance ts,
WindowPtr * window) TWOWORDINLINE(0x701A, 0xAA54);
/* Explicit initialization not needed for Carbon clients, since TSM is */
/* instanciated per-context. */
EXTERN_API( OSErr )
InitTSMAwareApplication (void) TWOWORDINLINE(0x7014, 0xAA54);
EXTERN_API( OSErr )
CloseTSMAwareApplication (void) TWOWORDINLINE(0x7015, 0xAA54);
#endif /* CALL_NOT_IN_CARBON */
#endif /* CALL_NOT_IN_CARBON */
/* Component Manager Interfaces to Input Methods */
EXTERN_API( ComponentResult )
GetScriptLanguageSupport (ComponentInstance ts,
ScriptLanguageSupportHandle * scriptHdl) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);
EXTERN_API( ComponentResult )
InitiateTextService (ComponentInstance ts) FIVEWORDINLINE(0x2F3C, 0x0000, 0x0002, 0x7000, 0xA82A);
EXTERN_API( ComponentResult )
TerminateTextService (ComponentInstance ts) FIVEWORDINLINE(0x2F3C, 0x0000, 0x0003, 0x7000, 0xA82A);
EXTERN_API( ComponentResult )
ActivateTextService (ComponentInstance ts) FIVEWORDINLINE(0x2F3C, 0x0000, 0x0004, 0x7000, 0xA82A);
EXTERN_API( ComponentResult )
DeactivateTextService (ComponentInstance ts) FIVEWORDINLINE(0x2F3C, 0x0000, 0x0005, 0x7000, 0xA82A);
EXTERN_API( ComponentResult )
GetTextServiceMenu (ComponentInstance ts,
MenuRef * serviceMenu) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
#if CALL_NOT_IN_CARBON
#if CALL_NOT_IN_CARBON
EXTERN_API( ComponentResult )
TextServiceEvent (ComponentInstance ts,
short numOfEvents,
EventRecord * event) FIVEWORDINLINE(0x2F3C, 0x0006, 0x0006, 0x7000, 0xA82A);
EXTERN_API( ComponentResult )
UCTextServiceEvent (ComponentInstance ts,
short numOfEvents,
EventRecord * event,
UniChar unicodeString[],
UniCharCount unicodeStrLength) FIVEWORDINLINE(0x2F3C, 0x000E, 0x000E, 0x7000, 0xA82A);
EXTERN_API( ComponentResult )
TextServiceMenuSelect (ComponentInstance ts,
MenuRef serviceMenu,
short item) FIVEWORDINLINE(0x2F3C, 0x0006, 0x0008, 0x7000, 0xA82A);
EXTERN_API( ComponentResult )
SetTextServiceCursor (ComponentInstance ts,
Point mousePos) FIVEWORDINLINE(0x2F3C, 0x0004, 0x000A, 0x7000, 0xA82A);
#endif /* CALL_NOT_IN_CARBON */
#endif /* CALL_NOT_IN_CARBON */
EXTERN_API( ComponentResult )
FixTextService (ComponentInstance ts) FIVEWORDINLINE(0x2F3C, 0x0000, 0x0009, 0x7000, 0xA82A);
EXTERN_API( ComponentResult )
HidePaletteWindows (ComponentInstance ts) FIVEWORDINLINE(0x2F3C, 0x0000, 0x000B, 0x7000, 0xA82A);
EXTERN_API( ComponentResult )
GetTextServiceProperty (ComponentInstance ts,
OSType propertySelector,
SInt32 * result) FIVEWORDINLINE(0x2F3C, 0x0008, 0x000C, 0x7000, 0xA82A);
EXTERN_API( ComponentResult )
SetTextServiceProperty (ComponentInstance ts,
OSType propertySelector,
SInt32 value) FIVEWORDINLINE(0x2F3C, 0x0008, 0x000D, 0x7000, 0xA82A);
#if PRAGMA_STRUCT_ALIGN
#pragma options align=reset
#elif PRAGMA_STRUCT_PACKPUSH
#pragma pack(pop)
#elif PRAGMA_STRUCT_PACK
#pragma pack()
#endif
#ifdef PRAGMA_IMPORT_OFF
#pragma import off
#elif PRAGMA_IMPORT
#pragma import reset
#endif
#ifdef __cplusplus
}
#endif
#endif /* __TEXTSERVICES__ */
| systembugtj/playasa | src/include/qt/TextServices.h | C | gpl-2.0 | 16,687 | [
30522,
1013,
1008,
5371,
1024,
6981,
2121,
7903,
2229,
1012,
1044,
3397,
1024,
3793,
2578,
3208,
19706,
1012,
2544,
1024,
2974,
1024,
2291,
1022,
1012,
1016,
2713,
1024,
4248,
7292,
1020,
1012,
1014,
1012,
1016,
9385,
1024,
1006,
1039,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* This file is part of rflpc.
*
* rflpc is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* rflpc is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with rflpc. If not, see <http://www.gnu.org/licenses/>.
*/
/*
Author: Michael Hauspie <michael.hauspie@univ-lille1.fr>
Created: 2012-03-27
*/
/** @file
* A implementation of srand and rand function.
* This implementation is directly taken from the glibc rand_r function implementation.
* http://sourceware.org/git/?p=glibc.git;a=blob;f=stdlib/rand_r.c;hb=HEAD
*/
#ifndef __RFLPC_RAND_H__
#define __RFLPC_RAND_H__
#ifdef RFLPC_CONFIG_ENABLE_RAND
/** @ingroup libc
* @{ */
#ifdef RAND_MAX
#undef RAND_MAX
#endif
/** The maximum value of a random number.
* The ::rand function generate number in [0, ::RAND_MAX] range.
*/
#define RAND_MAX 2147483647
/** Sets the seed used by ::rand() to generate the pseudo-random sequence.
* @param seed the seed to use.
*/
extern void srand(unsigned int seed);
/** Returns a pseudo-random integer in the range of 0 to ::RAND_MAX.
* @warning this function is not reentrant!
*/
extern int rand(void);
/** Returns a pseudo-random integer in the range of 0 to ::RAND_MAX.
* @note This function is reentrant as it uses a user defined pointer for its seed.
* @param seed pointer to the current value of the seed.
*/
extern int rand_r(unsigned int *seed);
/** @} */
#endif /* ENABLE_RAND */
#endif
| hauspie/rflpc | rflpc17xx/tinylibc/rand.h | C | gpl-3.0 | 1,860 | [
30522,
1013,
1008,
2023,
5371,
2003,
2112,
1997,
21792,
14277,
2278,
1012,
1008,
1008,
21792,
14277,
2278,
2003,
2489,
4007,
1024,
2017,
2064,
2417,
2923,
3089,
8569,
2618,
2009,
1998,
1013,
2030,
19933,
1008,
2009,
2104,
1996,
3408,
1997,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains the definition for the class assignment
*
* This class provides all the functionality for the new assign module.
*
* @package mod_assign
* @copyright 2012 NetSpot {@link http://www.netspot.com.au}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Assignment submission statuses
*/
define('ASSIGN_SUBMISSION_STATUS_DRAFT', 'draft'); // student thinks it is a draft
define('ASSIGN_SUBMISSION_STATUS_SUBMITTED', 'submitted'); // student thinks it is finished
/**
* Search filters for grading page
*/
define('ASSIGN_FILTER_SUBMITTED', 'submitted');
define('ASSIGN_FILTER_SINGLE_USER', 'singleuser');
define('ASSIGN_FILTER_REQUIRE_GRADING', 'require_grading');
/** Include accesslib.php */
require_once($CFG->libdir.'/accesslib.php');
/** Include formslib.php */
require_once($CFG->libdir.'/formslib.php');
/** Include repository/lib.php */
require_once($CFG->dirroot . '/repository/lib.php');
/** Include local mod_form.php */
require_once($CFG->dirroot.'/mod/assign/mod_form.php');
/** gradelib.php */
require_once($CFG->libdir.'/gradelib.php');
/** grading lib.php */
require_once($CFG->dirroot.'/grade/grading/lib.php');
/** Include feedbackplugin.php */
require_once($CFG->dirroot.'/mod/assign/feedbackplugin.php');
/** Include submissionplugin.php */
require_once($CFG->dirroot.'/mod/assign/submissionplugin.php');
/** Include renderable.php */
require_once($CFG->dirroot.'/mod/assign/renderable.php');
/** Include gradingtable.php */
require_once($CFG->dirroot.'/mod/assign/gradingtable.php');
/** Include eventslib.php */
require_once($CFG->libdir.'/eventslib.php');
/**
* Standard base class for mod_assign (assignment types).
*
* @package mod_assign
* @copyright 2012 NetSpot {@link http://www.netspot.com.au}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class assign {
/** @var stdClass the assignment record that contains the global settings for this assign instance */
private $instance;
/** @var context the context of the course module for this assign instance (or just the course if we are
creating a new one) */
private $context;
/** @var stdClass the course this assign instance belongs to */
private $course;
/** @var stdClass the admin config for all assign instances */
private $adminconfig;
/** @var assign_renderer the custom renderer for this module */
private $output;
/** @var stdClass the course module for this assign instance */
private $coursemodule;
/** @var array cache for things like the coursemodule name or the scale menu - only lives for a single
request */
private $cache;
/** @var array list of the installed submission plugins */
private $submissionplugins;
/** @var array list of the installed feedback plugins */
private $feedbackplugins;
/** @var string action to be used to return to this page (without repeating any form submissions etc.) */
private $returnaction = 'view';
/** @var array params to be used to return to this page */
private $returnparams = array();
/** @var string modulename prevents excessive calls to get_string */
private static $modulename = null;
/** @var string modulenameplural prevents excessive calls to get_string */
private static $modulenameplural = null;
/**
* Constructor for the base assign class
*
* @param mixed $coursemodulecontext context|null the course module context (or the course context if the coursemodule has not been created yet)
* @param mixed $coursemodule the current course module if it was already loaded - otherwise this class will load one from the context as required
* @param mixed $course the current course if it was already loaded - otherwise this class will load one from the context as required
*/
public function __construct($coursemodulecontext, $coursemodule, $course) {
global $PAGE;
$this->context = $coursemodulecontext;
$this->coursemodule = $coursemodule;
$this->course = $course;
$this->cache = array(); // temporary cache only lives for a single request - used to reduce db lookups
$this->submissionplugins = $this->load_plugins('assignsubmission');
$this->feedbackplugins = $this->load_plugins('assignfeedback');
$this->output = $PAGE->get_renderer('mod_assign');
}
/**
* Set the action and parameters that can be used to return to the current page
*
* @param string $action The action for the current page
* @param array $params An array of name value pairs which form the parameters to return to the current page
* @return void
*/
public function register_return_link($action, $params) {
$this->returnaction = $action;
$this->returnparams = $params;
}
/**
* Return an action that can be used to get back to the current page
* @return string action
*/
public function get_return_action() {
return $this->returnaction;
}
/**
* Based on the current assignment settings should we display the intro
* @return bool showintro
*/
private function show_intro() {
if ($this->get_instance()->alwaysshowdescription ||
time() > $this->get_instance()->allowsubmissionsfromdate) {
return true;
}
return false;
}
/**
* Return a list of parameters that can be used to get back to the current page
* @return array params
*/
public function get_return_params() {
return $this->returnparams;
}
/**
* Set the submitted form data
* @param stdClass $data The form data (instance)
*/
public function set_instance(stdClass $data) {
$this->instance = $data;
}
/**
* Set the context
* @param context $context The new context
*/
public function set_context(context $context) {
$this->context = $context;
}
/**
* Set the course data
* @param stdClass $course The course data
*/
public function set_course(stdClass $course) {
$this->course = $course;
}
/**
* get list of feedback plugins installed
* @return array
*/
public function get_feedback_plugins() {
return $this->feedbackplugins;
}
/**
* get list of submission plugins installed
* @return array
*/
public function get_submission_plugins() {
return $this->submissionplugins;
}
/**
* get a specific submission plugin by its type
* @param string $subtype assignsubmission | assignfeedback
* @param string $type
* @return mixed assign_plugin|null
*/
private function get_plugin_by_type($subtype, $type) {
$shortsubtype = substr($subtype, strlen('assign'));
$name = $shortsubtype . 'plugins';
$pluginlist = $this->$name;
foreach ($pluginlist as $plugin) {
if ($plugin->get_type() == $type) {
return $plugin;
}
}
return null;
}
/**
* Get a feedback plugin by type
* @param string $type - The type of plugin e.g comments
* @return mixed assign_feedback_plugin|null
*/
public function get_feedback_plugin_by_type($type) {
return $this->get_plugin_by_type('assignfeedback', $type);
}
/**
* Get a submission plugin by type
* @param string $type - The type of plugin e.g comments
* @return mixed assign_submission_plugin|null
*/
public function get_submission_plugin_by_type($type) {
return $this->get_plugin_by_type('assignsubmission', $type);
}
/**
* Load the plugins from the sub folders under subtype
* @param string $subtype - either submission or feedback
* @return array - The sorted list of plugins
*/
private function load_plugins($subtype) {
global $CFG;
$result = array();
$names = get_plugin_list($subtype);
foreach ($names as $name => $path) {
if (file_exists($path . '/locallib.php')) {
require_once($path . '/locallib.php');
$shortsubtype = substr($subtype, strlen('assign'));
$pluginclass = 'assign_' . $shortsubtype . '_' . $name;
$plugin = new $pluginclass($this, $name);
if ($plugin instanceof assign_plugin) {
$idx = $plugin->get_sort_order();
while (array_key_exists($idx, $result)) $idx +=1;
$result[$idx] = $plugin;
}
}
}
ksort($result);
return $result;
}
/**
* Display the assignment, used by view.php
*
* The assignment is displayed differently depending on your role,
* the settings for the assignment and the status of the assignment.
* @param string $action The current action if any.
* @return void
*/
public function view($action='') {
$o = '';
$mform = null;
// handle form submissions first
if ($action == 'savesubmission') {
$action = 'editsubmission';
if ($this->process_save_submission($mform)) {
$action = 'view';
}
} else if ($action == 'lock') {
$this->process_lock();
$action = 'grading';
} else if ($action == 'reverttodraft') {
$this->process_revert_to_draft();
$action = 'grading';
} else if ($action == 'unlock') {
$this->process_unlock();
$action = 'grading';
} else if ($action == 'confirmsubmit') {
$this->process_submit_for_grading();
// save and show next button
} else if ($action == 'batchgradingoperation') {
$this->process_batch_grading_operation();
$action = 'grading';
} else if ($action == 'submitgrade') {
if (optional_param('saveandshownext', null, PARAM_RAW)) {
//save and show next
$action = 'grade';
if ($this->process_save_grade($mform)) {
$action = 'nextgrade';
}
} else if (optional_param('nosaveandprevious', null, PARAM_RAW)) {
$action = 'previousgrade';
} else if (optional_param('nosaveandnext', null, PARAM_RAW)) {
//show next button
$action = 'nextgrade';
} else if (optional_param('savegrade', null, PARAM_RAW)) {
//save changes button
$action = 'grade';
if ($this->process_save_grade($mform)) {
$action = 'grading';
}
} else {
//cancel button
$action = 'grading';
}
}else if ($action == 'quickgrade') {
$message = $this->process_save_quick_grades();
$action = 'quickgradingresult';
}else if ($action == 'saveoptions') {
$this->process_save_grading_options();
$action = 'grading';
}
$returnparams = array('rownum'=>optional_param('rownum', 0, PARAM_INT));
$this->register_return_link($action, $returnparams);
// now show the right view page
if ($action == 'previousgrade') {
$mform = null;
$o .= $this->view_single_grade_page($mform, -1);
} else if ($action == 'quickgradingresult') {
$mform = null;
$o .= $this->view_quickgrading_result($message);
} else if ($action == 'nextgrade') {
$mform = null;
$o .= $this->view_single_grade_page($mform, 1);
} else if ($action == 'grade') {
$o .= $this->view_single_grade_page($mform);
} else if ($action == 'viewpluginassignfeedback') {
$o .= $this->view_plugin_content('assignfeedback');
} else if ($action == 'viewpluginassignsubmission') {
$o .= $this->view_plugin_content('assignsubmission');
} else if ($action == 'editsubmission') {
$o .= $this->view_edit_submission_page($mform);
} else if ($action == 'grading') {
$o .= $this->view_grading_page();
} else if ($action == 'downloadall') {
$o .= $this->download_submissions();
} else if ($action == 'submit') {
$o .= $this->check_submit_for_grading();
} else {
$o .= $this->view_submission_page();
}
return $o;
}
/**
* Add this instance to the database
*
* @param stdClass $formdata The data submitted from the form
* @param bool $callplugins This is used to skip the plugin code
* when upgrading an old assignment to a new one (the plugins get called manually)
* @return mixed false if an error occurs or the int id of the new instance
*/
public function add_instance(stdClass $formdata, $callplugins) {
global $DB;
$err = '';
// add the database record
$update = new stdClass();
$update->name = $formdata->name;
$update->timemodified = time();
$update->timecreated = time();
$update->course = $formdata->course;
$update->courseid = $formdata->course;
$update->intro = $formdata->intro;
$update->introformat = $formdata->introformat;
$update->alwaysshowdescription = $formdata->alwaysshowdescription;
$update->preventlatesubmissions = $formdata->preventlatesubmissions;
$update->submissiondrafts = $formdata->submissiondrafts;
$update->sendnotifications = $formdata->sendnotifications;
$update->sendlatenotifications = $formdata->sendlatenotifications;
$update->duedate = $formdata->duedate;
$update->allowsubmissionsfromdate = $formdata->allowsubmissionsfromdate;
$update->grade = $formdata->grade;
$returnid = $DB->insert_record('assign', $update);
$this->instance = $DB->get_record('assign', array('id'=>$returnid), '*', MUST_EXIST);
// cache the course record
$this->course = $DB->get_record('course', array('id'=>$formdata->course), '*', MUST_EXIST);
if ($callplugins) {
// call save_settings hook for submission plugins
foreach ($this->submissionplugins as $plugin) {
if (!$this->update_plugin_instance($plugin, $formdata)) {
print_error($plugin->get_error());
return false;
}
}
foreach ($this->feedbackplugins as $plugin) {
if (!$this->update_plugin_instance($plugin, $formdata)) {
print_error($plugin->get_error());
return false;
}
}
// in the case of upgrades the coursemodule has not been set so we need to wait before calling these two
// TODO: add event to the calendar
$this->update_calendar($formdata->coursemodule);
// TODO: add the item in the gradebook
$this->update_gradebook(false, $formdata->coursemodule);
}
$update = new stdClass();
$update->id = $this->get_instance()->id;
$update->nosubmissions = (!$this->is_any_submission_plugin_enabled()) ? 1: 0;
$DB->update_record('assign', $update);
return $returnid;
}
/**
* Delete all grades from the gradebook for this assignment
*
* @return bool
*/
private function delete_grades() {
global $CFG;
return grade_update('mod/assign', $this->get_course()->id, 'mod', 'assign', $this->get_instance()->id, 0, NULL, array('deleted'=>1)) == GRADE_UPDATE_OK;
}
/**
* Delete this instance from the database
*
* @return bool false if an error occurs
*/
public function delete_instance() {
global $DB;
$result = true;
foreach ($this->submissionplugins as $plugin) {
if (!$plugin->delete_instance()) {
print_error($plugin->get_error());
$result = false;
}
}
foreach ($this->feedbackplugins as $plugin) {
if (!$plugin->delete_instance()) {
print_error($plugin->get_error());
$result = false;
}
}
// delete files associated with this assignment
$fs = get_file_storage();
if (! $fs->delete_area_files($this->context->id) ) {
$result = false;
}
// delete_records will throw an exception if it fails - so no need for error checking here
$DB->delete_records('assign_submission', array('assignment'=>$this->get_instance()->id));
$DB->delete_records('assign_grades', array('assignment'=>$this->get_instance()->id));
$DB->delete_records('assign_plugin_config', array('assignment'=>$this->get_instance()->id));
// delete items from the gradebook
if (! $this->delete_grades()) {
$result = false;
}
// delete the instance
$DB->delete_records('assign', array('id'=>$this->get_instance()->id));
return $result;
}
/**
* Actual implementation of the reset course functionality, delete all the
* assignment submissions for course $data->courseid.
*
* @param $data the data submitted from the reset course.
* @return array status array
*/
public function reset_userdata($data) {
global $CFG,$DB;
$componentstr = get_string('modulenameplural', 'assign');
$status = array();
$fs = get_file_storage();
if (!empty($data->reset_assign_submissions)) {
// Delete files associated with this assignment.
foreach ($this->submissionplugins as $plugin) {
$fileareas = array();
$plugincomponent = $plugin->get_subtype() . '_' . $plugin->get_type();
$fileareas = $plugin->get_file_areas();
foreach ($fileareas as $filearea) {
$fs->delete_area_files($this->context->id, $plugincomponent, $filearea);
}
if (!$plugin->delete_instance()) {
$status[] = array('component'=>$componentstr,
'item'=>get_string('deleteallsubmissions','assign'),
'error'=>$plugin->get_error());
}
}
foreach ($this->feedbackplugins as $plugin) {
$fileareas = array();
$plugincomponent = $plugin->get_subtype() . '_' . $plugin->get_type();
$fileareas = $plugin->get_file_areas();
foreach ($fileareas as $filearea) {
$fs->delete_area_files($this->context->id, $plugincomponent, $filearea);
}
if (!$plugin->delete_instance()) {
$status[] = array('component'=>$componentstr,
'item'=>get_string('deleteallsubmissions','assign'),
'error'=>$plugin->get_error());
}
}
$assignssql = "SELECT a.id
FROM {assign} a
WHERE a.course=:course";
$params = array ("course" => $data->courseid);
$DB->delete_records_select('assign_submission', "assignment IN ($assignssql)", $params);
$status[] = array('component'=>$componentstr,
'item'=>get_string('deleteallsubmissions','assign'),
'error'=>false);
if (empty($data->reset_gradebook_grades)) {
// Remove all grades from gradebook.
require_once($CFG->dirroot.'/mod/assign/lib.php');
assign_reset_gradebook($data->courseid);
}
}
// Updating dates - shift may be negative too.
if ($data->timeshift) {
shift_course_mod_dates('assign',
array('duedate', 'allowsubmissionsfromdate'),
$data->timeshift,
$data->courseid);
$status[] = array('component'=>$componentstr,
'item'=>get_string('datechanged'),
'error'=>false);
}
return $status;
}
/**
* Update the settings for a single plugin
*
* @param assign_plugin $plugin The plugin to update
* @param stdClass $formdata The form data
* @return bool false if an error occurs
*/
private function update_plugin_instance(assign_plugin $plugin, stdClass $formdata) {
if ($plugin->is_visible()) {
$enabledname = $plugin->get_subtype() . '_' . $plugin->get_type() . '_enabled';
if ($formdata->$enabledname) {
$plugin->enable();
if (!$plugin->save_settings($formdata)) {
print_error($plugin->get_error());
return false;
}
} else {
$plugin->disable();
}
}
return true;
}
/**
* Update the gradebook information for this assignment
*
* @param bool $reset If true, will reset all grades in the gradbook for this assignment
* @param int $coursemoduleid This is required because it might not exist in the database yet
* @return bool
*/
public function update_gradebook($reset, $coursemoduleid) {
global $CFG;
/** Include lib.php */
require_once($CFG->dirroot.'/mod/assign/lib.php');
$assign = clone $this->get_instance();
$assign->cmidnumber = $coursemoduleid;
$param = null;
if ($reset) {
$param = 'reset';
}
return assign_grade_item_update($assign, $param);
}
/** Load and cache the admin config for this module
*
* @return stdClass the plugin config
*/
public function get_admin_config() {
if ($this->adminconfig) {
return $this->adminconfig;
}
$this->adminconfig = get_config('assign');
return $this->adminconfig;
}
/**
* Update the calendar entries for this assignment
*
* @param int $coursemoduleid - Required to pass this in because it might not exist in the database yet
* @return bool
*/
public function update_calendar($coursemoduleid) {
global $DB, $CFG;
require_once($CFG->dirroot.'/calendar/lib.php');
// special case for add_instance as the coursemodule has not been set yet.
if ($this->get_instance()->duedate) {
$event = new stdClass();
if ($event->id = $DB->get_field('event', 'id', array('modulename'=>'assign', 'instance'=>$this->get_instance()->id))) {
$event->name = $this->get_instance()->name;
$event->description = format_module_intro('assign', $this->get_instance(), $coursemoduleid);
$event->timestart = $this->get_instance()->duedate;
$calendarevent = calendar_event::load($event->id);
$calendarevent->update($event);
} else {
$event = new stdClass();
$event->name = $this->get_instance()->name;
$event->description = format_module_intro('assign', $this->get_instance(), $coursemoduleid);
$event->courseid = $this->get_instance()->course;
$event->groupid = 0;
$event->userid = 0;
$event->modulename = 'assign';
$event->instance = $this->get_instance()->id;
$event->eventtype = 'due';
$event->timestart = $this->get_instance()->duedate;
$event->timeduration = 0;
calendar_event::create($event);
}
} else {
$DB->delete_records('event', array('modulename'=>'assign', 'instance'=>$this->get_instance()->id));
}
}
/**
* Update this instance in the database
*
* @param stdClass $formdata - the data submitted from the form
* @return bool false if an error occurs
*/
public function update_instance($formdata) {
global $DB;
$update = new stdClass();
$update->id = $formdata->instance;
$update->name = $formdata->name;
$update->timemodified = time();
$update->course = $formdata->course;
$update->intro = $formdata->intro;
$update->introformat = $formdata->introformat;
$update->alwaysshowdescription = $formdata->alwaysshowdescription;
$update->preventlatesubmissions = $formdata->preventlatesubmissions;
$update->submissiondrafts = $formdata->submissiondrafts;
$update->sendnotifications = $formdata->sendnotifications;
$update->sendlatenotifications = $formdata->sendlatenotifications;
$update->duedate = $formdata->duedate;
$update->allowsubmissionsfromdate = $formdata->allowsubmissionsfromdate;
$update->grade = $formdata->grade;
$result = $DB->update_record('assign', $update);
$this->instance = $DB->get_record('assign', array('id'=>$update->id), '*', MUST_EXIST);
// load the assignment so the plugins have access to it
// call save_settings hook for submission plugins
foreach ($this->submissionplugins as $plugin) {
if (!$this->update_plugin_instance($plugin, $formdata)) {
print_error($plugin->get_error());
return false;
}
}
foreach ($this->feedbackplugins as $plugin) {
if (!$this->update_plugin_instance($plugin, $formdata)) {
print_error($plugin->get_error());
return false;
}
}
// update the database record
// update all the calendar events
$this->update_calendar($this->get_course_module()->id);
$this->update_gradebook(false, $this->get_course_module()->id);
$update = new stdClass();
$update->id = $this->get_instance()->id;
$update->nosubmissions = (!$this->is_any_submission_plugin_enabled()) ? 1: 0;
$DB->update_record('assign', $update);
return $result;
}
/**
* add elements in grading plugin form
*
* @param mixed $grade stdClass|null
* @param MoodleQuickForm $mform
* @param stdClass $data
* @return void
*/
private function add_plugin_grade_elements($grade, MoodleQuickForm $mform, stdClass $data) {
foreach ($this->feedbackplugins as $plugin) {
if ($plugin->is_enabled() && $plugin->is_visible()) {
$mform->addElement('header', 'header_' . $plugin->get_type(), $plugin->get_name());
if (!$plugin->get_form_elements($grade, $mform, $data)) {
$mform->removeElement('header_' . $plugin->get_type());
}
}
}
}
/**
* Add one plugins settings to edit plugin form
*
* @param assign_plugin $plugin The plugin to add the settings from
* @param MoodleQuickForm $mform The form to add the configuration settings to. This form is modified directly (not returned)
* @return void
*/
private function add_plugin_settings(assign_plugin $plugin, MoodleQuickForm $mform) {
global $CFG;
if ($plugin->is_visible()) {
// enabled
//tied disableIf rule to this select element
$mform->addElement('selectyesno', $plugin->get_subtype() . '_' . $plugin->get_type() . '_enabled', $plugin->get_name());
$mform->addHelpButton($plugin->get_subtype() . '_' . $plugin->get_type() . '_enabled', 'enabled', $plugin->get_subtype() . '_' . $plugin->get_type());
$default = get_config($plugin->get_subtype() . '_' . $plugin->get_type(), 'default');
if ($plugin->get_config('enabled') !== false) {
$default = $plugin->is_enabled();
}
$mform->setDefault($plugin->get_subtype() . '_' . $plugin->get_type() . '_enabled', $default);
$plugin->get_settings($mform);
}
}
/**
* Add settings to edit plugin form
*
* @param MoodleQuickForm $mform The form to add the configuration settings to. This form is modified directly (not returned)
* @return void
*/
public function add_all_plugin_settings(MoodleQuickForm $mform) {
$mform->addElement('header', 'general', get_string('submissionsettings', 'assign'));
foreach ($this->submissionplugins as $plugin) {
$this->add_plugin_settings($plugin, $mform);
}
$mform->addElement('header', 'general', get_string('feedbacksettings', 'assign'));
foreach ($this->feedbackplugins as $plugin) {
$this->add_plugin_settings($plugin, $mform);
}
}
/**
* Allow each plugin an opportunity to update the defaultvalues
* passed in to the settings form (needed to set up draft areas for
* editor and filemanager elements)
* @param array $defaultvalues
*/
public function plugin_data_preprocessing(&$defaultvalues) {
foreach ($this->submissionplugins as $plugin) {
if ($plugin->is_visible()) {
$plugin->data_preprocessing($defaultvalues);
}
}
foreach ($this->feedbackplugins as $plugin) {
if ($plugin->is_visible()) {
$plugin->data_preprocessing($defaultvalues);
}
}
}
/**
* Get the name of the current module.
*
* @return string the module name (Assignment)
*/
protected function get_module_name() {
if (isset(self::$modulename)) {
return self::$modulename;
}
self::$modulename = get_string('modulename', 'assign');
return self::$modulename;
}
/**
* Get the plural name of the current module.
*
* @return string the module name plural (Assignments)
*/
protected function get_module_name_plural() {
if (isset(self::$modulenameplural)) {
return self::$modulenameplural;
}
self::$modulenameplural = get_string('modulenameplural', 'assign');
return self::$modulenameplural;
}
/**
* Has this assignment been constructed from an instance?
*
* @return bool
*/
public function has_instance() {
return $this->instance || $this->get_course_module();
}
/**
* Get the settings for the current instance of this assignment
*
* @return stdClass The settings
*/
public function get_instance() {
global $DB;
if ($this->instance) {
return $this->instance;
}
if ($this->get_course_module()) {
$this->instance = $DB->get_record('assign', array('id' => $this->get_course_module()->instance), '*', MUST_EXIST);
}
if (!$this->instance) {
throw new coding_exception('Improper use of the assignment class. Cannot load the assignment record.');
}
return $this->instance;
}
/**
* Get the context of the current course
* @return mixed context|null The course context
*/
public function get_course_context() {
if (!$this->context && !$this->course) {
throw new coding_exception('Improper use of the assignment class. Cannot load the course context.');
}
if ($this->context) {
return $this->context->get_course_context();
} else {
return context_course::instance($this->course->id);
}
}
/**
* Get the current course module
*
* @return mixed stdClass|null The course module
*/
public function get_course_module() {
if ($this->coursemodule) {
return $this->coursemodule;
}
if (!$this->context) {
return null;
}
if ($this->context->contextlevel == CONTEXT_MODULE) {
$this->coursemodule = get_coursemodule_from_id('assign', $this->context->instanceid, 0, false, MUST_EXIST);
return $this->coursemodule;
}
return null;
}
/**
* Get context module
*
* @return context
*/
public function get_context() {
return $this->context;
}
/**
* Get the current course
* @return mixed stdClass|null The course
*/
public function get_course() {
global $DB;
if ($this->course) {
return $this->course;
}
if (!$this->context) {
return null;
}
$this->course = $DB->get_record('course', array('id' => $this->get_course_context()->instanceid), '*', MUST_EXIST);
return $this->course;
}
/**
* Return a grade in user-friendly form, whether it's a scale or not
*
* @param mixed $grade int|null
* @param boolean $editing Are we allowing changes to this grade?
* @param int $userid The user id the grade belongs to
* @param int $modified Timestamp from when the grade was last modified
* @return string User-friendly representation of grade
*/
public function display_grade($grade, $editing, $userid=0, $modified=0) {
global $DB;
static $scalegrades = array();
if ($this->get_instance()->grade >= 0) {
// Normal number
if ($editing && $this->get_instance()->grade > 0) {
if ($grade < 0) {
$displaygrade = '';
} else {
$displaygrade = format_float($grade);
}
$o = '<input type="text" name="quickgrade_' . $userid . '" value="' . $displaygrade . '" size="6" maxlength="10" class="quickgrade"/>';
$o .= ' / ' . format_float($this->get_instance()->grade,2);
$o .= '<input type="hidden" name="grademodified_' . $userid . '" value="' . $modified . '"/>';
return $o;
} else {
if ($grade == -1 || $grade === null) {
return '-';
} else {
return format_float(($grade),2) .' / '. format_float($this->get_instance()->grade,2);
}
}
} else {
// Scale
if (empty($this->cache['scale'])) {
if ($scale = $DB->get_record('scale', array('id'=>-($this->get_instance()->grade)))) {
$this->cache['scale'] = make_menu_from_list($scale->scale);
} else {
return '-';
}
}
if ($editing) {
$o = '<select name="quickgrade_' . $userid . '" class="quickgrade">';
$o .= '<option value="-1">' . get_string('nograde') . '</option>';
foreach ($this->cache['scale'] as $optionid => $option) {
$selected = '';
if ($grade == $optionid) {
$selected = 'selected="selected"';
}
$o .= '<option value="' . $optionid . '" ' . $selected . '>' . $option . '</option>';
}
$o .= '</select>';
$o .= '<input type="hidden" name="grademodified_' . $userid . '" value="' . $modified . '"/>';
return $o;
} else {
$scaleid = (int)$grade;
if (isset($this->cache['scale'][$scaleid])) {
return $this->cache['scale'][$scaleid];
}
return '-';
}
}
}
/**
* Load a list of users enrolled in the current course with the specified permission and group (0 for no group)
*
* @param int $currentgroup
* @param bool $idsonly
* @return array List of user records
*/
public function list_participants($currentgroup, $idsonly) {
if ($idsonly) {
return get_enrolled_users($this->context, "mod/assign:submit", $currentgroup, 'u.id');
} else {
return get_enrolled_users($this->context, "mod/assign:submit", $currentgroup);
}
}
/**
* Load a count of users enrolled in the current course with the specified permission and group (0 for no group)
*
* @param int $currentgroup
* @return int number of matching users
*/
public function count_participants($currentgroup) {
return count_enrolled_users($this->context, "mod/assign:submit", $currentgroup);
}
/**
* Load a count of users submissions in the current module that require grading
* This means the submission modification time is more recent than the
* grading modification time.
*
* @return int number of matching submissions
*/
public function count_submissions_need_grading() {
global $DB;
$params = array($this->get_course_module()->instance);
return $DB->count_records_sql("SELECT COUNT('x')
FROM {assign_submission} s
LEFT JOIN {assign_grades} g ON s.assignment = g.assignment AND s.userid = g.userid
WHERE s.assignment = ?
AND s.timemodified IS NOT NULL
AND (s.timemodified > g.timemodified OR g.timemodified IS NULL)",
$params);
}
/**
* Load a count of users enrolled in the current course with the specified permission and group (optional)
*
* @param string $status The submission status - should match one of the constants
* @return int number of matching submissions
*/
public function count_submissions_with_status($status) {
global $DB;
return $DB->count_records_sql("SELECT COUNT('x')
FROM {assign_submission}
WHERE assignment = ? AND
status = ?", array($this->get_course_module()->instance, $status));
}
/**
* Utility function to get the userid for every row in the grading table
* so the order can be frozen while we iterate it
*
* @return array An array of userids
*/
private function get_grading_userid_list(){
$filter = get_user_preferences('assign_filter', '');
$table = new assign_grading_table($this, 0, $filter, 0, false);
$useridlist = $table->get_column_data('userid');
return $useridlist;
}
/**
* Utility function get the userid based on the row number of the grading table.
* This takes into account any active filters on the table.
*
* @param int $num The row number of the user
* @param bool $last This is set to true if this is the last user in the table
* @return mixed The user id of the matching user or false if there was an error
*/
private function get_userid_for_row($num, $last){
if (!array_key_exists('userid_for_row', $this->cache)) {
$this->cache['userid_for_row'] = array();
}
if (array_key_exists($num, $this->cache['userid_for_row'])) {
list($userid, $last) = $this->cache['userid_for_row'][$num];
return $userid;
}
$filter = get_user_preferences('assign_filter', '');
$table = new assign_grading_table($this, 0, $filter, 0, false);
$userid = $table->get_cell_data($num, 'userid', $last);
$this->cache['userid_for_row'][$num] = array($userid, $last);
return $userid;
}
/**
* Return all assignment submissions by ENROLLED students (even empty)
*
* @param string $sort optional field names for the ORDER BY in the sql query
* @param string $dir optional specifying the sort direction, defaults to DESC
* @return array The submission objects indexed by id
*/
private function get_all_submissions( $sort="", $dir="DESC") {
global $CFG, $DB;
if ($sort == "lastname" or $sort == "firstname") {
$sort = "u.$sort $dir";
} else if (empty($sort)) {
$sort = "a.timemodified DESC";
} else {
$sort = "a.$sort $dir";
}
return $DB->get_records_sql("SELECT a.*
FROM {assign_submission} a, {user} u
WHERE u.id = a.userid
AND a.assignment = ?
ORDER BY $sort", array($this->get_instance()->id));
}
/**
* Generate zip file from array of given files
*
* @param array $filesforzipping - array of files to pass into archive_to_pathname - this array is indexed by the final file name and each element in the array is an instance of a stored_file object
* @return path of temp file - note this returned file does not have a .zip extension - it is a temp file.
*/
private function pack_files($filesforzipping) {
global $CFG;
//create path for new zip file.
$tempzip = tempnam($CFG->tempdir.'/', 'assignment_');
//zip files
$zipper = new zip_packer();
if ($zipper->archive_to_pathname($filesforzipping, $tempzip)) {
return $tempzip;
}
return false;
}
/**
* Finds all assignment notifications that have yet to be mailed out, and mails them.
*
* Cron function to be run periodically according to the moodle cron
*
* @return bool
*/
static function cron() {
global $DB;
// only ever send a max of one days worth of updates
$yesterday = time() - (24 * 3600);
$timenow = time();
// Collect all submissions from the past 24 hours that require mailing.
$sql = "SELECT s.*, a.course, a.name, g.*, g.id as gradeid, g.timemodified as lastmodified
FROM {assign} a
JOIN {assign_grades} g ON g.assignment = a.id
LEFT JOIN {assign_submission} s ON s.assignment = a.id AND s.userid = g.userid
WHERE g.timemodified >= :yesterday AND
g.timemodified <= :today AND
g.mailed = 0";
$params = array('yesterday' => $yesterday, 'today' => $timenow);
$submissions = $DB->get_records_sql($sql, $params);
if (empty($submissions)) {
mtrace('done.');
return true;
}
mtrace('Processing ' . count($submissions) . ' assignment submissions ...');
// Preload courses we are going to need those.
$courseids = array();
foreach ($submissions as $submission) {
$courseids[] = $submission->course;
}
// Filter out duplicates
$courseids = array_unique($courseids);
$ctxselect = context_helper::get_preload_record_columns_sql('ctx');
list($courseidsql, $params) = $DB->get_in_or_equal($courseids, SQL_PARAMS_NAMED);
$sql = "SELECT c.*, {$ctxselect}
FROM {course} c
LEFT JOIN {context} ctx ON ctx.instanceid = c.id AND ctx.contextlevel = :contextlevel
WHERE c.id {$courseidsql}";
$params['contextlevel'] = CONTEXT_COURSE;
$courses = $DB->get_records_sql($sql, $params);
// Clean up... this could go on for a while.
unset($courseids);
unset($ctxselect);
unset($courseidsql);
unset($params);
// Simple array we'll use for caching modules.
$modcache = array();
// Message students about new feedback
foreach ($submissions as $submission) {
mtrace("Processing assignment submission $submission->id ...");
// do not cache user lookups - could be too many
if (!$user = $DB->get_record("user", array("id"=>$submission->userid))) {
mtrace("Could not find user $submission->userid");
continue;
}
// use a cache to prevent the same DB queries happening over and over
if (!array_key_exists($submission->course, $courses)) {
mtrace("Could not find course $submission->course");
continue;
}
$course = $courses[$submission->course];
if (isset($course->ctxid)) {
// Context has not yet been preloaded. Do so now.
context_helper::preload_from_record($course);
}
// Override the language and timezone of the "current" user, so that
// mail is customised for the receiver.
cron_setup_user($user, $course);
// context lookups are already cached
$coursecontext = context_course::instance($course->id);
if (!is_enrolled($coursecontext, $user->id)) {
$courseshortname = format_string($course->shortname, true, array('context' => $coursecontext));
mtrace(fullname($user)." not an active participant in " . $courseshortname);
continue;
}
if (!$grader = $DB->get_record("user", array("id"=>$submission->grader))) {
mtrace("Could not find grader $submission->grader");
continue;
}
if (!array_key_exists($submission->assignment, $modcache)) {
if (! $mod = get_coursemodule_from_instance("assign", $submission->assignment, $course->id)) {
mtrace("Could not find course module for assignment id $submission->assignment");
continue;
}
$modcache[$submission->assignment] = $mod;
} else {
$mod = $modcache[$submission->assignment];
}
// context lookups are already cached
$contextmodule = context_module::instance($mod->id);
if (!$mod->visible) {
// Hold mail notification for hidden assignments until later
continue;
}
// need to send this to the student
$messagetype = 'feedbackavailable';
$eventtype = 'assign_notification';
$updatetime = $submission->lastmodified;
$modulename = get_string('modulename', 'assign');
self::send_assignment_notification($grader, $user, $messagetype, $eventtype, $updatetime, $mod, $contextmodule, $course, $modulename, $submission->name);
$grade = new stdClass();
$grade->id = $submission->gradeid;
$grade->mailed = 1;
$DB->update_record('assign_grades', $grade);
mtrace('Done');
}
mtrace('Done processing ' . count($submissions) . ' assignment submissions');
cron_setup_user();
// Free up memory just to be sure
unset($courses);
unset($modcache);
return true;
}
/**
* Update a grade in the grade table for the assignment and in the gradebook
*
* @param stdClass $grade a grade record keyed on id
* @return bool true for success
*/
private function update_grade($grade) {
global $DB;
$grade->timemodified = time();
if ($grade->grade && $grade->grade != -1) {
if ($this->get_instance()->grade > 0) {
if (!is_numeric($grade->grade)) {
return false;
} else if ($grade->grade > $this->get_instance()->grade) {
return false;
} else if ($grade->grade < 0) {
return false;
}
} else {
// this is a scale
if ($scale = $DB->get_record('scale', array('id' => -($this->get_instance()->grade)))) {
$scaleoptions = make_menu_from_list($scale->scale);
if (!array_key_exists((int) $grade->grade, $scaleoptions)) {
return false;
}
}
}
}
$result = $DB->update_record('assign_grades', $grade);
if ($result) {
$this->gradebook_item_update(null, $grade);
}
return $result;
}
/**
* display the submission that is used by a plugin
* Uses url parameters 'sid', 'gid' and 'plugin'
* @param string $pluginsubtype
* @return string
*/
private function view_plugin_content($pluginsubtype) {
global $USER;
$o = '';
$submissionid = optional_param('sid', 0, PARAM_INT);
$gradeid = optional_param('gid', 0, PARAM_INT);
$plugintype = required_param('plugin', PARAM_TEXT);
$item = null;
if ($pluginsubtype == 'assignsubmission') {
$plugin = $this->get_submission_plugin_by_type($plugintype);
if ($submissionid <= 0) {
throw new coding_exception('Submission id should not be 0');
}
$item = $this->get_submission($submissionid);
// permissions
if ($item->userid != $USER->id) {
require_capability('mod/assign:grade', $this->context);
}
$o .= $this->output->render(new assign_header($this->get_instance(),
$this->get_context(),
$this->show_intro(),
$this->get_course_module()->id,
$plugin->get_name()));
$o .= $this->output->render(new assign_submission_plugin_submission($plugin,
$item,
assign_submission_plugin_submission::FULL,
$this->get_course_module()->id,
$this->get_return_action(),
$this->get_return_params()));
$this->add_to_log('view submission', get_string('viewsubmissionforuser', 'assign', $item->userid));
} else {
$plugin = $this->get_feedback_plugin_by_type($plugintype);
if ($gradeid <= 0) {
throw new coding_exception('Grade id should not be 0');
}
$item = $this->get_grade($gradeid);
// permissions
if ($item->userid != $USER->id) {
require_capability('mod/assign:grade', $this->context);
}
$o .= $this->output->render(new assign_header($this->get_instance(),
$this->get_context(),
$this->show_intro(),
$this->get_course_module()->id,
$plugin->get_name()));
$o .= $this->output->render(new assign_feedback_plugin_feedback($plugin,
$item,
assign_feedback_plugin_feedback::FULL,
$this->get_course_module()->id,
$this->get_return_action(),
$this->get_return_params()));
$this->add_to_log('view feedback', get_string('viewfeedbackforuser', 'assign', $item->userid));
}
$o .= $this->view_return_links();
$o .= $this->view_footer();
return $o;
}
/**
* render the content in editor that is often used by plugin
*
* @param string $filearea
* @param int $submissionid
* @param string $plugintype
* @param string $editor
* @param string $component
* @return string
*/
public function render_editor_content($filearea, $submissionid, $plugintype, $editor, $component) {
global $CFG;
$result = '';
$plugin = $this->get_submission_plugin_by_type($plugintype);
$text = $plugin->get_editor_text($editor, $submissionid);
$format = $plugin->get_editor_format($editor, $submissionid);
$finaltext = file_rewrite_pluginfile_urls($text, 'pluginfile.php', $this->get_context()->id, $component, $filearea, $submissionid);
$result .= format_text($finaltext, $format, array('overflowdiv' => true, 'context' => $this->get_context()));
if ($CFG->enableportfolios) {
require_once($CFG->libdir . '/portfoliolib.php');
$button = new portfolio_add_button();
$button->set_callback_options('assign_portfolio_caller', array('cmid' => $this->get_course_module()->id, 'sid' => $submissionid, 'plugin' => $plugintype, 'editor' => $editor, 'area'=>$filearea), '/mod/assign/portfolio_callback.php');
$fs = get_file_storage();
if ($files = $fs->get_area_files($this->context->id, $component,$filearea, $submissionid, "timemodified", false)) {
$button->set_formats(PORTFOLIO_FORMAT_RICHHTML);
} else {
$button->set_formats(PORTFOLIO_FORMAT_PLAINHTML);
}
$result .= $button->to_html();
}
return $result;
}
/**
* Display a grading error
*
* @param string $message - The description of the result
* @return string
*/
private function view_quickgrading_result($message) {
$o = '';
$o .= $this->output->render(new assign_header($this->get_instance(),
$this->get_context(),
$this->show_intro(),
$this->get_course_module()->id,
get_string('quickgradingresult', 'assign')));
$o .= $this->output->render(new assign_quickgrading_result($message, $this->get_course_module()->id));
$o .= $this->view_footer();
return $o;
}
/**
* Display the page footer
*
* @return string
*/
private function view_footer() {
return $this->output->render_footer();
}
/**
* Does this user have grade permission for this assignment
*
* @return bool
*/
private function can_grade() {
// Permissions check
if (!has_capability('mod/assign:grade', $this->context)) {
return false;
}
return true;
}
/**
* Download a zip file of all assignment submissions
*
* @return void
*/
private function download_submissions() {
global $CFG,$DB;
// more efficient to load this here
require_once($CFG->libdir.'/filelib.php');
// load all submissions
$submissions = $this->get_all_submissions('','');
if (empty($submissions)) {
print_error('errornosubmissions', 'assign');
return;
}
// build a list of files to zip
$filesforzipping = array();
$fs = get_file_storage();
$groupmode = groups_get_activity_groupmode($this->get_course_module());
$groupid = 0; // All users
$groupname = '';
if ($groupmode) {
$groupid = groups_get_activity_group($this->get_course_module(), true);
$groupname = groups_get_group_name($groupid).'-';
}
// construct the zip file name
$filename = str_replace(' ', '_', clean_filename($this->get_course()->shortname.'-'.$this->get_instance()->name.'-'.$groupname.$this->get_course_module()->id.".zip")); //name of new zip file.
// get all the files for each submission
foreach ($submissions as $submission) {
$userid = $submission->userid; //get userid
if ((groups_is_member($groupid,$userid) or !$groupmode or !$groupid)) {
// get the plugins to add their own files to the zip
$user = $DB->get_record("user", array("id"=>$userid),'id,username,firstname,lastname', MUST_EXIST);
$prefix = clean_filename(fullname($user) . "_" .$userid . "_");
foreach ($this->submissionplugins as $plugin) {
if ($plugin->is_enabled() && $plugin->is_visible()) {
$pluginfiles = $plugin->get_files($submission);
foreach ($pluginfiles as $zipfilename => $file) {
$filesforzipping[$prefix . $zipfilename] = $file;
}
}
}
}
} // end of foreach loop
if ($zipfile = $this->pack_files($filesforzipping)) {
$this->add_to_log('download all submissions', get_string('downloadall', 'assign'));
send_temp_file($zipfile, $filename); //send file and delete after sending.
}
}
/**
* Util function to add a message to the log
*
* @param string $action The current action
* @param string $info A detailed description of the change. But no more than 255 characters.
* @param string $url The url to the assign module instance.
* @return void
*/
public function add_to_log($action = '', $info = '', $url='') {
global $USER;
$fullurl = 'view.php?id=' . $this->get_course_module()->id;
if ($url != '') {
$fullurl .= '&' . $url;
}
add_to_log($this->get_course()->id, 'assign', $action, $fullurl, $info, $this->get_course_module()->id, $USER->id);
}
/**
* Load the submission object for a particular user, optionally creating it if required
*
* @param int $userid The id of the user whose submission we want or 0 in which case USER->id is used
* @param bool $create optional Defaults to false. If set to true a new submission object will be created in the database
* @return stdClass The submission
*/
private function get_user_submission($userid, $create) {
global $DB, $USER;
if (!$userid) {
$userid = $USER->id;
}
// if the userid is not null then use userid
$submission = $DB->get_record('assign_submission', array('assignment'=>$this->get_instance()->id, 'userid'=>$userid));
if ($submission) {
return $submission;
}
if ($create) {
$submission = new stdClass();
$submission->assignment = $this->get_instance()->id;
$submission->userid = $userid;
$submission->timecreated = time();
$submission->timemodified = $submission->timecreated;
if ($this->get_instance()->submissiondrafts) {
$submission->status = ASSIGN_SUBMISSION_STATUS_DRAFT;
} else {
$submission->status = ASSIGN_SUBMISSION_STATUS_SUBMITTED;
}
$sid = $DB->insert_record('assign_submission', $submission);
$submission->id = $sid;
return $submission;
}
return false;
}
/**
* Load the submission object from it's id
*
* @param int $submissionid The id of the submission we want
* @return stdClass The submission
*/
private function get_submission($submissionid) {
global $DB;
return $DB->get_record('assign_submission', array('assignment'=>$this->get_instance()->id, 'id'=>$submissionid), '*', MUST_EXIST);
}
/**
* This will retrieve a grade object from the db, optionally creating it if required
*
* @param int $userid The user we are grading
* @param bool $create If true the grade will be created if it does not exist
* @return stdClass The grade record
*/
private function get_user_grade($userid, $create) {
global $DB, $USER;
if (!$userid) {
$userid = $USER->id;
}
// if the userid is not null then use userid
$grade = $DB->get_record('assign_grades', array('assignment'=>$this->get_instance()->id, 'userid'=>$userid));
if ($grade) {
return $grade;
}
if ($create) {
$grade = new stdClass();
$grade->assignment = $this->get_instance()->id;
$grade->userid = $userid;
$grade->timecreated = time();
$grade->timemodified = $grade->timecreated;
$grade->locked = 0;
$grade->grade = -1;
$grade->grader = $USER->id;
$gid = $DB->insert_record('assign_grades', $grade);
$grade->id = $gid;
return $grade;
}
return false;
}
/**
* This will retrieve a grade object from the db
*
* @param int $gradeid The id of the grade
* @return stdClass The grade record
*/
private function get_grade($gradeid) {
global $DB;
return $DB->get_record('assign_grades', array('assignment'=>$this->get_instance()->id, 'id'=>$gradeid), '*', MUST_EXIST);
}
/**
* Print the grading page for a single user submission
*
* @param moodleform $mform
* @param int $offset
* @return string
*/
private function view_single_grade_page($mform, $offset=0) {
global $DB, $CFG;
$o = '';
// Include grade form
require_once($CFG->dirroot . '/mod/assign/gradeform.php');
// Need submit permission to submit an assignment
require_capability('mod/assign:grade', $this->context);
$o .= $this->output->render(new assign_header($this->get_instance(),
$this->get_context(), false, $this->get_course_module()->id,get_string('grading', 'assign')));
$rownum = required_param('rownum', PARAM_INT) + $offset;
$useridlist = optional_param('useridlist', '', PARAM_TEXT);
if ($useridlist) {
$useridlist = explode(',', $useridlist);
} else {
$useridlist = $this->get_grading_userid_list();
}
$last = false;
$userid = $useridlist[$rownum];
if ($rownum == count($useridlist) - 1) {
$last = true;
}
if (!$userid) {
throw new coding_exception('Row is out of bounds for the current grading table: ' . $rownum);
}
$user = $DB->get_record('user', array('id' => $userid));
if ($user) {
$o .= $this->output->render(new assign_user_summary($user, $this->get_course()->id, has_capability('moodle/site:viewfullnames', $this->get_course_context())));
}
$submission = $this->get_user_submission($userid, false);
// get the current grade
$grade = $this->get_user_grade($userid, false);
if ($this->can_view_submission($userid)) {
$gradelocked = ($grade && $grade->locked) || $this->grading_disabled($userid);
$o .= $this->output->render(new assign_submission_status($this->get_instance()->allowsubmissionsfromdate,
$this->get_instance()->alwaysshowdescription,
$submission,
$this->is_any_submission_plugin_enabled(),
$gradelocked,
$this->is_graded($userid),
$this->get_instance()->duedate,
$this->get_submission_plugins(),
$this->get_return_action(),
$this->get_return_params(),
$this->get_course_module()->id,
assign_submission_status::GRADER_VIEW,
false,
false));
}
if ($grade) {
$data = new stdClass();
if ($grade->grade !== NULL && $grade->grade >= 0) {
$data->grade = format_float($grade->grade,2);
}
} else {
$data = new stdClass();
$data->grade = '';
}
// now show the grading form
if (!$mform) {
$mform = new mod_assign_grade_form(null, array($this, $data, array('rownum'=>$rownum, 'useridlist'=>$useridlist, 'last'=>$last)), 'post', '', array('class'=>'gradeform'));
}
$o .= $this->output->render(new assign_form('gradingform',$mform));
$this->add_to_log('view grading form', get_string('viewgradingformforstudent', 'assign', array('id'=>$user->id, 'fullname'=>fullname($user))));
$o .= $this->view_footer();
return $o;
}
/**
* View a link to go back to the previous page. Uses url parameters returnaction and returnparams.
*
* @return string
*/
private function view_return_links() {
$returnaction = optional_param('returnaction','', PARAM_ALPHA);
$returnparams = optional_param('returnparams','', PARAM_TEXT);
$params = array();
parse_str($returnparams, $params);
$params = array_merge( array('id' => $this->get_course_module()->id, 'action' => $returnaction), $params);
return $this->output->single_button(new moodle_url('/mod/assign/view.php', $params), get_string('back'), 'get');
}
/**
* View the grading table of all submissions for this assignment
*
* @return string
*/
private function view_grading_table() {
global $USER, $CFG;
// Include grading options form
require_once($CFG->dirroot . '/mod/assign/gradingoptionsform.php');
require_once($CFG->dirroot . '/mod/assign/quickgradingform.php');
require_once($CFG->dirroot . '/mod/assign/gradingbatchoperationsform.php');
$o = '';
$links = array();
if (has_capability('gradereport/grader:view', $this->get_course_context()) &&
has_capability('moodle/grade:viewall', $this->get_course_context())) {
$gradebookurl = '/grade/report/grader/index.php?id=' . $this->get_course()->id;
$links[$gradebookurl] = get_string('viewgradebook', 'assign');
}
if ($this->is_any_submission_plugin_enabled()) {
$downloadurl = '/mod/assign/view.php?id=' . $this->get_course_module()->id . '&action=downloadall';
$links[$downloadurl] = get_string('downloadall', 'assign');
}
$gradingactions = new url_select($links);
$gradingmanager = get_grading_manager($this->get_context(), 'mod_assign', 'submissions');
$perpage = get_user_preferences('assign_perpage', 10);
$filter = get_user_preferences('assign_filter', '');
$controller = $gradingmanager->get_active_controller();
$showquickgrading = empty($controller);
if (optional_param('action', '', PARAM_ALPHA) == 'saveoptions') {
$quickgrading = optional_param('quickgrading', false, PARAM_BOOL);
set_user_preference('assign_quickgrading', $quickgrading);
}
$quickgrading = get_user_preferences('assign_quickgrading', false);
// print options for changing the filter and changing the number of results per page
$gradingoptionsform = new mod_assign_grading_options_form(null,
array('cm'=>$this->get_course_module()->id,
'contextid'=>$this->context->id,
'userid'=>$USER->id,
'submissionsenabled'=>$this->is_any_submission_plugin_enabled(),
'showquickgrading'=>$showquickgrading,
'quickgrading'=>$quickgrading),
'post', '',
array('class'=>'gradingoptionsform'));
$gradingbatchoperationsform = new mod_assign_grading_batch_operations_form(null,
array('cm'=>$this->get_course_module()->id,
'submissiondrafts'=>$this->get_instance()->submissiondrafts),
'post', '',
array('class'=>'gradingbatchoperationsform'));
$gradingoptionsdata = new stdClass();
$gradingoptionsdata->perpage = $perpage;
$gradingoptionsdata->filter = $filter;
$gradingoptionsform->set_data($gradingoptionsdata);
$actionformtext = $this->output->render($gradingactions);
$o .= $this->output->render(new assign_header($this->get_instance(),
$this->get_context(), false, $this->get_course_module()->id, get_string('grading', 'assign'), $actionformtext));
$o .= groups_print_activity_menu($this->get_course_module(), $CFG->wwwroot . '/mod/assign/view.php?id=' . $this->get_course_module()->id.'&action=grading', true);
// plagiarism update status apearring in the grading book
if (!empty($CFG->enableplagiarism)) {
/** Include plagiarismlib.php */
require_once($CFG->libdir . '/plagiarismlib.php');
$o .= plagiarism_update_status($this->get_course(), $this->get_course_module());
}
// load and print the table of submissions
if ($showquickgrading && $quickgrading) {
$table = $this->output->render(new assign_grading_table($this, $perpage, $filter, 0, true));
$quickgradingform = new mod_assign_quick_grading_form(null,
array('cm'=>$this->get_course_module()->id,
'gradingtable'=>$table));
$o .= $this->output->render(new assign_form('quickgradingform', $quickgradingform));
} else {
$o .= $this->output->render(new assign_grading_table($this, $perpage, $filter, 0, false));
}
$currentgroup = groups_get_activity_group($this->get_course_module(), true);
$users = array_keys($this->list_participants($currentgroup, true));
if (count($users) != 0) {
// if no enrolled user in a course then don't display the batch operations feature
$o .= $this->output->render(new assign_form('gradingbatchoperationsform', $gradingbatchoperationsform));
}
$o .= $this->output->render(new assign_form('gradingoptionsform', $gradingoptionsform, 'M.mod_assign.init_grading_options'));
return $o;
}
/**
* View entire grading page.
*
* @return string
*/
private function view_grading_page() {
global $CFG;
$o = '';
// Need submit permission to submit an assignment
require_capability('mod/assign:grade', $this->context);
require_once($CFG->dirroot . '/mod/assign/gradeform.php');
// only load this if it is
$o .= $this->view_grading_table();
$o .= $this->view_footer();
$this->add_to_log('view submission grading table', get_string('viewsubmissiongradingtable', 'assign'));
return $o;
}
/**
* Capture the output of the plagiarism plugins disclosures and return it as a string
*
* @return void
*/
private function plagiarism_print_disclosure() {
global $CFG;
$o = '';
if (!empty($CFG->enableplagiarism)) {
/** Include plagiarismlib.php */
require_once($CFG->libdir . '/plagiarismlib.php');
$o .= plagiarism_print_disclosure($this->get_course_module()->id);
}
return $o;
}
/**
* message for students when assignment submissions have been closed
*
* @return string
*/
private function view_student_error_message() {
global $CFG;
$o = '';
// Need submit permission to submit an assignment
require_capability('mod/assign:submit', $this->context);
$o .= $this->output->render(new assign_header($this->get_instance(),
$this->get_context(),
$this->show_intro(),
$this->get_course_module()->id,
get_string('editsubmission', 'assign')));
$o .= $this->output->notification(get_string('submissionsclosed', 'assign'));
$o .= $this->view_footer();
return $o;
}
/**
* View edit submissions page.
*
* @param moodleform $mform
* @return void
*/
private function view_edit_submission_page($mform) {
global $CFG;
$o = '';
// Include submission form
require_once($CFG->dirroot . '/mod/assign/submission_form.php');
// Need submit permission to submit an assignment
require_capability('mod/assign:submit', $this->context);
if (!$this->submissions_open()) {
return $this->view_student_error_message();
}
$o .= $this->output->render(new assign_header($this->get_instance(),
$this->get_context(),
$this->show_intro(),
$this->get_course_module()->id,
get_string('editsubmission', 'assign')));
$o .= $this->plagiarism_print_disclosure();
$data = new stdClass();
if (!$mform) {
$mform = new mod_assign_submission_form(null, array($this, $data));
}
$o .= $this->output->render(new assign_form('editsubmissionform',$mform));
$o .= $this->view_footer();
$this->add_to_log('view submit assignment form', get_string('viewownsubmissionform', 'assign'));
return $o;
}
/**
* See if this assignment has a grade yet
*
* @param int $userid
* @return bool
*/
private function is_graded($userid) {
$grade = $this->get_user_grade($userid, false);
if ($grade) {
return ($grade->grade !== NULL && $grade->grade >= 0);
}
return false;
}
/**
* Perform an access check to see if the current $USER can view this users submission
*
* @param int $userid
* @return bool
*/
public function can_view_submission($userid) {
global $USER;
if (!is_enrolled($this->get_course_context(), $userid)) {
return false;
}
if ($userid == $USER->id && !has_capability('mod/assign:submit', $this->context)) {
return false;
}
if ($userid != $USER->id && !has_capability('mod/assign:grade', $this->context)) {
return false;
}
return true;
}
/**
* Ask the user to confirm they want to perform this batch operation
* @return string
*/
private function process_batch_grading_operation() {
global $CFG;
require_once($CFG->dirroot . '/mod/assign/gradingbatchoperationsform.php');
require_sesskey();
$gradingbatchoperationsform = new mod_assign_grading_batch_operations_form(null,
array('cm'=>$this->get_course_module()->id,
'submissiondrafts'=>$this->get_instance()->submissiondrafts),
'post', '',
array('class'=>'gradingbatchoperationsform'));
if ($data = $gradingbatchoperationsform->get_data()) {
// get the list of users
$users = $data->selectedusers;
$userlist = explode(',', $users);
foreach ($userlist as $userid) {
if ($data->operation == 'lock') {
$this->process_lock($userid);
} else if ($data->operation == 'unlock') {
$this->process_unlock($userid);
} else if ($data->operation == 'reverttodraft') {
$this->process_revert_to_draft($userid);
}
}
}
return true;
}
/**
* Ask the user to confirm they want to submit their work for grading
* @return string
*/
private function check_submit_for_grading() {
global $USER;
// Check that all of the submission plugins are ready for this submission
$notifications = array();
$submission = $this->get_user_submission($USER->id, false);
$plugins = $this->get_submission_plugins();
foreach ($plugins as $plugin) {
if ($plugin->is_enabled() && $plugin->is_visible()) {
$check = $plugin->precheck_submission($submission);
if ($check !== true) {
$notifications[] = $check;
}
}
}
$o = '';
$o .= $this->output->header();
$o .= $this->output->render(new assign_submit_for_grading_page($notifications, $this->get_course_module()->id));
$o .= $this->view_footer();
return $o;
}
/**
* Print 2 tables of information with no action links -
* the submission summary and the grading summary
*
* @param stdClass $user the user to print the report for
* @param bool $showlinks - Return plain text or links to the profile
* @return string - the html summary
*/
public function view_student_summary($user, $showlinks) {
global $CFG, $DB, $PAGE;
$grade = $this->get_user_grade($user->id, false);
$submission = $this->get_user_submission($user->id, false);
$o = '';
if ($this->can_view_submission($user->id)) {
$showedit = has_capability('mod/assign:submit', $this->context) &&
$this->submissions_open() && ($this->is_any_submission_plugin_enabled()) && $showlinks;
$showsubmit = $submission && ($submission->status == ASSIGN_SUBMISSION_STATUS_DRAFT) && $showlinks;
$gradelocked = ($grade && $grade->locked) || $this->grading_disabled($user->id);
$o .= $this->output->render(new assign_submission_status($this->get_instance()->allowsubmissionsfromdate,
$this->get_instance()->alwaysshowdescription,
$submission,
$this->is_any_submission_plugin_enabled(),
$gradelocked,
$this->is_graded($user->id),
$this->get_instance()->duedate,
$this->get_submission_plugins(),
$this->get_return_action(),
$this->get_return_params(),
$this->get_course_module()->id,
assign_submission_status::STUDENT_VIEW,
$showedit,
$showsubmit));
require_once($CFG->libdir.'/gradelib.php');
require_once($CFG->dirroot.'/grade/grading/lib.php');
$gradinginfo = grade_get_grades($this->get_course()->id,
'mod',
'assign',
$this->get_instance()->id,
$user->id);
$gradingitem = $gradinginfo->items[0];
$gradebookgrade = $gradingitem->grades[$user->id];
// check to see if all feedback plugins are empty
$emptyplugins = true;
if ($grade) {
foreach ($this->get_feedback_plugins() as $plugin) {
if ($plugin->is_visible() && $plugin->is_enabled()) {
if (!$plugin->is_empty($grade)) {
$emptyplugins = false;
}
}
}
}
if (!($gradebookgrade->hidden) && ($gradebookgrade->grade !== null || !$emptyplugins)) {
$gradefordisplay = '';
$gradingmanager = get_grading_manager($this->get_context(), 'mod_assign', 'submissions');
if ($controller = $gradingmanager->get_active_controller()) {
$controller->set_grade_range(make_grades_menu($this->get_instance()->grade));
$gradefordisplay = $controller->render_grade($PAGE,
$grade->id,
$gradingitem,
$gradebookgrade->str_long_grade,
has_capability('mod/assign:grade', $this->get_context()));
} else {
$gradefordisplay = $this->display_grade($gradebookgrade->grade, false);
}
$gradeddate = $gradebookgrade->dategraded;
$grader = $DB->get_record('user', array('id'=>$gradebookgrade->usermodified));
$feedbackstatus = new assign_feedback_status($gradefordisplay,
$gradeddate,
$grader,
$this->get_feedback_plugins(),
$grade,
$this->get_course_module()->id,
$this->get_return_action(),
$this->get_return_params());
$o .= $this->output->render($feedbackstatus);
}
}
return $o;
}
/**
* View submissions page (contains details of current submission).
*
* @return string
*/
private function view_submission_page() {
global $CFG, $DB, $USER, $PAGE;
$o = '';
$o .= $this->output->render(new assign_header($this->get_instance(),
$this->get_context(),
$this->show_intro(),
$this->get_course_module()->id));
if ($this->can_grade()) {
$o .= $this->output->render(new assign_grading_summary($this->count_participants(0),
$this->get_instance()->submissiondrafts,
$this->count_submissions_with_status(ASSIGN_SUBMISSION_STATUS_DRAFT),
$this->is_any_submission_plugin_enabled(),
$this->count_submissions_with_status(ASSIGN_SUBMISSION_STATUS_SUBMITTED),
$this->get_instance()->duedate,
$this->get_course_module()->id,
$this->count_submissions_need_grading()
));
}
$grade = $this->get_user_grade($USER->id, false);
$submission = $this->get_user_submission($USER->id, false);
if ($this->can_view_submission($USER->id)) {
$o .= $this->view_student_summary($USER, true);
}
$o .= $this->view_footer();
$this->add_to_log('view', get_string('viewownsubmissionstatus', 'assign'));
return $o;
}
/**
* convert the final raw grade(s) in the grading table for the gradebook
*
* @param stdClass $grade
* @return array
*/
private function convert_grade_for_gradebook(stdClass $grade) {
$gradebookgrade = array();
// trying to match those array keys in grade update function in gradelib.php
// with keys in th database table assign_grades
// starting around line 262
if ($grade->grade >= 0) {
$gradebookgrade['rawgrade'] = $grade->grade;
}
$gradebookgrade['userid'] = $grade->userid;
$gradebookgrade['usermodified'] = $grade->grader;
$gradebookgrade['datesubmitted'] = NULL;
$gradebookgrade['dategraded'] = $grade->timemodified;
if (isset($grade->feedbackformat)) {
$gradebookgrade['feedbackformat'] = $grade->feedbackformat;
}
if (isset($grade->feedbacktext)) {
$gradebookgrade['feedback'] = $grade->feedbacktext;
}
return $gradebookgrade;
}
/**
* convert submission details for the gradebook
*
* @param stdClass $submission
* @return array
*/
private function convert_submission_for_gradebook(stdClass $submission) {
$gradebookgrade = array();
$gradebookgrade['userid'] = $submission->userid;
$gradebookgrade['usermodified'] = $submission->userid;
$gradebookgrade['datesubmitted'] = $submission->timemodified;
return $gradebookgrade;
}
/**
* update grades in the gradebook
*
* @param mixed $submission stdClass|null
* @param mixed $grade stdClass|null
* @return bool
*/
private function gradebook_item_update($submission=NULL, $grade=NULL) {
if($submission != NULL){
$gradebookgrade = $this->convert_submission_for_gradebook($submission);
}else{
$gradebookgrade = $this->convert_grade_for_gradebook($grade);
}
// Grading is disabled, return.
if ($this->grading_disabled($gradebookgrade['userid'])) {
return false;
}
$assign = clone $this->get_instance();
$assign->cmidnumber = $this->get_course_module()->id;
return assign_grade_item_update($assign, $gradebookgrade);
}
/**
* update grades in the gradebook based on submission time
*
* @param stdClass $submission
* @param bool $updatetime
* @return bool
*/
private function update_submission(stdClass $submission, $updatetime=true) {
global $DB;
if ($updatetime) {
$submission->timemodified = time();
}
$result= $DB->update_record('assign_submission', $submission);
if ($result) {
$this->gradebook_item_update($submission);
}
return $result;
}
/**
* Is this assignment open for submissions?
*
* Check the due date,
* prevent late submissions,
* has this person already submitted,
* is the assignment locked?
*
* @return bool
*/
private function submissions_open() {
global $USER;
$time = time();
$dateopen = true;
if ($this->get_instance()->preventlatesubmissions && $this->get_instance()->duedate) {
$dateopen = ($this->get_instance()->allowsubmissionsfromdate <= $time && $time <= $this->get_instance()->duedate);
} else {
$dateopen = ($this->get_instance()->allowsubmissionsfromdate <= $time);
}
if (!$dateopen) {
return false;
}
// now check if this user has already submitted etc.
if (!is_enrolled($this->get_course_context(), $USER)) {
return false;
}
if ($submission = $this->get_user_submission($USER->id, false)) {
if ($this->get_instance()->submissiondrafts && $submission->status == ASSIGN_SUBMISSION_STATUS_SUBMITTED) {
// drafts are tracked and the student has submitted the assignment
return false;
}
}
if ($grade = $this->get_user_grade($USER->id, false)) {
if ($grade->locked) {
return false;
}
}
if ($this->grading_disabled($USER->id)) {
return false;
}
return true;
}
/**
* render the files in file area
* @param string $component
* @param string $area
* @param int $submissionid
* @return string
*/
public function render_area_files($component, $area, $submissionid) {
global $USER;
if (!$submissionid) {
$submission = $this->get_user_submission($USER->id,false);
$submissionid = $submission->id;
}
$fs = get_file_storage();
$browser = get_file_browser();
$files = $fs->get_area_files($this->get_context()->id, $component, $area , $submissionid , "timemodified", false);
return $this->output->assign_files($this->context, $submissionid, $area, $component);
}
/**
* Returns a list of teachers that should be grading given submission
*
* @param int $userid
* @return array
*/
private function get_graders($userid) {
//potential graders
$potentialgraders = get_enrolled_users($this->context, "mod/assign:grade");
$graders = array();
if (groups_get_activity_groupmode($this->get_course_module()) == SEPARATEGROUPS) { // Separate groups are being used
if ($groups = groups_get_all_groups($this->get_course()->id, $userid)) { // Try to find all groups
foreach ($groups as $group) {
foreach ($potentialgraders as $grader) {
if ($grader->id == $userid) {
continue; // do not send self
}
if (groups_is_member($group->id, $grader->id)) {
$graders[$grader->id] = $grader;
}
}
}
} else {
// user not in group, try to find graders without group
foreach ($potentialgraders as $grader) {
if ($grader->id == $userid) {
continue; // do not send self
}
if (!groups_has_membership($this->get_course_module(), $grader->id)) {
$graders[$grader->id] = $grader;
}
}
}
} else {
foreach ($potentialgraders as $grader) {
if ($grader->id == $userid) {
continue; // do not send self
}
// must be enrolled
if (is_enrolled($this->get_course_context(), $grader->id)) {
$graders[$grader->id] = $grader;
}
}
}
return $graders;
}
/**
* Format a notification for plain text
*
* @param string $messagetype
* @param stdClass $info
* @param stdClass $course
* @param stdClass $context
* @param string $modulename
* @param string $assignmentname
*/
private static function format_notification_message_text($messagetype, $info, $course, $context, $modulename, $assignmentname) {
$posttext = format_string($course->shortname, true, array('context' => $context->get_course_context())).' -> '.
$modulename.' -> '.
format_string($assignmentname, true, array('context' => $context))."\n";
$posttext .= '---------------------------------------------------------------------'."\n";
$posttext .= get_string($messagetype . 'text', "assign", $info)."\n";
$posttext .= "\n---------------------------------------------------------------------\n";
return $posttext;
}
/**
* Format a notification for HTML
*
* @param string $messagetype
* @param stdClass $info
* @param stdClass $course
* @param stdClass $context
* @param string $modulename
* @param stdClass $coursemodule
* @param string $assignmentname
* @param stdClass $info
*/
private static function format_notification_message_html($messagetype, $info, $course, $context, $modulename, $coursemodule, $assignmentname) {
global $CFG;
$posthtml = '<p><font face="sans-serif">'.
'<a href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">'.format_string($course->shortname, true, array('context' => $context->get_course_context())).'</a> ->'.
'<a href="'.$CFG->wwwroot.'/mod/assign/index.php?id='.$course->id.'">'.$modulename.'</a> ->'.
'<a href="'.$CFG->wwwroot.'/mod/assign/view.php?id='.$coursemodule->id.'">'.format_string($assignmentname, true, array('context' => $context)).'</a></font></p>';
$posthtml .= '<hr /><font face="sans-serif">';
$posthtml .= '<p>'.get_string($messagetype . 'html', 'assign', $info).'</p>';
$posthtml .= '</font><hr />';
return $posthtml;
}
/**
* Message someone about something (static so it can be called from cron)
*
* @param stdClass $userfrom
* @param stdClass $userto
* @param string $messagetype
* @param string $eventtype
* @param int $updatetime
* @param stdClass $coursemodule
* @param stdClass $context
* @param stdClass $course
* @param string $modulename
* @param string $assignmentname
* @return void
*/
public static function send_assignment_notification($userfrom, $userto, $messagetype, $eventtype,
$updatetime, $coursemodule, $context, $course,
$modulename, $assignmentname) {
global $CFG;
$info = new stdClass();
$info->username = fullname($userfrom, true);
$info->assignment = format_string($assignmentname,true, array('context'=>$context));
$info->url = $CFG->wwwroot.'/mod/assign/view.php?id='.$coursemodule->id;
$info->timeupdated = strftime('%c',$updatetime);
$postsubject = get_string($messagetype . 'small', 'assign', $info);
$posttext = self::format_notification_message_text($messagetype, $info, $course, $context, $modulename, $assignmentname);
$posthtml = ($userto->mailformat == 1) ? self::format_notification_message_html($messagetype, $info, $course, $context, $modulename, $coursemodule, $assignmentname) : '';
$eventdata = new stdClass();
$eventdata->modulename = 'assign';
$eventdata->userfrom = $userfrom;
$eventdata->userto = $userto;
$eventdata->subject = $postsubject;
$eventdata->fullmessage = $posttext;
$eventdata->fullmessageformat = FORMAT_PLAIN;
$eventdata->fullmessagehtml = $posthtml;
$eventdata->smallmessage = $postsubject;
$eventdata->name = $eventtype;
$eventdata->component = 'mod_assign';
$eventdata->notification = 1;
$eventdata->contexturl = $info->url;
$eventdata->contexturlname = $info->assignment;
message_send($eventdata);
}
/**
* Message someone about something
*
* @param stdClass $userfrom
* @param stdClass $userto
* @param string $messagetype
* @param string $eventtype
* @param int $updatetime
* @return void
*/
public function send_notification($userfrom, $userto, $messagetype, $eventtype, $updatetime) {
self::send_assignment_notification($userfrom, $userto, $messagetype, $eventtype, $updatetime, $this->get_course_module(), $this->get_context(), $this->get_course(), $this->get_module_name(), $this->get_instance()->name);
}
/**
* Notify student upon successful submission
*
* @global moodle_database $DB
* @param stdClass $submission
* @return void
*/
private function notify_student_submission_receipt(stdClass $submission) {
global $DB;
$adminconfig = $this->get_admin_config();
if (!$adminconfig->submissionreceipts) {
// No need to do anything
return;
}
$user = $DB->get_record('user', array('id'=>$submission->userid), '*', MUST_EXIST);
$this->send_notification($user, $user, 'submissionreceipt', 'assign_notification', $submission->timemodified);
}
/**
* Send notifications to graders upon student submissions
*
* @global moodle_database $DB
* @param stdClass $submission
* @return void
*/
private function notify_graders(stdClass $submission) {
global $DB;
$late = $this->get_instance()->duedate && ($this->get_instance()->duedate < time());
if (!$this->get_instance()->sendnotifications && !($late && $this->get_instance()->sendlatenotifications)) { // No need to do anything
return;
}
$user = $DB->get_record('user', array('id'=>$submission->userid), '*', MUST_EXIST);
if ($teachers = $this->get_graders($user->id)) {
foreach ($teachers as $teacher) {
$this->send_notification($user, $teacher, 'gradersubmissionupdated', 'assign_notification', $submission->timemodified);
}
}
}
/**
* assignment submission is processed before grading
*
* @return void
*/
private function process_submit_for_grading() {
global $USER;
// Need submit permission to submit an assignment
require_capability('mod/assign:submit', $this->context);
require_sesskey();
$submission = $this->get_user_submission($USER->id,true);
if ($submission->status != ASSIGN_SUBMISSION_STATUS_SUBMITTED) {
// Give each submission plugin a chance to process the submission
$plugins = $this->get_submission_plugins();
foreach ($plugins as $plugin) {
$plugin->submit_for_grading();
}
$submission->status = ASSIGN_SUBMISSION_STATUS_SUBMITTED;
$this->update_submission($submission);
$this->add_to_log('submit for grading', $this->format_submission_for_log($submission));
$this->notify_graders($submission);
$this->notify_student_submission_receipt($submission);
}
}
/**
* save quick grades
*
* @global moodle_database $DB
* @return string The result of the save operation
*/
private function process_save_quick_grades() {
global $USER, $DB, $CFG;
// Need grade permission
require_capability('mod/assign:grade', $this->context);
// make sure advanced grading is disabled
$gradingmanager = get_grading_manager($this->get_context(), 'mod_assign', 'submissions');
$controller = $gradingmanager->get_active_controller();
if (!empty($controller)) {
return get_string('errorquickgradingvsadvancedgrading', 'assign');
}
$users = array();
// first check all the last modified values
$currentgroup = groups_get_activity_group($this->get_course_module(), true);
$participants = $this->list_participants($currentgroup, true);
// gets a list of possible users and look for values based upon that.
foreach ($participants as $userid => $unused) {
$modified = optional_param('grademodified_' . $userid, -1, PARAM_INT);
if ($modified >= 0) {
// gather the userid, updated grade and last modified value
$record = new stdClass();
$record->userid = $userid;
$record->grade = unformat_float(required_param('quickgrade_' . $record->userid, PARAM_TEXT));
$record->lastmodified = $modified;
$record->gradinginfo = grade_get_grades($this->get_course()->id, 'mod', 'assign', $this->get_instance()->id, array($userid));
$users[$userid] = $record;
}
}
if (empty($users)) {
// Quick check to see whether we have any users to update and we don't
return get_string('quickgradingchangessaved', 'assign'); // Technical lie
}
list($userids, $params) = $DB->get_in_or_equal(array_keys($users), SQL_PARAMS_NAMED);
$params['assignment'] = $this->get_instance()->id;
// check them all for currency
$sql = 'SELECT u.id as userid, g.grade as grade, g.timemodified as lastmodified
FROM {user} u
LEFT JOIN {assign_grades} g ON u.id = g.userid AND g.assignment = :assignment
WHERE u.id ' . $userids;
$currentgrades = $DB->get_recordset_sql($sql, $params);
$modifiedusers = array();
foreach ($currentgrades as $current) {
$modified = $users[(int)$current->userid];
$grade = $this->get_user_grade($userid, false);
// check to see if the outcomes were modified
if ($CFG->enableoutcomes) {
foreach ($modified->gradinginfo->outcomes as $outcomeid => $outcome) {
$oldoutcome = $outcome->grades[$modified->userid]->grade;
$newoutcome = optional_param('outcome_' . $outcomeid . '_' . $modified->userid, -1, PARAM_FLOAT);
if ($oldoutcome != $newoutcome) {
// can't check modified time for outcomes because it is not reported
$modifiedusers[$modified->userid] = $modified;
continue;
}
}
}
// let plugins participate
foreach ($this->feedbackplugins as $plugin) {
if ($plugin->is_visible() && $plugin->is_enabled() && $plugin->supports_quickgrading()) {
if ($plugin->is_quickgrading_modified($modified->userid, $grade)) {
if ((int)$current->lastmodified > (int)$modified->lastmodified) {
return get_string('errorrecordmodified', 'assign');
} else {
$modifiedusers[$modified->userid] = $modified;
continue;
}
}
}
}
if (($current->grade < 0 || $current->grade === NULL) &&
($modified->grade < 0 || $modified->grade === NULL)) {
// different ways to indicate no grade
continue;
}
// Treat 0 and null as different values
if ($current->grade !== null) {
$current->grade = floatval($current->grade);
}
if ($current->grade !== $modified->grade) {
// grade changed
if ($this->grading_disabled($modified->userid)) {
continue;
}
if ((int)$current->lastmodified > (int)$modified->lastmodified) {
// error - record has been modified since viewing the page
return get_string('errorrecordmodified', 'assign');
} else {
$modifiedusers[$modified->userid] = $modified;
}
}
}
$currentgrades->close();
$adminconfig = $this->get_admin_config();
$gradebookplugin = $adminconfig->feedback_plugin_for_gradebook;
// ok - ready to process the updates
foreach ($modifiedusers as $userid => $modified) {
$grade = $this->get_user_grade($userid, true);
$grade->grade= grade_floatval(unformat_float($modified->grade));
$grade->grader= $USER->id;
// save plugins data
foreach ($this->feedbackplugins as $plugin) {
if ($plugin->is_visible() && $plugin->is_enabled() && $plugin->supports_quickgrading()) {
$plugin->save_quickgrading_changes($userid, $grade);
if (('assignfeedback_' . $plugin->get_type()) == $gradebookplugin) {
// This is the feedback plugin chose to push comments to the gradebook.
$grade->feedbacktext = $plugin->text_for_gradebook($grade);
$grade->feedbackformat = $plugin->format_for_gradebook($grade);
}
}
}
$this->update_grade($grade);
// save outcomes
if ($CFG->enableoutcomes) {
$data = array();
foreach ($modified->gradinginfo->outcomes as $outcomeid => $outcome) {
$oldoutcome = $outcome->grades[$modified->userid]->grade;
$newoutcome = optional_param('outcome_' . $outcomeid . '_' . $modified->userid, -1, PARAM_INT);
if ($oldoutcome != $newoutcome) {
$data[$outcomeid] = $newoutcome;
}
}
if (count($data) > 0) {
grade_update_outcomes('mod/assign', $this->course->id, 'mod', 'assign', $this->get_instance()->id, $userid, $data);
}
}
$this->add_to_log('grade submission', $this->format_grade_for_log($grade));
}
return get_string('quickgradingchangessaved', 'assign');
}
/**
* save grading options
*
* @return void
*/
private function process_save_grading_options() {
global $USER, $CFG;
// Include grading options form
require_once($CFG->dirroot . '/mod/assign/gradingoptionsform.php');
// Need submit permission to submit an assignment
require_capability('mod/assign:grade', $this->context);
$mform = new mod_assign_grading_options_form(null, array('cm'=>$this->get_course_module()->id,
'contextid'=>$this->context->id,
'userid'=>$USER->id,
'submissionsenabled'=>$this->is_any_submission_plugin_enabled(),
'showquickgrading'=>false));
if ($formdata = $mform->get_data()) {
set_user_preference('assign_perpage', $formdata->perpage);
if (isset($formdata->filter)) {
set_user_preference('assign_filter', $formdata->filter);
}
}
}
/**
* Take a grade object and print a short summary for the log file.
* The size limit for the log file is 255 characters, so be careful not
* to include too much information.
*
* @param stdClass $grade
* @return string
*/
private function format_grade_for_log(stdClass $grade) {
global $DB;
$user = $DB->get_record('user', array('id' => $grade->userid), '*', MUST_EXIST);
$info = get_string('gradestudent', 'assign', array('id'=>$user->id, 'fullname'=>fullname($user)));
if ($grade->grade != '') {
$info .= get_string('grade') . ': ' . $this->display_grade($grade->grade, false) . '. ';
} else {
$info .= get_string('nograde', 'assign');
}
if ($grade->locked) {
$info .= get_string('submissionslocked', 'assign') . '. ';
}
return $info;
}
/**
* Take a submission object and print a short summary for the log file.
* The size limit for the log file is 255 characters, so be careful not
* to include too much information.
*
* @param stdClass $submission
* @return string
*/
private function format_submission_for_log(stdClass $submission) {
$info = '';
$info .= get_string('submissionstatus', 'assign') . ': ' . get_string('submissionstatus_' . $submission->status, 'assign') . '. <br>';
// format_for_log here iterating every single log INFO from either submission or grade in every assignment plugin
foreach ($this->submissionplugins as $plugin) {
if ($plugin->is_enabled() && $plugin->is_visible()) {
$info .= "<br>" . $plugin->format_for_log($submission);
}
}
return $info;
}
/**
* save assignment submission
*
* @param moodleform $mform
* @return bool
*/
private function process_save_submission(&$mform) {
global $USER, $CFG;
// Include submission form
require_once($CFG->dirroot . '/mod/assign/submission_form.php');
// Need submit permission to submit an assignment
require_capability('mod/assign:submit', $this->context);
require_sesskey();
$data = new stdClass();
$mform = new mod_assign_submission_form(null, array($this, $data));
if ($mform->is_cancelled()) {
return true;
}
if ($data = $mform->get_data()) {
$submission = $this->get_user_submission($USER->id, true); //create the submission if needed & its id
$grade = $this->get_user_grade($USER->id, false); // get the grade to check if it is locked
if ($grade && $grade->locked) {
print_error('submissionslocked', 'assign');
return true;
}
foreach ($this->submissionplugins as $plugin) {
if ($plugin->is_enabled()) {
if (!$plugin->save($submission, $data)) {
print_error($plugin->get_error());
}
}
}
$this->update_submission($submission);
// Logging
$this->add_to_log('submit', $this->format_submission_for_log($submission));
if (!$this->get_instance()->submissiondrafts) {
$this->notify_student_submission_receipt($submission);
$this->notify_graders($submission);
}
return true;
}
return false;
}
/**
* Determine if this users grade is locked or overridden
*
* @param int $userid - The student userid
* @return bool $gradingdisabled
*/
public function grading_disabled($userid) {
global $CFG;
$gradinginfo = grade_get_grades($this->get_course()->id, 'mod', 'assign', $this->get_instance()->id, array($userid));
if (!$gradinginfo) {
return false;
}
if (!isset($gradinginfo->items[0]->grades[$userid])) {
return false;
}
$gradingdisabled = $gradinginfo->items[0]->grades[$userid]->locked || $gradinginfo->items[0]->grades[$userid]->overridden;
return $gradingdisabled;
}
/**
* Get an instance of a grading form if advanced grading is enabled
* This is specific to the assignment, marker and student
*
* @param int $userid - The student userid
* @param bool $gradingdisabled
* @return mixed gradingform_instance|null $gradinginstance
*/
private function get_grading_instance($userid, $gradingdisabled) {
global $CFG, $USER;
$grade = $this->get_user_grade($userid, false);
$grademenu = make_grades_menu($this->get_instance()->grade);
$advancedgradingwarning = false;
$gradingmanager = get_grading_manager($this->context, 'mod_assign', 'submissions');
$gradinginstance = null;
if ($gradingmethod = $gradingmanager->get_active_method()) {
$controller = $gradingmanager->get_controller($gradingmethod);
if ($controller->is_form_available()) {
$itemid = null;
if ($grade) {
$itemid = $grade->id;
}
if ($gradingdisabled && $itemid) {
$gradinginstance = ($controller->get_current_instance($USER->id, $itemid));
} else if (!$gradingdisabled) {
$instanceid = optional_param('advancedgradinginstanceid', 0, PARAM_INT);
$gradinginstance = ($controller->get_or_create_instance($instanceid, $USER->id, $itemid));
}
} else {
$advancedgradingwarning = $controller->form_unavailable_notification();
}
}
if ($gradinginstance) {
$gradinginstance->get_controller()->set_grade_range($grademenu);
}
return $gradinginstance;
}
/**
* add elements to grade form
*
* @param MoodleQuickForm $mform
* @param stdClass $data
* @param array $params
* @return void
*/
public function add_grade_form_elements(MoodleQuickForm $mform, stdClass $data, $params) {
global $USER, $CFG;
$settings = $this->get_instance();
$rownum = $params['rownum'];
$last = $params['last'];
$useridlist = $params['useridlist'];
$userid = $useridlist[$rownum];
$grade = $this->get_user_grade($userid, false);
// add advanced grading
$gradingdisabled = $this->grading_disabled($userid);
$gradinginstance = $this->get_grading_instance($userid, $gradingdisabled);
if ($gradinginstance) {
$gradingelement = $mform->addElement('grading', 'advancedgrading', get_string('grade').':', array('gradinginstance' => $gradinginstance));
if ($gradingdisabled) {
$gradingelement->freeze();
} else {
$mform->addElement('hidden', 'advancedgradinginstanceid', $gradinginstance->get_id());
}
} else {
// use simple direct grading
if ($this->get_instance()->grade > 0) {
$gradingelement = $mform->addElement('text', 'grade', get_string('gradeoutof', 'assign',$this->get_instance()->grade));
$mform->addHelpButton('grade', 'gradeoutofhelp', 'assign');
$mform->setType('grade', PARAM_TEXT);
if ($gradingdisabled) {
$gradingelement->freeze();
}
} else {
$grademenu = make_grades_menu($this->get_instance()->grade);
if (count($grademenu) > 0) {
$gradingelement = $mform->addElement('select', 'grade', get_string('grade').':', $grademenu);
$mform->setType('grade', PARAM_INT);
if ($gradingdisabled) {
$gradingelement->freeze();
}
}
}
}
$gradinginfo = grade_get_grades($this->get_course()->id,
'mod',
'assign',
$this->get_instance()->id,
$userid);
if (!empty($CFG->enableoutcomes)) {
foreach($gradinginfo->outcomes as $index=>$outcome) {
$options = make_grades_menu(-$outcome->scaleid);
if ($outcome->grades[$userid]->locked) {
$options[0] = get_string('nooutcome', 'grades');
$mform->addElement('static', 'outcome_'.$index.'['.$userid.']', $outcome->name.':',
$options[$outcome->grades[$userid]->grade]);
} else {
$options[''] = get_string('nooutcome', 'grades');
$attributes = array('id' => 'menuoutcome_'.$index );
$mform->addElement('select', 'outcome_'.$index.'['.$userid.']', $outcome->name.':', $options, $attributes );
$mform->setType('outcome_'.$index.'['.$userid.']', PARAM_INT);
$mform->setDefault('outcome_'.$index.'['.$userid.']', $outcome->grades[$userid]->grade );
}
}
}
if (has_all_capabilities(array('gradereport/grader:view', 'moodle/grade:viewall'), $this->get_course_context())) {
$gradestring = $this->output->action_link(new moodle_url('/grade/report/grader/index.php',
array('id'=>$this->get_course()->id)),
$gradinginfo->items[0]->grades[$userid]->str_grade);
} else {
$gradestring = $gradinginfo->items[0]->grades[$userid]->str_grade;
}
$mform->addElement('static', 'finalgrade', get_string('currentgrade', 'assign').':', $gradestring);
$mform->addElement('static', 'progress', '', get_string('gradingstudentprogress', 'assign', array('index'=>$rownum+1, 'count'=>count($useridlist))));
// plugins
$this->add_plugin_grade_elements($grade, $mform, $data);
// hidden params
$mform->addElement('hidden', 'id', $this->get_course_module()->id);
$mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'rownum', $rownum);
$mform->setType('rownum', PARAM_INT);
$mform->setConstant('rownum', $rownum);
$mform->addElement('hidden', 'useridlist', implode(',', $useridlist));
$mform->setType('useridlist', PARAM_TEXT);
$mform->addElement('hidden', 'ajax', optional_param('ajax', 0, PARAM_INT));
$mform->setType('ajax', PARAM_INT);
$mform->addElement('hidden', 'action', 'submitgrade');
$mform->setType('action', PARAM_ALPHA);
$buttonarray=array();
$buttonarray[] = $mform->createElement('submit', 'savegrade', get_string('savechanges', 'assign'));
if (!$last){
$buttonarray[] = $mform->createElement('submit', 'saveandshownext', get_string('savenext','assign'));
}
$buttonarray[] = $mform->createElement('cancel', 'cancelbutton', get_string('cancel'));
$mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
$mform->closeHeaderBefore('buttonar');
$buttonarray=array();
if ($rownum > 0) {
$buttonarray[] = $mform->createElement('submit', 'nosaveandprevious', get_string('previous','assign'));
}
if (!$last){
$buttonarray[] = $mform->createElement('submit', 'nosaveandnext', get_string('nosavebutnext', 'assign'));
}
$mform->addGroup($buttonarray, 'navar', '', array(' '), false);
}
/**
* add elements in submission plugin form
*
* @param mixed $submission stdClass|null
* @param MoodleQuickForm $mform
* @param stdClass $data
* @return void
*/
private function add_plugin_submission_elements($submission, MoodleQuickForm $mform, stdClass $data) {
foreach ($this->submissionplugins as $plugin) {
if ($plugin->is_enabled() && $plugin->is_visible() && $plugin->allow_submissions()) {
$mform->addElement('header', 'header_' . $plugin->get_type(), $plugin->get_name());
if (!$plugin->get_form_elements($submission, $mform, $data)) {
$mform->removeElement('header_' . $plugin->get_type());
}
}
}
}
/**
* check if feedback plugins installed are enabled
*
* @return bool
*/
public function is_any_feedback_plugin_enabled() {
if (!isset($this->cache['any_feedback_plugin_enabled'])) {
$this->cache['any_feedback_plugin_enabled'] = false;
foreach ($this->feedbackplugins as $plugin) {
if ($plugin->is_enabled() && $plugin->is_visible()) {
$this->cache['any_feedback_plugin_enabled'] = true;
break;
}
}
}
return $this->cache['any_feedback_plugin_enabled'];
}
/**
* check if submission plugins installed are enabled
*
* @return bool
*/
public function is_any_submission_plugin_enabled() {
if (!isset($this->cache['any_submission_plugin_enabled'])) {
$this->cache['any_submission_plugin_enabled'] = false;
foreach ($this->submissionplugins as $plugin) {
if ($plugin->is_enabled() && $plugin->is_visible() && $plugin->allow_submissions()) {
$this->cache['any_submission_plugin_enabled'] = true;
break;
}
}
}
return $this->cache['any_submission_plugin_enabled'];
}
/**
* add elements to submission form
* @param MoodleQuickForm $mform
* @param stdClass $data
* @return void
*/
public function add_submission_form_elements(MoodleQuickForm $mform, stdClass $data) {
global $USER;
// online text submissions
$submission = $this->get_user_submission($USER->id, false);
$this->add_plugin_submission_elements($submission, $mform, $data);
// hidden params
$mform->addElement('hidden', 'id', $this->get_course_module()->id);
$mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'action', 'savesubmission');
$mform->setType('action', PARAM_TEXT);
// buttons
}
/**
* revert to draft
* Uses url parameter userid
*
* @param int $userid
* @return void
*/
private function process_revert_to_draft($userid = 0) {
global $USER, $DB;
// Need grade permission
require_capability('mod/assign:grade', $this->context);
require_sesskey();
if (!$userid) {
$userid = required_param('userid', PARAM_INT);
}
$submission = $this->get_user_submission($userid, false);
if (!$submission) {
return;
}
$submission->status = ASSIGN_SUBMISSION_STATUS_DRAFT;
$this->update_submission($submission, false);
// update the modified time on the grade (grader modified)
$grade = $this->get_user_grade($userid, true);
$this->update_grade($grade);
$user = $DB->get_record('user', array('id' => $userid), '*', MUST_EXIST);
$this->add_to_log('revert submission to draft', get_string('reverttodraftforstudent', 'assign', array('id'=>$user->id, 'fullname'=>fullname($user))));
}
/**
* lock the process
* Uses url parameter userid
* @param int $userid
* @return void
*/
private function process_lock($userid = 0) {
global $USER, $DB;
// Need grade permission
require_capability('mod/assign:grade', $this->context);
require_sesskey();
if (!$userid) {
$userid = required_param('userid', PARAM_INT);
}
$grade = $this->get_user_grade($userid, true);
$grade->locked = 1;
$grade->grader = $USER->id;
$this->update_grade($grade);
$user = $DB->get_record('user', array('id' => $userid), '*', MUST_EXIST);
$this->add_to_log('lock submission', get_string('locksubmissionforstudent', 'assign', array('id'=>$user->id, 'fullname'=>fullname($user))));
}
/**
* unlock the process
*
* @param int $userid
* @return void
*/
private function process_unlock($userid = 0) {
global $USER, $DB;
// Need grade permission
require_capability('mod/assign:grade', $this->context);
require_sesskey();
if (!$userid) {
$userid = required_param('userid', PARAM_INT);
}
$grade = $this->get_user_grade($userid, true);
$grade->locked = 0;
$grade->grader = $USER->id;
$this->update_grade($grade);
$user = $DB->get_record('user', array('id' => $userid), '*', MUST_EXIST);
$this->add_to_log('unlock submission', get_string('unlocksubmissionforstudent', 'assign', array('id'=>$user->id, 'fullname'=>fullname($user))));
}
/**
* save outcomes submitted from grading form
*
* @param int $userid
* @param stdClass $formdata
*/
private function process_outcomes($userid, $formdata) {
global $CFG, $USER;
if (empty($CFG->enableoutcomes)) {
return;
}
if ($this->grading_disabled($userid)) {
return;
}
require_once($CFG->libdir.'/gradelib.php');
$data = array();
$gradinginfo = grade_get_grades($this->get_course()->id,
'mod',
'assign',
$this->get_instance()->id,
$userid);
if (!empty($gradinginfo->outcomes)) {
foreach($gradinginfo->outcomes as $index=>$oldoutcome) {
$name = 'outcome_'.$index;
if (isset($formdata->{$name}[$userid]) and $oldoutcome->grades[$userid]->grade != $formdata->{$name}[$userid]) {
$data[$index] = $formdata->{$name}[$userid];
}
}
}
if (count($data) > 0) {
grade_update_outcomes('mod/assign', $this->course->id, 'mod', 'assign', $this->get_instance()->id, $userid, $data);
}
}
/**
* save grade
*
* @param moodleform $mform
* @return bool - was the grade saved
*/
private function process_save_grade(&$mform) {
global $USER, $DB, $CFG;
// Include grade form
require_once($CFG->dirroot . '/mod/assign/gradeform.php');
// Need submit permission to submit an assignment
require_capability('mod/assign:grade', $this->context);
require_sesskey();
$rownum = required_param('rownum', PARAM_INT);
$useridlist = optional_param('useridlist', '', PARAM_TEXT);
if ($useridlist) {
$useridlist = explode(',', $useridlist);
} else {
$useridlist = $this->get_grading_userid_list();
}
$last = false;
$userid = $useridlist[$rownum];
if ($rownum == count($useridlist) - 1) {
$last = true;
}
$data = new stdClass();
$mform = new mod_assign_grade_form(null, array($this, $data, array('rownum'=>$rownum, 'useridlist'=>$useridlist, 'last'=>false)), 'post', '', array('class'=>'gradeform'));
if ($formdata = $mform->get_data()) {
$grade = $this->get_user_grade($userid, true);
$gradingdisabled = $this->grading_disabled($userid);
$gradinginstance = $this->get_grading_instance($userid, $gradingdisabled);
if (!$gradingdisabled) {
if ($gradinginstance) {
$grade->grade = $gradinginstance->submit_and_get_grade($formdata->advancedgrading, $grade->id);
} else {
// handle the case when grade is set to No Grade
if (isset($formdata->grade)) {
$grade->grade = grade_floatval(unformat_float($formdata->grade));
}
}
}
$grade->grader= $USER->id;
$adminconfig = $this->get_admin_config();
$gradebookplugin = $adminconfig->feedback_plugin_for_gradebook;
// call save in plugins
foreach ($this->feedbackplugins as $plugin) {
if ($plugin->is_enabled() && $plugin->is_visible()) {
if (!$plugin->save($grade, $formdata)) {
$result = false;
print_error($plugin->get_error());
}
if (('assignfeedback_' . $plugin->get_type()) == $gradebookplugin) {
// this is the feedback plugin chose to push comments to the gradebook
$grade->feedbacktext = $plugin->text_for_gradebook($grade);
$grade->feedbackformat = $plugin->format_for_gradebook($grade);
}
}
}
$this->process_outcomes($userid, $formdata);
$grade->mailed = 0;
$this->update_grade($grade);
$user = $DB->get_record('user', array('id' => $userid), '*', MUST_EXIST);
$this->add_to_log('grade submission', $this->format_grade_for_log($grade));
} else {
return false;
}
return true;
}
/**
* This function is a static wrapper around can_upgrade
*
* @param string $type The plugin type
* @param int $version The plugin version
* @return bool
*/
public static function can_upgrade_assignment($type, $version) {
$assignment = new assign(null, null, null);
return $assignment->can_upgrade($type, $version);
}
/**
* This function returns true if it can upgrade an assignment from the 2.2
* module.
* @param string $type The plugin type
* @param int $version The plugin version
* @return bool
*/
public function can_upgrade($type, $version) {
if ($type == 'offline' && $version >= 2011112900) {
return true;
}
foreach ($this->submissionplugins as $plugin) {
if ($plugin->can_upgrade($type, $version)) {
return true;
}
}
foreach ($this->feedbackplugins as $plugin) {
if ($plugin->can_upgrade($type, $version)) {
return true;
}
}
return false;
}
/**
* Copy all the files from the old assignment files area to the new one.
* This is used by the plugin upgrade code.
*
* @param int $oldcontextid The old assignment context id
* @param int $oldcomponent The old assignment component ('assignment')
* @param int $oldfilearea The old assignment filearea ('submissions')
* @param int $olditemid The old submissionid (can be null e.g. intro)
* @param int $newcontextid The new assignment context id
* @param int $newcomponent The new assignment component ('assignment')
* @param int $newfilearea The new assignment filearea ('submissions')
* @param int $newitemid The new submissionid (can be null e.g. intro)
* @return int The number of files copied
*/
public function copy_area_files_for_upgrade($oldcontextid, $oldcomponent, $oldfilearea, $olditemid, $newcontextid, $newcomponent, $newfilearea, $newitemid) {
// Note, this code is based on some code in filestorage - but that code
// deleted the old files (which we don't want)
$count = 0;
$fs = get_file_storage();
$oldfiles = $fs->get_area_files($oldcontextid, $oldcomponent, $oldfilearea, $olditemid, 'id', false);
foreach ($oldfiles as $oldfile) {
$filerecord = new stdClass();
$filerecord->contextid = $newcontextid;
$filerecord->component = $newcomponent;
$filerecord->filearea = $newfilearea;
$filerecord->itemid = $newitemid;
$fs->create_file_from_storedfile($filerecord, $oldfile);
$count += 1;
}
return $count;
}
/**
* Get an upto date list of user grades and feedback for the gradebook
*
* @param int $userid int or 0 for all users
* @return array of grade data formated for the gradebook api
* The data required by the gradebook api is userid,
* rawgrade,
* feedback,
* feedbackformat,
* usermodified,
* dategraded,
* datesubmitted
*/
public function get_user_grades_for_gradebook($userid) {
global $DB, $CFG;
$grades = array();
$assignmentid = $this->get_instance()->id;
$adminconfig = $this->get_admin_config();
$gradebookpluginname = $adminconfig->feedback_plugin_for_gradebook;
$gradebookplugin = null;
// find the gradebook plugin
foreach ($this->feedbackplugins as $plugin) {
if ($plugin->is_enabled() && $plugin->is_visible()) {
if (('assignfeedback_' . $plugin->get_type()) == $gradebookpluginname) {
$gradebookplugin = $plugin;
}
}
}
if ($userid) {
$where = ' WHERE u.id = ? ';
} else {
$where = ' WHERE u.id != ? ';
}
$graderesults = $DB->get_recordset_sql('SELECT u.id as userid, s.timemodified as datesubmitted, g.grade as rawgrade, g.timemodified as dategraded, g.grader as usermodified
FROM {user} u
LEFT JOIN {assign_submission} s ON u.id = s.userid and s.assignment = ?
JOIN {assign_grades} g ON u.id = g.userid and g.assignment = ?
' . $where, array($assignmentid, $assignmentid, $userid));
foreach ($graderesults as $result) {
$gradebookgrade = clone $result;
// now get the feedback
if ($gradebookplugin) {
$grade = $this->get_user_grade($result->userid, false);
if ($grade) {
$gradebookgrade->feedbacktext = $gradebookplugin->text_for_gradebook($grade);
$gradebookgrade->feedbackformat = $gradebookplugin->format_for_gradebook($grade);
}
}
$grades[$gradebookgrade->userid] = $gradebookgrade;
}
$graderesults->close();
return $grades;
}
}
| univirtualutp/amaca | mod/assign/locallib.php | PHP | gpl-3.0 | 136,629 | [
30522,
1026,
1029,
25718,
1013,
1013,
2023,
5371,
2003,
2112,
1997,
6888,
2571,
1011,
8299,
1024,
1013,
1013,
6888,
2571,
1012,
8917,
1013,
1013,
1013,
1013,
1013,
6888,
2571,
2003,
2489,
4007,
1024,
2017,
2064,
2417,
2923,
3089,
8569,
26... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#!/bin/sh
#
# Copyright (C) 2018 TDT AG <development@tdt.de>
#
# This is free software, licensed under the GNU General Public License v2.
# See https://www.gnu.org/licenses/gpl-2.0.txt for more information.
#
. /lib/functions.sh
. ../netifd-proto.sh
init_proto "$@"
INCLUDE_ONLY=1
BONDING_MASTERS="/sys/class/net/bonding_masters"
set_driver_values() {
local varname
for varname in "$@"; do
local value
json_get_var value "$varname"
[ -n "$value" ] && echo "$value" > /sys/class/net/"$link"/bonding/"$varname"
done
}
proto_bonding_init_config() {
no_device=1
available=1
proto_config_add_string "ifname"
proto_config_add_string "ipaddr"
proto_config_add_string "netmask"
proto_config_add_string "bonding_policy"
proto_config_add_string "link_monitoring"
proto_config_add_string "slaves"
proto_config_add_string "all_slaves_active"
proto_config_add_string "min_links"
proto_config_add_string "ad_actor_sys_prio"
proto_config_add_string "ad_actor_system"
proto_config_add_string "ad_select"
proto_config_add_string "lacp_rate"
proto_config_add_string "packets_per_slave"
proto_config_add_string "xmit_hash_policy"
proto_config_add_string "primary"
proto_config_add_string "primary_reselect"
proto_config_add_string "lp_interval"
proto_config_add_string "tlb_dynamic_lb"
proto_config_add_string "resend_igmp"
proto_config_add_string "fail_over_mac"
proto_config_add_string "num_grat_arp__num_unsol_na"
proto_config_add_string "arp_interval"
proto_config_add_string "arp_ip_target"
proto_config_add_string "arp_all_targets"
proto_config_add_string "arp_validate"
proto_config_add_string "miimon"
proto_config_add_string "downdelay"
proto_config_add_string "updelay"
proto_config_add_string "use_carrier"
}
proto_bonding_setup() {
local cfg="$1"
local link="bonding-$cfg"
# Check for loaded kernel bonding driver (/sys/class/net/bonding_masters exists)
[ -f "$BONDING_MASTERS" ] || {
echo "$cfg" "setup: bonding_masters does not exist in sysfs (kernel module not loaded?)"
proto_notify_error "$cfg" "setup: bonding_masters does not exist in sysfs (kernel module not loaded?)"
proto_block_restart "$cfg"
return
}
# Add bonding interface to system
echo "+$link" > "$BONDING_MASTERS"
# Set bonding policy (with corresponding parameters)
local bonding_policy
json_get_vars bonding_policy
case "$bonding_policy" in
802.3ad)
echo "$bonding_policy" > /sys/class/net/"$link"/bonding/mode
set_driver_values min_links ad_actor_sys_prio ad_actor_system ad_select lacp_rate
;;
balance-rr)
echo "$bonding_policy" > /sys/class/net/"$link"/bonding/mode
set_driver_values packets_per_slave xmit_hash_policy
;;
balance-tlb)
echo "$bonding_policy" > /sys/class/net/"$link"/bonding/mode
set_driver_values primary primary_reselect lp_interval tlb_dynamic_lb resend_igmp xmit_hash_policy
;;
balance-alb)
echo "$bonding_policy" > /sys/class/net/"$link"/bonding/mode
set_driver_values primary primary_reselect lp_interval tlb_dynamic_lb resend_igmp xmit_hash_policy
;;
balance-xor)
echo "$bonding_policy" > /sys/class/net/"$link"/bonding/mode
set_driver_values xmit_hash_policy
;;
broadcast)
echo "$bonding_policy" > /sys/class/net/"$link"/bonding/mode
;;
active-backup)
echo "$bonding_policy" > /sys/class/net/"$link"/bonding/mode
set_driver_values primary primary_reselect fail_over_mac num_grat_arp__num_unsol_na xmit_hash_policy
;;
esac
# Set link monitoring (with corresponding parameters)
local link_monitoring
json_get_vars link_monitoring
case "$link_monitoring" in
arp)
local arp_interval arp_ip_target arp_all_targets arp_validate
json_get_vars arp_interval arp_ip_target arp_all_targets arp_validate
[ -n "$arp_interval" -a "$arp_interval" != 0 ] && echo "$arp_interval" > /sys/class/net/"$link"/bonding/arp_interval
IFS=' '
for target in $arp_ip_target; do
echo "+$target" > /sys/class/net/"$link"/bonding/arp_ip_target
done
[ -n "$arp_all_targets" ] && echo "$arp_all_targets" > /sys/class/net/"$link"/bonding/arp_all_targets
[ -n "$arp_validate" ] && echo "$arp_validate" > /sys/class/net/"$link"/bonding/arp_validate
;;
mii)
local miimon downdelay updelay use_carrier
json_get_vars miimon downdelay updelay use_carrier
[ -n "$miimon" -a "$miimon" != 0 ] && echo "$miimon" > /sys/class/net/"$link"/bonding/miimon
[ -n "$downdelay" ] && echo "$downdelay" > /sys/class/net/"$link"/bonding/downdelay
[ -n "$updelay" ] && echo "$updelay" > /sys/class/net/"$link"/bonding/updelay
[ -n "$use_carrier" ] && echo "$use_carrier" > /sys/class/net/"$link"/bonding/use_carrier
;;
esac
# Add slaves to bonding interface
local slaves
json_get_vars slaves
for slave in $slaves; do
if [ "$(cat /proc/net/dev |grep "$slave")" == "" ]; then
echo "$cfg" "ERROR IN CONFIGURATION - $slave: No such device"
proto_notify_error "$cfg" "ERROR IN CONFIGURATION - $slave: No such device"
proto_block_restart "$cfg"
return
fi
ifconfig "$slave" down
sleep 1
echo "+$slave" > /sys/class/net/"$link"/bonding/slaves
ifconfig "$slave" up
done
[ -n "$all_slaves_active" ] && echo "$all_slaves_active" > /sys/class/net/"$link"/bonding/all_slaves_active
local ipaddr netmask
json_get_vars ipaddr netmask
# ATTENTION
#All json vars have to be read before the line below, as the
# json object will be overwritten by proto_init_update
# ATTENTION
proto_init_update "$link" 1
# For static configuration we _MUST_ have an IP address
[ -z "$ipaddr" ] && {
echo "$cfg" "INVALID LOCAL ADDRESS"
proto_notify_error "$cfg" "INVALID_LOCAL_ADDRESS"
proto_block_restart "$cfg"
return
}
proto_add_ipv4_address "$ipaddr" "$netmask"
proto_send_update "$cfg"
}
proto_bonding_teardown() {
local cfg="$1"
local link="bonding-$cfg"
# Check for loaded kernel bonding driver (/sys/class/net/bonding_masters exists)
[ -f "$BONDING_MASTERS" ] || {
echo "$cfg" "teardown: bonding_masters does not exist in sysfs (kernel module not loaded?)"
proto_notify_error "$cfg" "teardown: bonding_masters does not exist in sysfs (kernel module not loaded?)"
proto_block_restart "$cfg"
return
}
echo "-$link" > /sys/class/net/bonding_masters
logger "bonding_teardown($1): $2"
}
add_protocol bonding
| fededim/packages | net/bonding/files/lib/netifd/proto/bonding.sh | Shell | gpl-2.0 | 6,320 | [
30522,
1001,
999,
1013,
8026,
1013,
14021,
1001,
1001,
9385,
1006,
1039,
1007,
2760,
14595,
2102,
12943,
1026,
2458,
1030,
14595,
2102,
1012,
2139,
1028,
1001,
1001,
2023,
2003,
2489,
4007,
1010,
7000,
2104,
1996,
27004,
2236,
2270,
6105,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<scri
<!DOCTYPE html>
<html lang="fr" itemscope="" itemtype="http://schema.org/Blog">
<head> <script>
if (window.parent !== window) {
if (typeof btoa !== "function") {
window.btoa = function (input) {
var str = String(input);
for (var block, charCode, idx = 0, map = chars, output = ''; str.charAt(idx | 0) || (map = '=', idx % 1); output += map.charAt(63 & block >> 8 - idx % 1 * 8)) {
charCode = str.charCodeAt(idx += 3/4)
block = block << 8 | charCode
}
return output
}
}
var re = /^(?:https?:)?(?:\/\/)?([^\/\?]+)/i
var res = re.exec(document.referrer)
var domain = res[1]
var forbidden = ["aGVsbG8ubGFuZA==","Y3Vpc2luZS5sYW5k","cmVjZXR0ZS5sYW5k","cmVjZXR0ZXMubGFuZA==",]
if (forbidden.indexOf(btoa(domain)) > -1) {
document.location = document.location.origin + "/system/noframed"
}
}
</script>
<link rel="stylesheet" href="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/css/ob-style.css?v2.39.3.0" />
<link rel="stylesheet" href="//assets.over-blog-kiwi.com/b/blog/build/soundplayer.2940b52.css" />
<!-- Forked theme from id 60 - last modified : 2017-02-23T08:01:21+01:00 -->
<!-- shortcut:[Meta] -->
<!-- title -->
<!-- Title -->
<title>333 - Le Site dont vous êtes le Héros</title>
<!-- metas description, keyword, robots -->
<!-- Metas -->
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="author" content="" />
<meta property="og:site_name" content="Le Site dont vous êtes le Héros" />
<meta property="og:title" content="333 - Le Site dont vous êtes le Héros" />
<meta name="twitter:title" content="333 - Le Site dont vous êtes le Héros" />
<meta name="description" content="Une fois la flamme de la bougie soufflée, vous essayez de vous glisser avec délectation dans les bras de Morphée. Mais vous n'êtes pas couché depuis cinq minutes qu'un grattement furtif vous parvient du palier. A demi plongé dans le sommeil, vous ne savez..." />
<meta property="og:description" content="Une fois la flamme de la bougie soufflée, vous essayez de vous glisser avec délectation dans les bras de Morphée. Mais vous n'êtes pas couché depuis cinq minutes qu'un grattement furtif vous parvient du palier. A demi plongé dans le sommeil, vous ne savez..." />
<meta name="twitter:description" content="Une fois la flamme de la bougie soufflée, vous essayez de vous glisser avec délectation dans les bras de Morphée. Mais vous n'êtes pas couché depuis cinq minutes qu'un grattement furtif vous parvient du..." />
<meta property="og:locale" content="fr_FR" />
<meta property="og:url" content="http://lesitedontvousetesleheros.overblog.com/333-70" />
<meta name="twitter:url" content="http://lesitedontvousetesleheros.overblog.com/333-70" />
<meta property="og:type" content="article" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@overblog" />
<meta name="twitter:creator" content="@" />
<meta property="fb:app_id" content="284865384904712" />
<!-- Robots -->
<meta name="robots" content="index,follow" />
<!-- RSS -->
<link rel="alternate" type="application/rss+xml" title="RSS" href="/rss" />
<!-- Analytics -->
<!-- shortcut:[Options] -->
</script>ll" group="shares" />
<!-- shortcut:[Includes] -->
<!-- favicon -->
<!-- Metas -->
<link rel="shortcut icon" type="image/x-icon" href="http://fdata.over-blog.net/99/00/00/01/img/favicon.ico" />
<link rel="icon" type="image/png" href="http://fdata.over-blog.net/99/00/00/01/img/favicon.png" />
<link rel="apple-touch-icon" href="http://fdata.over-blog.net/99/00/00/01/img/mobile-favicon.png" />
<!-- SEO -->
<!-- includes -->
<link rel="alternate" type="application/rss+xml" title="RSS" href="/rss" />
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link href='http://fonts.googleapis.com/css?family=PT+Sans+Caption:400,700' rel='stylesheet' type='text/css'>
<!-- Fonts -->
<link href='http://fonts.googleapis.com/css?family=Carter+One' rel='stylesheet' type='text/css'>
<!-- Fancybox -->
<link rel="stylesheet" type="text/css" href="http://assets.over-blog-kiwi.com/themes/jquery/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
<style type="text/css">
/*** RESET ***/
.clearfix:after {content: "."; display: block; height: 0; clear: both; visibility: hidden;}
.clearfix {display: inline-block;} /* Hides from IE-mac \*/
* html .clearfix {height: 1%;}
.clearfix {display: block;}
* {margin:0; padding:0;}
body {background-color: #000; color: #fff; font-family: 'PT Sans Caption', sans-serif; font-size: 12px;}
a {text-decoration: none;}
h1,
h2,
h3,
h4,
h5,
h6 { font-weight:normal;}
img {border:none;}
.box li {list-style:none;}
#cl_1_0 ul,
#cl_1_0 ol {margin-left: 0; padding-left: 25px;}
.visuallyhidden,
.ob-form-subscription label {
position: absolute;
overflow: hidden;
clip: rect(0 0 0 0);
height: 1px; width: 1px;
margin: -1px; padding: 0; border: 0;
}
/*** General ***/
.ln {clear: both;}
#ln_2 {padding-bottom: 20px;}
.cl {float:left;}
.clear {clear:both;}
.list-title {font-size: 24px; margin: 10px 0 10px 10px; text-shadow: 1px 1px 1px #000;}
/*** Structure ***/
#cl_0_0 {margin-bottom:0; width:100%;}
#cl_1_0 {display:inline; padding:0 12px 0 0; width:630px; }
#cl_1_1 {display:inline; padding:0; width:308px;}
#cl_2_0 {margin-top: 30px; width: 100%;}
#global {margin:0px auto; width:950px;}
.header {margin: 110px 0 20px; text-align:left;}
.avatar,
#top{
display: inline-block;
vertical-align: middle;
}
.avatar{
margin-right: 10px;
}
#top .title {font-family: Carter One, cusrive; font-size: 60px; left: 0; letter-spacing: 2px; line-height: 60px; text-shadow: 0 5px 5px #333; text-transform: uppercase;}
#top .description {font-family: Carter One, cusrive; font-size:60px; font-size: 20px; letter-spacing: 2px; text-shadow: 0 2px 1px #333;}
article {margin-bottom: 35px;}
/** Article **/
.article,
.page{
background: #141414;
background: rgba(20,20,20,0.9);
border: 2px solid #333;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-ms-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px;
padding: 10px;
}
.noresult{
margin-bottom: 20px;
}
.beforeArticle {margin-bottom: 10px;}
.divTitreArticle .post-title,
.divPageTitle .post-title,
.special h3 {border-bottom: 1px solid; font-size: 30px; letter-spacing:2px; margin-bottom: 10px; padding-bottom:5px; word-wrap: break-word;}
.contenuArticle, .pageContent {padding-top:10px;}
.contenuArticle p,
.pageContent p .contenuArticle ol,
.contenuArticle ul {font-size: 14px; line-height: 22px; padding-bottom: 8px;}
.ob-repost {background: #222; border: 1px solid #2A2A2A; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; font-weight: bold; margin: 1em 0; text-align: center;}
.ob-repost p {font-size: 12px; line-height: normal; padding: 0;}
.ob-repost .ob-link {text-decoration: underline;}
/* Sections */
.ob-section-text,
.ob-section-images,
.ob-section-video,
.ob-section-audio,
.ob-section-quote,
.ob-secton-map {width: 600px;}
/* Medias */
.ob-video iframe,
.ob-video object,
.ob-section-images .ob-slideshow,
.ob-slideshow img, .ob-section-map .ob-map {
width: 600px;
}
.ob-video iframe{
border: 0;
}
.ob-video object {
max-height: 345px;
}
.ob-section-audio .obsoundplayer .obsoundplayername {
height: 31px;
width: 200px;
overflow: hidden;
}
/* Section texte */
.ob-text h3,
.ob-text h4,
.ob-text h5 {margin: 15px 0 5px;}
.ob-text h3 {font-size: 18px; line-height: 18px;}
.ob-text h4 {font-size: 16px; line-height: 16px;}
.ob-text h5 {font-size: 14px; font-weight: bold; line-height: 14px;}
.ob-text pre {width: 600px; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -webkit-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word; overflow: auto;}
/* Section image */
.ob-media-left {margin-right: 30px;}
.ob-media-right {margin-left: 30px; max-width: 100%;}
.ob-row-1-col img {width: 100%;}
.ob-row-2-col img {width: 50%; margin-top: 0; margin-bottom: 0;}
.ob-row-3-col img {width: 200px; margin-top: 0; margin-bottom: 0;}
/* Section map */
.ob-map div {color: #282924;}
/* Section HTML */
.ob-section-html iframe,
.ob-section-html embed,
.ob-section-html object {max-width: 100%;}
/* Section file */
.ob-section-file .ob-ctn {background: #222; border: none; -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -ms-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -o-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); display: block; max-width: 100%;}
.ob-section-file .ob-ctn a.ob-link,
.ob-section-file .ob-c a.ob-link:visited {color: #FFF; text-decoration: underline; max-width: 521px;}
.ob-section-file .ob-ctn a.ob-link:hover {color: #FFF; text-decoration: none;}
/* Section Quote */
.ob-section-quote {background: #222; border: none; -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -ms-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -o-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); margin-bottom: 20px; width: 100%;}
.ob-section-quote .ob-quote p {color: #FFF; min-height: 20px;}
.ob-section-quote .ob-quote p:before {color: #444; margin: 20px 0 0 -85px;}
.ob-section-quote .ob-quote p:after {color: #444; margin: 80px 0 0;}
.ob-section-quote p.ob-author,
.ob-section-quote p.ob-source {background: #444; font-size: 14px; font-style: italic; margin: 25px 0 0; max-height: 22px; max-width: 517px; overflow: hidden; padding-bottom: 0\9; position: relative; text-overflow: ellipsis; white-space: nowrap; z-index: 11;}
/* Section Link */
.ob-section-link .ob-ctn {background: #222; border: none; -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -ms-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -o-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);}
.ob-section-link .ob-media-left {margin: 0;}
.ob-section-link p.ob-url {background: #444; margin: 0; max-height: 20px; max-width: 395px;}
.ob-section-link p.ob-title {color: #FFF; margin-bottom: 0; margin-left: 20px;}
.ob-section-link p.ob-snippet {color: #FFF; margin-bottom: 10px; margin-left: 20px; margin-top: 0;}
.ob-section-link p.ob-title .ob-link {color: #FFF; max-height: 42px; overflow: hidden;}
.ob-section-link p.ob-snippet {margin-bottom: 35px; max-height: 40px; overflow: hidden;}
.ob-section-link .ob-img {float: left; width: 170px;}
.ob-section-link .ob-desc {margin-top: 5px;}
/* Description */
.contenuArticle .ob-desc {font-size: 13px; font-style: italic;}
/* twitter box */
.ob-section .twitter-tweet-rendered {max-width: 100% !important;}
.ob-section .twt-border {max-width: 100% !important;}
/* Share buttons */
.afterArticle {background: #141414; border: 2px solid #333; -moz-border-radius: 5px; -webkit-border-radius: 5px; -o-border-radius: 5px; border-radius: 5px; margin: 10px 0; -moz-opacity: 0.9; -webkit-opacity: 0.9; -o-opacity: 0.9; -ms-opacity: 0.9; opacity: 0.9; padding: 9px 13px 8px; position: relative; width: 600px; z-index: 1;/* iframe Facebook */}
.share h3,
.item-comments h3 {margin-bottom: 10px; font-size: 16px; line-height: 16px;}
.google-share,
.twitter-share,
.facebook-share,
.ob-share {float: left;}
.facebook-share {width: 105px;}
.ob-share {margin-top: -2px;}
.comment-number {-moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px; display: block; float: right; font-weight: bold; line-height: 17px; padding: 2px 7px; text-align: center;}
.item-comments {
}
/* Contact */
.ob-contact .ob-form {margin-bottom: 80px;}
.ob-contact .ob-form-field {margin: 5px 0 0 80px;}
.ob-label {width: 20%; font-size: 14px;}
.ob-captcha .ob-input-text{
margin-left: 20%;
}
.ob-input-submit,
.ob-error {margin-left: 31%;}
.box-content .ob-input-submit,
.box-content .ob-error {margin-left: 20%;}
.ob-input-text,
.ob-input-email,
.ob-input-textarea {padding: 6px 0; border: 2px solid #333; -moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px;}
.ob-input-submit {-moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px; display: block; font-weight: bold; line-height: 17px; margin-top: 5px; padding: 2px 7px; text-align: center;}
.ob-form + a {display: block; text-align: center;}
/** Sidebar **/
.box {background: #141414; border: 2px solid #333; margin-bottom:10px; -moz-opacity: 0.9; -webkit-opacity: 0.9; -o-opacity: 0.9; -ms-opacity: 0.9; opacity: 0.9; padding:10px; -moz-border-radius: 5px; -webkit-border-radius: 5px; -o-border-radius: 5px; border-radius: 5px;}
.box{/* ie6 hack */_background:#000;}
.box-titre h3 {border-bottom: 1px solid; font-family: Carter One; font-size: 20px; letter-spacing: 1px; margin-bottom: 10px; padding-bottom: 2px; text-shadow: 1px 1px 1px black; text-transform: uppercase;}
.box-content {font-size: 14px; line-height:18px;}
.box-content strong {font-weight:normal;}
.box-footer {display:none;}
/* Sidebar > About */
.profile .avatar {float: left; margin-right: 10px;}
.profile .avatar img {background: #333; -moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px; -moz-opacity: 0.8; -webkit-opacity: 0.8; -o-opacity: 0.8; -ms-opacity: 0.8; opacity: 0.8; padding: 3px; -moz-transition: opacity 300ms; -webkit-transition: opacity 300ms; -o-transition: opacity 300ms; -ms-transition: opacity 300ms; transition: opacity 300ms;}
.profile .avatar img:hover {-moz-opacity: 1; -webkit-opacity: 1; -o-opacity: 1; -ms-opacity: 1; opacity: 1;}
.profile .blog-owner-nickname {font-style: italic; display: block; margin-top: 10px; text-align: right;}
/* Sidebar > Search */
.search form {position:relative;}
.search form input {border: 2px solid #333; -moz-border-radius: 3px; -webkit-border-radius: 3px; -o-border-radius: 3px; -ms-border-radius: 3px; border-radius: 3px; color: #676767; padding: 5px 0; width: 70%;}
.search form button {border: 0; -moz-border-radius: 3px; -webkit-border-radius: 3px; -o-border-radius: 3px; -ms-border-radius: 3px; border-radius: 3px; cursor: pointer; font-weight: bold; padding: 5px 0; width: 13%;}
/* Sidebar > Subscribe */
.ob-form-subscription .ob-form-field{
display: inline-block;
}
.ob-form-subscription .ob-form-field input{
width: 170px;
}
.ob-form-subscription .ob-input-submit{
display: inline-block;
margin:0;
}
/* Sidebar > Last Posts */
.last li {float: left;}
.last ul:hover img {-moz-opacity: 0.7; -webkit-opacity: 0.7; -o-opacity: 0.7; -ms-opacity: 0.7; opacity: 0.7; -moz-transition: opacity 300ms; -webkit-transition: opacity 300ms; -o-transition: opacity 300ms; -ms-transition: opacity 300ms; transition: opacity 300ms;}
.last ul img {background: #333; -moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px; margin-bottom: 5px; -moz-transition: opacity 300ms; -webkit-transition: opacity 300ms; -o-transition: opacity 300ms; -ms-transition: opacity 300ms; transition: opacity 300ms;}
.last li.left img {margin-right: 8px;}
.last ul img:hover {-moz-opacity: 1; -webkit-opacity: 1; -o-opacity: 1; -ms-opacity: 1; opacity: 1; -moz-transition: opacity 300ms; -webkit-transition: opacity 300ms; -o-transition: opacity 300ms; -ms-transition: opacity 300ms; transition: opacity 300ms;}
/* Sidebar > Tags */
.tags li {
border-bottom: 1px solid #222;
margin: 10px 0;
padding: 10px 0;
word-wrap:break-word;
}
.tags li a {font-size: 16px;}
.tags .number {-moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px; float: right; font-weight: bold; line-height: 17px; margin-top: -2px; padding: 2px 7px; text-align: center;}
/* Sidebar > Follow me */
.follow li {-moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px; display: block; float: left; height: 83px; text-indent: -9999999%; width: 83px;}
.follow li a {background: url("http://assets.over-blog-kiwi.com/themes/5/images/follow-me.png") no-repeat; display: block; height: 100%; width: 100%;}
.follow .facebook-follow {margin-right: 10px;}
.follow .facebook-follow:hover {background: #3b5999; border-color: #3b5999;}
.follow .facebook-follow a {background-position: center 18px;}
.follow .twitter-follow {margin-right: 10px;}
.follow .twitter-follow:hover {background: #04bff2; border-color: #04bff2;}
.follow .twitter-follow a {background-position: center -74px;}
.follow .rss-follow:hover {background: #ff8604; border-color: #ff8604;}
.follow .rss-follow a {background-position: center -166px;}
/* Sidebar > Archives */
.plustext {font-size: 16px;}
.arch_month {margin-left: 20px;}
.arch_month li {border-bottom: 1px solid #222; margin: 10px 0; padding: 10px 0;}
.archives .number {-moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px; float: right; font-weight: bold; line-height: 17px; margin-top: -2px; padding: 2px 7px; text-align: center;}
.share > div{
float:left;
height:20px;
margin-right:28px;
}
.share .google-share{
margin-right: 0;
}
.share iframe{
border:none;
width:100px;
}
/** Pagination **/
.pagination {
margin: 30px auto 20px; width: 600px;
font-size: 14px; padding: 2px 0;
}
.pagination a {
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
-o-border-radius: 4px;
-ms-border-radius: 4px;
border-radius: 4px;
float: right;
line-height: 17px;
margin-top: -2px;
padding: 2px 7px;
text-align: center;
text-transform: uppercase;
}
.pagination .previous {float: left;}
.pagination .next {float: right;}
.ob-pagination{
margin: 20px 0;
text-align: center;
}
.ob-page{
display: inline-block;
margin: 0 1px;
padding: 2px 7px;
}
.ob-page-link{
border-radius: 4px;
}
/** Credits **/
.credits {display: block; margin: 20px 0; text-align: center; text-shadow: 1px 1px 1px #000;}
/**************
** ob-footer **
**************/
.ob-footer{
padding-bottom: 10px;
}
body.withDisplay{
background-position: 50% 68px;
}
#cl_1_1 .ads{
margin-bottom: 10px;
padding: 2px;
-moz-opacity: 0.9;
-webkit-opacity: 0.9;
-o-opacity: 0.9;
-ms-opacity: 0.9;
opacity: 0.9;
}
.ads{
background: #141414;
border: 2px solid #333;
border-radius: 2px;
margin: 0 auto;
}
.ads-600x250{
padding: 10px;
text-align: center;
}
.ads-728x90{
height: 90px;
width: 728px;
}
.ads-468x60{
height: 60px;
width: 468px;
}
.ads-468x60 + .before_articles,
.afterArticle + .ads-468x60{
margin-top:35px;
}
.ads-300x250{
height: 250px;
width: 300px;
}
.ads-600x250 div{
float: left;
}
.ads-300{
text-align: center;
}
/*****************
** Top articles **
*****************/
.ob-top-posts h2{
font-size: 35px;
}
.ob-top-article{
margin-bottom: 20px;
}
.ob-top-article h3{
line-height: normal;
}
/*** Themes ***/
/** JUNGLE **/
/* BACKGROUND */
body {background-image: url("http://img.over-blog-kiwi.com/0/24/52/97/201311/ob_5cf972_lesitedontvousetesleheros.jpg"); background-attachment: fixed; background-position: center center; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover;background-repeat: no-repeat;}
/* TOP */
#top .title a,
#top .title a:visited {color: #9bb1c5;}
#top .title a:hover,
#top .description {color: #fff;}
/* POSTS */
.beforeArticle .tags a,
.beforeArticle .tags a:visited {color: #9bb1c5;}
.beforeArticle .tags a:hover {color: #fff;}
.post-title,
.special h3 {border-bottom-color: #1e3249;}
.post-title a,
.post-title a:visited,
.special h3,
.ob-text h3,
.ob-text h4,
.ob-text h5 {color: #9bb1c5;}
.post-title a:hover {color: #fff;}
.contenuArticle a,
.contenuArticle a:visited,
.readmore a {color: #9bb1c5;}
.contenuArticle a:hover,
.readmore a:hover {color: #fff;}
/* Section file */
.ob-section-file .ob-ctn a.ob-link,
.ob-section-file .ob-c a.ob-link:visited,
.ob-section-file .ob-ctn a.ob-link:hover {color: #9bb1c5;}
/* Section Quote */
.ob-section-quote p.ob-author,
.ob-section-quote p.ob-source,
.ob-section-quote p.ob-author .ob-link,
.ob-section-quote p.ob-author .ob-link:visited,
.ob-section-quote p.ob-source .ob-link,
.ob-section-quote p.ob-source .ob-link:visited {color: #9bb1c5;}
.ob-section-quote p.ob-author:hover,
.ob-section-quote p.ob-source:hover,
.ob-section-quote p.ob-author .ob-link:hover,
.ob-section-quote p.ob-source .ob-link:hover {color: #fff;}
/* Section Link */
.ob-section-link p.ob-url ,
.ob-section-link p.ob-url .ob-link,
.ob-section-link p.ob-url .ob-link,
.ob-section-link p.ob-url .ob-link {color: #9bb1c5;}
.ob-section-link p.ob-url .ob-link:hover {color: #fff;}
/* SIDEBAR */
.box-titre h3 {border-bottom-color: #254870; color: #fff;}
.box-content strong {color:#bebebe;}
.box-content a,
.box-content a:visited,
.ob-footer a,
.ob-footer a:visited{color: #9bb1c5;}
.box-content a:hover,
.ob-footer a:hover{color: #fff;}
.archives .number,
.box-content form button,
.comment-number,
.follow li,
.ob-input-submit,
.pagination a,
.ob-page-link,
.tags .number {
background: #2e5fa4; /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzJlNWZhNCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjY1JSIgc3RvcC1jb2xvcj0iIzIyNDA2ZCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgPC9saW5lYXJHcmFkaWVudD4KICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2dyYWQtdWNnZy1nZW5lcmF0ZWQpIiAvPgo8L3N2Zz4=);
background: -moz-linear-gradient(top, #2e5fa4 0%, #22406d 65%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#2e5fa4), color-stop(65%,#22406d)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #2e5fa4 0%,#22406d 65%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #2e5fa4 0%,#22406d 65%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #2e5fa4 0%,#22406d 65%); /* IE10+ */
background: linear-gradient(to bottom, #2e5fa4 0%,#22406d 65%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#2e5fa4', endColorstr='#22406d',GradientType=0 ); /* IE6-8 */
border: 1px solid #2d5eab; color: #fff; text-shadow: 1px 1px 1px #141414;}
.box-content form button:active,
.comment-number:active,
.ob-input-submit:active,
.pagination a:active,
.ob-page-link:active{background: #22406d; /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIzNSUiIHN0b3AtY29sb3I9IiMyMjQwNmQiIHN0b3Atb3BhY2l0eT0iMSIvPgogICAgPHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjMmU1ZmE0IiBzdG9wLW9wYWNpdHk9IjEiLz4KICA8L2xpbmVhckdyYWRpZW50PgogIDxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9InVybCgjZ3JhZC11Y2dnLWdlbmVyYXRlZCkiIC8+Cjwvc3ZnPg==);
background: -moz-linear-gradient(top, #22406d 35%, #2e5fa4 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(35%,#22406d), color-stop(100%,#2e5fa4)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #22406d 35%,#2e5fa4 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #22406d 35%,#2e5fa4 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #22406d 35%,#2e5fa4 100%); /* IE10+ */
background: linear-gradient(to bottom, #22406d 35%,#2e5fa4 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#22406d', endColorstr='#2e5fa4',GradientType=0 ); /* IE6-8 */
}
.blog-owner-nickname {color: #254870;}
/* CREDITS */
.credits a,
.credits a:visited {color: #fff;}
.credits a:hover {color: #9bb1c5;}
</style>
<script src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/js/ads.js?v2.39.3.0"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-5354236-47', {
cookieDomain: 'lesitedontvousetesleheros.overblog.com',
cookieExpires: 31536000,
name: 'ob',
allowLinker: true
});
ga('ob.require', 'displayfeatures');
ga('ob.require', 'linkid', 'linkid.js');
ga('ob.set', 'anonymizeIp', true);
ga('ob.set', 'dimension1', '__ads_loaded__' in window ? '1' : '0');
ga('ob.set', 'dimension2', 'fr');
ga('ob.set', 'dimension3', 'BS');
ga('ob.set', 'dimension4', 'literature-comics-poetry');
ga('ob.set', 'dimension5', '1');
ga('ob.set', 'dimension6', '0');
ga('ob.set', 'dimension7', '0');
ga('ob.set', 'dimension10', '245297');
ga('ob.set', 'dimension11', '1');
ga('ob.set', 'dimension12', '1');
ga('ob.set', 'dimension13', '1');
ga('ob.send', 'pageview');
</script>
<script>
var obconnected = 0
var obconnectedblog = 0
var obtimestamp = 0
function isConnected(connected, connected_owner, timestamp) {
obconnected = connected
obconnectedblog = connected_owner
obtimestamp = timestamp
if (obconnected) {
document.querySelector('html').className += ' ob-connected'
}
if (obconnectedblog) {
document.querySelector('html').className += ' ob-connected-blog'
}
}
</script>
<script src="//connect.over-blog.com/ping/245297/isConnected"></script>
<script src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/js/h.js?v2.39.3.0"></script>
<script src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/js/repost.js?v2.39.3.0"></script>
<script src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/js/slideshow.js?v2.39.3.0"></script>
<script src="//assets.over-blog-kiwi.com/b/blog/build/soundplayer.2940b52.js"></script>
<script>
var OB = OB || {};
OB.isPost = true;
</script>
<script src="//assets.over-blog-kiwi.com/blog/js/index.js?v2.39.3.0"></script>
<script src="https://assets.over-blog-kiwi.com/ads/js/appconsent.bundle.min.js"></script>
<!-- DFP -->
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
(function() {
var useSSL = 'https:' == document.location.protocol;
var gads = document.createElement('script');
var node = document.getElementsByTagName('script')[0];
gads.async = true;
gads.type = 'text/javascript';
gads.src = (useSSL ? 'https:' : 'http:') + '//www.googletagservices.com/tag/js/gpt.js';
node.parentNode.insertBefore(gads, node);
})();
</script>
<!-- DFP -->
<script>
googletag.cmd.push(function() {
googletag.defineSlot('/6783/OverBlogKiwi/fr/245297_lesitedontvousetesleheros.overblog.com', [728,90], '_13ed3ef')
.set('adsense_background_color','#111111')
.set('adsense_border_color','#111111')
.set('adsense_text_color','#9bb1c5')
.set('adsense_link_color','#ffffff')
.set('adsense_url_color','#9bb1c5')
.addService(googletag.pubads());
});
googletag.cmd.push(function() {
googletag.defineSlot('/6783/OverBlogKiwi/fr/245297_lesitedontvousetesleheros.overblog.com', [300,250], '_30f3350')
.set('adsense_background_color','#111111')
.set('adsense_border_color','#111111')
.set('adsense_text_color','#9bb1c5')
.set('adsense_link_color','#ffffff')
.set('adsense_url_color','#9bb1c5')
.addService(googletag.pubads());
});
googletag.cmd.push(function() {
googletag.defineSlot('/6783/OverBlogKiwi/fr/245297_lesitedontvousetesleheros.overblog.com', [300,250], '_6d67124')
.set('adsense_background_color','#111111')
.set('adsense_border_color','#111111')
.set('adsense_text_color','#9bb1c5')
.set('adsense_link_color','#ffffff')
.set('adsense_url_color','#9bb1c5')
.addService(googletag.pubads());
});
googletag.cmd.push(function() {
googletag.defineSlot('/6783/OverBlogKiwi/fr/245297_lesitedontvousetesleheros.overblog.com', [[300,250],[300,600]], '_bb9b0bf')
.set('adsense_background_color','#111111')
.set('adsense_border_color','#111111')
.set('adsense_text_color','#9bb1c5')
.set('adsense_link_color','#ffffff')
.set('adsense_url_color','#9bb1c5')
.addService(googletag.pubads());
});
googletag.cmd.push(function() {
googletag.defineOutOfPageSlot('/6783/OverBlogKiwi/fr/245297_lesitedontvousetesleheros.overblog.com', '_2c08e5b')
.setTargeting('Slot', 'interstitial')
.setTargeting('Sliding', 'Both')
.addService(googletag.pubads());
});
googletag.cmd.push(function() {
googletag.defineOutOfPageSlot('/6783/OverBlogKiwi/fr/245297_lesitedontvousetesleheros.overblog.com', '_3883585')
.setTargeting('Slot', 'pop')
.addService(googletag.pubads());
});
</script>
<script src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogpdafront/prebid.js?v2.39.3.0" async></script>
<script>
googletag.cmd.push(function() {
googletag.pubads().disableInitialLoad();
});
function sendAdserverRequest() {
if (pbjs.adserverRequestSent) return;
pbjs.adserverRequestSent = true;
googletag.cmd.push(function() {
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
});
});
}
var PREBID_TIMEOUT = 2000;
var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];
pbjs.que.push(function() {
pbjs.enableAnalytics({
provider: 'ga',
options: {
global: 'ga',
enableDistribution: false,
sampling: 0.01
}
});
pbjs.setConfig({
userSync: {
enabledBidders: ['rubicon'],
iframeEnabled: false
} ,
consentManagement: {
cmpApi: 'iab',
timeout: 2500,
allowAuctionWithoutConsent: true
}
});
pbjs.bidderSettings = {
standard: {
adserverTargeting: [{
key: "hb_bidder",
val: function(bidResponse) {
return bidResponse.bidderCode;
}
}, {
key: "hb_adid",
val: function(bidResponse) {
return bidResponse.adId;
}
}, {
key: "custom_bid_price",
val: function(bidResponse) {
var cpm = bidResponse.cpm;
if (cpm < 1.00) {
return (Math.floor(cpm * 20) / 20).toFixed(2);
} else if (cpm < 5.00) {
return (Math.floor(cpm * 10) / 10).toFixed(2);
} else if (cpm < 10.00) {
return (Math.floor(cpm * 5) / 5).toFixed(2);
} else if (cpm < 20.00) {
return (Math.floor(cpm * 2) / 2).toFixed(2);
} else if (cpm < 50.00) {
return (Math.floor(cpm * 1) / 1).toFixed(2);
} else if (cpm < 100.00) {
return (Math.floor(cpm * 0.2) / 0.2).toFixed(2);
} else if (cpm < 300.00) {
return (Math.floor(cpm * 0.04) / 0.04).toFixed(2);
} else {
return '300.00';
}
}
}]
}
};
});
setTimeout(sendAdserverRequest, PREBID_TIMEOUT);
</script>
<script>
pbjs.que.push(function() {
var adUnits = [];
adUnits.push({
code: '_13ed3ef',
sizes: [[728,90]],
bids: [
{
bidder: 'appnexusAst',
params: {
placementId: 6542403,
},
},
{
bidder: 'rubicon',
params: {
accountId: 16072,
siteId: 119536,
zoneId: 775434,
},
},
]
})
adUnits.push({
code: '_30f3350',
sizes: [[300,250]],
bids: [
{
bidder: 'appnexusAst',
params: {
placementId: 6531816,
},
},
{
bidder: 'rubicon',
params: {
accountId: 16072,
siteId: 119536,
zoneId: 775488,
},
},
]
})
adUnits.push({
code: '_6d67124',
sizes: [[300,250]],
bids: [
{
bidder: 'appnexusAst',
params: {
placementId: 6531817,
},
},
{
bidder: 'rubicon',
params: {
accountId: 16072,
siteId: 119536,
zoneId: 775490,
},
},
]
})
adUnits.push({
code: '_bb9b0bf',
sizes: [[300,250],[300,600]],
bids: [
{
bidder: 'appnexusAst',
params: {
placementId: 6542408,
},
},
{
bidder: 'rubicon',
params: {
accountId: 16072,
siteId: 119536,
zoneId: 775484,
},
},
]
})
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
bidsBackHandler: function(bidResponses) {
sendAdserverRequest();
}
});
});
</script>
<script>
try {
googletag.cmd.push(function() {
// DFP Global Targeting
googletag.pubads().setTargeting('Rating', 'BS');
googletag.pubads().setTargeting('Disused', 'Yes');
googletag.pubads().setTargeting('Adult', 'No');
googletag.pubads().setTargeting('Category', 'literature-comics-poetry');
googletag.pubads().enableSingleRequest();
googletag.pubads().collapseEmptyDivs();
googletag.enableServices();
});
}
catch(e) {}
</script>
<!-- DFP -->
<script>
var _eStat_Whap_loaded=0;
</script>
<script src="//w.estat.com/js/whap.js"></script>
<script>
if(_eStat_Whap_loaded) {
eStatWhap.serial("800000207013");
eStatWhap.send();
}
</script>
<script src="https://cdn.tradelab.fr/tag/208269514b.js" async></script>
</head>
<body class="withDisplay" >
<div class="ob-ShareBar ob-ShareBar--dark js-ob-ShareBar">
<div class="ob-ShareBar-container ob-ShareBar-container--left">
<a href="https://www.over-blog.com" class="ob-ShareBar-branding">
<img class="ob-ShareBar-brandingImg" src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/images/shareicon-branding-ob--dark.png?v2.39.3.0" alt="Overblog">
</a>
</div>
<div class="ob-ShareBar-container ob-ShareBar-container--right">
<a href="#" data-href="https://www.facebook.com/sharer/sharer.php?u={referer}" title=" facebook"="FACEBOOK"|trans }}"" class="ob-ShareBar-share ob-ShareBar-share--facebook"></a>
<a href="#" data-href="https://twitter.com/intent/tweet?url={referer}&text={title}" title=" twitter"="TWITTER"|trans }}"" class="ob-ShareBar-share ob-ShareBar-share--twitter"></a>
<a href="#" data-href="#" title=" pinterest"="PINTEREST"|trans }}"" class="ob-ShareBar-share ob-ShareBar-share--pinterest js-ob-ShareBar-share--pinterest"></a>
<form action="/search" method="post" accept-charset="utf-8" class="ob-ShareBar-search">
<input type="text" name="q" value="" class="ob-ShareBar-input" placeholder="Rechercher">
<button class="ob-ShareBar-submit"></button>
</form>
<a href="https://admin.over-blog.com/245297/write/29340435" class="ob-ShareBar-edit ob-ShareBar--connected-blog">
<span>Editer l'article</span>
</a>
<a class="js-ob-ShareBar-follow ob-ShareBar--connected ob-ShareBar-follow" href="https://admin.over-blog.com/_follow/245297" target="_blank" rel="nofollow">
Suivre ce blog
</a>
<a href="https://admin.over-blog.com/245297" class="ob-ShareBar-admin ob-ShareBar--connected">
<img src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/images/lock-alt-dark.svg?v2.39.3.0" class="ob-ShareBar-lock">
<span>Administration</span>
</a>
<a href="https://connect.over-blog.com/fr/login" class="ob-ShareBar-login ob-ShareBar--notconnected">
<img src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/images/lock-alt-dark.svg?v2.39.3.0" class="ob-ShareBar-lock">
<span>Connexion</span>
</a>
<a href="https://connect.over-blog.com/fr/signup" class="ob-ShareBar-create ob-ShareBar--notconnected">
<span class="ob-ShareBar-plus">+</span>
<span>Créer mon blog</span>
</a>
<span class="ob-ShareBar-toggle ob-ShareBar-toggle--hide js-ob-ShareBar-toggle"></span>
</div>
</div>
<div class="ob-ShareBar ob-ShareBar--minified js-ob-ShareBar--minified">
<div class="ob-ShareBar-container">
<span class="ob-ShareBar-toggle ob-ShareBar-toggle--show js-ob-ShareBar-toggle"></span>
</div>
</div>
<script src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/js/sharebar.js?v2.39.3.0"></script>
<script>
var postTitle = "333"
socialShare(document.querySelector('.ob-ShareBar-share--facebook'), postTitle)
socialShare(document.querySelector('.ob-ShareBar-share--twitter'), postTitle)
</script> <!-- Init Facebook script -->
<div id="fb-root"></div>
<div class="ads ads-728x90">
<div id='_13ed3ef'><script>
try {
if (!window.__13ed3ef) {
window.__13ed3ef = true;
googletag.cmd.push(function() { googletag.display('_13ed3ef'); });
}
} catch(e) {}
</script></div> </div>
<div id="global">
<div id="ln_0" class="ln">
<div id="cl_0_0" class="cl">
<div class="column_content">
<div class="header">
<div id="top">
<h1 class="title">
<a href="http://lesitedontvousetesleheros.overblog.com" class="topLien" title="Lecture des livres dont vous êtes le héros">Le Site dont vous êtes le Héros</a>
</h1>
<p class="description">Lecture des livres dont vous êtes le héros</p>
</div>
</div>
</div>
</div>
<div class="clear"></div>
</div>
<div id="ln_1" class="ln">
<div id="cl_1_0" class="cl">
<div class="column_content">
<div>
<!-- Title -->
<!-- list posts -->
<article>
<div class="article">
<div class="option beforeArticle">
<div class="date">
Publié le
<time datetime="2013-06-12T20:57:28+02:00">12 Juin 2013</time>
</div>
<span class="tags">
</span>
</div>
<div class="divTitreArticle">
<h2 class="post-title">
<a href="http://lesitedontvousetesleheros.overblog.com/333-70" class="titreArticle" title="Une fois la flamme de la bougie soufflée, vous essayez de vous glisser avec délectation dans les bras de Morphée. Mais vous n'êtes pas couché depuis cinq minutes qu'un grattement furtif vous parvient du palier. A demi plongé dans le sommeil, vous ne savez...">
333
</a>
</h2>
</div>
<div class="contenuArticle">
<div class="ob-sections">
<div class="ob-section ob-section-text">
<div class="ob-text">
<p>Une fois la flamme de la bougie soufflée, vous essayez de vous glisser avec délectation dans les bras de Morphée. Mais vous n'êtes pas couché depuis cinq minutes qu'un grattement furtif vous parvient du palier. A demi plongé dans le sommeil, vous ne savez trop si quelqu'un essaie de pousser votre porte ou si votre imagination tend à la paranoïa obsessionnelle. Que faire ?</p><p><a href="http://lesitedontvousetesleheros.overblog.com/372-16">Ouvrir la porte pour en avoir le cœur net ?</a></p><p><a href="http://lesitedontvousetesleheros.overblog.com/393-86">Vous poster en embuscade pour surprendre un éventuel visiteur ?</a><em> </em></p><p><a href="http://lesitedontvousetesleheros.overblog.com/245-18">Ignorer tout ceci et dormir ?</a><em> </em></p>
</div>
</div>
</div>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
<!-- Share buttons + comments -->
<div class="afterArticle">
<div class="clear"></div>
<!-- Pagination -->
<div class="pagination clearfix">
<a href="http://lesitedontvousetesleheros.overblog.com/332-28" title="332" class="previous">← 332</a>
<a href="http://lesitedontvousetesleheros.overblog.com/334-18" title="334" class="next">334 →</a>
</div>
<!-- Comments -->
</div>
</article>
</div>
<div class="ads ads-600x250 clearfix">
<div id='_30f3350'><script>
try {
if (!window.__30f3350) {
window.__30f3350 = true;
googletag.cmd.push(function() { googletag.display('_30f3350'); });
}
} catch(e) {}
</script></div> <div id='_6d67124'><script>
try {
if (!window.__6d67124) {
window.__6d67124 = true;
googletag.cmd.push(function() { googletag.display('_6d67124'); });
}
} catch(e) {}
</script></div> </div>
<!-- Pagination -->
</div>
</div>
<div id="cl_1_1" class="cl">
<div class="column_content">
<div class="box freeModule">
<div class="box-titre">
<h3><span></span></h3>
</div>
<div class="box-content">
<div><script src="http://h1.flashvortex.com/display.php?id=2_1391984427_52721_435_0_468_60_8_1_13" type="text/javascript"></script></div>
</div>
</div>
<!-- Search -->
<div class="ads ads-300">
<div id='_bb9b0bf'><script>
try {
if (!window.__bb9b0bf) {
window.__bb9b0bf = true;
googletag.cmd.push(function() { googletag.display('_bb9b0bf'); });
}
} catch(e) {}
</script></div> </div>
<!-- Navigation -->
<div class="box blogroll">
<div class="box-titre">
<h3>
<span>Liens</span>
</h3>
</div>
<div class="box-content">
<ul class="list">
<li>
<a href="http://www.lesitedontvousetesleheros.fr/liste-des-series" target="_blank">
LISTE DES SERIES
</a>
</li>
<li>
<a href="http://www.lesitedontvousetesleheros.fr/2017/02/autres-livres-dont-vous-etes-le-heros-chez-divers-editeurs.html" target="_blank">
AUTRES LIVRES DONT VOUS ETES LE HEROS
</a>
</li>
</ul>
</div>
</div>
<p class="credits">
Hébergé par <a href="http://www.over-blog.com" target="_blank">Overblog</a>
</p>
</div>
</div>
<div class="clear"></div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://assets.over-blog-kiwi.com/themes/jquery/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<script>
$(document).ready(function() {
// Fancybox
$(".ob-section-images a, .ob-link-img").attr("rel", "fancybox");
$("a[rel=fancybox]").fancybox({
'overlayShow' : true,
'transitionIn' : 'fadin',
'transitionOut' : 'fadin',
'type' : 'image'
});
});
// Twitter share + tweets
!function(d,s,id){
var js, fjs = d.getElementsByTagName(s)[0];
if(!d.getElementById(id)){
js = d.createElement(s);
js.id = id;
js.src = "//platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js,fjs);
}
}(document,"script","twitter-wjs");
// Google + button
window.___gcfg = {lang: 'fr'};
(function() {
var po = document.createElement('script');
po.type = 'text/javascript';
po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);
})();
</script>
<script src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/js/print.js?v2.39.3.0"></script>
<script>
var postTitle = "333"
printPost(postTitle)
</script>
<div class="ob-footer" id="legals" >
<ul>
<li class="ob-footer-item"><a href="https://www.over-blog.com/" target="_blank">Créer un blog gratuit sur Overblog</a></li>
<li class="ob-footer-item"><a href="/top">Top articles</a></li>
<li class="ob-footer-item"><a href="/contact">Contact</a></li>
<li class="ob-footer-item"><a href="https://www.over-blog.com/abuse/245297"> Signaler un abus </a></li>
<li class="ob-footer-item"><a href="https://www.over-blog.com/terms-of-use" target="_blank">C.G.U.</a></li>
<li class="ob-footer-item"><a href="https://www.over-blog.com/features/earn-money.html" target="_blank">Rémunération en droits d'auteur</a></li>
<li class="ob-footer-item"><a href="https://www.over-blog.com/features/premium.html" target="_blank">Offre Premium</a></li>
<li class="ob-footer-item"><a href="https://www.over-blog.com/cookies" target="_blank">Cookies et données personnelles</a></li>
</ul>
</div>
<div id='_2c08e5b'><script>
googletag.cmd.push(function() { googletag.display('_2c08e5b'); });
</script></div><div id='_3883585'><script>
googletag.cmd.push(function() { googletag.display('_3883585'); });
</script></div>
<!-- End Google Tag Manager -->
<script>
dataLayer = [{
'category' : 'Literature, Comics & Poetry',
'rating' : 'BS',
'unused' : 'Yes',
'adult' : 'No',
'pda' : 'No',
'hasAds' : 'Yes',
'lang' : 'fr',
'adblock' : '__ads_loaded__' in window ? 'No' : 'Yes'
}];
</script>
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-KJ6B85"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>
googletag.cmd.push(function() {
(function(w,d,s,l,i){
w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});
var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';
j.async=true;j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-KJ6B85');
});
</script>
<!-- Begin comScore Tag -->
<script>
var _comscore = _comscore || [];
_comscore.push({ c1: "2", c2: "6035191" });
(function() {
var s = document.createElement("script"), el = document.getElementsByTagName("script")[0]; s.async = true;
s.src = (document.location.protocol == "https:" ? "https://sb" : "http://b") + ".scorecardresearch.com/beacon.js";
el.parentNode.insertBefore(s, el);
})();
</script>
<noscript>
<img src="http://b.scorecardresearch.com/p?c1=2&c2=6035191&cv=2.0&cj=1" />
</noscript>
<!-- End comScore Tag -->
<!-- Begin Mediamétrie Tag -->
<script>
function _eStat_Whap_loaded_func(){
eStatWhap.serial("800000207013");
eStatWhap.send();
}
(function() {
var myscript = document.createElement('script');
myscript.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'w.estat.com/js/whap.js';
myscript.setAttribute('async', 'true');
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(myscript, s);
})();
</script>
<!-- End Mediamétrie Tag -->
<script>
(function() {
var alreadyAccept = getCookie('wbCookieNotifier');
if(alreadyAccept != 1) showWbCookieNotifier();
window.closeWbCookieNotifier = function() {
setCookie('wbCookieNotifier', 1, 730);
window.document.getElementById("ob-cookies").style.display = "none";
}
function showWbCookieNotifier(){
var el = document.createElement("div");
var bo = document.body;
el.id = "ob-cookies";
el.className = "__wads_no_click ob-cookies";
var p = document.createElement("p");
p.className = "ob-cookies-content";
p.innerHTML = "En poursuivant votre navigation sur ce site, vous acceptez l'utilisation de cookies. Ces derniers assurent le bon fonctionnement de nos services, d'outils d'analyse et l’affichage de publicités pertinentes. <a class='ob-cookies-link' href='https://www.over-blog.com/cookies' target='_blank'>En savoir plus et agir</a> sur les cookies. <span class='ob-cookies-button' onclick='closeWbCookieNotifier()'>J'accepte</span>"
document.body.appendChild(el); el.appendChild(p);
window.wbCookieNotifier = el;
}
function setCookie(e,t,n,d){var r=new Date;r.setDate(r.getDate()+n);var i=escape(t)+(n==null?"":"; expires="+r.toUTCString())+(d==null?"":"; domain="+d)+";path=/";document.cookie=e+"="+i}
function getCookie(e){var t,n,r,i=document.cookie.split(";");for(t=0;t<i.length;t++){n=i[t].substr(0,i[t].indexOf("="));r=i[t].substr(i[t].indexOf("=")+1);n=n.replace(/^\s+|\s+$/g,"");if(n==e){return unescape(r)}}}
})();
</script>
</body>
</html>
| czuger/haute_tension | work/raw_data/pretre_jean_adorateurs_mal/daa931d1d025cc6e01cae4c69445f3823df6e84f4690e8461ce2df0bf4593a92.html | HTML | mit | 66,141 | [
30522,
1026,
8040,
3089,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
11374,
1027,
1000,
10424,
1000,
5167,
16186,
1027,
1000,
1000,
8875,
13874,
1027,
1000,
8299,
1024,
1013,
1013,
8040,
28433,
1012,
8917,
1013,
9927,
1000,
1028,
1026... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.