code stringlengths 5 1.01M | repo_name stringlengths 5 84 | path stringlengths 4 311 | language stringclasses 30 values | license stringclasses 15 values | size int64 5 1.01M | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|
#ifndef KISS_FTR_H
#define KISS_FTR_H
#include "kiss_fft.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
Real optimized version can save about 45% cpu time vs. complex fft of a real seq.
*/
typedef struct kiss_fftr_state *kiss_fftr_cfg;
kiss_fftr_cfg kiss_fftr_alloc(int nfft,int inverse_fft,void * mem, size_t * lenmem);
/*
nfft must be even
If you don't care to allocate space, use mem = lenmem = NULL
*/
void kiss_fftr(kiss_fftr_cfg cfg,const kiss_fft_scalar *timedata,kiss_fft_cpx *freqdata);
/*
input timedata has nfft scalar points
output freqdata has nfft/2+1 complex points
*/
void kiss_fftr2(kiss_fftr_cfg st,const kiss_fft_scalar *timedata,kiss_fft_scalar *freqdata);
void kiss_fftri(kiss_fftr_cfg cfg,const kiss_fft_cpx *freqdata,kiss_fft_scalar *timedata);
void kiss_fftri2(kiss_fftr_cfg st,const kiss_fft_scalar *freqdata, kiss_fft_scalar *timedata);
/*
input freqdata has nfft/2+1 complex points
output timedata has nfft scalar points
*/
#define kiss_fftr_free speex_free
#ifdef __cplusplus
}
#endif
#endif
| wendysuly/TeamTalk | win-client/3rdParty/src/libspeex/libspeex/kiss_fftr.h | C | apache-2.0 | 1,055 | [
30522,
1001,
2065,
13629,
2546,
3610,
1035,
3027,
2099,
1035,
1044,
1001,
9375,
3610,
1035,
3027,
2099,
1035,
1044,
1001,
2421,
1000,
3610,
1035,
21461,
2102,
1012,
1044,
1000,
1001,
2065,
3207,
2546,
1035,
1035,
18133,
7393,
24759,
2271,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
/* Test divi4 for SPU
Copyright (C) 2006, 2007 Sony Computer Entertainment Inc.
All rights reserved.
Redistribution and use in source and binary forms,
with or without modification, are permitted provided that the
following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Sony Computer Entertainment Inc nor the names
of its contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "simdmath.h"
#include "common-test.h"
#include "testutils.h"
int main()
{
TEST_SET_START("20040928161739EJL","EJL", "divi4");
int x0n = 0xffccb78d;
int x0d = 0x0 ;
int x0q = 0x0 ;
int x0r = 0xffccb78d;
int x1n = 0xff978333;
int x1d = 0xff976bb6;
int x1q = 0x0 ;
int x1r = 0xff978333;
int x2n = 0x5e146 ;
int x2d = 0xd14ebe0e;
int x2q = 0x0 ;
int x2r = 0x5e146 ;
int x3n = 0xf0e91618;
int x3d = 0xfddff7ac;
int x3q = 0x7 ;
int x3r = 0xffc95064;
int x4n = 0xf2128d9d;
int x4d = 0xe0f76 ;
int x4q = 0xffffff03;
int x4r = 0xfff7d53b;
int x5n = 0xda1ba2ce;
int x5d = 0x4c9 ;
int x5q = 0xfff814d3;
int x5r = 0xfffffd23;
int x6n = 0xdd4426a6;
int x6d = 0xf8d245cf;
int x6q = 0x4 ;
int x6r = 0xf9fb0f6a;
int x7n = 0xd1d5ae9 ;
int x7d = 0x333ab105;
int x7q = 0x0 ;
int x7r = 0xd1d5ae9 ;
int x8n = 0x3e0c6 ;
int x8d = 0xfff24255;
int x8q = 0x0 ;
int x8r = 0x3e0c6 ;
int x9n = 0xfd6fe27e;
int x9d = 0xf32454 ;
int x9q = 0xfffffffe;
int x9r = 0xff562b26;
int x10n =0xfb150f79;
int x10d =0xf521 ;
int x10q =0xfffffade;
int x10r =0xffff42db;
int x11n =0xfe88071f;
int x11d =0xfff937c2;
int x11q =0x37 ;
int x11r =0xfffd0c71;
vec_int4 x0n_v = (vec_int4){ x0n, x1n, x2n, x3n };
vec_int4 x1n_v = (vec_int4){ x4n, x5n, x6n, x7n };
vec_int4 x2n_v = (vec_int4){ x8n, x9n, x10n, x11n };
vec_int4 x0d_v = (vec_int4){ x0d, x1d, x2d, x3d };
vec_int4 x1d_v = (vec_int4){ x4d, x5d, x6d, x7d };
vec_int4 x2d_v = (vec_int4){ x8d, x9d, x10d, x11d };
vec_int4 x0q_v = (vec_int4){ x0q, x1q, x2q, x3q };
vec_int4 x1q_v = (vec_int4){ x4q, x5q, x6q, x7q };
vec_int4 x2q_v = (vec_int4){ x8q, x9q, x10q, x11q };
vec_int4 x0r_v = (vec_int4){ x0r, x1r, x2r, x3r };
vec_int4 x1r_v = (vec_int4){ x4r, x5r, x6r, x7r };
vec_int4 x2r_v = (vec_int4){ x8r, x9r, x10r, x11r };
divi4_t res;
TEST_START("divi4");
res = divi4(x0n_v, x0d_v);
TEST_CHECK("20040928161846EJL", allequal_int4( res.quot, x0q_v ) && allequal_int4( res.rem, x0r_v ), 0);
res = divi4(x1n_v, x1d_v);
TEST_CHECK("20040928161851EJL", allequal_int4( res.quot, x1q_v ) && allequal_int4( res.rem, x1r_v ), 0);
res = divi4(x2n_v, x2d_v);
TEST_CHECK("20040928161855EJL", allequal_int4( res.quot, x2q_v ) && allequal_int4( res.rem, x2r_v ), 0);
TEST_SET_DONE();
TEST_EXIT();
}
| xissburg/XDefrac | bullet-2.78/Extras/simdmathlibrary/spu/tests/divi4.c | C | mit | 4,371 | [
30522,
1013,
1008,
3231,
4487,
5737,
2549,
2005,
11867,
2226,
9385,
1006,
1039,
1007,
2294,
1010,
2289,
8412,
3274,
4024,
4297,
1012,
2035,
2916,
9235,
1012,
25707,
1998,
2224,
1999,
3120,
1998,
12441,
3596,
1010,
2007,
2030,
2302,
14080,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
/*
* AudioCore.c: Implements the JNi interface and handles
*
* (C) Copyright 2015 Simon Grätzer
* Email: simon@graetzer.org
*
* 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; version 2
* of the License.
*/
#include "de_rwth_aachen_comsys_audiosync_AudioCore.h"
#include <android/log.h>
#include <android/asset_manager.h>
#include <android/asset_manager_jni.h>
#include <signal.h>
#include <assert.h>
#include "audioplayer.h"
#include "AudioStreamSession.h"
#include "SenderSession.h"
#include "ReceiverSession.h"
#include "decoder.h"
#include "jrtplib/rtpsourcedata.h"
#define debugLog(...) __android_log_print(ANDROID_LOG_DEBUG, "AudioCore", __VA_ARGS__)
//#define debugLog(...) printf(__VA_ARGS__)
#ifdef RTP_SUPPORT_THREAD
void thread_exit_handler(int sig) {
debugLog("this signal is %d \n", sig);
pthread_exit(0);
}
#endif
// Global audiostream manager
AudioStreamSession *audioSession;
void Java_de_rwth_1aachen_comsys_audiosync_AudioCore_initAudio(JNIEnv *env, jobject thiz,
jint samplesPerSec,
jint framesPerBuffer) {
audioplayer_initGlobal((uint32_t) samplesPerSec, (uint32_t) framesPerBuffer);
#ifdef RTP_SUPPORT_THREAD
// Workaround to kill threads since pthread_cancel is not supported
// See jthread.cpp
struct sigaction actions;
memset(&actions, 0, sizeof(actions));
sigemptyset(&actions.sa_mask);
actions.sa_flags = 0;
actions.sa_handler = thread_exit_handler;
sigaction(SIGUSR1, &actions, NULL);
#endif
}
void Java_de_rwth_1aachen_comsys_audiosync_AudioCore_deinitAudio(JNIEnv *env, jobject thiz) {
if (audioSession) audioSession->Stop();
if (audioSession) delete audioSession;
audioplayer_cleanup();
}
void Java_de_rwth_1aachen_comsys_audiosync_AudioCore_startStreamingAsset (JNIEnv *env, jobject thiz,
jint portbase,
jobject assetManager,
jstring jPath) {
AAssetManager *mgr = AAssetManager_fromJava(env, assetManager);
const char *path = env->GetStringUTFChars(jPath, 0);
// Open the asset from the assets/ folder
AAsset *asset = AAssetManager_open(mgr, path, AASSET_MODE_UNKNOWN);
env->ReleaseStringUTFChars(jPath, path);
if (NULL == asset) {
debugLog("_ASSET_NOT_FOUND_");
return;
}
off_t outStart, fileSize;
int fd = AAsset_openFileDescriptor(asset, &outStart, &fileSize);
assert(0 <= fd);
debugLog("Audio file offset: %ld, size: %ld", outStart, fileSize);
AMediaExtractor *extr = decoder_createExtractorFromFd(fd, outStart, fileSize);
audioSession = SenderSession::StartStreaming((uint16_t) portbase, extr);
AAsset_close(asset);
}
void Java_de_rwth_1aachen_comsys_audiosync_AudioCore_startStreamingUri
(JNIEnv *env, jobject thiz, jint portbase, jstring jPath) {
const char *path = env->GetStringUTFChars(jPath, 0);
AMediaExtractor *extr = decoder_createExtractorFromUri(path);
env->ReleaseStringUTFChars(jPath, path);
audioSession = SenderSession::StartStreaming((uint16_t) portbase, extr);
}
/*
* Class: de_rwth_aachen_comsys_audiosync_AudioCore
* Method: startReceiving
* Signature: (Ljava/lang/String;I)V
*/
void Java_de_rwth_1aachen_comsys_audiosync_AudioCore_startReceiving(JNIEnv *env, jobject thiz,
jstring jHost, jint portbase) {
const char *host = env->GetStringUTFChars(jHost, 0);
audioSession = ReceiverSession::StartReceiving(host, (uint16_t) portbase);
env->ReleaseStringUTFChars(jHost, host);
}
/*
* Class: de_rwth_aachen_comsys_audiosync_AudioCore
* Method: stop
* Signature: ()V
*/
void Java_de_rwth_1aachen_comsys_audiosync_AudioCore_stopServices(JNIEnv *env, jobject thiz) {
if (audioSession) audioSession->Stop();
audioplayer_stopPlayback();
}
void Java_de_rwth_1aachen_comsys_audiosync_AudioCore_setDeviceLatency(JNIEnv *env, jobject thiz, jlong latencyMs) {
if (latencyMs >= 0)
audioplayer_setDeviceLatency((int64_t)latencyMs * 1000);
}
/*
* Class: de_rwth_aachen_comsys_audiosync_AudioCore
* Method: getRtpSourceCount
* Signature: ()I
*/
jobjectArray Java_de_rwth_1aachen_comsys_audiosync_AudioCore_getAudioDestinations
(JNIEnv *env, jobject thiz) {
if (audioSession == NULL) return NULL;
int i = 0;
if (audioSession->GotoFirstSource())
do {
jrtplib::RTPSourceData *source = audioSession->GetCurrentSourceInfo();
if (source == nullptr || source->IsOwnSSRC()) continue;
i++;
} while (audioSession->GotoNextSource());
if (i == 0) return NULL;
jclass clzz = env->FindClass("de/rwth_aachen/comsys/audiosync/AudioDestination");
jmethodID init = env->GetMethodID(clzz, "<init>", "()V");
jfieldID nameID = env->GetFieldID(clzz, "name", "Ljava/lang/String;");
jfieldID jitterID = env->GetFieldID(clzz, "jitter", "I");
jfieldID timeOffsetID = env->GetFieldID(clzz, "timeOffset", "I");
jfieldID packetsLostID = env->GetFieldID(clzz, "packetsLost", "I");
jobjectArray ret = env->NewObjectArray(i, clzz, NULL);
i = 0;
if (audioSession->GotoFirstSource()) {
do {
jrtplib::RTPSourceData *source = audioSession->GetCurrentSourceInfo();
if (source != nullptr && !source->IsOwnSSRC()) {
jrtplib::RTPSourceData *sourceData = audioSession->GetCurrentSourceInfo();
size_t nameLen = 0;
uint8_t *nameChars = sourceData->SDES_GetName(&nameLen);
char chars[256] = {0};
memcpy(chars, nameChars, nameLen);
jobject dest = env->NewObject(clzz, init);
env->SetObjectField(dest, nameID, env->NewStringUTF(chars));
env->SetIntField(dest, jitterID, (jint) sourceData->INF_GetJitter());
env->SetIntField(dest, timeOffsetID, (jint)sourceData->GetClockOffsetUSeconds());
env->SetIntField(dest, packetsLostID, (jint) sourceData->RR_GetPacketsLost());
env->SetObjectArrayElement(ret, i, dest);
i++;
}
} while (audioSession->GotoNextSource());
}
return ret;
}
/*
* Return current presentation time in milliseconds
*/
jlong Java_de_rwth_1aachen_comsys_audiosync_AudioCore_getCurrentPresentationTime
(JNIEnv *, jobject) {
if (audioSession != NULL && audioSession->IsRunning())
return (jlong)(audioSession->CurrentPlaybackTimeUs() / 1000);
return -1;
}
jboolean Java_de_rwth_1aachen_comsys_audiosync_AudioCore_isRunning (JNIEnv *, jobject) {
bool a = audioSession != NULL && audioSession->IsRunning();
return (jboolean) (a ? JNI_TRUE : JNI_FALSE);
}
jboolean Java_de_rwth_1aachen_comsys_audiosync_AudioCore_isSending(JNIEnv *, jobject) {
if (audioSession != NULL && audioSession->IsSender()) {
return (jboolean) (audioSession->IsRunning());
}
return JNI_FALSE;
}
void Java_de_rwth_1aachen_comsys_audiosync_AudioCore_pauseSending
(JNIEnv *, jobject) {
if (audioSession != NULL && audioSession->IsSender()) {
SenderSession *sender = (SenderSession *)audioSession;
// TODO
}
}
| graetzer/AudioSync | app/src/main/jni/AudioCore.cpp | C++ | gpl-2.0 | 7,611 | [
30522,
1013,
1008,
1008,
5746,
17345,
1012,
1039,
1024,
22164,
1996,
1046,
3490,
8278,
1998,
16024,
1008,
1008,
1006,
1039,
1007,
9385,
2325,
4079,
24665,
20501,
2121,
1008,
10373,
1024,
4079,
1030,
24665,
6679,
29546,
1012,
8917,
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... |
<?xml version="1.0" ?><!DOCTYPE TS><TS language="lv_LV" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Hirocoin</source>
<translation>Par Hirocoin</translation>
</message>
<message>
<location line="+39"/>
<source><b>Hirocoin</b> version</source>
<translation><b>Hirocoin</b> versija</translation>
</message>
<message>
<location line="+57"/>
<source>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../aboutdialog.cpp" line="+14"/>
<source>Copyright</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The Hirocoin developers</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation>Adrešu grāmata</translation>
</message>
<message>
<location line="+19"/>
<source>Double-click to edit address or label</source>
<translation>Adresi vai nosaukumu rediģē ar dubultklikšķi</translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>Izveidot jaunu adresi</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Kopēt iezīmēto adresi uz starpliktuvi</translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation>&Jauna adrese</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+63"/>
<source>These are your Hirocoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>&Copy Address</source>
<translation>&Kopēt adresi</translation>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation>Parādīt &QR kodu</translation>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a Hirocoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Export</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>Verify a message to ensure it was signed with a specified Hirocoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation>&Dzēst</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="-5"/>
<source>These are your Hirocoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Copy &Label</source>
<translation>Kopēt &Nosaukumu</translation>
</message>
<message>
<location line="+1"/>
<source>&Edit</source>
<translation>&Rediģēt</translation>
</message>
<message>
<location line="+1"/>
<source>Send &Coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+260"/>
<source>Export Address Book Data</source>
<translation>Eksportēt adreses</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Fails ar komatu kā atdalītāju (*.csv)</translation>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation>Kļūda eksportējot</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Nevar ierakstīt failā %1.</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation>Nosaukums</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adrese</translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation>(bez nosaukuma)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation>Paroles dialogs</translation>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation>Ierakstiet paroli</translation>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation>Jauna parole</translation>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation>Jaunā parole vēlreiz</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+33"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation>Ierakstiet maciņa jauno paroli.<br/>Lūdzu izmantojiet <b>10 vai vairāk nejauši izvēlētas zīmes</b>, vai <b>astoņus un vairāk vārdus</b>.</translation>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation>Šifrēt maciņu</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Lai veikto šo darbību, maciņš jāatslēdz ar paroli.</translation>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation>Atslēgt maciņu</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Šai darbībai maciņš jāatšifrē ar maciņa paroli.</translation>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation>Atšifrēt maciņu</translation>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation>Mainīt paroli</translation>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Ierakstiet maciņa veco un jauno paroli.</translation>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation>Apstiprināt maciņa šifrēšanu</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR HIROCOINS</b>!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+100"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-130"/>
<location line="+58"/>
<source>Wallet encrypted</source>
<translation>Maciņš nošifrēts</translation>
</message>
<message>
<location line="-56"/>
<source>Hirocoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your hirocoins from being stolen by malware infecting your computer.</source>
<translation>Hirocoin aizvērsies, lai pabeigtu šifrēšanu. Atcerieties, ka maciņa šifrēšana nevar pilnībā novērst bitkoinu zādzību, ko veic datorā ieviesušās kaitīgas programmas.</translation>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+42"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation>Maciņa šifrēšana neizdevās</translation>
</message>
<message>
<location line="-54"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Maciņa šifrēšana neizdevās programmas kļūdas dēļ. Jūsu maciņš netika šifrēts.</translation>
</message>
<message>
<location line="+7"/>
<location line="+48"/>
<source>The supplied passphrases do not match.</source>
<translation>Ievadītās paroles nav vienādas.</translation>
</message>
<message>
<location line="-37"/>
<source>Wallet unlock failed</source>
<translation>Maciņu atšifrēt neizdevās</translation>
</message>
<message>
<location line="+1"/>
<location line="+11"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>Maciņa atšifrēšanai ievadītā parole nav pareiza.</translation>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation>Maciņu neizdevās atšifrēt</translation>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+233"/>
<source>Sign &message...</source>
<translation>Parakstīt &ziņojumu...</translation>
</message>
<message>
<location line="+280"/>
<source>Synchronizing with network...</source>
<translation>Sinhronizācija ar tīklu...</translation>
</message>
<message>
<location line="-349"/>
<source>&Overview</source>
<translation>&Pārskats</translation>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation>Rādīt vispārēju maciņa pārskatu</translation>
</message>
<message>
<location line="+20"/>
<source>&Transactions</source>
<translation>&Transakcijas</translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation>Skatīt transakciju vēsturi</translation>
</message>
<message>
<location line="+7"/>
<source>Edit the list of stored addresses and labels</source>
<translation>Rediģēt saglabātās adreses un nosaukumus</translation>
</message>
<message>
<location line="-14"/>
<source>Show the list of addresses for receiving payments</source>
<translation>Rādīt maksājumu saņemšanas adreses</translation>
</message>
<message>
<location line="+31"/>
<source>E&xit</source>
<translation>&Iziet</translation>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation>Aizvērt programmu</translation>
</message>
<message>
<location line="+4"/>
<source>Show information about Hirocoin</source>
<translation>Parādīt informāciju par Hirocoin</translation>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation>Par &Qt</translation>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation>Parādīt informāciju par Qt</translation>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation>&Iespējas</translation>
</message>
<message>
<location line="+6"/>
<source>&Encrypt Wallet...</source>
<translation>Š&ifrēt maciņu...</translation>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation>&Izveidot maciņa rezerves kopiju</translation>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation>&Mainīt paroli</translation>
</message>
<message>
<location line="+285"/>
<source>Importing blocks from disk...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Reindexing blocks on disk...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-347"/>
<source>Send coins to a Hirocoin address</source>
<translation>Nosūtīt bitkoinus uz Hirocoin adresi</translation>
</message>
<message>
<location line="+49"/>
<source>Modify configuration options for Hirocoin</source>
<translation>Mainīt Hirocoin konfigurācijas uzstādījumus</translation>
</message>
<message>
<location line="+9"/>
<source>Backup wallet to another location</source>
<translation>Izveidot maciņa rezerves kopiju citur</translation>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation>Mainīt maciņa šifrēšanas paroli</translation>
</message>
<message>
<location line="+6"/>
<source>&Debug window</source>
<translation>&Debug logs</translation>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation>Atvērt atkļūdošanas un diagnostikas konsoli</translation>
</message>
<message>
<location line="-4"/>
<source>&Verify message...</source>
<translation>&Pārbaudīt ziņojumu...</translation>
</message>
<message>
<location line="-165"/>
<location line="+530"/>
<source>Hirocoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-530"/>
<source>Wallet</source>
<translation>Maciņš</translation>
</message>
<message>
<location line="+101"/>
<source>&Send</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Receive</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>&Addresses</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>&About Hirocoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show or hide the main Window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Encrypt the private keys that belong to your wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Sign messages with your Hirocoin addresses to prove you own them</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Verify messages to ensure they were signed with specified Hirocoin addresses</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>&File</source>
<translation>&Fails</translation>
</message>
<message>
<location line="+7"/>
<source>&Settings</source>
<translation>&Uzstādījumi</translation>
</message>
<message>
<location line="+6"/>
<source>&Help</source>
<translation>&Palīdzība</translation>
</message>
<message>
<location line="+9"/>
<source>Tabs toolbar</source>
<translation>Ciļņu rīkjosla</translation>
</message>
<message>
<location line="+17"/>
<location line="+10"/>
<source>[testnet]</source>
<translation>[testnet]</translation>
</message>
<message>
<location line="+47"/>
<source>Hirocoin client</source>
<translation>Hirocoin klients</translation>
</message>
<message numerus="yes">
<location line="+141"/>
<source>%n active connection(s) to Hirocoin network</source>
<translation><numerusform>%n aktīvu savienojumu ar Hirocoin tīklu</numerusform><numerusform>%n aktīvs savienojums ar Hirocoin tīklu</numerusform><numerusform>%n aktīvu savienojumu as Hirocoin tīklu</numerusform></translation>
</message>
<message>
<location line="+22"/>
<source>No block source available...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Processed %1 of %2 (estimated) blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Processed %1 blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+20"/>
<source>%n hour(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n week(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>%1 behind</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Last received block was generated %1 ago.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Transactions after this will not yet be visible.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>Error</source>
<translation>Kļūda</translation>
</message>
<message>
<location line="+3"/>
<source>Warning</source>
<translation>Brīdinājums</translation>
</message>
<message>
<location line="+3"/>
<source>Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+70"/>
<source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-140"/>
<source>Up to date</source>
<translation>Sinhronizēts</translation>
</message>
<message>
<location line="+31"/>
<source>Catching up...</source>
<translation>Sinhronizējos...</translation>
</message>
<message>
<location line="+113"/>
<source>Confirm transaction fee</source>
<translation>Apstiprināt transakcijas maksu</translation>
</message>
<message>
<location line="+8"/>
<source>Sent transaction</source>
<translation>Transakcija nosūtīta</translation>
</message>
<message>
<location line="+0"/>
<source>Incoming transaction</source>
<translation>Ienākoša transakcija</translation>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation>Datums: %1
Daudzums: %2
Tips: %3
Adrese: %4
</translation>
</message>
<message>
<location line="+33"/>
<location line="+23"/>
<source>URI handling</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-23"/>
<location line="+23"/>
<source>URI can not be parsed! This can be caused by an invalid Hirocoin address or malformed URI parameters.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>Maciņš ir <b>šifrēts</b> un pašlaik <b>atslēgts</b></translation>
</message>
<message>
<location line="+8"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>Maciņš ir <b>šifrēts</b> un pašlaik <b>slēgts</b></translation>
</message>
<message>
<location filename="../bitcoin.cpp" line="+111"/>
<source>A fatal error occurred. Hirocoin can no longer continue safely and will quit.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+104"/>
<source>Network Alert</source>
<translation>Tīkla brīdinājums</translation>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation>Mainīt adrese</translation>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation>&Nosaukums</translation>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation>Adrešu grāmatas ieraksta nosaukums</translation>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation>&Adrese</translation>
</message>
<message>
<location line="+10"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation>Adrese adrešu grāmatas ierakstā. To var mainīt tikai nosūtīšanas adresēm.</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+21"/>
<source>New receiving address</source>
<translation>Jauna saņemšanas adrese</translation>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation>Jauna nosūtīšanas adrese</translation>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation>Mainīt saņemšanas adresi</translation>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation>Mainīt nosūtīšanas adresi</translation>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation>Nupat ierakstītā adrese "%1" jau atrodas adrešu grāmatā.</translation>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid Hirocoin address.</source>
<translation>Ierakstītā adrese "%1" nav derīga Hirocoin adrese.</translation>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation>Nav iespējams atslēgt maciņu.</translation>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation>Neizdevās ģenerēt jaunu atslēgu.</translation>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+424"/>
<location line="+12"/>
<source>Hirocoin-Qt</source>
<translation>Hirocoin-Qt</translation>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation>versija</translation>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation>Lietojums:</translation>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation>komandrindas izvēles</translation>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation>Lietotāja interfeisa izvēlnes</translation>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation>Uzstādiet valodu, piemēram "de_DE" (pēc noklusēšanas: sistēmas lokāle)</translation>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation>Sākt minimizētu</translation>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation>Uzsākot, parādīt programmas informācijas logu (pēc noklusēšanas: 1)</translation>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation>Iespējas</translation>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation>&Galvenais</translation>
</message>
<message>
<location line="+6"/>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation>&Maksāt par transakciju</translation>
</message>
<message>
<location line="+31"/>
<source>Automatically start Hirocoin after logging in to the system.</source>
<translation>Automātiski sākt Hirocoin pēc pieteikšanās sistēmā.</translation>
</message>
<message>
<location line="+3"/>
<source>&Start Hirocoin on system login</source>
<translation>&Sākt Hirocoin reizē ar sistēmu</translation>
</message>
<message>
<location line="+35"/>
<source>Reset all client options to default.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Reset Options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>&Network</source>
<translation>&Tīkls</translation>
</message>
<message>
<location line="+6"/>
<source>Automatically open the Hirocoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation>Uz rūtera automātiski atvērt Hirocoin klienta portu. Tas strādā tikai tad, ja rūteris atbalsta UPnP un tas ir ieslēgts.</translation>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation>Kartēt portu, izmantojot &UPnP</translation>
</message>
<message>
<location line="+7"/>
<source>Connect to the Hirocoin network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation>&Savienoties caur SOCKS proxy:</translation>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation>Proxy &IP:</translation>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation>proxy IP adrese (piem. 127.0.0.1)</translation>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation>&Ports:</translation>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation>Proxy ports (piem. 9050)</translation>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation>SOCKS &Versija:</translation>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation>proxy SOCKS versija (piem. 5)</translation>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation>&Logs</translation>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation>Pēc loga minimizācijas rādīt tikai ikonu sistēmas teknē.</translation>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>&Minimizēt uz sistēmas tekni, nevis rīkjoslu</translation>
</message>
<message>
<location line="+7"/>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation>Logu aizverot, minimizēt, nevis beigt darbu. Kad šī izvēlne iespējota, programma aizvērsies tikai pēc Beigt komandas izvēlnē.</translation>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation>M&inimizēt aizverot</translation>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation>&Izskats</translation>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation>Lietotāja interfeiss un &valoda:</translation>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting Hirocoin.</source>
<translation>Šeit var iestatīt lietotāja valodu. Iestatījums aktivizēsies pēc Hirocoin pārstartēšanas.</translation>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation>&Vienības, kurās attēlot daudzumus:</translation>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation>Izvēlēties dalījuma vienību pēc noklusēšanas, ko izmantot interfeisā un nosūtot bitkoinus.</translation>
</message>
<message>
<location line="+9"/>
<source>Whether to show Hirocoin addresses in the transaction list or not.</source>
<translation>Rādīt vai nē Hirocoin adreses transakciju sarakstā.</translation>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation>&Attēlot adreses transakciju sarakstā</translation>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation>&OK</translation>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation>&Atcelt</translation>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation>&Pielietot</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+53"/>
<source>default</source>
<translation>pēc noklusēšanas</translation>
</message>
<message>
<location line="+130"/>
<source>Confirm options reset</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Some settings may require a client restart to take effect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Do you want to proceed?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+42"/>
<location line="+9"/>
<source>Warning</source>
<translation>Brīdinājums</translation>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting Hirocoin.</source>
<translation>Iestatījums aktivizēsies pēc Bitkoin pārstartēšanas.</translation>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation>Norādītā proxy adrese nav derīga.</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation>Forma</translation>
</message>
<message>
<location line="+50"/>
<location line="+166"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the Hirocoin network after a connection is established, but this process has not completed yet.</source>
<translation>Attēlotā informācija var būt novecojusi. Jūsu maciņš pēc savienojuma izveides automātiski sinhronizējas ar Hirocoin tīklu, taču šis process vēl nav beidzies.</translation>
</message>
<message>
<location line="-124"/>
<source>Balance:</source>
<translation>Bilance:</translation>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation>Neapstiprinātas:</translation>
</message>
<message>
<location line="-78"/>
<source>Wallet</source>
<translation>Maciņš</translation>
</message>
<message>
<location line="+107"/>
<source>Immature:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation><b>Pēdējās transakcijas</b></translation>
</message>
<message>
<location line="-101"/>
<source>Your current balance</source>
<translation>Jūsu tekošā bilance</translation>
</message>
<message>
<location line="+29"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation>Kopējā apstiprināmo transakciju vērtība, vēl nav ieskaitīta kopējā bilancē</translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="+116"/>
<location line="+1"/>
<source>out of sync</source>
<translation>nav sinhronizēts</translation>
</message>
</context>
<context>
<name>PaymentServer</name>
<message>
<location filename="../paymentserver.cpp" line="+107"/>
<source>Cannot start hirocoin: click-to-pay handler</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation>QR koda dialogs</translation>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation>Pieprasīt maksājumu</translation>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation>Daudzums:</translation>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation>Nosaukums:</translation>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation>Ziņojums:</translation>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation>&Saglabāt kā...</translation>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation>Kļūda kodējot URI QR kodā.</translation>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation>Rezultāta URI pārāk garš, mēģiniet saīsināt nosaukumu vai ziņojumu. </translation>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation>Saglabāt QR kodu</translation>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation>PNG attēli (*.png)</translation>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation>Klienta vārds</translation>
</message>
<message>
<location line="+10"/>
<location line="+23"/>
<location line="+26"/>
<location line="+23"/>
<location line="+23"/>
<location line="+36"/>
<location line="+53"/>
<location line="+23"/>
<location line="+23"/>
<location filename="../rpcconsole.cpp" line="+339"/>
<source>N/A</source>
<translation>N/A</translation>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation>Klienta versija</translation>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation>&Informācija</translation>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation>Sākuma laiks</translation>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation>Tīkls</translation>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation>Savienojumu skaits</translation>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation>Testa tīklā</translation>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation>Bloku virkne</translation>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation>Pašreizējais bloku skaits</translation>
</message>
<message>
<location line="+23"/>
<source>Estimated total blocks</source>
<translation>Bloku skaita novērtējums</translation>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation>Pēdējā bloka laiks</translation>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation>&Atvērt</translation>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Show the Hirocoin-Qt help message to get a list with possible Hirocoin command-line options.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation>&Konsole</translation>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation>Kompilācijas datums</translation>
</message>
<message>
<location line="-104"/>
<source>Hirocoin - Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Hirocoin Core</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Open the Hirocoin debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation>Notīrīt konsoli</translation>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-30"/>
<source>Welcome to the Hirocoin RPC console.</source>
<translation>Laipni lūgti Hirocoin RPC konsolē.</translation>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation>Izmantojiet bultiņas uz augšu un leju, lai pārvietotos pa vēsturi, un <b>Ctrl-L</b> ekrāna notīrīšanai.</translation>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation>Ierakstiet <b>help</b> lai iegūtu pieejamo komandu sarakstu.</translation>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+124"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation>Sūtīt bitkoinus</translation>
</message>
<message>
<location line="+50"/>
<source>Send to multiple recipients at once</source>
<translation>Sūtīt vairākiem saņēmējiem uzreiz</translation>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation>Dzēst visus transakcijas laukus</translation>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation>&Notīrīt visu</translation>
</message>
<message>
<location line="+22"/>
<source>Balance:</source>
<translation>Bilance:</translation>
</message>
<message>
<location line="+10"/>
<source>123.456 BTC</source>
<translation>123,456 BTC</translation>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation>Apstiprināt nosūtīšanu</translation>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-59"/>
<source><b>%1</b> to %2 (%3)</source>
<translation><b>%1</b> līdz %2 (%3)</translation>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation>Apstiprināt bitkoinu sūtīšanu</translation>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation>Vai tiešām vēlaties nosūtīt %1?</translation>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation>un</translation>
</message>
<message>
<location line="+23"/>
<source>The recipient address is not valid, please recheck.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation>Nosūtāmajai summai jābūt lielākai par 0.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation>Daudzums pārsniedz pieejamo.</translation>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation>Kopsumma pārsniedz pieejamo, ja pieskaitīta %1 transakcijas maksa.</translation>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation>Atrastas divas vienādas adreses, vienā nosūtīšanas reizē uz katru adresi var sūtīt tikai vienreiz.</translation>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation>Kļūda: transakcija tika atteikta. Tā var gadīties, ja kāds no maciņā esošiem bitkoiniem jau iztērēts, piemēram, izmantojot wallet.dat kopiju, kurā nav atzīmēti iztērētie bitkoini.</translation>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation>Forma</translation>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation>Apjo&ms</translation>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation>&Saņēmējs:</translation>
</message>
<message>
<location line="+34"/>
<source>The address to send the payment to (e.g. H7QEPyCg1Yv3UZUALDha9bNYXuYbfMe9Lp)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+60"/>
<location filename="../sendcoinsentry.cpp" line="+26"/>
<source>Enter a label for this address to add it to your address book</source>
<translation>Lai pievienotu adresi adrešu grāmatai, tai jādod nosaukums</translation>
</message>
<message>
<location line="-78"/>
<source>&Label:</source>
<translation>&Nosaukums:</translation>
</message>
<message>
<location line="+28"/>
<source>Choose address from address book</source>
<translation>Izvēlēties adresi no adrešu grāmatas</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="+7"/>
<source>Paste address from clipboard</source>
<translation>ielīmēt adresi no starpliktuves</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+7"/>
<source>Remove this recipient</source>
<translation>Dzēst šo saņēmēju</translation>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a Hirocoin address (e.g. H7QEPyCg1Yv3UZUALDha9bNYXuYbfMe9Lp)</source>
<translation>Ierakstiet Hirocoin adresi (piem. H7QEPyCg1Yv3UZUALDha9bNYXuYbfMe9Lp)</translation>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>&Sign Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. H7QEPyCg1Yv3UZUALDha9bNYXuYbfMe9Lp)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<location line="+213"/>
<source>Choose an address from the address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-203"/>
<location line="+213"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="-203"/>
<source>Paste address from clipboard</source>
<translation>ielīmēt adresi no starpliktuves</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+12"/>
<source>Enter the message you want to sign here</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Copy the current signature to the system clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this Hirocoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Reset all sign message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation>&Notīrīt visu</translation>
</message>
<message>
<location line="-87"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. H7QEPyCg1Yv3UZUALDha9bNYXuYbfMe9Lp)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified Hirocoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Verify &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Reset all verify message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a Hirocoin address (e.g. H7QEPyCg1Yv3UZUALDha9bNYXuYbfMe9Lp)</source>
<translation>Ierakstiet Hirocoin adresi (piem. H7QEPyCg1Yv3UZUALDha9bNYXuYbfMe9Lp)</translation>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Enter Hirocoin signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SplashScreen</name>
<message>
<location filename="../splashscreen.cpp" line="+22"/>
<source>The Hirocoin developers</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>[testnet]</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+20"/>
<source>Open until %1</source>
<translation>Atvērts līdz %1</translation>
</message>
<message>
<location line="+6"/>
<source>%1/offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation>%1/neapstiprinātas</translation>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation>%1 apstiprinājumu</translation>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation>Datums</translation>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Inputs</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation>Daudzums</translation>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-209"/>
<source>, has not been successfully broadcast yet</source>
<translation>, vēl nav veiksmīgi izziņots</translation>
</message>
<message numerus="yes">
<location line="-35"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+70"/>
<source>unknown</source>
<translation>nav zināms</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+14"/>
<source>Transaction details</source>
<translation>Transakcijas detaļas</translation>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation>Šis panelis parāda transakcijas detaļas</translation>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+225"/>
<source>Date</source>
<translation>Datums</translation>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation>Tips</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adrese</translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation>Daudzums</translation>
</message>
<message numerus="yes">
<location line="+57"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+3"/>
<source>Open until %1</source>
<translation>Atvērts līdz %1</translation>
</message>
<message>
<location line="+3"/>
<source>Offline (%1 confirmations)</source>
<translation>Nav pieslēgts (%1 apstiprinājumu)</translation>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed (%1 of %2 confirmations)</source>
<translation>Nav apstiprināts (%1 no %2 apstiprinājumu)</translation>
</message>
<message>
<location line="+3"/>
<source>Confirmed (%1 confirmations)</source>
<translation>Apstiprināts (%1 apstiprinājumu)</translation>
</message>
<message numerus="yes">
<location line="+8"/>
<source>Mined balance will be available when it matures in %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+5"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>Neviens cits mezgls šo bloku nav saņēmis un droši vien netiks akceptēts!</translation>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation>Ģenerēts, taču nav akceptēts</translation>
</message>
<message>
<location line="+43"/>
<source>Received with</source>
<translation>Saņemts ar</translation>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation>Saņemts no</translation>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation>Nosūtīts</translation>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation>Maksājums sev</translation>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation>Atrasts</translation>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation>(nav pieejams)</translation>
</message>
<message>
<location line="+199"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>Transakcijas statuss. Turiet peli virs šī lauka, lai redzētu apstiprinājumu skaitu.</translation>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation>Transakcijas saņemšanas datums un laiks.</translation>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation>Transakcijas tips.</translation>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation>Transakcijas mērķa adrese.</translation>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation>Bilancei pievienotais vai atņemtais daudzums.</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+52"/>
<location line="+16"/>
<source>All</source>
<translation>Visi</translation>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation>Šodien</translation>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation>Šonedēļ</translation>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation>Šomēnes</translation>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation>Pēdējais mēnesis</translation>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation>Šogad</translation>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation>Diapazons...</translation>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation>Saņemts ar</translation>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation>Nosūtīts</translation>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation>Sev</translation>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation>Atrasts</translation>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation>Cits</translation>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation>Ierakstiet meklējamo nosaukumu vai adresi</translation>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation>Minimālais daudzums</translation>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation>Kopēt adresi</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Kopēt nosaukumu</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>Kopēt daudzumu</translation>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation>Mainīt nosaukumu</translation>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation>Rādīt transakcijas detaļas</translation>
</message>
<message>
<location line="+139"/>
<source>Export Transaction Data</source>
<translation>Eksportēt transakcijas datus</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Fails ar komatu kā atdalītāju (*.csv)</translation>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation>Apstiprināts</translation>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation>Datums</translation>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation>Tips</translation>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation>Nosaukums</translation>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation>Adrese</translation>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation>Daudzums</translation>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation>ID</translation>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation>Eksportēšanas kļūda</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Nevar ierakstīt failā %1.</translation>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation>Diapazons:</translation>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+193"/>
<source>Send Coins</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>WalletView</name>
<message>
<location filename="../walletview.cpp" line="+42"/>
<source>&Export</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+193"/>
<source>Backup Wallet</source>
<translation>Izveidot maciņa rezerves kopiju</translation>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation>Maciņa dati (*.dat)</translation>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation>Rezerves kopēšana neizdevās</translation>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation>Kļūda, saglabājot maciņu jaunajā vietā.</translation>
</message>
<message>
<location line="+4"/>
<source>Backup Successful</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The wallet data was successfully saved to the new location.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+94"/>
<source>Hirocoin version</source>
<translation>Hirocoin versija</translation>
</message>
<message>
<location line="+102"/>
<source>Usage:</source>
<translation>Lietojums:</translation>
</message>
<message>
<location line="-29"/>
<source>Send command to -server or hirocoind</source>
<translation>Nosūtīt komantu uz -server vai hirocoind</translation>
</message>
<message>
<location line="-23"/>
<source>List commands</source>
<translation>Komandu saraksts</translation>
</message>
<message>
<location line="-12"/>
<source>Get help for a command</source>
<translation>Palīdzība par komandu</translation>
</message>
<message>
<location line="+24"/>
<source>Options:</source>
<translation>Iespējas:</translation>
</message>
<message>
<location line="+24"/>
<source>Specify configuration file (default: hirocoin.conf)</source>
<translation>Norādiet konfigurācijas failu (pēc noklusēšanas: hirocoin.conf)</translation>
</message>
<message>
<location line="+3"/>
<source>Specify pid file (default: hirocoind.pid)</source>
<translation>Norādiet pid failu (pēc noklusēšanas: hirocoind.pid)</translation>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation>Norādiet datu direktoriju</translation>
</message>
<message>
<location line="-9"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation>Uzstādiet datu bāzes bufera izmēru megabaitos (pēc noklusēšanas: 25)</translation>
</message>
<message>
<location line="-28"/>
<source>Listen for connections on <port> (default: 9348 or testnet: 19348)</source>
<translation>Gaidīt savienojumus portā <port> (pēc noklusēšanas: 9348 vai testnet: 19348)</translation>
</message>
<message>
<location line="+5"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation>Uzturēt līdz <n> savienojumiem ar citiem mezgliem(pēc noklusēšanas: 125)</translation>
</message>
<message>
<location line="-48"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation>Pievienoties mezglam, lai iegūtu citu mezglu adreses, un atvienoties</translation>
</message>
<message>
<location line="+82"/>
<source>Specify your own public address</source>
<translation>Norādiet savu publisko adresi</translation>
</message>
<message>
<location line="+3"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>Slieksnis pārkāpējmezglu atvienošanai (pēc noklusēšanas: 100)</translation>
</message>
<message>
<location line="-134"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>Sekundes, cik ilgi atturēt pārkāpējmezglus no atkārtotas pievienošanās (pēc noklusēšanas: 86400)</translation>
</message>
<message>
<location line="-29"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Listen for JSON-RPC connections on <port> (default: 9347 or testnet: 19347)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<source>Accept command line and JSON-RPC commands</source>
<translation>Pieņemt komandrindas un JSON-RPC komandas</translation>
</message>
<message>
<location line="+76"/>
<source>Run in the background as a daemon and accept commands</source>
<translation>Darbināt fonā kā servisu un pieņemt komandas</translation>
</message>
<message>
<location line="+37"/>
<source>Use the test network</source>
<translation>Izmantot testa tīklu</translation>
</message>
<message>
<location line="-112"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-80"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=hirocoinrpc
rpcpassword=%s
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %%s | mail -s "Hirocoin Alert" admin@foo.com
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Cannot obtain a lock on data directory %s. Hirocoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong Hirocoin will not work properly.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Block creation options:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Connect only to the specified node(s)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Corrupted block database detected</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Do you want to rebuild the block database now?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error initializing block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error initializing wallet database environment %s!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error loading block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error opening block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error: Disk space is low!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error: Wallet locked, unable to create transaction!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error: system error: </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to read block info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to read block</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to sync block index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write file info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write to coin database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write transaction index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write undo data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Find peers using DNS lookup (default: 1 unless -connect)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Generate coins (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 288, 0 = all)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-4, default: 3)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Not enough file descriptors available.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Rebuild block chain index from current blk000??.dat files</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Set the number of threads to service RPC calls (default: 4)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+26"/>
<source>Verifying blocks...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Verifying wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-69"/>
<source>Imports blocks from external blk000??.dat file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-76"/>
<source>Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+77"/>
<source>Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Invalid -tor address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -minrelaytxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -mintxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Maintain a full transaction index (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Only accept block chain matching built-in checkpoints (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Prepend debug output with timestamp</source>
<translation>Debug izvadei sākumā pievienot laika zīmogu</translation>
</message>
<message>
<location line="+5"/>
<source>SSL options: (see the Hirocoin Wiki for SSL setup instructions)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation>Debug/trace informāciju izvadīt konsolē, nevis debug.log failā</translation>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation>Debug/trace informāciju izvadīt debug programmai</translation>
</message>
<message>
<location line="+5"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Signing transaction failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>System error: </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Transaction amount too small</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transaction amounts must be positive</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transaction too large</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Username for JSON-RPC connections</source>
<translation>JSON-RPC savienojumu lietotājvārds</translation>
</message>
<message>
<location line="+4"/>
<source>Warning</source>
<translation>Brīdinājums</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>You need to rebuild the databases using -reindex to change -txindex</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-50"/>
<source>Password for JSON-RPC connections</source>
<translation>JSON-RPC savienojumu parole</translation>
</message>
<message>
<location line="-67"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>Atļaut JSON-RPC savienojumus no norādītās IP adreses</translation>
</message>
<message>
<location line="+76"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation>Nosūtīt komandas mezglam, kas darbojas adresē <ip> (pēc noklusēšanas: 127.0.0.1)</translation>
</message>
<message>
<location line="-120"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation>Izpildīt komandu, kad labāk atbilstošais bloks izmainās (%s cmd aizvieto ar bloka hešu)</translation>
</message>
<message>
<location line="+147"/>
<source>Upgrade wallet to latest format</source>
<translation>Atjaunot maciņa formātu uz jaunāko</translation>
</message>
<message>
<location line="-21"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation>Uzstādīt atslēgu bufera izmēru uz <n> (pēc noklusēšanas: 100)</translation>
</message>
<message>
<location line="-12"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>Atkārtoti skanēt bloku virkni, meklējot trūkstošās maciņa transakcijas</translation>
</message>
<message>
<location line="+35"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>JSON-RPC savienojumiem izmantot OpenSSL (https)</translation>
</message>
<message>
<location line="-26"/>
<source>Server certificate file (default: server.cert)</source>
<translation>Servera sertifikāta fails (pēc noklusēšanas: server.cert)</translation>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation>Servera privātā atslēga (pēc noklusēšanas: server.pem)</translation>
</message>
<message>
<location line="-151"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation>Pieņemamie šifri (pēc noklusēšanas: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation>
</message>
<message>
<location line="+165"/>
<source>This help message</source>
<translation>Šis palīdzības paziņojums</translation>
</message>
<message>
<location line="+6"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation>Nevar pievienoties pie %s šajā datorā (pievienošanās atgrieza kļūdu %d, %s)</translation>
</message>
<message>
<location line="-91"/>
<source>Connect through socks proxy</source>
<translation>Savienoties caurs socks proxy</translation>
</message>
<message>
<location line="-10"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation>Atļaut DNS uzmeklēšanu priekš -addnode, -seednode un -connect</translation>
</message>
<message>
<location line="+55"/>
<source>Loading addresses...</source>
<translation>Ielādē adreses...</translation>
</message>
<message>
<location line="-35"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation>Nevar ielādēt wallet.dat: maciņš bojāts</translation>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat: Wallet requires newer version of Hirocoin</source>
<translation>Nevar ielādēt wallet.dat: maciņa atvēršanai nepieciešama jaunāka Hirocoin versija</translation>
</message>
<message>
<location line="+93"/>
<source>Wallet needed to be rewritten: restart Hirocoin to complete</source>
<translation>Bija nepieciešams pārstartēt maciņu: pabeigšanai pārstartējiet Hirocoin</translation>
</message>
<message>
<location line="-95"/>
<source>Error loading wallet.dat</source>
<translation>Kļūda ielādējot wallet.dat</translation>
</message>
<message>
<location line="+28"/>
<source>Invalid -proxy address: '%s'</source>
<translation>Nederīga -proxy adrese: '%s'</translation>
</message>
<message>
<location line="+56"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation>-onlynet komandā norādīts nepazīstams tīkls: '%s'</translation>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation>Pieprasīta nezināma -socks proxy versija: %i</translation>
</message>
<message>
<location line="-96"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation>Nevar uzmeklēt -bind adresi: '%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation>Nevar atrisināt -externalip adresi: '%s'</translation>
</message>
<message>
<location line="+44"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation>Nederīgs daudzums priekš -paytxfree=<amount>: '%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Invalid amount</source>
<translation>Nederīgs daudzums</translation>
</message>
<message>
<location line="-6"/>
<source>Insufficient funds</source>
<translation>Nepietiek bitkoinu</translation>
</message>
<message>
<location line="+10"/>
<source>Loading block index...</source>
<translation>Ielādē bloku indeksu...</translation>
</message>
<message>
<location line="-57"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>Pievienot mezglu, kam pievienoties un turēt savienojumu atvērtu</translation>
</message>
<message>
<location line="-25"/>
<source>Unable to bind to %s on this computer. Hirocoin is probably already running.</source>
<translation>Nevar pievienoties %s uz šī datora. Hirocoin droši vien jau darbojas.</translation>
</message>
<message>
<location line="+64"/>
<source>Fee per KB to add to transactions you send</source>
<translation>Maksa par KB, ko pievienot nosūtāmajām transakcijām</translation>
</message>
<message>
<location line="+19"/>
<source>Loading wallet...</source>
<translation>Ielādē maciņu...</translation>
</message>
<message>
<location line="-52"/>
<source>Cannot downgrade wallet</source>
<translation>Nevar maciņa formātu padarīt vecāku</translation>
</message>
<message>
<location line="+3"/>
<source>Cannot write default address</source>
<translation>Nevar ierakstīt adresi pēc noklusēšanas</translation>
</message>
<message>
<location line="+64"/>
<source>Rescanning...</source>
<translation>Skanēju no jauna...</translation>
</message>
<message>
<location line="-57"/>
<source>Done loading</source>
<translation>Ielāde pabeigta</translation>
</message>
<message>
<location line="+82"/>
<source>To use the %s option</source>
<translation>Izmantot opciju %s</translation>
</message>
<message>
<location line="-74"/>
<source>Error</source>
<translation>Kļūda</translation>
</message>
<message>
<location line="-31"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation>Konfigurācijas failā jāuzstāda rpcpassword=<password>:
%s
Ja fails neeksistē, izveidojiet to ar atļauju lasīšanai tikai īpašniekam.</translation>
</message>
</context>
</TS>
| GoogolplexCoin/GoogolPlexCoin | src/qt/locale/bitcoin_lv_LV.ts | TypeScript | mit | 106,292 | [
30522,
1026,
1029,
20950,
2544,
1027,
1000,
1015,
1012,
1014,
1000,
1029,
1028,
1026,
999,
9986,
13874,
24529,
1028,
1026,
24529,
2653,
1027,
1000,
1048,
2615,
1035,
1048,
2615,
1000,
2544,
1027,
1000,
1016,
1012,
1014,
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... |
#!/usr/bin/perl
use strict;
use lib "$ENV{'LJHOME'}/cgi-bin";
use LJ;
my $dbh = LJ::get_dbh("master");
my $sth;
$sth = $dbh->prepare("SELECT spid FROM support WHERE timelasthelp IS NULL");
$sth->execute;
while (my ($spid) = $sth->fetchrow_array)
{
print "Fixing $spid...\n";
my $st2 = $dbh->prepare("SELECT MAX(timelogged) FROM supportlog WHERE spid=$spid AND type='answer'");
$st2->execute;
my ($max) = $st2->fetchrow_array;
$max = $max + 0; # turn undef -> 0
print " time = $max\n";
$dbh->do("UPDATE support SET timelasthelp=$max WHERE spid=$spid");
}
| apparentlymart/livejournal | bin/upgrading/support-upgrade.pl | Perl | gpl-2.0 | 589 | [
30522,
1001,
999,
1013,
2149,
2099,
1013,
8026,
1013,
2566,
2140,
2224,
9384,
1025,
2224,
5622,
2497,
1000,
1002,
4372,
2615,
1063,
1005,
1048,
3501,
23393,
2063,
1005,
1065,
1013,
1039,
5856,
1011,
8026,
1000,
1025,
2224,
1048,
3501,
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... |
import * as React from 'react';
import * as ReactDom from 'react-dom';
import * as strings from 'BarChartDemoWebPartStrings';
import { Version } from '@microsoft/sp-core-library';
import {
BaseClientSideWebPart,
IPropertyPaneConfiguration,
} from '@microsoft/sp-webpart-base';
import { PropertyPaneWebPartInformation } from '@pnp/spfx-property-controls/lib/PropertyPaneWebPartInformation';
import BarChartDemo from './components/BarChartDemo';
import { IBarChartDemoProps } from './components/IBarChartDemo.types';
export interface IBarChartDemoWebPartProps {
description: string;
}
/**
* This web part retrieves data asynchronously and renders a bar chart once loaded
* It mimics a "real-life" scenario by loading (random) data asynchronously
* and rendering the chart once the data has been retrieved.
* To keep the demo simple, we don't specify custom colors.
*/
export default class BarChartDemoWebPart extends BaseClientSideWebPart<IBarChartDemoWebPartProps> {
public render(): void {
const element: React.ReactElement<IBarChartDemoProps > = React.createElement(
BarChartDemo,
{
// there are no properties to pass for this demo
}
);
ReactDom.render(element, this.domElement);
}
protected onDispose(): void {
ReactDom.unmountComponentAtNode(this.domElement);
}
protected get dataVersion(): Version {
return Version.parse('1.0');
}
protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration {
return {
pages: [
{
groups: [
{
groupFields: [
PropertyPaneWebPartInformation({
description: strings.WebPartDescription,
moreInfoLink: strings.MoreInfoLinkUrl,
key: 'webPartInfoId'
})
]
}
]
}
]
};
}
}
| rgarita/sp-dev-fx-webparts | samples/react-chartcontrol/src/webparts/barChartDemo/BarChartDemoWebPart.ts | TypeScript | mit | 1,881 | [
30522,
12324,
1008,
2004,
10509,
2013,
1005,
10509,
1005,
1025,
12324,
1008,
2004,
10509,
9527,
2013,
1005,
10509,
1011,
14383,
1005,
1025,
12324,
1008,
2004,
7817,
2013,
1005,
3347,
7507,
5339,
3207,
5302,
8545,
2497,
26950,
18886,
3070,
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... |
#include <lib/lib.h>
int main(int argc, char* argv[]) {
return MACRO_IN_LIB;
}
| marcinkwiatkowski/buck | test/com/facebook/buck/cxx/testdata/reexport_header_deps/bin.c | C | apache-2.0 | 82 | [
30522,
1001,
2421,
1026,
5622,
2497,
1013,
5622,
2497,
1012,
1044,
1028,
20014,
2364,
1006,
20014,
12098,
18195,
1010,
25869,
1008,
12098,
2290,
2615,
1031,
1033,
1007,
1063,
2709,
26632,
1035,
1999,
1035,
5622,
2497,
1025,
1065,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="Text/html; charset=iso-8859-1">
<meta name="Author" content = "misho" >
<meta name="GENERATOR" content="VBDOX [1.0.24]" >
<script SRC="linkcss.js"></script>
<script SRC="langref.js"></script>
<title>dx_GFX_class: DRAW_AdvMap</title>
</head>
<BODY TOPMARGIN="0">
<TABLE CLASS="buttonbarshade" CELLSPACING=0><TR><TD> </TD></TR></TABLE>
<TABLE CLASS="buttonbartable" CELLSPACING=0>
<TR ID="hdr"><TD CLASS="runninghead" NOWRAP>dx_GFX_class: DRAW_AdvMap</TD></TR>
</TABLE>
<!-- ============ METHOD ENTRY ============ -->
<H1>DRAW_AdvMap</H1>
<P>Función avanzada de <a href="dx_GFX_class.DRAW_MapEx.html">DRAW_MapEx</a>. Dibuja un
<a href="REF_Maps.html">grafico</a> con efectos
aplicándole perspectiva.
<PRE class=syntax><B><font color="darkblue"> Public</font><font color="darkblue"> Sub</font><b><i> DRAW_AdvMap</i></b>(
<b><i> Map</i></b><font color="darkblue"> As</font><font color="darkblue"> Long</font>,
<b><i> X</i></b><font color="darkblue"> As</font><font color="darkblue"> Long</font>,
<b><i> Y</i></b><font color="darkblue"> As</font><font color="darkblue"> Long</font>,
<b><i> Z</i></b><font color="darkblue"> As</font><font color="darkblue"> Long</font>,
<b><i> Width</i></b><font color="darkblue"> As</font><font color="darkblue"> Long</font>,
<i> Height</i><font color="darkblue"> As Long</font>,
<b><i> AlphaBlendMode</i></b><font color="darkblue"> As</font><b><i> Blit_Alpha</i></b>,
<b><i> Color</i></b><font color="darkblue"> As</font><font color="darkblue"> Long</font>,
<b><i> Mirror</i></b><font color="darkblue"> As</font><b><i> Blit_Mirror</i></b>,
<b><i> Filter</i></b><font color="darkblue"> As</font><b><i> Blit_Filter</i></b>,
<b><i> Perspective</i></b><font color="darkblue"> As</font><b><i> Blit_Perspective</i></b>,
<font color="darkblue"> Optional</font><b><i> Factor</i></b><font color="darkblue"> As</font><font color="darkblue"> Long</font> )</B></PRE>
<H4>Argumentos</H4>
<DL>
<DT><I>Map</I></TD>
<DD>
<B>Long</B>.
Identificador del grafico.
</DD>
<DT><I>X</I></TD>
<DD>
<B>Long</B>.
Coordenada horizontal de dibujo.
</DD>
<DT><I>Y</I></TD>
<DD>
<B>Long</B>.
Coordenada vertical de dibujo.
</DD>
<DT><I>Z</I></TD>
<DD>
<B>Long</B>.
Coordenada de profundidad de dibujo.
Para saber como funciona este parámetro leer información acerca del
<a href="REF_ZBuffer.html">ZBuffer</a>.</DD>
<DT><I>Width</I></TD>
<DD>
<B>Long</B>.
Anchura con la que se dibujara el grafico. Si el valor es 0 se toma las dimensiones originales del grafico, si el valor es -1 se toma la dimensiones del grafico en memoria.
</DD>
<DT><I>Height</I></TD>
<DD>
<B>Long</B>.
Altura con la que se dibujara el grafico. Si el valor es 0 se toma las dimensiones originales del grafico, si el valor es -1 se toma la dimensiones del grafico en memoria.
</DD>
<DT><I>AlphaBlendMode</I></TD>
<DD>
<B><A href="dx_GFX_class.Blit_Alpha.html">Blit_Alpha</A></B>.
Modo de opacidad.
</DD>
<DT><I>Color</I></TD>
<DD>
<B>Long</B>.
Color <a href="REF_ARGB.html">ARGB</a> que se aplicara para realizar la
operación de dibujo. Para que el grafico se dibuje con los colores originales el
valor debe ser blanco puro <i>(&HFFFFFFFF o ARGB 255, 255, 255, 255). </i>El componente Alpha del color no se aplicara en los modos de opacidad
<a href="dx_GFX_class.Blit_Alpha.html">BlendOp_Aditive</a> y
<a href="dx_GFX_class.Blit_Alpha.html">BlendOp_Sustrative</a>.
</DD>
<DT><I>Mirror</I></TD>
<DD>
<B><A href="dx_GFX_class.Blit_Mirror.html">Blit_Mirror</A></B>.
Modo de espejado.
</DD>
<DT><I>Filter</I></TD>
<DD>
<B><A href="dx_GFX_class.Blit_Filter.html">Blit_Filter</A></B>.
Filtro de suavizado que se utilizara para dibujar el grafico.
</DD>
<DT><I>Perspective</I></TD>
<DD>
<B><A href="dx_GFX_class.Blit_Perspective.html">Blit_Perspective</A></B>.
Especifica el modo de perspectiva que tendrá el grafico en pantalla.</DD>
<DT><I>Factor</I></TD>
<DD>
Optional.
<B>Long</B>.
Parámetro opcional que permite introducir un valor para alterar la perspectiva final.
Este parametro no afecta a la constante
<a href="dx_GFX_class.Blit_Perspective.html">Isometric_Base</a></DD>
</DL>
<H4>Comentarios</H4>
<P>Esta función añade extras a la versión de
<a href="dx_GFX_class.DRAW_Map.html">DRAW_Map</a> permitiendo operaciones de espejados, opacidad (Alpha Blending), filtrado para suavizar los
píxeles del grafico en pantalla y posibilidad de proyectar un grafico en perspectiva tanto caballera como isométrica.
</P>
<H4>Vea también</H4>
<P>
<A HREF="dx_lib32.html">Proyecto dx_lib32 Descripción</A>
<A HREF="dx_GFX_class.html">Clase dx_GFX_class Descripción</A>
<A HREF="dx_GFX_class.html#public_props">dx_GFX_class Propiedades</A>
<A HREF="dx_GFX_class.html#public_methods">dx_GFX_class Metodos</A>
<B><A HREF="dx_GFX_class.DRAW_AdvBox.html">DRAW_AdvBox</A></B>
<B><A HREF="dx_GFX_class.DRAW_Box.html">DRAW_Box</A></B>
<DIV class=footer>dx_lib32 © 2004 - 2009 José Miguel Sánchez Fernández <P>Generado el viernes 02 de enero del 2009 con VBDOX 1.0.34 (<A href="http://vbdox.sourceforge.net/">http://vbdox.sourceforge.net</A>)<BR>Copyright © 2000 - 2001 M.Stamenov</DIV>
<DIV class=footer style="COLOR: #000000; FONT-SIZE: 90%">
</body>
</html>
| VisualStudioEX3/dx_lib32 | Documentacion/dx_GFX_class.DRAW_AdvMap.html | HTML | lgpl-2.1 | 5,765 | [
30522,
1026,
999,
9986,
13874,
16129,
2270,
1000,
1011,
1013,
1013,
1059,
2509,
2278,
1013,
1013,
26718,
2094,
16129,
1018,
1012,
1014,
17459,
1013,
1013,
4372,
1000,
1028,
1026,
16129,
1028,
1026,
2132,
1028,
1026,
18804,
8299,
1011,
1041,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 2010 Pablo Arrighi, Alex Concha, Miguel Lezama for version 1.
* Copyright 2013 Pablo Arrighi, Miguel Lezama, Kevin Mazet for version 2.
*
* This file is part of GOOL.
*
* GOOL 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, version 3.
*
* GOOL 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 version 3 for more details.
*
* You should have received a copy of the GNU General Public License along with GOOL,
* in the file COPYING.txt. If not, see <http://www.gnu.org/licenses/>.
*/
package gool.ast.core;
import gool.ast.type.TypeNone;
import gool.generator.GoolGeneratorController;
import gool.generator.common.CodeGenerator;
/**
* This class captures an enhanced for loop in the intermediate language.
* Hence it inherits of Expression.
* For example, this class captures
* {@code
* for( String s : array){
* ...
* }
*/
public class EnhancedForLoop extends Expression {
/**
* The variable declaration in the enhanced for loop.
*/
private VarDeclaration varDec;
/**
* The expression used in the enhanced for loop.
*/
private Expression expr;
/**
* The statement used in the enhanced for loop.
*/
private Statement statements;
/**
* The simple constructor of an enhanced for loop representation.
*/
private EnhancedForLoop() {
super(TypeNone.INSTANCE);
}
/**
* The constructor of an enhanced for loop representation.
* @param varDec
* : The variable declaration in the enhanced for loop.
* @param expr
* : The expression used in the enhanced for loop.
* @param statements
* : The statement used in the enhanced for loop.
*/
public EnhancedForLoop(VarDeclaration varDec, Expression expr,
Statement statements) {
this();
this.varDec = varDec;
this.expr = expr;
this.statements = statements;
}
/**
* Gets the variable declaration in the enhanced for loop.
* @return
* The variable declaration in the enhanced for loop.
*/
public VarDeclaration getVarDec() {
return varDec;
}
/**
* Gets the expression used in the enhanced for loop.
* @return
* The expression used in the enhanced for loop.
*/
public Expression getExpression() {
return expr;
}
/**
* Gets the statement used in the enhanced for loop.
* @return
* The statement used in the enhanced for loop.
*/
public Statement getStatements() {
return statements;
}
@Override
public String callGetCode() {
CodeGenerator cg;
try{
cg = GoolGeneratorController.generator();
}catch (IllegalStateException e){
return this.getClass().getSimpleName();
}
return cg.getCode(this);
}
}
| darrivau/GOOL | src/main/java/gool/ast/core/EnhancedForLoop.java | Java | gpl-3.0 | 2,878 | [
30522,
1013,
1008,
1008,
9385,
2230,
11623,
12098,
3089,
28891,
1010,
4074,
9530,
7507,
1010,
8374,
3393,
20722,
2050,
2005,
2544,
1015,
1012,
1008,
9385,
2286,
11623,
12098,
3089,
28891,
1010,
8374,
3393,
20722,
2050,
1010,
4901,
15079,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
// Created file "Lib\src\Uuid\X64\i_dxtmsft"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(CLSID_CrWheel, 0x5ae1dae0, 0x1461, 0x11d2, 0xa4, 0x84, 0x00, 0xc0, 0x4f, 0x8e, 0xfb, 0x69);
| Frankie-PellesC/fSDK | Lib/src/Uuid/X64/i_dxtmsft0000004D.c | C | lgpl-3.0 | 451 | [
30522,
1013,
1013,
2580,
5371,
1000,
5622,
2497,
1032,
5034,
2278,
1032,
1057,
21272,
1032,
1060,
21084,
1032,
1045,
1035,
1040,
18413,
5244,
6199,
1000,
21189,
12879,
2358,
6820,
6593,
1035,
26458,
2094,
1063,
27121,
2146,
2951,
2487,
1025... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class fAwards
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
Me.ListBox3 = New System.Windows.Forms.ListBox()
Me.lst_Awards = New System.Windows.Forms.ListBox()
Me.SlcTheme1 = New dsTycoon.SLCTheme()
Me.GroupBox1 = New System.Windows.Forms.GroupBox()
Me.Label1 = New System.Windows.Forms.Label()
Me.Button2 = New dsTycoon.SLCbtn()
Me.SlcTheme1.SuspendLayout()
Me.GroupBox1.SuspendLayout()
Me.SuspendLayout()
'
'Timer1
'
'
'ListBox3
'
Me.ListBox3.FormattingEnabled = True
Me.ListBox3.Location = New System.Drawing.Point(565, 430)
Me.ListBox3.Name = "ListBox3"
Me.ListBox3.Size = New System.Drawing.Size(97, 56)
Me.ListBox3.TabIndex = 12
Me.ListBox3.Visible = False
'
'lst_Awards
'
Me.lst_Awards.FormattingEnabled = True
Me.lst_Awards.Location = New System.Drawing.Point(12, 430)
Me.lst_Awards.Name = "lst_Awards"
Me.lst_Awards.Size = New System.Drawing.Size(59, 30)
Me.lst_Awards.TabIndex = 109
Me.lst_Awards.Visible = False
'
'SlcTheme1
'
Me.SlcTheme1.BackColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(57, Byte), Integer), CType(CType(72, Byte), Integer))
Me.SlcTheme1.BorderStyle = System.Windows.Forms.FormBorderStyle.None
Me.SlcTheme1.Controls.Add(Me.GroupBox1)
Me.SlcTheme1.Controls.Add(Me.Button2)
Me.SlcTheme1.Controls.Add(Me.ListBox3)
Me.SlcTheme1.Customization = "JRIV/zYjIP82IyD/JRIV/w=="
Me.SlcTheme1.Dock = System.Windows.Forms.DockStyle.Fill
Me.SlcTheme1.Font = New System.Drawing.Font("Verdana", 8.0!)
Me.SlcTheme1.Image = Nothing
Me.SlcTheme1.Location = New System.Drawing.Point(0, 0)
Me.SlcTheme1.Movable = True
Me.SlcTheme1.Name = "SlcTheme1"
Me.SlcTheme1.NoRounding = False
Me.SlcTheme1.Sizable = True
Me.SlcTheme1.Size = New System.Drawing.Size(681, 472)
Me.SlcTheme1.SmartBounds = True
Me.SlcTheme1.StartPosition = System.Windows.Forms.FormStartPosition.WindowsDefaultLocation
Me.SlcTheme1.TabIndex = 110
Me.SlcTheme1.TransparencyKey = System.Drawing.Color.Fuchsia
Me.SlcTheme1.Transparent = False
'
'GroupBox1
'
Me.GroupBox1.BackColor = System.Drawing.Color.WhiteSmoke
Me.GroupBox1.BackgroundImage = Global.dsTycoon.My.Resources.Resources.gameawards1
Me.GroupBox1.Controls.Add(Me.Label1)
Me.GroupBox1.Location = New System.Drawing.Point(32, 24)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(630, 400)
Me.GroupBox1.TabIndex = 13
Me.GroupBox1.TabStop = False
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(6, 379)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(402, 357)
Me.Label1.TabIndex = 0
Me.Label1.Text = "Label1"
'
'Button2
'
Me.Button2.Colors = New dsTycoon.Bloom(-1) {}
Me.Button2.Customization = ""
Me.Button2.Font = New System.Drawing.Font("Verdana", 8.0!)
Me.Button2.Image = Nothing
Me.Button2.Location = New System.Drawing.Point(313, 430)
Me.Button2.Name = "Button2"
Me.Button2.NoRounding = False
Me.Button2.Size = New System.Drawing.Size(78, 22)
Me.Button2.TabIndex = 10
Me.Button2.Text = " Accept"
Me.Button2.Transparent = False
'
'fAwards
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.BackColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(57, Byte), Integer), CType(CType(72, Byte), Integer))
Me.ClientSize = New System.Drawing.Size(681, 472)
Me.Controls.Add(Me.lst_Awards)
Me.Controls.Add(Me.SlcTheme1)
Me.DoubleBuffered = True
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
Me.MaximizeBox = False
Me.Name = "fAwards"
Me.Text = "Dev Studio Tycoon Awards"
Me.TransparencyKey = System.Drawing.Color.Fuchsia
Me.SlcTheme1.ResumeLayout(False)
Me.GroupBox1.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
Friend WithEvents Timer1 As System.Windows.Forms.Timer
Friend WithEvents ListBox3 As System.Windows.Forms.ListBox
Friend WithEvents lst_Awards As System.Windows.Forms.ListBox
Friend WithEvents SlcTheme1 As dsTycoon.SLCTheme
Friend WithEvents Button2 As dsTycoon.SLCbtn
Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents Label1 As System.Windows.Forms.Label
End Class
| rkrehn/devstudiotycoon | fAwards.Designer.vb | Visual Basic | gpl-3.0 | 6,024 | [
30522,
1026,
3795,
1012,
7513,
1012,
5107,
22083,
2594,
1012,
21624,
8043,
7903,
2229,
1012,
5859,
6914,
16848,
1006,
1007,
1028,
1035,
7704,
2465,
6904,
7652,
2015,
22490,
2015,
2291,
1012,
3645,
1012,
3596,
1012,
2433,
1005,
2433,
2058,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>libwallaby: General</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">libwallaby
 <span id="projectnumber">v24</span>
</div>
<div id="projectbrief">The wallaby standard library</div>
</td>
<td> <div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__general.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">General</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga038517d3df8f236dde8eefbbcadee37e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="vtable_8h.html#a8956b9119e3f283cb31cf6e029da3277">VF</a> <a class="el" href="export_8h.html#ad78259114e2822d9b93f376572655819">EXPORT_SYM</a> void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__general.html#ga038517d3df8f236dde8eefbbcadee37e">set_auto_publish</a> (int on)</td></tr>
<tr class="memdesc:ga038517d3df8f236dde8eefbbcadee37e"><td class="mdescLeft"> </td><td class="mdescRight">Sets whether or not hardware output command publishing happens automatically. <a href="#ga038517d3df8f236dde8eefbbcadee37e">More...</a><br /></td></tr>
<tr class="separator:ga038517d3df8f236dde8eefbbcadee37e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga2955f8e823ea99f92d32a86f21a5dab2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="vtable_8h.html#a8956b9119e3f283cb31cf6e029da3277">VF</a> <a class="el" href="export_8h.html#ad78259114e2822d9b93f376572655819">EXPORT_SYM</a> void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__general.html#ga2955f8e823ea99f92d32a86f21a5dab2">publish</a> ()</td></tr>
<tr class="memdesc:ga2955f8e823ea99f92d32a86f21a5dab2"><td class="mdescLeft"> </td><td class="mdescRight">Explictly publishes new data to the system. <a href="#ga2955f8e823ea99f92d32a86f21a5dab2">More...</a><br /></td></tr>
<tr class="separator:ga2955f8e823ea99f92d32a86f21a5dab2"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga2955f8e823ea99f92d32a86f21a5dab2"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="vtable_8h.html#a8956b9119e3f283cb31cf6e029da3277">VF</a> <a class="el" href="export_8h.html#ad78259114e2822d9b93f376572655819">EXPORT_SYM</a> void publish </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Explictly publishes new data to the system. </p>
<p>All hardware output commands are stored locally before being written to the system. This allows for batch execution of commands with automatic publishing turned off.</p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000016">Deprecated:</a></b></dt><dd>This has no effect when using the Wallaby </dd></dl>
</div>
</div>
<a class="anchor" id="ga038517d3df8f236dde8eefbbcadee37e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="vtable_8h.html#a8956b9119e3f283cb31cf6e029da3277">VF</a> <a class="el" href="export_8h.html#ad78259114e2822d9b93f376572655819">EXPORT_SYM</a> void set_auto_publish </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>on</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets whether or not hardware output command publishing happens automatically. </p>
<p><a class="el" href="group__general.html#ga2955f8e823ea99f92d32a86f21a5dab2" title="Explictly publishes new data to the system. ">publish()</a> is, by default, called on your behalf by libkovan. When you turn automatic publishing off, libkovan expects you to <a class="el" href="group__general.html#ga2955f8e823ea99f92d32a86f21a5dab2" title="Explictly publishes new data to the system. ">publish()</a> changes manually. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">on</td><td>1 for automatic publishing, 0 for manual publishing </td></tr>
</table>
</dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>Any command involving hardware modification, such as motors or servos, requires <a class="el" href="group__general.html#ga2955f8e823ea99f92d32a86f21a5dab2" title="Explictly publishes new data to the system. ">publish()</a> to be called before changes will be written to the system.</dd></dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000015">Deprecated:</a></b></dt><dd>This has no effect when using the Wallaby </dd></dl>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated on Tue Feb 21 2017 12:20:31 for libwallaby by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
</ul>
</div>
</body>
</html>
| kipr/harrogate | shared/client/doc/group__general.html | HTML | gpl-3.0 | 8,783 | [
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 org.zstack.test.storage.backup;
import junit.framework.Assert;
import org.junit.Before;
import org.junit.Test;
import org.zstack.core.Platform;
import org.zstack.core.cloudbus.CloudBus;
import org.zstack.core.componentloader.ComponentLoader;
import org.zstack.core.db.DatabaseFacade;
import org.zstack.header.message.MessageReply;
import org.zstack.header.storage.backup.*;
import org.zstack.test.Api;
import org.zstack.test.ApiSenderException;
import org.zstack.test.DBUtil;
import org.zstack.test.WebBeanConstructor;
import org.zstack.test.deployer.Deployer;
import org.zstack.utils.Utils;
import org.zstack.utils.data.SizeUnit;
import org.zstack.utils.logging.CLogger;
import java.util.concurrent.TimeUnit;
/*
* 1. add backup storage with 1G available capacity
* 2. allocate 500M with faked uuid
*
* confirm:
* failed
*/
public class TestAllocateBackupStorage3 {
CLogger logger = Utils.getLogger(TestAllocateBackupStorage3.class);
Deployer deployer;
Api api;
ComponentLoader loader;
CloudBus bus;
DatabaseFacade dbf;
@Before
public void setUp() throws Exception {
DBUtil.reDeployDB();
WebBeanConstructor con = new WebBeanConstructor();
deployer = new Deployer("deployerXml/backupStorage/TestAllocateBackupStorage.xml", con);
deployer.build();
api = deployer.getApi();
loader = deployer.getComponentLoader();
bus = loader.getComponent(CloudBus.class);
dbf = loader.getComponent(DatabaseFacade.class);
}
@Test
public void test() throws ApiSenderException, InterruptedException {
BackupStorageInventory bsinv = deployer.backupStorages.get("backup1");
long size = SizeUnit.MEGABYTE.toByte(500);
AllocateBackupStorageMsg msg = new AllocateBackupStorageMsg();
msg.setBackupStorageUuid(Platform.getUuid());
msg.setSize(size);
bus.makeTargetServiceIdByResourceUuid(msg, BackupStorageConstant.SERVICE_ID, bsinv.getUuid());
msg.setTimeout(TimeUnit.SECONDS.toMillis(15));
MessageReply reply = bus.call(msg);
Assert.assertFalse(reply.isSuccess());
Assert.assertEquals(BackupStorageErrors.ALLOCATE_ERROR.toString(), reply.getError().getCode());
BackupStorageVO vo = dbf.findByUuid(bsinv.getUuid(), BackupStorageVO.class);
Assert.assertEquals(bsinv.getAvailableCapacity(), vo.getAvailableCapacity());
}
}
| zstackorg/zstack | test/src/test/java/org/zstack/test/storage/backup/TestAllocateBackupStorage3.java | Java | apache-2.0 | 2,423 | [
30522,
7427,
8917,
1012,
1062,
9153,
3600,
1012,
3231,
1012,
5527,
1012,
10200,
1025,
12324,
12022,
4183,
1012,
7705,
1012,
20865,
1025,
12324,
8917,
1012,
12022,
4183,
1012,
2077,
1025,
12324,
8917,
1012,
12022,
4183,
1012,
3231,
1025,
123... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Minim : : AudioInput : : enableMonitoring</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="stylesheet.css" rel="stylesheet" type="text/css">
</head>
<body>
<center>
<table class="mainTable">
<tr>
<td class="header">
<span class="indexheader">Minim</span><br/>
<span class="indexnavigation">
<a href="index.html">core</a> |
<a href="index_ugens.html">ugens</a> |
<a href="index_analysis.html">analysis</a>
</span>
</td>
<td class="border-left"> </td>
</tr>
<tr>
<td class="classNavigation">
<p class="mainTextName"><A href="audioinput_class_audioinput.html">AudioInput</A></p>
<p class="methodName">enableMonitoring</p>
</td>
<td class="mainText border-left">
<p class="memberSectionHeader">Description</p>
When monitoring is enabled, you will be able to hear
the audio that is coming through the input.
<p class="memberSectionHeader">Signature</p>
<pre>void enableMonitoring()
</pre>
<p class="memberSectionHeader">Returns</p>
<p>None</p>
<p class="memberSectionHeader">Related</p>
<A href="audioinput_method_disablemonitoring.html">disableMonitoring ( )</A><BR>
<A href="audioinput_method_ismonitoring.html">isMonitoring ( )</A><BR>
<A href="audioinput_class_audioinput.html">AudioInput</A><BR>
<p class="memberSectionHeader">Example</p>
<pre>/**
* This sketch demonstrates how to monitor the currently active audio input
* of the computer using an AudioInput. What you will actually
* be monitoring depends on the current settings of the machine the sketch is running on.
* Typically, you will be monitoring the built-in microphone, but if running on a desktop
* it's feasible that the user may have the actual audio output of the computer
* as the active audio input, or something else entirely.
* <p>
* Press 'm' to toggle monitoring on and off.
* <p>
* When you run your sketch as an applet you will need to sign it in order to get an input.
* <p>
* For more information about Minim and additional features,
* visit http://code.compartmental.net/minim/
*/
import ddf.minim.*;
Minim minim;
AudioInput in;
void setup()
{
size(512, 200, P3D);
minim = new Minim(this);
// use the getLineIn method of the Minim object to get an AudioInput
in = minim.getLineIn();
}
void draw()
{
background(0);
stroke(255);
// draw the waveforms so we can see what we are monitoring
for(int i = 0; i < in.bufferSize() - 1; i++)
{
line( i, 50 + in.left.get(i)*50, i+1, 50 + in.left.get(i+1)*50 );
line( i, 150 + in.right.get(i)*50, i+1, 150 + in.right.get(i+1)*50 );
}
String monitoringState = in.isMonitoring() ? "enabled" : "disabled";
text( "Input monitoring is currently " + monitoringState + ".", 5, 15 );
}
void keyPressed()
{
if ( key == 'm' || key == 'M' )
{
if ( in.isMonitoring() )
{
in.disableMonitoring();
}
else
{
in.enableMonitoring();
}
}
}
</pre>
<p class="memberSectionHeader">Usage</p>
Web & Application
</td>
</tr>
</table>
</center>
</body>
</html>
| UTSDataArena/examples | processing/sketchbook/libraries/minim/documentation/audioinput_method_enablemonitoring.html | HTML | bsd-2-clause | 3,468 | [
30522,
1026,
999,
9986,
13874,
16129,
2270,
1000,
1011,
1013,
1013,
1059,
2509,
2278,
1013,
1013,
26718,
2094,
16129,
1018,
1012,
5890,
17459,
1013,
1013,
4372,
1000,
1000,
8299,
1024,
1013,
1013,
7479,
1012,
1059,
2509,
1012,
8917,
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) 2014 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas 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, version 3 of the License.
#
# Canvas 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/>.
require 'sanitize'
module CanvasSanitize
require "canvas_sanitize/canvas_sanitize"
end
| venturehive/canvas-lms | gems/canvas_sanitize/lib/canvas_sanitize.rb | Ruby | agpl-3.0 | 769 | [
30522,
1001,
1001,
9385,
1006,
1039,
1007,
2297,
1011,
2556,
16021,
18300,
5397,
1010,
4297,
1012,
1001,
1001,
2023,
5371,
2003,
2112,
1997,
10683,
1012,
1001,
1001,
10683,
2003,
2489,
4007,
1024,
2017,
2064,
2417,
2923,
3089,
8569,
2618,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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';
module.exports = {
Model: require('./model')
};
| thinkeloquent/npm-build-script | src/entity/index.js | JavaScript | mit | 65 | [
30522,
1005,
2224,
9384,
1005,
1025,
11336,
1012,
14338,
1027,
1063,
2944,
1024,
5478,
1006,
1005,
1012,
1013,
2944,
1005,
1007,
1065,
1025,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 os
import shutil
import tempfile
import vmprof
import prof_six as six
from _prof_imports import TreeStats, CallTreeStat
class VmProfProfile(object):
""" Wrapper class that represents VmProf Python profiling backend with API matching
the cProfile.
"""
def __init__(self):
self.stats = None
self.basepath = None
self.file = None
self.is_enabled = False
def runcall(self, func, *args, **kw):
self.enable()
try:
return func(*args, **kw)
finally:
self.disable()
def enable(self):
if not self.is_enabled:
if not os.path.exists(self.basepath):
os.makedirs(self.basepath)
self.file = tempfile.NamedTemporaryFile(delete=False, dir=self.basepath)
try:
vmprof.enable(self.file.fileno(), lines=True)
except:
vmprof.enable(self.file.fileno())
self.is_enabled = True
def disable(self):
if self.is_enabled:
vmprof.disable()
self.file.close()
self.is_enabled = False
def create_stats(self):
return None
def getstats(self):
self.create_stats()
return self.stats
def dump_stats(self, file):
shutil.copyfile(self.file.name, file)
def _walk_tree(self, parent, node, callback):
tree = callback(parent, node)
for c in six.itervalues(node.children):
self._walk_tree(node, c, callback)
return tree
def tree_stats_to_response(self, filename, response):
tree_stats_to_response(filename, response)
def snapshot_extension(self):
return '.prof'
def _walk_tree(parent, node, callback):
if node is None:
return None
tree = callback(parent, node)
for c in six.itervalues(node.children):
_walk_tree(tree, c, callback)
return tree
def tree_stats_to_response(filename, response):
stats = vmprof.read_profile(filename)
response.tree_stats = TreeStats()
response.tree_stats.sampling_interval = vmprof.DEFAULT_PERIOD
try:
tree = stats.get_tree()
except vmprof.stats.EmptyProfileFile:
tree = None
def convert(parent, node):
tstats = CallTreeStat()
tstats.name = node.name
tstats.count = node.count
tstats.children = []
tstats.line_count = getattr(node, 'lines', {})
if parent is not None:
if parent.children is None:
parent.children = []
parent.children.append(tstats)
return tstats
response.tree_stats.call_tree = _walk_tree(None, tree, convert)
| siosio/intellij-community | python/helpers/profiler/vmprof_profiler.py | Python | apache-2.0 | 2,691 | [
30522,
12324,
9808,
12324,
3844,
4014,
12324,
8915,
8737,
8873,
2571,
12324,
1058,
8737,
3217,
2546,
12324,
11268,
1035,
2416,
2004,
2416,
2013,
1035,
11268,
1035,
17589,
12324,
3628,
29336,
2015,
1010,
2655,
13334,
9153,
2102,
2465,
1058,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 React from "react";
import { readPin } from "../../devices/actions";
import { SensorListProps } from "./interfaces";
import { sortResourcesById } from "../../util";
import { Row, Col } from "../../ui";
import { isNumber } from "lodash";
import { ALLOWED_PIN_MODES } from "farmbot";
import { t } from "../../i18next_wrapper";
interface SensorReadingDisplayProps {
label: string;
value: number | undefined;
mode: number;
}
interface CalcStyleProps {
value: number;
mode: number;
}
const calcIndicatorStyle = ({ value, mode }: CalcStyleProps) => ({
left: `calc(${
(mode
? value / 1024 * 0.95 // analog
: value / 2) // digital
* 100}%)`,
width: `${mode ? 5 : 50}%`
});
const calcValueStyle = ({ value, mode }: CalcStyleProps) => ({
marginLeft: `${mode
? `${value > 500 ? -3.5 : 1.5}rem` // analog
: "7rem"}`, // digital
color: `${mode ? "" : "white"}`
});
const SensorReadingDisplay =
({ label, value, mode }: SensorReadingDisplayProps) => {
const moistureSensor = label.toLowerCase().includes("moisture") ?
"moisture-sensor" : "";
return <div className={`sensor-reading-display ${moistureSensor}`}>
{isNumber(value) && value >= 0 &&
<div className="indicator" style={calcIndicatorStyle({ value, mode })}>
<span style={calcValueStyle({ value, mode })}>
{value}
</span>
</div>}
</div>;
};
export const SensorList = (props: SensorListProps) =>
<div className="sensor-list">
{sortResourcesById(props.sensors).map(sensor => {
const { label, mode, pin } = sensor.body;
const pinNumber = (isNumber(pin) && isFinite(pin)) ? pin : -1;
const value = (props.pins[pinNumber] || { value: undefined }).value;
return <Row key={sensor.uuid}>
<Col xs={3}>
<label>{label}</label>
</Col>
<Col xs={1}>
<p>{pinNumber}</p>
</Col>
<Col xs={6}>
<SensorReadingDisplay label={label} value={value} mode={mode} />
</Col>
<Col xs={2}>
<ReadSensorButton
disabled={!!props.disabled}
sensorLabel={label}
pinNumber={pinNumber}
mode={mode} />
</Col>
</Row>;
})}
</div>;
interface ReadSensorButtonProps {
disabled: boolean;
sensorLabel: string;
pinNumber: number;
mode: number;
}
const ReadSensorButton = (props: ReadSensorButtonProps) => {
const { disabled, sensorLabel, pinNumber, mode } = props;
return <button
className={"fb-button gray"}
disabled={disabled}
title={t(`read ${sensorLabel} sensor`)}
onClick={() =>
readPin(pinNumber, `pin${pinNumber}`, mode as ALLOWED_PIN_MODES)}>
{t("read sensor")}
</button>;
};
| RickCarlino/farmbot-web-app | frontend/controls/sensors/sensor_list.tsx | TypeScript | mit | 2,756 | [
30522,
12324,
1008,
2004,
10509,
2013,
1000,
10509,
1000,
1025,
12324,
1063,
3191,
8091,
1065,
2013,
1000,
1012,
1012,
1013,
1012,
1012,
1013,
5733,
1013,
4506,
1000,
1025,
12324,
1063,
13617,
9863,
21572,
4523,
1065,
2013,
1000,
1012,
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 Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* The Apereo Foundation 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 com.tle.web.sections.jquery.libraries;
import com.tle.common.i18n.CurrentLocale;
import com.tle.core.javascript.JavascriptModule;
import com.tle.web.sections.jquery.JQueryLibraryInclude;
import com.tle.web.sections.render.PreRenderable;
@SuppressWarnings("nls")
public class JQueryDroppable implements JavascriptModule {
private static final long serialVersionUID = 1L;
public static final PreRenderable PRERENDER =
new JQueryLibraryInclude(
"jquery.ui.droppable.js",
JQueryUICore.PRERENDER,
JQueryMouse.PRERENDER,
JQueryUIWidget.PRERENDER,
JQueryDraggable.PRERENDER)
.hasMin();
@Override
public String getDisplayName() {
return CurrentLocale.get("com.tle.web.sections.jquery.modules.droppable.name");
}
@Override
public String getId() {
return "droppable";
}
@Override
public Object getPreRenderer() {
return PRERENDER;
}
}
| equella/Equella | Source/Plugins/Core/com.equella.core/src/com/tle/web/sections/jquery/libraries/JQueryDroppable.java | Java | apache-2.0 | 1,764 | [
30522,
1013,
1008,
1008,
7000,
2000,
1996,
23957,
2890,
2080,
3192,
2104,
2028,
2030,
2062,
12130,
6105,
1008,
10540,
1012,
2156,
1996,
5060,
5371,
5500,
2007,
2023,
2147,
2005,
3176,
1008,
2592,
4953,
9385,
6095,
1012,
1008,
1008,
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... |
FROM ubuntu:trusty
MAINTAINER John Dilts <john.dilts@enstratius.com>
RUN apt-get update && apt-get install -y wget curl git-core supervisor
RUN wget http://s3.amazonaws.com/influxdb/influxdb_0.8.8_amd64.deb
RUN dpkg -i influxdb_0.8.8_amd64.deb
ADD https://raw.githubusercontent.com/jbrien/sensu-docker/compose/support/install-sensu.sh /tmp/
RUN chmod +x /tmp/install-sensu.sh
RUN /tmp/install-sensu.sh
ADD influxdb-run.sh /tmp/influxdb-run.sh
ADD supervisor.conf /etc/supervisor/conf.d/supervisord.conf
EXPOSE 8083
EXPOSE 8086
CMD ["/tmp/influxdb-run.sh"]
| jbrien/sensu-docker | Influxdb/Dockerfile | Dockerfile | mit | 563 | [
30522,
2013,
1057,
8569,
3372,
2226,
1024,
3404,
2100,
5441,
2121,
2198,
29454,
3215,
1026,
2198,
1012,
29454,
3215,
1030,
4372,
20528,
22638,
1012,
4012,
1028,
2448,
26794,
1011,
2131,
10651,
1004,
1004,
26794,
1011,
2131,
16500,
1011,
106... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 org.ayo.robot.canvas.shape;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import org.ayo.robot.BaseView;
public class RectView extends BaseView {
public RectView(Context context) {
super(context);
init();
}
private void init(){
}
int centerX, centerY;
int rw, rh;
boolean isInited = false;
@Override
protected void drawShape(Canvas canvas, int w, int h, Paint paint) {
// Rect rect = new Rect(100, 100, 200, 200);
// RectF rectF = new RectF(100, 100, 200, 200);
if(!isInited){
centerX = w/2;
centerY = h/2;
rw = w - 200;
rh = h - 200;
isInited = true;
}
drawRect(canvas, centerX, centerY, rw, rh, paint);
/*
Rect的四个顶点是int
RectF的四个顶点float
RectF和rx(x-radius),ry(y-radius)构成了圆角Rect
rx The x-radius of the oval used to round the corners
ry The y-radius of the oval used to round the corners
Rect和RectF包含的方法:
inset
union
是否包含点或矩形
*/
}
public static void drawRect(Canvas canvas, int centerX, int centerY, int w, int h, Paint p){
int left = centerX - w/2;
int top = centerY - h/2;
int right = left + w;
int bottom = top + h;
canvas.drawRect(new RectF(left, top, right, bottom), p);
}
public void moveCenter(int dx, int dy){
centerX += dx;
centerY += dy;
invalidate();
}
public void changeSize(int dw, int dh){
rw += dw;
rh += dh;
invalidate();
}
@Override
public String getTitle() {
return "canvas.drawRect(rectF, paint)";
}
@Override
public String getMethod() {
return "画矩形";
}
@Override
public String getComment() {
return "画个矩形\n" +
"Rect处理int\n" +
"RectF处理float\n" +
"二者都有inset,union,contains点或矩形的方法";
}
} | cowthan/UI-Robot | app/src/main/java/org/ayo/robot/canvas/shape/RectView.java | Java | apache-2.0 | 2,195 | [
30522,
7427,
8917,
1012,
1037,
7677,
1012,
8957,
1012,
10683,
1012,
4338,
1025,
12324,
11924,
1012,
4180,
1012,
6123,
1025,
12324,
11924,
1012,
8389,
1012,
10683,
1025,
12324,
11924,
1012,
8389,
1012,
6773,
1025,
12324,
11924,
1012,
8389,
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... |
import numpy as np
import jarvis.helpers.helpers as helpers
from data_cleaner import DataCleaner
def get_data(csv=None, sep='|'):
dataset = create_dataset(csv, sep)
inputs = DataCleaner().clean(dataset[:, 0:1])
outputs = format_targets(dataset[:, 1])
train_data, test_data = inputs[::2], inputs[1::2]
train_targets, test_targets = outputs[::2], outputs[1::2]
return [(train_data, train_targets), (test_data, test_targets)]
def create_dataset(csv, sep):
if csv:
return helpers.read_csv(csv, sep=sep).values
else:
data = []
for f in helpers.csvs():
for row in helpers.read_csv(f, sep=sep).values:
data.append(list(row))
return np.array(data)
def format_targets(target_list):
target_map = {}
index = 0
actions = helpers.get_actions()
# Map targets to their index inside of actions array
for action in actions:
target_map[action] = index
index += 1
return map(lambda target: target_map[target], target_list)
| whittlbc/jarvis | jarvis/learn/classify/data_prepper.py | Python | mit | 960 | [
30522,
12324,
16371,
8737,
2100,
2004,
27937,
12324,
21072,
1012,
2393,
2545,
1012,
2393,
2545,
2004,
2393,
2545,
2013,
2951,
1035,
20133,
12324,
2951,
14321,
7231,
2099,
13366,
2131,
1035,
2951,
1006,
20116,
2615,
1027,
3904,
1010,
19802,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
cask 'parsec' do
version :latest
sha256 :no_check
# s3.dualstack.us-east-1.amazonaws.com/parsec-build was verified as official when first introduced to the cask
url 'https://s3.dualstack.us-east-1.amazonaws.com/parsec-build/package/parsec-macos.pkg'
name 'Parsec'
homepage 'https://parsecgaming.com/'
pkg 'parsec-macos.pkg'
postflight do
set_ownership '~/.parsec'
end
uninstall pkgutil: 'tv.parsec.www'
end
| troyxmccall/homebrew-cask | Casks/parsec.rb | Ruby | bsd-2-clause | 435 | [
30522,
25222,
2243,
1005,
11968,
3366,
2278,
1005,
2079,
2544,
1024,
6745,
21146,
17788,
2575,
1024,
2053,
1035,
4638,
1001,
1055,
2509,
1012,
7037,
9153,
3600,
1012,
2149,
1011,
2264,
1011,
1015,
1012,
9733,
10376,
2015,
1012,
4012,
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... |
/*!
* Start Bootstrap - Agency Bootstrap Theme (http://startbootstrap.com)
* Code licensed under the Apache License v2.0.
* For details, see http://www.apache.org/licenses/LICENSE-2.0.
*/
body {
overflow-x: hidden;
font-family: "Roboto Slab", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.text-muted {
color: #777;
}
.text-primary {
color: #fed136;
}
p {
font-size: 14px;
line-height: 1.75;
font-family: "Merriweather", serif;
}
p.large {
font-size: 16px;
}
a,
a:hover,
a:focus,
a:active,
a.active {
outline: 0;
}
a {
color: #fed136;
}
a:hover,
a:focus,
a:active,
a.active {
color: #fed136;
}
h1,
h2,
h3,
h4,
h5,
h6 {
text-transform: uppercase;
font-family: Montserrat, "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 700;
}
.img-centered {
margin: 0 auto;
}
.bg-light-gray {
background-color: #f7f7f7;
}
.bg-darkest-gray {
background-color: #222;
}
.btn-primary {
border-color: #fed136;
text-transform: uppercase;
font-family: Montserrat, "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 700;
color: #fff;
background-color: #fed136;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.open .dropdown-toggle.btn-primary {
border-color: #f6bf01;
color: #fff;
background-color: #fec503;
}
.btn-primary:active,
.btn-primary.active,
.open .dropdown-toggle.btn-primary {
background-image: none;
}
.btn-primary.disabled,
.btn-primary[disabled],
fieldset[disabled] .btn-primary,
.btn-primary.disabled:hover,
.btn-primary[disabled]:hover,
fieldset[disabled] .btn-primary:hover,
.btn-primary.disabled:focus,
.btn-primary[disabled]:focus,
fieldset[disabled] .btn-primary:focus,
.btn-primary.disabled:active,
.btn-primary[disabled]:active,
fieldset[disabled] .btn-primary:active,
.btn-primary.disabled.active,
.btn-primary[disabled].active,
fieldset[disabled] .btn-primary.active {
border-color: #fed136;
background-color: #fed136;
}
.btn-primary .badge {
color: #fed136;
background-color: #fff;
}
.btn-xl {
padding: 20px 40px;
border-color: #fed136;
border-radius: 3px;
text-transform: uppercase;
font-family: Montserrat, "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 18px;
font-weight: 700;
color: #fff;
background-color: #fed136;
}
.btn-xl:hover,
.btn-xl:focus,
.btn-xl:active,
.btn-xl.active,
.open .dropdown-toggle.btn-xl {
border-color: #f6bf01;
color: #fff;
background-color: #fec503;
}
.btn-xl:active,
.btn-xl.active,
.open .dropdown-toggle.btn-xl {
background-image: none;
}
.btn-xl.disabled,
.btn-xl[disabled],
fieldset[disabled] .btn-xl,
.btn-xl.disabled:hover,
.btn-xl[disabled]:hover,
fieldset[disabled] .btn-xl:hover,
.btn-xl.disabled:focus,
.btn-xl[disabled]:focus,
fieldset[disabled] .btn-xl:focus,
.btn-xl.disabled:active,
.btn-xl[disabled]:active,
fieldset[disabled] .btn-xl:active,
.btn-xl.disabled.active,
.btn-xl[disabled].active,
fieldset[disabled] .btn-xl.active {
border-color: #fed136;
background-color: #fed136;
}
.btn-xl .badge {
color: #fed136;
background-color: #fff;
}
.navbar-default {
border-color: transparent;
background-color: #222;
}
.navbar-default .navbar-brand {
font-family: "Jockey One", "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #fed136;
}
.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus,
.navbar-default .navbar-brand:active,
.navbar-default .navbar-brand.active {
color: #fed136;
}
.navbar-default .navbar-collapse {
border-color: rgba(255, 255, 255, 0.02);
}
.navbar-default .navbar-toggle {
border-color: #fed136;
background-color: #fed136;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: #fff;
}
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
background-color: #fed136;
}
.navbar-default .nav li a {
text-transform: uppercase;
font-family: Montserrat, "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 400;
letter-spacing: 1px;
color: #fff;
}
.navbar-default .nav li a:hover,
.navbar-default .nav li a:focus {
outline: 0;
color: #fed136;
}
.navbar-default .navbar-nav > .active > a {
border-radius: 0;
color: #fff;
background-color: #fed136;
}
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
color: #fff;
background-color: #fec503;
}
@media (min-width: 768px) {
.navbar-default {
padding: 25px 0;
border: 0;
background-color: transparent;
-webkit-transition: padding .3s;
-moz-transition: padding .3s;
transition: padding .3s;
}
.navbar-default .navbar-brand {
font-size: 2em;
-webkit-transition: all .3s;
-moz-transition: all .3s;
transition: all .3s;
}
.navbar-default .navbar-nav > .active > a {
border-radius: 3px;
}
.navbar-default.navbar-shrink {
padding: 10px 0;
background-color: #222;
}
.navbar-default.navbar-shrink .navbar-brand {
font-size: 1.5em;
}
}
header {
text-align: center;
color: #fff;
background-attachment: scroll;
background-image: url('../img/globe2.jpg');
background-position: center center;
background-repeat: none;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
}
header .intro-text {
padding-top: 100px;
padding-bottom: 50px;
}
header .intro-text .intro-lead-in {
margin-bottom: 25px;
font-family: Montserrat, "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 22px;
font-style: normal;
line-height: 22px;
}
header .intro-text .intro-heading {
text-transform: uppercase;
font-family: Montserrat, "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 50px;
font-weight: 700;
line-height: 50px;
margin-bottom: 0px;
}
@media (min-width: 768px) {
header .intro-text {
padding-top: 300px;
padding-bottom: 200px;
}
header .intro-text .intro-lead-in {
margin-bottom: 25px;
font-family: "Merriweather", serif;
font-size: 40px;
font-style: italic;
line-height: 40px;
}
header .intro-text .intro-heading {
margin-bottom: 50px;
text-transform: uppercase;
font-family: Montserrat, "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 75px;
font-weight: 700;
line-height: 75px;
}
}
section {
padding: 100px 0;
}
section h2.section-heading {
margin-top: 0;
margin-bottom: 15px;
font-size: 40px;
}
section h3.section-subheading {
margin-bottom: 75px;
text-transform: none;
font-size: 16px;
font-style: italic;
font-weight: 400;
font-family: "Merriweather", serif;
}
@media (min-width: 768px) {
section {
padding: 150px 0;
}
}
.service-heading {
margin: 15px 0;
text-transform: none;
}
#portfolio .portfolio-item {
right: 0;
margin: 0 0 15px;
}
#portfolio .portfolio-item .portfolio-link {
display: block;
position: relative;
margin: 0 auto;
max-width: 400px;
}
#portfolio .portfolio-item .portfolio-link .portfolio-hover {
position: absolute;
width: 100%;
height: 100%;
opacity: 0;
background: rgba(254, 209, 54, 0.9);
-webkit-transition: all ease .5s;
-moz-transition: all ease .5s;
transition: all ease .5s;
}
#portfolio .portfolio-item .portfolio-link .portfolio-hover:hover {
opacity: 1;
}
#portfolio .portfolio-item .portfolio-link .portfolio-hover .portfolio-hover-content {
position: absolute;
top: 50%;
width: 100%;
height: 20px;
margin-top: -12px;
text-align: center;
font-size: 20px;
color: #fff;
}
#portfolio .portfolio-item .portfolio-link .portfolio-hover .portfolio-hover-content i {
margin-top: -12px;
}
#portfolio .portfolio-item .portfolio-link .portfolio-hover .portfolio-hover-content h3,
#portfolio .portfolio-item .portfolio-link .portfolio-hover .portfolio-hover-content h4 {
margin: 0;
}
#portfolio .portfolio-item .portfolio-caption {
margin: 0 auto;
padding: 25px;
max-width: 400px;
text-align: center;
background-color: #fff;
}
#portfolio .portfolio-item .portfolio-caption h4 {
margin: 0;
text-transform: none;
}
#portfolio .portfolio-item .portfolio-caption p {
margin: 0;
font-family: "Droid Serif", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 16px;
font-style: italic;
}
#portfolio * {
z-index: 2;
}
@media (min-width: 767px) {
#portfolio .portfolio-item {
margin: 0 0 30px;
}
}
.timeline {
position: relative;
padding: 0;
list-style: none;
}
.timeline:before {
content: "";
position: absolute;
top: 0;
bottom: 0;
left: 40px;
width: 2px;
margin-left: -1.5px;
background-color: #f1f1f1;
}
.timeline > li {
position: relative;
margin-bottom: 50px;
min-height: 50px;
}
.timeline > li:before,
.timeline > li:after {
content: " ";
display: table;
}
.timeline > li:after {
clear: both;
}
.timeline > li .timeline-panel {
float: right;
position: relative;
width: 100%;
padding: 0 20px 0 100px;
text-align: left;
}
.timeline > li .timeline-panel:before {
right: auto;
left: -15px;
border-right-width: 15px;
border-left-width: 0;
}
.timeline > li .timeline-panel:after {
right: auto;
left: -14px;
border-right-width: 14px;
border-left-width: 0;
}
.timeline > li .timeline-image {
z-index: 100;
position: absolute;
left: 0;
width: 80px;
height: 80px;
margin-left: 0;
border: 7px solid #f1f1f1;
border-radius: 100%;
text-align: center;
color: #fff;
background-color: #fed136;
}
.timeline > li .timeline-image h4 {
margin-top: 12px;
font-size: 10px;
line-height: 14px;
}
.timeline > li.timeline-inverted > .timeline-panel {
float: right;
padding: 0 20px 0 100px;
text-align: left;
}
.timeline > li.timeline-inverted > .timeline-panel:before {
right: auto;
left: -15px;
border-right-width: 15px;
border-left-width: 0;
}
.timeline > li.timeline-inverted > .timeline-panel:after {
right: auto;
left: -14px;
border-right-width: 14px;
border-left-width: 0;
}
.timeline > li:last-child {
margin-bottom: 0;
}
.timeline .timeline-heading h4 {
margin-top: 0;
color: inherit;
}
.timeline .timeline-heading h4.subheading {
text-transform: none;
}
.timeline .timeline-body > p,
.timeline .timeline-body > ul {
margin-bottom: 0;
}
@media (min-width: 768px) {
.timeline:before {
left: 50%;
}
.timeline > li {
margin-bottom: 100px;
min-height: 100px;
}
.timeline > li .timeline-panel {
float: left;
width: 41%;
padding: 0 20px 20px 30px;
text-align: right;
}
.timeline > li .timeline-image {
left: 50%;
width: 100px;
height: 100px;
margin-left: -50px;
}
.timeline > li .timeline-image h4 {
margin-top: 16px;
font-size: 13px;
line-height: 18px;
}
.timeline > li.timeline-inverted > .timeline-panel {
float: right;
padding: 0 30px 20px 20px;
text-align: left;
}
}
@media (min-width: 992px) {
.timeline > li {
min-height: 150px;
}
.timeline > li .timeline-panel {
padding: 0 20px 20px;
}
.timeline > li .timeline-image {
width: 150px;
height: 150px;
margin-left: -75px;
}
.timeline > li .timeline-image h4 {
margin-top: 30px;
font-size: 18px;
line-height: 26px;
}
.timeline > li.timeline-inverted > .timeline-panel {
padding: 0 20px 20px;
}
}
@media (min-width: 1200px) {
.timeline > li {
min-height: 170px;
}
.timeline > li .timeline-panel {
padding: 0 20px 20px 100px;
}
.timeline > li .timeline-image {
width: 170px;
height: 170px;
margin-left: -85px;
}
.timeline > li .timeline-image h4 {
margin-top: 40px;
}
.timeline > li.timeline-inverted > .timeline-panel {
padding: 0 100px 20px 20px;
}
}
.team-member {
text-align: center;
margin-bottom: -10px;
}
.team-member img {
margin: 0 auto;
border: 5px solid #fff;
}
.team-member h4 {
margin-top: 25px;
margin-bottom: 0;
text-transform: none;
}
.team-member p {
margin-top: 0;
background-color: #fed136;
padding: 15px;
}
aside.clients img {
margin: 50px auto;
}
section#contact {
background-color: #222;
background-image: url(../img/map-image.png);
background-position: center;
background-repeat: no-repeat;
padding-top: 50px;
padding-bottom: 50px;
}
section#contact .section-heading {
color: #fff;
}
section#contact .form-group {
margin-bottom: 25px;
}
section#contact .form-group input,
section#contact .form-group textarea {
padding: 20px;
}
section#contact .form-group input.form-control {
height: auto;
}
section#contact .form-group textarea.form-control {
height: 236px;
}
section#contact .form-control:focus {
border-color: #fed136;
box-shadow: none;
}
section#contact::-webkit-input-placeholder {
text-transform: uppercase;
font-family: Montserrat, "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 700;
color: #bbb;
}
section#contact:-moz-placeholder {
text-transform: uppercase;
font-family: Montserrat, "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 700;
color: #bbb;
}
section#contact::-moz-placeholder {
text-transform: uppercase;
font-family: Montserrat, "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 700;
color: #bbb;
}
section#contact:-ms-input-placeholder {
text-transform: uppercase;
font-family: Montserrat, "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 700;
color: #bbb;
}
section#contact .text-danger {
color: #e74c3c;
}
footer {
padding: 25px 0;
text-align: center;
}
footer span.copyright {
text-transform: none;
font-family: Montserrat, "Helvetica Neue", Helvetica, Arial, sans-serif;
line-height: 40px;
text-align: left;
}
footer ul.quicklinks {
margin-bottom: 0;
text-transform: uppercase;
text-transform: none;
font-family: Montserrat, "Helvetica Neue", Helvetica, Arial, sans-serif;
line-height: 40px;
}
ul.social-buttons {
margin-bottom: 0;
}
ul.social-buttons li a {
display: block;
width: 40px;
height: 40px;
border-radius: 100%;
font-size: 20px;
line-height: 40px;
outline: 0;
color: #fff;
background-color: #222;
-webkit-transition: all .3s;
-moz-transition: all .3s;
transition: all .3s;
}
ul.social-buttons li a:hover,
ul.social-buttons li a:focus,
ul.social-buttons li a:active {
background-color: #fed136;
}
.btn:focus,
.btn:active,
.btn.active,
.btn:active:focus {
outline: 0;
}
.portfolio-modal .modal-content {
padding: 100px 0;
min-height: 100%;
border: 0;
border-radius: 0;
text-align: center;
background-clip: border-box;
-webkit-box-shadow: none;
box-shadow: none;
}
.portfolio-modal .modal-content h2 {
margin-bottom: 15px;
font-size: 3em;
}
.portfolio-modal .modal-content p {
margin-bottom: 30px;
}
.portfolio-modal .modal-content p.item-intro {
margin: 20px 0 30px;
font-family: "Droid Serif", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 16px;
font-style: italic;
}
.portfolio-modal .modal-content ul.list-inline {
margin-top: 0;
margin-bottom: 30px;
}
.portfolio-modal .modal-content img {
margin-bottom: 30px;
}
.portfolio-modal .close-modal {
position: absolute;
top: 25px;
right: 25px;
width: 75px;
height: 75px;
background-color: transparent;
cursor: pointer;
}
.portfolio-modal .close-modal:hover {
opacity: .3;
}
.portfolio-modal .close-modal .lr {
z-index: 1051;
width: 1px;
height: 75px;
margin-left: 35px;
background-color: #222;
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
}
.portfolio-modal .close-modal .lr .rl {
z-index: 1052;
width: 1px;
height: 75px;
background-color: #222;
-webkit-transform: rotate(90deg);
-ms-transform: rotate(90deg);
transform: rotate(90deg);
}
.portfolio-modal .modal-backdrop {
display: none;
opacity: 0;
}
::-moz-selection {
text-shadow: none;
background: #fed136;
}
::selection {
text-shadow: none;
background: #fed136;
}
img::selection {
background: 0 0;
}
img::-moz-selection {
background: 0 0;
}
body {
webkit-tap-highlight-color: #fed136;
}
.margins {
margin-left: 60px;
margin-right: 60px;
}
.photo {
margin-bottom: 0px;
margin-top: 0px;
padding-top: 70px;
padding-left: 0px;
margin-right: 0px;
left: 0px;
}
.professor {
padding-top: 100px;
padding-bottom: 0;
}
.biografia {
padding-bottom: 0px;
margin-bottom: 50px;
}
.depoimento {
margin-top: 30px;
}
.testemunho {
margin-top: 17px;
}
.testemunho h4 {
margin-bottom: 0;
}
section#pacotes {
background-color: #222;
}
section#pacotes .section-heading {
color: #fff;
}
section#contact h3 {
color: #fff;
}
section#contact p {
color: #fff;
}
.demo {
margin-left: 50px;
padding: 20px 40px;
border-color: #c6ccd2;
border-radius: 3px;
text-transform: uppercase;
font-family: Montserrat, "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 18px;
font-weight: 700;
color: #fff;
background-color: #c6ccd2;
}
.demo:hover {
color: #fff;
background-color: #767676;
}
.email {
line-height: 30px;
font-weight: 400;
height: 65px;
font-family: Montserrat, "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 22px;
}
section#demo {
padding-top: 55px;
padding-bottom: 55px;
background-color: #fed136;
}
.enviar {
margin-left: 0px;
padding: 20px 40px;
border-color: #c6ccd2;
border-radius: 3px;
text-transform: uppercase;
font-family: Montserrat, "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 18px;
font-weight: 700;
color: #fff;
background-color: #3996cc;
}
.enviar:hover {
color: #fff;
background-color: #3386b7;
}
section#demo p {
color: #222;
margin-top: 10px;
font-size: 14px;
font-family: Montserrat, "Helvetica Neue", Helvetica, Arial, sans-serif;
}
section#demo h3 {
text-transform: none;
margin-top: 0;
}
.logo {
color: #fed136;
text-transform: none;
font-size: 21px;
font-family: "Jockey One", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.glyphicon {
color: #fff;
}
section#contact .col-md-10,
.col-lg-10 {
margin-left: 0px;
padding-left: 3px;
}
.fa {
color: #222;
border: 10px;
background-color: #fff;
padding: 3px 6px 2px 5px;
border-radius: 9px;
margin-right: 0px;
margin-left: -3px;
}
.pacote {
background-color: #3996cc;
padding: 14px 8px 13px;
color: #fff;
text-align: center;
margin: 0;
}
section#pacotes p {
color: #222;
margin-top: 0;
font-size: 14px;
font-family: Montserrat, "Helvetica Neue", Helvetica, Arial, sans-serif;
padding: 8px;
font-weight: 200;
text-align: center;
border-top: 0;
border-bottom: 1px;
border-style: solid;
border-color: #ddd;
border-left: 0;
border-right: 0;
margin-bottom: 0;
}
section#pacotes h4 {
padding: 18px 8px;
color: #fff;
text-align: center;
background-color: #767676;
text-transform: none;
font-size: 35px;
margin: 0;
}
section#pacotes h5 {
padding: 15px 8px;
color: #222;
text-align: center;
background-color: #f6f6f6;
text-transform: none;
margin: 0;
font-size: 17px;
}
section#pacotes p.large {
color: #f7f7f7;
border: none;
text-align: left;
font-weight: 100;
font-size: 12px;
margin-top: 5px;
}
section#pacotes .col-md-10 {
padding-right: 0;
padding-left: 0;
}
.super {
border: 15px;
color: #e52323;
border-color: #fed136;
background-color: #df9898;
}
.pacote-coluna {
background-color: #fff;
padding-left: 0;
padding-right: 0;
border: 0.5px;
border-style: solid;
border-color: #ddd;
}
.pacote-max {
background-color: #fff;
padding-left: 0;
padding-right: 0;
border: 9px;
border-style: solid;
border-color: #fed136;
margin-top: -9px;
border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 7px;
border-bottom-left-radius: 7px;
}
.valor {
background-color: #fed136;
padding-left: 0;
padding-right: 0;
border: 9px;
border-style: solid;
border-color: #fed136;
margin-top: -9px;
border-top-left-radius: 7px;
border-top-right-radius: 7px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
height: 29px;
}
.valor h5 {
background-color: #fed136;
font-size: 14px;
}
.valor h6 {
margin-top: 0;
text-align: center;
margin-bottom: 0;
}
header h1 {
text-transform: none;
font-style: normal;
font-weight: 100;
margin-top: -26px;
margin-bottom: 0px;
}
header .row {
margin-top: 0px;
}
section#portfolio p {
margin-bottom: 67px;
}
section#portfolio {
padding-bottom: 68px;
}
section#about strong {
text-align: right;
text-transform: none;
font-size: 18px;
font-style: italic;
font-family: "Merriweather", serif;
}
section#services img {
border: 5px;
border-color: #f7f7f7;
border-style: solid;
border-radius: 52px;
}
| hichamidiomas/hichamidiomas.github.io | css/_pgbackup/agency_1424038683.css | CSS | apache-2.0 | 20,625 | [
30522,
1013,
1008,
999,
1008,
2707,
6879,
6494,
2361,
1011,
4034,
6879,
6494,
2361,
4323,
1006,
8299,
1024,
1013,
1013,
2707,
27927,
20528,
2361,
1012,
30524,
1012,
15895,
1012,
8917,
1013,
15943,
1013,
6105,
1011,
1016,
1012,
1014,
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... |
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
#include <Ice/Application.h>
#include <TestCommon.h>
#include <Test.h>
#include <string>
#include <iostream>
DEFINE_TEST("client")
using namespace std;
using namespace Ice;
using namespace Test;
int
run(int, char**, const Ice::CommunicatorPtr& communicator)
{
TestIntfPrx allTests(const CommunicatorPtr&);
TestIntfPrx obj = allTests(communicator);
return EXIT_SUCCESS;
}
int
main(int argc, char* argv[])
{
int status;
Ice::CommunicatorPtr communicator;
try
{
communicator = Ice::initialize(argc, argv);
status = run(argc, argv, communicator);
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
status = EXIT_FAILURE;
}
if(communicator)
{
try
{
communicator->destroy();
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
status = EXIT_FAILURE;
}
}
return status;
}
| sbesson/zeroc-ice | cpp/test/Ice/adapterDeactivation/Client.cpp | C++ | gpl-2.0 | 1,298 | [
30522,
1013,
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,
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... |
/*
* 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.oodt.cas.resource.mux;
import java.util.List;
import org.apache.oodt.cas.resource.batchmgr.Batchmgr;
import org.apache.oodt.cas.resource.monitor.Monitor;
import org.apache.oodt.cas.resource.scheduler.Scheduler;
import org.apache.oodt.cas.resource.structs.exceptions.QueueManagerException;
/**
* Interface for the backend manager
*
* @author starchmd
*/
public interface BackendManager {
/**
* Add in a backend set to this manager.
* @param queue - queue that maps to the given monitor, batchmgr, and scheduler
* @param monitor - monitor used for this set
* @param batchmgr - batch manager for this set
* @param scheduler - scheduler for this set
*/
void addSet(String queue, Monitor monitor, Batchmgr batchmgr, Scheduler scheduler);
/**
* Return monitor for the given queue.
* @param queue - queue to check
* @return montior
* @throws QueueManagerException when queue does not exist
*/
Monitor getMonitor(String queue) throws QueueManagerException;
/**
* Return batch manager for the given queue.
* @param queue - queue to check
* @return batchmgr
* @throws QueueManagerException when queue does not exist
*/
Batchmgr getBatchmgr(String queue) throws QueueManagerException;
/**
* Return scheduler for the given queue.
* @param queue - queue to check
* @return scheduler
* @throws QueueManagerException when queue does not exist
*/
Scheduler getScheduler(String queue) throws QueueManagerException;
/**
* Return a list of all monitors.
* @return list of all monitors
*/
List<Monitor> getMonitors();
}
| apache/oodt | resource/src/main/java/org/apache/oodt/cas/resource/mux/BackendManager.java | Java | apache-2.0 | 2,489 | [
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... |
# -*- coding: utf-8 -*-
"""Template shortcut & filters"""
import os
import datetime
from jinja2 import Environment, FileSystemLoader
from uwsgi_sloth.settings import ROOT
from uwsgi_sloth import settings, __VERSION__
template_path = os.path.join(ROOT, 'templates')
env = Environment(loader=FileSystemLoader(template_path))
# Template filters
def friendly_time(msecs):
secs, msecs = divmod(msecs, 1000)
mins, secs = divmod(secs, 60)
hours, mins = divmod(mins, 60)
if hours:
return '%dh%dm%ds' % (hours, mins, secs)
elif mins:
return '%dm%ds' % (mins, secs)
elif secs:
return '%ds%dms' % (secs, msecs)
else:
return '%.2fms' % msecs
env.filters['friendly_time'] = friendly_time
def render_template(template_name, context={}):
template = env.get_template(template_name)
context.update(
SETTINGS=settings,
now=datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'),
version='.'.join(map(str, __VERSION__)))
return template.render(**context)
| piglei/uwsgi-sloth | uwsgi_sloth/template.py | Python | apache-2.0 | 1,040 | [
30522,
1001,
1011,
1008,
1011,
30524,
10906,
12324,
7117,
2013,
1057,
9333,
5856,
1035,
10453,
2232,
12324,
10906,
1010,
1035,
1035,
2544,
1035,
1035,
23561,
1035,
4130,
1027,
9808,
1012,
4130,
1012,
3693,
1006,
7117,
1010,
1005,
23561,
201... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <errno.h>
#include <getopt.h>
#include <string.h>
#include <sys/prctl.h>
#include <unistd.h>
#include "alloc-util.h"
#include "dirent-util.h"
#include "fd-util.h"
#include "fs-util.h"
#include "hashmap.h"
#include "locale-util.h"
#include "log.h"
#include "main-func.h"
#include "nulstr-util.h"
#include "pager.h"
#include "parse-util.h"
#include "path-util.h"
#include "pretty-print.h"
#include "process-util.h"
#include "signal-util.h"
#include "stat-util.h"
#include "string-util.h"
#include "strv.h"
#include "terminal-util.h"
static const char prefixes[] =
"/etc\0"
"/run\0"
"/usr/local/lib\0"
"/usr/local/share\0"
"/usr/lib\0"
"/usr/share\0"
#if HAVE_SPLIT_USR
"/lib\0"
#endif
;
static const char suffixes[] =
"sysctl.d\0"
"tmpfiles.d\0"
"modules-load.d\0"
"binfmt.d\0"
"systemd/system\0"
"systemd/user\0"
"systemd/system-preset\0"
"systemd/user-preset\0"
"udev/rules.d\0"
"modprobe.d\0";
static const char have_dropins[] =
"systemd/system\0"
"systemd/user\0";
static PagerFlags arg_pager_flags = 0;
static int arg_diff = -1;
static enum {
SHOW_MASKED = 1 << 0,
SHOW_EQUIVALENT = 1 << 1,
SHOW_REDIRECTED = 1 << 2,
SHOW_OVERRIDDEN = 1 << 3,
SHOW_UNCHANGED = 1 << 4,
SHOW_EXTENDED = 1 << 5,
SHOW_DEFAULTS =
(SHOW_MASKED | SHOW_EQUIVALENT | SHOW_REDIRECTED | SHOW_OVERRIDDEN | SHOW_EXTENDED)
} arg_flags = 0;
static int equivalent(const char *a, const char *b) {
_cleanup_free_ char *x = NULL, *y = NULL;
int r;
r = chase_symlinks(a, NULL, CHASE_TRAIL_SLASH, &x);
if (r < 0)
return r;
r = chase_symlinks(b, NULL, CHASE_TRAIL_SLASH, &y);
if (r < 0)
return r;
return path_equal(x, y);
}
static int notify_override_masked(const char *top, const char *bottom) {
if (!(arg_flags & SHOW_MASKED))
return 0;
printf("%s%s%s %s %s %s\n",
ansi_highlight_red(), "[MASKED]", ansi_normal(),
top, special_glyph(SPECIAL_GLYPH_ARROW), bottom);
return 1;
}
static int notify_override_equivalent(const char *top, const char *bottom) {
if (!(arg_flags & SHOW_EQUIVALENT))
return 0;
printf("%s%s%s %s %s %s\n",
ansi_highlight_green(), "[EQUIVALENT]", ansi_normal(),
top, special_glyph(SPECIAL_GLYPH_ARROW), bottom);
return 1;
}
static int notify_override_redirected(const char *top, const char *bottom) {
if (!(arg_flags & SHOW_REDIRECTED))
return 0;
printf("%s%s%s %s %s %s\n",
ansi_highlight(), "[REDIRECTED]", ansi_normal(),
top, special_glyph(SPECIAL_GLYPH_ARROW), bottom);
return 1;
}
static int notify_override_overridden(const char *top, const char *bottom) {
if (!(arg_flags & SHOW_OVERRIDDEN))
return 0;
printf("%s%s%s %s %s %s\n",
ansi_highlight(), "[OVERRIDDEN]", ansi_normal(),
top, special_glyph(SPECIAL_GLYPH_ARROW), bottom);
return 1;
}
static int notify_override_extended(const char *top, const char *bottom) {
if (!(arg_flags & SHOW_EXTENDED))
return 0;
printf("%s%s%s %s %s %s\n",
ansi_highlight(), "[EXTENDED]", ansi_normal(),
top, special_glyph(SPECIAL_GLYPH_ARROW), bottom);
return 1;
}
static int notify_override_unchanged(const char *f) {
if (!(arg_flags & SHOW_UNCHANGED))
return 0;
printf("[UNCHANGED] %s\n", f);
return 1;
}
static int found_override(const char *top, const char *bottom) {
_cleanup_free_ char *dest = NULL;
pid_t pid;
int r;
assert(top);
assert(bottom);
if (null_or_empty_path(top) > 0)
return notify_override_masked(top, bottom);
r = readlink_malloc(top, &dest);
if (r >= 0) {
if (equivalent(dest, bottom) > 0)
return notify_override_equivalent(top, bottom);
else
return notify_override_redirected(top, bottom);
}
r = notify_override_overridden(top, bottom);
if (!arg_diff)
return r;
putchar('\n');
fflush(stdout);
r = safe_fork("(diff)", FORK_RESET_SIGNALS|FORK_DEATHSIG|FORK_CLOSE_ALL_FDS|FORK_RLIMIT_NOFILE_SAFE|FORK_LOG, &pid);
if (r < 0)
return r;
if (r == 0) {
execlp("diff", "diff", "-us", "--", bottom, top, NULL);
log_open();
log_error_errno(errno, "Failed to execute diff: %m");
_exit(EXIT_FAILURE);
}
(void) wait_for_terminate_and_check("diff", pid, WAIT_LOG_ABNORMAL);
putchar('\n');
return r;
}
static int enumerate_dir_d(
OrderedHashmap *top,
OrderedHashmap *bottom,
OrderedHashmap *drops,
const char *toppath, const char *drop) {
_cleanup_free_ char *unit = NULL;
_cleanup_free_ char *path = NULL;
_cleanup_strv_free_ char **list = NULL;
char **file;
char *c;
int r;
assert(!endswith(drop, "/"));
path = path_join(toppath, drop);
if (!path)
return -ENOMEM;
log_debug("Looking at %s", path);
unit = strdup(drop);
if (!unit)
return -ENOMEM;
c = strrchr(unit, '.');
if (!c)
return -EINVAL;
*c = 0;
r = get_files_in_directory(path, &list);
if (r < 0)
return log_error_errno(r, "Failed to enumerate %s: %m", path);
strv_sort(list);
STRV_FOREACH(file, list) {
OrderedHashmap *h;
int k;
char *p;
char *d;
if (!endswith(*file, ".conf"))
continue;
p = path_join(path, *file);
if (!p)
return -ENOMEM;
d = p + strlen(toppath) + 1;
log_debug("Adding at top: %s %s %s", d, special_glyph(SPECIAL_GLYPH_ARROW), p);
k = ordered_hashmap_put(top, d, p);
if (k >= 0) {
p = strdup(p);
if (!p)
return -ENOMEM;
d = p + strlen(toppath) + 1;
} else if (k != -EEXIST) {
free(p);
return k;
}
log_debug("Adding at bottom: %s %s %s", d, special_glyph(SPECIAL_GLYPH_ARROW), p);
free(ordered_hashmap_remove(bottom, d));
k = ordered_hashmap_put(bottom, d, p);
if (k < 0) {
free(p);
return k;
}
h = ordered_hashmap_get(drops, unit);
if (!h) {
h = ordered_hashmap_new(&string_hash_ops);
if (!h)
return -ENOMEM;
ordered_hashmap_put(drops, unit, h);
unit = strdup(unit);
if (!unit)
return -ENOMEM;
}
p = strdup(p);
if (!p)
return -ENOMEM;
log_debug("Adding to drops: %s %s %s %s %s",
unit, special_glyph(SPECIAL_GLYPH_ARROW), basename(p), special_glyph(SPECIAL_GLYPH_ARROW), p);
k = ordered_hashmap_put(h, basename(p), p);
if (k < 0) {
free(p);
if (k != -EEXIST)
return k;
}
}
return 0;
}
static int enumerate_dir(
OrderedHashmap *top,
OrderedHashmap *bottom,
OrderedHashmap *drops,
const char *path, bool dropins) {
_cleanup_closedir_ DIR *d = NULL;
struct dirent *de;
_cleanup_strv_free_ char **files = NULL, **dirs = NULL;
size_t n_files = 0, allocated_files = 0, n_dirs = 0, allocated_dirs = 0;
char **t;
int r;
assert(top);
assert(bottom);
assert(drops);
assert(path);
log_debug("Looking at %s", path);
d = opendir(path);
if (!d) {
if (errno == ENOENT)
return 0;
return log_error_errno(errno, "Failed to open %s: %m", path);
}
FOREACH_DIRENT_ALL(de, d, return -errno) {
dirent_ensure_type(d, de);
if (dropins && de->d_type == DT_DIR && endswith(de->d_name, ".d")) {
if (!GREEDY_REALLOC0(dirs, allocated_dirs, n_dirs + 2))
return -ENOMEM;
dirs[n_dirs] = strdup(de->d_name);
if (!dirs[n_dirs])
return -ENOMEM;
n_dirs ++;
}
if (!dirent_is_file(de))
continue;
if (!GREEDY_REALLOC0(files, allocated_files, n_files + 2))
return -ENOMEM;
files[n_files] = strdup(de->d_name);
if (!files[n_files])
return -ENOMEM;
n_files ++;
}
strv_sort(dirs);
strv_sort(files);
STRV_FOREACH(t, dirs) {
r = enumerate_dir_d(top, bottom, drops, path, *t);
if (r < 0)
return r;
}
STRV_FOREACH(t, files) {
_cleanup_free_ char *p = NULL;
p = path_join(path, *t);
if (!p)
return -ENOMEM;
log_debug("Adding at top: %s %s %s", basename(p), special_glyph(SPECIAL_GLYPH_ARROW), p);
r = ordered_hashmap_put(top, basename(p), p);
if (r >= 0) {
p = strdup(p);
if (!p)
return -ENOMEM;
} else if (r != -EEXIST)
return r;
log_debug("Adding at bottom: %s %s %s", basename(p), special_glyph(SPECIAL_GLYPH_ARROW), p);
free(ordered_hashmap_remove(bottom, basename(p)));
r = ordered_hashmap_put(bottom, basename(p), p);
if (r < 0)
return r;
p = NULL;
}
return 0;
}
static int should_skip_path(const char *prefix, const char *suffix) {
#if HAVE_SPLIT_USR
_cleanup_free_ char *target = NULL;
const char *dirname, *p;
dirname = prefix_roota(prefix, suffix);
if (chase_symlinks(dirname, NULL, 0, &target) < 0)
return false;
NULSTR_FOREACH(p, prefixes) {
_cleanup_free_ char *tmp = NULL;
if (path_startswith(dirname, p))
continue;
tmp = path_join(p, suffix);
if (!tmp)
return -ENOMEM;
if (path_equal(target, tmp)) {
log_debug("%s redirects to %s, skipping.", dirname, target);
return true;
}
}
#endif
return false;
}
static int process_suffix(const char *suffix, const char *onlyprefix) {
const char *p;
char *f;
OrderedHashmap *top, *bottom, *drops;
OrderedHashmap *h;
char *key;
int r = 0, k;
Iterator i, j;
int n_found = 0;
bool dropins;
assert(suffix);
assert(!startswith(suffix, "/"));
assert(!strstr(suffix, "//"));
dropins = nulstr_contains(have_dropins, suffix);
top = ordered_hashmap_new(&string_hash_ops);
bottom = ordered_hashmap_new(&string_hash_ops);
drops = ordered_hashmap_new(&string_hash_ops);
if (!top || !bottom || !drops) {
r = -ENOMEM;
goto finish;
}
NULSTR_FOREACH(p, prefixes) {
_cleanup_free_ char *t = NULL;
if (should_skip_path(p, suffix) > 0)
continue;
t = path_join(p, suffix);
if (!t) {
r = -ENOMEM;
goto finish;
}
k = enumerate_dir(top, bottom, drops, t, dropins);
if (r == 0)
r = k;
}
ORDERED_HASHMAP_FOREACH_KEY(f, key, top, i) {
char *o;
o = ordered_hashmap_get(bottom, key);
assert(o);
if (!onlyprefix || startswith(o, onlyprefix)) {
if (path_equal(o, f)) {
notify_override_unchanged(f);
} else {
k = found_override(f, o);
if (k < 0)
r = k;
else
n_found += k;
}
}
h = ordered_hashmap_get(drops, key);
if (h)
ORDERED_HASHMAP_FOREACH(o, h, j)
if (!onlyprefix || startswith(o, onlyprefix))
n_found += notify_override_extended(f, o);
}
finish:
ordered_hashmap_free_free(top);
ordered_hashmap_free_free(bottom);
ORDERED_HASHMAP_FOREACH_KEY(h, key, drops, i) {
ordered_hashmap_free_free(ordered_hashmap_remove(drops, key));
ordered_hashmap_remove(drops, key);
free(key);
}
ordered_hashmap_free(drops);
return r < 0 ? r : n_found;
}
static int process_suffixes(const char *onlyprefix) {
const char *n;
int n_found = 0, r;
NULSTR_FOREACH(n, suffixes) {
r = process_suffix(n, onlyprefix);
if (r < 0)
return r;
n_found += r;
}
return n_found;
}
static int process_suffix_chop(const char *arg) {
const char *p;
assert(arg);
if (!path_is_absolute(arg))
return process_suffix(arg, NULL);
/* Strip prefix from the suffix */
NULSTR_FOREACH(p, prefixes) {
const char *suffix;
suffix = startswith(arg, p);
if (suffix) {
suffix += strspn(suffix, "/");
if (*suffix)
return process_suffix(suffix, p);
else
return process_suffixes(arg);
}
}
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"Invalid suffix specification %s.", arg);
}
static int help(void) {
_cleanup_free_ char *link = NULL;
int r;
r = terminal_urlify_man("systemd-delta", "1", &link);
if (r < 0)
return log_oom();
printf("%s [OPTIONS...] [SUFFIX...]\n\n"
"Find overridden configuration files.\n\n"
" -h --help Show this help\n"
" --version Show package version\n"
" --no-pager Do not pipe output into a pager\n"
" --diff[=1|0] Show a diff when overridden files differ\n"
" -t --type=LIST... Only display a selected set of override types\n"
"\nSee the %s for details.\n"
, program_invocation_short_name
, link
);
return 0;
}
static int parse_flags(const char *flag_str, int flags) {
const char *word, *state;
size_t l;
FOREACH_WORD_SEPARATOR(word, l, flag_str, ",", state) {
if (strneq("masked", word, l))
flags |= SHOW_MASKED;
else if (strneq ("equivalent", word, l))
flags |= SHOW_EQUIVALENT;
else if (strneq("redirected", word, l))
flags |= SHOW_REDIRECTED;
else if (strneq("overridden", word, l))
flags |= SHOW_OVERRIDDEN;
else if (strneq("unchanged", word, l))
flags |= SHOW_UNCHANGED;
else if (strneq("extended", word, l))
flags |= SHOW_EXTENDED;
else if (strneq("default", word, l))
flags |= SHOW_DEFAULTS;
else
return -EINVAL;
}
return flags;
}
static int parse_argv(int argc, char *argv[]) {
enum {
ARG_NO_PAGER = 0x100,
ARG_DIFF,
ARG_VERSION
};
static const struct option options[] = {
{ "help", no_argument, NULL, 'h' },
{ "version", no_argument, NULL, ARG_VERSION },
{ "no-pager", no_argument, NULL, ARG_NO_PAGER },
{ "diff", optional_argument, NULL, ARG_DIFF },
{ "type", required_argument, NULL, 't' },
{}
};
int c;
assert(argc >= 1);
assert(argv);
while ((c = getopt_long(argc, argv, "ht:", options, NULL)) >= 0)
switch (c) {
case 'h':
return help();
case ARG_VERSION:
return version();
case ARG_NO_PAGER:
arg_pager_flags |= PAGER_DISABLE;
break;
case 't': {
int f;
f = parse_flags(optarg, arg_flags);
if (f < 0)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"Failed to parse flags field.");
arg_flags = f;
break;
}
case ARG_DIFF:
if (!optarg)
arg_diff = 1;
else {
int b;
b = parse_boolean(optarg);
if (b < 0)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"Failed to parse diff boolean.");
arg_diff = b;
}
break;
case '?':
return -EINVAL;
default:
assert_not_reached("Unhandled option");
}
return 1;
}
static int run(int argc, char *argv[]) {
int r, k, n_found = 0;
log_show_color(true);
log_parse_environment();
log_open();
r = parse_argv(argc, argv);
if (r <= 0)
return r;
if (arg_flags == 0)
arg_flags = SHOW_DEFAULTS;
if (arg_diff < 0)
arg_diff = !!(arg_flags & SHOW_OVERRIDDEN);
else if (arg_diff)
arg_flags |= SHOW_OVERRIDDEN;
(void) pager_open(arg_pager_flags);
if (optind < argc) {
int i;
for (i = optind; i < argc; i++) {
path_simplify(argv[i], false);
k = process_suffix_chop(argv[i]);
if (k < 0)
r = k;
else
n_found += k;
}
} else {
k = process_suffixes(NULL);
if (k < 0)
r = k;
else
n_found += k;
}
if (r >= 0)
printf("%s%i overridden configuration files found.\n", n_found ? "\n" : "", n_found);
return r;
}
DEFINE_MAIN_FUNCTION(run);
| tblume/systemd-testsuite-suse | src/delta/delta.c | C | gpl-2.0 | 20,751 | [
30522,
1013,
1008,
23772,
2595,
1011,
6105,
1011,
8909,
4765,
18095,
1024,
1048,
21600,
2140,
1011,
1016,
1012,
1015,
1009,
1008,
1013,
1001,
2421,
1026,
9413,
19139,
1012,
1044,
1028,
1001,
2421,
1026,
2131,
30524,
1012,
1044,
1028,
1001,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
(function(){tinymce.PluginManager.requireLangPack('codemagic');tinymce.create('tinymce.plugins.CodeMagic',{init:function(ed,url){ed.addCommand('mceCodeMagic',function(){ed.windowManager.open({file:url+'/codemagic.php',width:1200,height:600,inline:1,maximizable:true},{plugin_url:url})});ed.addButton('codemagic',{title:'codemagic.editor_button',cmd:'mceCodeMagic',image:url+'/img/code.png'});ed.onNodeChange.add(function(ed,cm,n,co){cm.setDisabled('link',co&&n.nodeName!='A');cm.setActive('link',n.nodeName=='A'&&!n.name)})},getInfo:function(){return{longname:'CodeMagic - syntax coloring and intendation',author:'Sutulustus',authorurl:'http://www.triad.sk/#/en',version:'0.9.5'}}});tinymce.PluginManager.add('codemagic',tinymce.plugins.CodeMagic)})(); | tgrimault/manorhouseporto.wp | wp-content/plugins/ultimate-tinymce/addons/codemagic/editor_plugin.js | JavaScript | gpl-2.0 | 752 | [
30522,
1006,
3853,
1006,
1007,
1063,
4714,
12458,
2063,
1012,
13354,
2378,
24805,
4590,
1012,
5478,
25023,
23947,
1006,
1005,
3642,
2863,
12863,
1005,
1007,
1025,
4714,
12458,
2063,
1012,
3443,
1006,
1005,
4714,
12458,
2063,
1012,
13354,
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... |
body {
padding: 30px;
font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
}
a {
color: #00B7FF;
}
div.main {
border: 1px solid #e1e4e8;
}
input[type="button"] {
color: #FFF;
background-color: #5cb85c;
cursor: pointer;
border: none;
margin: 1em, 0.25em, 0, 0;
padding: 6px;
font-weight: 700;
text-align: center;
border-radius: 0.3rem;
box-shadow: 0 0 0 1px transparent inset, 0 0 0 0 rgba(34, 36, 38, .15) inset;
}
| jheckjr/online-html-editor | app/public/stylesheets/style.css | CSS | mit | 451 | [
30522,
2303,
1063,
11687,
4667,
1024,
2382,
2361,
2595,
1025,
15489,
1024,
2403,
2361,
2595,
1000,
12776,
8524,
9026,
1000,
1010,
2002,
2140,
19510,
5555,
1010,
9342,
2140,
1010,
20344,
1011,
14262,
10128,
1025,
1065,
1037,
1063,
3609,
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... |
<?php
namespace Application\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
use Application\Form\ContactCreateForm;
use Application\Service\ContactService;
use Application\Service\PersonService;
/**
*
* Controller responsible for creation and destruction of contacts.
*
* @author wbondarenko@programmer.net
*
*/
class ContactController
extends ApplicationController
{
private $contactService;
private $personService;
public function __construct (ContactService $contactService, PersonService $personService)
{
$this->contactService = $contactService;
$this->personService = $personService;
}
/**
* Creates new contact on POST.
* Also partly responsible for ensuring that creation is possible.
* Renders appropriate HTML page on GET.
* Redirects to the authentication page is user is not logged in.
*/
public function createAction ()
{
if (!$this->isAuthenticated( ))
{
return $this->redirectToAuthentication( );
}
$form = new ContactCreateForm ("Create contact.");
$source = $this->identity( )->getPerson( );
$persons = array ( );
$request = $this->getRequest();
if ($request->isPost())
{
// TODO Implement input filter for form.
//$form->setInputFilter(new ContactCreateInputFilter ( ));
$form->setData($request->getPost());
if ($form->isValid())
{
$contact = $this->contactService->create($source, $this->params( )->fromPost("id"));
return $this->redirectToPersonalProfile( );
} else {
$this->layout( )->messages = $form->getMessages( );
}
} else if ($request->isGet( )) {
if ($target = $this->personService->retrieve($this->params( )->fromRoute("id")))
{
if (!$this->isMyself($target))
{
return array ('form' => $form, 'target' => $target);
} else {
return $this->redirectToPersonalProfile( );
}
}
}
}
/**
* Destroys a contact on POST.
* Renders appropriate HTML page on GET.
* Redirects to authentication page if user is not logged in.
*/
public function destroyAction ()
{
if (!$this->isAuthenticated( ))
{
return $this->redirectToAuthentication( );
}
$source = $this->identity( )->getPerson( );
$request = $this->getRequest();
if ($request->isPost())
{
$this->contactService->destroy($source, $this->params( )->fromPost('id'));
}
return $this->redirectToPersonalProfile( );
}
}
| Wbondar/Buddies | module/Application/src/Application/Controller/ContactController.php | PHP | mit | 2,817 | [
30522,
1026,
1029,
25718,
3415,
15327,
4646,
1032,
11486,
1025,
2224,
16729,
2094,
1032,
19842,
2278,
1032,
11486,
1032,
10061,
18908,
3258,
8663,
13181,
10820,
1025,
2224,
16729,
2094,
1032,
3193,
1032,
2944,
1032,
3193,
5302,
9247,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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;
namespace Take.Elephant.Tests.Specialized
{
public abstract class GuidItemOnDemandCacheMapFacts : OnDemandCacheMapFacts<Guid, Item>
{
}
} | takenet/elephant | src/Take.Elephant.Tests/Specialized/GuidItemOnDemandCacheMapFacts.cs | C# | apache-2.0 | 167 | [
30522,
2478,
2291,
1025,
3415,
15327,
2202,
1012,
10777,
1012,
5852,
1012,
7772,
1063,
2270,
10061,
2465,
26458,
23194,
26941,
3207,
2386,
16409,
15395,
2863,
14376,
18908,
2015,
1024,
2006,
3207,
2386,
16409,
15395,
2863,
14376,
18908,
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... |
JS=main.js
all: myocamlbuild.ml
ocamlbuild $(JS); ln -s _build/$(JS) .
clean:
ocamlbuild -clean
rm -f myocamlbuild.ml
myocamlbuild.ml:
ln -s ../../ocamljs/tools/myocamlbuild.ml
| hhughes/ocaml-frui | src/ocamljs-sanity/Makefile | Makefile | mit | 184 | [
30522,
1046,
2015,
1027,
2364,
1012,
1046,
2015,
2035,
1024,
2026,
24755,
19968,
8569,
4014,
2094,
1012,
19875,
1051,
28727,
20850,
19231,
2094,
1002,
1006,
1046,
2015,
1007,
1025,
1048,
2078,
1011,
1055,
1035,
3857,
1013,
1002,
1006,
1046,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 2014 The Gogs Authors. All rights reserved.
// Copyright 2018 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package repo
import (
"fmt"
"io"
"path"
"strings"
"code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/charset"
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/lfs"
"code.gitea.io/gitea/modules/log"
)
// ServeData download file from io.Reader
func ServeData(ctx *context.Context, name string, reader io.Reader) error {
buf := make([]byte, 1024)
n, _ := reader.Read(buf)
if n >= 0 {
buf = buf[:n]
}
ctx.Resp.Header().Set("Cache-Control", "public,max-age=86400")
name = path.Base(name)
// Google Chrome dislike commas in filenames, so let's change it to a space
name = strings.Replace(name, ",", " ", -1)
if base.IsTextFile(buf) || ctx.QueryBool("render") {
cs, err := charset.DetectEncoding(buf)
if err != nil {
log.Error("Detect raw file %s charset failed: %v, using by default utf-8", name, err)
cs = "utf-8"
}
ctx.Resp.Header().Set("Content-Type", "text/plain; charset="+strings.ToLower(cs))
} else if base.IsImageFile(buf) || base.IsPDFFile(buf) {
ctx.Resp.Header().Set("Content-Disposition", fmt.Sprintf(`inline; filename="%s"`, name))
ctx.Resp.Header().Set("Access-Control-Expose-Headers", "Content-Disposition")
} else {
ctx.Resp.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"`, name))
ctx.Resp.Header().Set("Access-Control-Expose-Headers", "Content-Disposition")
}
_, err := ctx.Resp.Write(buf)
if err != nil {
return err
}
_, err = io.Copy(ctx.Resp, reader)
return err
}
// ServeBlob download a git.Blob
func ServeBlob(ctx *context.Context, blob *git.Blob) error {
dataRc, err := blob.DataAsync()
if err != nil {
return err
}
defer func() {
if err = dataRc.Close(); err != nil {
log.Error("ServeBlob: Close: %v", err)
}
}()
return ServeData(ctx, ctx.Repo.TreePath, dataRc)
}
// ServeBlobOrLFS download a git.Blob redirecting to LFS if necessary
func ServeBlobOrLFS(ctx *context.Context, blob *git.Blob) error {
dataRc, err := blob.DataAsync()
if err != nil {
return err
}
defer func() {
if err = dataRc.Close(); err != nil {
log.Error("ServeBlobOrLFS: Close: %v", err)
}
}()
if meta, _ := lfs.ReadPointerFile(dataRc); meta != nil {
meta, _ = ctx.Repo.Repository.GetLFSMetaObjectByOid(meta.Oid)
if meta == nil {
return ServeBlob(ctx, blob)
}
lfsDataRc, err := lfs.ReadMetaObject(meta)
if err != nil {
return err
}
defer func() {
if err = lfsDataRc.Close(); err != nil {
log.Error("ServeBlobOrLFS: Close: %v", err)
}
}()
return ServeData(ctx, ctx.Repo.TreePath, lfsDataRc)
}
return ServeBlob(ctx, blob)
}
// SingleDownload download a file by repos path
func SingleDownload(ctx *context.Context) {
blob, err := ctx.Repo.Commit.GetBlobByPath(ctx.Repo.TreePath)
if err != nil {
if git.IsErrNotExist(err) {
ctx.NotFound("GetBlobByPath", nil)
} else {
ctx.ServerError("GetBlobByPath", err)
}
return
}
if err = ServeBlob(ctx, blob); err != nil {
ctx.ServerError("ServeBlob", err)
}
}
// SingleDownloadOrLFS download a file by repos path redirecting to LFS if necessary
func SingleDownloadOrLFS(ctx *context.Context) {
blob, err := ctx.Repo.Commit.GetBlobByPath(ctx.Repo.TreePath)
if err != nil {
if git.IsErrNotExist(err) {
ctx.NotFound("GetBlobByPath", nil)
} else {
ctx.ServerError("GetBlobByPath", err)
}
return
}
if err = ServeBlobOrLFS(ctx, blob); err != nil {
ctx.ServerError("ServeBlobOrLFS", err)
}
}
// DownloadByID download a file by sha1 ID
func DownloadByID(ctx *context.Context) {
blob, err := ctx.Repo.GitRepo.GetBlob(ctx.Params("sha"))
if err != nil {
if git.IsErrNotExist(err) {
ctx.NotFound("GetBlob", nil)
} else {
ctx.ServerError("GetBlob", err)
}
return
}
if err = ServeBlob(ctx, blob); err != nil {
ctx.ServerError("ServeBlob", err)
}
}
// DownloadByIDOrLFS download a file by sha1 ID taking account of LFS
func DownloadByIDOrLFS(ctx *context.Context) {
blob, err := ctx.Repo.GitRepo.GetBlob(ctx.Params("sha"))
if err != nil {
if git.IsErrNotExist(err) {
ctx.NotFound("GetBlob", nil)
} else {
ctx.ServerError("GetBlob", err)
}
return
}
if err = ServeBlobOrLFS(ctx, blob); err != nil {
ctx.ServerError("ServeBlob", err)
}
}
| vCaesar/gitea | routers/repo/download.go | GO | mit | 4,475 | [
30522,
1013,
1013,
9385,
2297,
1996,
2175,
5620,
6048,
1012,
2035,
2916,
9235,
1012,
1013,
1013,
9385,
2760,
1996,
21025,
27058,
6048,
1012,
2035,
2916,
9235,
1012,
1013,
1013,
2224,
1997,
2023,
3120,
3642,
2003,
9950,
2011,
1037,
10210,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
/*! Select2 4.0.0-rc.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/az",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return t+" simvol silin"},inputTooShort:function(e){var t=e.minimum-e.input.length;return t+" simvol daxil edin"},loadingMore:function(){return"Daha çox nəticə yüklənir…"},maximumSelected:function(e){return"Sadəcə "+e.maximum+" element seçə bilərsiniz"},noResults:function(){return"Nəticə tapılmadı"},searching:function(){return"Axtarılır…"}}}),{define:e.define,require:e.require}})(); | arterli/CmsWing | www/static/assets/plugins/select2/js/i18n/az.js | JavaScript | mit | 706 | [
30522,
1013,
1008,
999,
7276,
2475,
1018,
1012,
1014,
1012,
1014,
1011,
22110,
1012,
1016,
1064,
16770,
1024,
1013,
1013,
21025,
2705,
12083,
1012,
4012,
1013,
7276,
2475,
1013,
7276,
2475,
1013,
1038,
4135,
2497,
1013,
3040,
1013,
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... |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0">
<link rel="stylesheet" type="text/css" href="../../../examples/resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../../../examples/resources/demo.css">
<script type="text/javascript" language="javascript" src="../../../examples/resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../../../examples/resources/demo.js">
</script>
<title>KeyTable examples - Spreadsheet like keyboard navigation for DataTables</title>
</head>
<body class="dt-example">
<div class="container">
<section>
<h1>KeyTable example <span>Spreadsheet like keyboard navigation for DataTables</span></h1>
<div class="info">
<p>KeyTable provides Excel like cell navigation on any table. Events (focus, blur, action etc) can be assigned to individual cells, columns, rows or all cells.</p>
</div>
</section>
</div>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<div class="toc">
<div class="toc-group">
<h3><a href="./initialisation/index.html">Initialisation</a></h3>
<ul class="toc">
<li>
<a href="./initialisation/simple.html">Basic initialisation</a>
</li>
<li>
<a href="./initialisation/events.html">Events</a>
</li>
<li>
<a href="./initialisation/scrolling.html">Scrolling table</a>
</li>
<li>
<a href="./initialisation/scroller.html">Scroller integration</a>
</li>
<li>
<a href="./initialisation/server-side.html">Server-side processing</a>
</li>
<li>
<a href="./initialisation/stateSave.html">State saving</a>
</li>
<li>
<a href="./initialisation/blurable.html">Keep focus (no blur)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="./styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="./styling/focusStyle.html">Focus cell custom styling</a>
</li>
<li>
<a href="./styling/bootstrap.html">Bootstrap styling</a>
</li>
<li>
<a href="./styling/semanticui.html">Semantic UI styling</a>
</li>
<li>
<a href="./styling/foundation.html">Foundation styling</a>
</li>
<li>
<a href="./styling/bootstrap4.html">Bootstrap 4 styling</a>
</li>
<li>
<a href="./styling/jqueryui.html">jQuery UI styling</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> | Seddik-Abbassi/OctasoftMembre | web/Nouveau dossier/DataTables-1.10.13/extensions/KeyTable/examples/index.html | HTML | mit | 3,418 | [
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,
4957,
2128,
2140,
1027,
1000,
2460,
12690,
12696,
1000,
2828,
1027,
1000,
374... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 'spec_helper'
module Obelix
module AMI
describe Protocol do
let(:read_data) { "data" }
let(:transport) do
transport = double(TCPTransport, connect: nil, write: nil, :connected? => true)
allow(transport).to receive(:read).and_return("Asterisk Call Manager", read_data)
transport
end
let(:bytes) { double("Packet as string") }
let(:hostname) { double }
let(:parser) { double(AmiParser) }
subject { Protocol.new(transport: transport, parser: parser) }
context "#connect" do
context "transport" do
after { subject.connect(hostname) }
it { expect(transport).to receive(:connect).with(hostname) }
it { expect(transport).to receive(:read) }
end
context "if greeting line is incorrect" do
let(:transport) { double(TCPTransport, connect: nil, read: "BAD Stuff") }
it { expect{subject.connect(hostname)}.to raise_error(RuntimeError) }
end
context "if no greeting line" do
let(:transport) { double(TCPTransport, connect: nil, read: "") }
it { expect{subject.connect(hostname)}.to raise_error(RuntimeError) }
end
end
context "#write" do
let(:action_id) { 42 }
let(:parser) { double(AmiParser, assemble: bytes) }
let(:packet) do
packet = double(Packet)
allow(packet).to receive(:[]).with("ActionID").and_return(action_id)
packet
end
context "parser" do
after { subject.write(packet) }
it { expect(parser).to receive(:assemble).with(packet) }
end
context "transport" do
after { subject.write(packet) }
it { expect(transport).to receive(:write).with(bytes) }
end
end
context "#read" do
let(:parser) { double(AmiParser, parse: [event]) }
subject { Protocol.new(transport: transport, parser: parser) }
context "from transport" do
let(:parser) { double(AmiParser, parse: []) }
after { subject.read }
context "read data" do
it { expect(transport).to receive(:read) }
end
context "parse data returned" do
let(:read_data) { 'asdf' }
let(:transport) { transport = double(TCPTransport, read: read_data, :connected? => true) }
it { expect(parser).to receive(:parse).with(read_data) }
end
end
context "set transport to DisconnectedTransport if transport.connected?" do
let(:event) { double(Event, event?: false) }
let(:transport) { double(TCPTransport, :connected? => false, read: "") }
let(:disconnectedTransport) { double(DisconnectedTransport) }
before do
allow(DisconnectedTransport).to receive(:new).and_return(disconnectedTransport)
allow(disconnectedTransport).to receive(:read).and_raise(RuntimeError)
end
it { expect(transport).to receive(:connected?); subject.read }
it { expect(DisconnectedTransport).to receive(:new).and_return(disconnectedTransport); subject.read }
it { expect{ subject.read; subject.read }.to raise_error(RuntimeError) }
end
context "invoke listeners" do
after { subject.read }
context "for event listener" do
let(:event) { double(Event, event?: true) }
it "event listener fired if event packet" do
listener_fired = false
subject.add_event_listener { listener_fired = true }
subject.read
expect(listener_fired).to be true
end
it "no listener fired if response packet" do
allow(event).to receive(:event?).and_return(false)
listener_fired = false
subject.add_event_listener { listener_fired = true }
subject.read
expect(listener_fired).to be false
end
end
context "for response listener" do
let(:event) { double(Event, event?: false) }
it "response listener fired if event response" do
listener_fired = false
subject.add_response_listener { listener_fired = true }
subject.read
expect(listener_fired).to be true
end
it "no listener fired if event packet" do
allow(event).to receive(:event?).and_return(true)
listener_fired = false
subject.add_event_listener { listener_fired = true }
subject.read
expect(listener_fired).to be true
end
end
end
end
end
end
end
| dennis/obelix | spec/obelix/ami/protocol_spec.rb | Ruby | mit | 4,767 | [
30522,
5478,
1005,
28699,
1035,
2393,
2121,
1005,
11336,
15578,
3669,
2595,
11336,
26445,
6235,
8778,
2079,
2292,
1006,
1024,
3191,
1035,
2951,
1007,
1063,
1000,
2951,
1000,
1065,
2292,
1006,
1024,
3665,
1007,
2079,
3665,
1027,
3313,
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.jdon.annotation;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Domain Model should normal live in memory not in database. so cache in memory
* is very important for domain model life cycle.
*
*
* @see com.jdon.controller.model.ModelIF
* @author banQ
*
*/
@Target(TYPE)
@Retention(RUNTIME)
@Documented
public @interface Model {
/**
* disable from version 6.5
*
* @return
*/
boolean isCacheable() default true;
/**
* disable from version 6.5
*
* @return
*/
boolean isModified() default false;
}
| linqingyicen/jdonframework | src/main/java/com/jdon/annotation/Model.java | Java | apache-2.0 | 768 | [
30522,
7427,
4012,
1012,
26219,
2239,
1012,
5754,
17287,
3508,
1025,
12324,
10763,
9262,
1012,
11374,
1012,
5754,
17287,
3508,
1012,
5783,
13874,
1012,
2828,
1025,
12324,
10763,
9262,
1012,
11374,
1012,
5754,
17287,
3508,
1012,
20125,
18155,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 Wandu\Http\Parameters;
use Mockery;
use PHPUnit\Framework\TestCase;
use Wandu\Http\Exception\CannotCallMethodException;
class ParameterTest extends TestCase
{
/** @var array */
protected $param1Attributes = [
'string' => 'string!',
'number' => '10',
'array' => [
'null' => null,
'empty' => '',
'false' => false,
],
'array_of_array' => [
[
'string' => 'string!',
'number' => '10',
],
[
'string' => 'string!!',
'number' => '11',
],
[
'string' => 'string!!!',
'number' => '12',
],
],
];
/** @var array */
protected $param2Attributes = [
'null' => null,
'empty' => '',
'false' => false,
];
/** @var array */
protected $param3Attributes = [
'string1' => 'string 1!',
'string2' => 'string 2!',
];
/** @var array */
protected $param3FallbackAttributes = [
'string1' => 'string 1 fallback!',
'fallback' => 'fallback!',
];
/** @var \Wandu\Http\Contracts\ParameterInterface */
protected $param1;
/** @var \Wandu\Http\Contracts\ParameterInterface */
protected $param2;
/** @var \Wandu\Http\Contracts\ParameterInterface */
protected $param3;
public function setUp()
{
$this->param1 = new Parameter($this->param1Attributes);
$this->param2 = new Parameter($this->param2Attributes);
$this->param3 = new Parameter($this->param3Attributes, new Parameter($this->param3FallbackAttributes));
}
public function tearDown()
{
Mockery::close();
}
public function testGet()
{
static::assertSame('string!', $this->param1->get('string'));
static::assertSame('10', $this->param1->get('number'));
static::assertNull($this->param1->get('string.undefined'));
static::assertNull($this->param1->get('number.undefined'));
}
public function testGetNull()
{
// not strict
static::assertEquals("Other Value!!", $this->param2->get('undefined', "Other Value!!"));
static::assertEquals("Other Value!!", $this->param2->get('null', "Other Value!!"));
static::assertEquals("Other Value!!", $this->param2->get('empty', "Other Value!!"));
static::assertEquals("Other Value!!", $this->param2->get('false', "Other Value!!"));
// strict
static::assertEquals("Other Value!!", $this->param2->get('undefined', "Other Value!!", true));
static::assertEquals("Other Value!!", $this->param2->get('null', "Other Value!!", true));
static::assertEquals("", $this->param2->get('empty', "Other Value!!", true));
static::assertEquals(false, $this->param2->get('false', "Other Value!!", true));
}
public function testHas()
{
$params = $this->param1;
static::assertTrue($params->has('string'));
static::assertTrue($params->has('number'));
static::assertFalse($params->has('string.undefined'));
static::assertFalse($params->has('number.undefined'));
}
public function testHasNull()
{
static::assertFalse($this->param2->has('undefined'));
static::assertFalse($this->param2->has('null'));
static::assertTrue($this->param2->has('empty'));
static::assertTrue($this->param2->has('false'));
}
public function testToArray()
{
static::assertSame([
'null' => null,
'empty' => '',
'false' => false,
], $this->param2->toArray());
}
public function testToArrayWithFallback()
{
static::assertSame([
'string1' => 'string 1!',
'string2' => 'string 2!',
'fallback' => 'fallback!',
], $this->param3->toArray());
}
public function testGetWithDefault()
{
$params = $this->param1;
static::assertSame("default", $params->get('string.undefined', "default"));
static::assertSame("default", $params->get('number.undefined', "default"));
}
public function testFallback()
{
$params = $this->param3;
static::assertSame("string 1!", $params->get('string1'));
static::assertSame("string 2!", $params->get('string2'));
static::assertSame("fallback!", $params->get('fallback'));
static::assertSame(null, $params->get('undefined'));
static::assertSame("string 1!", $params->get('string1', "default"));
static::assertSame("string 2!", $params->get('string2', "default"));
static::assertSame("fallback!", $params->get('fallback', "default"));
static::assertSame("default", $params->get('undefined', "default"));
}
public function testHasWithFallback()
{
$params = $this->param3;
static::assertTrue($params->has('string1'));
static::assertTrue($params->has('string2'));
static::assertTrue($params->has('fallback'));
static::assertFalse($params->has('undefined'));
}
public function testGetMany()
{
$params = $this->param1;
static::assertSame(
[
'string' => 'string!',
'number' => '10'
],
$params->getMany(['string', 'number'])
);
static::assertSame(
[
'string' => 'string!',
],
$params->getMany(['string'])
);
static::assertSame(
[
'string' => 'string!',
'unknown' => null,
],
$params->getMany(['string', 'unknown'])
);
static::assertSame(
[
'string' => 'string!',
'unknown' => null,
],
$params->getMany(['string', 'unknown' => null])
);
static::assertSame(
[
'string' => 'string!',
'unknown' => false,
],
$params->getMany(['string' => false, 'unknown' => false])
);
}
public function testGetManyWithNull()
{
$params = $this->param2;
static::assertSame(
[
'undefined' => null,
'null' => null,
'false' => null,
'empty' => null,
],
$params->getMany(['undefined', 'null', 'false', 'empty'])
);
static::assertSame(
[
'undefined' => null,
'null' => null,
'false' => false,
'empty' => '',
],
$params->getMany(['undefined', 'null', 'false', 'empty'], true)
);
}
public function testArrayAccessOffsetGet()
{
static::assertSame($this->param1->get('string'), $this->param1['string']);
static::assertSame($this->param1->get('unknown'), $this->param1['unknown']);
static::assertSame($this->param1->get('unknown', 'default'), $this->param1['unknown||default']);
static::assertSame('string!', $this->param1['string']);
static::assertSame(null, $this->param1['unknown']);
static::assertSame('default', $this->param1['unknown||default']);
}
public function testArrayAccessOffsetExists()
{
static::assertSame($this->param1->has('string'), isset($this->param1['string']));
static::assertSame($this->param1->has('unknown'), isset($this->param1['unknown']));
static::assertTrue(isset($this->param1['string']));
static::assertFalse(isset($this->param1['unknown']));
}
public function testArrayAccessOffsetSet()
{
try {
$this->param1['string'] = 'string?';
static::fail();
} catch (CannotCallMethodException $e) {
static::assertEquals('offsetSet', $e->getMethodName());
}
}
public function testArrayAccessOffsetUnset()
{
try {
unset($this->param1['string']);
static::fail();
} catch (CannotCallMethodException $e) {
static::assertEquals('offsetUnset', $e->getMethodName());
}
}
public function testGetIterator()
{
static::assertSame([
'string',
'number',
'array',
'array_of_array',
], array_keys(iterator_to_array($this->param1)));
static::assertSame([
'string!',
'10',
[
'null' => null,
'empty' => '',
'false' => false,
],
[
[
'string' => 'string!',
'number' => '10',
],
[
'string' => 'string!!',
'number' => '11',
],
[
'string' => 'string!!!',
'number' => '12',
],
],
], array_values(iterator_to_array($this->param1)));
// with fallback
static::assertSame([
'string1',
'string2',
'fallback',
], array_keys(iterator_to_array($this->param3)));
static::assertSame([
'string 1!',
'string 2!',
'fallback!',
], array_values(iterator_to_array($this->param3)));
}
public function testGetWithDotSyntax()
{
static::assertSame([
'null' => null,
'empty' => '',
'false' => false,
], $this->param1->get('array'));
// not strict
static::assertEquals("Other Value!!", $this->param1->get('array.undefined', "Other Value!!"));
static::assertEquals("Other Value!!", $this->param1->get('array.null', "Other Value!!"));
static::assertEquals("Other Value!!", $this->param1->get('array.empty', "Other Value!!"));
static::assertEquals("Other Value!!", $this->param1->get('array.false', "Other Value!!"));
// strict
static::assertEquals("Other Value!!", $this->param1->get('array.undefined', "Other Value!!", true));
static::assertEquals("Other Value!!", $this->param1->get('array.null', "Other Value!!", true));
static::assertEquals("", $this->param1->get('array.empty', "Other Value!!", true));
static::assertEquals(false, $this->param1->get('array.false', "Other Value!!", true));
}
public function testHasWithDotSyntax()
{
static::assertTrue($this->param1->has('array'));
static::assertFalse($this->param1->has('array.undefined'));
static::assertFalse($this->param1->has('array.null'));
static::assertTrue($this->param1->has('array.empty'));
static::assertTrue($this->param1->has('array.false'));
}
}
| Wandu/Framework | tests/Http/Parameters/ParameterTest.php | PHP | mit | 10,968 | [
30522,
1026,
1029,
25718,
3415,
15327,
23967,
2226,
1032,
8299,
1032,
11709,
1025,
2224,
12934,
7301,
1025,
2224,
25718,
19496,
2102,
1032,
7705,
1032,
3231,
18382,
1025,
2224,
23967,
2226,
1032,
8299,
1032,
6453,
1032,
3685,
9289,
13728,
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 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>IndieLib - Crossplatform: IND_Frame Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="indielib_logo.png"/></td>
<td style="padding-left: 0.5em;">
<div id="projectname">IndieLib - Crossplatform
</div>
<div id="projectbrief">C++ 2.5d graphics library based in DirectX and OpenGL</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Groups</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">IND_Frame Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Contains data of a frame in an <a class="el" href="class_i_n_d___animation.html" title="IND_Animation objects are loaded trough the methods of IND_AnimationManager.">IND_Animation</a> entity.
<a href="class_i_n_d___frame.html#details">More...</a></p>
<p><code>#include <<a class="el" href="_i_n_d___frame_8h_source.html">IND_Frame.h</a>></code></p>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Contains data of a frame in an <a class="el" href="class_i_n_d___animation.html" title="IND_Animation objects are loaded trough the methods of IND_AnimationManager.">IND_Animation</a> entity. </p>
<p>Mainly is for private use in <a class="el" href="class_i_n_d___animation.html" title="IND_Animation objects are loaded trough the methods of IND_AnimationManager.">IND_Animation</a> objects. </p>
</div><hr/>The documentation for this class was generated from the following file:<ul>
<li>/Users/mquinones/Desktop/SOFTWARE DEV/PROJECTS/indielib-gitrepo/IndieLib/common/include/<a class="el" href="_i_n_d___frame_8h_source.html">IND_Frame.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Feb 6 2013 21:40:21 for IndieLib - Crossplatform by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>
</body>
</html>
| AdamPayne/TeamRocketGame | MyGame/Tutorials/docs/Doxygen/html/class_i_n_d___frame.html | HTML | lgpl-3.0 | 5,988 | [
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... |
#! /bin/bash
function die()
{
echo $* 2>&1
exit 1
}
if test -n "$FDUSER" ; then
echo "Using freedesktop.org account $FDUSER"
user="$FDUSER@"
else
echo "Using freedesktop.org account from ~/.ssh/config, or local username"
fi
CHECKOUTDIR=`mktemp -d || echo /tmp/dbus-for-docs`
export CVSROOT=":ext:${user}cvs.freedesktop.org:/cvs/dbus"
cd $CHECKOUTDIR || die "could not changedir to $CHECKOUTDIR"
echo "Checking out to directory "`pwd`
/bin/rm -rf dbus/doc || true ## get rid of old doxygen, etc.
cvs co dbus || die "failed to cvs update"
cd dbus || die "could not cd to dbus"
echo "Configuring and building docs"
## the configure flags are explicit so if you lack xmlto, etc.
## you won't fail to update those docs
./autogen.sh --enable-xml-docs=yes --enable-doxygen-docs=yes || die "could not autogen"
doxygen Doxyfile || die "could not run Doxygen"
make -C doc || die "could not build docs"
MANFILES=`find -name "dbus*.1"`
for M in $MANFILES ; do
BASENAME=`basename $M`
echo "Converting $M to $BASENAME.html"
man2html $M > doc/$BASENAME.html
done
echo "Packing docs into tarball"
cp README HACKING AUTHORS NEWS COPYING ChangeLog doc/ || die "could not copy in assorted files"
tar cfz dbus-docs.tar.gz doc/*.dtd doc/*.xsl doc/*.xml doc/*.html doc/*.txt doc/api/html/*.html doc/api/html/*.css doc/api/html/*.png doc/api/html/*.gif doc/HACKING doc/AUTHORS doc/NEWS doc/ChangeLog doc/TODO doc/README doc/COPYING doc/*.png doc/*.svg || die "could not tar up docs"
tar tfz dbus-docs.tar.gz | sort > tarball.list || die "could not list tarball contents"
find doc -not -type d | grep -v CVS | grep -v -E '.~[0-9.]+~' | grep -v Makefile | grep -vE '.c$' | grep -v man3dbus | grep -v .cvsignore | sort > filesystem.list || die "could not list doc/* contents"
diff -u filesystem.list tarball.list || die "some files were not included"
echo "Uploading docs to server"
scp dbus-docs.tar.gz "${user}"dbus.freedesktop.org:
ssh "${user}"dbus.freedesktop.org '(cd /srv/dbus.freedesktop.org/www/ && /bin/cp -f ~/dbus-docs.tar.gz . && tar zxf dbus-docs.tar.gz && echo "Successfully unpacked tarball on server")'
echo "Uploading DTD to server"
scp -p doc/introspect.dtd "${user}"dbus.freedesktop.org:/srv/specifications.freedesktop.org/www/dbus/1.0/introspect.dtd
| rex-xxx/mt6572_x201 | external/dbus/update-dbus-docs.sh | Shell | gpl-2.0 | 2,292 | [
30522,
1001,
999,
1013,
8026,
1013,
24234,
3853,
3280,
1006,
1007,
1063,
9052,
1002,
1008,
1016,
1028,
1004,
1015,
6164,
1015,
1065,
2065,
3231,
1011,
1050,
1000,
1002,
1042,
17619,
2121,
1000,
1025,
2059,
9052,
1000,
2478,
10650,
2229,
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 (c) 2012. HappyDroids LLC, All rights reserved.
*/
package com.happydroids.droidtowers.achievements;
public enum RequirementType {
POPULATION,
EMPLOYMENT,
DESIRABILITY,
BUILD,
HIRE,
UNLOCK,
HAPPYDROIDS_CONNECT,
ADD_NEIGHBOR
}
| 0x90sled/droidtowers | main/source/com/happydroids/droidtowers/achievements/RequirementType.java | Java | mit | 261 | [
30522,
1013,
1008,
1008,
9385,
1006,
1039,
1007,
2262,
1012,
3407,
22196,
9821,
11775,
1010,
2035,
2916,
9235,
1012,
1008,
1013,
7427,
4012,
1012,
3407,
22196,
9821,
1012,
2852,
9314,
23196,
2015,
1012,
10106,
1025,
2270,
4372,
2819,
9095,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 TOOLS_ARCH_XTENSA_UAPI_ASM_MMAN_FIX_H
#define TOOLS_ARCH_XTENSA_UAPI_ASM_MMAN_FIX_H
#define MADV_DODUMP 17
#define MADV_DOFORK 11
#define MADV_DONTDUMP 16
#define MADV_DONTFORK 10
#define MADV_DONTNEED 4
#define MADV_FREE 8
#define MADV_HUGEPAGE 14
#define MADV_MERGEABLE 12
#define MADV_NOHUGEPAGE 15
#define MADV_NORMAL 0
#define MADV_RANDOM 1
#define MADV_REMOVE 9
#define MADV_SEQUENTIAL 2
#define MADV_UNMERGEABLE 13
#define MADV_WILLNEED 3
#define MAP_ANONYMOUS 0x0800
#define MAP_DENYWRITE 0x2000
#define MAP_EXECUTABLE 0x4000
#define MAP_FILE 0
#define MAP_FIXED 0x010
#define MAP_GROWSDOWN 0x1000
#define MAP_HUGETLB 0x80000
#define MAP_LOCKED 0x8000
#define MAP_NONBLOCK 0x20000
#define MAP_NORESERVE 0x0400
#define MAP_POPULATE 0x10000
#define MAP_PRIVATE 0x002
#define MAP_SHARED 0x001
#define MAP_STACK 0x40000
#define PROT_EXEC 0x4
#define PROT_GROWSDOWN 0x01000000
#define PROT_GROWSUP 0x02000000
#define PROT_NONE 0x0
#define PROT_READ 0x1
#define PROT_SEM 0x10
#define PROT_WRITE 0x2
/* MADV_HWPOISON is undefined on xtensa, fix it for perf */
#define MADV_HWPOISON 100
/* MADV_SOFT_OFFLINE is undefined on xtensa, fix it for perf */
#define MADV_SOFT_OFFLINE 101
/* MAP_32BIT is undefined on xtensa, fix it for perf */
#define MAP_32BIT 0
/* MAP_UNINITIALIZED is undefined on xtensa, fix it for perf */
#define MAP_UNINITIALIZED 0
#endif
| axxia/axxia_yocto_linux_4.1_pull | tools/arch/xtensa/include/uapi/asm/mman.h | C | gpl-2.0 | 1,368 | [
30522,
1001,
2065,
13629,
2546,
5906,
1035,
7905,
1035,
1060,
25808,
2050,
1035,
25423,
8197,
1035,
2004,
2213,
1035,
21021,
2078,
1035,
8081,
1035,
1044,
1001,
9375,
5906,
1035,
7905,
1035,
1060,
25808,
2050,
1035,
25423,
8197,
1035,
2004,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
/**
* JBoss, Home of Professional Open Source.
* Copyright 2014-2020 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* 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 org.jboss.pnc.indyrepositorymanager;
import org.jboss.pnc.indyrepositorymanager.fixture.TestBuildExecution;
import org.jboss.pnc.enums.RepositoryType;
import org.jboss.pnc.spi.repositorymanager.BuildExecution;
import org.jboss.pnc.spi.repositorymanager.model.RepositoryConnectionInfo;
import org.jboss.pnc.spi.repositorymanager.model.RepositorySession;
import org.jboss.pnc.test.category.ContainerTest;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import java.util.Collections;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.MatcherAssert.assertThat;
@Category(ContainerTest.class)
public class AllSessionUrlsForBuildAreAlikeTest extends AbstractRepositoryManagerDriverTest {
@Test
public void formatRepositoryURLForSimpleInfo_AllURLsMatch() throws Exception {
// create a dummy non-chained build execution and a repo session based on it
BuildExecution execution = new TestBuildExecution();
RepositorySession repositoryConfiguration = driver.createBuildRepository(
execution,
accessToken,
accessToken,
RepositoryType.MAVEN,
Collections.emptyMap(),
false);
assertThat(repositoryConfiguration, notNullValue());
RepositoryConnectionInfo connectionInfo = repositoryConfiguration.getConnectionInfo();
assertThat(connectionInfo, notNullValue());
// check that all URLs in the connection info are the same (this might be different in another repo driver)
String expectedUrl = connectionInfo.getDependencyUrl();
assertThat(connectionInfo.getToolchainUrl(), equalTo(expectedUrl));
// assertThat(connectionInfo.getDeployPath(), equalTo(expectedUrl));
}
}
| thescouser89/pnc | indy-repository-manager/src/test/java/org/jboss/pnc/indyrepositorymanager/AllSessionUrlsForBuildAreAlikeTest.java | Java | apache-2.0 | 2,572 | [
30522,
1013,
1008,
1008,
1008,
1046,
15853,
2015,
1010,
2188,
1997,
2658,
2330,
3120,
1012,
1008,
9385,
2297,
1011,
12609,
2417,
6045,
1010,
4297,
1012,
1010,
1998,
3265,
16884,
1008,
2004,
5393,
2011,
1996,
1030,
3166,
22073,
1012,
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... |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="pt">
<head>
<!-- Generated by javadoc (version 1.7.0_09) on Mon Sep 16 13:13:38 BRT 2013 -->
<title>Uses of Class com.robsonmartins.acaas.t2libras.bean.PalavraSearch</title>
<meta name="date" content="2013-09-16">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class com.robsonmartins.acaas.t2libras.bean.PalavraSearch";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../com/robsonmartins/acaas/t2libras/bean/PalavraSearch.html" title="class in com.robsonmartins.acaas.t2libras.bean">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?com/robsonmartins/acaas/t2libras/bean/class-use/PalavraSearch.html" target="_top">Frames</a></li>
<li><a href="PalavraSearch.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class com.robsonmartins.acaas.t2libras.bean.PalavraSearch" class="title">Uses of Class<br>com.robsonmartins.acaas.t2libras.bean.PalavraSearch</h2>
</div>
<div class="classUseContainer">No usage of com.robsonmartins.acaas.t2libras.bean.PalavraSearch</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../com/robsonmartins/acaas/t2libras/bean/PalavraSearch.html" title="class in com.robsonmartins.acaas.t2libras.bean">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?com/robsonmartins/acaas/t2libras/bean/class-use/PalavraSearch.html" target="_top">Frames</a></li>
<li><a href="PalavraSearch.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| robsonsmartins/acaas | source/acaas.jboss7/AcaaSweb/WebContent/doc/java/com/robsonmartins/acaas/t2libras/bean/class-use/PalavraSearch.html | HTML | gpl-3.0 | 4,466 | [
30522,
1026,
999,
9986,
13874,
16129,
2270,
1000,
1011,
1013,
1013,
1059,
2509,
2278,
1013,
1013,
26718,
2094,
16129,
1018,
1012,
5890,
17459,
1013,
1013,
4372,
1000,
1000,
8299,
1024,
1013,
1013,
7479,
1012,
1059,
2509,
1012,
8917,
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) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
#nullable disable
namespace StyleCop.Analyzers.OrderingRules
{
using System;
using System.Collections.Immutable;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using StyleCop.Analyzers.Helpers;
using StyleCop.Analyzers.Settings.ObjectModel;
/// <summary>
/// A constant field is placed beneath a non-constant field.
/// </summary>
/// <remarks>
/// <para>A violation of this rule occurs when a constant field is placed beneath a non-constant field. Constants
/// should be placed above fields to indicate that the two are fundamentally different types of elements with
/// different considerations for the compiler, different naming requirements, etc.</para>
/// </remarks>
[DiagnosticAnalyzer(LanguageNames.CSharp)]
internal class SA1203ConstantsMustAppearBeforeFields : DiagnosticAnalyzer
{
/// <summary>
/// The ID for diagnostics produced by the <see cref="SA1203ConstantsMustAppearBeforeFields"/> analyzer.
/// </summary>
public const string DiagnosticId = "SA1203";
private const string HelpLink = "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1203.md";
private static readonly LocalizableString Title = new LocalizableResourceString(nameof(OrderingResources.SA1203Title), OrderingResources.ResourceManager, typeof(OrderingResources));
private static readonly LocalizableString MessageFormat = new LocalizableResourceString(nameof(OrderingResources.SA1203MessageFormat), OrderingResources.ResourceManager, typeof(OrderingResources));
private static readonly LocalizableString Description = new LocalizableResourceString(nameof(OrderingResources.SA1203Description), OrderingResources.ResourceManager, typeof(OrderingResources));
private static readonly DiagnosticDescriptor Descriptor =
new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, AnalyzerCategory.OrderingRules, DiagnosticSeverity.Warning, AnalyzerConstants.EnabledByDefault, Description, HelpLink);
private static readonly ImmutableArray<SyntaxKind> TypeDeclarationKinds =
ImmutableArray.Create(SyntaxKind.ClassDeclaration, SyntaxKind.StructDeclaration);
private static readonly Action<SyntaxNodeAnalysisContext, StyleCopSettings> TypeDeclarationAction = HandleTypeDeclaration;
/// <inheritdoc/>
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } =
ImmutableArray.Create(Descriptor);
/// <inheritdoc/>
public override void Initialize(AnalysisContext context)
{
context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.None);
context.EnableConcurrentExecution();
context.RegisterSyntaxNodeAction(TypeDeclarationAction, TypeDeclarationKinds);
}
private static void HandleTypeDeclaration(SyntaxNodeAnalysisContext context, StyleCopSettings settings)
{
var elementOrder = settings.OrderingRules.ElementOrder;
int constantIndex = elementOrder.IndexOf(OrderingTrait.Constant);
if (constantIndex < 0)
{
return;
}
var typeDeclaration = (TypeDeclarationSyntax)context.Node;
var members = typeDeclaration.Members;
var previousFieldConstant = true;
var previousFieldStatic = false;
var previousFieldReadonly = false;
var previousAccessLevel = AccessLevel.NotSpecified;
foreach (var member in members)
{
if (!(member is FieldDeclarationSyntax field))
{
continue;
}
AccessLevel currentAccessLevel = MemberOrderHelper.GetAccessLevelForOrdering(field, field.Modifiers);
bool currentFieldConstant = field.Modifiers.Any(SyntaxKind.ConstKeyword);
bool currentFieldReadonly = currentFieldConstant || field.Modifiers.Any(SyntaxKind.ReadOnlyKeyword);
bool currentFieldStatic = currentFieldConstant || field.Modifiers.Any(SyntaxKind.StaticKeyword);
bool compareConst = true;
for (int j = 0; compareConst && j < constantIndex; j++)
{
switch (elementOrder[j])
{
case OrderingTrait.Accessibility:
if (currentAccessLevel != previousAccessLevel)
{
compareConst = false;
}
continue;
case OrderingTrait.Readonly:
if (currentFieldReadonly != previousFieldReadonly)
{
compareConst = false;
}
continue;
case OrderingTrait.Static:
if (currentFieldStatic != previousFieldStatic)
{
compareConst = false;
}
continue;
case OrderingTrait.Kind:
// Only fields may be marked const, and all fields have the same kind.
continue;
case OrderingTrait.Constant:
default:
continue;
}
}
if (compareConst)
{
if (!previousFieldConstant && currentFieldConstant)
{
context.ReportDiagnostic(Diagnostic.Create(Descriptor, NamedTypeHelpers.GetNameOrIdentifierLocation(member)));
}
}
previousFieldConstant = currentFieldConstant;
previousFieldReadonly = currentFieldReadonly;
previousFieldStatic = currentFieldStatic;
previousAccessLevel = currentAccessLevel;
}
}
}
}
| DotNetAnalyzers/StyleCopAnalyzers | StyleCop.Analyzers/StyleCop.Analyzers/OrderingRules/SA1203ConstantsMustAppearBeforeFields.cs | C# | mit | 6,370 | [
30522,
1013,
1013,
9385,
1006,
1039,
1007,
5234,
4432,
12030,
1010,
11775,
1012,
2035,
2916,
9235,
1012,
1013,
1013,
7000,
2104,
1996,
10210,
6105,
1012,
2156,
6105,
1999,
1996,
2622,
7117,
2005,
6105,
2592,
1012,
1001,
19701,
3085,
4487,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
//<<<<<extract,9,3,11,3,FOO,fail
package main
import "fmt"
func main() {
i := 0
for i <= 5 {
if i == 3 {
break
}
fmt.Println(i)
i++
}
fmt.Println("after loop")
}
| godoctor/godoctor | refactoring/testdata/extractfunc/071-test012/main.go | GO | bsd-3-clause | 179 | [
30522,
1013,
1013,
1026,
1026,
1026,
1026,
1026,
14817,
1010,
1023,
1010,
1017,
1010,
2340,
1010,
1017,
1010,
29379,
1010,
8246,
7427,
2364,
12324,
1000,
4718,
2102,
1000,
4569,
2278,
2364,
1006,
1007,
1063,
1045,
1024,
1027,
1014,
2005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
/*
* linux/arch/arm/kernel/smp.c
*
* Copyright (C) 2002 ARM Limited, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/cache.h>
#include <linux/profile.h>
#include <linux/errno.h>
#include <linux/mm.h>
#include <linux/err.h>
#include <linux/cpu.h>
#include <linux/smp.h>
#include <linux/seq_file.h>
#include <linux/irq.h>
#include <linux/percpu.h>
#include <linux/clockchips.h>
#include <linux/completion.h>
#include <asm/atomic.h>
#include <asm/cacheflush.h>
#include <asm/cpu.h>
#include <asm/cputype.h>
#include <asm/exception.h>
#include <asm/topology.h>
#include <asm/mmu_context.h>
#include <asm/pgtable.h>
#include <asm/pgalloc.h>
#include <asm/processor.h>
#include <asm/sections.h>
#include <asm/tlbflush.h>
#include <asm/ptrace.h>
#include <asm/localtimer.h>
#include <asm/smp_plat.h>
#include <mach/sec_debug.h> /* onlyjazz */
/*
* as from 2.5, kernels no longer have an init_tasks structure
* so we need some other way of telling a new secondary core
* where to place its SVC stack
*/
struct secondary_data secondary_data;
enum ipi_msg_type {
IPI_CPU_START = 1,
IPI_TIMER = 2,
IPI_RESCHEDULE,
IPI_CALL_FUNC,
IPI_CALL_FUNC_SINGLE,
IPI_CPU_STOP,
IPI_CPU_BACKTRACE,
};
static DECLARE_COMPLETION(cpu_running);
int __cpuinit __cpu_up(unsigned int cpu)
{
struct cpuinfo_arm *ci = &per_cpu(cpu_data, cpu);
struct task_struct *idle = ci->idle;
pgd_t *pgd;
int ret;
/*
* Spawn a new process manually, if not already done.
* Grab a pointer to its task struct so we can mess with it
*/
if (!idle) {
idle = fork_idle(cpu);
if (IS_ERR(idle)) {
printk(KERN_ERR "CPU%u: fork() failed\n", cpu);
return PTR_ERR(idle);
}
ci->idle = idle;
} else {
/*
* Since this idle thread is being re-used, call
* init_idle() to reinitialize the thread structure.
*/
init_idle(idle, cpu);
}
/*
* Allocate initial page tables to allow the new CPU to
* enable the MMU safely. This essentially means a set
* of our "standard" page tables, with the addition of
* a 1:1 mapping for the physical address of the kernel.
*/
pgd = pgd_alloc(&init_mm);
if (!pgd)
return -ENOMEM;
if (PHYS_OFFSET != PAGE_OFFSET) {
#ifndef CONFIG_HOTPLUG_CPU
identity_mapping_add(pgd, __pa(__init_begin), __pa(__init_end));
#endif
identity_mapping_add(pgd, __pa(_stext), __pa(_etext));
identity_mapping_add(pgd, __pa(_sdata), __pa(_edata));
}
/*
* We need to tell the secondary core where to find
* its stack and the page tables.
*/
secondary_data.stack = task_stack_page(idle) + THREAD_START_SP;
secondary_data.pgdir = virt_to_phys(pgd);
secondary_data.swapper_pg_dir = virt_to_phys(swapper_pg_dir);
__cpuc_flush_dcache_area(&secondary_data, sizeof(secondary_data));
outer_clean_range(__pa(&secondary_data), __pa(&secondary_data + 1));
/*
* Now bring the CPU into our world.
*/
ret = boot_secondary(cpu, idle);
if (ret == 0) {
/*
* CPU was successfully started, wait for it
* to come online or time out.
*/
wait_for_completion_timeout(&cpu_running,
msecs_to_jiffies(1000));
if (!cpu_online(cpu)) {
pr_crit("CPU%u: failed to come online\n", cpu);
ret = -EIO;
}
} else {
pr_err("CPU%u: failed to boot: %d\n", cpu, ret);
}
secondary_data.stack = NULL;
secondary_data.pgdir = 0;
if (PHYS_OFFSET != PAGE_OFFSET) {
#ifndef CONFIG_HOTPLUG_CPU
identity_mapping_del(pgd, __pa(__init_begin), __pa(__init_end));
#endif
identity_mapping_del(pgd, __pa(_stext), __pa(_etext));
identity_mapping_del(pgd, __pa(_sdata), __pa(_edata));
}
pgd_free(&init_mm, pgd);
return ret;
}
#ifdef CONFIG_HOTPLUG_CPU
static void percpu_timer_stop(void);
/*
* __cpu_disable runs on the processor to be shutdown.
*/
int __cpu_disable(void)
{
unsigned int cpu = smp_processor_id();
struct task_struct *p;
int ret;
ret = platform_cpu_disable(cpu);
if (ret)
return ret;
/*
* Take this CPU offline. Once we clear this, we can't return,
* and we must not schedule until we're ready to give up the cpu.
*/
set_cpu_online(cpu, false);
/*
* OK - migrate IRQs away from this CPU
*/
migrate_irqs();
/*
* Stop the local timer for this CPU.
*/
percpu_timer_stop();
/*
* Flush user cache and TLB mappings, and then remove this CPU
* from the vm mask set of all processes.
*/
flush_cache_all();
local_flush_tlb_all();
read_lock(&tasklist_lock);
for_each_process(p) {
if (p->mm)
cpumask_clear_cpu(cpu, mm_cpumask(p->mm));
}
read_unlock(&tasklist_lock);
return 0;
}
static DECLARE_COMPLETION(cpu_died);
/*
* called on the thread which is asking for a CPU to be shutdown -
* waits until shutdown has completed, or it is timed out.
*/
void __cpu_die(unsigned int cpu)
{
if (!wait_for_completion_timeout(&cpu_died, msecs_to_jiffies(5000))) {
pr_err("CPU%u: cpu didn't die\n", cpu);
return;
}
pr_debug("CPU%u: shutdown\n", cpu);
if (!platform_cpu_kill(cpu))
printk("CPU%u: unable to kill\n", cpu);
}
/*
* Called from the idle thread for the CPU which has been shutdown.
*
* Note that we disable IRQs here, but do not re-enable them
* before returning to the caller. This is also the behaviour
* of the other hotplug-cpu capable cores, so presumably coming
* out of idle fixes this.
*/
void __ref cpu_die(void)
{
unsigned int cpu = smp_processor_id();
idle_task_exit();
local_irq_disable();
mb();
/* Tell __cpu_die() that this CPU is now safe to dispose of */
complete(&cpu_died);
/*
* actual CPU shutdown procedure is at least platform (if not
* CPU) specific.
*/
platform_cpu_die(cpu);
/*
* Do not return to the idle loop - jump back to the secondary
* cpu initialisation. There's some initialisation which needs
* to be repeated to undo the effects of taking the CPU offline.
*/
__asm__("mov sp, %0\n"
" mov fp, #0\n"
" b secondary_start_kernel"
:
: "r" (task_stack_page(current) + THREAD_SIZE - 8));
}
#endif /* CONFIG_HOTPLUG_CPU */
int __cpu_logical_map[NR_CPUS];
void __init smp_setup_processor_id(void)
{
int i;
u32 cpu = is_smp() ? read_cpuid_mpidr() & 0xff : 0;
cpu_logical_map(0) = cpu;
for (i = 1; i < NR_CPUS; ++i)
cpu_logical_map(i) = i == cpu ? 0 : i;
printk(KERN_INFO "Booting Linux on physical CPU %d\n", cpu);
}
/*
* Called by both boot and secondaries to move global data into
* per-processor storage.
*/
static void __cpuinit smp_store_cpu_info(unsigned int cpuid)
{
struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpuid);
cpu_info->loops_per_jiffy = loops_per_jiffy;
}
/*
* This is the secondary CPU boot entry. We're using this CPUs
* idle thread stack, but a set of temporary page tables.
*/
asmlinkage void __cpuinit secondary_start_kernel(void)
{
struct mm_struct *mm = &init_mm;
unsigned int cpu = smp_processor_id();
pr_debug("CPU%u: Booted secondary processor\n", cpu);
/*
* All kernel threads share the same mm context; grab a
* reference and switch to it.
*/
atomic_inc(&mm->mm_count);
current->active_mm = mm;
cpumask_set_cpu(cpu, mm_cpumask(mm));
cpu_switch_mm(mm->pgd, mm);
enter_lazy_tlb(mm, current);
local_flush_tlb_all();
cpu_init();
preempt_disable();
trace_hardirqs_off();
/*
* Give the platform a chance to do its own initialisation.
*/
platform_secondary_init(cpu);
notify_cpu_starting(cpu);
calibrate_delay();
smp_store_cpu_info(cpu);
/*
* OK, now it's safe to let the boot CPU continue. Wait for
* the CPU migration code to notice that the CPU is online
* before we continue - which happens after __cpu_up returns.
*/
set_cpu_online(cpu, true);
complete(&cpu_running);
/*
* Setup the percpu timer for this CPU.
*/
percpu_timer_setup();
local_irq_enable();
local_fiq_enable();
/*
* OK, it's off to the idle thread for us
*/
cpu_idle();
}
void __init smp_cpus_done(unsigned int max_cpus)
{
int cpu;
unsigned long bogosum = 0;
for_each_online_cpu(cpu)
bogosum += per_cpu(cpu_data, cpu).loops_per_jiffy;
printk(KERN_INFO "SMP: Total of %d processors activated "
"(%lu.%02lu BogoMIPS).\n",
num_online_cpus(),
bogosum / (500000/HZ),
(bogosum / (5000/HZ)) % 100);
}
void __init smp_prepare_boot_cpu(void)
{
unsigned int cpu = smp_processor_id();
per_cpu(cpu_data, cpu).idle = current;
}
void __init smp_prepare_cpus(unsigned int max_cpus)
{
unsigned int ncores = num_possible_cpus();
smp_store_cpu_info(smp_processor_id());
/*
* are we trying to boot more cores than exist?
*/
if (max_cpus > ncores)
max_cpus = ncores;
if (max_cpus > 1) {
/*
* Enable the local timer or broadcast device for the
* boot CPU, but only if we have more than one CPU.
*/
percpu_timer_setup();
/*
* Initialise the SCU if there are more than one CPU
* and let them know where to start.
*/
platform_smp_prepare_cpus(max_cpus);
}
}
static void (*smp_cross_call)(const struct cpumask *, unsigned int);
void __init set_smp_cross_call(void (*fn)(const struct cpumask *, unsigned int))
{
smp_cross_call = fn;
}
void arch_send_call_function_ipi_mask(const struct cpumask *mask)
{
smp_cross_call(mask, IPI_CALL_FUNC);
}
void arch_send_call_function_single_ipi(int cpu)
{
smp_cross_call(cpumask_of(cpu), IPI_CALL_FUNC_SINGLE);
}
static const char *ipi_types[NR_IPI] = {
#define S(x,s) [x - IPI_CPU_START] = s
S(IPI_CPU_START, "CPU start interrupts"),
S(IPI_TIMER, "Timer broadcast interrupts"),
S(IPI_RESCHEDULE, "Rescheduling interrupts"),
S(IPI_CALL_FUNC, "Function call interrupts"),
S(IPI_CALL_FUNC_SINGLE, "Single function call interrupts"),
S(IPI_CPU_STOP, "CPU stop interrupts"),
S(IPI_CPU_BACKTRACE, "CPU backtrace"),
};
void show_ipi_list(struct seq_file *p, int prec)
{
unsigned int cpu, i;
for (i = 0; i < NR_IPI; i++) {
seq_printf(p, "%*s%u: ", prec - 1, "IPI", i);
for_each_present_cpu(cpu)
seq_printf(p, "%10u ",
__get_irq_stat(cpu, ipi_irqs[i]));
seq_printf(p, " %s\n", ipi_types[i]);
}
}
u64 smp_irq_stat_cpu(unsigned int cpu)
{
u64 sum = 0;
int i;
for (i = 0; i < NR_IPI; i++)
sum += __get_irq_stat(cpu, ipi_irqs[i]);
return sum;
}
/*
* Timer (local or broadcast) support
*/
static DEFINE_PER_CPU(struct clock_event_device, percpu_clockevent);
static void ipi_timer(void)
{
struct clock_event_device *evt = &__get_cpu_var(percpu_clockevent);
irq_enter();
evt->event_handler(evt);
irq_exit();
}
#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
static void smp_timer_broadcast(const struct cpumask *mask)
{
smp_cross_call(mask, IPI_TIMER);
}
#else
#define smp_timer_broadcast NULL
#endif
static void broadcast_timer_set_mode(enum clock_event_mode mode,
struct clock_event_device *evt)
{
}
static void __cpuinit broadcast_timer_setup(struct clock_event_device *evt)
{
evt->name = "dummy_timer";
evt->features = CLOCK_EVT_FEAT_ONESHOT |
CLOCK_EVT_FEAT_PERIODIC |
CLOCK_EVT_FEAT_DUMMY;
evt->rating = 400;
evt->mult = 1;
evt->set_mode = broadcast_timer_set_mode;
clockevents_register_device(evt);
}
void __cpuinit percpu_timer_setup(void)
{
unsigned int cpu = smp_processor_id();
struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu);
evt->cpumask = cpumask_of(cpu);
evt->broadcast = smp_timer_broadcast;
if (local_timer_setup(evt))
broadcast_timer_setup(evt);
}
#ifdef CONFIG_HOTPLUG_CPU
/*
* The generic clock events code purposely does not stop the local timer
* on CPU_DEAD/CPU_DEAD_FROZEN hotplug events, so we have to do it
* manually here.
*/
static void percpu_timer_stop(void)
{
unsigned int cpu = smp_processor_id();
struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu);
local_timer_stop(evt);
}
#endif
static DEFINE_RAW_SPINLOCK(stop_lock);
/*
* ipi_cpu_stop - handle IPI from smp_send_stop()
*/
static void ipi_cpu_stop(unsigned int cpu)
{
if (system_state == SYSTEM_BOOTING ||
system_state == SYSTEM_RUNNING) {
raw_spin_lock(&stop_lock);
printk(KERN_CRIT "CPU%u: stopping\n", cpu);
dump_stack();
sec_debug_dump_stack();
raw_spin_unlock(&stop_lock);
}
set_cpu_online(cpu, false);
local_fiq_disable();
local_irq_disable();
while (1)
cpu_relax();
}
static cpumask_t backtrace_mask;
static DEFINE_RAW_SPINLOCK(backtrace_lock);
/* "in progress" flag of arch_trigger_all_cpu_backtrace */
static unsigned long backtrace_flag;
void smp_send_all_cpu_backtrace(void)
{
unsigned int this_cpu = smp_processor_id();
int i;
if (test_and_set_bit(0, &backtrace_flag))
/*
* If there is already a trigger_all_cpu_backtrace() in progress
* (backtrace_flag == 1), don't output double cpu dump infos.
*/
return;
cpumask_copy(&backtrace_mask, cpu_online_mask);
cpu_clear(this_cpu, backtrace_mask);
pr_info("Backtrace for cpu %d (current):\n", this_cpu);
dump_stack();
pr_info("\nsending IPI to all other CPUs:\n");
smp_cross_call(&backtrace_mask, IPI_CPU_BACKTRACE);
/* Wait for up to 10 seconds for all other CPUs to do the backtrace */
for (i = 0; i < 10 * 1000; i++) {
if (cpumask_empty(&backtrace_mask))
break;
mdelay(1);
}
clear_bit(0, &backtrace_flag);
smp_mb__after_clear_bit();
}
/*
* ipi_cpu_backtrace - handle IPI from smp_send_all_cpu_backtrace()
*/
static void ipi_cpu_backtrace(unsigned int cpu, struct pt_regs *regs)
{
if (cpu_isset(cpu, backtrace_mask)) {
raw_spin_lock(&backtrace_lock);
pr_warning("IPI backtrace for cpu %d\n", cpu);
show_regs(regs);
raw_spin_unlock(&backtrace_lock);
cpu_clear(cpu, backtrace_mask);
}
}
/*
* Main handler for inter-processor interrupts
*/
asmlinkage void __exception_irq_entry do_IPI(int ipinr, struct pt_regs *regs)
{
handle_IPI(ipinr, regs);
}
void handle_IPI(int ipinr, struct pt_regs *regs)
{
unsigned int cpu = smp_processor_id();
struct pt_regs *old_regs = set_irq_regs(regs);
if (ipinr >= IPI_CPU_START && ipinr < IPI_CPU_START + NR_IPI)
__inc_irq_stat(cpu, ipi_irqs[ipinr - IPI_CPU_START]);
switch (ipinr) {
case IPI_CPU_START:
/* Wake up from WFI/WFE using SGI */
break;
case IPI_TIMER:
ipi_timer();
break;
case IPI_RESCHEDULE:
scheduler_ipi();
break;
case IPI_CALL_FUNC:
generic_smp_call_function_interrupt();
break;
case IPI_CALL_FUNC_SINGLE:
generic_smp_call_function_single_interrupt();
break;
case IPI_CPU_STOP:
ipi_cpu_stop(cpu);
break;
case IPI_CPU_BACKTRACE:
irq_enter();
ipi_cpu_backtrace(cpu, regs);
irq_exit();
break;
default:
printk(KERN_CRIT "CPU%u: Unknown IPI message 0x%x\n",
cpu, ipinr);
break;
}
set_irq_regs(old_regs);
}
void smp_send_reschedule(int cpu)
{
if (unlikely(cpu_is_offline(cpu))) {
WARN_ON(1);
return;
}
smp_cross_call(cpumask_of(cpu), IPI_RESCHEDULE);
}
void smp_send_stop(void)
{
unsigned long timeout;
if (num_online_cpus() > 1) {
cpumask_t mask = cpu_online_map;
cpu_clear(smp_processor_id(), mask);
smp_cross_call(&mask, IPI_CPU_STOP);
}
/* Wait up to one second for other CPUs to stop */
timeout = USEC_PER_SEC;
while (num_online_cpus() > 1 && timeout--)
udelay(1);
if (num_online_cpus() > 1)
pr_warning("SMP: failed to stop secondary CPUs\n");
}
/*
* not supported here
*/
int setup_profiling_timer(unsigned int multiplier)
{
return -EINVAL;
}
| lovers-fancy/SC-05D_Kernel | arch/arm/kernel/smp.c | C | gpl-2.0 | 15,454 | [
30522,
1013,
1008,
1008,
11603,
1013,
7905,
1013,
2849,
1013,
16293,
1013,
15488,
2361,
1012,
1039,
1008,
1008,
9385,
1006,
1039,
30524,
2618,
2009,
1998,
1013,
2030,
19933,
1008,
2009,
2104,
1996,
3408,
1997,
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... |
<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* App\Entity$EditeurNatureSupport.
*
* @ORM\Table(name="editeurnaturesupport")
* @ORM\Entity(repositoryClass="App\Repository\EditeurNatureSupportRepository")
*/
class EditeurNatureSupport
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var Editeur
*
* @ORM\ManyToOne(
* targetEntity="App\Entity\Editeur",
* inversedBy="editeurNatureSupports"
* )
* @ORM\JoinColumn(nullable=false)
*/
private $editeur;
/**
* @var NatureSupport
*
* @ORM\ManyToOne(
* targetEntity="App\Entity\NatureSupport",
* inversedBy="editeurNatureSupports"
* )
* @ORM\JoinColumn(
* name="naturesupport_id",
* referencedColumnName="id",
* nullable=false
* )
*/
private $natureSupport;
/**
* @var Collection
*
* @ORM\ManyToMany(
* targetEntity="App\Entity\CategorieOeuvre",
* inversedBy="editeurNatureSupports"
* )
* @ORM\JoinTable(
* name="editeurnaturesupport_categorieoeuvre",
* joinColumns={
* @ORM\JoinColumn(
* name="editeurnaturesupport_id",
* referencedColumnName="id"
* )
* },
* inverseJoinColumns={
* @ORM\JoinColumn(
* name="categorieoeuvre_id",
* referencedColumnName="id"
* )
* }
* )
*/
private $categoriesOeuvres;
/**
* @var Collection
*
* @ORM\OneToMany(
* targetEntity="App\Entity\Support",
* mappedBy="editeurNatureSupport"
* )
*/
private $supports;
/**
* Constructeur.
*
* @param Editeur|null $editeur
* @param NatureSupport|null $natureSupport
*/
public function __construct(
Editeur $editeur = null,
NatureSupport $natureSupport = null
) {
$this->editeur = $editeur;
$this->natureSupport = $natureSupport;
$this->categoriesOeuvres = new ArrayCollection();
}
/**
* Get id.
*
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* Set editeur.
*
* @param Editeur|null $editeur
*/
public function setEditeur(Editeur $editeur = null): void
{
$this->editeur = $editeur;
}
/**
* Get editeur.
*
* @return Editeur
*/
public function getEditeur(): ?Editeur
{
return $this->editeur;
}
/**
* Set natureSupport.
*
* @param NatureSupport|null $natureSupport
*/
public function setNatureSupport(NatureSupport $natureSupport = null): void
{
$this->editeur = $natureSupport;
}
/**
* Get natureSupport.
*
* @return NatureSupport|null
*/
public function getNatureSupport(): ?NatureSupport
{
return $this->natureSupport;
}
/**
* Add categorieOeuvre.
*
* @param CategorieOeuvre $categorieOeuvre
*/
public function addCategorieOeuvre(CategorieOeuvre $categorieOeuvre): void
{
if (!$this->categoriesOeuvres->contains($categorieOeuvre)) {
$this->categoriesOeuvres[] = $categorieOeuvre;
$categorieOeuvre->addEditeurNatureSupport($this);
}
}
/**
* Remove categorieOeuvre.
*
* @param CategorieOeuvre $categorieOeuvre
*/
public function removeCategorieOeuvre(CategorieOeuvre $categorieOeuvre): void
{
if ($this->categoriesOeuvres->contains($categorieOeuvre)) {
$this->categoriesOeuvres->removeElement($categorieOeuvre);
$categorieOeuvre->removeEditeurNatureSupport($this);
}
}
/**
* Get categoriesOeuvres.
*
* @return Collection
*/
public function getCategoriesOeuvres(): Collection
{
return $this->categoriesOeuvres;
}
/**
* Add support.
*
* @param Support $support
*/
public function addSupport(Support $support): void
{
if (!$this->supports->contains($support)) {
$this->supports[] = $support;
}
$support->setEditeurNatureSupport($this);
}
/**
* Remove support.
*
* @param Support $support
*/
public function removeSupport(Support $support): void
{
if ($this->supports->contains($support)) {
$this->supports->removeElement($support);
}
$support->setEditeurNatureSupport(null);
}
/**
* Get supports.
*
* @return Collection
*/
public function getSupports(): Collection
{
return $this->supports;
}
}
| dmsr45/github_sf_media | src/Entity/EditeurNatureSupport.php | PHP | mit | 4,995 | [
30522,
1026,
1029,
25718,
3415,
15327,
10439,
1032,
9178,
1025,
2224,
8998,
1032,
2691,
1032,
6407,
1032,
9140,
26895,
18491,
1025,
2224,
8998,
1032,
2691,
1032,
6407,
1032,
3074,
1025,
2224,
8998,
1032,
2030,
2213,
1032,
12375,
2004,
2030,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 Academe\Instructions;
use Academe\Contracts\Mapper\Executable;
abstract class BaseExecutable implements Executable
{
} | AaronJan/Academe | src/Academe/Instructions/BaseExecutable.php | PHP | apache-2.0 | 147 | [
30522,
1026,
1029,
25718,
3415,
15327,
9353,
9648,
4168,
1032,
8128,
1025,
2224,
9353,
9648,
4168,
1032,
8311,
1032,
4949,
4842,
1032,
4654,
8586,
23056,
1025,
10061,
2465,
2918,
10288,
8586,
23056,
22164,
4654,
8586,
23056,
1063,
1065,
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... |
/*
* Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-03-22 wangyq the first version
*/
#ifndef DRV_RTC_H__
#define DRV_RTC_H__
int rt_hw_rtc_init(void);
#endif
| weety/rt-thread | bsp/essemi/es32f369x/drivers/drv_rtc.h | C | apache-2.0 | 297 | [
30522,
1013,
1008,
1008,
9385,
1006,
1039,
1007,
2760,
8344,
2264,
6499,
6199,
12702,
12260,
6593,
4948,
6558,
2522,
1012,
1010,
5183,
1012,
1008,
1008,
23772,
2595,
1011,
6105,
1011,
8909,
4765,
18095,
1024,
15895,
1011,
1016,
1012,
1014,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.tikaji.halocraft;
import com.tikaji.halocraft.common.handlers.ConfigurationHandler;
import com.tikaji.halocraft.common.proxy.IProxy;
import com.tikaji.halocraft.common.utility.Reference;
import com.tikaji.halocraft.common.utility.VersionChecker;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
/**
* Created by Jacob Williams on 6/17/2015.
*/
@Mod(modid = Reference.ModInfo.MOD_ID, name = Reference.ModInfo.MOD_NAME, version = Reference.ModInfo.VERSION)
public class HaloCraft
{
@Mod.Instance
public static HaloCraft INSTANCE;
public static boolean haveWarnedVersionIsOutOfDate = false;
@SidedProxy(clientSide = Reference.ModInfo.CLIENT_PROXY_CLASS, serverSide = Reference.ModInfo.SERVER_PROXY_CLASS)
public static IProxy proxy;
public static VersionChecker versionChecker;
public static String prependModID(String name)
{
return Reference.ModInfo.MOD_ID + ":" + name;
}
@Mod.EventHandler
public void initialize(FMLInitializationEvent event)
{
proxy.init();
}
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent event)
{
proxy.postInit();
ConfigurationHandler.postInit();
}
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event)
{
ConfigurationHandler.init(new Configuration(event.getSuggestedConfigurationFile()));
proxy.preInit();
ConfigurationHandler.save();
}
}
| Tikaji/HaloCraft | src/main/java/com/tikaji/halocraft/HaloCraft.java | Java | gpl-3.0 | 1,665 | [
30522,
7427,
4012,
1012,
14841,
2912,
4478,
1012,
17201,
10419,
1025,
12324,
4012,
1012,
14841,
2912,
4478,
1012,
17201,
10419,
1012,
2691,
1012,
28213,
2015,
1012,
9563,
11774,
3917,
1025,
12324,
4012,
1012,
14841,
2912,
4478,
1012,
17201,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 cs342.Chat.GUI.custom;
import javax.swing.*;
import javax.swing.border.LineBorder;
import javax.swing.text.*;
import java.awt.*;
import java.util.HashMap;
public class ChatArea {
private ChatPane cstmPane;
private JScrollBar vertical;
public final JScrollPane SCROLL_PANE;
private HashMap<String, StyledDocument> CONVO_TO_DOC;
public ChatArea() {
SCROLL_PANE = new JScrollPane();
CONVO_TO_DOC = new HashMap<String, StyledDocument>();
cstmPane = new ChatPane();
SCROLL_PANE.setViewportBorder(new LineBorder(new Color(0, 0, 0)));
SCROLL_PANE.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
SCROLL_PANE.setViewportView(cstmPane);
vertical = SCROLL_PANE.getVerticalScrollBar();
}
public void showChat(String entry) {
cstmPane.doc = CONVO_TO_DOC.get(entry);
cstmPane.setStyledDocument(cstmPane.doc);
}
public void createNewChat(String convo) {
CONVO_TO_DOC.put(convo, new DefaultStyledDocument());
}
public void removeChat(String convo) {
CONVO_TO_DOC.remove(convo);
}
public void clientPrint(String line, String who, String where) {
cstmPane.doc = CONVO_TO_DOC.get(where);
cstmPane.clientPrint(line, who);
setScrollBarMinimum();
}
public void serverPrint(String line, String who, String where) {
cstmPane.doc = CONVO_TO_DOC.get(where);
cstmPane.serverPrint(line, who);
setScrollBarMinimum();
}
private void setScrollBarMinimum() {
vertical.setValue( vertical.getMinimum());
}
private class ChatPane extends JTextPane {
private static final long serialVersionUID = 1L;
private StyledDocument doc;
private Style style;
private SimpleAttributeSet align;
private Color BACKGROUND = new Color(47, 79, 79);
private Color CLIENT_COLOR = new Color(255, 69, 0);
private Color SERVER_COLOR = new Color(0, 69, 255).brighter();
private Insets MARGINS = new Insets(5, 5, 5, 5);
private String FONT_NAME = "Calibri";
private int FONT_SIZE = 16;
private ChatPane() {
super();
super.setEditorKit(new WrapEditorKit());
super.setEditable(false);
super.setBackground(BACKGROUND);
super.setMargin(MARGINS);
style = this.addStyle("STYLE", null);
align = new SimpleAttributeSet();
StyleConstants.setFontFamily(style, FONT_NAME);
StyleConstants.setFontSize(style, FONT_SIZE);
StyleConstants.setBold(style, true);
}
private void clientPrint(String line, String who) {
StyleConstants.setAlignment(align, StyleConstants.ALIGN_RIGHT);
StyleConstants.setForeground(style, CLIENT_COLOR);
print(line + "\n");
}
private void serverPrint(String line, String who) {
StyleConstants.setAlignment(align, StyleConstants.ALIGN_LEFT);
StyleConstants.setForeground(style, SERVER_COLOR.brighter());
print(who + ": ");
StyleConstants.setForeground(style, SERVER_COLOR);
print(line + "\n");
}
private void print(String line) {
try {
doc.setParagraphAttributes(doc.getLength(), line.length(),
align, false);
doc.insertString(doc.getLength(), line, style);
} catch (BadLocationException e) {
}
}
}
} | TomasJuocepis/CS342-ChatApp | src/cs342/Chat/GUI/custom/ChatArea.java | Java | gpl-2.0 | 3,081 | [
30522,
7427,
20116,
22022,
2475,
1012,
11834,
1012,
26458,
1012,
7661,
1025,
12324,
9262,
2595,
1012,
7370,
1012,
1008,
1025,
12324,
9262,
2595,
1012,
7370,
1012,
3675,
1012,
2240,
12821,
4063,
1025,
12324,
9262,
2595,
1012,
7370,
1012,
379... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Basalt
======
[](https://travis-ci.org/polyfox/moon-basalt)
[](https://codeclimate.com/github/polyfox/moon-basalt)
[](http://inch-ci.org/github/polyfox/moon-basalt)
[](https://codeclimate.com/github/polyfox/moon-basalt)
Project Manager for Moon
## USAGE
```bash
basalt new NAME
# this will create a new basalt ready project
```
## CHANGELOG
* 09/05/2015 (0.13.0)
* Project has been removed, basalt is now purely a package manager.
* 11/04/2015 (0.12.3)
* Fixed issue where packages that were not stated in the Basaltfile would be
included.
* Added autoload option for pkg defs in a Basaltfile, this allows you to
finetune the output of the packages/load, preventing certain packages
from loading automatically.
* 03/03/2015 (0.12.1)
* Added conflicts field for pkg.yml
This can be used to stop a package from being included with another package,
which may cause it to unstable.
This is for cases such as having 2 different packages which define the same
system. (possibly different versions)
* 02/03/2015 (0.12.0)
* Added -f, --basaltfile option
* 12/02/2015 (0.10.1)
* Added install_method setting for Basaltfile
This allows the changing of the installation method for packages, by
default this is 'ref', which means to symlink the package into the current
package.
Use 'copy' to copy the package instead.
```
set install_method: 'copy'
# insert your packaging here
```
Please note you can overload the install_method per package by including
it as an option.
```
set install_method: 'copy'
pkg 'my-awesome-package', install_method: 'ref' # will be symlinked from the repo
pkg 'my-notso-awesome-package' # will be copied from the repo
```
* New CLI options
* -v, --verbose
Verbose can be very talky, this is helpful when you need to debug its
cluttered internals.
* -i, --install-method=METHOD
As with the previous addition, `install`, `update`, `sync` commands now
use the --install-method option.
```
basalt install -i copy
```
* 07/02/2015 (0.10.0)
* module(s) -> package(s)
* Basaltmods -> Basaltfile
This change affects the entire codebase and CLI app, from here on,
modules are not reffered to as packages instead.
NOTE: no effort has been made to make this backwards compatable with
the "modules" convention used previoiusly.
```bash
basalt package new
# new command for quickly creating new packages
basalt package install
# install a package into an existing project, this will read
# an existing Basaltfile and install the package to the directory
# specified
basalt package uninstall
# revserse of install, removes a package from the project
basalt package sync
# removes old packages and installs new packages
basalt package update
# same as sync
basalt package list
# lists both the available and installed packages, packages are
# color-coded based on their state
basalt package list-available
# lists all available packages in the repo.
basalt package list-installed
# lists all currently installed packages in the project.
# NOTE: this will only read the existing Basaltfile and report what
# has been chosen.
# The package, MAY or MAY NOT be installed at all until basalt
# package update has been ran
```
| polyfox/moon-basalt | README.md | Markdown | mit | 3,848 | [
30522,
26343,
1027,
1027,
1027,
1027,
1027,
1027,
1031,
999,
1031,
3857,
3570,
1033,
1006,
16770,
1024,
1013,
1013,
10001,
1011,
25022,
1012,
8917,
1013,
26572,
14876,
2595,
1013,
4231,
1011,
26343,
1012,
17917,
2290,
1029,
3589,
1027,
3040... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 CAMERA_SETTINGS_H_
#define CAMERA_SETTINGS_H_
#ifndef _CYCLOPS_RESOLUTION_
#define _CYCLOPS_RESOLUTION_ 128
#endif
#define _CYCLOPS_RESOLUTION_H _CYCLOPS_RESOLUTION_ //non square not fully implimented yet
#define _CYCLOPS_RESOLUTION_W _CYCLOPS_RESOLUTION_
#ifndef _CYCLOPS_COLOR_DEPTH_
#define _CYCLOPS_COLOR_DEPTH_ 1 //1 for B&W
#endif //2 for YCbCr
//3 for RGB
#ifndef _CYCLOPS_IMAGE_NFRAMES_
#define _CYCLOPS_IMAGE_NFRAMES_ 1
#endif
#endif
| nesl/sos-2x | platform/cyclops/include/camera_settings.h | C | bsd-3-clause | 465 | [
30522,
1001,
2065,
13629,
2546,
4950,
1035,
10906,
1035,
1044,
1035,
1001,
9375,
4950,
1035,
10906,
1035,
1044,
1035,
1001,
2065,
13629,
2546,
1035,
22330,
28659,
1035,
5813,
1035,
1001,
9375,
1035,
22330,
28659,
1035,
5813,
1035,
11899,
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... |
package com.x.organization.assemble.personal.jaxrs.password;
import com.x.base.core.project.exception.LanguagePromptException;
class ExceptionOldPasswordNotMatch extends LanguagePromptException {
private static final long serialVersionUID = -3885997486474873786L;
ExceptionOldPasswordNotMatch() {
super("原密码错误.");
}
}
| o2oa/o2oa | o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/password/ExceptionOldPasswordNotMatch.java | Java | agpl-3.0 | 338 | [
30522,
7427,
4012,
1012,
1060,
1012,
3029,
1012,
21365,
1012,
3167,
1012,
13118,
2869,
1012,
20786,
1025,
12324,
4012,
1012,
1060,
1012,
2918,
1012,
4563,
1012,
2622,
1012,
6453,
1012,
2653,
21572,
27718,
10288,
24422,
1025,
2465,
6453,
116... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
/*
* testlistfmt_ka_GE.js - test the list formatter object
*
* Copyright © 2020, JEDLSoft
*
* 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.
*/
if (typeof(ListFmt) === "undefined") {
var ListFmt = require("../../lib/ListFmt.js");
}
if (typeof(ilib) === "undefined") {
var ilib = require("../../lib/ilib.js");
}
module.exports.testlistfmt_ka_GE = {
setUp: function(callback) {
ilib.clearCache();
callback();
},
testListFmtkaGENumberFormatOne: function(test) {
var fmt = new ListFmt({
locale: "ka-GE"
});
test.expect(2);
test.ok(fmt !== null);
test.equal(fmt.format(["ერთი"]), "ერთი");
test.done();
},
testListFmtkaGENumberFormatTwo: function(test) {
var fmt = new ListFmt({
locale: "ka-GE"
});
test.expect(2);
test.ok(fmt !== null);
test.equal(fmt.format(["ერთი", "ორი"]), "ერთი და ორი");
test.done();
},
testListFmtkaGENumberFormatThree: function(test) {
var fmt = new ListFmt({
locale: "ka-GE"
});
test.expect(2);
test.ok(fmt !== null);
test.equal(fmt.format(["ერთი", "ორი", "სამი"]), "ერთი, ორი და სამი");
test.done();
},
testListFmtkaGENumberFormatFour: function(test) {
var fmt = new ListFmt({
locale: "ka-GE"
});
test.expect(2);
test.ok(fmt !== null);
test.equal(fmt.format(["ერთი", "ორი", "სამი", "ოთხი"]), "ერთი, ორი, სამი და ოთხი");
test.done();
},
testListFmtkaGENumberFormatFive: function(test) {
var fmt = new ListFmt({
locale: "ka-GE"
});
test.expect(2);
test.ok(fmt !== null);
test.equal(fmt.format(["ერთი", "ორი", "სამი", "ოთხი", "ხუთი"]), "ერთი, ორი, სამი, ოთხი და ხუთი");
test.done();
},
testListFmtUnitStylekaGENumberFormatOneShort: function(test) {
var fmt = new ListFmt({
locale: "ka-GE",
style: "unit"
});
test.expect(2);
test.ok(fmt !== null);
test.equal(fmt.format(["ერთი"]), "ერთი");
test.done();
},
testListFmtUnitStylekaGENumberFormatTwoShort: function(test) {
var fmt = new ListFmt({
locale: "ka-GE",
style: "unit"
});
test.expect(2);
test.ok(fmt !== null);
test.equal(fmt.format(["ერთი", "ორი"]), "ერთი, ორი");
test.done();
},
testListFmtUnitStylekaGENumberFormatThreeShort: function(test) {
var fmt = new ListFmt({
locale: "ka-GE",
style: "unit"
});
test.expect(2);
test.ok(fmt !== null);
test.equal(fmt.format(["ერთი", "ორი", "სამი"]), "ერთი, ორი, სამი");
test.done();
},
testListFmtUnitStylekaGENumberFormatFourShort: function(test) {
var fmt = new ListFmt({
locale: "ka-GE",
style: "unit"
});
test.expect(2);
test.ok(fmt !== null);
test.equal(fmt.format(["ერთი", "ორი", "სამი", "ოთხი"]), "ერთი, ორი, სამი, ოთხი");
test.done();
},
testListFmtUnitStylekaGENumberFormatFiveShort: function(test) {
var fmt = new ListFmt({
locale: "ka-GE",
style: "unit"
});
test.expect(2);
test.ok(fmt !== null);
test.equal(fmt.format(["ერთი", "ორი", "სამი", "ოთხი", "ხუთი"]), "ერთი, ორი, სამი, ოთხი, ხუთი");
test.done();
},
testListFmtUnitStylekaGENumberFormatOneFull: function(test) {
var fmt = new ListFmt({
locale: "ka-GE",
style: "unit",
length: "full"
});
test.expect(2);
test.ok(fmt !== null);
test.equal(fmt.format(["ერთი"]), "ერთი");
test.done();
},
testListFmtUnitStylekaGENumberFormatTwoFull: function(test) {
var fmt = new ListFmt({
locale: "ka-GE",
style: "unit",
length: "full"
});
test.expect(2);
test.ok(fmt !== null);
test.equal(fmt.format(["ერთი", "ორი"]), "ერთი, ორი");
test.done();
},
testListFmtUnitStylekaGENumberFormatThreeFull: function(test) {
var fmt = new ListFmt({
locale: "ka-GE",
style: "unit",
length: "full"
});
test.expect(2);
test.ok(fmt !== null);
test.equal(fmt.format(["ერთი", "ორი", "სამი"]), "ერთი, ორი, სამი");
test.done();
},
testListFmtUnitStylekaGENumberFormatFourFull: function(test) {
var fmt = new ListFmt({
locale: "ka-GE",
style: "unit",
length: "full"
});
test.expect(2);
test.ok(fmt !== null);
test.equal(fmt.format(["ერთი", "ორი", "სამი", "ოთხი"]), "ერთი, ორი, სამი, ოთხი");
test.done();
},
testListFmtUnitStylekaGENumberFormatFiveFull: function(test) {
var fmt = new ListFmt({
locale: "ka-GE",
style: "unit",
length: "full"
});
test.expect(2);
test.ok(fmt !== null);
test.equal(fmt.format(["ერთი", "ორი", "სამი", "ოთხი", "ხუთი"]), "ერთი, ორი, სამი, ოთხი, ხუთი");
test.done();
},
testListFmtORStylekaGENumberFormatOne: function(test) {
var fmt = new ListFmt({
locale: "ka-GE",
style: "disjunction"
});
test.expect(2);
test.ok(fmt !== null);
test.equal(fmt.format(["ერთი"]), "ერთი");
test.done();
},
testListFmtORStylekaGENumberFormatTwo: function(test) {
var fmt = new ListFmt({
locale: "ka-GE",
style: "disjunction"
});
test.expect(2);
test.ok(fmt !== null);
test.equal(fmt.format(["ერთი", "ორი"]), "ერთი ან ორი");
test.done();
},
testListFmtORStylekaGENumberFormatThree: function(test) {
var fmt = new ListFmt({
locale: "ka-GE",
style: "disjunction"
});
test.expect(2);
test.ok(fmt !== null);
test.equal(fmt.format(["ერთი", "ორი", "სამი"]), "ერთი, ორი ან სამი");
test.done();
},
testListFmtORStylekaGENumberFormatFour: function(test) {
var fmt = new ListFmt({
locale: "ka-GE",
style: "disjunction"
});
test.expect(2);
test.ok(fmt !== null);
test.equal(fmt.format(["ერთი", "ორი", "სამი", "ოთხი"]), "ერთი, ორი, სამი ან ოთხი");
test.done();
},
testListFmtORStylekaGENumberFormatFiveFull: function(test) {
var fmt = new ListFmt({
locale: "ka-GE",
style: "disjunction"
});
test.expect(2);
test.ok(fmt !== null);
test.equal(fmt.format(["ერთი", "ორი", "სამი", "ოთხი", "ხუთი"]), "ერთი, ორი, სამი, ოთხი ან ხუთი");
test.done();
}
}; | iLib-js/iLib | js/test/strings-ext/testlistfmt_ka_GE.js | JavaScript | apache-2.0 | 8,383 | [
30522,
1013,
1008,
1008,
3231,
9863,
16715,
2102,
1035,
10556,
1035,
16216,
1012,
1046,
2015,
1011,
3231,
1996,
2862,
4289,
3334,
4874,
1008,
1008,
9385,
1075,
12609,
1010,
24401,
4877,
15794,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
//
// NWLAppDelegate.h
// NWLoggingCocoaDemo
//
// Copyright (c) 2012 noodlewerk. All rights reserved.
//
@interface NWLAppDelegate : NSObject <NSApplicationDelegate>
@property (assign) IBOutlet NSWindow *window;
@end
| noodlewerk/NWLogging | Demo/Cocoa/NWLAppDelegate.h | C | bsd-2-clause | 224 | [
30522,
1013,
1013,
1013,
1013,
22064,
2721,
9397,
9247,
29107,
2618,
1012,
1044,
1013,
1013,
22064,
21197,
4726,
3597,
3597,
9648,
5302,
1013,
1013,
1013,
1013,
9385,
1006,
30524,
3200,
1006,
23911,
1007,
21307,
5833,
7485,
11524,
22254,
50... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 mongoose = require('mongoose')
const TABLE_NAME = 'Post'
const Schema = mongoose.Schema
const ObjectId = Schema.Types.ObjectId
const escape = (require('../utils')).escape
const PostSchema = new Schema({
//类型
type: {
type: String,
default: 'post' // post | page
},
//标题
title: {
type: String,
trim: true,
set: escape
},
//别名
alias: {
type: String,
trim: true,
set: escape
},
//创建者
user: {
type: ObjectId,
ref: 'User'
},
//类别
category: {
type: ObjectId,
ref: 'Category'
},
//摘要
excerpt: {
type: String,
trim: true,
},
//内容
contents: {
type: String,
trim: true,
},
//markdown
markdown: {
type: String,
trim: true,
},
//标签
tags: Array,
//缩略图
thumbnail: {
type: String,
trim: true,
set: escape
},
//统计
count: {
//浏览次数
views: {
type: Number,
default: 1,
},
//评论数
comments: {
type: Number,
default: 0,
},
//点赞数
praises: {
type: Number,
default: 1
}
},
//状态
status: {
type: Number,
default: 1 // 1:发布, 0 :草稿, -1 :删除
},
//置顶
top: Boolean,
//允许评论
allowComment: {
type: Boolean,
default: true
},
//允许打赏
allowReward: Boolean,
//著名版权
license: Boolean,
//使用密码
usePassword: Boolean,
//密码
password: {
type: String,
trim: true
},
order: {
type: Number,
default: 1
},
//创建时间
createTime: {
type: Date,
default: Date.now()
},
//修改时间
updateTime: {
type: Date,
default: Date.now()
}
}, {
connection: TABLE_NAME,
versionKey: false,
})
module.exports = mongoose.model(TABLE_NAME, PostSchema) | S-mohan/mblog | server/model/post.js | JavaScript | mit | 1,843 | [
30522,
9530,
3367,
12256,
3995,
9232,
1027,
5478,
1006,
1005,
12256,
3995,
9232,
1005,
1007,
9530,
3367,
2795,
1035,
2171,
1027,
1005,
2695,
1005,
9530,
3367,
8040,
28433,
1027,
12256,
3995,
9232,
1012,
8040,
28433,
9530,
3367,
4874,
3593,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 owltools.yaml.golrconfig;
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import owltools.gaf.io.AbstractXmlWriter;
public class SolrSchemaXMLWriter extends AbstractXmlWriter {
//private static Logger LOG = Logger.getLogger(ConfigManager.class);
private ConfigManager config = null;
public SolrSchemaXMLWriter(ConfigManager aconfig) {
super(" "); // like emacs nXML
config = aconfig;
}
/**
* Automatically add fields to the schema depending on qualities in the current GOlrField.
*
* @param field GOlrField
* @param xml
* @throws XMLStreamException
*/
private void generateAutomaticFields(GOlrField field, XMLStreamWriter xml) throws XMLStreamException{
// Detect whether we need to automatically add _*_map mapping information.
// Work on either "list" or "closure".
Pattern pcl = Pattern.compile("(.*)_closure_label$");
Pattern pll = Pattern.compile("(.*)_list_label$");
Matcher clmatch = pcl.matcher(field.id);
Matcher llmatch = pll.matcher(field.id);
// See if it's one of the above.
String baseName = null;
String mtype = null;
if( clmatch.matches() ){
baseName = clmatch.group(1);
mtype = "_closure_map";
}else if( llmatch.matches() ){
baseName = llmatch.group(1);
mtype = "_list_map";
}
if( mtype != null ){
// NOTE: See comments below.
xml.writeComment(" Automatically created to capture mapping information ");
xml.writeComment(" between " + baseName + "_(list|closure) and " + field.id + ".");
xml.writeComment(" It is not indexed for searching (JSON blob), but may be useful to the client. ");
xml.writeStartElement("field"); // <field>
xml.writeAttribute("name", baseName + mtype);
xml.writeAttribute("type", "string");
xml.writeAttribute("required", "false");
xml.writeAttribute("multiValued", "false");
xml.writeAttribute("indexed", "false");
xml.writeAttribute("stored", "true");
xml.writeEndElement(); // </field>
}
}
/**
* Just dump out the fields of our various lists.
*
* @param config
* @param xml
* @throws XMLStreamException
*/
//private void outFields(List<? extends GOlrCoreField> fieldList, XMLStreamWriter xml) throws XMLStreamException{
private void outFields(ConfigManager config, XMLStreamWriter xml) throws XMLStreamException{
ArrayList<GOlrField> fieldList = config.getFields();
for( GOlrField field : fieldList ){
// Output any comments we found as a bunch at the top;
// this should help clarify things when fields are overloaded.
ArrayList<String> comments = config.getFieldComments(field.id);
for( String comment : comments ){
xml.writeComment(comment);
}
// Gather things up first.
String f_id = field.id;
String f_type = field.type;
// ID is the only required field.
String f_required = "false";
if( field.id.equals("id") ){
f_required = "true";
}
// Cardinality maps to multivalued.
String f_multi = "true";
if( field.cardinality.equals("single") ){
f_multi = "false";
}
String f_indexed = field.indexed;
// Write out the "main" field declaration.
xml.writeStartElement("field");
// The main variants.
xml.writeAttribute("name", f_id);
xml.writeAttribute("type", f_type);
xml.writeAttribute("required", f_required);
xml.writeAttribute("multiValued", f_multi);
xml.writeAttribute("indexed", f_indexed);
// Invariants: we'll always store.
xml.writeAttribute("stored", "true");
// Done.
xml.writeEndElement(); // </field>
// If searchable is true, create an additional field that mirrors
// the main one, but using the tokenizer (needed for edismax, etc.).
String f_searchable = field.searchable;
//LOG.info("field.searchable: " + f_searchable);
if( f_searchable.equals("true") ){
//String munged_id = f_id + config.getSearchableExtension();
String munged_id = f_id + "_searchable";
xml.writeComment("An easily searchable (TextField tokenized) version of " + f_id + ".");
xml.writeStartElement("field");
// The main variants.
xml.writeAttribute("name", munged_id);
xml.writeAttribute("type", "text_searchable");
xml.writeAttribute("required", f_required);
xml.writeAttribute("multiValued", f_multi);
// Invariants: we'll always store and index.
xml.writeAttribute("indexed", "true");
xml.writeAttribute("stored", "true");
// Done.
xml.writeEndElement(); // </field>
// Also, add the field copy soe we don't have to worry about manually loading it.
xml.writeStartElement("copyField");
// <copyField source="body" dest="teaser" maxChars="300"/>
xml.writeAttribute("source", f_id);
xml.writeAttribute("dest", munged_id);
xml.writeEndElement(); // </copyField>
}
// Add any automatically generated fields if necessary.
generateAutomaticFields(field, xml);
}
}
/**
* Dump the necessary Solr schema as a String.
*
* @return schema
* @throws XMLStreamException
*/
public String schema() throws XMLStreamException{
//OutputStream outputStream = System.out;
OutputStream outputStream = new ByteArrayOutputStream();
XMLStreamWriter xml = this.createWriter(outputStream);
xml.writeStartDocument();
///
/// Opening cruft.
///
xml.writeStartElement("schema");
xml.writeAttribute("name", "golr");
xml.writeAttribute("version", "3.6");
xml.writeStartElement("types");
// NOTE: See comments below.
xml.writeComment("Unsplit string for when text needs to be dealt with atomically.");
xml.writeComment("For example, faceted querying.");
xml.writeStartElement("fieldType");
xml.writeAttribute("name", "string");
xml.writeAttribute("class", "solr.StrField");
xml.writeAttribute("sortMissingLast", "true");
xml.writeEndElement(); // </fieldType>
// NOTE: See comments below.
xml.writeComment("Any string with spaces that needs to be treated for searching purposes.");
xml.writeComment("This will be automatically used in cases where \"searchable: true\" has been");
xml.writeComment("specified in the YAML.");
xml.writeStartElement("fieldType");
xml.writeAttribute("name", "text_searchable");
xml.writeAttribute("class", "solr.TextField");
xml.writeAttribute("positionIncrementGap", "100");
xml.writeAttribute("sortMissingLast", "true");
xml.writeStartElement("analyzer");
xml.writeStartElement("tokenizer");
xml.writeAttribute("class", "solr.StandardTokenizerFactory");
xml.writeEndElement(); // </tokenizer>
xml.writeStartElement("filter");
xml.writeAttribute("class", "solr.LowerCaseFilterFactory");
xml.writeEndElement(); // </filter>
xml.writeEndElement(); // </analyzer>
xml.writeEndElement(); // </fieldType>
// Integer.
xml.writeStartElement("fieldType");
xml.writeAttribute("name", "integer");
xml.writeAttribute("class", "solr.TrieIntField");
xml.writeAttribute("precisionStep", "0");
xml.writeAttribute("positionIncrementGap", "0");
xml.writeAttribute("sortMissingLast", "true");
xml.writeEndElement(); // </fieldType>
// True boolean.
xml.writeStartElement("fieldType");
xml.writeAttribute("name", "boolean");
xml.writeAttribute("class", "solr.BoolField");
xml.writeAttribute("sortMissingLast", "true");
xml.writeEndElement(); // </fieldType>
xml.writeEndElement(); // </types>
///
/// Fields
///
xml.writeStartElement("fields");
//xml.writeDefaultNamespace("http://www.w3.org/1999/xhtml");
// Instructions.
//xml.writeComment("START");
//xml.writeComment(" Add this and below to your schema.xml file as your schema and restart Jetty. ");
//xml.writeComment(" After this schema has been applied for the given config file, purge the index and rerun the loader (with said config file). ");
// Write out the special required "document_category" field declaration.
xml.writeComment(" A special static/fixed (by YAML conf file) field all documents have. ");
xml.writeStartElement("field"); // <field>
xml.writeAttribute("name", "document_category");
xml.writeAttribute("type", "string");
xml.writeAttribute("required", "false");
xml.writeAttribute("multiValued", "false");
xml.writeAttribute("indexed", "true");
xml.writeAttribute("stored", "true");
xml.writeEndElement(); // </field>
// // Single fixed fields--the same every time.
// outFields(config.getFixedFields(), xml);
//
// // Dynamic fields.
// outFields(config.getDynamicFields(), xml);
// Dynamic fields.
//outFields(config.getFields(), xml);
outFields(config, xml);
xml.writeEndElement(); // </fields>
///
/// Closing cruft.
///
xml.writeStartElement("uniqueKey");
xml.writeCharacters("id");
xml.writeEndElement(); // </uniqueKey>
// These are now declared in the search string:
// defaultSearchOperator defaults to OR and can be changed with "q.op".
// defaultSearchField is deprecated for using "df" in request handler.
//xml.writeStartElement("defaultSearchField");
//xml.writeCharacters("label");
//xml.writeEndElement(); // </defaultSearchField>
//xml.writeStartElement("solrQueryParser");
//xml.writeAttribute("defaultOperator", "OR");
//xml.writeEndElement(); // </solrQueryParser>
// Special STOP and wrap up.
//xml.writeComment("STOP");
xml.writeEndElement(); // </schema>
xml.writeEndDocument();
xml.close();
return outputStream.toString();
}
}
| dhimmel/owltools | OWLTools-Solr/src/main/java/owltools/yaml/golrconfig/SolrSchemaXMLWriter.java | Java | bsd-3-clause | 9,582 | [
30522,
7427,
13547,
3406,
27896,
1012,
8038,
19968,
1012,
2175,
20974,
8663,
8873,
2290,
1025,
12324,
9262,
1012,
22834,
1012,
24880,
2906,
9447,
5833,
18780,
21422,
1025,
12324,
9262,
1012,
22834,
1012,
27852,
25379,
1025,
12324,
9262,
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... |
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
void bli_her_unb_var1( conj_t conjh,
obj_t* alpha,
obj_t* x,
obj_t* c,
her_t* cntl );
#undef GENTPROT2
#define GENTPROT2( ctype_x, ctype_c, chx, chc, varname ) \
\
void PASTEMAC2(chx,chc,varname)( \
uplo_t uplo, \
conj_t conjx, \
conj_t conjh, \
dim_t m, \
void* alpha, \
void* x, inc_t incx, \
void* c, inc_t rs_c, inc_t cs_c \
);
INSERT_GENTPROT2_BASIC( her_unb_var1 )
#ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT
INSERT_GENTPROT2_MIX_D( her_unb_var1 )
#endif
#ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT
INSERT_GENTPROT2_MIX_P( her_unb_var1 )
#endif
| tkelman/blis | frame/2/her/bli_her_unb_var1.h | C | bsd-3-clause | 2,588 | [
30522,
1013,
1008,
1038,
6856,
2019,
4874,
1011,
2241,
7705,
2005,
4975,
2152,
1011,
2836,
1038,
8523,
1011,
2066,
8860,
1012,
9385,
1006,
1039,
1007,
2297,
1010,
1996,
2118,
1997,
3146,
25707,
1998,
2224,
1999,
3120,
1998,
12441,
3596,
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
namespace BankId\Merchant\Library\Schemas\saml\metadata;
/**
* Class representing Extensions
*/
class Extensions extends ExtensionsType
{
}
| notarynodes/idintt | hackathon-module/idintt-php-module/library/Schemas/saml/metadata/Extensions.php | PHP | apache-2.0 | 166 | [
30522,
1026,
1029,
25718,
3415,
15327,
2924,
3593,
1032,
6432,
1032,
3075,
1032,
8040,
28433,
2015,
1032,
3520,
2140,
1032,
27425,
1025,
1013,
1008,
1008,
1008,
2465,
5052,
14305,
1008,
1013,
2465,
14305,
8908,
14305,
13874,
1063,
1065,
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... |
---
layout: post
title: "Spark(二):Standalone和YARN方式部署集群"
date: 2016-04-05 08:11:11
author: 伊布
categories: tech
tags: spark
cover: "/assets/instacode.png"
---
* TOC
{:toc}
Spark有三种集群部署方式:
- standalone
- mesos
- yarn
其中standalone方式部署最为简单,下面做一下简单的记录。后面我还补充了YARN的方式。
> 其实最简单的是local方式,单机。
### 1 环境
我在一台服务器上安装了ESXi来管理虚拟机,多个虚拟机组成spark集群。虚拟机软件配置如下:
- 安装ubuntu server 14.04版本
- 安装OpenJDK 1.7
- 用户名为ieevee,具备sudo权限,并且sudo执行命令时不需要输入密码
- master上配置所有节点的/etc/hosts记录
- 安装pssh
配置无密码sudo方法如下。
```
root@spark1:/etc# chmod u+w sudoers
root@spark1:/etc# echo "%ieevee ALL=(ALL) NOPASSWD: ALL" > sudoers
root@spark1:/etc# chmod u-w sudoers
```
我做的虚拟机镜像配置了/home/ieevee/.ssh/authorized_keys,默认打通了ssh免密登录。
### 2 部署
我们先部署1个master+3个slave的集群。感叹下,相比之下某阿公司的ADS产品,spark的部署真的太简单了。
我用的spark为目前的release 1.6.1 pre-build版本,官方下载for hadoop 2.6的即可。将该包丢到集群的各个机器上,解压。我解压后的路径是`/home/ieevee/spark/spark-1.6.1-bin-hadoop2.6`。
#### 2.1 单独启动
**启动master**
到spark1机器上,执行`./sbin/start-master.sh `,启动master。查看日志,可以找到如下2个路径:
- spark集群内master路径:`spark://spark1:7077`,下面slave启动时需要用这个路径来指定master
- WEB UI路径:`http://192.168.181.73:8080`,浏览器打开可以看到里面空空如也,什么资源也没有。
**启动slave**
到spark2机器上,执行`./sbin/start-slave.sh spark1:7077`,启动第一个slave,此时在WEB UI可以看到Alive Workers为1,core、memory为该slave节点的所有资源(内存扣1G给操作系统),workers中可以看到spark2。
继续到spark3、spark4机器上执行`./sbin/start-slave.sh spark1:7077`,最终在WEB UI上看到的情况如下:

#### 2.2 集中启动
当然上面这样做很麻烦,需要在每个节点上启动进程,更好的办法是在master(spark1)上配置slaves节点,统一启动。
在spark1上:
```
cp ./conf/slaves.template ./conf/slaves
echo "spark2" >> ./conf/slaves
echo "spark3" >> ./conf/slaves
echo "spark4" >> ./conf/slaves
./sbin/start-all.sh
```
如果后面觉得slave资源不够了,仍然可以安装2.1的做法,在新节点上`./sbin/start-slave.sh spark1:7077`,可以动态的加载上去,并且在master上执行stop-all.sh,也可以把新加的这个节点stop掉(这么友好我都快哭了)
#### 2.3 验证
如上,资源已经有了,下面我们跑个简单的任务。
```
./bin/spark-submit --master spark://spark1:7077 --class org.apache.spark.examples.SparkLR --name SparkLR lib/spark-examples-1.6.1-hadoop2.6.0.jar
```
spark-submit可以指定master,我们这里因为是standalone,所以指定了spark1的路径,yarn/mesos不同。执行完毕后到WEB UI上可以看到该任务在3个slave节点上都跑了响应的作业。
还可以指定`--supervise`,如果应用返回非0值会做重试。
#### 2.4 资源调度
standalone模式下,任务遵从FIFO调度。由于默认任务会使用所有资源,所以同一时刻只能跑一个任务;不过我们可以限制每个任务占用的资源,这样可以多个用户同时使用。mesos或者yarn模式会更自由一些。
### 3 HA
多个slave的情况下自动具备了worker的HA,因为spark会将失败的任务调度到其他worker上执行。但是,master还是有单点的,如果master故障了,那么用户就无法提交新的作业了。注意,已经提交到worker的作业不受影响。
spark官方给出了2种解决方法,一个是使用zk做分布式协调,zk选主;另一个是使用基于LOCAL FILE SYSTEM恢复的单节点方案。第二种其实只有1个master实例,当master故障后服务不可用,必须重启master进程,一般在生成系统上是不可接受的,所以我采用的是第一种方式。
我在spark1的基础上,增加了2台master:spark11和spark12.
#### 3.1 配置ZK
ZK也需要部署为集群模式,分别装在spark1/spark11/spark12,三台机器都要执行下面:
```bash
cp conf/zoo_sample.cfg conf/zoo.cfg
echo "server.1=spark1:2888:3888" >> conf/zoo.cfg
echo "server.2=spark11:2888:3888" >> conf/zoo.cfg
echo "server.3=spark12:2888:3888" >> conf/zoo.cfg
touch data/myid
# 下面的“1”,在不同的机器上替换为对应的值。
echo "1" > /data/myid
./bin/zkServer.sh start
```
启动后,我们任意选择一个机器上的./bin/zkCli.sh连上去,确保zk好用:
```
./bin/zkCli.sh
[zk: localhost:2181(CONNECTED) 0] connect spark1:2181,spark11:2181,spark12:2181
[zk: spark1:2181,spark11:2181,spark12:2181(CONNECTED) 1] ls /
[zookeeper]
```
#### 3.2 配置master
为了使能recovery mode,需要在start-env.sh中指定SPARK_DAEMON_JAVA_OPTS,具体为以下三个参数:
|参数 | 意义|
|----|---|
|spark.deploy.recoveryMode |需要配置为ZOOKEEPER,默认是NONE|
|spark.deploy.zookeeper.url|ZK url,如"spark1:2181,spark11:2181,spark12:2181"|
|spark.deploy.zookeeper.dir | zk上的路径,默认为'spark'|
我修改了前面2个参数。
```
cp conf/spark-env.sh.template conf/spark-env.sh
echo "SPARK_DAEMON_JAVA_OPTS=\"$SPARK_DAEMON_JAVA_OPTS -Dspark.deploy.recoveryMode=ZOOKEEPER -Dspark.deploy.zookeeper.url=spark1:2181,spark11:2181,spark12:2181\"" >> conf/spark-env.sh
```
#### 3.3 检验HA
我没找到好的集中启动的方式,采用的还是每个机器上单独命令启动的方式,简单起见,测试的时候我启动了3台master和1台slave(spark2机器)。
master的启动跟之前是一样的,slave有不同:
```
./bin/start-slave.sh spark1:7077,spark11:7077,spark12:7077
```
简要说明下。3台master启动后,在WEB UI上能看到其状态,我这里的情况是2台ALIVE(例如spark1和spark11),1台STANDBY(spark12);spark2启动后,只有1台master上(例如spark11)可以看到其计算资源,其他2台看不到;将spark11关闭,过一两分钟后可以看到spark1上拿到了计算资源,查看spark2的日志,能看到重连的过程。
实际上,spark的master HA机制做的非常优秀的一点是,master的切换是由新master来通知之前注册过的slaves的。因此,standby master并不要求一开始就部署上去,slave启动的时候,也不需要像上面这样指定3个spark url。
**上面的过程可以做个小优化,即仍然在spark1上start-all,然后再将spark11/spark12加入到集群的master中。这样即使spark1故障关闭了,新的master仍然可以接管计算资源。**
不过美中不足的是,集群切换的时间有点长,官方说法是1-2分钟,不知道是不是跟故障发现的频率太低有关系。
### 4 Spark on YARN
我理解现在的spark on yarn 也只是说spark的任务跑在yarn上,这样区别于standalone方式,可以有一个公共的资源管理模块来提供服务。
配置YARN略去不谈,可以参考[这篇文章](http://www.alexjf.net/blog/distributed-systems/hadoop-yarn-installation-definitive-guide/#single-node-test)。
YARN配置好后,还需要设置环境变量来指定HADDOP/YARN的配置文件,SPARK启动的时候会去这个目录中找YARN的配置文件,用来向YARN提交任务。
```
export YARN_CONF_DIR=/home/ieevee/hadoop/hadoop-2.6.3/etc/hadoop
export HADOOP_CONF_DIR=/home/ieevee/hadoop/hadoop-2.6.3/etc/hadoop
```
启动SPARK任务的命令行,指定的--master与以前不一样,例如启动thriftserver:
`./sbin/start-thriftserver.sh --master yarn`
这样就可以在YARN上有一个常驻的JDBC server,使用beeline就可以开心的连上去做SQL操作了。
[Reference](http://spark.apache.org/docs/latest/spark-standalone.html)
| silenceshell/silenceshell.github.io | _posts/2016-04-05-spark-standalone.md | Markdown | mit | 8,336 | [
30522,
1011,
1011,
1011,
9621,
1024,
2695,
2516,
1024,
1000,
12125,
1987,
1752,
1988,
1993,
26609,
1796,
27158,
1863,
100,
1960,
100,
100,
100,
1000,
3058,
1024,
2355,
1011,
5840,
1011,
5709,
5511,
1024,
2340,
1024,
2340,
3166,
1024,
1762... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 org.innovateuk.ifs.registration.service;
import org.springframework.web.context.request.RequestAttributes;
import java.util.HashMap;
import java.util.Map;
/**
* This solves the java.lang.IllegalStateException: Cannot ask for request attribute - request is not active anymore!
* Error, Request attributes are reset before the organisation is updates and removed afterwards.
* @see https://stackoverflow.com/questions/44121654/inherited-servletrquestattributes-is-marked-completed-before-child-thread-finish
* @see https://medium.com/@pranav_maniar/spring-accessing-request-scope-beans-outside-of-web-request-faad27b5ed57
*
*/
public class CustomRequestScopeAttr implements RequestAttributes {
private Map<String, Object> requestAttributeMap = new HashMap<>();
@Override
public Object getAttribute(String name, int scope) {
if (scope == RequestAttributes.SCOPE_REQUEST) {
return this.requestAttributeMap.get(name);
}
return null;
}
@Override
public void setAttribute(String name, Object value, int scope) {
if (scope == RequestAttributes.SCOPE_REQUEST) {
this.requestAttributeMap.put(name, value);
}
}
@Override
public void removeAttribute(String name, int scope) {
if (scope == RequestAttributes.SCOPE_REQUEST) {
this.requestAttributeMap.remove(name);
}
}
@Override
public String[] getAttributeNames(int scope) {
if (scope == RequestAttributes.SCOPE_REQUEST) {
return this.requestAttributeMap.keySet().toArray(new String[0]);
}
return new String[0];
}
@Override
public void registerDestructionCallback(String name, Runnable callback, int scope) {
// Not Supported
}
@Override
public Object resolveReference(String key) {
// Not supported
return null;
}
@Override
public String getSessionId() {
return null;
}
@Override
public Object getSessionMutex() {
return null;
}
} | InnovateUKGitHub/innovation-funding-service | ifs-web-service/ifs-web-core/src/main/java/org/innovateuk/ifs/registration/service/CustomRequestScopeAttr.java | Java | mit | 2,061 | [
30522,
7427,
8917,
1012,
7601,
7103,
2618,
6968,
1012,
2065,
2015,
1012,
8819,
1012,
2326,
1025,
12324,
8917,
1012,
3500,
15643,
6198,
1012,
4773,
30524,
9262,
1012,
21183,
4014,
1012,
23325,
2863,
2361,
1025,
12324,
9262,
1012,
21183,
4014... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
[](http://badge.fury.io/js/mini-emitter)
[](https://travis-ci.org/alykoshin/mini-emitter)
[](http://coveralls.io/github/alykoshin/mini-emitter?branch=master)
[](https://codeclimate.com/github/alykoshin/mini-emitter)
[](http://inch-ci.org/github/alykoshin/mini-emitter)
[](https://david-dm.org/alykoshin/mini-emitter#info=dependencies)
[](https://david-dm.org/alykoshin/mini-emitter#info=devDependencies)
# mini-emitter
Simple Emitter for browser similar to the one in Node
Not yet ready for public usage.
If you have different needs regarding the functionality, please add a [feature request](https://github.com/alykoshin/mini-emitter/issues).
## Installation
```sh
npm install --save mini-emitter
```
## Usage
Not yet ready for public usage.
## Credits
[Alexander](https://github.com/alykoshin/)
## Links to package pages:
[github.com](https://github.com/alykoshin/mini-emitter) [npmjs.com](https://www.npmjs.com/package/mini-emitter) [travis-ci.org](https://travis-ci.org/alykoshin/mini-emitter) [coveralls.io](https://coveralls.io/github/alykoshin/mini-emitter) [inch-ci.org](http://inch-ci.org/github/alykoshin/mini-emitter)
## License
MIT
| alykoshin/mini-emitter | README.md | Markdown | mit | 1,742 | [
30522,
1031,
999,
1031,
27937,
2213,
2544,
1033,
1006,
16770,
1024,
1013,
1013,
10780,
1012,
8111,
1012,
22834,
1013,
1046,
2015,
1013,
7163,
1011,
12495,
12079,
1012,
17917,
2290,
1007,
1033,
1006,
8299,
1024,
1013,
1013,
10780,
1012,
8111... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
-- MySQL dump 10.13 Distrib 5.6.25, for debian-linux-gnu (x86_64)
--
-- Host: 192.168.1.15 Database: pipedot
-- ------------------------------------------------------
-- Server version 5.6.25-0ubuntu1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `article`
--
DROP TABLE IF EXISTS `article`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `article` (
`article_id` int(11) NOT NULL,
`author_link` varchar(200) NOT NULL,
`author_name` varchar(50) NOT NULL,
`body` text NOT NULL,
`comments_clean` int(11) NOT NULL,
`comments_total` int(11) NOT NULL,
`description` text NOT NULL,
`feed_html` text NOT NULL,
`feed_id` int(11) NOT NULL,
`guid` varchar(200) NOT NULL,
`link` varchar(200) NOT NULL,
`publish_time` int(11) NOT NULL,
`redirect_link` varchar(200) NOT NULL,
`title` varchar(200) NOT NULL,
`thumb_id` int(11) NOT NULL,
PRIMARY KEY (`article_id`),
UNIQUE KEY `article_guid` (`guid`),
KEY `article_feed` (`feed_id`,`publish_time`),
FULLTEXT KEY `title_search` (`title`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `avatar`
--
DROP TABLE IF EXISTS `avatar`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `avatar` (
`avatar_id` int(11) NOT NULL,
`hash_64` varchar(64) NOT NULL,
`hash_128` varchar(64) NOT NULL,
`hash_256` varchar(64) NOT NULL,
`time` int(11) NOT NULL,
`zid` varchar(50) NOT NULL,
PRIMARY KEY (`avatar_id`),
UNIQUE KEY `avatar_id_UNIQUE` (`avatar_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `ban_ip`
--
DROP TABLE IF EXISTS `ban_ip`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ban_ip` (
`remote_ip` varchar(45) NOT NULL,
`short_id` int(11) NOT NULL,
`time` int(11) NOT NULL,
`zid` varchar(50) NOT NULL,
PRIMARY KEY (`remote_ip`),
UNIQUE KEY `remote_ip_UNIQUE` (`remote_ip`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `ban_user`
--
DROP TABLE IF EXISTS `ban_user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ban_user` (
`zid` varchar(50) NOT NULL,
`short_id` int(11) NOT NULL,
`time` int(11) NOT NULL,
`editor_zid` varchar(50) NOT NULL,
PRIMARY KEY (`zid`),
UNIQUE KEY `zid_UNIQUE` (`zid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `bug`
--
DROP TABLE IF EXISTS `bug`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bug` (
`bug_id` int(11) NOT NULL,
`author_zid` varchar(50) NOT NULL,
`body` text NOT NULL,
`closed` int(11) NOT NULL,
`closed_zid` varchar(50) NOT NULL,
`comments_clean` int(11) NOT NULL,
`comments_total` int(11) NOT NULL,
`priority` varchar(20) NOT NULL,
`publish_time` int(11) NOT NULL,
`title` varchar(100) NOT NULL,
PRIMARY KEY (`bug_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `bug_file`
--
DROP TABLE IF EXISTS `bug_file`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bug_file` (
`bug_file_id` int(11) NOT NULL,
`bug_id` int(11) NOT NULL,
`hash` varchar(64) NOT NULL,
`name` varchar(100) NOT NULL,
`remote_ip` varchar(45) NOT NULL,
`server` varchar(50) NOT NULL,
`size` int(11) NOT NULL,
`time` int(11) NOT NULL,
`type` varchar(20) NOT NULL,
`zid` varchar(50) NOT NULL,
PRIMARY KEY (`bug_file_id`),
UNIQUE KEY `short_id_UNIQUE` (`bug_file_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `bug_label`
--
DROP TABLE IF EXISTS `bug_label`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bug_label` (
`label_id` int(11) NOT NULL AUTO_INCREMENT,
`label_name` varchar(20) NOT NULL,
`label_tag` varchar(20) NOT NULL,
`background_color` varchar(7) NOT NULL,
`foreground_color` varchar(7) NOT NULL,
`reportable` int(11) NOT NULL,
PRIMARY KEY (`label_id`),
UNIQUE KEY `label_id_UNIQUE` (`label_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `bug_labels`
--
DROP TABLE IF EXISTS `bug_labels`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bug_labels` (
`bug_id` int(11) NOT NULL,
`label_id` int(11) NOT NULL,
KEY `bug_label_bug_id` (`bug_id`),
KEY `bug_label_label_id` (`label_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `cache`
--
DROP TABLE IF EXISTS `cache`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cache` (
`cache_id` int(11) NOT NULL AUTO_INCREMENT,
`access_time` int(11) NOT NULL,
`create_time` int(11) NOT NULL,
`data_hash` varchar(64) NOT NULL,
`url` varchar(250) NOT NULL,
`url_hash` varchar(64) NOT NULL,
PRIMARY KEY (`cache_id`),
UNIQUE KEY `cache_id_UNIQUE` (`url_hash`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `captcha`
--
DROP TABLE IF EXISTS `captcha`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `captcha` (
`captcha_id` int(11) NOT NULL AUTO_INCREMENT,
`question` varchar(250) NOT NULL,
`answer` varchar(250) NOT NULL,
PRIMARY KEY (`captcha_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `captcha_challenge`
--
DROP TABLE IF EXISTS `captcha_challenge`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `captcha_challenge` (
`remote_ip` varchar(100) NOT NULL,
`captcha_id` int(11) NOT NULL,
PRIMARY KEY (`remote_ip`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `card`
--
DROP TABLE IF EXISTS `card`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `card` (
`card_id` int(11) NOT NULL,
`body` text NOT NULL,
`comments_clean` int(11) NOT NULL,
`comments_total` int(11) NOT NULL,
`edit_time` int(11) NOT NULL,
`image_id` int(11) NOT NULL,
`link_subject` varchar(200) NOT NULL,
`link_url` varchar(200) NOT NULL,
`photo_id` int(11) NOT NULL,
`publish_time` int(11) NOT NULL,
`zid` varchar(50) NOT NULL,
PRIMARY KEY (`card_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `card_edit`
--
DROP TABLE IF EXISTS `card_edit`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `card_edit` (
`card_id` varchar(64) NOT NULL,
`body` text NOT NULL,
`edit_time` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `card_tags`
--
DROP TABLE IF EXISTS `card_tags`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `card_tags` (
`card_id` int(11) NOT NULL,
`tag` varchar(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `comment`
--
DROP TABLE IF EXISTS `comment`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `comment` (
`comment_id` int(11) NOT NULL,
`article_id` int(11) NOT NULL,
`body` text NOT NULL,
`clean` int(11) NOT NULL,
`edit_time` int(11) NOT NULL,
`junk_status` int(11) NOT NULL,
`junk_time` int(11) NOT NULL,
`junk_zid` varchar(50) NOT NULL,
`parent_id` int(11) NOT NULL,
`publish_time` int(11) NOT NULL,
`remote_ip` varchar(45) NOT NULL,
`subject` varchar(100) NOT NULL,
`zid` varchar(50) NOT NULL,
PRIMARY KEY (`comment_id`),
KEY `comment_zid` (`zid`),
KEY `comment_article_id` (`article_id`),
FULLTEXT KEY `comment_search` (`subject`,`body`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `comment_edit`
--
DROP TABLE IF EXISTS `comment_edit`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `comment_edit` (
`comment_id` int(11) NOT NULL,
`edit_time` int(11) NOT NULL,
`body` text NOT NULL,
`subject` varchar(100) NOT NULL,
KEY `comment_edit_index` (`comment_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `comment_view`
--
DROP TABLE IF EXISTS `comment_view`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `comment_view` (
`article_id` int(11) NOT NULL,
`zid` varchar(50) NOT NULL,
`comments_clean` int(11) NOT NULL DEFAULT '-1',
`comments_total` int(11) NOT NULL DEFAULT '-1',
`time` int(11) NOT NULL,
`last_time` int(11) NOT NULL,
PRIMARY KEY (`article_id`,`zid`),
KEY `view_article_id` (`article_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `comment_vote`
--
DROP TABLE IF EXISTS `comment_vote`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `comment_vote` (
`comment_id` int(11) NOT NULL,
`zid` varchar(50) NOT NULL,
`reason` varchar(20) NOT NULL,
`time` int(11) NOT NULL,
`value` int(11) NOT NULL,
PRIMARY KEY (`comment_id`,`zid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `contact`
--
DROP TABLE IF EXISTS `contact`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contact` (
`contact_id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(50) NOT NULL,
`name` varchar(50) NOT NULL,
`zid` varchar(50) NOT NULL,
PRIMARY KEY (`contact_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `country`
--
DROP TABLE IF EXISTS `country`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `country` (
`country_id` int(11) NOT NULL AUTO_INCREMENT,
`country_code` varchar(2) NOT NULL,
`country_name` varchar(50) NOT NULL,
PRIMARY KEY (`country_id`),
UNIQUE KEY `country_id_UNIQUE` (`country_id`),
UNIQUE KEY `country_code_unique` (`country_code`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `default_conf`
--
DROP TABLE IF EXISTS `default_conf`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `default_conf` (
`conf` varchar(50) NOT NULL,
`name` varchar(50) NOT NULL,
`value` varchar(250) NOT NULL,
UNIQUE KEY `default_conf_unique` (`conf`,`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `drive_data`
--
DROP TABLE IF EXISTS `drive_data`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `drive_data` (
`hash` varchar(64) NOT NULL,
`server_id` int(11) NOT NULL,
`size` bigint(20) NOT NULL,
PRIMARY KEY (`hash`),
UNIQUE KEY `hash_UNIQUE` (`hash`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `drive_dir`
--
DROP TABLE IF EXISTS `drive_dir`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `drive_dir` (
`dir_id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`parent_id` int(11) NOT NULL,
`time` int(11) NOT NULL,
`zid` varchar(50) NOT NULL,
PRIMARY KEY (`dir_id`),
UNIQUE KEY `path_id_UNIQUE` (`dir_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `drive_file`
--
DROP TABLE IF EXISTS `drive_file`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `drive_file` (
`file_id` int(11) NOT NULL AUTO_INCREMENT,
`hash` varchar(64) NOT NULL,
`name` varchar(255) NOT NULL,
`parent_id` int(11) NOT NULL,
`time` int(11) NOT NULL,
`type` int(11) NOT NULL,
`zid` varchar(50) NOT NULL,
PRIMARY KEY (`file_id`),
UNIQUE KEY `file_id_UNIQUE` (`file_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `drive_link`
--
DROP TABLE IF EXISTS `drive_link`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `drive_link` (
`hash` varchar(64) NOT NULL,
`item_id` int(11) NOT NULL,
`type_id` int(11) NOT NULL,
`zid` varchar(50) NOT NULL,
PRIMARY KEY (`hash`,`item_id`,`type_id`),
UNIQUE KEY `drive_link_unique` (`hash`,`item_id`,`type_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `drive_server`
--
DROP TABLE IF EXISTS `drive_server`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `drive_server` (
`server_id` int(11) NOT NULL AUTO_INCREMENT,
`server_name` varchar(50) NOT NULL,
PRIMARY KEY (`server_id`),
UNIQUE KEY `server_id_UNIQUE` (`server_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `drive_version`
--
DROP TABLE IF EXISTS `drive_version`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `drive_version` (
`file_id` int(11) NOT NULL,
`version` int(11) NOT NULL,
`hash` varchar(64) NOT NULL,
`time` int(11) NOT NULL,
PRIMARY KEY (`file_id`,`version`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `email_challenge`
--
DROP TABLE IF EXISTS `email_challenge`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `email_challenge` (
`code` varchar(64) NOT NULL,
`email` varchar(50) NOT NULL,
`expires` int(11) NOT NULL,
`username` varchar(20) NOT NULL,
PRIMARY KEY (`code`),
UNIQUE KEY `code_UNIQUE` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `feed`
--
DROP TABLE IF EXISTS `feed`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `feed` (
`feed_id` int(11) NOT NULL,
`copyright` varchar(200) NOT NULL,
`description` varchar(200) NOT NULL,
`link` varchar(200) NOT NULL,
`slug` varchar(200) NOT NULL,
`time` int(11) NOT NULL,
`title` varchar(200) NOT NULL,
`topic_id` int(11) NOT NULL,
`uri` varchar(200) NOT NULL,
PRIMARY KEY (`feed_id`),
UNIQUE KEY `feed_slug` (`slug`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `feed_topic`
--
DROP TABLE IF EXISTS `feed_topic`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `feed_topic` (
`topic_id` int(11) NOT NULL AUTO_INCREMENT,
`icon` varchar(20) NOT NULL,
`name` varchar(50) NOT NULL,
`slug` varchar(50) NOT NULL,
PRIMARY KEY (`topic_id`),
UNIQUE KEY `feed_topic_slug` (`slug`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `feed_user`
--
DROP TABLE IF EXISTS `feed_user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `feed_user` (
`zid` varchar(50) NOT NULL,
`feed_id` int(11) NOT NULL,
`col` int(11) NOT NULL,
`pos` int(11) NOT NULL,
PRIMARY KEY (`zid`,`feed_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `image`
--
DROP TABLE IF EXISTS `image`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `image` (
`image_id` int(11) NOT NULL AUTO_INCREMENT,
`hash` varchar(64) NOT NULL,
`original_width` int(11) NOT NULL,
`original_height` int(11) NOT NULL,
`original_url` varchar(250) NOT NULL,
`parent_url` varchar(250) NOT NULL,
`server` varchar(50) NOT NULL,
`time` int(11) NOT NULL,
`zid` varchar(50) NOT NULL,
PRIMARY KEY (`image_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `image_style`
--
DROP TABLE IF EXISTS `image_style`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `image_style` (
`image_style_id` int(11) NOT NULL AUTO_INCREMENT,
`description` varchar(50) NOT NULL,
PRIMARY KEY (`image_style_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `ip`
--
DROP TABLE IF EXISTS `ip`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ip` (
`ip_id` int(11) NOT NULL AUTO_INCREMENT,
`address` varchar(45) NOT NULL,
`country_id` int(11) NOT NULL,
`latitude` int(11) NOT NULL,
`longitude` int(11) NOT NULL,
PRIMARY KEY (`ip_id`),
UNIQUE KEY `ip_id_UNIQUE` (`ip_id`),
UNIQUE KEY `remote_ip_UNIQUE` (`address`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `journal`
--
DROP TABLE IF EXISTS `journal`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `journal` (
`journal_id` int(11) NOT NULL,
`body` text NOT NULL,
`comments_clean` int(11) NOT NULL,
`comments_total` int(11) NOT NULL,
`edit_time` int(11) NOT NULL,
`photo_id` int(11) NOT NULL,
`publish_time` int(11) NOT NULL,
`published` int(11) NOT NULL,
`slug` varchar(100) NOT NULL,
`title` varchar(100) NOT NULL,
`topic` varchar(20) NOT NULL,
`zid` varchar(50) NOT NULL,
PRIMARY KEY (`journal_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `journal_photo`
--
DROP TABLE IF EXISTS `journal_photo`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `journal_photo` (
`journal_id` int(11) NOT NULL,
`photo_id` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `karma_log`
--
DROP TABLE IF EXISTS `karma_log`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `karma_log` (
`zid` varchar(50) NOT NULL,
`time` int(11) NOT NULL,
`value` int(11) NOT NULL,
`type_id` int(11) NOT NULL,
`id` int(11) NOT NULL,
KEY `karma_index` (`zid`,`time`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `karma_type`
--
DROP TABLE IF EXISTS `karma_type`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `karma_type` (
`type_id` int(11) NOT NULL AUTO_INCREMENT,
`type` varchar(100) NOT NULL,
`value` int(11) NOT NULL,
PRIMARY KEY (`type_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `login`
--
DROP TABLE IF EXISTS `login`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `login` (
`zid` varchar(50) NOT NULL,
`login_key` varchar(64) NOT NULL,
`agent_id` int(11) NOT NULL,
`ip_id` int(11) NOT NULL,
`last_time` int(11) NOT NULL,
`login_time` int(11) NOT NULL,
`os_id` int(11) NOT NULL,
PRIMARY KEY (`login_key`,`zid`),
UNIQUE KEY `login_unique` (`zid`,`login_key`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `mail`
--
DROP TABLE IF EXISTS `mail`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mail` (
`mail_id` int(11) NOT NULL AUTO_INCREMENT,
`body` text NOT NULL,
`in_reply_to` varchar(250) NOT NULL,
`location` varchar(250) NOT NULL,
`mail_from` varchar(250) NOT NULL,
`message_id` varchar(250) NOT NULL,
`received_time` int(11) NOT NULL DEFAULT '0',
`rcpt_to` varchar(250) NOT NULL,
`reply_to` varchar(250) NOT NULL,
`size` int(11) NOT NULL DEFAULT '0',
`subject` varchar(250) NOT NULL,
`zid` varchar(50) NOT NULL,
PRIMARY KEY (`mail_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `mail_dir`
--
DROP TABLE IF EXISTS `mail_dir`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mail_dir` (
`dir_id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`slug` varchar(50) NOT NULL,
`zid` varchar(50) NOT NULL,
PRIMARY KEY (`dir_id`),
UNIQUE KEY `slug_unique` (`zid`,`slug`),
KEY `zid_index` (`zid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `notification`
--
DROP TABLE IF EXISTS `notification`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `notification` (
`notification_id` int(11) NOT NULL AUTO_INCREMENT,
`item_id` int(11) NOT NULL,
`parent_id` int(11) NOT NULL,
`time` int(11) NOT NULL,
`type_id` int(11) NOT NULL,
`zid` varchar(50) NOT NULL,
PRIMARY KEY (`notification_id`),
KEY `notification_index` (`zid`,`time`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `page`
--
DROP TABLE IF EXISTS `page`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `page` (
`slug` varchar(100) NOT NULL,
`title` varchar(100) NOT NULL,
`body` text NOT NULL,
PRIMARY KEY (`slug`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `photo`
--
DROP TABLE IF EXISTS `photo`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `photo` (
`photo_id` int(11) NOT NULL,
`aspect_width` int(11) NOT NULL,
`aspect_height` int(11) NOT NULL,
`has_medium` int(11) NOT NULL,
`has_large` int(11) NOT NULL,
`hash` varchar(64) NOT NULL,
`original_name` varchar(250) NOT NULL,
`original_width` int(11) NOT NULL,
`original_height` int(11) NOT NULL,
`server` varchar(50) NOT NULL,
`size` int(11) NOT NULL,
`time` int(11) NOT NULL,
`zid` varchar(50) NOT NULL,
PRIMARY KEY (`photo_id`),
UNIQUE KEY `short_id_UNIQUE` (`photo_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `pipe`
--
DROP TABLE IF EXISTS `pipe`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `pipe` (
`pipe_id` int(11) NOT NULL,
`author_zid` varchar(50) NOT NULL,
`body` text NOT NULL,
`closed` tinyint(4) NOT NULL,
`comments_clean` int(11) NOT NULL,
`comments_total` int(11) NOT NULL,
`edit_zid` varchar(50) NOT NULL,
`icon` varchar(20) NOT NULL,
`keywords` varchar(100) NOT NULL,
`reason` varchar(50) NOT NULL,
`slug` varchar(100) NOT NULL,
`time` int(11) NOT NULL,
`title` varchar(100) NOT NULL,
`topic_id` int(11) NOT NULL,
PRIMARY KEY (`pipe_id`),
KEY `pipe_time` (`time`),
FULLTEXT KEY `pipe_search` (`body`,`title`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `pipe_vote`
--
DROP TABLE IF EXISTS `pipe_vote`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `pipe_vote` (
`pipe_id` int(11) NOT NULL,
`zid` varchar(50) NOT NULL,
`time` int(11) NOT NULL,
`value` int(11) NOT NULL,
PRIMARY KEY (`pipe_id`,`zid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `poll`
--
DROP TABLE IF EXISTS `poll`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `poll` (
`poll_id` int(11) NOT NULL,
`comments_clean` int(11) NOT NULL,
`comments_total` int(11) NOT NULL,
`promoted` int(11) NOT NULL,
`publish_time` int(11) NOT NULL,
`question` varchar(200) NOT NULL,
`slug` varchar(200) NOT NULL,
`type_id` int(11) NOT NULL,
`zid` varchar(50) NOT NULL,
PRIMARY KEY (`poll_id`),
KEY `poll_time` (`publish_time`),
FULLTEXT KEY `poll_search` (`question`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `poll_answer`
--
DROP TABLE IF EXISTS `poll_answer`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `poll_answer` (
`answer_id` int(11) NOT NULL AUTO_INCREMENT,
`poll_id` int(11) NOT NULL,
`answer` varchar(200) NOT NULL,
`position` int(11) NOT NULL,
PRIMARY KEY (`answer_id`),
UNIQUE KEY `aid_UNIQUE` (`answer_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `poll_type`
--
DROP TABLE IF EXISTS `poll_type`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `poll_type` (
`type_id` int(11) NOT NULL AUTO_INCREMENT,
`poll_type` varchar(50) NOT NULL,
PRIMARY KEY (`type_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `poll_vote`
--
DROP TABLE IF EXISTS `poll_vote`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `poll_vote` (
`poll_id` int(11) NOT NULL,
`zid` varchar(50) NOT NULL,
`answer_id` int(11) NOT NULL,
`time` int(11) NOT NULL,
`points` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `reader_topic`
--
DROP TABLE IF EXISTS `reader_topic`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `reader_topic` (
`topic_id` int(11) NOT NULL AUTO_INCREMENT,
`icon` varchar(20) NOT NULL,
`name` varchar(50) NOT NULL,
`slug` varchar(50) NOT NULL,
`zid` varchar(50) NOT NULL,
PRIMARY KEY (`topic_id`),
UNIQUE KEY `topic_id_UNIQUE` (`topic_id`),
UNIQUE KEY `slug_UNIQUE` (`zid`,`slug`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `reader_user`
--
DROP TABLE IF EXISTS `reader_user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `reader_user` (
`zid` varchar(64) NOT NULL,
`feed_id` int(11) NOT NULL,
`name` varchar(50) NOT NULL,
`slug` varchar(50) NOT NULL,
`topic_id` int(11) NOT NULL,
PRIMARY KEY (`zid`,`feed_id`),
UNIQUE KEY `reader_user_feed_unique` (`zid`,`feed_id`),
UNIQUE KEY `reader_user_slug_unique` (`zid`,`slug`),
UNIQUE KEY `reader_user_name_unique` (`zid`,`name`),
KEY `reader_user_zid` (`zid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `screenshot`
--
DROP TABLE IF EXISTS `screenshot`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `screenshot` (
`short_id` int(11) NOT NULL,
`screenshot_id` varchar(64) NOT NULL,
`body` text NOT NULL,
`hash` varchar(64) NOT NULL,
`height` int(11) NOT NULL,
`size` int(11) NOT NULL,
`type` varchar(3) NOT NULL,
`width` int(11) NOT NULL,
PRIMARY KEY (`short_id`),
UNIQUE KEY `short_id_UNIQUE` (`short_id`),
UNIQUE KEY `screenshot_id_UNIQUE` (`screenshot_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `server_conf`
--
DROP TABLE IF EXISTS `server_conf`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `server_conf` (
`name` varchar(50) NOT NULL,
`value` varchar(250) NOT NULL,
PRIMARY KEY (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `short`
--
DROP TABLE IF EXISTS `short`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `short` (
`short_id` int(11) NOT NULL AUTO_INCREMENT,
`type_id` int(11) NOT NULL,
PRIMARY KEY (`short_id`),
UNIQUE KEY `short_id_UNIQUE` (`short_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `short_view`
--
DROP TABLE IF EXISTS `short_view`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `short_view` (
`view_id` bigint(20) NOT NULL AUTO_INCREMENT,
`short_id` int(11) NOT NULL,
`agent` varchar(250) NOT NULL,
`referer` varchar(250) NOT NULL,
`remote_ip` varchar(45) NOT NULL,
`time` int(11) NOT NULL,
`zid` varchar(50) NOT NULL,
PRIMARY KEY (`view_id`),
UNIQUE KEY `view_id_UNIQUE` (`view_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `store_cart`
--
DROP TABLE IF EXISTS `store_cart`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `store_cart` (
`customer_id` int(11) NOT NULL,
`item_id` int(11) NOT NULL,
`quantity` int(11) NOT NULL,
PRIMARY KEY (`customer_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `store_category`
--
DROP TABLE IF EXISTS `store_category`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `store_category` (
`category_id` int(11) NOT NULL AUTO_INCREMENT,
`category_description` text NOT NULL,
`category_icon` varchar(20) NOT NULL,
`category_name` varchar(50) NOT NULL,
PRIMARY KEY (`category_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `store_feature`
--
DROP TABLE IF EXISTS `store_feature`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `store_feature` (
`feature_id` int(11) NOT NULL AUTO_INCREMENT,
`category_id` int(11) NOT NULL,
`feature_description` text NOT NULL,
`feature_name` varchar(50) NOT NULL,
PRIMARY KEY (`feature_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `store_image`
--
DROP TABLE IF EXISTS `store_image`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `store_image` (
`image_id` int(11) NOT NULL AUTO_INCREMENT,
`item_id` int(11) NOT NULL,
PRIMARY KEY (`image_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `store_item`
--
DROP TABLE IF EXISTS `store_item`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `store_item` (
`item_id` int(11) NOT NULL AUTO_INCREMENT,
`category_id` int(11) NOT NULL,
`description` text NOT NULL,
`featured` int(11) NOT NULL,
`image_id` int(11) NOT NULL,
`name` varchar(50) NOT NULL,
`price` int(11) NOT NULL,
`shipping` int(11) NOT NULL,
`title` varchar(50) NOT NULL,
`features` varchar(50) NOT NULL,
PRIMARY KEY (`item_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `store_item_feature`
--
DROP TABLE IF EXISTS `store_item_feature`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `store_item_feature` (
`feature_id` int(11) NOT NULL,
`item_id` int(11) NOT NULL,
`value` varchar(50) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `store_item_image`
--
DROP TABLE IF EXISTS `store_item_image`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `store_item_image` (
`image_id` int(11) NOT NULL,
`item_id` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `story`
--
DROP TABLE IF EXISTS `story`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `story` (
`story_id` int(11) NOT NULL,
`author_zid` varchar(50) NOT NULL,
`body` text NOT NULL,
`comments_clean` int(11) NOT NULL,
`comments_total` int(11) NOT NULL,
`edit_time` int(11) NOT NULL,
`edit_zid` varchar(50) NOT NULL,
`icon` varchar(20) NOT NULL,
`image_id` int(11) NOT NULL,
`keywords` varchar(100) NOT NULL,
`pipe_id` int(11) NOT NULL,
`publish_time` int(11) NOT NULL,
`slug` varchar(100) NOT NULL,
`title` varchar(100) NOT NULL,
`topic_id` int(11) NOT NULL,
`tweet_id` bigint(20) NOT NULL,
PRIMARY KEY (`story_id`),
KEY `story_publish_time` (`publish_time`),
FULLTEXT KEY `story_search` (`title`,`body`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `story_edit`
--
DROP TABLE IF EXISTS `story_edit`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `story_edit` (
`story_id` varchar(64) NOT NULL,
`body` text NOT NULL,
`edit_time` int(11) NOT NULL,
`edit_zid` varchar(50) NOT NULL,
`icon` varchar(20) NOT NULL,
`image_id` int(11) NOT NULL,
`slug` varchar(100) NOT NULL,
`title` varchar(100) NOT NULL,
`topic_id` int(11) NOT NULL,
UNIQUE KEY `story_edit_index` (`edit_time`,`story_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `stream_main`
--
DROP TABLE IF EXISTS `stream_main`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `stream_main` (
`article_id` int(11) NOT NULL,
`time` int(11) NOT NULL,
PRIMARY KEY (`article_id`),
KEY `stream_time` (`time`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `stream_user`
--
DROP TABLE IF EXISTS `stream_user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `stream_user` (
`zid` varchar(50) NOT NULL,
`article_id` int(11) NOT NULL,
`time` int(11) NOT NULL,
PRIMARY KEY (`zid`,`article_id`),
KEY `stream_time` (`zid`,`time`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `stream_vote`
--
DROP TABLE IF EXISTS `stream_vote`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `stream_vote` (
`zid` varchar(50) NOT NULL,
`article_id` int(11) NOT NULL,
`time` int(11) NOT NULL,
`value` int(11) NOT NULL,
PRIMARY KEY (`zid`,`article_id`),
KEY `stream_vote_card_id` (`article_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `tag`
--
DROP TABLE IF EXISTS `tag`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tag` (
`tag_id` int(11) NOT NULL AUTO_INCREMENT,
`tag` varchar(20) NOT NULL,
PRIMARY KEY (`tag_id`),
UNIQUE KEY `tag_UNIQUE` (`tag`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `thumb`
--
DROP TABLE IF EXISTS `thumb`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `thumb` (
`thumb_id` int(11) NOT NULL,
`hash` varchar(64) NOT NULL,
`low_res` int(11) NOT NULL,
`time` int(11) NOT NULL,
PRIMARY KEY (`thumb_id`),
UNIQUE KEY `thumb_id_UNIQUE` (`thumb_id`),
UNIQUE KEY `hash_UNIQUE` (`hash`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `tmp_image`
--
DROP TABLE IF EXISTS `tmp_image`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tmp_image` (
`tmp_image_id` int(11) NOT NULL AUTO_INCREMENT,
`hash` varchar(64) NOT NULL,
`original_width` int(11) NOT NULL,
`original_height` int(11) NOT NULL,
`original_url` varchar(250) NOT NULL,
`parent_url` varchar(250) NOT NULL,
`server` varchar(50) NOT NULL,
`time` int(11) NOT NULL,
`zid` varchar(50) NOT NULL,
PRIMARY KEY (`tmp_image_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `topic`
--
DROP TABLE IF EXISTS `topic`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `topic` (
`topic_id` int(11) NOT NULL AUTO_INCREMENT,
`icon` varchar(20) NOT NULL,
`promoted` tinyint(4) NOT NULL,
`slug` varchar(50) NOT NULL,
`topic` varchar(50) NOT NULL,
PRIMARY KEY (`topic_id`),
UNIQUE KEY `slug_UNIQUE` (`slug`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `user`
--
DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user` (
`user_id` int(11) NOT NULL,
`zid` varchar(50) NOT NULL,
PRIMARY KEY (`user_id`),
UNIQUE KEY `zid_UNIQUE` (`zid`),
UNIQUE KEY `user_id_UNIQUE` (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `user_conf`
--
DROP TABLE IF EXISTS `user_conf`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_conf` (
`zid` varchar(50) NOT NULL,
`name` varchar(50) NOT NULL,
`value` varchar(250) NOT NULL,
UNIQUE KEY `user_conf_unique` (`zid`,`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2015-10-28 23:13:02
| bet0x/pipecode | schema.sql | SQL | agpl-3.0 | 42,302 | [
30522,
1011,
1011,
2026,
2015,
4160,
2140,
15653,
2184,
1012,
2410,
4487,
3367,
3089,
2497,
1019,
1012,
1020,
1012,
2423,
1010,
2005,
2139,
15599,
1011,
11603,
1011,
27004,
1006,
1060,
20842,
1035,
4185,
1007,
1011,
1011,
1011,
1011,
3677,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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) 2017 IBM 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:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@org.osgi.annotation.versioning.Version("1.0.16")
package com.ibm.ws.security.wim.registry.dataobject;
| OpenLiberty/open-liberty | dev/com.ibm.ws.security.wim.registry/src/com/ibm/ws/security/wim/registry/dataobject/package-info.java | Java | epl-1.0 | 638 | [
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... |
edb is available under the GPL 2 license, see the COPYING for details.
NOTE: This README now only covers the most essential documentation, for more
complete documentation see the html files in the doc/ directory.
Compiling
---------
Compiling edb is generally quite simple. edb currently depends on the
following packages:
Qt >= 4.6
boost >= 1.35 (headers only)
Many distributions already have packages that satisify these.
Once you have QT and boost installed, it is as simple as
$ qmake
$ make
This will build the debugger along with all plugins I have written. On certain
systems your qmake may be named slightly differently, I've noticed that the
Fedora Core rpms name it qmake-qt4.
If you are planning on doing a make install, you likely want to specify the
default plugin path, here's how you would do that.
$ qmake -makefile DEFAULT_PLUGIN_PATH="/usr/lib/edb/"
$ make
Installing
----------
Basic installation is simple, you may run
$ make install
Or if you would like to specify where things should go, you probably want to
use something like this
make INSTALL_ROOT=/usr/ install
In which case the plugins will be installed in /usr/lib/edb and the binaries
will be installed in /usr/bin/. Finally, if you are doing a make install, you
probably want to specify a default plugin path, this is done during the qmake
process.
Generating Symbols
------------------
In order to have edb take advantage of certain features (such as the Heap
analyzer plugin), it will need some symbol maps to work with. The easiest way
to create these is to run edb with the --symbols flag, here's an example:
$ ./edb --symbols /lib/libc.so.6 > symbols/libc.so.6.map
The name of the symbol file IS IMPORTANT, a quick and dirty way to get all
symbols from most existing libraries on your system would be like this:
$ for i in $(ls /lib/*.so* /usr/lib/*.so*); do ./edb --symbols $i > symbols/$(basename $i).map; done
This will take a moment, but not that long and you will have symbols based on
all libraries on your system. Note that the edb_make_symbolmap script will work
on regular binaries as well, not just libraries. So if you are debugging an
application, you may want to generate its symbols as well. Eventually, I will
build a "Regenerate Symbols" feature into edb (a plugin perhaps?), but for now,
the script will have to do.
NOTE: as of version 0.8.5 the symbol map format has changed slightly, you will
need to regenerate your map files.
Also, don't forget to set the symbols directory in the options dialog to the
directory which you placed the map files!
| 7u83/edc | README.md | Markdown | gpl-2.0 | 2,595 | [
30522,
3968,
2497,
2003,
2800,
2104,
1996,
14246,
2140,
1016,
6105,
1010,
2156,
1996,
24731,
2005,
4751,
1012,
3602,
1024,
2023,
3191,
4168,
2085,
2069,
4472,
1996,
2087,
6827,
12653,
1010,
2005,
2062,
3143,
12653,
2156,
1996,
16129,
6764,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
/******************************
Description: Net handler base.
Author: M.Wan
Date: 3/14/2015
******************************/
#ifndef __NET_NET_HANDLER__
#define __NET_NET_HANDLER__
#include "../base/mwbase.h"
#include <string>
MW_FRAMEWORK_BEGIN
class MWNetResponse;
/**
* A handler class to handle the network response.
*/
class MW_DLL MWNetHandler : public MWObject
{
public:
/**
* Create a NetHandler object.
* @note This method is just for script. Please don't create it in cpp.
*/
static MWNetHandler *create();
/**
* MWNetHandler destructor.
*/
virtual ~MWNetHandler() {}
/**
* Protocols about how to handle successful/failed message.
*/
virtual void handleSuccessfulMessage(MWNetResponse *response);
virtual void handleFailedMessage(MWNetResponse *response);
protected:
MWNetHandler() {}
};
MW_FRAMEWORK_END
#endif
| wanmaple/MWFrameworkForCocosLua | frameworks/runtime-src/Framework/net/MWNetHandler.h | C | apache-2.0 | 911 | [
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,
6412,
1024,
5658,
28213,
2918,
1012,
3166,
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... |
var fs = require('fs'),
path = require('path'),
cleanCSS = require('clean-css'),
rjs = require('requirejs');
module.exports = function(grunt) {
// **css* task works pretty much the same as grunt's min task. The task
// target is the destination, data is an array of glob patterns. These
// files are concataned and run through requirejs optimizer to handle
// @import inlines in CSS files.
grunt.task.registerMultiTask('css', 'Concats, replaces @imports and minifies the CSS files', function() {
this.requiresConfig('staging');
// if defined, files get prepended by the output config value
var files = this.data;
// subtarget name is the output destination
var target = this.target;
// async task
var cb = this.async();
// concat prior to rjs optimize css, and before min max info
grunt.log.write('Writing css files to ' + target + '...');
var out = grunt.helper('mincss', files);
// only go through if their's file to process
if(!out) {
return cb();
}
// write minified file before going through rjs:optimize to possibly inline
// @imports (that are not handled by compass within .scss or .sass files)
grunt.file.write(target, out);
// replace @import statements
//
// XXX no error handling in this helper so far..
// Check that rjs returns an error when something wrong (if it throws...)
// if it is bubble the error back here
grunt.helper('rjs:optimize:css', target, function() {
// do the minification once inline imports are done
grunt.log.ok();
cb();
});
});
//
// **mincss** basic utility to concat CSS files and run them through
// [cleanCSS](https://github.com/GoalSmashers/clean-css), might opt to use
// [https://github.com/jzaefferer/grunt-css] plugin.
//
grunt.registerHelper('mincss', function(files, o) {
o = o || {};
files = grunt.file.expandFiles(files);
return files.map(function(filepath) {
var content = grunt.file.read(filepath);
return o.nocompress ? content : cleanCSS.process(content);
}).join('');
});
// **rjs:optimize:css** is an helper using rjs to optimize a single file,
// mainly to properly import multi-level of @import statements, which can be
// tricky with all the url rewrites.
//
// file - Path to the css file to optimize
// options - (optional) rjs configuration
// cb - callback function to call on completion
grunt.registerHelper('rjs:optimize:css', function(file, options, cb) {
if(!cb) { cb = options; options = {}; }
options.cssIn = file;
options.out = options.out || file;
options.optimizeCss = 'standard.keepComments.keepLines';
var before = grunt.file.read(file);
rjs.optimize(options, function() {
grunt.helper('min_max_info', grunt.file.read(file), before);
cb();
});
});
};
| josephgvariam/jems | jems/node_modules/yeoman/tasks/css.js | JavaScript | mit | 2,885 | [
30522,
13075,
1042,
2015,
1027,
5478,
1006,
1005,
1042,
2015,
1005,
1007,
1010,
4130,
1027,
5478,
1006,
1005,
4130,
1005,
1007,
1010,
4550,
6169,
2015,
1027,
5478,
1006,
1005,
4550,
1011,
20116,
2015,
1005,
1007,
1010,
1054,
22578,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
if (Meteor.isServer) {
var
//// A lookup-table whose keys are generated each time an ‘you.register’ form is rendered using the `babelslug()` method.
//// The key is a babelslug, followed by hyphen, followed by a Meteor connection ID (like a session ID for anon users).
//// The value is the unix timestamp in milliseconds, which allows us to clear out old and unused babelslugs.
//// Two examples are shown here:
recentBabelslugs = { // @todo for a multi-servo project, move this functionality to a shared mongoDB collection
// 'MagentaMouse-KukNJw4d4vjGzzrQa': 1409341347912,
// 'BlueChessCat-YYJWMWTPq7RFWdKr6': 1409341399283
}
//// Clear out stale elements in the `recentBabelslugs` lookup-table.
, recentBabelslugsHousekeeping = function () {
var key
, now = Date.now()
;
for (key in recentBabelslugs) {
if (15 * 60 * 1000 < now - recentBabelslugs[key]) { // allow a user 15 minutes to fill in the registration form
delete recentBabelslugs[key];
}
}
}
//// Check how many times a given `username` exists in the user database. If all’s well, this should only ever return `0` or `1`.
, usernameCount = function (username) {
return Meteor.users.find({ 'profile.username': username }).count();
}
//// BabelSlug, from Rich Plastow’s work, 2014-02-09.
, ucs2 = [
[ // animal
{ en:'slug' ,es:'babosa' ,ru:'\u0441\u043B\u0438\u0437\u043D\u044F\u043A',fr:'limace' ,zh:'\u86DE\u8753',ar:'\u064A\u0631\u0642\u0627\u0646\u0629' }
, { en:'mouse' ,es:'rat\u00F3n',ru:'\u043C\u044B\u0448\u044C' ,fr:'souris' ,zh:'\u9F20\u6807',ar:'\u0641\u0623\u0631' }
, { en:'cow' ,es:'vaca' ,ru:'\u043A\u043E\u0440\u043E\u0432\u0430' ,fr:'vache' ,zh:'\u725B' ,ar:'\u0628\u0642\u0631\u0629' }
, { en:'cat' ,es:'gato' ,ru:'\u043A\u043E\u0448\u043A\u0430' ,fr:'chat' ,zh:'\u732B' ,ar:'\u0642\u0637' }
, { en:'rabbit',es:'conejo' ,ru:'\u043A\u0440\u043E\u043B\u0438\u043A' ,fr:'lapin' ,zh:'\u5154' ,ar:'\u0623\u0631\u0646\u0628' }
, { en:'deer' ,es:'ciervo' ,ru:'\u043E\u043B\u0435\u043D\u044C' ,fr:'cerf' ,zh:'\u9E7F' ,ar:'\u0623\u064A\u0644' }
, { en:'bear' ,es:'oso' ,ru:'\u043C\u0435\u0434\u0432\u0435\u0434\u044C',fr:'ours' ,zh:'\u718A' ,ar:'\u062F\u064F\u0628\u0651' }
, { en:'frog' ,es:'rana' ,ru:'\u043B\u044F\u0433\u0443\u0448\u043A\u0430',fr:'grenouille',zh:'\u9752\u86D9',ar:'\u0636\u0641\u062F\u0639' }
]
// , [ // texture
// { en:'-' ,es:'-' ,ru:'-' ,fr:'-' ,zh:'-' ,ar:'-' }
// , { en:'dotted' ,es:'punteado',ru:[1087,1091,1085,1082,1090,1080,1088,1085,1099,1081],fr:'pointill\u00E9',zh:[26001,28857],ar:[1605,1606,1602,1591] }
// , { en:'striped',es:'rayas' ,ru:[1087,1086,1083,1086,1089,1072,1090,1099,1081] ,fr:'ray\u00E9' ,zh:[26465,32441],ar:[1605,1602,1604,1605] }
// , { en:'chess' ,es:'ajedrez' ,ru:[1096,1072,1093,1084,1072,1090,1099] ,fr:'\u00E9checs' ,zh:[26827] ,ar:[1588,1591,1585,1606,1580] }
// ]
, [ // color1
{ en:'-' ,es:'-' ,ru:'-' ,fr:'-' ,zh:'-' ,ar:'-' }
, { en:'red' ,es:'rojo' ,ru:[1082,1088,1072,1089,1085,1099,1081] ,fr:'rouge' ,zh:[32418] ,ar:[1571,1581,1605,1585] }
, { en:'orange' ,es:'naranja' ,ru:[1086,1088,1072,1085,1078,1077,1074,1099,1081],fr:'orange' ,zh:[27225] ,ar:[1575,1604,1576,1585,1578,1602,1575,1604,1610] }
, { en:'yellow' ,es:'amarillo',ru:[1078,1077,1083,1090,1099,1081] ,fr:'jaune' ,zh:[40644] ,ar:[1571,1589,1601,1585] }
, { en:'green' ,es:'verde' ,ru:[1079,1077,1083,1077,1085,1099,1081] ,fr:'vert' ,zh:[32511] ,ar:[1571,1582,1590,1585] }
// , { en:'cyan' ,es:'cian' ,ru:[1075,1086,1083,1091,1073,1086,1081] ,fr:'cyan' ,zh:[38738] ,ar:[1587,1605,1575,1608,1610] }
, { en:'blue' ,es:'azul' ,ru:[1089,1080,1085,1080,1081] ,fr:'bleu' ,zh:[34013] ,ar:[1571,1586,1585,1602] }
, { en:'purple' ,es:'magenta' ,ru:[1087,1091,1088,1087,1091,1088,1085,1099,1081],fr:'magenta',zh:[27915,32418],ar:[1571,1585,1580,1608,1575,1606,1610] } // @todo translate purple (these are for magenta)
]
, [ // emotion @todo convert remaining languages from 2014-Work/BabelSlug/README.md
{ en:'-' ,es:'-' ,fr:'-' }
, { en:'happy' ,es:'feliz' ,fr:'heureux' }
// , { en:'sad' ,es:'triste' ,fr:'triste' }
, { en:'laughing' ,es:'risa' ,fr:'rire' }
, { en:'sleepy' ,es:'soñoliento' ,fr:'somnolent' }
, { en:'surprised',es:'sorprendido',fr:'étonné' }
// , { en:'playful' ,es:'juguetón' ,fr:'espiègle' }
, { en:'confused' ,es:'confundido' ,fr:'embrouillé' }
]
]
//// Prepare an empty cache, which may contain HTML entities converted from `ucs2`, if required.
, html = (function () {
var i, j, l, m ,html = {};
for (i=0, l=ucs2.length; i<l; i++) {
html[i] = [];
for (j=0, m=ucs2[i].length; j<m; j++) {
html[i][j] = {};
}
}
return html
} ())
// !!!! `numberToPhrase()`, then `i` becomes `num`, and then `ucs2` becomes an array, and `i` is iterator !!!!
, numberToPhrase = function (number, options) {
var key, len, rem, word
, num = ~~(number < 0 ? -number : number) // ensure `num` is a positive whole number, or zero
, opt = options || {}
, l18n = ucs2[0][0][opt.l18n] ? opt.l18n : 'en' // set to English if the localization option is invalid or unspecified
, phrase = []
;
for (key in ucs2) {
len = ucs2[key].length;
rem = num % len;
if (! opt.format || 'ucs2' === opt.format) {
word = ucs2[key][rem][l18n];
// console.log('key ' + key + ' format ' + 'ucs2' + ' word ' + word);
} else if ('html' === opt.format) {
word = html[key][rem][l18n];
if (! word) {
word = html[key][rem][l18n] = ucs2[key][rem][l18n].replace(/[\u00A0-\u2666]/g, function(c) {
return '&#' + c.charCodeAt(0) + ';';
});
// console.log('ADD TO CACHE key ' + key + ' format ' + 'html' + ' word ' + word);
} else {
// console.log('GET IN CACHE key ' + key + ' format ' + 'html' + ' word ' + word);
}
} else {
// @todo format error
}
if ('-' !== word) { phrase.unshift(word); }
num = ~~(num / len); // prepare for the next part in `ucs2`
if (0 === num) { break; } // low numbers don't need to step through every section in `ucs2`
}
return phrase.join('-');
}
;
Meteor.methods({
babelslug: function () {
var i, key, babelslug;
if (this.isSimulation) { return; } // clientside stub (return value is ignored)
//// Housekeeping on the `recentBabelslugs` lut.
recentBabelslugsHousekeeping();
//// Try, 200 times, to find a username which has not been taken. @todo this is quite brute-force ... can we come up with a more elegant solution?
for (i=200; i>0; i--) {
babelslug = numberToPhrase( Math.floor(Math.random() * 50000) );
if ( 3 === babelslug.split('-').length && ! recentBabelslugs[babelslug] && ! usernameCount(babelslug) ) { break; } // we are only using three-part usernames at present
}
if (! i) { throw new Meteor.Error(500, "Cannot generate a username! Please email " + Config.about.webmaster); } // @todo check `(! i)` can ever be truthy
recentBabelslugs[babelslug] = { // later, when the form is submitted, we will check that the babelslug value is expected
now: Date.now() // allows `recentBabelslugsHousekeeping()` to find stale babelslugs
, cid: this.connection.id
}
return babelslug + '_' + this.connection.id; // @todo is `this.connection.id` ever some unexpected value, for example `null`?
}
});
Accounts.onCreateUser(function (options, user) {
var babelslug, connectionId;
//// Housekeeping on the `recentBabelslugs` lut.
recentBabelslugsHousekeeping();
//// Validate the value of `<input id="AT_field_you-babelslug" ...>`.
babelslug = options.profile['you-babelslug'].split('_')[0];
connectionId = options.profile['you-babelslug'].split('_')[1];
if (! babelslug || ! connectionId) {
throw new Meteor.Error(500, "The ‘username’ field is invalid."); // @todo better error-code than 500?
}
if (! recentBabelslugs[babelslug]) {
throw new Meteor.Error(500, "Your registration form expired after 15 minutes. Please refresh the browser and try again."); // The ‘username’ value is unexpected, so this may actually be a hack attempt
}
if ( usernameCount(babelslug) ) {
throw new Meteor.Error(500, "The ‘username’ is already in use."); // prevent two `Meteor.user` records having the same username, which could happen on a multi-servo project, until we change `recentBabelslugs` to a shared mongoDB collection @todo
}
//// Remove the babelslug, as it’s not needed any more.
delete recentBabelslugs[babelslug];
//// Record the username (‘info@loop.coop’ gets a special username).
options.profile = options.profile || {};
options.profile.username = 'info@loop.coop' === options.email ? 'red-cat' : babelslug;
//// Record other registration data.
if (options.profile['you-age-group-code']) { options.profile.agc = options.profile['you-age-group-code']; }
if (options.profile['you-based-in-code']) { options.profile.bic = options.profile['you-based-in-code']; }
if (options.profile['you-hear-about-code']) { options.profile.hac = options.profile['you-hear-about-code']; }
if (options.profile['you-hear-about-text']) { options.profile.hat = options.profile['you-hear-about-text']; }
if (options.profile['you-newsletter-opt']) { options.profile.nlo = options.profile['you-newsletter-opt']; }
//// The registration is valid, so record it as usual. http://docs.meteor.com/#accounts_oncreateuser
user.profile = options.profile;
return user;
});
}
| loopdotcoop/looptopia | you/you.create-user.js | JavaScript | gpl-2.0 | 11,763 | [
30522,
2065,
1006,
23879,
1012,
26354,
2121,
6299,
1007,
1063,
13075,
1013,
1013,
1013,
1013,
1037,
2298,
6279,
1011,
2795,
3005,
6309,
2024,
7013,
2169,
2051,
2019,
1520,
2017,
1012,
4236,
1521,
2433,
2003,
10155,
2478,
1996,
1036,
11561,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
jsonp({"cep":"09330250","logradouro":"Rua Ros\u00e1rio Sansaloni","bairro":"Jardim Itapeva","cidade":"Mau\u00e1","uf":"SP","estado":"S\u00e3o Paulo"});
| lfreneda/cepdb | api/v1/09330250.jsonp.js | JavaScript | cc0-1.0 | 152 | [
30522,
1046,
30524,
15723,
22172,
2009,
24065,
3567,
1000,
1010,
1000,
28744,
9648,
1000,
1024,
1000,
5003,
2226,
1032,
1057,
8889,
2063,
2487,
1000,
1010,
1000,
1057,
2546,
1000,
1024,
1000,
11867,
1000,
1010,
1000,
9765,
9365,
1000,
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 { applyMiddleware, createStore, compose } from "redux";
//Connect react router with redux
import { syncHistoryWithStore } from "react-router-redux";
import { browserHistory } from "react-router";
import logger from "redux-logger";
import thunk from "redux-thunk";
import promise from "redux-promise-middleware";
import rootReducer from './reducers/index.js';
// axsios
//If making an initial state and passing as a preloadedState to createStore, need to make a reducer
//for each property in the intial state. The reason being the reducer has access to the state. So
//This is like setting the initial state for thee reducers here instead of doing it directly in the
//reducer function itself.
// const initialState = {
// allData: 123,
// sesssion
// }
const middleware = applyMiddleware(promise(), thunk, logger());
const store = createStore(rootReducer, middleware);
export const history = syncHistoryWithStore(browserHistory, store);
export default store; | nhoon2002/CodeFlo | src/store.js | JavaScript | mit | 982 | [
30522,
12324,
1063,
6611,
4328,
20338,
8059,
1010,
9005,
19277,
1010,
17202,
1065,
2013,
1000,
2417,
5602,
1000,
1025,
1013,
1013,
7532,
10509,
2799,
2099,
2007,
2417,
5602,
12324,
1063,
26351,
24158,
7062,
24415,
23809,
2063,
1065,
2013,
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... |
/* drivers/gpu/mali400/mali/platform/pegasus-m400/exynos4_pmm.c
*
* Copyright 2011 by S.LSI. Samsung Electronics Inc.
* San#24, Nongseo-Dong, Giheung-Gu, Yongin, Korea
*
* Samsung SoC Mali400 DVFS driver
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software FoundatIon.
*/
/**
* @file exynos4_pmm.c
* Platform specific Mali driver functions for the exynos 4XXX based platforms
*/
#include "mali_kernel_common.h"
#include "mali_osk.h"
#include "exynos4_pmm.h"
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>
#if defined(CONFIG_MALI400_PROFILING)
#include "mali_osk_profiling.h"
#endif
#if defined(CONFIG_PM_RUNTIME)
#include <plat/pd.h>
#endif
#include <asm/io.h>
#include <mach/regs-pmu.h>
#include <linux/workqueue.h>
#define MALI_DVFS_STEPS 5
#define MALI_DVFS_WATING 10 /* msec */
#define MALI_DVFS_DEFAULT_STEP 1
#ifdef CONFIG_CPU_FREQ
#include <mach/asv.h>
#define EXYNOS4_ASV_ENABLED
#endif
#include <plat/cpu.h>
#define MALI_DVFS_CLK_DEBUG 0
#define SEC_THRESHOLD 1
#define CPUFREQ_LOCK_DURING_440 0
static int bMaliDvfsRun = 0;
typedef struct mali_dvfs_tableTag{
unsigned int clock;
unsigned int freq;
unsigned int vol;
#if SEC_THRESHOLD
unsigned int downthreshold;
unsigned int upthreshold;
#endif
}mali_dvfs_table;
typedef struct mali_dvfs_statusTag{
unsigned int currentStep;
mali_dvfs_table * pCurrentDvfs;
} mali_dvfs_status_t;
/* dvfs status */
mali_dvfs_status_t maliDvfsStatus;
int mali_dvfs_control;
typedef struct mali_runtime_resumeTag{
int clk;
int vol;
unsigned int step;
}mali_runtime_resume_table;
mali_runtime_resume_table mali_runtime_resume = {266, 900000, 1};
/* dvfs table */
mali_dvfs_table mali_dvfs[MALI_DVFS_STEPS]={
#if defined(CONFIG_CPU_EXYNOS4212) || defined(CONFIG_CPU_EXYNOS4412)
/* step 0 */{160 ,1000000 ,875000 , 0 , 70},
/* step 1 */{266 ,1000000 ,900000 ,62 , 90},
/* step 2 */{350 ,1000000 ,950000 ,85 , 90},
/* step 3 */{440 ,1000000 ,1025000 ,85 , 90},
/* step 4 */{533 ,1000000 ,1075000 ,85 ,100} };
#else
/* step 0 */{134 ,1000000 , 950000 ,85 , 90},
/* step 1 */{267 ,1000000 ,1050000 ,85 ,100} };
#endif
#ifdef EXYNOS4_ASV_ENABLED
#define ASV_LEVEL 12 /* ASV0, 1, 11 is reserved */
#define ASV_LEVEL_PRIME 13 /* ASV0, 1, 12 is reserved */
static unsigned int asv_3d_volt_9_table_1ghz_type[MALI_DVFS_STEPS-1][ASV_LEVEL] = {
{ 975000, 950000, 950000, 950000, 925000, 925000, 925000, 900000, 900000, 900000, 900000, 875000}, /* L3(160Mhz) */
#if (MALI_DVFS_STEPS > 1)
{ 1000000, 975000, 975000, 975000, 950000, 950000, 950000, 900000, 900000, 900000, 900000, 875000}, /* L2(266Mhz) */
#if (MALI_DVFS_STEPS > 2)
{ 1075000, 1050000, 1050000, 1050000, 1000000, 1000000, 1000000, 975000, 975000, 975000, 975000, 925000}, /* L1(350Mhz) */
#if (MALI_DVFS_STEPS > 3)
{ 1125000, 1100000, 1100000, 1100000, 1075000, 1075000, 1075000, 1025000, 1025000, 1025000, 1025000, 975000}, /* L0(440Mhz) */
#endif
#endif
#endif
};
static unsigned int asv_3d_volt_9_table[MALI_DVFS_STEPS-1][ASV_LEVEL] = {
{ 950000, 925000, 900000, 900000, 875000, 875000, 875000, 875000, 850000, 850000, 850000, 850000}, /* L3(160Mhz) */
#if (MALI_DVFS_STEPS > 1)
{ 975000, 950000, 925000, 925000, 925000, 900000, 900000, 875000, 875000, 875000, 875000, 850000}, /* L2(266Mhz) */
#if (MALI_DVFS_STEPS > 2)
{ 1050000, 1025000, 1000000, 1000000, 975000, 950000, 950000, 950000, 925000, 925000, 925000, 900000}, /* L1(350Mhz) */
#if (MALI_DVFS_STEPS > 3)
{ 1100000, 1075000, 1050000, 1050000, 1050000, 1025000, 1025000, 1000000, 1000000, 1000000, 975000, 950000}, /* L0(440Mhz) */
#endif
#endif
#endif
};
static unsigned int asv_3d_volt_9_table_for_prime[MALI_DVFS_STEPS][ASV_LEVEL_PRIME] = {
{ 962500, 937500, 925000, 912500, 900000, 887500, 875000, 862500, 875000, 862500, 850000, 850000, 850000}, /* L4(160Mhz) */
#if (MALI_DVFS_STEPS > 1)
{ 987500, 962500, 950000, 937500, 925000, 912500, 900000, 887500, 900000, 887500, 875000, 875000, 875000}, /* L3(266Mhz) */
#if (MALI_DVFS_STEPS > 2)
{ 1037500, 1012500, 1000000, 987500, 975000, 962500, 950000, 937500, 950000, 937500, 912500, 900000, 887500}, /* L2(350Mhz) */
#if (MALI_DVFS_STEPS > 3)
{ 1100000, 1075000, 1062500, 1050000, 1037500, 1025000, 1012500, 1000000, 1012500, 1000000, 975000, 962500, 950000}, /* L1(440Mhz) */
#if (MALI_DVFS_STEPS > 4)
{ 1162500, 1137500, 1125000, 1112500, 1100000, 1087500, 1075000, 1062500, 1075000, 1062500, 1037500, 1025000, 1012500}, /* L0(533Mhz) */
#endif
#endif
#endif
#endif
};
#endif /* ASV_LEVEL */
#define EXTXTALCLK_NAME "ext_xtal"
#define VPLLSRCCLK_NAME "vpll_src"
#define FOUTVPLLCLK_NAME "fout_vpll"
#define SCLVPLLCLK_NAME "sclk_vpll"
#define GPUMOUT1CLK_NAME "mout_g3d1"
#define MPLLCLK_NAME "mout_mpll"
#define GPUMOUT0CLK_NAME "mout_g3d0"
#define GPUCLK_NAME "sclk_g3d"
#define CLK_DIV_STAT_G3D 0x1003C62C
#define CLK_DESC "clk-divider-status"
static struct clk *ext_xtal_clock = NULL;
static struct clk *vpll_src_clock = NULL;
static struct clk *fout_vpll_clock = NULL;
static struct clk *sclk_vpll_clock = NULL;
static struct clk *mpll_clock = NULL;
static struct clk *mali_parent_clock = NULL;
static struct clk *mali_clock = NULL;
#if defined(CONFIG_CPU_EXYNOS4412) || defined(CONFIG_CPU_EXYNOS4212)
/* Pegasus */
static const mali_bool bis_vpll = MALI_TRUE;
int mali_gpu_clk = 440;
int mali_gpu_vol = 1025000;
#else
/* Orion */
static const mali_bool bis_vpll = MALI_FALSE;
int mali_gpu_clk = 267;
int mali_gpu_vol = 1050000;
#endif
static unsigned int GPU_MHZ = 1000000;
int gpu_power_state;
static int bPoweroff;
static atomic_t clk_active;
#ifdef CONFIG_REGULATOR
//struct regulator *g3d_regulator = NULL;
#endif
mali_io_address clk_register_map = 0;
/* DVFS */
static unsigned int mali_dvfs_utilization = 255;
static void mali_dvfs_work_handler(struct work_struct *w);
static struct workqueue_struct *mali_dvfs_wq = 0;
extern mali_io_address clk_register_map;
_mali_osk_mutex_t *mali_dvfs_lock;
int mali_runtime_resumed = -1;
static DECLARE_WORK(mali_dvfs_work, mali_dvfs_work_handler);
#ifdef CONFIG_REGULATOR
void mali_regulator_disable(void)
{
/* if(IS_ERR_OR_NULL(g3d_regulator))
{
MALI_DEBUG_PRINT(1, ("error on mali_regulator_disable : g3d_regulator is null\n"));
return;
}
regulator_disable(g3d_regulator);*/
}
void mali_regulator_enable(void)
{
/* if(IS_ERR_OR_NULL(g3d_regulator))
{
MALI_DEBUG_PRINT(1, ("error on mali_regulator_enable : g3d_regulator is null\n"));
return;
}
regulator_enable(g3d_regulator);*/
}
void mali_regulator_set_voltage(int min_uV, int max_uV)
{
_mali_osk_mutex_wait(mali_dvfs_lock);
/* if(IS_ERR_OR_NULL(g3d_regulator))
{
MALI_DEBUG_PRINT(1, ("error on mali_regulator_set_voltage : g3d_regulator is null\n"));
return;
}*/
MALI_PRINT(("= regulator_set_voltage: %d, %d \n",min_uV, max_uV));
/* regulator_set_voltage(g3d_regulator, min_uV, max_uV);
mali_gpu_vol = regulator_get_voltage(g3d_regulator);
MALI_DEBUG_PRINT(1, ("Mali voltage: %d\n", mali_gpu_vol));*/
_mali_osk_mutex_signal(mali_dvfs_lock);
}
#endif
unsigned long mali_clk_get_rate(void)
{
return clk_get_rate(mali_clock);
}
static unsigned int get_mali_dvfs_status(void)
{
return maliDvfsStatus.currentStep;
}
mali_bool mali_clk_get(void)
{
if (bis_vpll)
{
if (ext_xtal_clock == NULL)
{
ext_xtal_clock = clk_get(NULL, EXTXTALCLK_NAME);
if (IS_ERR(ext_xtal_clock)) {
MALI_PRINT(("MALI Error : failed to get source ext_xtal_clock\n"));
return MALI_FALSE;
}
}
if (vpll_src_clock == NULL)
{
vpll_src_clock = clk_get(NULL, VPLLSRCCLK_NAME);
if (IS_ERR(vpll_src_clock)) {
MALI_PRINT(("MALI Error : failed to get source vpll_src_clock\n"));
return MALI_FALSE;
}
}
if (fout_vpll_clock == NULL)
{
fout_vpll_clock = clk_get(NULL, FOUTVPLLCLK_NAME);
if (IS_ERR(fout_vpll_clock)) {
MALI_PRINT(("MALI Error : failed to get source fout_vpll_clock\n"));
return MALI_FALSE;
}
}
if (sclk_vpll_clock == NULL)
{
sclk_vpll_clock = clk_get(NULL, SCLVPLLCLK_NAME);
if (IS_ERR(sclk_vpll_clock)) {
MALI_PRINT(("MALI Error : failed to get source sclk_vpll_clock\n"));
return MALI_FALSE;
}
}
if (mali_parent_clock == NULL)
{
mali_parent_clock = clk_get(NULL, GPUMOUT1CLK_NAME);
if (IS_ERR(mali_parent_clock)) {
MALI_PRINT(( "MALI Error : failed to get source mali parent clock\n"));
return MALI_FALSE;
}
}
}
else /* mpll */
{
if (mpll_clock == NULL)
{
mpll_clock = clk_get(NULL, MPLLCLK_NAME);
if (IS_ERR(mpll_clock)) {
MALI_PRINT(("MALI Error : failed to get source mpll clock\n"));
return MALI_FALSE;
}
}
if (mali_parent_clock == NULL)
{
mali_parent_clock = clk_get(NULL, GPUMOUT0CLK_NAME);
if (IS_ERR(mali_parent_clock)) {
MALI_PRINT(( "MALI Error : failed to get source mali parent clock\n"));
return MALI_FALSE;
}
}
}
/* mali clock get always. */
if (mali_clock == NULL)
{
mali_clock = clk_get(NULL, GPUCLK_NAME);
if (IS_ERR(mali_clock)) {
MALI_PRINT(("MALI Error : failed to get source mali clock\n"));
return MALI_FALSE;
}
}
return MALI_TRUE;
}
void mali_clk_put(mali_bool binc_mali_clock)
{
if (mali_parent_clock)
{
clk_put(mali_parent_clock);
mali_parent_clock = NULL;
}
if (mpll_clock)
{
clk_put(mpll_clock);
mpll_clock = NULL;
}
if (sclk_vpll_clock)
{
clk_put(sclk_vpll_clock);
sclk_vpll_clock = NULL;
}
if (binc_mali_clock && fout_vpll_clock)
{
clk_put(fout_vpll_clock);
fout_vpll_clock = NULL;
}
if (vpll_src_clock)
{
clk_put(vpll_src_clock);
vpll_src_clock = NULL;
}
if (ext_xtal_clock)
{
clk_put(ext_xtal_clock);
ext_xtal_clock = NULL;
}
if (binc_mali_clock && mali_clock)
{
clk_put(mali_clock);
mali_clock = NULL;
}
}
void mali_clk_set_rate(unsigned int clk, unsigned int mhz)
{
int err;
unsigned long rate = (unsigned long)clk * (unsigned long)mhz;
_mali_osk_mutex_wait(mali_dvfs_lock);
MALI_DEBUG_PRINT(3, ("Mali platform: Setting frequency to %d mhz\n", clk));
if (mali_clk_get() == MALI_FALSE)
return;
if (bis_vpll)
{
clk_set_rate(fout_vpll_clock, (unsigned int)clk * GPU_MHZ);
clk_set_parent(vpll_src_clock, ext_xtal_clock);
clk_set_parent(sclk_vpll_clock, fout_vpll_clock);
clk_set_parent(mali_parent_clock, sclk_vpll_clock);
clk_set_parent(mali_clock, mali_parent_clock);
}
else
{
clk_set_parent(mali_parent_clock, mpll_clock);
clk_set_parent(mali_clock, mali_parent_clock);
}
if (!atomic_read(&clk_active)) {
if (clk_enable(mali_clock) < 0)
return;
atomic_set(&clk_active, 1);
}
err = clk_set_rate(mali_clock, rate);
if (err > 0)
MALI_PRINT_ERROR(("Failed to set Mali clock: %d\n", err));
rate = mali_clk_get_rate();
MALI_DEBUG_PRINT(3, ("Mali frequency %d\n", rate / mhz));
GPU_MHZ = mhz;
mali_gpu_clk = (int)(rate / mhz);
mali_clk_put(MALI_FALSE);
_mali_osk_mutex_signal(mali_dvfs_lock);
}
int get_mali_dvfs_control_status(void)
{
return mali_dvfs_control;
}
mali_bool set_mali_dvfs_current_step(unsigned int step)
{
_mali_osk_mutex_wait(mali_dvfs_lock);
maliDvfsStatus.currentStep = step % MALI_DVFS_STEPS;
if (step >= MALI_DVFS_STEPS)
mali_runtime_resumed = maliDvfsStatus.currentStep;
_mali_osk_mutex_signal(mali_dvfs_lock);
return MALI_TRUE;
}
static mali_bool set_mali_dvfs_status(u32 step,mali_bool boostup)
{
u32 validatedStep=step;
#if MALI_DVFS_CLK_DEBUG
unsigned int *pRegMaliClkDiv;
unsigned int *pRegMaliMpll;
#endif
if(boostup) {
#ifdef CONFIG_REGULATOR
/* change the voltage */
// mali_regulator_set_voltage(mali_dvfs[step].vol, mali_dvfs[step].vol);
#endif
/* change the clock */
mali_clk_set_rate(mali_dvfs[step].clock, mali_dvfs[step].freq);
} else {
/* change the clock */
mali_clk_set_rate(mali_dvfs[step].clock, mali_dvfs[step].freq);
#ifdef CONFIG_REGULATOR
/* change the voltage */
// mali_regulator_set_voltage(mali_dvfs[step].vol, mali_dvfs[step].vol);
#endif
}
#if defined(CONFIG_MALI400_PROFILING)
_mali_osk_profiling_add_event(MALI_PROFILING_EVENT_TYPE_SINGLE|
MALI_PROFILING_EVENT_CHANNEL_GPU|
MALI_PROFILING_EVENT_REASON_SINGLE_GPU_FREQ_VOLT_CHANGE,
mali_gpu_clk, mali_gpu_vol/1000, 0, 0, 0);
#endif
mali_clk_put(MALI_FALSE);
#if MALI_DVFS_CLK_DEBUG
pRegMaliClkDiv = ioremap(0x1003c52c,32);
pRegMaliMpll = ioremap(0x1003c22c,32);
MALI_PRINT(("Mali MPLL reg:%d, CLK DIV: %d \n",*pRegMaliMpll, *pRegMaliClkDiv));
#endif
#ifdef EXYNOS4_ASV_ENABLED
if (samsung_rev() < EXYNOS4412_REV_2_0) {
if (mali_dvfs[step].clock == 160)
exynos4x12_set_abb_member(ABB_G3D, ABB_MODE_100V);
else
exynos4x12_set_abb_member(ABB_G3D, ABB_MODE_130V);
}
#endif
set_mali_dvfs_current_step(validatedStep);
/* for future use */
maliDvfsStatus.pCurrentDvfs = &mali_dvfs[validatedStep];
#if CPUFREQ_LOCK_DURING_440
/* lock/unlock CPU freq by Mali */
if (mali_dvfs[step].clock == 440)
err = cpufreq_lock_by_mali(1200);
else
cpufreq_unlock_by_mali();
#endif
return MALI_TRUE;
}
static void mali_platform_wating(u32 msec)
{
/*
* sample wating
* change this in the future with proper check routine.
*/
unsigned int read_val;
while(1)
{
read_val = _mali_osk_mem_ioread32(clk_register_map, 0x00);
if ((read_val & 0x8000)==0x0000) break;
_mali_osk_time_ubusydelay(100); /* 1000 -> 100 : 20101218 */
}
}
static mali_bool change_mali_dvfs_status(u32 step, mali_bool boostup )
{
MALI_DEBUG_PRINT(4, ("> change_mali_dvfs_status: %d, %d \n",step, boostup));
if(!set_mali_dvfs_status(step, boostup))
{
MALI_DEBUG_PRINT(1, ("error on set_mali_dvfs_status: %d, %d \n",step, boostup));
return MALI_FALSE;
}
/* wait until clock and voltage is stablized */
mali_platform_wating(MALI_DVFS_WATING); /* msec */
return MALI_TRUE;
}
#ifdef EXYNOS4_ASV_ENABLED
extern unsigned int exynos_result_of_asv;
static mali_bool mali_dvfs_table_update(void)
{
unsigned int i;
unsigned int step_num = MALI_DVFS_STEPS;
if(samsung_rev() < EXYNOS4412_REV_2_0)
step_num = MALI_DVFS_STEPS - 1;
if(soc_is_exynos4412()) {
/*if (exynos_armclk_max == 1000000) {
MALI_PRINT(("::C::exynos_result_of_asv : %d\n", exynos_result_of_asv));
for (i = 0; i < step_num; i++) {
mali_dvfs[i].vol = asv_3d_volt_9_table_1ghz_type[i][exynos_result_of_asv];
MALI_PRINT(("mali_dvfs[%d].vol = %d \n", i, mali_dvfs[i].vol));
}
} else */
/* modify by cym 20141204 */
#if 0
if(((is_special_flag() >> G3D_LOCK_FLAG) & 0x1) && (samsung_rev() >= EXYNOS4412_REV_2_0)) {
#else
#ifdef CONFIG_CPU_TYPE_SCP
if(((is_special_flag() >> G3D_LOCK_FLAG) & 0x1) && (samsung_rev() >= EXYNOS4412_REV_2_0)) {
#else
if((samsung_rev() >= EXYNOS4412_REV_2_0)) {
#endif
#endif
/* end modify */
MALI_PRINT(("::L::exynos_result_of_asv : %d\n", exynos_result_of_asv));
for (i = 0; i < step_num; i++) {
mali_dvfs[i].vol = asv_3d_volt_9_table_for_prime[i][exynos_result_of_asv] + 25000;
MALI_PRINT(("mali_dvfs[%d].vol = %d \n ", i, mali_dvfs[i].vol));
}
} else if (samsung_rev() >= EXYNOS4412_REV_2_0) {
MALI_PRINT(("::P::exynos_result_of_asv : %d\n", exynos_result_of_asv));
for (i = 0; i < step_num; i++) {
mali_dvfs[i].vol = asv_3d_volt_9_table_for_prime[i][exynos_result_of_asv];
MALI_PRINT(("mali_dvfs[%d].vol = %d \n", i, mali_dvfs[i].vol));
}
} else {
MALI_PRINT(("::Q::exynos_result_of_asv : %d\n", exynos_result_of_asv));
for (i = 0; i < step_num; i++) {
mali_dvfs[i].vol = asv_3d_volt_9_table[i][exynos_result_of_asv];
MALI_PRINT(("mali_dvfs[%d].vol = %d \n", i, mali_dvfs[i].vol));
}
}
}
return MALI_TRUE;
}
#endif
static unsigned int decideNextStatus(unsigned int utilization)
{
static unsigned int level = 0;
int iStepCount = 0;
if (mali_runtime_resumed >= 0) {
level = mali_runtime_resumed;
mali_runtime_resumed = -1;
}
if (mali_dvfs_control == 0 && level == get_mali_dvfs_status()) {
if (utilization > (int)(255 * mali_dvfs[maliDvfsStatus.currentStep].upthreshold / 100) &&
level < MALI_DVFS_STEPS - 1) {
level++;
if ((samsung_rev() < EXYNOS4412_REV_2_0) && 3 == get_mali_dvfs_status()) {
level=get_mali_dvfs_status();
}
}
else if (utilization < (int)(255 * mali_dvfs[maliDvfsStatus.currentStep].downthreshold / 100) &&
level > 0) {
level--;
}
} else {
for (iStepCount = MALI_DVFS_STEPS-1; iStepCount >= 0; iStepCount--) {
if ( mali_dvfs_control >= mali_dvfs[iStepCount].clock ) {
maliDvfsStatus.currentStep = iStepCount;
level = iStepCount;
break;
}
}
}
return level;
}
static void update_time_in_state(int level);
static mali_bool mali_dvfs_status(unsigned int utilization)
{
unsigned int nextStatus = 0;
unsigned int curStatus = 0;
mali_bool boostup = MALI_FALSE;
#ifdef EXYNOS4_ASV_ENABLED
static mali_bool asv_applied = MALI_FALSE;
#endif
#ifdef EXYNOS4_ASV_ENABLED
if (asv_applied == MALI_FALSE) {
mali_dvfs_table_update();
change_mali_dvfs_status(1, 0);
asv_applied = MALI_TRUE;
return MALI_TRUE;
}
#endif
MALI_DEBUG_PRINT(4, ("> mali_dvfs_status: %d \n",utilization));
/* decide next step */
curStatus = get_mali_dvfs_status();
nextStatus = decideNextStatus(utilization);
MALI_DEBUG_PRINT(4, ("= curStatus %d, nextStatus %d, maliDvfsStatus.currentStep %d \n", curStatus, nextStatus, maliDvfsStatus.currentStep));
/* if next status is same with current status, don't change anything */
if(curStatus!=nextStatus)
{
/* check if boost up or not */
if(nextStatus > maliDvfsStatus.currentStep) boostup = 1;
update_time_in_state(curStatus);
/* change mali dvfs status */
if(!change_mali_dvfs_status(nextStatus,boostup))
{
MALI_DEBUG_PRINT(1, ("error on change_mali_dvfs_status \n"));
return MALI_FALSE;
}
}
return MALI_TRUE;
}
int mali_dvfs_is_running(void)
{
return bMaliDvfsRun;
}
static void mali_dvfs_work_handler(struct work_struct *w)
{
bMaliDvfsRun=1;
MALI_DEBUG_PRINT(3, ("=== mali_dvfs_work_handler\n"));
if(!mali_dvfs_status(mali_dvfs_utilization))
MALI_DEBUG_PRINT(1, ( "error on mali dvfs status in mali_dvfs_work_handler"));
bMaliDvfsRun=0;
}
mali_bool init_mali_dvfs_status(void)
{
/*
* default status
* add here with the right function to get initilization value.
*/
if (!mali_dvfs_wq)
{
mali_dvfs_wq = create_singlethread_workqueue("mali_dvfs");
}
/* add a error handling here */
maliDvfsStatus.currentStep = MALI_DVFS_DEFAULT_STEP;
return MALI_TRUE;
}
void deinit_mali_dvfs_status(void)
{
if (mali_dvfs_wq)
{
destroy_workqueue(mali_dvfs_wq);
mali_dvfs_wq = NULL;
}
}
mali_bool mali_dvfs_handler(unsigned int utilization)
{
mali_dvfs_utilization = utilization;
queue_work_on(0, mali_dvfs_wq, &mali_dvfs_work);
return MALI_TRUE;
}
static mali_bool init_mali_clock(void)
{
mali_bool ret = MALI_TRUE;
gpu_power_state = 0;
bPoweroff = 1;
if (mali_clock != 0)
return ret; /* already initialized */
mali_dvfs_lock = _mali_osk_mutex_init(_MALI_OSK_LOCKFLAG_UNORDERED, 0);
if (mali_dvfs_lock == NULL)
return _MALI_OSK_ERR_FAULT;
if (!mali_clk_get())
{
MALI_PRINT(("Error: Failed to get Mali clock\n"));
goto err_clk;
}
mali_clk_set_rate((unsigned int)mali_gpu_clk, GPU_MHZ);
MALI_PRINT(("init_mali_clock mali_clock %x\n", mali_clock));
#ifdef CONFIG_REGULATOR
/* g3d_regulator = regulator_get(NULL, "vdd_g3d");
if (IS_ERR(g3d_regulator))
{
MALI_PRINT(("MALI Error : failed to get vdd_g3d\n"));
ret = MALI_FALSE;
goto err_regulator;
}
regulator_enable(g3d_regulator);
mali_regulator_set_voltage(mali_gpu_vol, mali_gpu_vol);*/
#endif
#if defined(CONFIG_MALI400_PROFILING)
_mali_osk_profiling_add_event(MALI_PROFILING_EVENT_TYPE_SINGLE|
MALI_PROFILING_EVENT_CHANNEL_GPU|
MALI_PROFILING_EVENT_REASON_SINGLE_GPU_FREQ_VOLT_CHANGE,
mali_gpu_clk, mali_gpu_vol/1000, 0, 0, 0);
#endif
mali_clk_put(MALI_FALSE);
return MALI_TRUE;
#ifdef CONFIG_REGULATOR
/*err_regulator:
regulator_put(g3d_regulator);*/
#endif
err_clk:
mali_clk_put(MALI_TRUE);
return ret;
}
static mali_bool deinit_mali_clock(void)
{
if (mali_clock == 0)
return MALI_TRUE;
#ifdef CONFIG_REGULATOR
/* if (g3d_regulator)
{
regulator_put(g3d_regulator);
g3d_regulator = NULL;
}*/
#endif
mali_clk_put(MALI_TRUE);
return MALI_TRUE;
}
static _mali_osk_errcode_t enable_mali_clocks(void)
{
int err;
if (!atomic_read(&clk_active)) {
err = clk_enable(mali_clock);
MALI_DEBUG_PRINT(3,("enable_mali_clocks mali_clock %p error %d \n", mali_clock, err));
atomic_set(&clk_active, 1);
}
/* set clock rate */
#ifdef CONFIG_MALI_DVFS
if (get_mali_dvfs_control_status() != 0 || mali_gpu_clk >= mali_runtime_resume.clk) {
mali_clk_set_rate(mali_gpu_clk, GPU_MHZ);
} else {
#ifdef CONFIG_REGULATOR
// mali_regulator_set_voltage(mali_runtime_resume.vol, mali_runtime_resume.vol);
#endif
mali_clk_set_rate(mali_runtime_resume.clk, GPU_MHZ);
set_mali_dvfs_current_step(mali_runtime_resume.step);
}
#else
mali_clk_set_rate((unsigned int)mali_gpu_clk, GPU_MHZ);
maliDvfsStatus.currentStep = MALI_DVFS_DEFAULT_STEP;
#endif
MALI_SUCCESS;
}
static _mali_osk_errcode_t disable_mali_clocks(void)
{
if (atomic_read(&clk_active)) {
clk_disable(mali_clock);
atomic_set(&clk_active, 0);
}
MALI_DEBUG_PRINT(3,("disable_mali_clocks mali_clock %p \n", mali_clock));
MALI_SUCCESS;
}
/* Some defines changed names in later Odroid-A kernels. Make sure it works for both. */
#ifndef S5P_G3D_CONFIGURATION
#define S5P_G3D_CONFIGURATION S5P_PMU_G3D_CONF
#endif
#ifndef S5P_G3D_STATUS
#define S5P_G3D_STATUS S5P_PMU_G3D_CONF + 0x4
#endif
_mali_osk_errcode_t g3d_power_domain_control(int bpower_on)
{
if (bpower_on)
{
void __iomem *status;
u32 timeout;
__raw_writel(S5P_INT_LOCAL_PWR_EN, S5P_G3D_CONFIGURATION);
status = S5P_G3D_STATUS;
timeout = 10;
while ((__raw_readl(status) & S5P_INT_LOCAL_PWR_EN)
!= S5P_INT_LOCAL_PWR_EN) {
if (timeout == 0) {
MALI_PRINTF(("Power domain enable failed.\n"));
return -ETIMEDOUT;
}
timeout--;
_mali_osk_time_ubusydelay(100);
}
}
else
{
void __iomem *status;
u32 timeout;
__raw_writel(0, S5P_G3D_CONFIGURATION);
status = S5P_G3D_STATUS;
/* Wait max 1ms */
timeout = 10;
while (__raw_readl(status) & S5P_INT_LOCAL_PWR_EN)
{
if (timeout == 0) {
MALI_PRINTF(("Power domain disable failed.\n" ));
return -ETIMEDOUT;
}
timeout--;
_mali_osk_time_ubusydelay(100);
}
}
MALI_SUCCESS;
}
_mali_osk_errcode_t mali_platform_init(struct device *dev)
{
MALI_CHECK(init_mali_clock(), _MALI_OSK_ERR_FAULT);
#ifdef CONFIG_MALI_DVFS
if (!clk_register_map) clk_register_map = _mali_osk_mem_mapioregion( CLK_DIV_STAT_G3D, 0x20, CLK_DESC );
if(!init_mali_dvfs_status())
MALI_DEBUG_PRINT(1, ("mali_platform_init failed\n"));
#endif
mali_platform_power_mode_change(dev, MALI_POWER_MODE_ON);
MALI_SUCCESS;
}
_mali_osk_errcode_t mali_platform_deinit(struct device *dev)
{
mali_platform_power_mode_change(dev, MALI_POWER_MODE_DEEP_SLEEP);
deinit_mali_clock();
#ifdef CONFIG_MALI_DVFS
deinit_mali_dvfs_status();
if (clk_register_map )
{
_mali_osk_mem_unmapioregion(CLK_DIV_STAT_G3D, 0x20, clk_register_map);
clk_register_map = NULL;
}
#endif
MALI_SUCCESS;
}
_mali_osk_errcode_t mali_platform_power_mode_change(struct device *dev, mali_power_mode power_mode)
{
switch (power_mode)
{
case MALI_POWER_MODE_ON:
MALI_DEBUG_PRINT(3, ("Mali platform: Got MALI_POWER_MODE_ON event, %s\n",
bPoweroff ? "powering on" : "already on"));
if (bPoweroff == 1)
{
#if !defined(CONFIG_PM_RUNTIME)
g3d_power_domain_control(1);
#endif
MALI_DEBUG_PRINT(4, ("enable clock \n"));
enable_mali_clocks();
#if defined(CONFIG_MALI400_PROFILING)
_mali_osk_profiling_add_event(MALI_PROFILING_EVENT_TYPE_SINGLE |
MALI_PROFILING_EVENT_CHANNEL_GPU |
MALI_PROFILING_EVENT_REASON_SINGLE_GPU_FREQ_VOLT_CHANGE,
mali_gpu_clk, mali_gpu_vol/1000, 0, 0, 0);
#endif
bPoweroff=0;
}
break;
case MALI_POWER_MODE_LIGHT_SLEEP:
case MALI_POWER_MODE_DEEP_SLEEP:
MALI_DEBUG_PRINT(3, ("Mali platform: Got %s event, %s\n", power_mode ==
MALI_POWER_MODE_LIGHT_SLEEP ? "MALI_POWER_MODE_LIGHT_SLEEP" :
"MALI_POWER_MODE_DEEP_SLEEP", bPoweroff ? "already off" : "powering off"));
if (bPoweroff == 0)
{
disable_mali_clocks();
#if defined(CONFIG_MALI400_PROFILING)
_mali_osk_profiling_add_event(MALI_PROFILING_EVENT_TYPE_SINGLE |
MALI_PROFILING_EVENT_CHANNEL_GPU |
MALI_PROFILING_EVENT_REASON_SINGLE_GPU_FREQ_VOLT_CHANGE,
0, 0, 0, 0, 0);
#endif
#if !defined(CONFIG_PM_RUNTIME)
g3d_power_domain_control(0);
#endif
bPoweroff=1;
}
break;
}
MALI_SUCCESS;
}
mali_gpu_utilization_handler(struct mali_gpu_utilization_data *data)
{
if (bPoweroff==0)
{
#ifdef CONFIG_MALI_DVFS
if(data!=NULL && !mali_dvfs_handler(data->utilization_gpu))
MALI_DEBUG_PRINT(1, ("error on mali dvfs status in utilization\n"));
#endif
}
}
u64 mali_dvfs_time[MALI_DVFS_STEPS];
static void update_time_in_state(int level)
{
u64 current_time;
static u64 prev_time=0;
if (prev_time ==0)
prev_time=get_jiffies_64();
current_time = get_jiffies_64();
mali_dvfs_time[level] += current_time-prev_time;
prev_time = current_time;
}
ssize_t show_time_in_state(struct device *dev, struct device_attribute *attr, char *buf)
{
//struct device *kbdev;
ssize_t ret = 0;
int i;
update_time_in_state(maliDvfsStatus.currentStep);
for (i = 0; i < MALI_DVFS_STEPS; i++) {
ret += snprintf(buf+ret, PAGE_SIZE-ret, "%d %llu\n",
mali_dvfs[i].clock,
mali_dvfs_time[i]);
}
if (ret < PAGE_SIZE - 1) {
ret += snprintf(buf+ret, PAGE_SIZE-ret, "\n");
} else {
buf[PAGE_SIZE-2] = '\n';
buf[PAGE_SIZE-1] = '\0';
ret = PAGE_SIZE-1;
}
return ret;
}
ssize_t set_time_in_state(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
{
int i;
for (i = 0; i < MALI_DVFS_STEPS; i++) {
mali_dvfs_time[i] = 0;
}
return count;
}
| Android-Dongyf/itop-kernel | drivers/media/video/samsung/mali_r4p0/platform/pegasus-m400/exynos4_pmm.c | C | gpl-2.0 | 26,197 | [
30522,
1013,
1008,
6853,
1013,
14246,
2226,
1013,
16007,
29537,
1013,
16007,
1013,
4132,
1013,
26606,
1011,
1049,
29537,
1013,
4654,
6038,
2891,
2549,
1035,
7610,
2213,
1012,
1039,
1008,
1008,
9385,
2249,
2011,
1055,
1012,
1048,
5332,
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><head>
<script type="text/javascript" src="lightgl.js"></script>
<script type="text/javascript" src="csg.js"></script>
<script type="text/javascript" src="openjscad.js"></script>
<script type="text/javascript" src="braille.jscad" charset="utf-8"></script>
<script type="text/javascript" src="jquery-1.10.1.min.js"></script>
<style>
body {
font: 14px/20px 'Helvetica Neue Light', HelveticaNeue-Light, 'Helvetica Neue', Helvetica, Arial, sans-serif;
max-width: 820px;
margin: 0 auto;
padding: 10px;
}
canvas {
border: 1px solid black;
margin: 0px 8px;
}
pre, code {
font: 12px/20px Monaco, monospace;
border: 1px solid #CCC;
border-radius: 3px;
background: #F9F9F9;
padding: 0 3px;
color: #555;
}
pre {
padding: 10px;
width: 100%;
}
textarea {
font: 12px/20px Monaco, monospace;
padding: 5px 8px;
width: 300px;
height: 100px;
}
td {
vertical-align: top;
}
canvas { cursor: move; }
</style>
<link rel="stylesheet" href="openjscad.css" type="text/css" />
<script>
var gProcessor=null;
var detailsOffset = 4;
var detailsAmount = 7;
// Show all exceptions to the user:
OpenJsCad.AlertUserOfUncaughtExceptions();
function onload()
{
gProcessor = new OpenJsCad.Processor(document.getElementById("viewer"));
jQuery.get('braille.jscad', function(data)
{
gProcessor.setJsCad(data, "braille.jscad");
showDetails(false);
});
adaptControls();
}
function adaptControls()
{
if (gProcessor.viewer != null)
gProcessor.viewer.gl.clearColor(1, 1, 0.97, 1);
$("#viewer .viewer")[0].style.backgroundColor = "white";
$("#viewer .parametersdiv button")[0].onclick = parseParameters;
var moreElement = "<hr/><p><a id='more'></a></p>";
$("#viewer .parametersdiv .parameterstable").after(moreElement);
setLanguage("german");
}
function setLanguage(lang)
{
if (lang == "german")
{
// var $statusBar = $("#viewer .statusdiv");
// $statusBar.children("span")[0].innerHTML = "Fertig."
$("#viewer .parametersdiv button")[0].innerHTML = "3D Modell generieren";
}
}
function showDetails(show)
{
var tableRows = $("#viewer .parametersdiv .parameterstable tr");
for (var i=detailsOffset; i < tableRows.length && i < detailsOffset+detailsAmount; i++)
{
tableRows[i].style.display = (show) ? "table-row" : "none";
}
var moreLink = $("#more")[0];
moreLink.innerHTML = (show) ? "simple Einstellungen" : "Details einstellen";
moreLink.href = "javascript:showDetails(" + !show + ");";
}
function parseParameters()
{
var param_form_size = $("#viewer .parametersdiv .parameterstable tr:eq(4) td:eq(1) input")[0];
param_form_size.value = Math.min(Math.max(param_form_size.value, 0.0), 10.0);
var param_dot_height = $("#viewer .parametersdiv .parameterstable tr:eq(5) td:eq(1) input")[0];
param_dot_height.value = Math.min(Math.max(param_dot_height.value, 0.5), 0.8);
var param_dot_diameter = $("#viewer .parametersdiv .parameterstable tr:eq(6) td:eq(1) input")[0];
param_dot_diameter.value = Math.min(Math.max(param_dot_diameter.value, 1.4), 1.6);
var param_plate_thickness = $("#viewer .parametersdiv .parameterstable tr:eq(7) td:eq(1) input")[0];
param_plate_thickness.value = Math.max(param_plate_thickness.value, 0.0);
var param_resolution = $("#viewer .parametersdiv .parameterstable tr:eq(10) td:eq(1) input")[0];
var isnumber = !isNaN(parseInt(param_resolution.value)) && isFinite(param_resolution.value);
var resolution = (isnumber) ? parseInt(param_resolution.value) : 0;
resolution = Math.min(Math.max(param_resolution.value, 10), 30);
resolution += (resolution % 2);
param_resolution.value = resolution;
gProcessor.rebuildSolid();
}
</script>
<title>Text to 3d printable Braille</title>
</head>
<body onload="onload()">
<h1>Text to 3d printable Braille</h1>
<div id="viewer"></div>
</body>
</html>
| v01pe/Text2Braille3d | index.html | HTML | mit | 3,907 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
1028,
1026,
2132,
1028,
1026,
5896,
2828,
1027,
1000,
3793,
1013,
9262,
22483,
1000,
5034,
2278,
1027,
1000,
2422,
23296,
1012,
1046,
2015,
1000,
1028,
1026,
1013,
5896,
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... |
require.config( {
//By default load any module IDs from js/lib
baseUrl: "app/",
//except, if the module ID starts with "app",
//load it from the js/app directory. paths
//config is relative to the baseUrl, and
//never includes a ".js" extension since
//the paths config could be for a directory.
paths: {
lib: "../lib",
}
} );
requirejs( ["lib/angular/angular"], function() {
require( ["app"], function() {
angular.element( document ).ready( function() {
angular.bootstrap( document, ['dotaApp'] );
} );
} );
} ); | mangeg/dota2test | Dota2Test/src/Dota2.WebApp/wwwroot/init.js | JavaScript | mit | 597 | [
30522,
5478,
1012,
9530,
8873,
2290,
1006,
1063,
1013,
1013,
2011,
12398,
7170,
2151,
11336,
8909,
2015,
2013,
1046,
2015,
1013,
5622,
2497,
2918,
3126,
2140,
1024,
1000,
10439,
1013,
1000,
1010,
1013,
1013,
3272,
1010,
2065,
1996,
11336,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
/* misc.c --- miscellaneous utility functions for RX simulator.
Copyright (C) 2005-2016 Free Software Foundation, Inc.
Contributed by Red Hat, Inc.
This file is part of the GNU simulators.
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/>. */
#include "config.h"
#include <stdio.h>
#include "cpu.h"
#include "misc.h"
int
bcd2int (int bcd, int w)
{
int v = 0, m = 1, i;
for (i = 0; i < (w ? 4 : 2); i++)
{
v += (bcd % 16) * m;
m *= 10;
bcd /= 16;
}
return v;
}
int
int2bcd (int v, int w)
{
int bcd = 0, m = 1, i;
for (i = 0; i < (w ? 4 : 2); i++)
{
bcd += (v % 10) * m;
m *= 16;
v /= 10;
}
return bcd;
}
char *
comma (unsigned int u)
{
static char buf[5][20];
static int bi = 0;
int comma = 0;
char *bp;
bi = (bi + 1) % 5;
bp = buf[bi] + 19;
*--bp = 0;
do
{
if (comma == 3)
{
*--bp = ',';
comma = 0;
}
comma++;
*--bp = '0' + (u % 10);
u /= 10;
}
while (u);
return bp;
}
| freak97/binutils | sim/rx/misc.c | C | gpl-2.0 | 1,565 | [
30522,
1013,
1008,
28616,
2278,
1012,
1039,
1011,
1011,
1011,
25408,
9710,
4972,
2005,
1054,
2595,
25837,
1012,
9385,
1006,
1039,
1007,
2384,
1011,
2355,
2489,
4007,
3192,
1010,
4297,
1012,
5201,
2011,
2417,
6045,
1010,
4297,
1012,
2023,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
/***************************************
* Responsive Menu - v.1.0
*
* Tested on:
* Firefox
* Chrome
* Safari
* IE9+ (because of its responsive nature is useless to optimize it for previeous IEs)
* Safari iOS
* ...It should work on Android too, but I've not tested on it yet ;)
*
* Overview:
*
* Two states responsive menu:
* - for desktops (or >768px screen resolutions) it renders as a classic inline menu,
* - for mobile (or <768px screen resolutions) it renders as a dropdown menu with open/close helper icon.
*
* Easily stylable, just change whatever you want in .main-* classes, or add your own classes if you prefer to.
*
* No javascript needed
*
* Notes:
*
* .responsive-* classes are the structural rules,
* .main-* classes are the stylistic rules, you should change them in order to make it render as you desire.
*
* The main html uses a resets-and-helpers.css external stylesheet in order to keep this one clean and readable,
* you can merge them together in your own project
*
* !Important!
* Add an ontouchstart="" listener to <body> tag to enable touch events
*
* ...Yeah, I know the look and feel is poor, but this is not a "Look-at-that-uber-cool-styled-menu" experiment,
* it was made as proof of concept, it must work not just look pretty...
* If you want it to nicer or match your design taste, then just extend it's style ;)
*
***************************************/
/***************************************
* Structure
***************************************/
.responsive-menu {
height: auto;
overflow: hidden;
cursor: pointer;
}
.responsive-menu-voice {
float: left;
height: 30px;
line-height: 30px;
}
/***************************************
* Styles goes here
***************************************/
.main-menu {
background: #e9e9e9;
}
.main-menu a {
padding: 0 5px;
color: #333;
font: 400 14px/14px Arial, Helvetica, Sans-Serif;
text-decoration: none;
text-transform: capitalize;
}
.main-menu .main-menu-voice {
background: #e9e9e9;
}
.main-menu .main-menu-voice:hover {
background: #e0e0e0;
}
.main-menu .main-menu-voice:hover a {
text-decoration: underline;
}
/***************************************
* mediaquery overrides
***************************************/
/* Landscape phone to portrait tablet */
@media only screen and (max-width: 768px) {
/***************************************
* Structure
***************************************/
.responsive-menu:before {
/* responsive-menu-opener.png width 30px, height 30px */
content: url('../gfx/responsive-menu-opener.png');/* opener's height should match wrapper height */
}
.responsive-menu:active,
.responsive-menu:hover {
height: auto;
}
.responsive-menu:active:before,
.responsive-menu:hover:before {
/* hover status for menu opener, just override content:...; */
content: url('../gfx/responsive-menu-opener-hover.png');
}
.responsive-menu {
height: 30px;/* wrapper height should match opener's height */
}
.responsive-menu-voices {
margin: 0;
}
.responsive-menu-voice {
float: none;
}
.responsive-menu-voice-link {
display: block;
}
/***************************************
* Styles goes here
***************************************/
.main-menu {
background: #d5d5d5;
}
.main-menu a {
line-height: 35px;
}
.main-menu .main-menu-voice {
height: 35px;
line-height: 35px;
}
.main-menu .main-menu-voice:active a,
.main-menu .main-menu-voice:hover a {
text-decoration: none;
padding-left: 10px;
}
}
/***************************************
* Puts your IE specific styles here
***************************************/
| Orlmente/css-only-responsive-menu | css-responsive-menu/assets/css/responsive-menu.css | CSS | mit | 3,812 | [
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... |
<?php
/**
* @Project NUKEVIET 4.x
* @Author VINADES (contact@vinades.vn)
* @Copyright 2014 VINADES. All rights reserved
* @License GNU/GPL version 2 or any later version
* @Createdate Apr 22, 2010 3:00:20 PM
*/
if( ! defined( 'NV_IS_FILE_ADMIN' ) ) die( 'Stop!!!' );
$xtpl = new XTemplate( 'list_row.tpl', NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $module_file );
$xtpl->assign( 'LANG', $lang_module );
$xtpl->assign( 'GLANG', $lang_global );
$a = 0;
$sql = 'SELECT * FROM ' . NV_PREFIXLANG . '_' . $module_data . '_rows ORDER BY full_name';
$result = $db->query( $sql );
while( $row = $result->fetch() )
{
++$a;
$xtpl->assign( 'ROW', array(
'full_name' => $row['full_name'],
'email' => $row['email'],
'phone' => $row['phone'],
'fax' => $row['fax'],
'id' => $row['id'],
'url_part' => NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $row['id'] . '/0/1',
'url_edit' => NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=row&id=' . $row['id']
) );
$array = array( $lang_global['disable'], $lang_global['active'] );
foreach( $array as $key => $val )
{
$xtpl->assign( 'STATUS', array(
'key' => $key,
'selected' => $key == $row['act'] ? ' selected="selected"' : '',
'title' => $val
) );
$xtpl->parse( 'main.row.status' );
}
$xtpl->parse( 'main.row' );
}
if( empty( $a ) )
{
Header( 'Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=row' );
die();
}
$xtpl->assign( 'URL_ADD', NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=row' );
$xtpl->parse( 'main' );
$contents = $xtpl->text( 'main' );
$page_title = $lang_module['list_row_title'];
include NV_ROOTDIR . '/includes/header.php';
echo nv_admin_theme( $contents );
include NV_ROOTDIR . '/includes/footer.php';
?> | doan281/nukeviet4_dev | modules/contact/admin/list_row.php | PHP | gpl-2.0 | 2,173 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
1008,
1030,
2622,
16371,
3489,
13469,
2102,
1018,
1012,
1060,
1008,
1030,
3166,
19354,
18673,
1006,
3967,
1030,
19354,
18673,
1012,
1058,
2078,
1007,
1008,
1030,
9385,
2297,
19354,
18673,
1012,
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... |
---
name: Zipkin
publisher: Kong Inc.
version: 0.1-x
source_url: https://github.com/Kong/kong-plugin-zipkin
desc: Propagate Zipkin spans and report space to a Zipkin server
description: |
Propagate Zipkin distributed tracing spans, and report spans to a Zipkin server.
<div class="alert alert-warning">
<strong>Note:</strong> The functionality of this plugin as bundled
with versions of Kong prior to 0.14.1 and Kong Enterprise prior to 0.34
differs from what is documented herein. Refer to the
<a href="https://github.com/Kong/kong/blob/master/CHANGELOG.md">CHANGELOG</a>
for details.
</div>
type: plugin
categories:
- analytics-monitoring
kong_version_compatibility:
community_edition:
compatible:
- 0.14.x
enterprise_edition:
compatible:
- 0.34-x
- 0.33-x
- 0.32-x
params:
name: zipkin
api_id: true
service_id: true
route_id: true
consumer_id: true
config:
- name: http_endpoint
required: true
default: ""
value_in_examples: http://your.zipkin.collector:9411/api/v2/spans
description: |
The full HTTP(S) endpoint to which Zipkin spans should be sent by Kong.
- name: sample_ratio
required: false
default: "`0.001`"
value_in_examples: 0.001
description: |
How often to sample requests that do not contain trace ids.
Set to `0` to turn sampling off, or to `1` to sample **all** requests.
---
## How it Works
When enabled, [this plugin](https://github.com/Kong/kong-plugin-zipkin) traces requests in a way compatible with [zipkin](https://zipkin.io/).
The code is structured around an [opentracing](http://opentracing.io/) core using the [opentracing-lua library](https://github.com/Kong/opentracing-lua) to collect timing data of a request in each of Kong's phases.
The plugin uses opentracing-lua compatible extractor, injector, and reporters to implement Zipkin's protocols.
### Extractor and Injector
An opentracing "extractor" collects information from an incoming request.
If no trace ID is present in the incoming request, then one is probabilistically generated based on the `sample_ratio` configuration value.
An opentracing "injector" adds trace information to an outgoing request. Currently, the injector is only called for the request proxied by kong; it is **not** yet used for requests to the database or by other plugins (such as the [http-log plugin](./http-log/)).
This plugin follows Zipkin's ["B3" specification](https://github.com/openzipkin/b3-propagation/) as to which HTTP headers to use. Additionally, it supports [Jaegar](http://jaegertracing.io/)-style `uberctx-` headers for propagating [baggage](https://github.com/opentracing/specification/blob/master/specification.md#set-a-baggage-item).
### Reporter
An opentracing "reporter" is how tracing data is reported to another system.
This plugin records tracing data for a given request, and sends it as a batch to a Zipkin server using [the Zipkin v2 API](https://zipkin.io/zipkin-api/#/default/post_spans). Note that zipkin version 1.31 or higher is required.
The `http_endpoint` configuration variable must contain the full uri including scheme, host, port and path sections (i.e. your uri likely ends in `/api/v2/spans`).
## FAQ
### Can I use this plugin with other tracing systems, like Jaeger?
Probably! Jaeger accepts spans in Zipkin format - see https://www.jaegertracing.io/docs/features/#backwards-compatibility-with-zipkin for more information.
| Mashape/getkong.org | app/_hub/kong-inc/zipkin/0.1-x.md | Markdown | mit | 3,525 | [
30522,
1011,
1011,
1011,
2171,
1024,
14101,
4939,
6674,
1024,
4290,
4297,
1012,
2544,
1024,
1014,
1012,
1015,
1011,
1060,
3120,
1035,
24471,
2140,
1024,
16770,
1024,
1013,
1013,
21025,
2705,
12083,
1012,
4012,
1013,
4290,
1013,
4290,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="style.css"></link>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0">
<table border="0" width=855px height=2095px align="left" cellspacing="0">
<tr cellspacing="0" width="855px" height="108px">
<td cellspacing="0" width="855px" height="108px">
<img src="howtosubmit_top.jpg" height="108" width="855" />
</td>
</tr>
<tr cellspacing="0" width="855px" height="200px">
<td cellspacing="0" width="855px" height="200px">
<a href="http://onstudynotes.com/submit/" target="_top">
<img src="howtosubmit_link.jpg" height="200" width="855" /></a>
</td>
</tr>
<tr cellspacing="0" width="855px" height="1648px">
<td cellspacing="0" width="855px" height="1648px">
<img src="howtosubmit_bottom.jpg" height="1648px" width="855px" />
</td>
</tr>
<tr cellspacing="0" width="855px" height="139px">
<td cellspacing="0" width="855px" height="139px">
<A HREF="http://onstudynotes.com/contact-us/" target=_top>
<img src="contactus.jpg" height="139" width="855" /></A>
</td>
</tr>
</table>
</body>
</html>
| onstudynotes/onstudynotes | instructions/howtosubmit.html | HTML | gpl-2.0 | 1,423 | [
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... |
// SPDX-License-Identifier: GPL-2.0-only
/*
* iio/adc/max1027.c
* Copyright (C) 2014 Philippe Reynes
*
* based on linux/drivers/iio/ad7923.c
* Copyright 2011 Analog Devices Inc (from AD7923 Driver)
* Copyright 2012 CS Systemes d'Information
*
* max1027.c
*
* Partial support for max1027 and similar chips.
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/spi/spi.h>
#include <linux/delay.h>
#include <linux/iio/iio.h>
#include <linux/iio/buffer.h>
#include <linux/iio/trigger.h>
#include <linux/iio/trigger_consumer.h>
#include <linux/iio/triggered_buffer.h>
#define MAX1027_CONV_REG BIT(7)
#define MAX1027_SETUP_REG BIT(6)
#define MAX1027_AVG_REG BIT(5)
#define MAX1027_RST_REG BIT(4)
/* conversion register */
#define MAX1027_TEMP BIT(0)
#define MAX1027_SCAN_0_N (0x00 << 1)
#define MAX1027_SCAN_N_M (0x01 << 1)
#define MAX1027_SCAN_N (0x02 << 1)
#define MAX1027_NOSCAN (0x03 << 1)
#define MAX1027_CHAN(n) ((n) << 3)
/* setup register */
#define MAX1027_UNIPOLAR 0x02
#define MAX1027_BIPOLAR 0x03
#define MAX1027_REF_MODE0 (0x00 << 2)
#define MAX1027_REF_MODE1 (0x01 << 2)
#define MAX1027_REF_MODE2 (0x02 << 2)
#define MAX1027_REF_MODE3 (0x03 << 2)
#define MAX1027_CKS_MODE0 (0x00 << 4)
#define MAX1027_CKS_MODE1 (0x01 << 4)
#define MAX1027_CKS_MODE2 (0x02 << 4)
#define MAX1027_CKS_MODE3 (0x03 << 4)
/* averaging register */
#define MAX1027_NSCAN_4 0x00
#define MAX1027_NSCAN_8 0x01
#define MAX1027_NSCAN_12 0x02
#define MAX1027_NSCAN_16 0x03
#define MAX1027_NAVG_4 (0x00 << 2)
#define MAX1027_NAVG_8 (0x01 << 2)
#define MAX1027_NAVG_16 (0x02 << 2)
#define MAX1027_NAVG_32 (0x03 << 2)
#define MAX1027_AVG_EN BIT(4)
enum max1027_id {
max1027,
max1029,
max1031,
max1227,
max1229,
max1231,
};
static const struct spi_device_id max1027_id[] = {
{"max1027", max1027},
{"max1029", max1029},
{"max1031", max1031},
{"max1227", max1227},
{"max1229", max1229},
{"max1231", max1231},
{}
};
MODULE_DEVICE_TABLE(spi, max1027_id);
static const struct of_device_id max1027_adc_dt_ids[] = {
{ .compatible = "maxim,max1027" },
{ .compatible = "maxim,max1029" },
{ .compatible = "maxim,max1031" },
{ .compatible = "maxim,max1227" },
{ .compatible = "maxim,max1229" },
{ .compatible = "maxim,max1231" },
{},
};
MODULE_DEVICE_TABLE(of, max1027_adc_dt_ids);
#define MAX1027_V_CHAN(index, depth) \
{ \
.type = IIO_VOLTAGE, \
.indexed = 1, \
.channel = index, \
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
.scan_index = index + 1, \
.scan_type = { \
.sign = 'u', \
.realbits = depth, \
.storagebits = 16, \
.shift = 2, \
.endianness = IIO_BE, \
}, \
}
#define MAX1027_T_CHAN \
{ \
.type = IIO_TEMP, \
.channel = 0, \
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
.scan_index = 0, \
.scan_type = { \
.sign = 'u', \
.realbits = 12, \
.storagebits = 16, \
.endianness = IIO_BE, \
}, \
}
#define MAX1X27_CHANNELS(depth) \
MAX1027_T_CHAN, \
MAX1027_V_CHAN(0, depth), \
MAX1027_V_CHAN(1, depth), \
MAX1027_V_CHAN(2, depth), \
MAX1027_V_CHAN(3, depth), \
MAX1027_V_CHAN(4, depth), \
MAX1027_V_CHAN(5, depth), \
MAX1027_V_CHAN(6, depth), \
MAX1027_V_CHAN(7, depth)
#define MAX1X29_CHANNELS(depth) \
MAX1X27_CHANNELS(depth), \
MAX1027_V_CHAN(8, depth), \
MAX1027_V_CHAN(9, depth), \
MAX1027_V_CHAN(10, depth), \
MAX1027_V_CHAN(11, depth)
#define MAX1X31_CHANNELS(depth) \
MAX1X27_CHANNELS(depth), \
MAX1X29_CHANNELS(depth), \
MAX1027_V_CHAN(12, depth), \
MAX1027_V_CHAN(13, depth), \
MAX1027_V_CHAN(14, depth), \
MAX1027_V_CHAN(15, depth)
static const struct iio_chan_spec max1027_channels[] = {
MAX1X27_CHANNELS(10),
};
static const struct iio_chan_spec max1029_channels[] = {
MAX1X29_CHANNELS(10),
};
static const struct iio_chan_spec max1031_channels[] = {
MAX1X31_CHANNELS(10),
};
static const struct iio_chan_spec max1227_channels[] = {
MAX1X27_CHANNELS(12),
};
static const struct iio_chan_spec max1229_channels[] = {
MAX1X29_CHANNELS(12),
};
static const struct iio_chan_spec max1231_channels[] = {
MAX1X31_CHANNELS(12),
};
static const unsigned long max1027_available_scan_masks[] = {
0x000001ff,
0x00000000,
};
static const unsigned long max1029_available_scan_masks[] = {
0x00001fff,
0x00000000,
};
static const unsigned long max1031_available_scan_masks[] = {
0x0001ffff,
0x00000000,
};
struct max1027_chip_info {
const struct iio_chan_spec *channels;
unsigned int num_channels;
const unsigned long *available_scan_masks;
};
static const struct max1027_chip_info max1027_chip_info_tbl[] = {
[max1027] = {
.channels = max1027_channels,
.num_channels = ARRAY_SIZE(max1027_channels),
.available_scan_masks = max1027_available_scan_masks,
},
[max1029] = {
.channels = max1029_channels,
.num_channels = ARRAY_SIZE(max1029_channels),
.available_scan_masks = max1029_available_scan_masks,
},
[max1031] = {
.channels = max1031_channels,
.num_channels = ARRAY_SIZE(max1031_channels),
.available_scan_masks = max1031_available_scan_masks,
},
[max1227] = {
.channels = max1227_channels,
.num_channels = ARRAY_SIZE(max1227_channels),
.available_scan_masks = max1027_available_scan_masks,
},
[max1229] = {
.channels = max1229_channels,
.num_channels = ARRAY_SIZE(max1229_channels),
.available_scan_masks = max1029_available_scan_masks,
},
[max1231] = {
.channels = max1231_channels,
.num_channels = ARRAY_SIZE(max1231_channels),
.available_scan_masks = max1031_available_scan_masks,
},
};
struct max1027_state {
const struct max1027_chip_info *info;
struct spi_device *spi;
struct iio_trigger *trig;
__be16 *buffer;
struct mutex lock;
u8 reg ____cacheline_aligned;
};
static int max1027_read_single_value(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val)
{
int ret;
struct max1027_state *st = iio_priv(indio_dev);
if (iio_buffer_enabled(indio_dev)) {
dev_warn(&indio_dev->dev, "trigger mode already enabled");
return -EBUSY;
}
/* Start acquisition on conversion register write */
st->reg = MAX1027_SETUP_REG | MAX1027_REF_MODE2 | MAX1027_CKS_MODE2;
ret = spi_write(st->spi, &st->reg, 1);
if (ret < 0) {
dev_err(&indio_dev->dev,
"Failed to configure setup register\n");
return ret;
}
/* Configure conversion register with the requested chan */
st->reg = MAX1027_CONV_REG | MAX1027_CHAN(chan->channel) |
MAX1027_NOSCAN;
if (chan->type == IIO_TEMP)
st->reg |= MAX1027_TEMP;
ret = spi_write(st->spi, &st->reg, 1);
if (ret < 0) {
dev_err(&indio_dev->dev,
"Failed to configure conversion register\n");
return ret;
}
/*
* For an unknown reason, when we use the mode "10" (write
* conversion register), the interrupt doesn't occur every time.
* So we just wait 1 ms.
*/
mdelay(1);
/* Read result */
ret = spi_read(st->spi, st->buffer, (chan->type == IIO_TEMP) ? 4 : 2);
if (ret < 0)
return ret;
*val = be16_to_cpu(st->buffer[0]);
return IIO_VAL_INT;
}
static int max1027_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val, int *val2, long mask)
{
int ret = 0;
struct max1027_state *st = iio_priv(indio_dev);
mutex_lock(&st->lock);
switch (mask) {
case IIO_CHAN_INFO_RAW:
ret = max1027_read_single_value(indio_dev, chan, val);
break;
case IIO_CHAN_INFO_SCALE:
switch (chan->type) {
case IIO_TEMP:
*val = 1;
*val2 = 8;
ret = IIO_VAL_FRACTIONAL;
break;
case IIO_VOLTAGE:
*val = 2500;
*val2 = chan->scan_type.realbits;
ret = IIO_VAL_FRACTIONAL_LOG2;
break;
default:
ret = -EINVAL;
break;
}
break;
default:
ret = -EINVAL;
break;
}
mutex_unlock(&st->lock);
return ret;
}
static int max1027_debugfs_reg_access(struct iio_dev *indio_dev,
unsigned reg, unsigned writeval,
unsigned *readval)
{
struct max1027_state *st = iio_priv(indio_dev);
u8 *val = (u8 *)st->buffer;
if (readval) {
int ret = spi_read(st->spi, val, 2);
*readval = be16_to_cpu(st->buffer[0]);
return ret;
}
*val = (u8)writeval;
return spi_write(st->spi, val, 1);
}
static int max1027_validate_trigger(struct iio_dev *indio_dev,
struct iio_trigger *trig)
{
struct max1027_state *st = iio_priv(indio_dev);
if (st->trig != trig)
return -EINVAL;
return 0;
}
static int max1027_set_trigger_state(struct iio_trigger *trig, bool state)
{
struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig);
struct max1027_state *st = iio_priv(indio_dev);
int ret;
if (state) {
/* Start acquisition on cnvst */
st->reg = MAX1027_SETUP_REG | MAX1027_CKS_MODE0 |
MAX1027_REF_MODE2;
ret = spi_write(st->spi, &st->reg, 1);
if (ret < 0)
return ret;
/* Scan from 0 to max */
st->reg = MAX1027_CONV_REG | MAX1027_CHAN(0) |
MAX1027_SCAN_N_M | MAX1027_TEMP;
ret = spi_write(st->spi, &st->reg, 1);
if (ret < 0)
return ret;
} else {
/* Start acquisition on conversion register write */
st->reg = MAX1027_SETUP_REG | MAX1027_CKS_MODE2 |
MAX1027_REF_MODE2;
ret = spi_write(st->spi, &st->reg, 1);
if (ret < 0)
return ret;
}
return 0;
}
static irqreturn_t max1027_trigger_handler(int irq, void *private)
{
struct iio_poll_func *pf = private;
struct iio_dev *indio_dev = pf->indio_dev;
struct max1027_state *st = iio_priv(indio_dev);
pr_debug("%s(irq=%d, private=0x%p)\n", __func__, irq, private);
/* fill buffer with all channel */
spi_read(st->spi, st->buffer, indio_dev->masklength * 2);
iio_push_to_buffers(indio_dev, st->buffer);
iio_trigger_notify_done(indio_dev->trig);
return IRQ_HANDLED;
}
static const struct iio_trigger_ops max1027_trigger_ops = {
.validate_device = &iio_trigger_validate_own_device,
.set_trigger_state = &max1027_set_trigger_state,
};
static const struct iio_info max1027_info = {
.read_raw = &max1027_read_raw,
.validate_trigger = &max1027_validate_trigger,
.debugfs_reg_access = &max1027_debugfs_reg_access,
};
static int max1027_probe(struct spi_device *spi)
{
int ret;
struct iio_dev *indio_dev;
struct max1027_state *st;
pr_debug("%s: probe(spi = 0x%p)\n", __func__, spi);
indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
if (indio_dev == NULL) {
pr_err("Can't allocate iio device\n");
return -ENOMEM;
}
spi_set_drvdata(spi, indio_dev);
st = iio_priv(indio_dev);
st->spi = spi;
st->info = &max1027_chip_info_tbl[spi_get_device_id(spi)->driver_data];
mutex_init(&st->lock);
indio_dev->name = spi_get_device_id(spi)->name;
indio_dev->info = &max1027_info;
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->channels = st->info->channels;
indio_dev->num_channels = st->info->num_channels;
indio_dev->available_scan_masks = st->info->available_scan_masks;
st->buffer = devm_kmalloc_array(&indio_dev->dev,
indio_dev->num_channels, 2,
GFP_KERNEL);
if (st->buffer == NULL) {
dev_err(&indio_dev->dev, "Can't allocate buffer\n");
return -ENOMEM;
}
if (spi->irq) {
ret = devm_iio_triggered_buffer_setup(&spi->dev, indio_dev,
&iio_pollfunc_store_time,
&max1027_trigger_handler,
NULL);
if (ret < 0) {
dev_err(&indio_dev->dev, "Failed to setup buffer\n");
return ret;
}
st->trig = devm_iio_trigger_alloc(&spi->dev, "%s-trigger",
indio_dev->name);
if (st->trig == NULL) {
ret = -ENOMEM;
dev_err(&indio_dev->dev,
"Failed to allocate iio trigger\n");
return ret;
}
st->trig->ops = &max1027_trigger_ops;
st->trig->dev.parent = &spi->dev;
iio_trigger_set_drvdata(st->trig, indio_dev);
ret = devm_iio_trigger_register(&indio_dev->dev,
st->trig);
if (ret < 0) {
dev_err(&indio_dev->dev,
"Failed to register iio trigger\n");
return ret;
}
ret = devm_request_threaded_irq(&spi->dev, spi->irq,
iio_trigger_generic_data_rdy_poll,
NULL,
IRQF_TRIGGER_FALLING,
spi->dev.driver->name,
st->trig);
if (ret < 0) {
dev_err(&indio_dev->dev, "Failed to allocate IRQ.\n");
return ret;
}
}
/* Internal reset */
st->reg = MAX1027_RST_REG;
ret = spi_write(st->spi, &st->reg, 1);
if (ret < 0) {
dev_err(&indio_dev->dev, "Failed to reset the ADC\n");
return ret;
}
/* Disable averaging */
st->reg = MAX1027_AVG_REG;
ret = spi_write(st->spi, &st->reg, 1);
if (ret < 0) {
dev_err(&indio_dev->dev, "Failed to configure averaging register\n");
return ret;
}
return devm_iio_device_register(&spi->dev, indio_dev);
}
static struct spi_driver max1027_driver = {
.driver = {
.name = "max1027",
.of_match_table = max1027_adc_dt_ids,
},
.probe = max1027_probe,
.id_table = max1027_id,
};
module_spi_driver(max1027_driver);
MODULE_AUTHOR("Philippe Reynes <tremyfr@yahoo.fr>");
MODULE_DESCRIPTION("MAX1X27/MAX1X29/MAX1X31 ADC");
MODULE_LICENSE("GPL v2");
| GuillaumeSeren/linux | drivers/iio/adc/max1027.c | C | gpl-2.0 | 13,085 | [
30522,
1013,
1013,
23772,
2595,
1011,
6105,
1011,
8909,
4765,
18095,
1024,
14246,
2140,
1011,
1016,
1012,
1014,
1011,
2069,
1013,
1008,
1008,
2462,
2080,
1013,
4748,
2278,
1013,
4098,
10790,
22907,
1012,
1039,
1008,
9385,
1006,
1039,
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... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014-2019 khalim19
#
# 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.
"""
This module defines a custom widget holding an array of GUI elements. The widget
is used as the default GUI for `setting.ArraySetting` instances.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
from future.builtins import *
import collections
import contextlib
import pygtk
pygtk.require("2.0")
import gtk
import gobject
from .. import utils as pgutils
from . import draganddropcontext as draganddropcontext_
__all__ = [
"ItemBox",
"ArrayBox",
"ItemBoxItem",
]
class ItemBox(gtk.ScrolledWindow):
"""
This base class defines a scrollable box holding a vertical list of items.
Each item is an instance of `_ItemBoxItem` class or one of its subclasses.
"""
ITEM_SPACING = 4
VBOX_SPACING = 4
def __init__(self, item_spacing=ITEM_SPACING, *args, **kwargs):
super().__init__(*args, **kwargs)
self._item_spacing = item_spacing
self._drag_and_drop_context = draganddropcontext_.DragAndDropContext()
self._items = []
self._vbox_items = gtk.VBox(homogeneous=False)
self._vbox_items.set_spacing(self._item_spacing)
self._vbox = gtk.VBox(homogeneous=False)
self._vbox.set_spacing(self.VBOX_SPACING)
self._vbox.pack_start(self._vbox_items, expand=False, fill=False)
self.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
self.add_with_viewport(self._vbox)
self.get_child().set_shadow_type(gtk.SHADOW_NONE)
def add_item(self, item):
self._vbox_items.pack_start(item.widget, expand=False, fill=False)
item.button_remove.connect("clicked", self._on_item_button_remove_clicked, item)
item.widget.connect("key-press-event", self._on_item_widget_key_press_event, item)
self._setup_drag(item)
self._items.append(item)
return item
def reorder_item(self, item, position):
new_position = min(max(position, 0), len(self._items) - 1)
self._items.pop(self._get_item_position(item))
self._items.insert(new_position, item)
self._vbox_items.reorder_child(item.widget, new_position)
return new_position
def remove_item(self, item):
item_position = self._get_item_position(item)
if item_position < len(self._items) - 1:
next_item_position = item_position + 1
self._items[next_item_position].item_widget.grab_focus()
self._vbox_items.remove(item.widget)
item.remove_item_widget()
self._items.remove(item)
def clear(self):
for unused_ in range(len(self._items)):
self.remove_item(self._items[0])
def _setup_drag(self, item):
self._drag_and_drop_context.setup_drag(
item.item_widget,
self._get_drag_data,
self._on_drag_data_received,
[item],
[item],
self)
def _get_drag_data(self, dragged_item):
return str(self._items.index(dragged_item))
def _on_drag_data_received(self, dragged_item_index_str, destination_item):
dragged_item = self._items[int(dragged_item_index_str)]
self.reorder_item(dragged_item, self._get_item_position(destination_item))
def _on_item_widget_key_press_event(self, widget, event, item):
if event.state & gtk.gdk.MOD1_MASK: # Alt key
key_name = gtk.gdk.keyval_name(event.keyval)
if key_name in ["Up", "KP_Up"]:
self.reorder_item(
item, self._get_item_position(item) - 1)
elif key_name in ["Down", "KP_Down"]:
self.reorder_item(
item, self._get_item_position(item) + 1)
def _on_item_button_remove_clicked(self, button, item):
self.remove_item(item)
def _get_item_position(self, item):
return self._items.index(item)
class ItemBoxItem(object):
_HBOX_BUTTONS_SPACING = 3
_HBOX_SPACING = 3
def __init__(self, item_widget):
self._item_widget = item_widget
self._hbox = gtk.HBox(homogeneous=False)
self._hbox.set_spacing(self._HBOX_SPACING)
self._hbox_buttons = gtk.HBox(homogeneous=False)
self._hbox_buttons.set_spacing(self._HBOX_BUTTONS_SPACING)
self._event_box_buttons = gtk.EventBox()
self._event_box_buttons.add(self._hbox_buttons)
self._hbox.pack_start(self._item_widget, expand=True, fill=True)
self._hbox.pack_start(self._event_box_buttons, expand=False, fill=False)
self._event_box = gtk.EventBox()
self._event_box.add(self._hbox)
self._has_hbox_buttons_focus = False
self._button_remove = gtk.Button()
self._setup_item_button(self._button_remove, gtk.STOCK_CLOSE)
self._event_box.connect("enter-notify-event", self._on_event_box_enter_notify_event)
self._event_box.connect("leave-notify-event", self._on_event_box_leave_notify_event)
self._is_event_box_allocated_size = False
self._buttons_allocation = None
self._event_box.connect("size-allocate", self._on_event_box_size_allocate)
self._event_box_buttons.connect(
"size-allocate", self._on_event_box_buttons_size_allocate)
self._event_box.show_all()
self._hbox_buttons.set_no_show_all(True)
@property
def widget(self):
return self._event_box
@property
def item_widget(self):
return self._item_widget
@property
def button_remove(self):
return self._button_remove
def remove_item_widget(self):
self._hbox.remove(self._item_widget)
def _setup_item_button(self, item_button, icon, position=None):
item_button.set_relief(gtk.RELIEF_NONE)
button_icon = gtk.image_new_from_pixbuf(
item_button.render_icon(icon, gtk.ICON_SIZE_MENU))
item_button.add(button_icon)
self._hbox_buttons.pack_start(item_button, expand=False, fill=False)
if position is not None:
self._hbox_buttons.reorder_child(item_button, position)
item_button.show_all()
def _on_event_box_enter_notify_event(self, event_box, event):
if event.detail != gtk.gdk.NOTIFY_INFERIOR:
self._hbox_buttons.show()
def _on_event_box_leave_notify_event(self, event_box, event):
if event.detail != gtk.gdk.NOTIFY_INFERIOR:
self._hbox_buttons.hide()
def _on_event_box_size_allocate(self, event_box, allocation):
if self._is_event_box_allocated_size:
return
self._is_event_box_allocated_size = True
# Assign enough height to the HBox to make sure it does not resize when
# showing buttons.
if self._buttons_allocation.height >= allocation.height:
self._hbox.set_property("height-request", allocation.height)
def _on_event_box_buttons_size_allocate(self, event_box, allocation):
if self._buttons_allocation is not None:
return
self._buttons_allocation = allocation
# Make sure the width allocated to the buttons remains the same even if
# buttons are hidden. This avoids a problem with unreachable buttons when
# the horizontal scrollbar is displayed.
self._event_box_buttons.set_property(
"width-request", self._buttons_allocation.width)
self._hbox_buttons.hide()
class ArrayBox(ItemBox):
"""
This class can be used to edit `setting.ArraySetting` instances interactively.
Signals:
* `"array-box-changed"` - An item was added, reordered or removed by the user.
* `"array-box-item-changed"` - The contents of an item was modified by the
user. Currently, this signal is not invoked in this widget and can only be
invoked explicitly by calling `ArrayBox.emit("array-box-item-changed")`.
"""
__gsignals__ = {
b"array-box-changed": (gobject.SIGNAL_RUN_FIRST, None, ()),
b"array-box-item-changed": (gobject.SIGNAL_RUN_FIRST, None, ())}
_SIZE_HBOX_SPACING = 6
def __init__(
self,
new_item_default_value,
min_size=0,
max_size=None,
item_spacing=ItemBox.ITEM_SPACING,
max_width=None,
max_height=None,
*args,
**kwargs):
"""
Parameters:
* `new_item_default_value` - default value for new items.
* `min_size` - minimum number of elements.
* `max_size` - maximum number of elements. If `None`, the number of elements
is unlimited.
* `item_spacing` - vertical spacing in pixels between items.
* `max_width` - maximum width of the array box before the horizontal
scrollbar is displayed. The array box will resize automatically until the
maximum width is reached. If `max_width` is `None`, the width is fixed
to whatever width is provided by `gtk.ScrolledWindow`. If `max_width` is
zero or negative, the width is unlimited.
* `max_height` - maximum height of the array box before the vertical
scrollbar is displayed. For more information, see `max_width`.
"""
super().__init__(item_spacing=item_spacing, *args, **kwargs)
self._new_item_default_value = new_item_default_value
self._min_size = min_size if min_size >= 0 else 0
if max_size is None:
self._max_size = 2**32
else:
self._max_size = max_size if max_size >= min_size else min_size
self.max_width = max_width
self.max_height = max_height
self.on_add_item = pgutils.empty_func
self.on_reorder_item = pgutils.empty_func
self.on_remove_item = pgutils.empty_func
self._items_total_width = None
self._items_total_height = None
self._items_allocations = {}
self._locker = _ActionLocker()
self._init_gui()
def _init_gui(self):
self._size_spin_button = gtk.SpinButton(
gtk.Adjustment(
value=0,
lower=self._min_size,
upper=self._max_size,
step_incr=1,
page_incr=10,
),
digits=0)
self._size_spin_button.set_numeric(True)
self._size_spin_button.set_value(0)
self._size_spin_button_label = gtk.Label(_("Size"))
self._size_hbox = gtk.HBox()
self._size_hbox.set_spacing(self._SIZE_HBOX_SPACING)
self._size_hbox.pack_start(self._size_spin_button_label, expand=False, fill=False)
self._size_hbox.pack_start(self._size_spin_button, expand=False, fill=False)
self._vbox.pack_start(self._size_hbox, expand=False, fill=False)
self._vbox.reorder_child(self._size_hbox, 0)
self._size_spin_button.connect(
"value-changed", self._on_size_spin_button_value_changed)
def add_item(self, item_value=None, index=None):
if item_value is None:
item_value = self._new_item_default_value
item_widget = self.on_add_item(item_value, index)
item = _ArrayBoxItem(item_widget)
super().add_item(item)
item.widget.connect("size-allocate", self._on_item_widget_size_allocate, item)
if index is None:
item.label.set_label(self._get_item_name(len(self._items)))
if index is not None:
with self._locker.lock_temp("emit_array_box_changed_on_reorder"):
self.reorder_item(item, index)
if self._locker.is_unlocked("update_spin_button"):
with self._locker.lock_temp("emit_size_spin_button_value_changed"):
self._size_spin_button.spin(gtk.SPIN_STEP_FORWARD, increment=1)
return item
def reorder_item(self, item, new_position):
orig_position = self._get_item_position(item)
processed_new_position = super().reorder_item(item, new_position)
self.on_reorder_item(orig_position, processed_new_position)
self._rename_item_names(min(orig_position, processed_new_position))
if self._locker.is_unlocked("emit_array_box_changed_on_reorder"):
self.emit("array-box-changed")
def remove_item(self, item):
if (self._locker.is_unlocked("prevent_removal_below_min_size")
and len(self._items) == self._min_size):
return
if self._locker.is_unlocked("update_spin_button"):
with self._locker.lock_temp("emit_size_spin_button_value_changed"):
self._size_spin_button.spin(gtk.SPIN_STEP_BACKWARD, increment=1)
item_position = self._get_item_position(item)
super().remove_item(item)
if item in self._items_allocations:
self._update_height(-(self._items_allocations[item].height + self._item_spacing))
del self._items_allocations[item]
self.on_remove_item(item_position)
self._rename_item_names(item_position)
def set_values(self, values):
self._locker.lock("emit_size_spin_button_value_changed")
self._locker.lock("prevent_removal_below_min_size")
orig_on_remove_item = self.on_remove_item
self.on_remove_item = pgutils.empty_func
self.clear()
# This fixes an issue of items being allocated height of 1 when the array
# size was previously 0.
self.set_property("height-request", -1)
for index, value in enumerate(values):
self.add_item(value, index)
self.on_remove_item = orig_on_remove_item
self._size_spin_button.set_value(len(values))
self._locker.unlock("prevent_removal_below_min_size")
self._locker.unlock("emit_size_spin_button_value_changed")
def _setup_drag(self, item):
self._drag_and_drop_context.setup_drag(
# Using the entire item allows dragging only by the label rather than the
# widget itself. This avoids problems with widgets such as spin buttons
# that do not behave correctly when reordering and also avoids accidental
# clicking and modifying the widget by the user.
item.widget,
self._get_drag_data,
self._on_drag_data_received,
[item],
[item],
self)
def _on_size_spin_button_value_changed(self, size_spin_button):
if self._locker.is_unlocked("emit_size_spin_button_value_changed"):
self._locker.lock("update_spin_button")
new_size = size_spin_button.get_value_as_int()
if new_size > len(self._items):
num_elements_to_add = new_size - len(self._items)
for unused_ in range(num_elements_to_add):
self.add_item()
elif new_size < len(self._items):
num_elements_to_remove = len(self._items) - new_size
for unused_ in range(num_elements_to_remove):
self.remove_item(self._items[-1])
self.emit("array-box-changed")
self._locker.unlock("update_spin_button")
def _on_item_button_remove_clicked(self, button, item):
self._locker.lock("emit_size_spin_button_value_changed")
should_emit_signal = (
len(self._items) > self._min_size
or self._locker.is_locked("prevent_removal_below_min_size"))
super()._on_item_button_remove_clicked(button, item)
if should_emit_signal:
self.emit("array-box-changed")
self._locker.unlock("emit_size_spin_button_value_changed")
def _on_item_widget_size_allocate(self, item_widget, allocation, item):
if item in self._items_allocations:
self._update_width(allocation.width - self._items_allocations[item].width)
self._update_height(allocation.height - self._items_allocations[item].height)
else:
self._update_width(allocation.width)
self._update_height(allocation.height + self._item_spacing)
self._items_allocations[item] = allocation
def _update_width(self, width_diff):
if self._items_total_width is None:
self._items_total_width = self.get_allocation().width
if width_diff != 0:
self._update_dimension(
width_diff,
self._items_total_width,
self.max_width,
"width-request")
self._items_total_width = self._items_total_width + width_diff
def _update_height(self, height_diff):
if self._items_total_height is None:
self._items_total_height = self.get_allocation().height
if height_diff != 0:
self._update_dimension(
height_diff,
self._items_total_height,
self.max_height,
"height-request")
self._items_total_height = self._items_total_height + height_diff
def _update_dimension(
self,
size_diff,
total_size,
max_visible_size,
dimension_request_property):
if max_visible_size is None:
is_max_visible_size_unlimited = True
else:
is_max_visible_size_unlimited = max_visible_size <= 0
if not is_max_visible_size_unlimited:
visible_size = min(total_size, max_visible_size)
else:
visible_size = total_size
if (is_max_visible_size_unlimited
or (visible_size + size_diff <= max_visible_size
and total_size < max_visible_size)):
new_size = visible_size + size_diff
elif total_size >= max_visible_size and size_diff < 0:
if total_size + size_diff < max_visible_size:
new_size = total_size + size_diff
else:
new_size = max_visible_size
else:
new_size = max_visible_size
if max_visible_size is not None:
self.set_property(dimension_request_property, new_size)
def _rename_item_names(self, start_index):
for index, item in enumerate(self._items[start_index:]):
item.label.set_label(self._get_item_name(index + 1 + start_index))
@staticmethod
def _get_item_name(index):
return _("Element") + " " + str(index)
class _ArrayBoxItem(ItemBoxItem):
def __init__(self, item_widget):
super().__init__(item_widget)
self._label = gtk.Label()
self._label.show()
self._hbox.pack_start(self._label, expand=False, fill=False)
self._hbox.reorder_child(self._label, 0)
@property
def label(self):
return self._label
class _ActionLocker(object):
def __init__(self):
self._tokens = collections.defaultdict(int)
@contextlib.contextmanager
def lock_temp(self, key):
self.lock(key)
try:
yield
finally:
self.unlock(key)
def lock(self, key):
self._tokens[key] += 1
def unlock(self, key):
if self._tokens[key] > 0:
self._tokens[key] -= 1
def is_locked(self, key):
return self._tokens[key] > 0
def is_unlocked(self, key):
return self._tokens[key] == 0
gobject.type_register(ArrayBox)
| khalim19/gimp-plugin-export-layers | export_layers/pygimplib/gui/itembox.py | Python | gpl-3.0 | 18,637 | [
30522,
1001,
1011,
1008,
1011,
16861,
1024,
21183,
2546,
1011,
1022,
1011,
1008,
1011,
1001,
1001,
9385,
1006,
1039,
1007,
2297,
1011,
10476,
1047,
8865,
5714,
16147,
1001,
1001,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 SiteTest\Form;
use Site\Form\ConnectedSiteToggleForm;
class ConnectedSiteToggleFormTest extends \Dvsa\Mot\Frontend\Test\TestCase
{
public function testFormRadioOnValues() {
$form = new ConnectedSiteToggleForm();
$form->setValue(0);
$this->assertFalse($form->getRadioOnElement()->isChecked());
$form = new ConnectedSiteToggleForm();
$form->setValue(1);
$this->assertTrue($form->getRadioOnElement()->isChecked());
}
public function testFormRadioOffValues() {
$form = new ConnectedSiteToggleForm();
$form->setValue(0);
$this->assertTrue($form->getRadioOffElement()->isChecked());
$form = new ConnectedSiteToggleForm();
$form->setValue(1);
$this->assertFalse($form->getRadioOffElement()->isChecked());
}
/**
* @dataProvider dataProviderFormValidation
*/
public function testFormValidation($value, $isValid){
$form = new ConnectedSiteToggleForm();
$this->assertSame($isValid, $form->isValid($value));
}
public function dataProviderFormValidation(){
return [
[1, true],
[0, true],
[-1, false],
[2, false],
[3, false],
];
}
} | dvsa/mot | mot-web-frontend/module/Site/test/SiteTest/Form/ConnectedSiteToggleFormTest.php | PHP | mit | 1,277 | [
30522,
1026,
1029,
25718,
3415,
15327,
2609,
22199,
1032,
2433,
1025,
2224,
2609,
1032,
2433,
1032,
4198,
28032,
18903,
24679,
14192,
1025,
2465,
4198,
28032,
18903,
24679,
14192,
22199,
8908,
1032,
1040,
15088,
2050,
1032,
9587,
2102,
1032,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 nars.experiment.minicraft.top.item;
public class ToolType {
public static final ToolType shovel = new ToolType("Shvl", 0);
public static final ToolType hoe = new ToolType("Hoe", 1);
public static final ToolType sword = new ToolType("Swrd", 2);
public static final ToolType pickaxe = new ToolType("Pick", 3);
public static final ToolType axe = new ToolType("Axe", 4);
public final String name;
public final int sprite;
private ToolType(String name, int sprite) {
this.name = name;
this.sprite = sprite;
}
}
| automenta/narchy | lab/src/main/java/nars/experiment/minicraft/top/item/ToolType.java | Java | agpl-3.0 | 569 | [
30522,
7427,
6583,
2869,
1012,
7551,
1012,
7163,
10419,
1012,
2327,
1012,
8875,
1025,
2270,
2465,
6994,
13874,
1063,
2270,
10763,
2345,
6994,
13874,
24596,
1027,
2047,
6994,
13874,
1006,
1000,
14021,
2615,
2140,
1000,
1010,
1014,
1007,
1025... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
// NOTE: This example uses the next generation Twilio helper library - for more
// information on how to download and install this version, visit
// https://www.twilio.com/docs/libraries/node
const apiKeySid = 'SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const apiKeySecret = 'your_api_key_secret';
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const Twilio = require('twilio');
const client = new Twilio(apiKeySid, apiKeySecret, { accountSid: accountSid });
client.video.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch().then(room => {
console.log(room.uniqueName);
});
| teoreteetik/api-snippets | video/rest/rooms/retrieve-room-by-sid/retrieve-room-by-sid.3.x.js | JavaScript | mit | 578 | [
30522,
1013,
1013,
3602,
1024,
2023,
2742,
3594,
1996,
2279,
4245,
1056,
29602,
3695,
2393,
2121,
3075,
1011,
2005,
2062,
1013,
1013,
2592,
2006,
2129,
2000,
8816,
1998,
16500,
2023,
2544,
1010,
3942,
1013,
1013,
16770,
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... |
<?php
namespace spec\Genesis\API\Constants\Transaction;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
class StatesSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType('Genesis\API\Constants\Transaction\States');
}
}
| dev018/testrepo | spec/Genesis/API/Constants/Transaction/StatesSpec.php | PHP | mit | 276 | [
30522,
1026,
1029,
25718,
30524,
4874,
4783,
3270,
25500,
2099,
1063,
3853,
2009,
1035,
2003,
1035,
3988,
21335,
3468,
1006,
1007,
1063,
1002,
2023,
1011,
1028,
2323,
3270,
19510,
18863,
1006,
1005,
11046,
1032,
17928,
1032,
5377,
2015,
103... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 PIGEON_H_
#define PIGEON_H_
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
#define PIGEON_ALIGNSIZE 4
#define PIGEON_LINESIZE 80
// Typedefs {{{
typedef void
(*PortalEntryHandler)(void * target, char * message, char * response);
typedef char *
(*PigeonIn)(char * buffer, int maxSize); // getline
typedef void
(*PigeonOut)(const char * message); // puts
typedef unsigned long
(*PigeonMillis)(); // millis
struct Pigeon;
typedef struct Pigeon Pigeon;
struct Portal;
typedef struct Portal Portal;
typedef struct
PortalEntrySetup
{
char * key;
PortalEntryHandler handler;
void * handle;
bool stream;
bool onchange;
bool manual;
}
PortalEntrySetup;
// }}}
// Methods {{{
void
portalAdd(Portal*, PortalEntrySetup);
void
portalAddBatch(Portal*, PortalEntrySetup*);
void
portalSet(
Portal*,
const char * key,
const char * message
);
void
portalGetStreamKeys(Portal*, char * destination);
bool
portalSetStreamKeys(Portal*, char * sequence);
void
portalUpdate(Portal*, const char * key);
void
portalFlush(Portal*);
void
portalReady(Portal*);
void
portalEnable(Portal*);
void
portalDisable(Portal*);
Pigeon *
pigeonInit(PigeonIn, PigeonOut, PigeonMillis);
Portal *
pigeonCreatePortal(Pigeon*, const char * id);
void
pigeonReady(Pigeon*);
void
portalFloatHandler(void * handle, char * message, char * response);
void
portalUintHandler(void * handle, char * message, char * response);
void
portalIntHandler(void * handle, char * message, char * response);
void
portalUlongHandler(void * handle, char * message, char * response);
void
portalBoolHandler(void * handle, char * message, char * response);
void
portalStreamKeyHandler(void * handle, char * message, char * response);
// }}}
// End C++ export structure
#ifdef __cplusplus
}
#endif
// End include guard
#endif
| ErnWong/NothingButNet-Mark-III | include/pigeon.h | C | mit | 1,856 | [
30522,
1001,
2065,
13629,
2546,
16516,
1035,
1044,
1035,
1001,
9375,
16516,
1035,
1044,
1035,
1001,
2421,
1026,
2358,
18939,
13669,
1012,
1044,
1028,
1001,
2065,
3207,
2546,
1035,
1035,
18133,
7393,
24759,
2271,
4654,
16451,
1000,
1039,
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 2020 The Knative Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package generators
import (
"io"
"k8s.io/gengo/generator"
"k8s.io/gengo/namer"
"k8s.io/gengo/types"
"k8s.io/klog"
)
// reconcilerControllerStubGenerator produces a file of the stub of the
// controller for a custom impl with injection.
type reconcilerControllerStubGenerator struct {
generator.DefaultGen
outputPackage string
imports namer.ImportTracker
typeToGenerate *types.Type
reconcilerPkg string
informerPackagePath string
reconcilerClass string
hasReconcilerClass bool
}
var _ generator.Generator = (*reconcilerControllerStubGenerator)(nil)
func (g *reconcilerControllerStubGenerator) Filter(c *generator.Context, t *types.Type) bool {
// Only process the type for this generator.
return t == g.typeToGenerate
}
func (g *reconcilerControllerStubGenerator) Namers(c *generator.Context) namer.NameSystems {
return namer.NameSystems{
"raw": namer.NewRawNamer(g.outputPackage, g.imports),
}
}
func (g *reconcilerControllerStubGenerator) Imports(c *generator.Context) (imports []string) {
imports = append(imports, g.imports.ImportLines()...)
return
}
func (g *reconcilerControllerStubGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error {
sw := generator.NewSnippetWriter(w, c, "{{", "}}")
klog.V(5).Info("processing type ", t)
m := map[string]interface{}{
"type": t,
"class": g.reconcilerClass,
"hasClass": g.hasReconcilerClass,
"informerGet": c.Universe.Function(types.Name{
Package: g.informerPackagePath,
Name: "Get",
}),
"controllerImpl": c.Universe.Type(types.Name{Package: "knative.dev/pkg/controller", Name: "Impl"}),
"reconcilerNewImpl": c.Universe.Type(types.Name{
Package: g.reconcilerPkg,
Name: "NewImpl",
}),
"loggingFromContext": c.Universe.Function(types.Name{
Package: "knative.dev/pkg/logging",
Name: "FromContext",
}),
"contextContext": c.Universe.Type(types.Name{
Package: "context",
Name: "Context",
}),
"configmapWatcher": c.Universe.Type(types.Name{
Package: "knative.dev/pkg/configmap",
Name: "Watcher",
}),
"classAnnotationKey": c.Universe.Variable(types.Name{
Package: g.reconcilerPkg,
Name: "ClassAnnotationKey",
}),
"annotationFilterFunc": c.Universe.Function(types.Name{
Package: "knative.dev/pkg/reconciler",
Name: "AnnotationFilterFunc",
}),
"filterHandler": c.Universe.Type(types.Name{
Package: "k8s.io/client-go/tools/cache",
Name: "FilteringResourceEventHandler",
}),
}
sw.Do(reconcilerControllerStub, m)
return sw.Error()
}
var reconcilerControllerStub = `
// TODO: PLEASE COPY AND MODIFY THIS FILE AS A STARTING POINT
// NewController creates a Reconciler for {{.type|public}} and returns the result of NewImpl.
func NewController(
ctx {{.contextContext|raw}},
cmw {{.configmapWatcher|raw}},
) *{{.controllerImpl|raw}} {
logger := {{.loggingFromContext|raw}}(ctx)
{{.type|lowercaseSingular}}Informer := {{.informerGet|raw}}(ctx)
{{if .hasClass}}
classValue := "default" // TODO: update this to the appropriate value.
classFilter := {{.annotationFilterFunc|raw}}({{.classAnnotationKey|raw}}, classValue, false /*allowUnset*/)
{{end}}
// TODO: setup additional informers here.
{{if .hasClass}}// TODO: remember to use the classFilter from above to filter appropriately.{{end}}
r := &Reconciler{}
impl := {{.reconcilerNewImpl|raw}}(ctx, r{{if .hasClass}}, classValue{{end}})
logger.Info("Setting up event handlers.")
{{if .hasClass}}
{{.type|lowercaseSingular}}Informer.Informer().AddEventHandler({{.filterHandler|raw}}{
FilterFunc: classFilter,
Handler: controller.HandleAll(impl.Enqueue),
})
{{else}}
{{.type|lowercaseSingular}}Informer.Informer().AddEventHandler(controller.HandleAll(impl.Enqueue))
{{end}}
// TODO: add additional informer event handlers here.
return impl
}
`
| google/knative-gcp | vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/reconciler_controller_stub.go | GO | apache-2.0 | 4,426 | [
30522,
1013,
1008,
9385,
12609,
1996,
14161,
8082,
6048,
1012,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
2017,
2089,
2025,
2224,
2023,
5371,
3272,
1999,
12646,
2007,
1996,
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... |
/*
* Purple's oscar protocol plugin
* This file is the legal property of its developers.
* Please see the AUTHORS file distributed alongside this file.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
/*
* AIM Callback Types
*
*/
#ifndef _SNACTYPES_H_
#define _SNACTYPES_H_
/*
* SNAC Families.
*/
#define SNAC_FAMILY_OSERVICE 0x0001
#define SNAC_FAMILY_LOCATE 0x0002
#define SNAC_FAMILY_BUDDY 0x0003
#define SNAC_FAMILY_ICBM 0x0004
#define SNAC_FAMILY_ADVERT 0x0005
#define SNAC_FAMILY_INVITE 0x0006
#define SNAC_FAMILY_ADMIN 0x0007
#define SNAC_FAMILY_POPUP 0x0008
#define SNAC_FAMILY_BOS 0x0009
#define SNAC_FAMILY_USERLOOKUP 0x000a
#define SNAC_FAMILY_STATS 0x000b
#define SNAC_FAMILY_TRANSLATE 0x000c
#define SNAC_FAMILY_CHATNAV 0x000d
#define SNAC_FAMILY_CHAT 0x000e
#define SNAC_FAMILY_ODIR 0x000f
#define SNAC_FAMILY_BART 0x0010
#define SNAC_FAMILY_FEEDBAG 0x0013
#define SNAC_FAMILY_ICQ 0x0015
#define SNAC_FAMILY_AUTH 0x0017
#define SNAC_FAMILY_ALERT 0x0018
#define AIM_CB_FAM_SPECIAL 0xffff /* Internal libfaim use */
/*
* SNAC Family: Ack.
*
* Not really a family, but treating it as one really
* helps it fit into the libfaim callback structure better.
*
*/
#define AIM_CB_ACK_ACK 0x0001
/*
* SNAC Family: General.
*/
#define SNAC_SUBTYPE_OSERVICE_ERROR 0x0001
#define SNAC_SUBTYPE_OSERVICE_CLIENTREADY 0x0002
#define SNAC_SUBTYPE_OSERVICE_SERVERREADY 0x0003
#define SNAC_SUBTYPE_OSERVICE_SERVICEREQ 0x0004
#define SNAC_SUBTYPE_OSERVICE_REDIRECT 0x0005
#define SNAC_SUBTYPE_OSERVICE_RATEINFOREQ 0x0006
#define SNAC_SUBTYPE_OSERVICE_RATEINFO 0x0007
#define SNAC_SUBTYPE_OSERVICE_RATEINFOACK 0x0008
#define SNAC_SUBTYPE_OSERVICE_RATECHANGE 0x000a
#define SNAC_SUBTYPE_OSERVICE_SERVERPAUSE 0x000b
#define SNAC_SUBTYPE_OSERVICE_SERVERRESUME 0x000d
#define SNAC_SUBTYPE_OSERVICE_REQSELFINFO 0x000e
#define SNAC_SUBTYPE_OSERVICE_SELFINFO 0x000f
#define SNAC_SUBTYPE_OSERVICE_EVIL 0x0010
#define SNAC_SUBTYPE_OSERVICE_SETIDLE 0x0011
#define SNAC_SUBTYPE_OSERVICE_MIGRATIONREQ 0x0012
#define SNAC_SUBTYPE_OSERVICE_MOTD 0x0013
#define SNAC_SUBTYPE_OSERVICE_SETPRIVFLAGS 0x0014
#define SNAC_SUBTYPE_OSERVICE_WELLKNOWNURL 0x0015
#define SNAC_SUBTYPE_OSERVICE_NOP 0x0016
#define SNAC_SUBTYPE_OSERVICE_DEFAULT 0xffff
/*
* SNAC Family: Location Services.
*/
#define SNAC_SUBTYPE_LOCATE_ERROR 0x0001
#define SNAC_SUBTYPE_LOCATE_REQRIGHTS 0x0002
#define SNAC_SUBTYPE_LOCATE_RIGHTSINFO 0x0003
#define SNAC_SUBTYPE_LOCATE_SETUSERINFO 0x0004
#define SNAC_SUBTYPE_LOCATE_REQUSERINFO 0x0005
#define SNAC_SUBTYPE_LOCATE_USERINFO 0x0006
#define SNAC_SUBTYPE_LOCATE_WATCHERSUBREQ 0x0007
#define SNAC_SUBTYPE_LOCATE_WATCHERNOT 0x0008
#define SNAC_SUBTYPE_LOCATE_GOTINFOBLOCK 0xfffd
#define SNAC_SUBTYPE_LOCATE_DEFAULT 0xffff
/*
* SNAC Family: Buddy List Management Services.
*/
#define SNAC_SUBTYPE_BUDDY_ERROR 0x0001
#define SNAC_SUBTYPE_BUDDY_REQRIGHTS 0x0002
#define SNAC_SUBTYPE_BUDDY_RIGHTSINFO 0x0003
#define SNAC_SUBTYPE_BUDDY_ADDBUDDY 0x0004
#define SNAC_SUBTYPE_BUDDY_REMBUDDY 0x0005
#define SNAC_SUBTYPE_BUDDY_REJECT 0x000a
#define SNAC_SUBTYPE_BUDDY_ONCOMING 0x000b
#define SNAC_SUBTYPE_BUDDY_OFFGOING 0x000c
#define SNAC_SUBTYPE_BUDDY_DEFAULT 0xffff
/*
* SNAC Family: Messaging Services.
*/
#define SNAC_SUBTYPE_ICBM_ERROR 0x0001
#define SNAC_SUBTYPE_ICBM_PARAMINFO 0x0005
#define SNAC_SUBTYPE_ICBM_INCOMING 0x0007
#define SNAC_SUBTYPE_ICBM_EVIL 0x0009
#define SNAC_SUBTYPE_ICBM_MISSEDCALL 0x000a
#define SNAC_SUBTYPE_ICBM_CLIENTAUTORESP 0x000b
#define SNAC_SUBTYPE_ICBM_ACK 0x000c
#define SNAC_SUBTYPE_ICBM_MTN 0x0014
#define SNAC_SUBTYPE_ICBM_DEFAULT 0xffff
/*
* SNAC Family: Advertisement Services
*/
#define SNAC_SUBTYPE_ADVERT_ERROR 0x0001
#define SNAC_SUBTYPE_ADVERT_DEFAULT 0xffff
/*
* SNAC Family: Invitation Services.
*/
#define SNAC_SUBTYPE_INVITE_ERROR 0x0001
#define SNAC_SUBTYPE_INVITE_DEFAULT 0xffff
/*
* SNAC Family: Administrative Services.
*/
#define SNAC_SUBTYPE_ADMIN_ERROR 0x0001
#define SNAC_SUBTYPE_ADMIN_INFOCHANGE_REPLY 0x0005
#define SNAC_SUBTYPE_ADMIN_DEFAULT 0xffff
/*
* SNAC Family: Popup Messages
*/
#define SNAC_SUBTYPE_POPUP_ERROR 0x0001
#define SNAC_SUBTYPE_POPUP_DEFAULT 0xffff
/*
* SNAC Family: Misc BOS Services.
*/
#define SNAC_SUBTYPE_BOS_ERROR 0x0001
#define SNAC_SUBTYPE_BOS_RIGHTSQUERY 0x0002
#define SNAC_SUBTYPE_BOS_RIGHTS 0x0003
#define SNAC_SUBTYPE_BOS_DEFAULT 0xffff
/*
* SNAC Family: User Lookup Services
*/
#define SNAC_SUBTYPE_USERLOOKUP_ERROR 0x0001
#define SNAC_SUBTYPE_USERLOOKUP_DEFAULT 0xffff
/*
* SNAC Family: User Status Services
*/
#define SNAC_SUBTYPE_STATS_ERROR 0x0001
#define SNAC_SUBTYPE_STATS_SETREPORTINTERVAL 0x0002
#define SNAC_SUBTYPE_STATS_REPORTACK 0x0004
#define SNAC_SUBTYPE_STATS_DEFAULT 0xffff
/*
* SNAC Family: Translation Services
*/
#define SNAC_SUBTYPE_TRANSLATE_ERROR 0x0001
#define SNAC_SUBTYPE_TRANSLATE_DEFAULT 0xffff
/*
* SNAC Family: Chat Navigation Services
*/
#define SNAC_SUBTYPE_CHATNAV_ERROR 0x0001
#define SNAC_SUBTYPE_CHATNAV_CREATE 0x0008
#define SNAC_SUBTYPE_CHATNAV_INFO 0x0009
#define SNAC_SUBTYPE_CHATNAV_DEFAULT 0xffff
/*
* SNAC Family: Chat Services
*/
#define SNAC_SUBTYPE_CHAT_ERROR 0x0001
#define SNAC_SUBTYPE_CHAT_ROOMINFOUPDATE 0x0002
#define SNAC_SUBTYPE_CHAT_USERJOIN 0x0003
#define SNAC_SUBTYPE_CHAT_USERLEAVE 0x0004
#define SNAC_SUBTYPE_CHAT_OUTGOINGMSG 0x0005
#define SNAC_SUBTYPE_CHAT_INCOMINGMSG 0x0006
#define SNAC_SUBTYPE_CHAT_DEFAULT 0xffff
/*
* SNAC Family: "New" Search
*/
#define SNAC_SUBTYPE_ODIR_ERROR 0x0001
#define SNAC_SUBTYPE_ODIR_SEARCH 0x0002
#define SNAC_SUBTYPE_ODIR_RESULTS 0x0003
/*
* SNAC Family: Buddy icons
*/
#define SNAC_SUBTYPE_BART_ERROR 0x0001
#define SNAC_SUBTYPE_BART_REQUEST 0x0004
#define SNAC_SUBTYPE_BART_RESPONSE 0x0005
/*
* SNAC Family: Server-Stored Buddy Lists
*/
#define SNAC_SUBTYPE_FEEDBAG_ERROR 0x0001
#define SNAC_SUBTYPE_FEEDBAG_REQRIGHTS 0x0002
#define SNAC_SUBTYPE_FEEDBAG_RIGHTSINFO 0x0003
#define SNAC_SUBTYPE_FEEDBAG_REQDATA 0x0004
#define SNAC_SUBTYPE_FEEDBAG_REQIFCHANGED 0x0005
#define SNAC_SUBTYPE_FEEDBAG_LIST 0x0006
#define SNAC_SUBTYPE_FEEDBAG_ACTIVATE 0x0007
#define SNAC_SUBTYPE_FEEDBAG_ADD 0x0008
#define SNAC_SUBTYPE_FEEDBAG_MOD 0x0009
#define SNAC_SUBTYPE_FEEDBAG_DEL 0x000A
#define SNAC_SUBTYPE_FEEDBAG_SRVACK 0x000E
#define SNAC_SUBTYPE_FEEDBAG_NOLIST 0x000F
#define SNAC_SUBTYPE_FEEDBAG_EDITSTART 0x0011
#define SNAC_SUBTYPE_FEEDBAG_EDITSTOP 0x0012
#define SNAC_SUBTYPE_FEEDBAG_SENDAUTH 0x0014
#define SNAC_SUBTYPE_FEEDBAG_RECVAUTH 0x0015
#define SNAC_SUBTYPE_FEEDBAG_SENDAUTHREQ 0x0018
#define SNAC_SUBTYPE_FEEDBAG_RECVAUTHREQ 0x0019
#define SNAC_SUBTYPE_FEEDBAG_SENDAUTHREP 0x001a
#define SNAC_SUBTYPE_FEEDBAG_RECVAUTHREP 0x001b
#define SNAC_SUBTYPE_FEEDBAG_ADDED 0x001c
/*
* SNAC Family: ICQ
*
* Most of these are actually special.
*/
#define SNAC_SUBTYPE_ICQ_ERROR 0x0001
#define SNAC_SUBTYPE_ICQ_OFFLINEMSG 0x00f0
#define SNAC_SUBTYPE_ICQ_OFFLINEMSGCOMPLETE 0x00f1
#define SNAC_SUBTYPE_ICQ_INFO 0x00f2
#define SNAC_SUBTYPE_ICQ_ALIAS 0x00f3
#define SNAC_SUBTYPE_ICQ_DEFAULT 0xffff
/*
* SNAC Family: Authorizer
*
* Used only in protocol versions three and above.
*/
#define SNAC_SUBTYPE_AUTH_ERROR 0x0001
#define SNAC_SUBTYPE_AUTH_LOGINREQEST 0x0002
#define SNAC_SUBTYPE_AUTH_LOGINRESPONSE 0x0003
#define SNAC_SUBTYPE_AUTH_AUTHREQ 0x0006
#define SNAC_SUBTYPE_AUTH_AUTHRESPONSE 0x0007
#define SNAC_SUBTYPE_AUTH_SECURID_REQUEST 0x000a
#define SNAC_SUBTYPE_AUTH_SECURID_RESPONSE 0x000b
/*
* SNAC Family: Email
*
* Used for getting information on the email address
* associated with your username.
*/
#define SNAC_SUBTYPE_ALERT_ERROR 0x0001
#define SNAC_SUBTYPE_ALERT_SENDCOOKIES 0x0006
#define SNAC_SUBTYPE_ALERT_MAILSTATUS 0x0007
#define SNAC_SUBTYPE_ALERT_INIT 0x0016
/*
* SNAC Family: Internal Messages
*
* This isn't truly a SNAC family either, but using
* these, we can integrated non-SNAC services into
* the SNAC-centered libfaim callback structure.
*/
#define AIM_CB_SPECIAL_CONNERR 0x0003
#define AIM_CB_SPECIAL_CONNINITDONE 0x0006
/* SNAC flags */
#define AIM_SNACFLAGS_DESTRUCTOR 0x0001
#endif /* _SNACTYPES_H_ */
| tdrhq/pidgin-clone | libpurple/protocols/oscar/snactypes.h | C | gpl-2.0 | 8,874 | [
30522,
1013,
1008,
1008,
6379,
1005,
1055,
7436,
8778,
13354,
2378,
1008,
2023,
5371,
2003,
1996,
3423,
3200,
1997,
2049,
9797,
1012,
1008,
3531,
2156,
1996,
6048,
5371,
5500,
4077,
2023,
5371,
1012,
1008,
1008,
2023,
3075,
2003,
2489,
40... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
// Eina Rust bindings for EFL.
// Copyright (C) 2014 Luis Araujo <araujoc.luisf@gmail.com>
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
extern crate libc;
extern crate core;
use std::ptr;
use std::mem::transmute;
use std::option::Option;
use eina::core::mem::uninitialized;
use eina::libc::{c_void, c_int, c_uint};
use eseful;
pub type EinaBool = u8;
pub static EINA_FALSE: EinaBool = 0u8;
pub static EINA_TRUE: EinaBool = 1u8;
type _EinaMagic = uint;
type _CEinaMagic = c_uint;
/*
* EinaList object.
*/
/// EinaList object.
pub struct EinaList<'r, T> {
_eo: *mut _EinaList<'r, T>
}
/// Representation of an Eina_List.
pub struct _EinaList<'r, T> {
data: &'r T,
next: *mut _EinaList<'r, T>,
prev: *mut _EinaList<'r, T>,
accounting: *_EinaListAccounting<'r, T>,
__magic: _EinaMagic
}
pub struct _EinaListAccounting<'r, T> {
last: *mut _EinaList<'r, T>,
count: uint,
__magic: _EinaMagic
}
/// C representation of an Eina_List.
pub struct _CEinaList {
data: *c_void,
next: *_CEinaList,
prev: *_CEinaList,
accounting: *_CEinaListAccounting,
__magic: _CEinaMagic
}
pub struct _CEinaListAccounting {
last: *_CEinaList,
count: c_uint,
__magic: _CEinaMagic
}
/*
* Inlined list type (EinaInlist).
*/
/// Inlined list type.
pub struct EinaInlist {
_eo: *_EinaInlist
}
pub struct _EinaInlist {
/// Next node
next: *_EinaInlist,
/// Previous node
prev: *_EinaInlist,
/// Last node
last: *_EinaInlist
}
/*
* EinaHash type.
*/
/// Type for a generic hash table.
pub struct _EinaHash<T> {
key_length_cb: EinaKeyLength<T>,
key_cmp_cb: EinaKeyCmp<T>,
key_hash_cb: EinaKeyHash<T>,
data_free_cb: EinaFreeCb<T>,
buckets: **EinaRbtree,
size: int,
mask: int,
population: int,
buckets_power_size: int,
__magic: _EinaMagic
}
pub struct _CEinaHash {
key_length_cb: _CEinaKeyLength,
key_cmp_cb: _CEinaKeyCmp,
key_hash_cb: _CEinaKeyHash,
data_free_cb: _CEinaFreeCb,
buckets: **EinaRbtree,
size: c_int,
mask: c_int,
population: c_int,
buckets_power_size: c_int,
__magic: _CEinaMagic
}
/// Type for a function to determine the length of a hash key.
pub type EinaKeyLength<T> = fn (&T) -> int;
type _CEinaKeyLength = fn (*c_void) -> c_int;
/// Type for a function to compare two hash keys.
pub type EinaKeyCmp<T> = fn (&T, int, &T, int) -> c_int;
type _CEinaKeyCmp = fn (*c_void, c_int, *c_void, c_int) -> c_int;
/// Type for a function to create a hash key.
pub type EinaKeyHash<T> = fn (&T, int) -> int;
type _CEinaKeyHash = fn (*c_void, c_int) -> c_int;
/// A callback type used to free data when iterating over a container.
pub type EinaFreeCb<T> = fn (&T);
type _CEinaFreeCb = fn (*c_void);
/// Type for a Red-Black tree node. It should be inlined into user's type.
pub struct EinaRbtree {
son: *[EinaRbtree, ..2],
color: uint
}
#[link(name = "eina")]
extern "C" {
fn eina_init() -> c_int;
fn eina_shutdown() -> c_int;
fn eina_list_free(list: *_CEinaList) -> *_CEinaList;
fn eina_list_append(list: *_CEinaList, data: *c_void) -> *_CEinaList;
fn eina_list_prepend(list: *_CEinaList, data: *c_void) -> *_CEinaList;
/* Inline list type */
fn eina_inlist_append(in_list: *_EinaInlist, in_item: *_EinaInlist) -> *_EinaInlist;
fn eina_inlist_prepend(in_list: *_EinaInlist, in_item: *_EinaInlist) -> *_EinaInlist;
fn eina_inlist_promote(list: *_EinaInlist, item: *_EinaInlist) -> *_EinaInlist;
fn eina_inlist_demote(list: *_EinaInlist, item: *_EinaInlist) -> *_EinaInlist;
fn eina_inlist_remove(in_list: *_EinaInlist, in_item: *_EinaInlist) -> *_EinaInlist;
/* Hash type */
fn eina_hash_stringshared_new(data_free_cb: _CEinaFreeCb) -> *_CEinaHash;
fn eina_hash_string_superfast_new(data_free_cb: _CEinaFreeCb) -> *_CEinaHash;
fn eina_hash_add(hash: *_CEinaHash, key: *c_void, data: *c_void) -> EinaBool;
fn eina_hash_find(hash: *_CEinaHash, key: *c_void) -> *c_void;
fn eina_hash_population(hash: *_CEinaHash) -> c_int;
fn eina_hash_free(hash: *_CEinaHash);
}
/* Implementations for EinaList type */
impl<'r, T> EinaList<'r, T> {
/// Create high level EinaList object.
pub fn new(el: *mut _EinaList<'r, T>) -> EinaList<'r, T> {
EinaList { _eo: el }
}
}
/// EinaList implements the Iterator trait.
impl<'r, T> Iterator<&'r T> for EinaList<'r, T> {
fn next(&mut self) -> Option<&'r T> {
let v = list_data_get(self._eo);
*self = match list_next(self._eo) {
None => EinaList { _eo: ptr::mut_null() },
Some(l) => EinaList { _eo: l }
};
return v
}
}
/* Implementations for EinaInlist type */
impl EinaInlist {
pub fn new(el: *_EinaInlist) -> EinaInlist {
EinaInlist { _eo: el }
}
}
impl<'r, T> Iterator<&'r T> for EinaInlist {
fn next(&mut self) -> Option<&'r T> {
let v = if self._eo.is_null() {
None
} else {
let elm: &T = inlist_container_get(*self);
Some(elm)
};
// Get next value if current value is valid (Some).
if v.is_some() { self._eo = unsafe { (*self._eo).next } };
return v
}
}
/// Initialize the Eina library.
pub fn init() -> int { unsafe { eina_init() as int } }
/// Shut down the Eina library.
pub fn shutdown() -> int { unsafe { eina_shutdown() as int } }
/// Free an entire list and all the nodes, ignoring the data contained.
pub fn list_free<T>(list: *mut _EinaList<T>) -> *mut _EinaList<T> {
unsafe {
transmute::<*_CEinaList,*mut _EinaList<T>>(
eina_list_free(transmute::<*mut _EinaList<T>,*_CEinaList>(list)))
}
}
/// Append the given data to the given linked list.
/// This function appends data to list. If list is 'None', a new list is returned.
pub fn list_append<T>(list: Option<*mut _EinaList<T>>, data: &T) -> *mut _EinaList<T> {
unsafe {
let c_data: *c_void = transmute(data);
match list {
None => transmute::<*_CEinaList,*mut _EinaList<T>>(
eina_list_append(ptr::null(), c_data)),
Some(l) => transmute::<*_CEinaList,*mut _EinaList<T>>(
eina_list_append(transmute::<*mut _EinaList<T>,*_CEinaList>(l), c_data))
}
}
}
/// Prepends the given data to the given linked list.
/// This function prepends data to list. If list is 'None', a new list is returned.
pub fn list_prepend<T>(list: Option<*mut _EinaList<T>>, data: &T) -> *mut _EinaList<T> {
unsafe {
let c_data: *c_void = transmute(data);
match list {
None => transmute::<*_CEinaList,*mut _EinaList<T>>(
eina_list_prepend(ptr::null(), c_data)),
Some(l) => transmute::<*_CEinaList,*mut _EinaList<T>>(
eina_list_prepend(transmute::<*mut _EinaList<T>,*_CEinaList>(l), c_data))
}
}
}
/// Get the list node data member.
#[inline]
pub fn list_data_get<'r, T>(list: *mut _EinaList<'r, T>) -> Option<&'r T> {
if list.is_null() { return None }
unsafe { Some((*list).data) }
}
/// Set the list node data member.
#[inline]
pub fn list_data_set<'r, T>(list: *mut _EinaList<'r, T>, new_data: &'r T) -> Option<&'r T> {
if list.is_null() { return None }
unsafe {
let olddata = (*list).data;
(*list).data = new_data;
Some(olddata)
}
}
/// Get the last list node in the list.
#[inline]
pub fn list_last<'a, T>(list: *mut _EinaList<'a, T>) -> Option<*mut _EinaList<'a, T>> {
if list.is_null() { return None }
unsafe { Some((*(*list).accounting).last) }
}
/// Get the next list node after the specified list node.
#[inline]
pub fn list_next<'a, T>(list: *mut _EinaList<'a, T>) -> Option<*mut _EinaList<'a, T>> {
if list.is_null() { return None }
unsafe {
// Let's be nice and return None for nullable next
if (*list).next.is_null() { return None }
Some((*list).next)
}
}
/// Get the previous list node before the specified list node.
#[inline]
pub fn list_prev<'a, T>(list: *mut _EinaList<'a, T>) -> Option<*mut _EinaList<'a, T>> {
if list.is_null() { return None }
unsafe {
// Let's be nice and return None for nullable prev
if (*list).prev.is_null() { return None }
Some((*list).prev)
}
}
/// Get the count of the number of items in a list.
#[inline]
pub fn list_count<'r, T>(list: *mut _EinaList<'r, T>) -> uint {
if list.is_null() { return 0 }
unsafe {
(*(*list).accounting).count
}
}
/// Convenient function to get the last list node data member.
#[inline]
pub fn list_last_data_get<'r, T>(list: *mut _EinaList<'r, T>) -> Option<&'r T> {
match list_last(list) {
None => None,
Some(last) => list_data_get(last)
}
}
/* Inline list functions */
/// Add a new node to end of a list.
pub fn inlist_append(in_list: Option<EinaInlist>, in_item: *_EinaInlist) -> EinaInlist {
EinaInlist {
_eo: unsafe {
match in_list {
None => eina_inlist_append(ptr::null(), in_item),
Some(lst) => eina_inlist_append(lst._eo, in_item)
}
}
}
}
/// Add a new node to beginning of list.
pub fn inlist_prepend(in_list: Option<EinaInlist>, in_item: *_EinaInlist) -> EinaInlist {
EinaInlist {
_eo: unsafe {
match in_list {
None => eina_inlist_prepend(ptr::null(), in_item),
Some(lst) => eina_inlist_prepend(lst._eo, in_item)
}
}
}
}
/// Move existing node to beginning of list.
pub fn inlist_promote(in_list: Option<EinaInlist>, in_item: *_EinaInlist) -> EinaInlist {
EinaInlist {
_eo: unsafe {
match in_list {
None => eina_inlist_promote(ptr::null(), in_item),
Some(lst) => eina_inlist_promote(lst._eo, in_item)
}
}
}
}
/// Move existing node to end of list.
pub fn inlist_demote(in_list: Option<EinaInlist>, in_item: *_EinaInlist) -> EinaInlist {
EinaInlist {
_eo: unsafe {
match in_list {
None => eina_inlist_demote(ptr::null(), in_item),
Some(lst) => eina_inlist_demote(lst._eo, in_item)
}
}
}
}
/// Remove node from list.
pub fn inlist_remove(in_list: EinaInlist, in_item: *_EinaInlist) -> EinaInlist {
EinaInlist {
_eo: unsafe { eina_inlist_remove(in_list._eo, in_item) }
}
}
/// Get the container object of an in_list.
pub fn inlist_container_get<T>(in_list: EinaInlist) -> &T {
unsafe { transmute(in_list._eo) }
}
/// Convenient function for object allocation.
#[inline]
pub fn object<T>() -> T {
unsafe { uninitialized::<T>() }
}
/// Macro to get the inlist object of a struct.
#[macro_export]
macro_rules! inlist_get(
($inlist:ident) => (unsafe {
use std::mem::transmute;
transmute(&($inlist.__in_list))
})
)
/* Hash type functions */
/// Create a new hash table optimized for stringshared values.
pub fn hash_stringshared_new<T>(data_free_cb: EinaFreeCb<T>) -> *mut _EinaHash<T> {
unsafe { transmute(eina_hash_stringshared_new(transmute(data_free_cb))) }
}
/// Create a new hash table for use with strings.
pub fn hash_string_superfast_new<T>(data_free_cb: EinaFreeCb<T>) -> *mut _EinaHash<T> {
unsafe { transmute(eina_hash_string_superfast_new(transmute(data_free_cb))) }
}
/// Add an entry to the given hash table.
pub fn hash_add<T>(hash: *mut _EinaHash<T>, key: &T, data: &T) -> bool {
eseful::from_eina_to_bool(unsafe {
eina_hash_add(transmute(hash), transmute(key), transmute(data))
})
}
/// Retrieve a specific entry in the given hash table.
pub fn hash_find<T>(hash: *mut _EinaHash<T>, key: &T) -> &T {
unsafe { transmute(eina_hash_find(transmute(hash), transmute(key))) }
}
/// Returns the number of entries in the given hash table.
pub fn hash_population<T>(hash: *mut _EinaHash<T>) -> int {
unsafe { eina_hash_population(transmute(hash)) as int }
}
/// Free the given hash table resources.
pub fn hash_free<T>(hash: *mut _EinaHash<T>) {
unsafe { eina_hash_free(transmute(hash)) }
}
| araujol/rust-efl | src/eina.rs | Rust | lgpl-2.1 | 12,899 | [
30522,
1013,
1013,
16417,
2050,
18399,
8031,
2015,
2005,
1041,
30524,
1013,
1013,
2023,
3075,
2003,
2489,
4007,
1025,
2017,
2064,
2417,
2923,
3089,
8569,
2618,
2009,
1998,
1013,
2030,
1013,
1013,
19933,
2009,
2104,
1996,
3408,
1997,
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... |
/**
* jQuery plugin wrapper for TinySort
* Does not use the first argument in tinysort.js since that is handled internally by the jQuery selector.
* Sub-selections (option.selector) do not use the jQuery selector syntax but regular CSS3 selector syntax.
* @summary jQuery plugin wrapper for TinySort
* @version 2.2.2
* @requires tinysort
* @license MIT/GPL
* @author Ron Valstar (http://www.sjeiti.com/)
* @copyright Ron Valstar <ron@ronvalstar.nl>
*/
!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery","tinysort"],a):jQuery&&!jQuery.fn.tsort&&a(jQuery,tinysort)}(function(a,b){"use strict";a.tinysort={defaults:b.defaults},a.fn.extend({tinysort:function(){var a,c,d=Array.prototype.slice.call(arguments);d.unshift(this),a=b.apply(null,d),c=a.length;for(var e=0,f=this.length;f>e;e++)c>e?this[e]=a[e]:delete this[e];return this.length=c,this}}),a.fn.tsort=a.fn.tinysort}); | sajochiu/cdnjs | ajax/libs/tinysort/2.2.2/jquery.tinysort.min.js | JavaScript | mit | 912 | [
30522,
1013,
1008,
1008,
1008,
1046,
4226,
2854,
13354,
2378,
10236,
4842,
2005,
4714,
21748,
2102,
1008,
2515,
2025,
2224,
1996,
2034,
6685,
1999,
4714,
21748,
2102,
1012,
1046,
2015,
2144,
2008,
2003,
8971,
16058,
2011,
1996,
1046,
4226,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 -*-
"""
irc/server.py
Copyright © 2009 Ferry Boender
Copyright © 2012 Jason R. Coombs
This server has basic support for:
* Connecting
* Channels
* Nicknames
* Public/private messages
It is MISSING support for notably:
* Server linking
* Modes (user and channel)
* Proper error reporting
* Basically everything else
It is mostly useful as a testing tool or perhaps for building something like a
private proxy on. Do NOT use it in any kind of production code or anything that
will ever be connected to by the public.
"""
#
# Very simple hacky ugly IRC server.
#
# Todo:
# - Encode format for each message and reply with events.codes['needmoreparams']
# - starting server when already started doesn't work properly. PID file is not changed, no error messsage is displayed.
# - Delete channel if last user leaves.
# - [ERROR] <socket.error instance at 0x7f9f203dfb90> (better error msg required)
# - Empty channels are left behind
# - No Op assigned when new channel is created.
# - User can /join multiple times (doesn't add more to channel, does say 'joined')
# - PING timeouts
# - Allow all numerical commands.
# - Users can send commands to channels they are not in (PART)
# Not Todo (Won't be supported)
# - Server linking.
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following
# conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#
from __future__ import print_function, absolute_import
import argparse
import logging
import socket
import select
import re
from . import client
from . import _py2_compat
from . import logging as log_util
from . import events
from . import buffer
SRV_WELCOME = "Welcome to %s v%s, the ugliest IRC server in the world." % (
__name__, client.VERSION)
log = logging.getLogger(__name__)
class IRCError(Exception):
"""
Exception thrown by IRC command handlers to notify client of a server/client error.
"""
def __init__(self, code, value):
self.code = code
self.value = value
def __str__(self):
return repr(self.value)
@classmethod
def from_name(cls, name, value):
return cls(events.codes[name], value)
class IRCChannel(object):
"""
Object representing an IRC channel.
"""
def __init__(self, name, topic='No topic'):
self.name = name
self.topic_by = 'Unknown'
self.topic = topic
self.clients = set()
class IRCClient(_py2_compat.socketserver.BaseRequestHandler):
"""
IRC client connect and command handling. Client connection is handled by
the `handle` method which sets up a two-way communication with the client.
It then handles commands sent by the client by dispatching them to the
handle_ methods.
"""
class Disconnect(BaseException): pass
def __init__(self, request, client_address, server):
self.user = None
self.host = client_address # Client's hostname / ip.
self.realname = None # Client's real name
self.nick = None # Client's currently registered nickname
self.send_queue = [] # Messages to send to client (strings)
self.channels = {} # Channels the client is in
_py2_compat.socketserver.BaseRequestHandler.__init__(self, request,
client_address, server)
def handle(self):
log.info('Client connected: %s', self.client_ident())
self.buffer = buffer.LineBuffer()
try:
while True:
self._handle_one()
except self.Disconnect:
self.request.close()
def _handle_one(self):
"""
Handle one read/write cycle.
"""
ready_to_read, ready_to_write, in_error = select.select(
[self.request], [self.request], [self.request], 0.1)
if in_error:
raise self.Disconnect()
# Write any commands to the client
while self.send_queue and ready_to_write:
msg = self.send_queue.pop(0)
self._send(msg)
# See if the client has any commands for us.
if ready_to_read:
self._handle_incoming()
def _handle_incoming(self):
try:
data = self.request.recv(1024)
except Exception:
raise self.Disconnect()
if not data:
raise self.Disconnect()
self.buffer.feed(data)
for line in self.buffer:
self._handle_line(line)
def _handle_line(self, line):
try:
log.debug('from %s: %s' % (self.client_ident(), line))
command, sep, params = line.partition(' ')
handler = getattr(self, 'handle_%s' % command.lower(), None)
if not handler:
log.info('No handler for command: %s. '
'Full line: %s' % (command, line))
raise IRCError.from_name('unknowncommand',
'%s :Unknown command' % command)
response = handler(params)
except AttributeError as e:
log.error(_py2_compat.str(e))
raise
except IRCError as e:
response = ':%s %s %s' % (self.server.servername, e.code, e.value)
log.error(response)
except Exception as e:
response = ':%s ERROR %r' % (self.server.servername, e)
log.error(response)
raise
if response:
self._send(response)
def _send(self, msg):
log.debug('to %s: %s', self.client_ident(), msg)
self.request.send(msg + '\r\n')
def handle_nick(self, params):
"""
Handle the initial setting of the user's nickname and nick changes.
"""
nick = params
# Valid nickname?
if re.search('[^a-zA-Z0-9\-\[\]\'`^{}_]', nick):
raise IRCError.from_name('erroneusnickname', ':%s' % nick)
if self.server.clients.get(nick, None) == self:
# Already registered to user
return
if nick in self.server.clients:
# Someone else is using the nick
raise IRCError.from_name('nicknameinuse', 'NICK :%s' % (nick))
if not self.nick:
# New connection and nick is available; register and send welcome
# and MOTD.
self.nick = nick
self.server.clients[nick] = self
response = ':%s %s %s :%s' % (self.server.servername,
events.codes['welcome'], self.nick, SRV_WELCOME)
self.send_queue.append(response)
response = ':%s 376 %s :End of MOTD command.' % (
self.server.servername, self.nick)
self.send_queue.append(response)
return
# Nick is available. Change the nick.
message = ':%s NICK :%s' % (self.client_ident(), nick)
self.server.clients.pop(self.nick)
self.nick = nick
self.server.clients[self.nick] = self
# Send a notification of the nick change to all the clients in the
# channels the client is in.
for channel in self.channels.values():
self._send_to_others(message, channel)
# Send a notification of the nick change to the client itself
return message
def handle_user(self, params):
"""
Handle the USER command which identifies the user to the server.
"""
params = params.split(' ', 3)
if len(params) != 4:
raise IRCError.from_name('needmoreparams',
'USER :Not enough parameters')
user, mode, unused, realname = params
self.user = user
self.mode = mode
self.realname = realname
return ''
def handle_ping(self, params):
"""
Handle client PING requests to keep the connection alive.
"""
response = ':%s PONG :%s' % (self.server.servername, self.server.servername)
return response
def handle_join(self, params):
"""
Handle the JOINing of a user to a channel. Valid channel names start
with a # and consist of a-z, A-Z, 0-9 and/or '_'.
"""
channel_names = params.split(' ', 1)[0] # Ignore keys
for channel_name in channel_names.split(','):
r_channel_name = channel_name.strip()
# Valid channel name?
if not re.match('^#([a-zA-Z0-9_])+$', r_channel_name):
raise IRCError.from_name('nosuchchannel',
'%s :No such channel' % r_channel_name)
# Add user to the channel (create new channel if not exists)
channel = self.server.channels.setdefault(r_channel_name, IRCChannel(r_channel_name))
channel.clients.add(self)
# Add channel to user's channel list
self.channels[channel.name] = channel
# Send the topic
response_join = ':%s TOPIC %s :%s' % (channel.topic_by, channel.name, channel.topic)
self.send_queue.append(response_join)
# Send join message to everybody in the channel, including yourself and
# send user list of the channel back to the user.
response_join = ':%s JOIN :%s' % (self.client_ident(), r_channel_name)
for client in channel.clients:
client.send_queue.append(response_join)
nicks = [client.nick for client in channel.clients]
response_userlist = ':%s 353 %s = %s :%s' % (self.server.servername, self.nick, channel.name, ' '.join(nicks))
self.send_queue.append(response_userlist)
response = ':%s 366 %s %s :End of /NAMES list' % (self.server.servername, self.nick, channel.name)
self.send_queue.append(response)
def handle_privmsg(self, params):
"""
Handle sending a private message to a user or channel.
"""
target, sep, msg = params.partition(' ')
if not msg:
raise IRCError.from_name('needmoreparams',
'PRIVMSG :Not enough parameters')
message = ':%s PRIVMSG %s %s' % (self.client_ident(), target, msg)
if target.startswith('#') or target.startswith('$'):
# Message to channel. Check if the channel exists.
channel = self.server.channels.get(target)
if not channel:
raise IRCError.from_name('nosuchnick', 'PRIVMSG :%s' % target)
if not channel.name in self.channels:
# The user isn't in the channel.
raise IRCError.from_name('cannotsendtochan',
'%s :Cannot send to channel' % channel.name)
self._send_to_others(message, channel)
else:
# Message to user
client = self.server.clients.get(target, None)
if not client:
raise IRCError.from_name('nosuchnick', 'PRIVMSG :%s' % target)
client.send_queue.append(message)
def _send_to_others(self, message, channel):
"""
Send the message to all clients in the specified channel except for
self.
"""
other_clients = [client for client in channel.clients
if not client == self]
for client in other_clients:
client.send_queue.append(message)
def handle_topic(self, params):
"""
Handle a topic command.
"""
channel_name, sep, topic = params.partition(' ')
channel = self.server.channels.get(channel_name)
if not channel:
raise IRCError.from_name('nosuchnick', 'PRIVMSG :%s' % channel_name)
if not channel.name in self.channels:
# The user isn't in the channel.
raise IRCError.from_name('cannotsendtochan',
'%s :Cannot send to channel' % channel.name)
if topic:
channel.topic = topic.lstrip(':')
channel.topic_by = self.nick
message = ':%s TOPIC %s :%s' % (self.client_ident(), channel_name,
channel.topic)
return message
def handle_part(self, params):
"""
Handle a client parting from channel(s).
"""
for pchannel in params.split(','):
if pchannel.strip() in self.server.channels:
# Send message to all clients in all channels user is in, and
# remove the user from the channels.
channel = self.server.channels.get(pchannel.strip())
response = ':%s PART :%s' % (self.client_ident(), pchannel)
if channel:
for client in channel.clients:
client.send_queue.append(response)
channel.clients.remove(self)
self.channels.pop(pchannel)
else:
response = ':%s 403 %s :%s' % (self.server.servername, pchannel, pchannel)
self.send_queue.append(response)
def handle_quit(self, params):
"""
Handle the client breaking off the connection with a QUIT command.
"""
response = ':%s QUIT :%s' % (self.client_ident(), params.lstrip(':'))
# Send quit message to all clients in all channels user is in, and
# remove the user from the channels.
for channel in self.channels.values():
for client in channel.clients:
client.send_queue.append(response)
channel.clients.remove(self)
def handle_dump(self, params):
"""
Dump internal server information for debugging purposes.
"""
print("Clients:", self.server.clients)
for client in self.server.clients.values():
print(" ", client)
for channel in client.channels.values():
print(" ", channel.name)
print("Channels:", self.server.channels)
for channel in self.server.channels.values():
print(" ", channel.name, channel)
for client in channel.clients:
print(" ", client.nick, client)
def client_ident(self):
"""
Return the client identifier as included in many command replies.
"""
return client.NickMask.from_params(self.nick, self.user,
self.server.servername)
def finish(self):
"""
The client conection is finished. Do some cleanup to ensure that the
client doesn't linger around in any channel or the client list, in case
the client didn't properly close the connection with PART and QUIT.
"""
log.info('Client disconnected: %s', self.client_ident())
response = ':%s QUIT :EOF from client' % self.client_ident()
for channel in self.channels.values():
if self in channel.clients:
# Client is gone without properly QUITing or PARTing this
# channel.
for client in channel.clients:
client.send_queue.append(response)
channel.clients.remove(self)
self.server.clients.pop(self.nick)
log.info('Connection finished: %s', self.client_ident())
def __repr__(self):
"""
Return a user-readable description of the client
"""
return '<%s %s!%s@%s (%s)>' % (
self.__class__.__name__,
self.nick,
self.user,
self.host[0],
self.realname,
)
class IRCServer(_py2_compat.socketserver.ThreadingMixIn,
_py2_compat.socketserver.TCPServer):
daemon_threads = True
allow_reuse_address = True
channels = {}
"Existing channels (IRCChannel instances) by channel name"
clients = {}
"Connected clients (IRCClient instances) by nick name"
def __init__(self, *args, **kwargs):
self.servername = 'localhost'
self.channels = {}
self.clients = {}
_py2_compat.socketserver.TCPServer.__init__(self, *args, **kwargs)
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument("-a", "--address", dest="listen_address",
default='127.0.0.1', help="IP on which to listen")
parser.add_argument("-p", "--port", dest="listen_port", default=6667,
type=int, help="Port on which to listen")
log_util.add_arguments(parser)
return parser.parse_args()
def main():
options = get_args()
log_util.setup(options)
log.info("Starting irc.server")
#
# Start server
#
try:
bind_address = options.listen_address, options.listen_port
ircserver = IRCServer(bind_address, IRCClient)
log.info('Listening on {listen_address}:{listen_port}'.format(
**vars(options)))
ircserver.serve_forever()
except socket.error as e:
log.error(repr(e))
raise SystemExit(-2)
if __name__ == "__main__":
main()
| sim0629/irc | irc/server.py | Python | lgpl-2.1 | 17,734 | [
30522,
1001,
1011,
1008,
1011,
16861,
1024,
21183,
2546,
1011,
1022,
1011,
1008,
1011,
1000,
1000,
1000,
20868,
2278,
1013,
8241,
1012,
1052,
2100,
9385,
1075,
2268,
7115,
8945,
10497,
2121,
9385,
1075,
2262,
4463,
1054,
1012,
2522,
5358,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 __grid_block_state__
#define __grid_block_state__
namespace gridlr {
enum BlockState {
Empty,
Zero,
One,
Two,
Three,
Four,
Five,
Six,
Seven,
Eight,
Nine,
MAX
};
}
#endif /* __grid_block_state__ */ | KasumiL5x/ciri | test/src/demos/gridlr/BlockState.hpp | C++ | mit | 232 | [
30522,
1001,
2065,
13629,
2546,
1035,
1035,
8370,
1035,
3796,
1035,
2110,
1035,
1035,
1001,
9375,
1035,
1035,
8370,
1035,
3796,
1035,
2110,
1035,
1035,
3415,
15327,
8370,
20974,
1063,
4372,
2819,
5991,
12259,
1063,
4064,
1010,
5717,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
LifeBalancer
============
iPhone App to plan your life as described in the book "The 7 Habits of Highly Effective People"
| Czarto/LifeBalancer | README.md | Markdown | mit | 123 | [
30522,
2166,
26657,
2099,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
18059,
10439,
2000,
2933,
2115,
2166,
2004,
2649,
1999,
1996,
2338,
1000,
1996,
1021,
14243,
1997,
3811,
4621,
2111,
1000,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
/**
* @addtogroup Elm_Gesture_Layer
*
* @{
*/
/**
* Enum of supported gesture types.
*/
typedef enum
{
ELM_GESTURE_FIRST = 0,
ELM_GESTURE_N_TAPS, /**< N fingers single taps */
ELM_GESTURE_N_LONG_TAPS, /**< N fingers single long-taps */
ELM_GESTURE_N_DOUBLE_TAPS, /**< N fingers double-single taps */
ELM_GESTURE_N_TRIPLE_TAPS, /**< N fingers triple-single taps */
ELM_GESTURE_MOMENTUM, /**< Reports momentum in the direction of move */
ELM_GESTURE_N_LINES, /**< N fingers line gesture */
ELM_GESTURE_N_FLICKS, /**< N fingers flick gesture */
ELM_GESTURE_ZOOM, /**< Zoom */
ELM_GESTURE_ROTATE, /**< Rotate */
ELM_GESTURE_LAST
} Elm_Gesture_Type;
/**
* Enum of gesture states.
*/
typedef enum
{
ELM_GESTURE_STATE_UNDEFINED = -1, /**< Gesture not STARTed */
ELM_GESTURE_STATE_START, /**< Gesture STARTed */
ELM_GESTURE_STATE_MOVE, /**< Gesture is ongoing */
ELM_GESTURE_STATE_END, /**< Gesture completed */
ELM_GESTURE_STATE_ABORT /**< Ongoing gesture was ABORTed */
} Elm_Gesture_State;
/**
* Holds taps info for user
*/
typedef struct _Elm_Gesture_Taps_Info Elm_Gesture_Taps_Info;
/**
* Struct holds taps info for user
*/
struct _Elm_Gesture_Taps_Info
{
Evas_Coord x, y; /**< Holds center point between fingers */
unsigned int n; /**< Number of fingers tapped */
unsigned int timestamp; /**< event timestamp */
};
/**
* holds momentum info for user
*/
typedef struct _Elm_Gesture_Momentum_Info Elm_Gesture_Momentum_Info;
/**
* Struct holds momentum info for user
* x1 and y1 are not necessarily in sync
* x1 holds x value of x direction starting point
* and same holds for y1.
* This is noticeable when doing V-shape movement
*/
struct _Elm_Gesture_Momentum_Info /* Report line ends, timestamps, and momentum computed */
{
Evas_Coord x1; /**< Final-swipe direction starting point on X */
Evas_Coord y1; /**< Final-swipe direction starting point on Y */
Evas_Coord x2; /**< Final-swipe direction ending point on X */
Evas_Coord y2; /**< Final-swipe direction ending point on Y */
unsigned int tx; /**< Timestamp of start of final x-swipe */
unsigned int ty; /**< Timestamp of start of final y-swipe */
Evas_Coord mx; /**< Momentum on X */
Evas_Coord my; /**< Momentum on Y */
unsigned int n; /**< Number of fingers */
};
/**
* Holds line info for user
*/
typedef struct _Elm_Gesture_Line_Info Elm_Gesture_Line_Info;
/**
* Struct holds line info for user
*/
struct _Elm_Gesture_Line_Info /* Report line ends, timestamps, and momentum computed */
{
Elm_Gesture_Momentum_Info momentum; /**< Line momentum info */
double angle; /**< Angle (direction) of lines */
};
/**
* Holds zoom info for user
*/
typedef struct _Elm_Gesture_Zoom_Info Elm_Gesture_Zoom_Info;
/**
* Struct holds zoom info for user
*/
struct _Elm_Gesture_Zoom_Info
{
Evas_Coord x, y; /**< Holds zoom center point reported to user */
Evas_Coord radius; /**< Holds radius between fingers reported to user */
double zoom; /**< Zoom value: 1.0 means no zoom */
double momentum; /**< Zoom momentum: zoom growth per second (NOT YET SUPPORTED) */
};
/**
* Holds rotation info for user
*/
typedef struct _Elm_Gesture_Rotate_Info Elm_Gesture_Rotate_Info;
/**
* Struct holds rotation info for user
*/
struct _Elm_Gesture_Rotate_Info
{
Evas_Coord x, y; /**< Holds zoom center point reported to user */
Evas_Coord radius; /**< Holds radius between fingers reported to user */
double base_angle; /**< Holds start-angle */
double angle; /**< Rotation value: 0.0 means no rotation */
double momentum; /**< Rotation momentum: rotation done per second (NOT YET SUPPORTED) */
};
/**
* User callback used to stream gesture info from gesture layer
* @param data user data
* @param event_info gesture report info
* Returns a flag field to be applied on the causing event.
* You should probably return EVAS_EVENT_FLAG_ON_HOLD if your widget acted
* upon the event, in an irreversible way.
*/
typedef Evas_Event_Flags (*Elm_Gesture_Event_Cb)(void *data, void *event_info);
/**
* This function sets the gesture layer line min length of an object
*
* @param obj gesture-layer.
* @param line_min_length the length.
*
* @since 1.8
*/
EAPI void elm_gesture_layer_line_min_length_set(Evas_Object *obj, int line_min_length);
/**
* This function returns the gesture layer line min length of an object
*
* @param obj gesture-layer.
* @return the length.
*
* @since 1.8
*/
EAPI int elm_gesture_layer_line_min_length_get(const Evas_Object *obj);
/**
* This function sets the gesture layer zoom distance tolerance of an object
*
* @param obj gesture-layer.
* @param zoom_distance_tolerance zoom distance tolerance
*
* @since 1.8
*/
EAPI void elm_gesture_layer_zoom_distance_tolerance_set(Evas_Object *obj, Evas_Coord zoom_distance_tolerance);
/**
* This function returns the gesture layer zoom distance tolerance of an object
*
* @param obj gesture-layer.
* @return zoom distance tolerance
*
* @since 1.8
*/
EAPI Evas_Coord elm_gesture_layer_zoom_distance_tolerance_get(const Evas_Object *obj);
/**
* This function sets the gesture layer line distance tolerance of an object
*
* @param obj gesture-layer.
* @param line_distance_tolerance line distance tolerance
*
* @since 1.8
*/
EAPI void elm_gesture_layer_line_distance_tolerance_set(Evas_Object *obj, Evas_Coord line_distance_tolerance);
/**
* This function returns the gesture layer line distance tolerance of an object
*
* @param obj gesture-layer.
* @return line distance tolerance
*
* @since 1.8
*/
EAPI Evas_Coord elm_gesture_layer_line_distance_tolerance_get(const Evas_Object *obj);
/**
* This function sets the gesture layer line angular tolerance of an object
*
* @param obj gesture-layer.
* @param line_angular_tolerance line angular tolerance
*
* @since 1.8
*/
EAPI void elm_gesture_layer_line_angular_tolerance_set(Evas_Object *obj, double line_angular_tolerance);
/**
* This function returns the gesture layer line angular tolerance of an object
*
* @param obj gesture-layer.
* @return line angular tolerance
*
* @since 1.8
*/
EAPI double elm_gesture_layer_line_angular_tolerance_get(const Evas_Object *obj);
/**
* This function sets the gesture layer zoom wheel factor of an object
*
* @param obj gesture-layer.
* @param zoom_wheel_factor zoom wheel factor
*
* @since 1.8
*/
EAPI void elm_gesture_layer_zoom_wheel_factor_set(Evas_Object *obj, double zoom_wheel_factor);
/**
* This function returns the gesture layer zoom wheel factor of an object
*
* @param obj gesture-layer.
* @return zoom wheel factor
*
* @since 1.8
*/
EAPI double elm_gesture_layer_zoom_wheel_factor_get(const Evas_Object *obj);
/**
* This function sets the gesture layer zoom finger factor of an object
*
* @param obj gesture-layer.
* @param zoom_finger_factor zoom finger factor
*
* @since 1.8
*/
EAPI void elm_gesture_layer_zoom_finger_factor_set(Evas_Object *obj, double zoom_finger_factor);
/**
* This function returns the gesture layer zoom finger factor of an object
*
* @param obj gesture-layer.
* @return zoom finger factor
*
* @since 1.8
*/
EAPI double elm_gesture_layer_zoom_finger_factor_get(const Evas_Object *obj);
/**
* This function sets the gesture layer rotate angular tolerance of an object
*
* @param obj gesture-layer.
* @param rotate_angular_tolerance rotate angular tolerance
*
* @since 1.8
*/
EAPI void elm_gesture_layer_rotate_angular_tolerance_set(Evas_Object *obj, double rotate_angular_tolerance);
/**
* This function returns the gesture layer rotate angular tolerance of an object
*
* @param obj gesture-layer.
* @return rotate angular tolerance
*
* @since 1.8
*/
EAPI double elm_gesture_layer_rotate_angular_tolerance_get(const Evas_Object *obj);
/**
* This function sets the gesture layer flick time limit (in ms) of an object
*
* @param obj gesture-layer.
* @param flick_time_limit_ms flick time limit (in ms)
*
* @since 1.8
*/
EAPI void elm_gesture_layer_flick_time_limit_ms_set(Evas_Object *obj, unsigned int flick_time_limit_ms);
/**
* This function returns the gesture layer flick time limit (in ms) of an object
*
* @param obj gesture-layer.
* @return flick time limit (in ms)
*
* @since 1.8
*/
EAPI unsigned int elm_gesture_layer_flick_time_limit_ms_get(const Evas_Object *obj);
/**
* This function sets the gesture layer long tap start timeout of an object
*
* @param obj gesture-layer.
* @param long_tap_start_timeout long tap start timeout
*
* @since 1.8
*/
EAPI void elm_gesture_layer_long_tap_start_timeout_set(Evas_Object *obj, double long_tap_start_timeout);
/**
* this function returns the gesture layer long tap start timeout of an object
*
* @param obj gesture-layer.
* @return long tap start timeout
*
* @since 1.8
*/
EAPI double elm_gesture_layer_long_tap_start_timeout_get(const Evas_Object *obj);
/**
* This function sets the gesture layer continues enable of an object
*
* @param obj gesture-layer.
* @param continues_enable continues enable
*
* @since 1.8
*/
EAPI void elm_gesture_layer_continues_enable_set(Evas_Object *obj, Eina_Bool continues_enable);
/**
* This function returns the gesture layer continues enable of an object
*
* @param obj gesture-layer.
* @return continues enable
*
* @since 1.8
*/
EAPI Eina_Bool elm_gesture_layer_continues_enable_get(const Evas_Object *obj);
/**
* This function sets the gesture layer double tap timeout of an object
*
* @param obj gesture-layer.
* @param double_tap_timeout double tap timeout
*
* @since 1.8
*/
EAPI void elm_gesture_layer_double_tap_timeout_set(Evas_Object *obj, double double_tap_timeout);
/**
* this function returns the gesture layer double tap timeout of an object
*
* @param obj gesture-layer.
* @return double tap timeout
*
* @since 1.8
*/
EAPI double elm_gesture_layer_double_tap_timeout_get(const Evas_Object *obj);
/**
* This function sets the gesture layer finger-size for taps
* If not set, this size taken from elm_config.
* Set to ZERO if you want GLayer to use system finger size value (default)
*
* @param obj gesture-layer.
* @param sz Finger size
*
* @since 1.8
*/
EAPI void elm_gesture_layer_tap_finger_size_set(Evas_Object *obj, Evas_Coord sz);
/**
* This function returns the gesture layer finger-size for taps
*
* @param obj gesture-layer.
* @return Finger size that is currently used by Gesture Layer for taps.
*
* @since 1.8
*/
EAPI Evas_Coord elm_gesture_layer_tap_finger_size_get(const Evas_Object *obj);
/**
* @}
*/
| FlorentRevest/Elementary | src/lib/elm_gesture_layer_common.h | C | lgpl-2.1 | 10,716 | [
30522,
1013,
1008,
1008,
1008,
1030,
5587,
3406,
17058,
17709,
1035,
9218,
1035,
6741,
1008,
1008,
1030,
1063,
1008,
1013,
1013,
1008,
1008,
1008,
4372,
2819,
1997,
3569,
9218,
4127,
1012,
1008,
1013,
30524,
1050,
3093,
2309,
25316,
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... |
package ch.heigvd.amt.mvcdemo.rest.resources;
import ch.heigvd.amt.mvcdemo.model.entities.Sector;
import ch.heigvd.amt.mvcdemo.rest.dto.SectorDTO;
import ch.heigvd.amt.mvcdemo.services.dao.BusinessDomainEntityNotFoundException;
import ch.heigvd.amt.mvcdemo.services.dao.SectorsDAOLocal;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.ResponseBuilder;
import javax.ws.rs.core.UriInfo;
/**
*
* @author Olivier Liechti (olivier.liechti@heig-vd.ch)
*/
@Stateless
@Path("/sectors")
public class SectorsResource {
@Context
UriInfo uriInfo;
@EJB
private SectorsDAOLocal sectorsDAO;
@GET
@Produces("application/json")
public List<SectorDTO> getSectors() {
List<SectorDTO> result = new ArrayList<>();
List<Sector> sectors = sectorsDAO.findAll();
for (Sector sector : sectors) {
long sectorId = sector.getId();
URI sectorHref = uriInfo
.getAbsolutePathBuilder()
.path(SectorsResource.class, "getSector")
.build(sectorId);
SectorDTO dto = new SectorDTO();
dto.setHref(sectorHref);
dto.setName(sector.getName());
result.add(dto);
}
return result;
}
@POST
@Consumes("application/json")
public Response createSector(SectorDTO sectorDTO) {
boolean created;
long sectorId;
try {
sectorId = sectorsDAO.findByName(sectorDTO.getName()).getId();
created = false;
} catch (BusinessDomainEntityNotFoundException ex) {
created = true;
sectorId = sectorsDAO.create(new Sector(sectorDTO.getName()));
}
URI sectorUri = uriInfo
.getBaseUriBuilder()
.path(SectorsResource.class)
.path(SectorsResource.class, "getSector")
.build(sectorId);
ResponseBuilder builder;
if (created) {
builder = Response.created(sectorUri);
} else {
builder = Response.ok().location(sectorUri);
}
return builder.build();
}
@GET
@Path("/{id}")
@Produces("application/json")
public Sector getSector(@PathParam(value = "id") long id) throws BusinessDomainEntityNotFoundException {
return sectorsDAO.findById(id);
}
@PUT
@Path("/{id}")
@Consumes("application/json")
public Response updateSector(SectorDTO sectorDTO, @PathParam(value = "id") long id) throws BusinessDomainEntityNotFoundException {
Sector sector = sectorsDAO.findById(id);
sector.setName(sectorDTO.getName());
return Response.ok().build();
}
@DELETE
@Path("/{id}")
public Response deleteSector(@PathParam(value = "id") long id) throws BusinessDomainEntityNotFoundException {
Sector sector = sectorsDAO.findById(id);
sectorsDAO.delete(sector);
return Response.ok().build();
}
}
| SoftEng-HEIGVD/Teaching-HEIGVD-AMT-Example-MVC | MVCDemo/src/main/java/ch/heigvd/amt/mvcdemo/rest/resources/SectorsResource.java | Java | mit | 3,061 | [
30522,
7427,
10381,
1012,
2002,
8004,
16872,
1012,
2572,
2102,
1012,
19842,
19797,
6633,
2080,
1012,
2717,
1012,
4219,
1025,
12324,
10381,
1012,
2002,
8004,
16872,
1012,
2572,
2102,
1012,
19842,
19797,
6633,
30524,
1012,
2002,
8004,
16872,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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) 2001-2002 by David Brownell
*
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifdef __KERNEL__
#include <linux/rwsem.h>
/* This file contains declarations of usbcore internals that are mostly
* used or exposed by Host Controller Drivers.
*/
/*
* USB Packet IDs (PIDs)
*/
#define USB_PID_UNDEF_0 0xf0
#define USB_PID_OUT 0xe1
#define USB_PID_ACK 0xd2
#define USB_PID_DATA0 0xc3
#define USB_PID_PING 0xb4 /* USB 2.0 */
#define USB_PID_SOF 0xa5
#define USB_PID_NYET 0x96 /* USB 2.0 */
#define USB_PID_DATA2 0x87 /* USB 2.0 */
#define USB_PID_SPLIT 0x78 /* USB 2.0 */
#define USB_PID_IN 0x69
#define USB_PID_NAK 0x5a
#define USB_PID_DATA1 0x4b
#define USB_PID_PREAMBLE 0x3c /* Token mode */
#define USB_PID_ERR 0x3c /* USB 2.0: handshake mode */
#define USB_PID_SETUP 0x2d
#define USB_PID_STALL 0x1e
#define USB_PID_MDATA 0x0f /* USB 2.0 */
/*-------------------------------------------------------------------------*/
/*
* USB Host Controller Driver (usb_hcd) framework
*
* Since "struct usb_bus" is so thin, you can't share much code in it.
* This framework is a layer over that, and should be more sharable.
*
* @authorized_default: Specifies if new devices are authorized to
* connect by default or they require explicit
* user space authorization; this bit is settable
* through /sys/class/usb_host/X/authorized_default.
* For the rest is RO, so we don't lock to r/w it.
*/
/*-------------------------------------------------------------------------*/
struct usb_hcd {
/*
* housekeeping
*/
struct usb_bus self; /* hcd is-a bus */
struct kref kref; /* reference counter */
const char *product_desc; /* product/vendor string */
char irq_descr[24]; /* driver + bus # */
struct timer_list rh_timer; /* drives root-hub polling */
struct urb *status_urb; /* the current status urb */
#ifdef CONFIG_PM
struct work_struct wakeup_work; /* for remote wakeup */
#endif
/*
* hardware info/state
*/
const struct hc_driver *driver; /* hw-specific hooks */
/* Flags that need to be manipulated atomically */
unsigned long flags;
#define HCD_FLAG_HW_ACCESSIBLE 0x00000001
#define HCD_FLAG_SAW_IRQ 0x00000002
unsigned rh_registered:1;/* is root hub registered? */
/* The next flag is a stopgap, to be removed when all the HCDs
* support the new root-hub polling mechanism. */
unsigned uses_new_polling:1;
unsigned poll_rh:1; /* poll for rh status? */
unsigned poll_pending:1; /* status has changed? */
unsigned wireless:1; /* Wireless USB HCD */
unsigned authorized_default:1;
int irq; /* irq allocated */
void __iomem *regs; /* device memory/io */
u64 rsrc_start; /* memory/io resource start */
u64 rsrc_len; /* memory/io resource length */
unsigned power_budget; /* in mA, 0 = no limit */
#define HCD_BUFFER_POOLS 4
struct dma_pool *pool [HCD_BUFFER_POOLS];
int state;
# define __ACTIVE 0x01
# define __SUSPEND 0x04
# define __TRANSIENT 0x80
# define HC_STATE_HALT 0
# define HC_STATE_RUNNING (__ACTIVE)
# define HC_STATE_QUIESCING (__SUSPEND|__TRANSIENT|__ACTIVE)
# define HC_STATE_RESUMING (__SUSPEND|__TRANSIENT)
# define HC_STATE_SUSPENDED (__SUSPEND)
#define HC_IS_RUNNING(state) ((state) & __ACTIVE)
#define HC_IS_SUSPENDED(state) ((state) & __SUSPEND)
/* more shared queuing code would be good; it should support
* smarter scheduling, handle transaction translators, etc;
* input size of periodic table to an interrupt scheduler.
* (ohci 32, uhci 1024, ehci 256/512/1024).
*/
/* The HC driver's private data is stored at the end of
* this structure.
*/
unsigned long hcd_priv[0]
__attribute__ ((aligned (sizeof(unsigned long))));
};
/* 2.4 does this a bit differently ... */
static inline struct usb_bus *hcd_to_bus (struct usb_hcd *hcd)
{
return &hcd->self;
}
static inline struct usb_hcd *bus_to_hcd (struct usb_bus *bus)
{
return container_of(bus, struct usb_hcd, self);
}
struct hcd_timeout { /* timeouts we allocate */
struct list_head timeout_list;
struct timer_list timer;
};
/*-------------------------------------------------------------------------*/
struct hc_driver {
const char *description; /* "ehci-hcd" etc */
const char *product_desc; /* product/vendor string */
size_t hcd_priv_size; /* size of private data */
/* irq handler */
irqreturn_t (*irq) (struct usb_hcd *hcd);
int flags;
#define HCD_MEMORY 0x0001 /* HC regs use memory (else I/O) */
#define HCD_USB11 0x0010 /* USB 1.1 */
#define HCD_USB2 0x0020 /* USB 2.0 */
/* called to init HCD and root hub */
int (*reset) (struct usb_hcd *hcd);
int (*start) (struct usb_hcd *hcd);
/* NOTE: these suspend/resume calls relate to the HC as
* a whole, not just the root hub; they're for PCI bus glue.
*/
/* called after suspending the hub, before entering D3 etc */
int (*suspend) (struct usb_hcd *hcd, pm_message_t message);
/* called after entering D0 (etc), before resuming the hub */
int (*resume) (struct usb_hcd *hcd);
/* cleanly make HCD stop writing memory and doing I/O */
void (*stop) (struct usb_hcd *hcd);
/* shutdown HCD */
void (*shutdown) (struct usb_hcd *hcd);
/* return current frame number */
int (*get_frame_number) (struct usb_hcd *hcd);
/* manage i/o requests, device state */
int (*urb_enqueue)(struct usb_hcd *hcd,
struct urb *urb, gfp_t mem_flags);
int (*urb_dequeue)(struct usb_hcd *hcd,
struct urb *urb, int status);
/* hw synch, freeing endpoint resources that urb_dequeue can't */
void (*endpoint_disable)(struct usb_hcd *hcd,
struct usb_host_endpoint *ep);
/* root hub support */
int (*hub_status_data) (struct usb_hcd *hcd, char *buf);
int (*hub_control) (struct usb_hcd *hcd,
u16 typeReq, u16 wValue, u16 wIndex,
char *buf, u16 wLength);
int (*bus_suspend)(struct usb_hcd *);
int (*bus_resume)(struct usb_hcd *);
int (*start_port_reset)(struct usb_hcd *, unsigned port_num);
void (*hub_irq_enable)(struct usb_hcd *);
/* Needed only if port-change IRQs are level-triggered */
#ifdef CONFIG_KDB_USB
/* KDB poll function for this HC */
int (*kdb_poll_char)(struct urb *urb);
#endif /* CONFIG_KDB_USB */
};
extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb);
extern int usb_hcd_check_unlink_urb(struct usb_hcd *hcd, struct urb *urb,
int status);
extern void usb_hcd_unlink_urb_from_ep(struct usb_hcd *hcd, struct urb *urb);
extern int usb_hcd_submit_urb (struct urb *urb, gfp_t mem_flags);
extern int usb_hcd_unlink_urb (struct urb *urb, int status);
extern void usb_hcd_giveback_urb(struct usb_hcd *hcd, struct urb *urb,
int status);
extern void usb_hcd_flush_endpoint(struct usb_device *udev,
struct usb_host_endpoint *ep);
extern void usb_hcd_disable_endpoint(struct usb_device *udev,
struct usb_host_endpoint *ep);
extern int usb_hcd_get_frame_number (struct usb_device *udev);
extern struct usb_hcd *usb_create_hcd (const struct hc_driver *driver,
struct device *dev, char *bus_name);
extern struct usb_hcd *usb_get_hcd (struct usb_hcd *hcd);
extern void usb_put_hcd (struct usb_hcd *hcd);
extern int usb_add_hcd(struct usb_hcd *hcd,
unsigned int irqnum, unsigned long irqflags);
extern void usb_remove_hcd(struct usb_hcd *hcd);
struct platform_device;
extern void usb_hcd_platform_shutdown(struct platform_device* dev);
#ifdef CONFIG_PCI
struct pci_dev;
struct pci_device_id;
extern int usb_hcd_pci_probe (struct pci_dev *dev,
const struct pci_device_id *id);
extern void usb_hcd_pci_remove (struct pci_dev *dev);
#ifdef CONFIG_PM
extern int usb_hcd_pci_suspend (struct pci_dev *dev, pm_message_t state);
extern int usb_hcd_pci_resume (struct pci_dev *dev);
#endif /* CONFIG_PM */
extern void usb_hcd_pci_shutdown (struct pci_dev *dev);
#endif /* CONFIG_PCI */
/* pci-ish (pdev null is ok) buffer alloc/mapping support */
int hcd_buffer_create (struct usb_hcd *hcd);
void hcd_buffer_destroy (struct usb_hcd *hcd);
void *hcd_buffer_alloc (struct usb_bus *bus, size_t size,
gfp_t mem_flags, dma_addr_t *dma);
void hcd_buffer_free (struct usb_bus *bus, size_t size,
void *addr, dma_addr_t dma);
/* generic bus glue, needed for host controllers that don't use PCI */
extern irqreturn_t usb_hcd_irq (int irq, void *__hcd);
extern void usb_hc_died (struct usb_hcd *hcd);
extern void usb_hcd_poll_rh_status(struct usb_hcd *hcd);
/* -------------------------------------------------------------------------- */
/* Enumeration is only for the hub driver, or HCD virtual root hubs */
extern struct usb_device *usb_alloc_dev(struct usb_device *parent,
struct usb_bus *, unsigned port);
extern int usb_new_device(struct usb_device *dev);
extern void usb_disconnect(struct usb_device **);
extern int usb_get_configuration(struct usb_device *dev);
extern void usb_destroy_configuration(struct usb_device *dev);
/*-------------------------------------------------------------------------*/
/*
* HCD Root Hub support
*/
#include "hub.h"
/* (shifted) direction/type/recipient from the USB 2.0 spec, table 9.2 */
#define DeviceRequest \
((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_DEVICE)<<8)
#define DeviceOutRequest \
((USB_DIR_OUT|USB_TYPE_STANDARD|USB_RECIP_DEVICE)<<8)
#define InterfaceRequest \
((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_INTERFACE)<<8)
#define EndpointRequest \
((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_INTERFACE)<<8)
#define EndpointOutRequest \
((USB_DIR_OUT|USB_TYPE_STANDARD|USB_RECIP_INTERFACE)<<8)
/* class requests from the USB 2.0 hub spec, table 11-15 */
/* GetBusState and SetHubDescriptor are optional, omitted */
#define ClearHubFeature (0x2000 | USB_REQ_CLEAR_FEATURE)
#define ClearPortFeature (0x2300 | USB_REQ_CLEAR_FEATURE)
#define GetHubDescriptor (0xa000 | USB_REQ_GET_DESCRIPTOR)
#define GetHubStatus (0xa000 | USB_REQ_GET_STATUS)
#define GetPortStatus (0xa300 | USB_REQ_GET_STATUS)
#define SetHubFeature (0x2000 | USB_REQ_SET_FEATURE)
#define SetPortFeature (0x2300 | USB_REQ_SET_FEATURE)
/*-------------------------------------------------------------------------*/
/*
* Generic bandwidth allocation constants/support
*/
#define FRAME_TIME_USECS 1000L
#define BitTime(bytecount) (7 * 8 * bytecount / 6) /* with integer truncation */
/* Trying not to use worst-case bit-stuffing
of (7/6 * 8 * bytecount) = 9.33 * bytecount */
/* bytecount = data payload byte count */
#define NS_TO_US(ns) ((ns + 500L) / 1000L)
/* convert & round nanoseconds to microseconds */
/*
* Full/low speed bandwidth allocation constants/support.
*/
#define BW_HOST_DELAY 1000L /* nanoseconds */
#define BW_HUB_LS_SETUP 333L /* nanoseconds */
/* 4 full-speed bit times (est.) */
#define FRAME_TIME_BITS 12000L /* frame = 1 millisecond */
#define FRAME_TIME_MAX_BITS_ALLOC (90L * FRAME_TIME_BITS / 100L)
#define FRAME_TIME_MAX_USECS_ALLOC (90L * FRAME_TIME_USECS / 100L)
/*
* Ceiling [nano/micro]seconds (typical) for that many bytes at high speed
* ISO is a bit less, no ACK ... from USB 2.0 spec, 5.11.3 (and needed
* to preallocate bandwidth)
*/
#define USB2_HOST_DELAY 5 /* nsec, guess */
#define HS_NSECS(bytes) ( ((55 * 8 * 2083) \
+ (2083UL * (3 + BitTime(bytes))))/1000 \
+ USB2_HOST_DELAY)
#define HS_NSECS_ISO(bytes) ( ((38 * 8 * 2083) \
+ (2083UL * (3 + BitTime(bytes))))/1000 \
+ USB2_HOST_DELAY)
#define HS_USECS(bytes) NS_TO_US (HS_NSECS(bytes))
#define HS_USECS_ISO(bytes) NS_TO_US (HS_NSECS_ISO(bytes))
extern long usb_calc_bus_time (int speed, int is_input,
int isoc, int bytecount);
/*-------------------------------------------------------------------------*/
extern void usb_set_device_state(struct usb_device *udev,
enum usb_device_state new_state);
/*-------------------------------------------------------------------------*/
/* exported only within usbcore */
extern struct list_head usb_bus_list;
extern struct mutex usb_bus_list_lock;
extern wait_queue_head_t usb_kill_urb_queue;
extern void usb_enable_root_hub_irq (struct usb_bus *bus);
extern int usb_find_interface_driver (struct usb_device *dev,
struct usb_interface *interface);
#define usb_endpoint_out(ep_dir) (!((ep_dir) & USB_DIR_IN))
#ifdef CONFIG_PM
extern void usb_hcd_resume_root_hub (struct usb_hcd *hcd);
extern void usb_root_hub_lost_power (struct usb_device *rhdev);
extern int hcd_bus_suspend(struct usb_device *rhdev);
extern int hcd_bus_resume(struct usb_device *rhdev);
#else
static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd)
{
return;
}
#endif /* CONFIG_PM */
/*
* USB device fs stuff
*/
#ifdef CONFIG_USB_DEVICEFS
/*
* these are expected to be called from the USB core/hub thread
* with the kernel lock held
*/
extern void usbfs_update_special (void);
extern int usbfs_init(void);
extern void usbfs_cleanup(void);
#else /* CONFIG_USB_DEVICEFS */
static inline void usbfs_update_special (void) {}
static inline int usbfs_init(void) { return 0; }
static inline void usbfs_cleanup(void) { }
#endif /* CONFIG_USB_DEVICEFS */
/*-------------------------------------------------------------------------*/
#if defined(CONFIG_USB_MON)
struct usb_mon_operations {
void (*urb_submit)(struct usb_bus *bus, struct urb *urb);
void (*urb_submit_error)(struct usb_bus *bus, struct urb *urb, int err);
void (*urb_complete)(struct usb_bus *bus, struct urb *urb, int status);
/* void (*urb_unlink)(struct usb_bus *bus, struct urb *urb); */
};
extern struct usb_mon_operations *mon_ops;
static inline void usbmon_urb_submit(struct usb_bus *bus, struct urb *urb)
{
if (bus->monitored)
(*mon_ops->urb_submit)(bus, urb);
}
static inline void usbmon_urb_submit_error(struct usb_bus *bus, struct urb *urb,
int error)
{
if (bus->monitored)
(*mon_ops->urb_submit_error)(bus, urb, error);
}
static inline void usbmon_urb_complete(struct usb_bus *bus, struct urb *urb,
int status)
{
if (bus->monitored)
(*mon_ops->urb_complete)(bus, urb, status);
}
int usb_mon_register(struct usb_mon_operations *ops);
void usb_mon_deregister(void);
#else
static inline void usbmon_urb_submit(struct usb_bus *bus, struct urb *urb) {}
static inline void usbmon_urb_submit_error(struct usb_bus *bus, struct urb *urb,
int error) {}
static inline void usbmon_urb_complete(struct usb_bus *bus, struct urb *urb,
int status) {}
#endif /* CONFIG_USB_MON */
/*-------------------------------------------------------------------------*/
/* hub.h ... DeviceRemovable in 2.4.2-ac11, gone in 2.4.10 */
// bleech -- resurfaced in 2.4.11 or 2.4.12
#define bitmap DeviceRemovable
/*-------------------------------------------------------------------------*/
/* random stuff */
#define RUN_CONTEXT (in_irq () ? "in_irq" \
: (in_interrupt () ? "in_interrupt" : "can sleep"))
/* This rwsem is for use only by the hub driver and ehci-hcd.
* Nobody else should touch it.
*/
extern struct rw_semaphore ehci_cf_port_reset_rwsem;
#endif /* __KERNEL__ */
| blakearnold/MPR | drivers/usb/core/hcd.h | C | gpl-2.0 | 15,632 | [
30522,
1013,
1008,
1008,
9385,
1006,
1039,
1007,
2541,
1011,
2526,
2011,
2585,
15005,
3363,
1008,
1008,
2023,
2565,
2003,
2489,
4007,
1025,
2017,
2064,
2417,
2923,
3089,
8569,
2618,
2009,
1998,
1013,
2030,
19933,
2009,
1008,
2104,
1996,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Reactive;
using Microsoft.Xna.Framework;
using Microsoft.Devices.Sensors;
namespace WP7AccelerometerSample
{
public class AccelerometerObservable
{
public static IObservable<Vector3> GetAccelerometer()
{
var accelerometer = new Accelerometer();
accelerometer.Start();
IObservable<IEvent<AccelerometerReadingEventArgs>> accelerometerReadingAsObservable =
Observable.FromEvent<AccelerometerReadingEventArgs>(
ev => accelerometer.ReadingChanged += ev,
ev => accelerometer.ReadingChanged -= ev);
var vector3FromAccelerometerEventArgs = from args in accelerometerReadingAsObservable
select new Vector3(
(float)args.EventArgs.X,
(float)args.EventArgs.Y,
(float)args.EventArgs.Z);
return vector3FromAccelerometerEventArgs;
}
}
}
| jwooley/RxSamples | WP7AccelerometerSample/WP7AccelerometerSample/AccelerometerObservable.cs | C# | mit | 1,391 | [
30522,
2478,
2291,
1025,
2478,
2291,
1012,
5658,
1025,
2478,
2291,
1012,
3645,
1025,
2478,
2291,
1012,
3645,
1012,
7711,
1025,
2478,
2291,
1012,
3645,
1012,
5491,
1025,
2478,
2291,
1012,
3645,
1012,
10710,
1025,
2478,
2291,
1012,
3645,
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... |
---
layout: post
title: KVO problems with CALayer on 10.5?
category: articles
tags: [code,osx]
---
I was trying out some code on 10.5 that was originally developed on 10.6, and ran into a number of really strange issues. At first they seemed almost random and unrelated but after debugging for a while it turned out they were all related to key-value observation in some way or another.
After more debugging, it became clear that for some reason I was not getting any observer callbacks and Cocoa bindings weren't working for certain objects.
This looked suspicious, and sure enough, implementing:
{% highlight objc %}
+ (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key
{
BOOL notifies = [super automaticallyNotifiesObserversForKey:key];
NSLog(@"Notifies for key %@: %d", key, notifies);
return notifies;
}
{% endhighlight %}
in one of the affected classes showed that the return value was always <code>NO</code>, even for properties that I had declared myself!
The reason is that CALayer's implementation of <code>automaticallyNotifiesObserversForKey:</code> in 10.5 returns <code>NO</code> for all keys. In 10.6 it works as expected, returning only <code>NO</code> for its own properties.
Fortunately the work-around is simple: just implement the class method yourself and return <code>YES</code> for your own properties:
{% highlight objc %}
+ (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key
{
if ([key isEqualToString:@"myKey"]) {
return YES;
}
return [super automaticallyNotifiesObserversForKey:key];
}
{% endhighlight %}
| rhult/rhult.github.com | _posts/2009-12-13-kvo-problems-with-calayer.md | Markdown | mit | 1,590 | [
30522,
1011,
1011,
1011,
9621,
1024,
2695,
2516,
1024,
24888,
2080,
3471,
2007,
10250,
4710,
2121,
2006,
2184,
1012,
1019,
1029,
4696,
1024,
4790,
22073,
1024,
1031,
3642,
1010,
9808,
2595,
1033,
1011,
1011,
1011,
1045,
2001,
2667,
2041,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.