text stringlengths 2 1.04M | meta dict |
|---|---|
import { expect } from 'chai';
import * as firestore from '@firebase/firestore-types';
import { Deferred } from '../../util/promise';
import firebase from '../util/firebase_export';
import * as integrationHelpers from '../util/helpers';
const apiDescribe = integrationHelpers.apiDescribe;
apiDescribe('Database transactions', persistence => {
// TODO(klimt): Test that transactions don't see latency compensation
// changes, using the other kind of integration test.
// We currently require every document read to also be written.
it('get documents', () => {
return integrationHelpers.withTestDb(persistence, db => {
const doc = db.collection('spaces').doc();
return doc
.set({
foo: 1,
desc: 'Stuff related to Firestore project...',
owner: 'Jonny'
})
.then(() => {
return (
db
.runTransaction(transaction => {
return transaction.get(doc);
})
// We currently require every document read to also be
// written.
// TODO(b/34879758): Add this check back once we drop that.
// .then((snapshot) => {
// expect(snapshot).to.exist;
// expect(snapshot.data()['owner']).to.equal('Jonny');
// });
.then(() => expect.fail('transaction should fail'))
.catch(err => {
expect(err).to.exist;
expect(err.message).to.contain(
'Every document read in a transaction must also be' +
' written'
);
})
);
});
});
});
it('delete documents', () => {
return integrationHelpers.withTestDb(persistence, db => {
const doc = db.collection('towns').doc();
return doc
.set({ foo: 'bar' })
.then(() => {
return doc.get();
})
.then(snapshot => {
expect(snapshot).to.exist;
expect(snapshot.data()['foo']).to.equal('bar');
return db.runTransaction(transaction => {
transaction.delete(doc);
return Promise.resolve();
});
})
.then(() => {
return doc.get();
})
.then(snapshot => {
expect(snapshot.exists).to.equal(false);
return Promise.resolve();
});
});
});
it('get nonexistent document then create', () => {
return integrationHelpers.withTestDb(persistence, db => {
const docRef = db.collection('towns').doc();
return db
.runTransaction(transaction => {
return transaction.get(docRef).then(docSnap => {
expect(docSnap.exists).to.equal(false);
transaction.set(docRef, { foo: 'bar' });
});
})
.then(() => {
return docRef.get();
})
.then(snapshot => {
expect(snapshot.exists).to.equal(true);
expect(snapshot.data()).to.deep.equal({ foo: 'bar' });
});
});
});
it('get nonexistent document then fail patch', () => {
return integrationHelpers.withTestDb(persistence, db => {
const docRef = db.collection('towns').doc();
return db
.runTransaction(transaction => {
return transaction.get(docRef).then(docSnap => {
expect(docSnap.exists).to.equal(false);
transaction.update(docRef, { foo: 'bar' });
});
})
.then(() => expect.fail('transaction should fail'))
.catch(err => {
expect(err).to.exist;
expect(err.message).to.equal(
"Can't update a document that doesn't exist."
);
});
});
});
it("can't delete document then patch", () => {
return integrationHelpers.withTestDb(persistence, db => {
const docRef = db.collection('towns').doc();
return docRef.set({ foo: 'bar' }).then(() => {
return db
.runTransaction(transaction => {
return transaction.get(docRef).then(docSnap => {
expect(docSnap.exists).to.equal(true);
transaction.delete(docRef);
// Since we deleted the doc, the update will fail
transaction.update(docRef, { foo: 'new-bar' });
});
})
.then(() => expect.fail('transaction should fail'))
.catch(err => {
expect(err).to.exist;
// TODO(b/65409268): This is likely the wrong error code
expect((err as firestore.FirestoreError).code).to.equal(
'failed-precondition'
);
expect(err.message).to.equal(
"Can't update a document that doesn't exist."
);
});
});
});
});
it("can't delete document then set", () => {
return integrationHelpers.withTestDb(persistence, db => {
const docRef = db.collection('towns').doc();
return docRef.set({ foo: 'bar' }).then(() => {
return db
.runTransaction(transaction => {
return transaction.get(docRef).then(docSnap => {
expect(docSnap.exists).to.equal(true);
transaction.delete(docRef);
// TODO(dimond): In theory this should work, but it's complex to
// make it work, so instead we just let the transaction fail and
// verify it's unsupported for now
transaction.set(docRef, { foo: 'new-bar' });
});
})
.then(() => expect.fail('transaction should fail'))
.catch(err => {
expect(err).to.exist;
// TODO(b/65409268): This is likely the wrong error code
expect((err as firestore.FirestoreError).code).to.equal(
'invalid-argument'
);
});
});
});
});
it('write document twice', () => {
return integrationHelpers.withTestDb(persistence, db => {
const doc = db.collection('towns').doc();
return db
.runTransaction(transaction => {
transaction.set(doc, { a: 'b' }).set(doc, { c: 'd' });
return Promise.resolve();
})
.then(() => {
return doc.get();
})
.then(snapshot => {
expect(snapshot.exists).to.equal(true);
expect(snapshot.data()).to.deep.equal({ c: 'd' });
});
});
});
it('set document with merge', () => {
return integrationHelpers.withTestDb(persistence, db => {
const doc = db.collection('towns').doc();
return db
.runTransaction(transaction => {
transaction.set(doc, { a: 'b', nested: { a: 'b' } }).set(
doc,
{ c: 'd', nested: { c: 'd' } },
{
merge: true
}
);
return Promise.resolve();
})
.then(() => {
return doc.get();
})
.then(snapshot => {
expect(snapshot.exists).to.equal(true);
expect(snapshot.data()).to.deep.equal({
a: 'b',
c: 'd',
nested: { a: 'b', c: 'd' }
});
});
});
});
it('increment transactionally', () => {
// A set of concurrent transactions.
const transactionPromises: Array<Promise<void>> = [];
const readPromises: Array<Promise<void>> = [];
// A barrier to make sure every transaction reaches the same spot.
const barrier = new Deferred();
let started = 0;
return integrationHelpers.withTestDb(persistence, db => {
const doc = db.collection('counters').doc();
return doc
.set({
count: 5
})
.then(() => {
// Make 3 transactions that will all increment.
for (let i = 0; i < 3; i++) {
const resolveRead = new Deferred<void>();
readPromises.push(resolveRead.promise);
transactionPromises.push(
db.runTransaction(transaction => {
return transaction.get(doc).then(snapshot => {
expect(snapshot).to.exist;
started = started + 1;
resolveRead.resolve();
return barrier.promise.then(() => {
transaction.set(doc, {
count: snapshot.data()['count'] + 1
});
});
});
})
);
}
// Let all of the transactions fetch the old value and stop once.
return Promise.all(readPromises);
})
.then(() => {
// Let all of the transactions continue and wait for them to
// finish.
expect(started).to.equal(3);
barrier.resolve();
return Promise.all(transactionPromises);
})
.then(() => {
// Now all transaction should be completed, so check the result.
return doc.get();
})
.then(snapshot => {
expect(snapshot).to.exist;
expect(snapshot.data()['count']).to.equal(8);
});
});
});
it('update transactionally', () => {
// A set of concurrent transactions.
const transactionPromises: Array<Promise<void>> = [];
const readPromises: Array<Promise<void>> = [];
// A barrier to make sure every transaction reaches the same spot.
const barrier = new Deferred();
let started = 0;
return integrationHelpers.withTestDb(persistence, db => {
const doc = db.collection('counters').doc();
return doc
.set({
count: 5,
other: 'yes'
})
.then(() => {
// Make 3 transactions that will all increment.
for (let i = 0; i < 3; i++) {
const resolveRead = new Deferred<void>();
readPromises.push(resolveRead.promise);
transactionPromises.push(
db.runTransaction(transaction => {
return transaction.get(doc).then(snapshot => {
expect(snapshot).to.exist;
started = started + 1;
resolveRead.resolve();
return barrier.promise.then(() => {
transaction.update(doc, {
count: snapshot.data()['count'] + 1
});
});
});
})
);
}
// Let all of the transactions fetch the old value and stop once.
return Promise.all(readPromises);
})
.then(() => {
// Let all of the transactions continue and wait for them to
// finish.
expect(started).to.equal(3);
barrier.resolve();
return Promise.all(transactionPromises);
})
.then(() => {
// Now all transaction should be completed, so check the result.
return doc.get();
})
.then(snapshot => {
expect(snapshot).to.exist;
expect(snapshot.data()['count']).to.equal(8);
expect(snapshot.data()['other']).to.equal('yes');
});
});
});
it('can update nested fields transactionally', () => {
const initialData = {
desc: 'Description',
owner: { name: 'Jonny' },
'is.admin': false
};
const finalData = {
desc: 'Description',
owner: { name: 'Sebastian' },
'is.admin': true
};
return integrationHelpers.withTestDb(persistence, db => {
const doc = db.collection('counters').doc();
return db
.runTransaction(transaction => {
transaction.set(doc, initialData);
transaction.update(
doc,
'owner.name',
'Sebastian',
new firebase.firestore.FieldPath('is.admin'),
true
);
return Promise.resolve();
})
.then(() => doc.get())
.then(docSnapshot => {
expect(docSnapshot.exists).to.be.ok;
expect(docSnapshot.data()).to.deep.equal(finalData);
});
});
});
it('handle reading one doc and writing another', () => {
return integrationHelpers.withTestDb(persistence, db => {
const doc1 = db.collection('counters').doc();
const doc2 = db.collection('counters').doc();
let tries = 0;
return (
doc1
.set({
count: 15
})
.then(() => {
return db.runTransaction(transaction => {
tries++;
// Get the first doc.
return (
transaction
.get(doc1)
// Do a write outside of the transaction. The first time the
// transaction is tried, this will bump the version, which
// will cause the write to doc2 to fail. The second time, it
// will be a no-op and not bump the version.
.then(() => doc1.set({ count: 1234 }))
// Now try to update the other doc from within the
// transaction.
// This should fail once, because we read 15 earlier.
.then(() => transaction.set(doc2, { count: 16 }))
);
});
})
// We currently require every document read to also be written.
// TODO(b/34879758): Add this check back once we drop that.
// .then(() => doc1.get())
// .then(snapshot => {
// expect(tries).to.equal(2);
// expect(snapshot.data()['count']).to.equal(1234);
// return doc2.get();
// })
// .then(snapshot => expect(snapshot.data()['count']).to.equal(16));
.then(() => expect.fail('transaction should fail'))
.catch(err => {
expect(err).to.exist;
expect(err.message).to.contain(
'Every document read in a transaction must also be ' + 'written'
);
})
);
});
});
it('handle reading a doc twice with different versions', () => {
return integrationHelpers.withTestDb(persistence, db => {
const doc = db.collection('counters').doc();
return doc
.set({
count: 15
})
.then(() => {
return db.runTransaction(transaction => {
// Get the doc once.
return (
transaction
.get(doc)
// Do a write outside of the transaction.
.then(() => doc.set({ count: 1234 }))
// Get the doc again in the transaction with the new
// version.
.then(() => transaction.get(doc))
// Now try to update the doc from within the transaction.
// This should fail, because we read 15 earlier.
.then(() => transaction.set(doc, { count: 16 }))
);
});
})
.then(() => expect.fail('transaction should fail'))
.catch(err => expect(err).to.exist)
.then(() => doc.get())
.then(snapshot => {
expect(snapshot.data()['count']).to.equal(1234);
});
});
});
it('cannot read after writing', () => {
return integrationHelpers.withTestDb(persistence, db => {
return db
.runTransaction(transaction => {
const doc = db.collection('anything').doc();
transaction.set(doc, { foo: 'bar' });
return transaction.get(doc);
})
.then(() => {
expect.fail('transaction should fail');
})
.catch(err => {
expect(err).to.exist;
});
});
});
describe('must return a promise:', () => {
const noop = () => {
/* -_- */
};
const badReturns = [
undefined,
null,
5,
{},
{ then: noop, noCatch: noop },
{ noThen: noop, catch: noop }
];
for (const badReturn of badReturns) {
it(badReturn + ' is rejected', () => {
// tslint:disable-next-line:no-any Intentionally returning bad type.
const fn = ((txn: firestore.Transaction) => badReturn) as any;
return integrationHelpers.withTestDb(persistence, db => {
return db
.runTransaction(fn)
.then(() => expect.fail('transaction should fail'))
.catch(err => {
expect(err).to.exist;
expect(err.message).to.contain(
'Transaction callback must return a Promise'
);
});
});
});
}
});
it('cannot have a get without mutations', () => {
return integrationHelpers.withTestDb(persistence, db => {
const docRef = db.collection('foo').doc();
return (
docRef
.set({ foo: 'bar' })
.then(() => {
return db.runTransaction(txn => {
return txn.get(docRef);
});
})
// We currently require every document read to also be written.
// TODO(b/34879758): Add this check back once we drop that.
// .then((snapshot) => {
// expect(snapshot).to.exist;
// expect(snapshot.data()['foo']).to.equal('bar');
// });
.then(() => expect.fail('transaction should fail'))
.catch(err => {
expect(err).to.exist;
expect(err.message).to.contain(
'Every document read in a transaction must also be ' + 'written'
);
})
);
});
});
it('are successful with no transaction operations', () => {
return integrationHelpers.withTestDb(persistence, db => {
return db.runTransaction(txn => {
return Promise.resolve();
});
});
});
it('are cancelled on rejected promise', () => {
return integrationHelpers.withTestDb(persistence, db => {
const doc = db.collection('towns').doc();
let count = 0;
return db
.runTransaction(transaction => {
count++;
transaction.set(doc, { foo: 'bar' });
return Promise.reject('no');
})
.then(() => expect.fail('transaction should fail'))
.catch(err => {
expect(err).to.exist;
expect(err).to.equal('no');
expect(count).to.equal(1);
return doc.get();
})
.then(snapshot => {
expect((snapshot as firestore.DocumentSnapshot).exists).to.equal(
false
);
});
});
});
it('are cancelled on throw', () => {
return integrationHelpers.withTestDb(persistence, db => {
const doc = db.collection('towns').doc();
const failure = new Error('no');
let count = 0;
return db
.runTransaction(transaction => {
count++;
transaction.set(doc, { foo: 'bar' });
throw failure;
})
.then(() => expect.fail('transaction should fail'))
.catch(err => {
expect(err).to.exist;
expect(err).to.equal(failure);
expect(count).to.equal(1);
return doc.get();
})
.then(snapshot => {
expect((snapshot as firestore.DocumentSnapshot).exists).to.equal(
false
);
});
});
});
});
| {
"content_hash": "932ea6872a56a09548b5ba629d33c84a",
"timestamp": "",
"source": "github",
"line_count": 582,
"max_line_length": 78,
"avg_line_length": 33.039518900343644,
"alnum_prop": 0.49903791148785687,
"repo_name": "FirebasePrivate/firebase-js-sdk-1",
"id": "3ed53be5532bd3dc155845a994a61c79cf18f067",
"size": "19822",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "packages/firestore/test/integration/api/transactions.test.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "3252"
},
{
"name": "HTML",
"bytes": "28563"
},
{
"name": "JavaScript",
"bytes": "2587211"
},
{
"name": "Python",
"bytes": "6779"
},
{
"name": "Shell",
"bytes": "10750"
},
{
"name": "TypeScript",
"bytes": "2737194"
}
],
"symlink_target": ""
} |
#ifndef vnsw_agent_bfd_proto_h_
#define vnsw_agent_bfd_proto_h_
#include "pkt/proto.h"
#include "services/bfd_handler.h"
#include "oper/health_check.h"
#include "bfd/bfd_client.h"
#include "bfd/bfd_server.h"
#include "bfd/bfd_connection.h"
#include "bfd/bfd_session.h"
#include "base/test/task_test_util.h"
#define BFD_TX_BUFF_LEN 128
#define BFD_TRACE(obj, ...) \
do { \
Bfd##obj::TraceMsg(BfdTraceBuf, __FILE__, __LINE__, ##__VA_ARGS__); \
} while (false)
class BfdProto : public Proto {
public:
static const uint32_t kMultiplier = 2;
static const uint32_t kMinRxInterval = 500000; // microseconds
static const uint32_t kMinTxInterval = 500000; // microseconds
struct BfdStats {
BfdStats() { Reset(); }
void Reset() { bfd_sent = bfd_received = 0; }
uint32_t bfd_sent;
uint32_t bfd_received;
};
class BfdCommunicator : public BFD::Connection {
public:
BfdCommunicator(BfdProto *bfd_proto) :
bfd_proto_(bfd_proto), server_(NULL) {}
virtual ~BfdCommunicator() {}
virtual void SendPacket(
const boost::asio::ip::udp::endpoint &local_endpoint,
const boost::asio::ip::udp::endpoint &remote_endpoint,
const BFD::SessionIndex &session_index,
const boost::asio::mutable_buffer &packet, int pktSize);
virtual void NotifyStateChange(const BFD::SessionKey &key, const bool &up);
virtual BFD::Server *GetServer() const { return server_; }
virtual void SetServer(BFD::Server *server) { server_ = server; }
private:
BfdProto *bfd_proto_;
BFD::Server *server_;
};
BfdProto(Agent *agent, boost::asio::io_service &io);
virtual ~BfdProto();
ProtoHandler *AllocProtoHandler(boost::shared_ptr<PktInfo> info,
boost::asio::io_service &io);
void Shutdown() {
delete client_;
client_ = NULL;
// server_->DeleteClientSessions();
// TASK_UTIL_EXPECT_TRUE(server_->event_queue()->IsQueueEmpty());
server_->event_queue()->Shutdown();
delete server_;
server_ = NULL;
sessions_.clear();
}
bool BfdHealthCheckSessionControl(
HealthCheckTable::HealthCheckServiceAction action,
HealthCheckInstanceService *service);
bool GetSourceAddress(uint32_t interface, IpAddress &address);
void NotifyHealthCheckInstanceService(uint32_t interface, std::string &data);
BfdCommunicator &bfd_communicator() { return communicator_; }
void IncrementSent() { stats_.bfd_sent++; }
void IncrementReceived() { stats_.bfd_received++; }
const BfdStats &GetStats() const { return stats_; }
uint32_t ActiveSessions() const { return sessions_.size(); }
private:
friend BfdCommunicator;
// map from interface id to health check instance service
typedef std::map<uint32_t, HealthCheckInstanceService *> Sessions;
typedef std::pair<uint32_t, HealthCheckInstanceService *> SessionsPair;
tbb::mutex mutex_; // lock for sessions_ access between health check & BFD
boost::shared_ptr<PktInfo> msg_;
BfdCommunicator communicator_;
BFD::Server *server_;
BFD::Client *client_;
BfdHandler handler_;
Sessions sessions_;
BfdStats stats_;
DISALLOW_COPY_AND_ASSIGN(BfdProto);
};
#endif // vnsw_agent_bfd_proto_h_
| {
"content_hash": "31e2cbbbfe3e0388945798687060d58a",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 83,
"avg_line_length": 33.94230769230769,
"alnum_prop": 0.6192634560906516,
"repo_name": "eonpatapon/contrail-controller",
"id": "b3aeaaa3decc8d290b881764cda2207aa16692ae",
"size": "3602",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/vnsw/agent/services/bfd_proto.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "722794"
},
{
"name": "C++",
"bytes": "22097574"
},
{
"name": "GDB",
"bytes": "39260"
},
{
"name": "Go",
"bytes": "47213"
},
{
"name": "Java",
"bytes": "91653"
},
{
"name": "Lua",
"bytes": "13345"
},
{
"name": "PowerShell",
"bytes": "1810"
},
{
"name": "Python",
"bytes": "7240671"
},
{
"name": "Roff",
"bytes": "41295"
},
{
"name": "Ruby",
"bytes": "13596"
},
{
"name": "Shell",
"bytes": "53994"
}
],
"symlink_target": ""
} |
package io.bxbxbai.swipeplaybar;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.support.v4.view.PagerAdapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.LinearInterpolator;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.ArrayDeque;
import java.util.Queue;
import butterknife.ButterKnife;
/**
* @author bxbxbai
*/
public class PlayCtrlBarPagerAdapter extends PagerAdapter {
private static final int NUM_SONGS = 10;
private static final int ANIMATOR_DURATION = 1000 * 10;
private LayoutInflater mInflater;
private Queue<View> mReusableViews;
public PlayCtrlBarPagerAdapter(Context context) {
mInflater = LayoutInflater.from(context);
mReusableViews = new ArrayDeque<>(NUM_SONGS);
}
@Override
public int getCount() {
return NUM_SONGS;
}
@Override
public boolean isViewFromObject(View view, Object object) {
return view == object;
}
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
if (object instanceof View) {
container.removeView((View) object);
mReusableViews.add((View) object);
}
}
@Override
public Object instantiateItem(ViewGroup container, int position) {
View v = mReusableViews.poll();
if (v == null) {
v = mInflater.inflate(R.layout.layout_music, container, false);
}
bindData(v, position);
container.addView(v);
setAnimator(v);
return v;
}
private void bindData(View v, int position) {
TextView songName = ButterKnife.findById(v, R.id.tv_song_name);
songName.setText("Try - " + position);
ImageView artistImage = ButterKnife.findById(v, R.id.iv_artist_cover);
if (position % 2 == 1) {
artistImage.setImageResource(R.drawable.adele);
} else {
artistImage.setImageResource(R.drawable.bxbxbai);
}
}
@Override
public float getPageWidth(int position) {
return 1.0f;
}
public static void setAnimator(View view) {
ObjectAnimator animator = ObjectAnimator.ofFloat(view.findViewById(R.id.iv_artist_cover), "rotation", 0f, 360f);
animator.setRepeatCount(Integer.MAX_VALUE);
animator.setDuration(ANIMATOR_DURATION);
animator.setInterpolator(new LinearInterpolator());
view.setTag(R.id.tag_animator, animator);
}
}
| {
"content_hash": "cb16216f810576a509f69048b760b18c",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 120,
"avg_line_length": 28.406593406593405,
"alnum_prop": 0.6707930367504835,
"repo_name": "0359xiaodong/SwipePlaybarDemo",
"id": "57f52d7a579cb960816388a563c3dbc70000a0fb",
"size": "2585",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/java/io/bxbxbai/swipeplaybar/PlayCtrlBarPagerAdapter.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "23467"
}
],
"symlink_target": ""
} |
goog.module('goog.delegate.delegatesTest');
goog.setTestOnly();
const delegates = goog.require('goog.delegate.delegates');
const recordFunction = goog.require('goog.testing.recordFunction');
const testSuite = goog.require('goog.testing.testSuite');
goog.require('goog.testing.jsunit');
testSuite({
shouldRunTests() {
return typeof Array.prototype.map == 'function';
},
testFunctionsActuallyCalled() {
const funcs = [
recordFunction(),
recordFunction(() => ''),
recordFunction(() => 42),
recordFunction(),
];
const assertCallCounts = (...counts) => {
assertArrayEquals(counts, funcs.map(f => f.getCallCount()));
funcs.forEach(f => f.reset());
};
assertUndefined(delegates.callFirst(funcs, f => f()));
assertCallCounts(1, 0, 0, 0);
assertEquals('', delegates.callUntilDefinedAndNotNull(funcs, f => f()));
assertCallCounts(1, 1, 0, 0);
assertEquals(42, delegates.callUntilTruthy(funcs, f => f()));
assertCallCounts(1, 1, 1, 0);
},
testResultNeverDefined() {
const funcs = [
recordFunction(),
recordFunction(),
];
const assertCallCounts = (...counts) => {
assertArrayEquals(counts, funcs.map(f => f.getCallCount()));
funcs.forEach(f => f.reset());
};
assertUndefined(delegates.callFirst(funcs, f => f()));
assertCallCounts(1, 0);
assertUndefined(delegates.callUntilDefinedAndNotNull(funcs, f => f()));
assertCallCounts(1, 1);
assertFalse(delegates.callUntilTruthy(funcs, f => f()));
assertCallCounts(1, 1);
},
});
| {
"content_hash": "290d6924eeba058763b6d728d9d003fa",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 76,
"avg_line_length": 30.25,
"alnum_prop": 0.6439923712650986,
"repo_name": "teppeis/closure-library",
"id": "89582e1865d69115c23cfed5ded14802d2949d8d",
"size": "2201",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "closure/goog/delegate/delegates_test.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "3228"
},
{
"name": "CSS",
"bytes": "114838"
},
{
"name": "Emacs Lisp",
"bytes": "2410"
},
{
"name": "HTML",
"bytes": "1244968"
},
{
"name": "JavaScript",
"bytes": "21026484"
},
{
"name": "Python",
"bytes": "82137"
},
{
"name": "Shell",
"bytes": "17215"
}
],
"symlink_target": ""
} |
About jsnap
===========
**jsnap** dumps the state of a JavaScript program after executing the top-level code, but before entering the event loop. This state can then be analyzed by other tools.
jsnap is under development. It currently seems to work, but it may have some quirks.
Usage
=====
Clone the repository then run `npm install` from the cloned repo to install the required packages.
Assuming jsnap is installed in folder `jsnap`, run the tool like this:
node jsnap/jsnap.js FILE...
where FILE is the JavaScript file whose snapshot you would like to take. You can specify multiple files; jsnap will simply concatenate them for you.
By default, the file will run in a browser-like environment (WebKit) using phantomjs. To run the file using node.js's environment, add the parameter `--runtime node`. Note that this will execute the file with full privileges, there is no sandboxing!
State Dump Format
================
A state dump is a JSON object, described in the following paragraphs.
A ''value'' in the heap dump satisfies the type:
type Value =
string | number | boolean | null | { key: number } | { isUndefined: true }
That is, all primitive JavaScript values except undefined are encoded directly, while objects are indirectly referenced using a numerical key (wrapped inside an object for unambiguity). Function objects are treated like objects in this regard. Undefined is represented as an object because JSON has no syntax for that value.
Objects in the heap are encoded in the following way:
type Obj = {
function?: UserFunc | NativeFunc | BindFunc | UnknownFunc
env?: Value
prototype?: Value
properties: Array[Property]
}
type Property = {
name: string
writeable: boolean
configurable: boolean
enumerable: boolean
value?: Value
get?: Value
set?: Value
}
type UserFunc = {
type: 'user'
id: number
}
type NativeFunc = {
type: 'native'
id: string
}
type BindFunc = {
type: 'bind'
target: Value
arguments: Array[Value]
}
type UnknownFunc = {
type: 'unknown'
}
The `Property` type corresponds to what you would get from `getOwnPropertyDescriptor`, except with the additional `name` property. The properties occur in the same order as returned by `getOwnPropertyNames`.
An object is a function if it has a `function` property. Four types of functions are supported:
- `UserFunc`: User functions are functions that have a body in the source code. The `id` field indicates which function expression, declaration, getter, or setter is the body of the function. Functions are numbered by the order in which they occur in the source code, starting with 1 (so we can use 0 to refer to the top-level, although this is never occurs in a heap dump).
- `NativeFunc`: Native functions are the built-in functions that come with the runtime environment (node.js or WebKit). These are identified by a string such as "String.prototype.substring". For platform XXX there is a canonical set of native identifiers is given in `natives-XXX.txt`.
- `BindFunc`: These functions are functions are created using `Function.prototype.bind`.
- `UnknownFunc`: These are functions not covered by any of the above. These could be functions created during a call to `eval`, by a call to `Function` or be a native function whose identifier is not canonicalized.
The `env` property is used to refer to the *enclosing environment object*. Function objects and environment objects have such a link. For user functions, it refers to the environment object that was active when the function was created (binding the free variables of the function). Environment objects also have an `env` property, which refers to the environment object one scope further up.
The `prototype` property refers to the value of the internal prototype link. This property is absent for environment objects; all plain JavaScript objects have the property, although it may have the value `null`.
A state dump consists of a heap and the key identifying the global object:
type StateDump = {
global: number
heap: Array[Obj]
}
The heap is a mapping from keys to objects, represented by an array. Keys should therefore be condensed close to 0, although any number of entries in the array may be null, for unused keys. The `global` property is the key of the global object.
How it Works
============
jsnap instruments the target JavaScript program so that it outputs its own state at the end of its top-level.
JavaScript has reflective capabilities that lets us explore the object graph, although the state of a function object is tricky to capture. Given a function object, it is not generally possible to inspect the free variables of this function (i.e. variables defined in enclosing functions).
The instrumentation rewrites local variables so they reside inside explicit "environment objects" that we can look at when dumping the state.
For example:
```javascript
function f(x) {
return function(y) {
return x + y;
}
}
var g = f(5)
```
Given a reference `g`, it is not possible to tell that `x` is bound 5.
The above code function will therefore be re-written to something like this:
```javascript
function f(x) {
var env1 = {}
env1.x = x;
var inner = function(y) {
var env2 = { env: env1 }
env2.y = y;
return env1.x + env2.y;
}
inner.env = env1;
return inner;
}
var g = f(5)
```
Given a reference to `g`, one can now inspect `g.env` to look at the enclosing variables, and see that `x` is 5. | {
"content_hash": "09758aadc25e3690ec5afedc0d85457f",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 391,
"avg_line_length": 46.040650406504064,
"alnum_prop": 0.7225852021896522,
"repo_name": "asgerf/jsnap",
"id": "c28293e0481a6058d600da3d831d0c80e1eaace0",
"size": "5663",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "5304629"
}
],
"symlink_target": ""
} |
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/privacy/dlp/v2/dlp.proto
namespace Google\Cloud\Dlp\V2;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* The field type of `value` and `field` do not need to match to be
* considered equal, but not all comparisons are possible.
* A `value` of type:
* - `string` can be compared against all other types
* - `boolean` can only be compared against other booleans
* - `integer` can be compared against doubles or a string if the string value
* can be parsed as an integer.
* - `double` can be compared against integers or a string if the string can
* be parsed as a double.
* - `Timestamp` can be compared against strings in RFC 3339 date string
* format.
* - `TimeOfDay` can be compared against timestamps and strings in the format
* of 'HH:mm:ss'.
* If we fail to compare do to type mismatch, a warning will be given and
* the condition will evaluate to false.
*
* Generated from protobuf message <code>google.privacy.dlp.v2.RecordCondition.Condition</code>
*/
class RecordCondition_Condition extends \Google\Protobuf\Internal\Message
{
/**
* Field within the record this condition is evaluated against. [required]
*
* Generated from protobuf field <code>.google.privacy.dlp.v2.FieldId field = 1;</code>
*/
private $field = null;
/**
* Operator used to compare the field or infoType to the value. [required]
*
* Generated from protobuf field <code>.google.privacy.dlp.v2.RelationalOperator operator = 3;</code>
*/
private $operator = 0;
/**
* Value to compare against. [Required, except for `EXISTS` tests.]
*
* Generated from protobuf field <code>.google.privacy.dlp.v2.Value value = 4;</code>
*/
private $value = null;
public function __construct() {
\GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce();
parent::__construct();
}
/**
* Field within the record this condition is evaluated against. [required]
*
* Generated from protobuf field <code>.google.privacy.dlp.v2.FieldId field = 1;</code>
* @return \Google\Cloud\Dlp\V2\FieldId
*/
public function getField()
{
return $this->field;
}
/**
* Field within the record this condition is evaluated against. [required]
*
* Generated from protobuf field <code>.google.privacy.dlp.v2.FieldId field = 1;</code>
* @param \Google\Cloud\Dlp\V2\FieldId $var
* @return $this
*/
public function setField($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\FieldId::class);
$this->field = $var;
return $this;
}
/**
* Operator used to compare the field or infoType to the value. [required]
*
* Generated from protobuf field <code>.google.privacy.dlp.v2.RelationalOperator operator = 3;</code>
* @return int
*/
public function getOperator()
{
return $this->operator;
}
/**
* Operator used to compare the field or infoType to the value. [required]
*
* Generated from protobuf field <code>.google.privacy.dlp.v2.RelationalOperator operator = 3;</code>
* @param int $var
* @return $this
*/
public function setOperator($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Dlp\V2\RelationalOperator::class);
$this->operator = $var;
return $this;
}
/**
* Value to compare against. [Required, except for `EXISTS` tests.]
*
* Generated from protobuf field <code>.google.privacy.dlp.v2.Value value = 4;</code>
* @return \Google\Cloud\Dlp\V2\Value
*/
public function getValue()
{
return $this->value;
}
/**
* Value to compare against. [Required, except for `EXISTS` tests.]
*
* Generated from protobuf field <code>.google.privacy.dlp.v2.Value value = 4;</code>
* @param \Google\Cloud\Dlp\V2\Value $var
* @return $this
*/
public function setValue($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\Value::class);
$this->value = $var;
return $this;
}
}
| {
"content_hash": "7d44037b2175866aa65351f1fa0710cd",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 105,
"avg_line_length": 31.4,
"alnum_prop": 0.6454352441613588,
"repo_name": "pongad/api-client-staging",
"id": "a7bc15bbfd2ca853dc9ce737e5a015057c354222",
"size": "4239",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "generated/php/google-cloud-dlp-v2/proto/src/Google/Cloud/Dlp/V2/RecordCondition_Condition.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Java",
"bytes": "10561078"
},
{
"name": "JavaScript",
"bytes": "890945"
},
{
"name": "PHP",
"bytes": "9761909"
},
{
"name": "Python",
"bytes": "1395608"
},
{
"name": "Shell",
"bytes": "592"
}
],
"symlink_target": ""
} |
<?php
namespace Sharkodlak\FluentDb\Query;
interface Query {
public function __toString();
public function dropResult();
public function executeOnce();
public function getResult();
public function isExecuted();
}
| {
"content_hash": "8935f13b2f7c93d0235f73ba526eb4e6",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 36,
"avg_line_length": 20,
"alnum_prop": 0.759090909090909,
"repo_name": "sharkodlak/fluentDb",
"id": "e970bec5ab848c28d10b06e7c6f448d9fcecb5d2",
"size": "220",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Query/Query.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "35988"
},
{
"name": "Shell",
"bytes": "535"
}
],
"symlink_target": ""
} |
class Expression;
namespace CLSmith {
class ExpressionVector : public CLExpression {
public:
// Type of vector expression.
enum VectorExprType {
kLiteral = 0,
kVariable,
kSIMD,
kBuiltIn
};
// Type of suffix access.
enum SuffixAccess {
kHi = 0,
kLo,
kEven,
kOdd
};
ExpressionVector(std::vector<std::unique_ptr<const Expression>>&& exprs,
const Type& type, int size, enum SuffixAccess suffix_access)
: CLExpression(kVector),
exprs_(std::forward<std::vector<std::unique_ptr<const Expression>>>(exprs)),
type_(type), size_(size), is_component_access_(false),
suffix_access_(suffix_access) {
}
ExpressionVector(std::vector<std::unique_ptr<const Expression>>&& exprs,
const Type& type, int size, std::vector<int> accesses)
: CLExpression(kVector),
exprs_(std::forward<std::vector<std::unique_ptr<const Expression>>>(exprs)),
type_(type), size_(size), is_component_access_(true),
accesses_(accesses) {
}
ExpressionVector(ExpressionVector&& other) = default;
ExpressionVector& operator=(ExpressionVector&& other) = default;
virtual ~ExpressionVector() {}
// Create an expression that produces a vector value.
// The expression can be a vector literal, vector variable, an operation on
// one or two vectors or calling a built-in vector function.
// The type of the expression will match 'type', if type is a scalar, or a
// vector of different length, the vector will be itemised to match.
// size will determine the length of the vector produced (before itemisation),
// it must be a valid vector length, or 0 (for a random length).
static ExpressionVector *make_random(CGContext &cg_context, const Type *type,
const CVQualifiers *qfer, int size);
// Create a vector of constant elements.
static ExpressionVector *make_constant(const Type *type, int value);
// Initialise table for selecting vector expression type. Should be called
// once on start-up.
static void InitProbabilityTable();
// Implementations of pure virtual methods in Expression. Most of these are
// trivial, as the expression evaluates to a runtime constant.
ExpressionVector *clone() const;
const Type &get_type() const { return type_; }
CVQualifiers get_qualifiers() const { return CVQualifiers(true, false); }
void get_eval_to_subexps(std::vector<const Expression*>& subs) const;
void get_referenced_ptrs(std::vector<const Variable*>& ptrs) const;
unsigned get_complexity() const;
void Output(std::ostream& out) const;
const std::vector<std::unique_ptr<const Expression>>& GetExpressions() const {
return exprs_;
}
private:
// Vector of expressions that when combined will form an OpenCL vector.
std::vector<std::unique_ptr<const Expression>> exprs_;
// Basic type of the expression, can be a scalar.
const Type& type_;
// Vector length.
const int size_;
// Vector accesses.
bool is_component_access_; // Is the access per component (i.e. vec.xy).
std::vector<int> accesses_; // If it is component accesses, which components.
enum SuffixAccess suffix_access_; // If not component, access with suffix.
DISALLOW_COPY_AND_ASSIGN(ExpressionVector);
};
} // namespace CLSmith
#endif // _CLSMITH_EXPRESSIONVECTOR_H_
| {
"content_hash": "b781a6dca2d32ecf3289f33e755489f0",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 84,
"avg_line_length": 38.275862068965516,
"alnum_prop": 0.6963963963963964,
"repo_name": "ChrisLidbury/CLSmith",
"id": "71f28b87b12b2534eb78d8635cbbc8a99b3b983d",
"size": "4387",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/CLSmith/ExpressionVector.h",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "C",
"bytes": "92650"
},
{
"name": "C++",
"bytes": "1489435"
},
{
"name": "CMake",
"bytes": "9681"
},
{
"name": "M4",
"bytes": "53811"
},
{
"name": "Makefile",
"bytes": "251551"
},
{
"name": "Perl",
"bytes": "224045"
},
{
"name": "Python",
"bytes": "17422"
},
{
"name": "Shell",
"bytes": "348306"
}
],
"symlink_target": ""
} |
<p> </p>
<div style="width: 681; height: 327; border: 1px solid #FFFFFF; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1">
<b>
<font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#CC6600">
REAL ANALYSIS</font></b><p class="MsoNormal"><font face="Verdana" size="2"><b>
The Lebesgue Integral: </b>Riemann-Stieltjes integral, Measures and measurable
sets, measurable functions, the abstract Lebesgue integral. Product measures
and Fubini's theorem. Complex measures and the lebesgue - Radon - Nikodym
theorem and its applications.</font></p>
<p class="MsoNormal"><font face="Verdana" size="2"><b>Function Spaces and Banach
Spaces: </b>
L<sup>p </sup>spaces, Abstract Banach Spaces. The conjugate spaces. Abstract
Hilbert spaces.</font></p>
<p><font face="Verdana" size="2"><b>Books</b></font></p>
<ul>
<li>
<p style="margin:0in;margin-bottom:.0001pt">
<span style="font-family: Verdana"><font size="2">Royden, H. L., Real
Analysis, The Macmillan Company, New York, 1963.</font></span></li>
<li>
<p style="margin:0in;margin-bottom:.0001pt">
<font size="2"><span style="font-family: Verdana">Rudin, W., Real and Complex
Analysis, Second Edition, Tata McGraw Hill Publishing Co. Ltd., New Delhi,
1974.</span></font></li>
<li>
<p style="margin:0in;margin-bottom:.0001pt">
<font size="2"><span style="font-family: Verdana">Rudin, W., Functional
Analysis, Tata McGraw Hill Publishing Co. Ltd., New Delhi, 1973.</span></font></li>
<li>
<p style="margin:0in;margin-bottom:.0001pt">
<font size="2"><span style="font-family: Verdana">Hewitt, E. and Stromberg,
K., Real and Abstract Analysis, Springer International Student Edition,
Springer-Verlag/Narosa Pub. House, New Delhi, 1978.</span></font></li>
</ul>
</div>
| {
"content_hash": "a447080bc0af053055a154d52947892c",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 134,
"avg_line_length": 51.57142857142857,
"alnum_prop": 0.6903047091412743,
"repo_name": "siddhartha-gadgil/www.math.iisc.ernet.in",
"id": "96ad97e7fca58642cfed995fd086c41b1112f1fe",
"size": "1813",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/courses/courses2001/realanalysis.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "16646"
},
{
"name": "HTML",
"bytes": "7363807"
},
{
"name": "JavaScript",
"bytes": "14188"
}
],
"symlink_target": ""
} |
struct timeval;
struct fd_set;
struct timezone;
| {
"content_hash": "a75409c88af44c24e2430c8547097c03",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 16,
"avg_line_length": 16,
"alnum_prop": 0.7916666666666666,
"repo_name": "chandler14362/panda3d",
"id": "7da313e913d72d8f80e4b85ae7ae178218e2e2a3",
"size": "62",
"binary": false,
"copies": "14",
"ref": "refs/heads/master",
"path": "dtool/src/parser-inc/sys/time.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "4004"
},
{
"name": "C",
"bytes": "5288285"
},
{
"name": "C++",
"bytes": "27114399"
},
{
"name": "Emacs Lisp",
"bytes": "229264"
},
{
"name": "HTML",
"bytes": "8081"
},
{
"name": "Java",
"bytes": "3113"
},
{
"name": "JavaScript",
"bytes": "7003"
},
{
"name": "Logos",
"bytes": "5504"
},
{
"name": "MAXScript",
"bytes": "1745"
},
{
"name": "NSIS",
"bytes": "61448"
},
{
"name": "Nemerle",
"bytes": "3001"
},
{
"name": "Objective-C",
"bytes": "27625"
},
{
"name": "Objective-C++",
"bytes": "258129"
},
{
"name": "Perl",
"bytes": "206982"
},
{
"name": "Perl 6",
"bytes": "27055"
},
{
"name": "Puppet",
"bytes": "2627"
},
{
"name": "Python",
"bytes": "5568942"
},
{
"name": "R",
"bytes": "421"
},
{
"name": "Roff",
"bytes": "3432"
},
{
"name": "Shell",
"bytes": "55940"
},
{
"name": "Visual Basic",
"bytes": "136"
}
],
"symlink_target": ""
} |
<?xml version="1.0"?>
<!--
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.
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>reef-examples-hdinsight</artifactId>
<name>REEF Examples on HDInsight</name>
<parent>
<groupId>org.apache.reef</groupId>
<artifactId>reef-project</artifactId>
<version>0.14.0-SNAPSHOT</version>
<relativePath>../../..</relativePath>
</parent>
<properties>
<rootPath>${basedir}/../../..</rootPath>
</properties>
<dependencies>
<!-- REEF -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>reef-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>reef-runtime-hdinsight</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>reef-examples</artifactId>
<version>${project.version}</version>
</dependency>
<!-- End of REEF -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<!-- Hadoop -->
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-common</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-client</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-api</artifactId>
<scope>compile</scope>
</dependency>
<!-- End of Hadoop -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<configLocation>lang/java/reef-common/src/main/resources/checkstyle-strict.xml</configLocation>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<outputFile>
${project.build.directory}/${project.artifactId}-${project.version}-shaded.jar
</outputFile>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>
org.apache.reef.runtime.hdinsight.cli.HDICLI
</Main-Class>
</manifestEntries>
</transformer>
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>yarn-default.xml</exclude>
<exclude>yarn-version-info.properties</exclude>
<exclude>core-default.xml</exclude>
<exclude>LICENSE</exclude>
<exclude>META-INF/*</exclude>
</excludes>
</filter>
</filters>
</configuration>
</plugin>
</plugins>
</build>
</project>
| {
"content_hash": "76fad73948f15fb702f8749068fd514e",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 119,
"avg_line_length": 38.69444444444444,
"alnum_prop": 0.5254845656855707,
"repo_name": "dafrista/incubator-reef",
"id": "1e8a9c78407938506dd69627bfd3a5c67d0dd890",
"size": "5572",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lang/java/reef-examples-hdinsight/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "2297"
},
{
"name": "C",
"bytes": "1022"
},
{
"name": "C#",
"bytes": "3760327"
},
{
"name": "C++",
"bytes": "177432"
},
{
"name": "CSS",
"bytes": "905"
},
{
"name": "Java",
"bytes": "5497449"
},
{
"name": "JavaScript",
"bytes": "3750"
},
{
"name": "Objective-C",
"bytes": "2755"
},
{
"name": "PowerShell",
"bytes": "6426"
},
{
"name": "Protocol Buffer",
"bytes": "35089"
},
{
"name": "Python",
"bytes": "20839"
},
{
"name": "Shell",
"bytes": "22281"
}
],
"symlink_target": ""
} |
from . import locales
import os
import unittest
class LocalesTest(unittest.TestCase):
def test_eq(self):
locale = locales.Locale('en_US')
self.assertEqual(locale, 'en_US')
self.assertEqual(locale, 'en_us')
self.assertEqual(locale, locales.Locale('en_US'))
if __name__ == '__main__':
unittest.main()
| {
"content_hash": "1100d95b482c391a7f38cff9d9ccbdac",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 53,
"avg_line_length": 20.25,
"alnum_prop": 0.6697530864197531,
"repo_name": "vitorio/pygrow",
"id": "297cd4a01c3c4dbbd9ceec0de0566d02c73340cb",
"size": "324",
"binary": false,
"copies": "1",
"ref": "refs/heads/objstoreurls2",
"path": "grow/pods/locales_test.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "177"
},
{
"name": "HTML",
"bytes": "4287"
},
{
"name": "Python",
"bytes": "243109"
},
{
"name": "Shell",
"bytes": "2577"
}
],
"symlink_target": ""
} |
from behave import *
import os, shutil
from bottle import request
from images import api, scanner, location, entry, tag, user, import_job, delete, export_job
from images.setup import Setup
@given('a system specified by "{ini_file}"')
def step_impl(context, ini_file):
try:
shutil.rmtree('/tmp/images_behave')
except:
pass
os.mkdir('/tmp/images_behave')
context.setup = Setup(os.path.join('features', ini_file))
context.setup.create_database_tables()
context.setup.add_users()
context.setup.add_locations()
context.setup.add_tags()
def tear_down(context):
context.setup = None
request.user = None
shutil.rmtree('/tmp/images_behave')
context.tear_down_scenario.append(tear_down)
| {
"content_hash": "54f3478e87096844530a9f12d5a96350",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 91,
"avg_line_length": 29.423076923076923,
"alnum_prop": 0.6745098039215687,
"repo_name": "eblade/images4",
"id": "9a3e675e80e17dfc4975f09385976654445c7b46",
"size": "765",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "features/steps/system.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3114"
},
{
"name": "Cucumber",
"bytes": "8644"
},
{
"name": "HTML",
"bytes": "26093"
},
{
"name": "JavaScript",
"bytes": "19102"
},
{
"name": "Python",
"bytes": "225920"
}
],
"symlink_target": ""
} |
require 'test_helper'
class CodeSetTest < ActiveSupport::TestCase
setup do
dump_database
end
test "Should be able to add codes to a code_set" do
cs = FactoryGirl.create(:annulled_marital_status_code)
cs.reload
full_codes = cs.codes
assert_equal full_codes.keys.length , 1
codes = cs.get_code_system("MaritalStatusCodes")
assert_equal codes.length, 1
cs.add_code("MaritalStatusCodes","AA")
codes = cs.get_code_system("MaritalStatusCodes")
assert_equal codes.length, 2
cs.add_code("MaritalStatusCodes2","A")
codes = cs.get_code_system("MaritalStatusCodes2")
assert_equal codes.length, 1
end
test "Should be able to Remove codes from a set " do
cs = FactoryGirl.create(:annulled_marital_status_code)
cs.reload
full_codes = cs.codes
assert_equal full_codes.keys.length , 1
codes = cs.get_code_system("MaritalStatusCodes")
assert_equal codes.length, 1
cs.remove_code("MaritalStatusCodes", "A")
codes = cs.get_code_system("MaritalStatusCodes")
assert_equal codes.length, 0
end
test "Should be able to Remove all codes from a code system from a code set" do
cs = FactoryGirl.create(:annulled_marital_status_code)
cs.reload
full_codes = cs.codes
assert_equal full_codes.keys.length , 1
codes = cs.get_code_system("MaritalStatusCodes")
assert_equal codes.length, 1
cs.remove_code_system("MaritalStatusCodes")
codes = cs.codes
assert_equal codes["MaritalStatusCodes"], nil
end
end
| {
"content_hash": "e7eca64e01ff302feb7b0c80b41306c0",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 81,
"avg_line_length": 27.17543859649123,
"alnum_prop": 0.6868947708198838,
"repo_name": "scoophealth/query-composer",
"id": "3ea80d7a09e68e0d8e0acee10a5ee925788e1e64",
"size": "1549",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "test/unit/code_set_test.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "29073"
},
{
"name": "CoffeeScript",
"bytes": "21961"
},
{
"name": "HTML",
"bytes": "1290046"
},
{
"name": "JavaScript",
"bytes": "296994"
},
{
"name": "Python",
"bytes": "9099"
},
{
"name": "Ruby",
"bytes": "172899"
},
{
"name": "Shell",
"bytes": "14146"
}
],
"symlink_target": ""
} |
package delta
import java.util.concurrent.ArrayBlockingQueue
import scala.concurrent.{ Future, Promise, TimeoutException }
import scala.concurrent.duration.{ DurationInt, FiniteDuration }
import scala.reflect.ClassTag
import scala.util.{ Failure, Success, Try }
import org.bson.{ BsonReader, BsonWriter, UuidRepresentation }
import org.bson.codecs._
import com.mongodb.async.SingleResultCallback
import java.util.UUID
import org.bson._
import org.bson.types.Decimal128
import scala.jdk.CollectionConverters._
import org.bson.types.ObjectId
package object mongo {
implicit def tuple2Codec[A: Codec, B: Codec] = new Codec[(A, B)] {
def getEncoderClass = classOf[Tuple2[_, _]].asInstanceOf[Class[Tuple2[A, B]]]
def encode(writer: BsonWriter, value: (A, B), encoderContext: EncoderContext): Unit = {
writer.writeStartArray()
implicitly[Codec[A]].encode(writer, value._1, encoderContext)
implicitly[Codec[B]].encode(writer, value._2, encoderContext)
writer.writeEndArray()
}
def decode(reader: BsonReader, decoderContext: DecoderContext): (A, B) = {
reader.readStartArray()
val a: A = implicitly[Codec[A]].decode(reader, decoderContext)
val b: B = implicitly[Codec[B]].decode(reader, decoderContext)
reader.readEndArray()
a -> b
}
}
implicit val objectIdCodec = new ObjectIdCodec
implicit val uuidCodec: Codec[UUID] = new UuidCodec(UuidRepresentation.STANDARD)
implicit val stringCodec: Codec[String] = new StringCodec
implicit val intCodec = new IntegerCodec().asInstanceOf[Codec[Int]]
implicit val longCodec = new LongCodec().asInstanceOf[Codec[Long]]
implicit val unitCodec = new Codec[Unit] {
def getEncoderClass = classOf[Unit]
def encode(writer: BsonWriter, value: Unit, encoderContext: EncoderContext): Unit = {
writer.writeUndefined()
}
def decode(reader: BsonReader, decoderContext: DecoderContext): Unit = {
reader.readUndefined()
}
}
implicit def JavaEnumCodec[E <: java.lang.Enum[E]: ClassTag] = new JavaEnumCodec[E]
def ScalaEnumCodec[E <: Enumeration](enum: E): Codec[E#Value] = new Codec[E#Value] {
val getEncoderClass = enum.values.head.getClass.asInstanceOf[Class[E#Value]]
private[this] val byName = enum.values.foldLeft(Map.empty[String, E#Value]) {
case (map, enum) => map.updated(enum.toString, enum)
}
def encode(writer: BsonWriter, value: E#Value, encoderContext: EncoderContext): Unit = {
stringCodec.encode(writer, value.toString, encoderContext)
}
def decode(reader: BsonReader, decoderContext: DecoderContext): E#Value = {
byName apply stringCodec.decode(reader, decoderContext)
}
}
implicit def toBson(oid: ObjectId): BsonValue = if (oid == null) BsonNull.VALUE else new BsonObjectId(oid)
implicit def toBson(uuid: UUID): BsonValue = if (uuid == null) BsonNull.VALUE else new BsonBinary(uuid)
implicit def toBson(bytes: Array[Byte]): BsonValue = if (bytes == null) BsonNull.VALUE else new BsonBinary(bytes)
implicit def toBson(int: Int): BsonInt32 = new BsonInt32(int)
implicit def toBson(long: Long): BsonInt64 = new BsonInt64(long)
implicit def toBson(bool: Boolean): BsonBoolean = if (bool) BsonBoolean.TRUE else BsonBoolean.FALSE
implicit def toBson(str: String): BsonValue = if (str == null) BsonNull.VALUE else new BsonString(str)
implicit def toBson(dbl: Double): BsonValue = new BsonDouble(dbl)
implicit def toBson(flt: Float): BsonValue = new BsonDouble(flt)
implicit def toBson(bd: BigDecimal): BsonValue = if (bd == null) BsonNull.VALUE else toBson(bd.underlying)
implicit def toBson(bd: java.math.BigDecimal): BsonValue = if (bd == null) BsonNull.VALUE else new BsonDecimal128(new Decimal128(bd))
implicit def toBson[B](iter: Iterable[B])(implicit toBsonValue: B => BsonValue): BsonValue =
if (iter == null) BsonNull.VALUE
else iter.foldLeft(new BsonArray) {
case (arr, bv) =>
arr.add(bv)
arr
}
implicit def fromBsonToInt(bson: BsonValue): Int = bson.asInt32
implicit def fromBsonToInt(bson: BsonInt32): Int = bson.getValue
implicit def fromBsonToLong(bson: BsonValue): Long = bson.asInt64
implicit def fromBsonToLong(bson: BsonInt64): Long = bson.getValue
implicit def fromBsonToString(bson: BsonValue): String = bson.asString
implicit def fromBsonToString(bson: BsonString): String = bson.getValue
implicit def fromBsonToBoolean(bson: BsonValue): Boolean = bson.asBoolean
implicit def fromBsonToBoolean(bson: BsonBoolean): Boolean = bson.getValue
implicit def fromBsonToIterable[T](bson: BsonValue)(implicit toT: BsonValue => T): Iterable[T] = fromBsonToIterable[T](bson.asArray)
implicit def fromBsonToIterable[T](bson: BsonArray)(implicit toT: BsonValue => T): Iterable[T] =
bson.getValues.asScala.map(toT)
implicit def fromBsonToDouble(bson: BsonValue): Double = bson.asDouble
implicit def fromBsonToDouble(bson: BsonDouble): Double = bson.getValue
implicit def fromBsonToFloat(bson: BsonValue): Float = bson.asDouble
implicit def fromBsonToFloat(bson: BsonDouble): Float = bson.getValue.asInstanceOf[Float]
implicit def fromBsonToByteArray(bson: BsonValue): Array[Byte] = bson.asBinary
implicit def fromBsonToByteArray(bson: BsonBinary): Array[Byte] = bson.getData
implicit def fromBsonToBigDecimal(bson: BsonValue): BigDecimal = bson.asDecimal128
implicit def fromBsonToBigDecimal(bson: BsonDecimal128): BigDecimal = BigDecimal(bson.getValue.bigDecimalValue)
def withFutureCallback[R](
thunk: (=> SingleResultCallback[R]) => Unit): Future[Option[R]] = {
val promise = Promise[Option[R]]()
var used = false
def callback = if (!used) new SingleResultCallback[R] {
used = true
def onResult(result: R, t: Throwable): Unit = {
if (t != null) promise failure t
else promise success Option(result)
}
}
else throw new IllegalStateException("Cannot use callback multiple times")
thunk(callback)
promise.future
}
def withBlockingCallback[R](
timeout: FiniteDuration = 30.seconds)(
thunk: (=> SingleResultCallback[R]) => Unit): Option[R] = {
val queue = new ArrayBlockingQueue[Try[R]](1)
var used = false
def callback = if (!used) new SingleResultCallback[R] {
used = true
def onResult(result: R, t: Throwable): Unit = {
if (t != null) queue offer Failure(t)
else queue offer Success(result)
}
}
else throw new IllegalStateException("Cannot use callback multiple times")
thunk(callback)
queue.poll(timeout.length, timeout.unit) match {
case null => throw new TimeoutException("Timed out waiting for callback")
case result => Option(result.get)
}
}
implicit val codec4Bin: scuff.Codec[Array[Byte], BsonValue] = new scuff.Codec[Array[Byte], BsonValue] {
def encode(bytes: Array[Byte]) = new BsonBinary(bytes)
def decode(bson: BsonValue): Array[Byte] = bson.asBinary().getData
}
implicit val codec4ObjectId: scuff.Codec[ObjectId, BsonValue] = new scuff.Codec[ObjectId, BsonValue] {
def encode(a: ObjectId) = new BsonObjectId(a)
def decode(b: BsonValue) = b.asObjectId.getValue
}
implicit val codec4Uuid: scuff.Codec[UUID, BsonValue] = new scuff.Codec[UUID, BsonValue] {
def encode(a: UUID) = new BsonBinary(a)
def decode(b: BsonValue) = b.asBinary.asUuid
}
implicit val codec4String: scuff.Codec[String, BsonValue] = new scuff.Codec[String, BsonValue] {
def encode(a: String) = new BsonString(a)
def decode(b: BsonValue) = b.asString.getValue
}
implicit val codec4Int: scuff.Codec[Int, BsonValue] = new scuff.Codec[Int, BsonValue] {
def encode(a: Int) = new BsonInt32(a)
def decode(b: BsonValue) = b.asInt32.intValue
}
implicit val codec4Long: scuff.Codec[Long, BsonValue] = new scuff.Codec[Long, BsonValue] {
def encode(a: Long) = new BsonInt64(a)
def decode(b: BsonValue) = b.asInt64.longValue
}
}
| {
"content_hash": "4b1cbe078054e8e2e1493d843faa7c96",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 135,
"avg_line_length": 47.81437125748503,
"alnum_prop": 0.7148403256105197,
"repo_name": "nilskp/ulysses",
"id": "35af830e5b3a094dc876231c4b6e8589c4f6e607",
"size": "7985",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "delta-mongodb/src/main/scala/delta/mongo/package.scala",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Scala",
"bytes": "177362"
}
],
"symlink_target": ""
} |
require 'rubygems'
require 'shoulda/matchers'
require 'booker_ruby'
require 'carmen'
Time.zone = 'UTC'
Booker.config[:log_message] = -> (message, extra_info) { true }
Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f}
| {
"content_hash": "452e4c24918862c81342525c81e9ad07",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 69,
"avg_line_length": 20.166666666666668,
"alnum_prop": 0.6611570247933884,
"repo_name": "HireFrederick/booker_ruby",
"id": "961415089109d3cb79d4a02ac4cf1a22e8bea635",
"size": "242",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/spec_helper.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "232"
},
{
"name": "Ruby",
"bytes": "234243"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_111) on Thu Mar 16 20:08:30 EET 2017 -->
<title>spaceinvaders.exceptions Class Hierarchy</title>
<meta name="date" content="2017-03-16">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="spaceinvaders.exceptions Class Hierarchy";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li>Class</li>
<li class="navBarCell1Rev">Tree</li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-all.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../spaceinvaders/command/server/package-tree.html">Prev</a></li>
<li><a href="../../spaceinvaders/game/package-tree.html">Next</a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?spaceinvaders/exceptions/package-tree.html" target="_top">Frames</a></li>
<li><a href="package-tree.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">
<h1 class="title">Hierarchy For Package spaceinvaders.exceptions</h1>
<span class="packageHierarchyLabel">Package Hierarchies:</span>
<ul class="horizontal">
<li><a href="../../overview-tree.html">All Packages</a></li>
</ul>
</div>
<div class="contentContainer">
<h2 title="Class Hierarchy">Class Hierarchy</h2>
<ul>
<li type="circle">java.lang.Object
<ul>
<li type="circle">java.lang.Throwable (implements java.io.Serializable)
<ul>
<li type="circle">java.lang.Exception
<ul>
<li type="circle">spaceinvaders.exceptions.<a href="../../spaceinvaders/exceptions/CommandNotFoundException.html" title="class in spaceinvaders.exceptions"><span class="typeNameLink">CommandNotFoundException</span></a></li>
<li type="circle">spaceinvaders.exceptions.<a href="../../spaceinvaders/exceptions/InvalidServerAddressException.html" title="class in spaceinvaders.exceptions"><span class="typeNameLink">InvalidServerAddressException</span></a></li>
<li type="circle">spaceinvaders.exceptions.<a href="../../spaceinvaders/exceptions/InvalidUserNameException.html" title="class in spaceinvaders.exceptions"><span class="typeNameLink">InvalidUserNameException</span></a></li>
<li type="circle">java.io.IOException
<ul>
<li type="circle">spaceinvaders.exceptions.<a href="../../spaceinvaders/exceptions/SocketOpeningException.html" title="class in spaceinvaders.exceptions"><span class="typeNameLink">SocketOpeningException</span></a></li>
</ul>
</li>
<li type="circle">java.lang.RuntimeException
<ul>
<li type="circle">java.lang.IllegalArgumentException
<ul>
<li type="circle">spaceinvaders.exceptions.<a href="../../spaceinvaders/exceptions/IllegalPortNumberException.html" title="class in spaceinvaders.exceptions"><span class="typeNameLink">IllegalPortNumberException</span></a></li>
</ul>
</li>
</ul>
</li>
<li type="circle">spaceinvaders.exceptions.<a href="../../spaceinvaders/exceptions/ServerNotFoundException.html" title="class in spaceinvaders.exceptions"><span class="typeNameLink">ServerNotFoundException</span></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li>Class</li>
<li class="navBarCell1Rev">Tree</li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-all.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../spaceinvaders/command/server/package-tree.html">Prev</a></li>
<li><a href="../../spaceinvaders/game/package-tree.html">Next</a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?spaceinvaders/exceptions/package-tree.html" target="_top">Frames</a></li>
<li><a href="package-tree.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>
| {
"content_hash": "8739dc5d01de2e28338709e134187475",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 233,
"avg_line_length": 37.19375,
"alnum_prop": 0.6691312384473198,
"repo_name": "apetenchea/SpaceInvaders",
"id": "977e3d299d0df5e6518863f10fae8e93c42d271a",
"size": "5951",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/spaceinvaders/exceptions/package-tree.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "200257"
},
{
"name": "Shell",
"bytes": "227"
}
],
"symlink_target": ""
} |
package dao
import (
"context"
"fmt"
"strings"
"time"
"go-common/app/service/openplatform/anti-fraud/model"
"go-common/library/database/sql"
"go-common/library/log"
"go-common/library/xstr"
)
const (
_getQusSQL = "SELECT question_id ,question_type,answer_type,question_name,question_bank_id,difficulty,is_deleted FROM question where question_id=? and is_deleted =0 "
_addQusSQL = "INSERT INTO question(question_id ,question_type,answer_type,question_name,question_bank_id,difficulty) VALUES(?,?,?,?,?,?)"
_getQuslistBywhereSQL = "SELECT question_id ,question_type,answer_type,question_name,question_bank_id,difficulty,is_deleted FROM question where is_deleted = 0 and question_bank_id = ? order by id desc limit ? ,? "
_getAllQusByBankID = "SELECT question_id FROM question WHERE question_bank_id = ? AND is_deleted = 0"
_getQuslistSQL = "SELECT question_id ,question_type,answer_type,question_name,question_bank_id,difficulty,is_deleted FROM question where is_deleted = ? limit ? ,? "
_getQusCntSQL = "SELECT COUNT(*) FROM question where is_deleted = 0 "
_delQusSQL = "UPDATE question set is_deleted = ? where question_id =? "
_updateQusSQL = "UPDATE question set question_type = ? ,answer_type=? ,question_name = ? , question_bank_id = ? ,difficulty = ? where question_id =? and is_deleted =0 "
_addAnswerSQL = "INSERT INTO question_answer(answer_id ,question_id,answer_content,is_correct ) VALUES(?,?,?,?)"
_multyAddAnswerSQL = "INSERT INTO question_answer(answer_id ,question_id,answer_content,is_correct ) VALUES %s "
_updateAnswerSQL = "UPDATE question_answer set answer_content = ? , is_correct =? , is_deleted =0 where answer_id = ? "
_delAnswerSQL = "UPDATE question_answer set is_deleted = 1 where question_id =? "
_getAnswerListSQL = "select answer_id ,question_id, answer_content,is_correct from question_answer where question_id =? and is_deleted =0 "
_addUserAnswerSQL = "INSERT INTO question_user_answer(uid ,question_id,platform,source,answers,is_correct ) VALUES(?,?,?,?,?,?)"
_checkAnswerSQL = "SELECT count(1) from question_answer where is_correct =1 and question_id = ? and answer_id IN(%s) "
_getRandomPicSQL = "SELECT x,y,src from question_verify_pic where id =? "
_getListPicSQL = "SELECT id from question_verify_pic limit ? ,? "
_getPicCntSQL = "SELECT COUNT(*) FROM question_verify_pic "
)
// GetQusInfo info
func (d *Dao) GetQusInfo(c context.Context, qid int64) (oi *model.Question, err error) {
oi = &model.Question{}
row := d.db.QueryRow(c, _getQusSQL, qid)
if err = row.Scan(&oi.QsID, &oi.QsType, &oi.AnswerType, &oi.QsName, &oi.QsBId, &oi.QsDif, &oi.IsDeleted); err != nil {
if err == sql.ErrNoRows {
oi = nil
err = nil
} else {
log.Error("row.Scan error(%v)", err)
}
}
return
}
// InsertQus add
func (d *Dao) InsertQus(c context.Context, oi *model.Question) (lastID int64, err error) {
res, err := d.db.Exec(c, _addQusSQL, oi.QsID, oi.QsType, oi.AnswerType, oi.QsName, oi.QsBId, oi.QsDif)
if err != nil {
log.Error("[dao.question|GetQusList] d.db.Query err: %v", err)
return
}
lastID, err = res.LastInsertId()
return
}
// GetQusList list
func (d *Dao) GetQusList(c context.Context, offset int, limitnum int, qBid int64) (res []*model.Question, err error) {
res = make([]*model.Question, 0)
_sql := _getQuslistSQL
if qBid > 0 {
_sql = _getQuslistBywhereSQL
}
rows, err := d.db.Query(c, _sql, qBid, offset, limitnum)
if err != nil {
log.Error("[dao.question|GetQusList] d.db.Query err: %v %d,%d", err, offset, limitnum)
return
}
defer rows.Close()
for rows.Next() {
oi := &model.Question{}
if err = rows.Scan(&oi.QsID, &oi.QsType, &oi.AnswerType, &oi.QsName, &oi.QsBId, &oi.QsDif, &oi.IsDeleted); err != nil {
log.Error("[dao.question|GetOrder] rows.Scan err: %v", res)
return
}
res = append(res, oi)
}
return
}
// GetQusIds ids
func (d *Dao) GetQusIds(c context.Context, bankID int64) (ids []int64, err error) {
if ids = d.GetBankQuestionsCache(c, bankID); len(ids) > 1 {
return
}
rows, err := d.db.Query(c, _getAllQusByBankID, bankID)
if err != nil {
log.Error("d.GetQusIds(%d) error(%v)", bankID, err)
return
}
defer rows.Close()
for rows.Next() {
var temp int64
if err = rows.Scan(&temp); err != nil {
log.Error("d.GetQusIds(%d) rows.Scan() error(%v)", bankID, err)
return
}
ids = append(ids, temp)
}
d.SetBankQuestionsCache(c, bankID, ids)
return
}
// DelQus del
func (d *Dao) DelQus(c context.Context, qid int64) (affect int64, err error) {
res, err := d.db.Exec(c, _delQusSQL, 1, qid)
if err != nil {
log.Error("d.DelQus(qbid:%d, dmid:%d) error(%v)", qid, 1, err)
return
}
return res.RowsAffected()
}
// UpdateQus update
func (d *Dao) UpdateQus(c context.Context, update *model.ArgUpdateQus, answers []model.Answer) (affect int64, err error) {
res, err := d.db.Exec(c, _updateQusSQL, update.Type, update.AnType, update.Name, update.BId, update.Dif, update.QsID)
if err != nil {
log.Error("d.UpdateQus(qbid:%d, dmid:%d) error(%v)", update.QsID, update.QsID, err)
return
}
return res.RowsAffected()
}
// GetQusCount cnt
func (d *Dao) GetQusCount(c context.Context, bid int64) (total int64, err error) {
var cntSQL string
if bid == 0 {
cntSQL = _getQusCntSQL
err = d.db.QueryRow(c, cntSQL).Scan(&total)
} else {
cntSQL = _getQusCntSQL + "and question_bank_id = ?"
err = d.db.QueryRow(c, cntSQL, bid).Scan(&total)
}
if err != nil {
log.Error("d.GetQusCount error(%v)", err)
return
}
return
}
// InserAnwser add
func (d *Dao) InserAnwser(c context.Context, answer *model.AnswerAdd) (affect int64, err error) {
res, err := d.db.Exec(c, _addAnswerSQL, answer.AnswerID, answer.QsID, answer.AnswerContent, answer.IsCorrect)
if err != nil {
log.Error("d.InserAnwser() error(%v)", err)
return
}
affect, err = res.LastInsertId()
return
}
// MultiAddAnwser add
func (d *Dao) MultiAddAnwser(c context.Context, answers []*model.AnswerAdd) (err error) {
length := len(answers)
if length == 0 {
return
}
values := strings.Trim(strings.Repeat("(?, ?, ?, ?),", length), ",")
args := make([]interface{}, 0)
for _, ins := range answers {
AnswerID := time.Now().UnixNano() / 1e6
time.Sleep(time.Millisecond)
args = append(args, AnswerID, ins.QsID, ins.AnswerContent, ins.IsCorrect)
}
_, err = d.db.Exec(c, fmt.Sprintf(_multyAddAnswerSQL, values), args...)
if err != nil {
log.Error("d.InserAnwser() error(%v)", err)
return
}
return
}
// UpdateAnwser upd
func (d *Dao) UpdateAnwser(c context.Context, answer *model.AnswerAdd) (affect int64, err error) {
res, err := d.db.Exec(c, _updateAnswerSQL, answer.AnswerContent, answer.IsCorrect, answer.AnswerID)
if err != nil {
log.Error("d.UpdateAnwser() error(%v)", err)
return
}
affect, err = res.RowsAffected()
return
}
// DelAnwser del
func (d *Dao) DelAnwser(c context.Context, qusID int64) (affect int64, err error) {
res, err := d.db.Exec(c, _delAnswerSQL, qusID)
if err != nil {
log.Error("d.UpdateAnwser() error(%v)", err)
return
}
affect, err = res.RowsAffected()
return
}
// GetAnswerList list
func (d *Dao) GetAnswerList(c context.Context, qusID int64) (res []*model.Answer, err error) {
res = make([]*model.Answer, 0)
rows, err := d.db.Query(c, _getAnswerListSQL, qusID)
if err != nil {
log.Error("[dao.GetAnswerList] d.db.Query err: %v", err)
return
}
defer rows.Close()
for rows.Next() {
oi := &model.Answer{}
if err = rows.Scan(&oi.AnswerID, &oi.QsID, &oi.AnswerContent, &oi.IsCorrect); err != nil {
log.Error("[dao.question|GetOrder] rows.Scan err: %v", res)
return
}
res = append(res, oi)
}
return
}
// AddUserAnwser add
func (d *Dao) AddUserAnwser(c context.Context, answer *model.ArgCheckAnswer, isCorrect int8) (affect int64, err error) {
ids := xstr.JoinInts(answer.Answers)
res, err := d.db.Exec(c, _addUserAnswerSQL, answer.UID, answer.QsID, answer.Platform, answer.Source, ids, isCorrect)
if err != nil {
log.Error("d.InserAnwser() error(%v)", err)
return
}
affect, err = res.LastInsertId()
return
}
// CheckAnswer check
func (d *Dao) CheckAnswer(c context.Context, qsid int64, ids []int64) (total int, err error) {
err = d.db.QueryRow(c, fmt.Sprintf(_checkAnswerSQL, xstr.JoinInts(ids)), qsid).Scan(&total)
if err != nil {
log.Error("d.GetQusBankCount error(%v)", err)
return
}
return
}
// GetRandomPic get
func (d *Dao) GetRandomPic(c context.Context, id int) (oi *model.QuestBkPic, err error) {
oi = &model.QuestBkPic{}
row := d.db.QueryRow(c, _getRandomPicSQL, id)
if err = row.Scan(&oi.X, &oi.Y, &oi.Src); err != nil {
if err == sql.ErrNoRows {
oi = nil
err = nil
} else {
log.Error("row.Scan error(%v)", err)
}
}
return
}
// GetAllPicIds ids
func (d *Dao) GetAllPicIds(c context.Context, offset int, limitnum int) (ids []int, err error) {
rows, err := d.db.Query(c, _getListPicSQL, offset, limitnum)
if err != nil {
log.Error("[dao.GetAllPicIds] d.db.Query err: %v %d,%d", err, offset, limitnum)
return
}
defer rows.Close()
for rows.Next() {
var oi int
if err = rows.Scan(&oi); err != nil {
log.Error("[dao.question|GetOrder] rows.Scan err: %v", ids)
return
}
ids = append(ids, oi)
}
return
}
// GetPicCount cnt
func (d *Dao) GetPicCount(c context.Context) (total int, err error) {
err = d.db.QueryRow(c, _getPicCntSQL).Scan(&total)
if err != nil {
log.Error("d.GetQusCount error(%v)", err)
return
}
return
}
| {
"content_hash": "93cb7f62057a3b638722668038f2358e",
"timestamp": "",
"source": "github",
"line_count": 299,
"max_line_length": 219,
"avg_line_length": 32.013377926421406,
"alnum_prop": 0.6634977016297534,
"repo_name": "LQJJ/demo",
"id": "762e029d6ace8fb60257ef45488169c9cbf3aa9d",
"size": "9572",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "126-go-common-master/app/service/openplatform/anti-fraud/dao/question.go",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "5910716"
},
{
"name": "C++",
"bytes": "113072"
},
{
"name": "CSS",
"bytes": "10791"
},
{
"name": "Dockerfile",
"bytes": "934"
},
{
"name": "Go",
"bytes": "40121403"
},
{
"name": "Groovy",
"bytes": "347"
},
{
"name": "HTML",
"bytes": "359263"
},
{
"name": "JavaScript",
"bytes": "545384"
},
{
"name": "Makefile",
"bytes": "6671"
},
{
"name": "Mathematica",
"bytes": "14565"
},
{
"name": "Objective-C",
"bytes": "14900720"
},
{
"name": "Objective-C++",
"bytes": "20070"
},
{
"name": "PureBasic",
"bytes": "4152"
},
{
"name": "Python",
"bytes": "4490569"
},
{
"name": "Ruby",
"bytes": "44850"
},
{
"name": "Shell",
"bytes": "33251"
},
{
"name": "Swift",
"bytes": "463286"
},
{
"name": "TSQL",
"bytes": "108861"
}
],
"symlink_target": ""
} |
/**
* Contient toutes les énumérations des paramètres requis pour certaines méthodes.
* @author "Pitton Olivier <olivier dot pitton at gmail dot com>"
*
*/
package fr.mailjet.rest.parameters; | {
"content_hash": "e30848b085b5ce76a0bac2eea1984032",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 82,
"avg_line_length": 32.5,
"alnum_prop": 0.7538461538461538,
"repo_name": "olivier-pitton/mailjet",
"id": "4067e445c7e9deaa6049a2ce2a1c1032b6673b9e",
"size": "199",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Mailjet-REST/src/main/java/fr/mailjet/rest/parameters/package-info.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "270287"
}
],
"symlink_target": ""
} |
#include <dae/daeDom.h>
#include <dom/domCg_setuser_type.h>
#include <dae/daeMetaCMPolicy.h>
#include <dae/daeMetaSequence.h>
#include <dae/daeMetaChoice.h>
#include <dae/daeMetaGroup.h>
#include <dae/daeMetaAny.h>
#include <dae/daeMetaElementAttribute.h>
daeElementRef
domCg_setuser_type::create(daeInt bytes)
{
domCg_setuser_typeRef ref = new(bytes) domCg_setuser_type;
return ref;
}
daeMetaElement *
domCg_setuser_type::registerElement()
{
if ( _Meta != NULL ) return _Meta;
_Meta = new daeMetaElement;
_Meta->setName( "cg_setuser_type" );
_Meta->registerClass(domCg_setuser_type::create, &_Meta);
daeMetaCMPolicy *cm = NULL;
daeMetaElementAttribute *mea = NULL;
cm = new daeMetaChoice( _Meta, cm, 0, 0, 1 );
cm = new daeMetaChoice( _Meta, cm, 0, 1, -1 );
mea = new daeMetaElementArrayAttribute( _Meta, cm, 0, 1, 1 );
mea->setName( "cg_param_type" );
mea->setOffset( daeOffsetOf(domCg_setuser_type,elemCg_param_type_array) );
mea->setElementType( domCg_param_type::registerElement() );
cm->appendChild( new daeMetaGroup( mea, _Meta, cm, 0, 1, 1 ) );
mea = new daeMetaElementArrayAttribute( _Meta, cm, 0, 1, 1 );
mea->setName( "array" );
mea->setOffset( daeOffsetOf(domCg_setuser_type,elemArray_array) );
mea->setElementType( domCg_setarray_type::registerElement() );
cm->appendChild( mea );
mea = new daeMetaElementArrayAttribute( _Meta, cm, 0, 1, 1 );
mea->setName( "usertype" );
mea->setOffset( daeOffsetOf(domCg_setuser_type,elemUsertype_array) );
mea->setElementType( domCg_setuser_type::registerElement() );
cm->appendChild( mea );
mea = new daeMetaElementArrayAttribute( _Meta, cm, 0, 1, 1 );
mea->setName( "connect_param" );
mea->setOffset( daeOffsetOf(domCg_setuser_type,elemConnect_param_array) );
mea->setElementType( domCg_connect_param::registerElement() );
cm->appendChild( mea );
cm->setMaxOrdinal( 0 );
cm->getParent()->appendChild( cm );
cm = cm->getParent();
mea = new daeMetaElementArrayAttribute( _Meta, cm, 3001, 1, -1 );
mea->setName( "setparam" );
mea->setOffset( daeOffsetOf(domCg_setuser_type,elemSetparam_array) );
mea->setElementType( domCg_setparam::registerElement() );
cm->appendChild( mea );
cm->setMaxOrdinal( 0 );
_Meta->setCMRoot( cm );
// Ordered list of sub-elements
_Meta->addContents(daeOffsetOf(domCg_setuser_type,_contents));
_Meta->addContentsOrder(daeOffsetOf(domCg_setuser_type,_contentsOrder));
// Add attribute: name
{
daeMetaAttribute *ma = new daeMetaAttribute;
ma->setName( "name" );
ma->setType( daeAtomicType::get("Cg_identifier"));
ma->setOffset( daeOffsetOf( domCg_setuser_type , attrName ));
ma->setContainer( _Meta );
ma->setIsRequired( true );
_Meta->appendAttribute(ma);
}
// Add attribute: source
{
daeMetaAttribute *ma = new daeMetaAttribute;
ma->setName( "source" );
ma->setType( daeAtomicType::get("xsNCName"));
ma->setOffset( daeOffsetOf( domCg_setuser_type , attrSource ));
ma->setContainer( _Meta );
ma->setIsRequired( true );
_Meta->appendAttribute(ma);
}
_Meta->setElementSize(sizeof(domCg_setuser_type));
_Meta->validate();
return _Meta;
}
daeMetaElement * domCg_setuser_type::_Meta = NULL;
| {
"content_hash": "a906c91a7c2bb51226c1f2f0f9464af9",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 76,
"avg_line_length": 29.072727272727274,
"alnum_prop": 0.6966854283927455,
"repo_name": "palestar/medusa",
"id": "6ac9b6f28e5347ef5ee5aeec61ac4a3309596f49",
"size": "3832",
"binary": false,
"copies": "2",
"ref": "refs/heads/develop",
"path": "ThirdParty/bullet-2.75/Extras/COLLADA_DOM/src/1.4/dom/domCg_setuser_type.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "864803"
},
{
"name": "C++",
"bytes": "12938688"
},
{
"name": "Clarion",
"bytes": "80976"
},
{
"name": "Lua",
"bytes": "4055"
},
{
"name": "Makefile",
"bytes": "37934"
},
{
"name": "Objective-C",
"bytes": "3178"
},
{
"name": "R",
"bytes": "3909"
},
{
"name": "Shell",
"bytes": "4892"
}
],
"symlink_target": ""
} |
<?php
include_once('/kunden/homepages/0/d643120834/htdocs/config/index.php');
require(ROOT.'inc/conn.php');
$config = new Blog();
$current_page = 0;
$site = $config->getSiteData($config->site);
$site['media']['photos'] = $config->getPhotoAds($site['creator'], 'current-promo',1);
$todays_date = date('Y-m-d');
$result = $conn->query('select * from twitter_data WHERE timestamp LIKE "%'.$todays_date.'%" ORDER BY `id` DESC');
$numb_soms_sent = count($result->fetchAll());
$leads_conversion = new Config();
/* DETECT HOW MANY POSTS CREATED TODAY */
$posted_today = null;
$tp = $config->getPostsByUser(0,1,'admin');
foreach ($tp as $post) {
$post_date = date('m-d',strtotime($post['submission_date']));
$todays_date2 = date('m-d');
if ($post_date===$todays_date2) {
$posted_today = true;
}
}
if ($posted_today===true) {
$status[] = '<span class="text-success">BLOGS POSTED TODAY!</span>';
} else {
$status[] = '<span class="text-danger">NOT POSTED TODAY!</span>';
}
/* DETECT HOW MANY PROMOS POSTED TO DAY */
$posted_today = null;
$tpr = $config->getPromosByUser('admin',0);
// $config->debug($tpr,1);
foreach ($tpr as $promo) {
$post_date = date('m-d',strtotime($promo['date_created']));
$todays_date2 = date('m-d');
if ($post_date===$todays_date2) {
$posted_today = true;
}
}
if ($posted_today===true) {
$status[] = '<span class="text-success">PROMOS CREATED TODAY!</span>';
} else {
$status[] = '<span class="text-danger">NO PROMOS CREATED TODAY</span>';
$status[] = '<a class="btn btn-success-outline btn-block pull-left" href="http://freelabel.net/users/dashboard/?ctrl=promos" target="_blank">ADD NEW PROMO</a>';
}
/* DETECT HOW MANY CLIENTS SIGNED UP TODAY */
/*
* BUILD SOM ALERTS
*/
$status[] = 'Messages Sent: '.$numb_soms_sent.' / 600';
if ($numb_soms_sent < 600) {
$status[] = '<span class="text-danger">Not Enough SOMS Sent.</span>';
$status[] = '<a class="btn btn-success-outline som-button-trigger btn-block pull-left" href="http://freelabel.net/twitter/?som=1&q=1" target="_blank">SOM</a>';
$status[] = '<button onclick="openScript()" class="btn btn-warning-outline btn-block">
Open Script
</button>';
} else {
$status[] = '<span class="text-success">SOM quota met!</span>';
}
/*
* GET SOM ALERT DATA
*/
$data='<div class="card card-chart">
<ul class="list-group"><h1>Alerts</h1>';
foreach ($status as $key => $value) {
$data .= '<li class="list-group-item complete clearfix">
'.$value.'
</li>';
}
$data.='</ul>
</div>';
$adminPosts = $config->getPostsByUser(0,20,'admin');
include(ROOT.'inc/connection.php');
// START COUTNING LEADS
$result = mysqli_query($con,"SELECT * FROM leads
WHERE follow_up_date LIKE '%$todays_date%'
/*OR follow_up_date='$yesterdays_date'
OR follow_up_date='$daybefore_date'
OR follow_up_date='$threedaysback'
OR follow_up_date='$fourdaysback'
OR follow_up_date='$fivedaysback'
/*OR `user_name` = '".$user_name_session."' */
ORDER BY `id` DESC LIMIT 100");
while($row = mysqli_fetch_assoc($result)) {
$i = $i;
$leads[$row['lead_twitter']][] = array('name'=>$row['lead_name'],'count'=>$row['count']);
$i = $i + 1;
}
if ($leads==NULL) {
$leads['noneFound'] = 'no leads found';
}
// var_dump($leads);
/*
* Lead Build Data
*/
$lead_build='<div class="card card-chart">
<ul class="list-group"><h1>Leads</h1>';
foreach ($leads as $key => $value) {
if ($value!=='no leads found') {
$status = '';
if ($value[0]['count']>=3) {
$count = $value[0]['count'];
$status = 'status-completed';
} elseif ($value[0]['count']>=1) {
$count = $value[0]['count'];
$status = 'status-backlog';
} else {
$count = 0;
$status = 'status-noticket';
}
$lead_build .= '
<li class="lead-block list-group-item complete clearfix">
<span class="label pull-left"><a class="fa fa-star-o lead-promo-button" href="#" data-id="'.$key.'"></a></span>
<span class="label pull-left"><a class="fa fa-comment lead-response-button" href="#" data-id="'.$key.'"></a></span>
<span class="label pull-right lead-twitter-name" data-user="'.$key.'" data-count="'.$count.'">[<a href="http://twitter.com/@'.$key.'" target="_blank">@'.$key.'</a>] <span class="text-muted">['.count($value).':'.$count.']</span></span>
<span class="pull-left icon-status '.$status.'"></span>'.$value[0]['name'].'
</li>';
} else {
// echo 'No leads found!!';
}
}
$lead_build.='</ul>
</div>';
$number_of_leads = count($leads);
$min_sales = 100;
$price = 56;
// GET PERCENTAGACES
$sales_progress = round(($number_of_leads / $min_sales) * 100);
$total_sales = number_format($number_of_leads * $price);
$sales_estimate = $total_sales * 0.1;
$total_sales_quota = number_format($min_sales * $price);
/*
* GET SOM ALERT DATA
*/
$data.='<div class="card card-chart">
<ul class="list-group"><h1>Progress</h1>';
// foreach ($status as $key => $value) {
$data .= '<li class="list-group-item complete">
<span class="label pull-right">0</span>
<span class="pull-left icon-status status-completed"></span> '.$sales_progress.'% Completed
</li>';
$data .= '<li class="list-group-item complete">
<span class="label pull-right">0</span>
<span class="pull-left icon-status status-completed"></span> $'.$total_sales.' / $'.$total_sales_quota.' Estimated Revenue
</li>';
$data .= '<li class="list-group-item complete">
<span class="label pull-right">0</span>
<span class="pull-left icon-status status-completed"></span> '.$number_of_leads.' / '.$min_sales.'
</li>';
$data .= '<li class="list-group-item complete">
<span class="label pull-right">0</span><span class="pull-left icon-status status-completed"></span> ';
if ($number_of_leads > $min_sales) {
$sales_status = '<span class="text-success">Sales met!</span>';
} else {
$sales_status = '<span class="text-danger">Sales not met!</span>';
}
$data.= $sales_status.'
</li>';
$data .= '<li class="list-group-item complete clearfix">
<a class="btn btn-success-outline open-clients-trigger btn-block pull-left" href="#" target="_blank">View Clients</a>
</li>';
// }
$data.='</ul>
</div>';
// var_dump($leads);
?>
<?php //include(ROOT.'submit/views/db/current_clients.php'); ?>
<script type="text/javascript">
function openScript() {
window.open("http://freelabel.net/users/dashboard/dev?ctrl=script", "_blank", "toolbar=yes,scrollbars=yes,resizable=yes,top=10,left=0,width=290,height=1100");
}
</script>
<style type="text/css">
.lead-response-window {
width: 100%;
min-height:300px;
}
.lead-block .fa {
margin-right: 0.5em;
}
.hot-lead {
color: gold;
}
</style>
<!-- MAIN CONTAINER AREA -->
<div class="container row">
<div class="col-md-4">
<?php echo $data; ?>
</div>
<div class="col-md-8 lead-container">
<select class="form-control lead-filter">
<option value="today">Today</option>
<option value="yesterday">Yesterday</option>
<option value="this_month">This Month</option>
</select>
<?php echo $lead_build; ?>
</div>
</div>
<!-- MODAL -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">
<textarea class="form-control lead-response-input" rows="5"></textarea>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary lead-response-trigger">Send Message</button>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(function(){
$('.lead-response-button').click(function(event){
event.preventDefault();
var lead_id = $(this).attr('data-id');
var wrapper = $(this).parent().parent();
// hide wrapper
wrapper.remove();
// reset wrapper
$('#myModal .modal-title').html('');
$('.lead-response-input').val('');
// Open Modal
$('#myModal').modal('toggle');
$('#myModal .modal-title').html(wrapper.html());
// $('#myModal .modal-body').append('<iframe src="http://freelabel.net/" class="lead-response-window" ></iframe>');
});
$('.som-button-trigger').click(function(e){
e.preventDefault();
var posturl = $(this).attr('href');
// var somurl = 'http://freelabel.net/twitter/?som=1&q=1';
var somurl = 'http://freelabel.net/som/index.php?som=1&stayopen=1&mins=4&recent=1&cat=all';
// alert('open ' + url);
window.open(posturl);
window.open(somurl);
});
// open twitter messages
$('.lead-twitter-name').click(function(e){
// e.preventDefault();
var elem = $(this);
var lead_id = elem.attr('data-user');
var count = elem.attr('data-count');
var url = 'http://freelabel.net/users/dashboard/updateLeadCount';
$.post(url, {
lead_id : lead_id,
count: count
}, function(result){
elem.css('color','red');
var name = elem.attr('data-user');
// alert('okay ' + result);
// alert('okay ' + result);
});
});
// Lead Response Trigger
$('.lead-response-trigger').click(function(){
var text = $('.lead-response-input').val();
alert('okay do this right here: ' + text);
});
// Lead Promo Trigger
$('.lead-promo-button').click(function(e) {
e.preventDefault();
var lead_name = $(this).attr('data-id');
var elem = $(this);
var promo = '@' + lead_name + ' <?php echo $site['media']['photos'][0]['title']. ' - freelabel.net/users/image/index/'.$site['media']['photos'][0]['id']; ?>';
var message = encodeURI(promo);
var url = 'http://freelabel.net/som/index.php?post=1&t=&text=' + message;
$.post(url,function(result){
alert(result);
elem.removeClass('fa-star-o');
elem.addClass('fa-star');
elem.css('color', 'yellow');
});
// var url = 'http://freelabel.net/som/index.php?post=1&t=&text=' + message;
// window.open(url);
});
// Open Clients Trigger
$('.open-clients-trigger').click(function(e){
e.preventDefault();
var wrap = $('#leads');
var url = 'http://freelabel.net/users/dashboard/clients/';
wrap.html('Loading clients..');
$.post(url , function(result){
wrap.html(result);
})
alert('okay do this right here: ' + text);
});
/* LEADS FILETERS */
$('.lead-filter').change(function(e){
var filter = $(this).val();
var path = "http://freelabel.net/users/dashboard/leads_stream/";
var data = {
filter : filter
}
$.get(path, data, function(result){
// alert(result);
$('.lead-container').html(result);
});
});
});
</script>
| {
"content_hash": "fa68969a6b0c312f64983b2e1cc437dd",
"timestamp": "",
"source": "github",
"line_count": 382,
"max_line_length": 246,
"avg_line_length": 30.95026178010471,
"alnum_prop": 0.5557811046265754,
"repo_name": "mayoalexander/fl-two",
"id": "d55caab3851241f21f9b345c552f5ad655978540",
"size": "11823",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "users/application/views/dashboard/leads.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "16052"
},
{
"name": "CSS",
"bytes": "1977662"
},
{
"name": "CoffeeScript",
"bytes": "737"
},
{
"name": "Go",
"bytes": "30195"
},
{
"name": "HTML",
"bytes": "1462415"
},
{
"name": "JavaScript",
"bytes": "3485680"
},
{
"name": "Nginx",
"bytes": "1651"
},
{
"name": "PHP",
"bytes": "5627434"
},
{
"name": "Python",
"bytes": "25112"
},
{
"name": "Ruby",
"bytes": "4088"
},
{
"name": "Shell",
"bytes": "2621"
}
],
"symlink_target": ""
} |
using System;
using System.Xml.Serialization;
namespace HoloXPLOR.Data.DataForge
{
[XmlRoot(ElementName = "BTFireControl")]
public partial class BTFireControl : BTNode
{
[XmlArray(ElementName = "Enable")]
[XmlArrayItem(Type = typeof(BTInputBool))]
[XmlArrayItem(Type = typeof(BTInputBoolValue))]
[XmlArrayItem(Type = typeof(BTInputBoolVar))]
[XmlArrayItem(Type = typeof(BTInputBoolBB))]
public BTInputBool[] Enable { get; set; }
}
}
| {
"content_hash": "c27dab6e1d959036fadfc123eac1cbd5",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 55,
"avg_line_length": 29.352941176470587,
"alnum_prop": 0.6673346693386774,
"repo_name": "dolkensp/HoloXPLOR",
"id": "caed6064f1757c65e1133e459ae54f38e32482d4",
"size": "499",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "HoloXPLOR.Data/DataForge/AutoGen/BTFireControl.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "99"
},
{
"name": "C#",
"bytes": "814127"
},
{
"name": "CSS",
"bytes": "18315"
},
{
"name": "HTML",
"bytes": "54617"
},
{
"name": "JavaScript",
"bytes": "1516198"
},
{
"name": "Smarty",
"bytes": "879117"
}
],
"symlink_target": ""
} |
OpenTheWindow games project.
1. Angular2
2. Electron
3. Express (node backend server)
4. Jasmine (unit tests) + Karma (test runner)
5. Protractor (end to end testing)
6. Webpack
## File Structure
Component approach is used.
This is the new standard for developing Angular apps and a great way to ensure maintainable code by encapsulation of our behavior logic.
A component is basically a self contained app usually in a single file or a folder with each concern as a file: style, template, specs, e2e, and component class.
Here's how it looks:
```
OPEN_Launcher/
├──backend/ * nodejs backend (`api.js` is the entry point)
|
├──src/ * our source files that will be compiled to javascript
| ├──app.ts * our entry file for our browser environment
│ │
| ├──index.html * Index.html: where we generate our index page
│ │
| ├──polyfills.ts * our polyfills file
│ │
| ├──vendor.ts * our vendor file
│ │
│ ├──app/ * WebApp: folder
│ │ ├──components/ * folder that holds specific components
│ │ │ └──component/ * specific component business group
│ │ │ ├──component.ts * a specific component typescript
│ │ │ └──component.spec.ts * a simple test of the component
│ │ │
│ │ ├──shared/ * folder that holds shared components
│ │ │ ├──enums/ * our enumerations are here
│ │ │ ├──mocks/ * our mocks are here
│ │ │ ├──models/ * our models are here
│ │ │ ├──pipes/ * our pipes are here
│ │ │ ├──plugins/ * folder for third party components (not written by us)
│ │ │ └──services/ * folder for services used across the application
│ │ │
│ │ └──tests/ * folder that holds e2e tests and page objects for the components
│ │
│ └──assets/ * static assets are served here
│ ├──css/ * our stylesheets are here
│ ├──games/ * games executables are here
│ ├──images/ * images are stored here
│ ├──js/ * only requiring jquery statement is stored here (this might be changed)
│ ├──robots.txt * for search engines to crawl your website
│ └──db.json * json database where users are stored
│
├──tslint.json * typescript lint config
├──typedoc.json * typescript documentation generator
├──tsconfig.json * config that webpack uses for typescript
├──typings.json * our typings manager
└──package.json * what npm uses to manage it's dependencies
```
# Getting Started
## Dependencies
What you need to run this app:
* `node` and `npm` (`brew install node`)
* Ensure you're running the latest versions Node `v4.1.x`+ and NPM `2.14.x`+
Once you have those, you should install these globals with `npm install --global`:
* `webpack` (`npm install --global webpack`)
* `webpack-dev-server` (`npm install --global webpack-dev-server`)
* `karma` (`npm install --global karma-cli`)
* `protractor` (`npm install --global protractor`)
* `typings` (`npm install --global typings`)
* `typescript` (`npm install --global typescript`)
* `electron-packager` (`npm install --global electron-packager`)
## Installation
* `fork` this repo
* `clone` your fork
* `npm install` to install all dependencies
* `npm start` to start the app on [localhost:3000](localhost:3000)
## Running the app
After you have installed all dependencies you can now run the app. Run `npm start` to start a local server using `webpack-dev-server` which will watch, build (in-memory), and reload for you. The port will be displayed to you as `http://0.0.0.0:3000` (or if you prefer IPv6, if you're using `express` server, then it's `http://[::1]:3000/`).
## Building the exe file using [Electron](https://github.com/electron/electron)
Electron can be used with any framework, so once Electron is set in place, we simply create the Angular 2 app as we would for the web.
The Electron configuration is contained in `./src/main.js`.
## Building Windows installer using [Electron Installer](https://github.com/electron/windows-installer)
Electron Installer is a NPM module that builds Windows installers for Electron apps using [Squirrel](https://github.com/Squirrel/Squirrel.Windows).
The Electron Installer configuration is contained in `installer.js`.
### IMPORTANT
Set the environment variable to 'prod' in `./backend/env.js`.
To build application exe file for win32 x64 run the following command:
```bash
npm run pack
```
To build Windows installer for the application run the following command:
```bash
npm run installer
```
## Other commands
### server
```bash
# development
npm run server
# production
npm run build:prod
npm run server:prod
```
### run tests
```bash
npm run test
```
### watch and run our tests
```bash
npm run watch:test
```
### run end-to-end tests
```bash
# make sure you have your server running in another terminal
npm run e2e
```
### run webdriver (for end-to-end)
```bash
npm run webdriver:update
npm run webdriver:start
```
## Use latest TypeScript compiler
TypeScript 1.7.x includes everything you need. Make sure to upgrade, even if you installed TypeScript previously.
```
npm install --global typescript
```
## Use a TypeScript-aware editor
* [Visual Studio Code](https://code.visualstudio.com/)
* [Webstorm 10](https://www.jetbrains.com/webstorm/download/)
* [Atom](https://atom.io/) with [TypeScript plugin](https://atom.io/packages/atom-typescript)
* [Sublime Text](http://www.sublimetext.com/3) with [Typescript-Sublime-Plugin](https://github.com/Microsoft/Typescript-Sublime-plugin#installation)
# Typings
> When you include a module that doesn't include Type Definitions inside of the module you need to include external Type Definitions with Typings
## Use latest Typings module
```
npm install --global typings
```
## Custom Type Definitions
When including 3rd party modules you also need to include the type definition for the module
if they don't provide one within the module. You can try to install it with typings
```
typings install node --save
```
If you can't find the type definition in the registry we can make an ambient definition in
this file for now. For example
```typescript
declare module "my-module" {
export function doesSomething(value: string): string;
}
```
If you're prototyping and you will fix the types later you can also declare it as type any
```typescript
declare var assert: any;
```
If you're importing a module that uses Node.js modules which are CommonJS you need to import as
```typescript
import * as _ from 'lodash';
``` | {
"content_hash": "0642e611cafc3662ae2d3dc4461b67fd",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 340,
"avg_line_length": 41.473684210526315,
"alnum_prop": 0.6397349125775522,
"repo_name": "dragica/OPEN_Launcher",
"id": "35c7966c7ab464c0cf6cd8d898919fbd81d36988",
"size": "7551",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2713"
},
{
"name": "HTML",
"bytes": "1233829"
},
{
"name": "JavaScript",
"bytes": "53597"
},
{
"name": "TypeScript",
"bytes": "139810"
}
],
"symlink_target": ""
} |
package net.minecraft.entity;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import java.util.List;
import java.util.Set;
import java.util.concurrent.Callable;
import net.minecraft.crash.CrashReport;
import net.minecraft.crash.CrashReportCategory;
import net.minecraft.entity.boss.EntityDragon;
import net.minecraft.entity.boss.EntityWither;
import net.minecraft.entity.item.EntityArmorStand;
import net.minecraft.entity.item.EntityBoat;
import net.minecraft.entity.item.EntityEnderCrystal;
import net.minecraft.entity.item.EntityEnderEye;
import net.minecraft.entity.item.EntityEnderPearl;
import net.minecraft.entity.item.EntityExpBottle;
import net.minecraft.entity.item.EntityFallingBlock;
import net.minecraft.entity.item.EntityFireworkRocket;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.entity.item.EntityTNTPrimed;
import net.minecraft.entity.item.EntityXPOrb;
import net.minecraft.entity.passive.EntityBat;
import net.minecraft.entity.passive.EntitySquid;
import net.minecraft.entity.passive.IAnimals;
import net.minecraft.entity.player.PlayerMP;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.entity.projectile.EntityEgg;
import net.minecraft.entity.projectile.EntityFireball;
import net.minecraft.entity.projectile.EntityFishHook;
import net.minecraft.entity.projectile.EntityPotion;
import net.minecraft.entity.projectile.EntitySmallFireball;
import net.minecraft.entity.projectile.EntitySnowball;
import net.minecraft.network.Packet;
import net.minecraft.util.IntHashMap;
import net.minecraft.util.ReportedException;
import net.minecraft.world.WorldServer;
import net.minecraft.world.chunk.Chunk;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class EntityTracker
{
private static final Logger logger = LogManager.getLogger();
private final WorldServer theWorld;
private Set<EntityTrackerEntry> trackedEntities = Sets.<EntityTrackerEntry>newHashSet();
private IntHashMap<EntityTrackerEntry> trackedEntityHashTable = new IntHashMap();
private int maxTrackingDistanceThreshold;
public EntityTracker(WorldServer theWorldIn)
{
this.theWorld = theWorldIn;
this.maxTrackingDistanceThreshold = theWorldIn.getMinecraftServer().getConfigurationManager().getEntityViewDistance();
}
public void trackEntity(Entity p_72786_1_)
{
if (p_72786_1_ instanceof PlayerMP)
{
this.trackEntity(p_72786_1_, 512, 2);
PlayerMP entityplayermp = (PlayerMP)p_72786_1_;
for (EntityTrackerEntry entitytrackerentry : this.trackedEntities)
{
if (entitytrackerentry.trackedEntity != entityplayermp)
{
entitytrackerentry.updatePlayerEntity(entityplayermp);
}
}
}
else if (p_72786_1_ instanceof EntityFishHook)
{
this.addEntityToTracker(p_72786_1_, 64, 5, true);
}
else if (p_72786_1_ instanceof EntityArrow)
{
this.addEntityToTracker(p_72786_1_, 64, 20, false);
}
else if (p_72786_1_ instanceof EntitySmallFireball)
{
this.addEntityToTracker(p_72786_1_, 64, 10, false);
}
else if (p_72786_1_ instanceof EntityFireball)
{
this.addEntityToTracker(p_72786_1_, 64, 10, false);
}
else if (p_72786_1_ instanceof EntitySnowball)
{
this.addEntityToTracker(p_72786_1_, 64, 10, true);
}
else if (p_72786_1_ instanceof EntityEnderPearl)
{
this.addEntityToTracker(p_72786_1_, 64, 10, true);
}
else if (p_72786_1_ instanceof EntityEnderEye)
{
this.addEntityToTracker(p_72786_1_, 64, 4, true);
}
else if (p_72786_1_ instanceof EntityEgg)
{
this.addEntityToTracker(p_72786_1_, 64, 10, true);
}
else if (p_72786_1_ instanceof EntityPotion)
{
this.addEntityToTracker(p_72786_1_, 64, 10, true);
}
else if (p_72786_1_ instanceof EntityExpBottle)
{
this.addEntityToTracker(p_72786_1_, 64, 10, true);
}
else if (p_72786_1_ instanceof EntityFireworkRocket)
{
this.addEntityToTracker(p_72786_1_, 64, 10, true);
}
else if (p_72786_1_ instanceof EntityItem)
{
this.addEntityToTracker(p_72786_1_, 64, 20, true);
}
else if (p_72786_1_ instanceof EntityMinecart)
{
this.addEntityToTracker(p_72786_1_, 80, 3, true);
}
else if (p_72786_1_ instanceof EntityBoat)
{
this.addEntityToTracker(p_72786_1_, 80, 3, true);
}
else if (p_72786_1_ instanceof EntitySquid)
{
this.addEntityToTracker(p_72786_1_, 64, 3, true);
}
else if (p_72786_1_ instanceof EntityWither)
{
this.addEntityToTracker(p_72786_1_, 80, 3, false);
}
else if (p_72786_1_ instanceof EntityBat)
{
this.addEntityToTracker(p_72786_1_, 80, 3, false);
}
else if (p_72786_1_ instanceof EntityDragon)
{
this.addEntityToTracker(p_72786_1_, 160, 3, true);
}
else if (p_72786_1_ instanceof IAnimals)
{
this.addEntityToTracker(p_72786_1_, 80, 3, true);
}
else if (p_72786_1_ instanceof EntityTNTPrimed)
{
this.addEntityToTracker(p_72786_1_, 160, 10, true);
}
else if (p_72786_1_ instanceof EntityFallingBlock)
{
this.addEntityToTracker(p_72786_1_, 160, 20, true);
}
else if (p_72786_1_ instanceof EntityHanging)
{
this.addEntityToTracker(p_72786_1_, 160, Integer.MAX_VALUE, false);
}
else if (p_72786_1_ instanceof EntityArmorStand)
{
this.addEntityToTracker(p_72786_1_, 160, 3, true);
}
else if (p_72786_1_ instanceof EntityXPOrb)
{
this.addEntityToTracker(p_72786_1_, 160, 20, true);
}
else if (p_72786_1_ instanceof EntityEnderCrystal)
{
this.addEntityToTracker(p_72786_1_, 256, Integer.MAX_VALUE, false);
}
}
public void trackEntity(Entity entityIn, int trackingRange, int updateFrequency)
{
this.addEntityToTracker(entityIn, trackingRange, updateFrequency, false);
}
/**
* Args : Entity, trackingRange, updateFrequency, sendVelocityUpdates
*/
public void addEntityToTracker(Entity entityIn, int trackingRange, final int updateFrequency, boolean sendVelocityUpdates)
{
if (trackingRange > this.maxTrackingDistanceThreshold)
{
trackingRange = this.maxTrackingDistanceThreshold;
}
try
{
if (this.trackedEntityHashTable.containsItem(entityIn.getEntityId()))
{
throw new IllegalStateException("Entity is already tracked!");
}
EntityTrackerEntry entitytrackerentry = new EntityTrackerEntry(entityIn, trackingRange, updateFrequency, sendVelocityUpdates);
this.trackedEntities.add(entitytrackerentry);
this.trackedEntityHashTable.addKey(entityIn.getEntityId(), entitytrackerentry);
entitytrackerentry.updatePlayerEntities(this.theWorld.playerEntities);
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Adding entity to track");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Entity To Track");
crashreportcategory.addCrashSection("Tracking range", trackingRange + " blocks");
crashreportcategory.addCrashSectionCallable("Update interval", new Callable<String>()
{
public String call() throws Exception
{
String s = "Once per " + updateFrequency + " ticks";
if (updateFrequency == Integer.MAX_VALUE)
{
s = "Maximum (" + s + ")";
}
return s;
}
});
entityIn.addEntityCrashInfo(crashreportcategory);
CrashReportCategory crashreportcategory1 = crashreport.makeCategory("Entity That Is Already Tracked");
((EntityTrackerEntry)this.trackedEntityHashTable.lookup(entityIn.getEntityId())).trackedEntity.addEntityCrashInfo(crashreportcategory1);
try
{
throw new ReportedException(crashreport);
}
catch (ReportedException reportedexception)
{
logger.error((String)"\"Silently\" catching entity tracking error.", (Throwable)reportedexception);
}
}
}
public void untrackEntity(Entity entityIn)
{
if (entityIn instanceof PlayerMP)
{
PlayerMP entityplayermp = (PlayerMP)entityIn;
for (EntityTrackerEntry entitytrackerentry : this.trackedEntities)
{
entitytrackerentry.removeFromTrackedPlayers(entityplayermp);
}
}
EntityTrackerEntry entitytrackerentry1 = (EntityTrackerEntry)this.trackedEntityHashTable.removeObject(entityIn.getEntityId());
if (entitytrackerentry1 != null)
{
this.trackedEntities.remove(entitytrackerentry1);
entitytrackerentry1.sendDestroyEntityPacketToTrackedPlayers();
}
}
public void updateTrackedEntities()
{
List<PlayerMP> list = Lists.<PlayerMP>newArrayList();
for (EntityTrackerEntry entitytrackerentry : this.trackedEntities)
{
entitytrackerentry.updatePlayerList(this.theWorld.playerEntities);
if (entitytrackerentry.playerEntitiesUpdated && entitytrackerentry.trackedEntity instanceof PlayerMP)
{
list.add((PlayerMP)entitytrackerentry.trackedEntity);
}
}
for (int i = 0; i < ((List)list).size(); ++i)
{
PlayerMP entityplayermp = (PlayerMP)list.get(i);
for (EntityTrackerEntry entitytrackerentry1 : this.trackedEntities)
{
if (entitytrackerentry1.trackedEntity != entityplayermp)
{
entitytrackerentry1.updatePlayerEntity(entityplayermp);
}
}
}
}
public void func_180245_a(PlayerMP p_180245_1_)
{
for (EntityTrackerEntry entitytrackerentry : this.trackedEntities)
{
if (entitytrackerentry.trackedEntity == p_180245_1_)
{
entitytrackerentry.updatePlayerEntities(this.theWorld.playerEntities);
}
else
{
entitytrackerentry.updatePlayerEntity(p_180245_1_);
}
}
}
public void sendToAllTrackingEntity(Entity entityIn, Packet p_151247_2_)
{
EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry)this.trackedEntityHashTable.lookup(entityIn.getEntityId());
if (entitytrackerentry != null)
{
entitytrackerentry.sendPacketToTrackedPlayers(p_151247_2_);
}
}
public void func_151248_b(Entity entityIn, Packet p_151248_2_)
{
EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry)this.trackedEntityHashTable.lookup(entityIn.getEntityId());
if (entitytrackerentry != null)
{
entitytrackerentry.func_151261_b(p_151248_2_);
}
}
public void removePlayerFromTrackers(PlayerMP p_72787_1_)
{
for (EntityTrackerEntry entitytrackerentry : this.trackedEntities)
{
entitytrackerentry.removeTrackedPlayerSymmetric(p_72787_1_);
}
}
public void func_85172_a(PlayerMP p_85172_1_, Chunk p_85172_2_)
{
for (EntityTrackerEntry entitytrackerentry : this.trackedEntities)
{
if (entitytrackerentry.trackedEntity != p_85172_1_ && entitytrackerentry.trackedEntity.chunkCoordX == p_85172_2_.xPosition && entitytrackerentry.trackedEntity.chunkCoordZ == p_85172_2_.zPosition)
{
entitytrackerentry.updatePlayerEntity(p_85172_1_);
}
}
}
}
| {
"content_hash": "cc576972b591e536ca8db98756d6a150",
"timestamp": "",
"source": "github",
"line_count": 337,
"max_line_length": 207,
"avg_line_length": 37.103857566765576,
"alnum_prop": 0.6350767754318618,
"repo_name": "TorchPowered/Thallium",
"id": "99e21ab240e3452cc820900dd9ecba522992c288",
"size": "12504",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/net/minecraft/entity/EntityTracker.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "5821"
},
{
"name": "Java",
"bytes": "6522828"
},
{
"name": "Shell",
"bytes": "7076"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<recipeml version="0.5">
<recipe>
<head>
<title>Artichoke Baskets with Caper Dip</title>
<categories>
<cat>Vegetables</cat>
<cat>Dips</cat></categories>
<yield>4</yield></head>
<ingredients>
<ing>
<amt>
<qty>2</qty>
<unit/></amt>
<item>Artichokes (about 12oz each)</item></ing>
<ing>
<amt>
<qty>1/2</qty>
<unit>cups</unit></amt>
<item>Fat free mayonnaise</item></ing>
<ing>
<amt>
<qty>1</qty>
<unit>clove</unit></amt>
<item>Garlic, minced</item></ing>
<ing>
<amt>
<qty>1</qty>
<unit>tablespoon</unit></amt>
<item>Small capers, OR</item></ing>
<ing>
<amt>
<qty>1</qty>
<unit>small</unit></amt>
<item>Pickle, chopped</item></ing>
<ing>
<amt>
<qty>1</qty>
<unit>tablespoon</unit></amt>
<item>Caper or pickle brine</item></ing></ingredients>
<directions>
<step> Impress your favorite valentine with these lovely artichoke baskets filled
with a creamy fat free dip. FOR ARTICHOKES: With sharp knife, cut off
stems. With scissors, snip off prickly tips. Rinse and shake ff water. Wrap
artichokes in plastic wrap and place on microwave safe plate or place in a
microwave safe casserole. Add 1/4 cup water and cover. Place in microwave
and cook on high 5-1/2 to 8-1/2 minutes until lower leaves can be pulled
off and base pierces easily with fork
rotate and rearrange halfway through cooking. Let stand 3-5 minutes.
TO PREPARE DIP: In small bowl combine mayonnaise, garlic, capers and caper
brine.
TO PREPARE BASKET: Remove 1/4 of one side of artichoke leaves; reserve
leaves
Carefully remove and discard the choke. Place on small plate. Fill inside
of basket with caper kip and allow some to spill out onto the plate. Chill
until ready to serve. If desired serve with reserved artichoke leaves.
NOTE* If desired, artichokes can be cooked on stove top. Place trimmed
artichokes stem side down in small saucepot just big enough to hold them
snugly. Pour boiling water to a depth of 1 inch,cover and steam 45 minutes
over medium heat until done as above. With tongs, remove from pot; drain.
Makes 2 servings, 129 calories each.
Origin: Women's World, February 16, 1993 Shared by: Sharon Stevens
From Gemini's MASSIVE MealMaster collection at www.synapse.com/~gemini
</step></directions></recipe></recipeml>
| {
"content_hash": "5fbcb7e87da8027e83a2f75aaf4f36e9",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 88,
"avg_line_length": 36.861111111111114,
"alnum_prop": 0.6281085154483798,
"repo_name": "coogle/coogle-recipes",
"id": "175c34d8f5458f4bcce6c9c647afa1cafa80f8be",
"size": "2654",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "extras/recipes/Artichoke_Baskets_with_Caper_Dip.xml",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Blade",
"bytes": "70365"
},
{
"name": "CSS",
"bytes": "2508"
},
{
"name": "HTML",
"bytes": "1294"
},
{
"name": "JavaScript",
"bytes": "1133"
},
{
"name": "PHP",
"bytes": "130922"
},
{
"name": "Puppet",
"bytes": "23814"
},
{
"name": "SCSS",
"bytes": "1015"
},
{
"name": "Shell",
"bytes": "3538"
},
{
"name": "Vue",
"bytes": "559"
}
],
"symlink_target": ""
} |
import {assert} from '@webex/test-helper-chai';
import {cloneDeep} from 'lodash';
import Device from '@webex/internal-plugin-device';
import MockWebex from '@webex/test-helper-mock-webex';
import sinon from 'sinon';
import dto from './wdm-dto';
describe('plugin-device', () => {
describe('Device', () => {
let webex;
let device;
beforeEach('initialize webex with the device plugin', () => {
webex = new MockWebex({
children: {
device: Device
}
});
const clonedDTO = cloneDeep(dto);
webex.internal.device.set(clonedDTO);
device = webex.internal.device;
});
describe('events', () => {
describe('when a feature is changed', () => {
let spy;
let modifiedDTOFeatures;
beforeEach('setup sinon', () => {
spy = sinon.spy();
modifiedDTOFeatures = {
...dto.features,
user: [
...dto.features.user,
...dto.features.developer
]
};
});
it('should trigger a \'change\' event', () => {
device.on('change', spy);
device.features.set(modifiedDTOFeatures);
assert.called(spy);
});
it('should trigger a \'change:features\' event', () => {
device.on('change:features', spy);
device.features.set(modifiedDTOFeatures);
assert.called(spy);
});
});
describe('when an network inactivity property changes', () => {
beforeEach('setup sinon', () => {
device.checkNetworkReachability = sinon.spy();
});
describe('when the \'intranetInactivityCheckUrl\' changes', () => {
beforeEach('change \'intranetInactivityCheckUrl\'', () => {
device.intranetInactivityCheckUrl = 'https://not-a-url.com';
});
it('should call \'checkNetworkReachability()\'', () => {
assert.called(device.checkNetworkReachability);
});
});
describe('when the \'intranetInactivityDuration\' changes', () => {
beforeEach('change \'intranetInactivityDuration\'', () => {
device.intranetInactivityDuration = 1234;
});
it('should call \'checkNetworkReachability()\'', () => {
assert.called(device.checkNetworkReachability);
});
});
describe('when the \'inNetworkInactivityDuration\' changes', () => {
beforeEach('change \'inNetworkInactivityDuration\'', () => {
device.inNetworkInactivityDuration = 1234;
});
it('should call \'checkNetworkReachability()\'', () => {
assert.called(device.checkNetworkReachability);
});
});
});
});
describe('derived properties', () => {
describe('#registered', () => {
describe('when the device does not have a url', () => {
beforeEach('remove the device\'s url', () => {
device.url = undefined;
});
it('should return false', () => {
assert.isFalse(device.registered);
});
});
describe('when the device does have a url', () => {
beforeEach('set the device\'s url', () => {
device.url = dto.url;
});
it('should return true', () => {
assert.isTrue(device.registered);
});
});
});
});
describe('#setLogoutTimer()', () => {
describe('when the duration parameter is not set', () => {
it('should not change the existing timer', () => {
const {logoutTimer} = device;
device.setLogoutTimer();
assert.equal(device.logoutTimer, logoutTimer);
});
});
describe('when the duration parameter is zero or negative', () => {
it('should not change the existing timer', () => {
const {logoutTimer} = device;
device.setLogoutTimer(-1);
assert.equal(device.logoutTimer, logoutTimer);
});
});
describe('when the duration is valid', () => {
beforeEach(() => {
device.resetLogoutTimer = sinon.spy();
});
it('should create a \'change:lastUserActivityDate\' listener', () => {
device.setLogoutTimer(60000);
device.trigger('change:lastUserActivityDate');
assert.called(device.resetLogoutTimer);
});
it('should set the logout timer', () => {
const {logoutTimer} = device;
device.setLogoutTimer(60000);
assert.notEqual(device.logoutTimer, logoutTimer);
});
});
});
describe('#serialize()', () => {
it('should serialize entitlement feature keys', () => {
assert.hasAllKeys(
device.serialize().features.entitlement,
Object.keys(dto.features.entitlement)
);
});
it('should serialize user feature keys', () => {
assert.hasAllKeys(
device.serialize().features.user,
Object.keys(dto.features.user)
);
});
});
});
});
| {
"content_hash": "3e800a73164f46848cbd1a5771710f47",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 78,
"avg_line_length": 29.53179190751445,
"alnum_prop": 0.5296535525543159,
"repo_name": "mwegman/spark-js-sdk",
"id": "d1a246f7f922ed2f6da68c566eac356582c9a41a",
"size": "5109",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "packages/node_modules/@webex/internal-plugin-device/test/unit/spec/device.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "387"
},
{
"name": "JavaScript",
"bytes": "129686"
},
{
"name": "Python",
"bytes": "9677"
},
{
"name": "Shell",
"bytes": "19743"
}
],
"symlink_target": ""
} |
"""Tests for container build_tar tool"""
from container.build_tar import TarFile
import unittest
import tempfile
from os import path
import tarfile
import glob
class BuildTarTest(unittest.TestCase):
def testAddsTarWithLongFileNames(self):
with tempfile.TemporaryDirectory() as tmp:
output_file_name = path.join(tmp, "output.tar")
with TarFile(output_file_name, directory="/specifieddir", compression=None, root_directory=".", default_mtime=None,
enable_mtime_preservation=False, xz_path="", force_posixpath=False) as output_file:
output_file.add_tar("./tests/container/testdata/expected.tar")
with tarfile.open(output_file_name) as output_file:
contained_names = output_file.getnames()
# Assert all files from the source directory appear in the output tar file.
for source_file in glob.iglob("./tests/container/testdata/files/*"):
self.assertIn('./specifieddir/files/' + path.basename(source_file), contained_names)
def testAddsTarWithLongPrefix(self):
with tempfile.TemporaryDirectory() as tmp:
output_file_name = path.join(tmp, "output.tar")
prefix = 'a' * 99
with TarFile(output_file_name, directory="/" + prefix, compression=None, root_directory=".", default_mtime=None,
enable_mtime_preservation=False, xz_path="", force_posixpath=False) as output_file:
output_file.add_tar("./tests/container/testdata/expected.tar")
with tarfile.open(output_file_name) as output_file:
contained_names = output_file.getnames()
# Assert all files from the source directory appear in the output tar file.
for source_file in glob.iglob("./tests/container/testdata/files/*"):
self.assertIn('./{}/files/{}'.format(prefix, path.basename(source_file)), contained_names)
def testPackageNameParserValidMetadata(self):
metadata = """
Package: test
Description: Dummy
Version: 1.2.4
"""
self.assertEqual('test', TarFile.parse_pkg_name(metadata, "test.deb"))
def testPkgMetadataStatusFileName(self):
metadata = """Package: test
Description: Dummy
Version: 1.2.4
"""
with tempfile.TemporaryDirectory() as tmp:
# write control file into a metadata tar
control_file_name = path.join(tmp, "control")
with open(control_file_name, "w") as control_file:
control_file.write(metadata)
metadata_tar_file_name = path.join(tmp, "metadata.tar")
with tarfile.open(metadata_tar_file_name, "w") as metadata_tar_file:
metadata_tar_file.add(control_file_name, arcname="control")
output_file_name = path.join(tmp, "output.tar")
with TarFile(output_file_name, directory="/", compression=None, root_directory="./", default_mtime=None,
enable_mtime_preservation=False, xz_path="", force_posixpath=False) as output_file:
output_file.add_pkg_metadata(metadata_tar_file_name, "ignored.deb")
with tarfile.open(output_file_name) as output_file:
contained_names = output_file.getnames()
self.assertIn('./var/lib/dpkg/status.d/test', contained_names)
def testPackageNameParserInvalidMetadata(self):
metadata = "Package Name: Invalid"
self.assertEqual('test-invalid-pkg',
TarFile.parse_pkg_name(metadata, "some/path/test-invalid-pkg.deb"))
def testPkgMetadataMd5sumsFileName(self):
metadata = """Package: test
Description: Dummy
Version: 1.2.4
"""
md5sums ="""4006d28dbf6dfbe2c0fe695839e64cb3 usr/lib/python3/dist-packages/docutils/languages/cs.py
"""
with tempfile.TemporaryDirectory() as tmp:
# write control file into a metadata tar
control_file_name = path.join(tmp, "control")
with open(control_file_name, "w") as control_file:
control_file.write(metadata)
# write md5sums file into a metadata tar
md5sums_file_name = path.join(tmp, "md5sums")
with open(md5sums_file_name, "w") as md5sums_file:
md5sums_file.write(md5sums)
metadata_tar_file_name = path.join(tmp, "metadata.tar")
with tarfile.open(metadata_tar_file_name, "w") as metadata_tar_file:
metadata_tar_file.add(control_file_name, arcname="control")
metadata_tar_file.add(md5sums_file_name, arcname="md5sums")
output_file_name = path.join(tmp, "output.tar")
with TarFile(output_file_name, directory="/", compression=None, root_directory="./", default_mtime=None,
enable_mtime_preservation=False, xz_path="", force_posixpath=False) as output_file:
output_file.add_pkg_metadata(metadata_tar_file_name, "ignored.deb")
with tarfile.open(output_file_name) as output_file:
contained_names = output_file.getnames()
self.assertIn('./var/lib/dpkg/status.d/test', contained_names)
self.assertIn('./var/lib/dpkg/status.d/test.md5sums', contained_names)
if __name__ == '__main__':
unittest.main()
| {
"content_hash": "273a0012670baf2a28af9a059338ec0c",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 121,
"avg_line_length": 43.01754385964912,
"alnum_prop": 0.6859706362153344,
"repo_name": "bazelbuild/rules_docker",
"id": "e8f60aa6c942f56081b7127c2426a8cf201416a8",
"size": "5506",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/container/build_tar_test.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "1764"
},
{
"name": "Go",
"bytes": "133160"
},
{
"name": "Java",
"bytes": "3866"
},
{
"name": "Python",
"bytes": "129060"
},
{
"name": "Shell",
"bytes": "80094"
},
{
"name": "Smarty",
"bytes": "4686"
},
{
"name": "Starlark",
"bytes": "549095"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_101) on Mon Sep 19 15:00:46 UTC 2016 -->
<title>org.springframework.remoting.httpinvoker (Spring Framework 4.3.3.RELEASE API)</title><script>var _hmt = _hmt || [];(function() {var hm = document.createElement("script");hm.src = "//hm.baidu.com/hm.js?dd1361ca20a10cc161e72d4bc4fef6df";var s = document.getElementsByTagName("script")[0];s.parentNode.insertBefore(hm, s);})();</script>
<meta name="date" content="2016-09-19">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="org.springframework.remoting.httpinvoker (Spring Framework 4.3.3.RELEASE API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</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 class="aboutLanguage">Spring Framework</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/springframework/remoting/caucho/package-summary.html">Prev Package</a></li>
<li><a href="../../../../org/springframework/remoting/jaxws/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/springframework/remoting/httpinvoker/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.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">
<h1 title="Package" class="title">Package org.springframework.remoting.httpinvoker</h1>
<div class="docSummary">
<div class="block">Remoting classes for transparent Java-to-Java remoting via HTTP invokers.</div>
</div>
<p>See: <a href="#package.description">Description</a></p>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation">
<caption><span>Interface Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Interface</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/springframework/remoting/httpinvoker/HttpInvokerClientConfiguration.html" title="interface in org.springframework.remoting.httpinvoker">HttpInvokerClientConfiguration</a></td>
<td class="colLast">
<div class="block">Configuration interface for executing HTTP invoker requests.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/springframework/remoting/httpinvoker/HttpInvokerRequestExecutor.html" title="interface in org.springframework.remoting.httpinvoker">HttpInvokerRequestExecutor</a></td>
<td class="colLast">
<div class="block">Strategy interface for actual execution of an HTTP invoker request.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation">
<caption><span>Class Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/springframework/remoting/httpinvoker/AbstractHttpInvokerRequestExecutor.html" title="class in org.springframework.remoting.httpinvoker">AbstractHttpInvokerRequestExecutor</a></td>
<td class="colLast">
<div class="block">Abstract base implementation of the HttpInvokerRequestExecutor interface.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/springframework/remoting/httpinvoker/HttpComponentsHttpInvokerRequestExecutor.html" title="class in org.springframework.remoting.httpinvoker">HttpComponentsHttpInvokerRequestExecutor</a></td>
<td class="colLast">
<div class="block"><a href="../../../../org/springframework/remoting/httpinvoker/HttpInvokerRequestExecutor.html" title="interface in org.springframework.remoting.httpinvoker"><code>HttpInvokerRequestExecutor</code></a> implementation that uses
<a href="http://hc.apache.org/httpcomponents-client-ga/httpclient/">Apache HttpComponents HttpClient</a>
to execute POST requests.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/springframework/remoting/httpinvoker/HttpInvokerClientInterceptor.html" title="class in org.springframework.remoting.httpinvoker">HttpInvokerClientInterceptor</a></td>
<td class="colLast">
<div class="block"><a href="../../../../org/aopalliance/intercept/MethodInterceptor.html" title="interface in org.aopalliance.intercept"><code>MethodInterceptor</code></a> for accessing an
HTTP invoker service.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/springframework/remoting/httpinvoker/HttpInvokerProxyFactoryBean.html" title="class in org.springframework.remoting.httpinvoker">HttpInvokerProxyFactoryBean</a></td>
<td class="colLast">
<div class="block"><a href="../../../../org/springframework/beans/factory/FactoryBean.html" title="interface in org.springframework.beans.factory"><code>FactoryBean</code></a> for HTTP invoker proxies.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/springframework/remoting/httpinvoker/HttpInvokerServiceExporter.html" title="class in org.springframework.remoting.httpinvoker">HttpInvokerServiceExporter</a></td>
<td class="colLast">
<div class="block">Servlet-API-based HTTP request handler that exports the specified service bean
as HTTP invoker service endpoint, accessible via an HTTP invoker proxy.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/springframework/remoting/httpinvoker/SimpleHttpInvokerRequestExecutor.html" title="class in org.springframework.remoting.httpinvoker">SimpleHttpInvokerRequestExecutor</a></td>
<td class="colLast">
<div class="block">HttpInvokerRequestExecutor implementation that uses standard J2SE facilities
to execute POST requests, without support for HTTP authentication or
advanced configuration options.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/springframework/remoting/httpinvoker/SimpleHttpInvokerServiceExporter.html" title="class in org.springframework.remoting.httpinvoker">SimpleHttpInvokerServiceExporter</a></td>
<td class="colLast">
<div class="block">HTTP request handler that exports the specified service bean as
HTTP invoker service endpoint, accessible via an HTTP invoker proxy.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
<a name="package.description">
<!-- -->
</a>
<h2 title="Package org.springframework.remoting.httpinvoker Description">Package org.springframework.remoting.httpinvoker Description</h2>
<div class="block">Remoting classes for transparent Java-to-Java remoting via HTTP invokers.
Uses Java serialization just like RMI, but provides the same ease of setup
as Caucho's HTTP-based Hessian and Burlap protocols.
<p><b>HTTP invoker is the recommended protocol for Java-to-Java remoting.</b>
It is more powerful and more extensible than Hessian and Burlap, at the
expense of being tied to Java. Neverthelesss, it is as easy to set up as
Hessian and Burlap, which is its main advantage compared to RMI.</div>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</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 class="aboutLanguage">Spring Framework</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/springframework/remoting/caucho/package-summary.html">Prev Package</a></li>
<li><a href="../../../../org/springframework/remoting/jaxws/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/springframework/remoting/httpinvoker/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.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>
| {
"content_hash": "6f8debde468f3333fc39f0ed6713a860",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 340,
"avg_line_length": 46.57964601769911,
"alnum_prop": 0.7015294005889617,
"repo_name": "piterlin/piterlin.github.io",
"id": "7369094a5453a0471ee34447c145ae72d9daa337",
"size": "10527",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/spring4.3.3-docs/javadoc-api/org/springframework/remoting/httpinvoker/package-summary.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "479"
},
{
"name": "HTML",
"bytes": "9480869"
},
{
"name": "JavaScript",
"bytes": "246"
}
],
"symlink_target": ""
} |
package excelize
import "encoding/xml"
// xlsxComments directly maps the comments element from the namespace
// http://schemas.openxmlformats.org/spreadsheetml/2006/main. A comment is a
// rich text note that is attached to and associated with a cell, separate from
// other cell content. Comment content is stored separate from the cell, and is
// displayed in a drawing object (like a text box) that is separate from, but
// associated with, a cell. Comments are used as reminders, such as noting how a
// complex formula works, or to provide feedback to other users. Comments can
// also be used to explain assumptions made in a formula or to call out
// something special about the cell.
type xlsxComments struct {
XMLName xml.Name `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main comments"`
Authors []xlsxAuthor `xml:"authors"`
CommentList xlsxCommentList `xml:"commentList"`
}
// xlsxAuthor directly maps the author element. This element holds a string
// representing the name of a single author of comments. Every comment shall
// have an author. The maximum length of the author string is an implementation
// detail, but a good guideline is 255 chars.
type xlsxAuthor struct {
Author string `xml:"author"`
}
// xlsxCommentList (List of Comments) directly maps the xlsxCommentList element.
// This element is a container that holds a list of comments for the sheet.
type xlsxCommentList struct {
Comment []xlsxComment `xml:"comment"`
}
// xlsxComment directly maps the comment element. This element represents a
// single user entered comment. Each comment shall have an author and can
// optionally contain richly formatted text.
type xlsxComment struct {
Ref string `xml:"ref,attr"`
AuthorID int `xml:"authorId,attr"`
Text xlsxText `xml:"text"`
}
// xlsxText directly maps the text element. This element contains rich text
// which represents the text of a comment. The maximum length for this text is a
// spreadsheet application implementation detail. A recommended guideline is
// 32767 chars.
type xlsxText struct {
R []xlsxR `xml:"r"`
}
// formatComment directly maps the format settings of the comment.
type formatComment struct {
Author string `json:"author"`
Text string `json:"text"`
}
// Comment directly maps the comment information.
type Comment struct {
Author string `json:"author"`
AuthorID int `json:"author_id"`
Ref string `json:"ref"`
Text string `json:"text"`
}
| {
"content_hash": "0b21cf3b27b272df6ecea2a7d0b3d13c",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 103,
"avg_line_length": 39.36507936507937,
"alnum_prop": 0.7483870967741936,
"repo_name": "xlplbo/translate_tool",
"id": "9075c8873ab2adce4fc6de7ce47865ad1c59d903",
"size": "2952",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "vendor/github.com/360EntSecGroup-Skylar/excelize/xmlComments.go",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ActionScript",
"bytes": "6574"
},
{
"name": "Go",
"bytes": "58067"
},
{
"name": "HTML",
"bytes": "952"
},
{
"name": "Lua",
"bytes": "1701"
},
{
"name": "PHP",
"bytes": "5379"
}
],
"symlink_target": ""
} |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package helpers;
import java.math.BigDecimal;
/**
*
* @author Jurica
*/
public class FloatFunkcije {
public static float getCijena(float cijena, int mjesta) {
BigDecimal bd = new BigDecimal(Float.toString(cijena));
bd = bd.setScale(mjesta, BigDecimal.ROUND_HALF_UP);
return bd.floatValue();
}
}
| {
"content_hash": "96dd02de61fbd500684ec1ff0f702ebc",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 79,
"avg_line_length": 24.857142857142858,
"alnum_prop": 0.685823754789272,
"repo_name": "SuperJura/Exercises",
"id": "56b6d24059110f45afb8cff10e6b8be7c714c79f",
"size": "522",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "JavaExercises/JavaWebShop/WebShop/src/java/helpers/FloatFunkcije.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "7911"
},
{
"name": "CSS",
"bytes": "1297"
},
{
"name": "HTML",
"bytes": "10917"
},
{
"name": "Java",
"bytes": "187156"
},
{
"name": "JavaScript",
"bytes": "16197"
}
],
"symlink_target": ""
} |
'use strict';
const React = require('react');
const RNTesterListFilters = require('./RNTesterListFilters');
const {
StyleSheet,
TextInput,
View,
ScrollView,
Image,
} = require('react-native');
import {RNTesterThemeContext} from './RNTesterTheme';
import type {RNTesterExample} from '../types/RNTesterTypes';
import type {SectionData} from '../types/RNTesterTypes';
type Props = {
filter: Function,
render: Function,
disableSearch?: boolean,
testID?: string,
hideFilterPills?: boolean,
page: 'examples_page' | 'components_page' | 'bookmarks_page',
sections: SectionData[],
...
};
type State = {filter: string, category: string, ...};
class RNTesterExampleFilter extends React.Component<Props, State> {
state: State = {filter: '', category: ''};
render(): React.Node {
const filterText = this.state.filter;
let filterRegex = /.*/;
try {
filterRegex = new RegExp(String(filterText), 'i');
} catch (error) {
console.warn(
'Failed to create RegExp: %s\n%s',
filterText,
error.message,
);
}
const filter = example => {
const category = this.state.category;
return (
this.props.disableSearch ||
this.props.filter({example, filterRegex, category})
);
};
let filteredSections = this.props.sections.map(section => ({
...section,
data: section.data.filter(filter),
}));
if (this.state.filter.trim() !== '' || this.state.category.trim() !== '') {
filteredSections = filteredSections.filter(
section => section.title !== 'Recently Viewed',
);
}
return (
<View style={styles.container}>
{this._renderTextInput()}
{this._renderFilteredSections(filteredSections)}
</View>
);
}
_renderFilteredSections(filteredSections): ?React.Element<any> {
if (this.props.page === 'examples_page') {
return (
<ScrollView
keyboardShouldPersistTaps="handled"
keyboardDismissMode="interactive">
{this.props.render({filteredSections})}
{/**
* This is a fake list item. It is needed to provide the ScrollView some bottom padding.
* The height of this item is basically ScreenHeight - the height of (Header + bottom navbar)
* */}
<View style={{height: 350}} />
</ScrollView>
);
} else {
return this.props.render({filteredSections});
}
}
_renderTextInput(): ?React.Element<any> {
if (this.props.disableSearch) {
return null;
}
return (
<RNTesterThemeContext.Consumer>
{theme => {
return (
<View style={[styles.searchRow, {backgroundColor: '#F3F8FF'}]}>
<View style={styles.textInputStyle}>
<Image
source={require('../assets/search-icon.png')}
style={styles.searchIcon}
/>
<TextInput
autoCapitalize="none"
autoCorrect={false}
clearButtonMode="always"
onChangeText={text => {
this.setState(() => ({filter: text}));
}}
placeholder="Search..."
placeholderTextColor={theme.PlaceholderTextColor}
underlineColorAndroid="transparent"
style={[
styles.searchTextInput,
{
color: theme.LabelColor,
backgroundColor: theme.SecondaryGroupedBackgroundColor,
borderColor: theme.QuaternaryLabelColor,
},
]}
testID={this.props.testID}
value={this.state.filter}
/>
</View>
{!this.props.hideFilterPills && (
<RNTesterListFilters
onFilterButtonPress={filterLabel =>
this.setState({category: filterLabel})
}
/>
)}
</View>
);
}}
</RNTesterThemeContext.Consumer>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
searchRow: {
paddingHorizontal: 20,
paddingVertical: 10,
alignItems: 'center',
},
searchTextInput: {
borderRadius: 6,
borderWidth: 1,
paddingVertical: 0,
height: 35,
flex: 1,
alignSelf: 'center',
paddingLeft: 35,
},
textInputStyle: {
flexDirection: 'row',
alignItems: 'center',
position: 'relative',
right: 10,
},
searchIcon: {
width: 20,
height: 20,
position: 'relative',
top: 0,
left: 27,
zIndex: 2,
},
});
module.exports = RNTesterExampleFilter;
| {
"content_hash": "9ff7164710944afdce8e3bd613255c75",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 103,
"avg_line_length": 26.633333333333333,
"alnum_prop": 0.5469336670838548,
"repo_name": "hoangpham95/react-native",
"id": "efcefc5a2717c467240cc1c262da1f16f00b9b3c",
"size": "5005",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "packages/rn-tester/js/components/RNTesterExampleFilter.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "15392"
},
{
"name": "Awk",
"bytes": "121"
},
{
"name": "Batchfile",
"bytes": "683"
},
{
"name": "C",
"bytes": "202549"
},
{
"name": "C++",
"bytes": "681063"
},
{
"name": "CSS",
"bytes": "40393"
},
{
"name": "HTML",
"bytes": "172601"
},
{
"name": "IDL",
"bytes": "897"
},
{
"name": "Java",
"bytes": "2832751"
},
{
"name": "JavaScript",
"bytes": "3909263"
},
{
"name": "Makefile",
"bytes": "7566"
},
{
"name": "Objective-C",
"bytes": "1414603"
},
{
"name": "Objective-C++",
"bytes": "202130"
},
{
"name": "Prolog",
"bytes": "287"
},
{
"name": "Python",
"bytes": "136508"
},
{
"name": "Ruby",
"bytes": "7654"
},
{
"name": "Shell",
"bytes": "40287"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>exceptions: Not compatible</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / extra-dev</a></li>
<li class="active"><a href="">8.10.dev / exceptions - 8.6.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
exceptions
<small>
8.6.0
<span class="label label-info">Not compatible</span>
</small>
</h1>
<p><em><script>document.write(moment("2020-08-22 02:22:20 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-08-22 02:22:20 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-m4 1 Virtual package relying on m4
coq 8.10.dev Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.05.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.05.0 Official 4.05.0 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.8.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "Hugo.Herbelin@inria.fr"
homepage: "https://github.com/coq-contribs/exceptions"
license: "LGPL 2.1"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/Exceptions"]
depends: [
"ocaml"
"coq" {>= "8.6" & < "8.7~"}
]
tags: [ "keyword: exceptions" "keyword: continuations" "category: Computer Science/Semantics and Compilation/Semantics" ]
authors: [ "Pierre Castéran" ]
bug-reports: "https://github.com/coq-contribs/exceptions/issues"
dev-repo: "git+https://github.com/coq-contribs/exceptions.git"
synopsis: "Pro[gramm,v]ing with continuations:A development in Coq"
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/exceptions/archive/v8.6.0.tar.gz"
checksum: "md5=b4afde95bbfe2f0b1d91a1486ffd0b9e"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-exceptions.8.6.0 coq.8.10.dev</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.10.dev).
The following dependencies couldn't be met:
- coq-exceptions -> coq < 8.7~ -> ocaml < 4.05.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-exceptions.8.6.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
<small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small>
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "848d43ee04028ed2300747f438f398ac",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 157,
"avg_line_length": 41.79141104294479,
"alnum_prop": 0.5406635349383441,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "6bf07119d710cf371f670e7c8075bb3a69fb00d9",
"size": "6815",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.05.0-2.0.6/extra-dev/8.10.dev/exceptions/8.6.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports['default'] = uid;
var id = 0;
function uid() {
var prefix = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0];
return String(prefix + id++);
}
module.exports = exports['default']; | {
"content_hash": "30257567a2d3c96a4d56f17b1a2b3130",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 87,
"avg_line_length": 19.733333333333334,
"alnum_prop": 0.6351351351351351,
"repo_name": "catalinmiron/react-tinymce-mention",
"id": "150226b8476d4ba5e962cba1cbbb98edcf3f2bf9",
"size": "296",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "lib/mention/utils/uid.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "509"
},
{
"name": "JavaScript",
"bytes": "222460"
},
{
"name": "Shell",
"bytes": "1637"
}
],
"symlink_target": ""
} |
DoorBell is simple application that allow you to put your computer on an "Busy" mode, so people around you get noticed you are busy.
DoorBell is builded on top of [atom/Electron](https://github.com/atom/electron).
## Credits
* Michael Dobell - Idea Creator
* Miguel Moraleda - Developer
## Development
Javascript Style Guide: https://github.com/Jam3/Javascript-Code-Conventions
CSS Style Guide: https://github.com/Jam3/CSS-Style-Guide
```
git clone https://github.com/miguelmoraleda/doorbell.git
cd doorbell
npm install
npm run start
```
## Build
Currently we are supporting only OSX.
```
npm run build
```
## Next Steps
* Configurable shortcut.
* Configurable busy mode view. (Rectangle, Circle or none)
* Auto updater.
* Add a time based activation.
* Create new icon for the app.
## Contributing
Please feel free to send PR to this project.
## License
The MIT License (MIT) Copyright (c) 2015 Miguel Moraleda
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| {
"content_hash": "f219448bee5724f8ea8b016c1533e33d",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 460,
"avg_line_length": 46.26190476190476,
"alnum_prop": 0.7812660833762224,
"repo_name": "miguelmoraleda/doorbell",
"id": "5d9af9e652be3d0df79c31af7a38282ae996f1ca",
"size": "1954",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "256"
},
{
"name": "HTML",
"bytes": "2072"
},
{
"name": "JavaScript",
"bytes": "9977"
}
],
"symlink_target": ""
} |
namespace Kuki.Bss.Domain.Model
{
using System.Collections.Generic;
public class MasterData
{
public virtual string Version { get; set; }
public virtual string Signature { get; set; }
public virtual IEnumerable<DatapointType> DatapointTypes { get; set; }
public virtual IEnumerable<MediumType> MediumTypes { get; set; }
public virtual IEnumerable<MaskVersion> MaskVersions { get; set; }
public virtual IEnumerable<Manufacturer> Manufacturers { get; set; }
public virtual IEnumerable<Language> Languages { get; set; }
}
} | {
"content_hash": "73d542a49794e14f627c62aa89587468",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 78,
"avg_line_length": 39.6,
"alnum_prop": 0.6835016835016835,
"repo_name": "Privux/the-bus",
"id": "7ff7a2e59f84a641f18b9628a28ae1029c2fe540",
"size": "596",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Kuki.Bss.Domain.Model/MasterData.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "134481"
}
],
"symlink_target": ""
} |
Survey::Engine.routes.draw do
root to: 'pages#home'
end
| {
"content_hash": "ada6955d44ec721b2065213b12acbd94",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 29,
"avg_line_length": 19.333333333333332,
"alnum_prop": 0.7241379310344828,
"repo_name": "csahlman/angular-survey",
"id": "bb02697a5304f6a4e0528d20c718fc929102874e",
"size": "58",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "config/routes.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "101530"
},
{
"name": "JavaScript",
"bytes": "1198"
},
{
"name": "Ruby",
"bytes": "14133"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="MavenImportPreferences">
<option name="generalSettings">
<MavenGeneralSettings>
<option name="mavenHome" value="Bundled (Maven 3)" />
</MavenGeneralSettings>
</option>
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
</list>
</value>
</option>
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
<component name="masterDetails">
<states>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.33380085" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project> | {
"content_hash": "1596708b3b4fef2962321774754297ca",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 176,
"avg_line_length": 41.7536231884058,
"alnum_prop": 0.633113502256161,
"repo_name": "socoolby/android_guid_page",
"id": "a037db20e99b4405918c9ab129b140ae551bd774",
"size": "2881",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": ".idea/misc.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Groovy",
"bytes": "844"
},
{
"name": "Java",
"bytes": "203463"
}
],
"symlink_target": ""
} |
"""Quote strings to be valid DOT identifiers, assemble quoted attribute lists."""
import functools
import re
import typing
import warnings
from . import _tools
from . import exceptions
__all__ = ['quote', 'quote_edge',
'a_list', 'attr_list',
'escape', 'nohtml']
# https://www.graphviz.org/doc/info/lang.html
# https://www.graphviz.org/doc/info/attrs.html#k:escString
HTML_STRING = re.compile(r'<.*>$', re.DOTALL)
ID = re.compile(r'([a-zA-Z_][a-zA-Z0-9_]*|-?(\.[0-9]+|[0-9]+(\.[0-9]*)?))$')
KEYWORDS = {'node', 'edge', 'graph', 'digraph', 'subgraph', 'strict'}
COMPASS = {'n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw', 'c', '_'} # TODO
FINAL_ODD_BACKSLASHES = re.compile(r'(?<!\\)(?:\\{2})*\\$')
QUOTE_WITH_OPTIONAL_BACKSLASHES = re.compile(r'''
(?P<escaped_backslashes>(?:\\{2})*)
\\? # treat \" same as "
(?P<literal_quote>")
''', flags=re.VERBOSE)
ESCAPE_UNESCAPED_QUOTES = functools.partial(QUOTE_WITH_OPTIONAL_BACKSLASHES.sub,
r'\g<escaped_backslashes>'
r'\\'
r'\g<literal_quote>')
@_tools.deprecate_positional_args(supported_number=1)
def quote(identifier: str,
is_html_string=HTML_STRING.match,
is_valid_id=ID.match,
dot_keywords=KEYWORDS,
endswith_odd_number_of_backslashes=FINAL_ODD_BACKSLASHES.search,
escape_unescaped_quotes=ESCAPE_UNESCAPED_QUOTES) -> str:
r"""Return DOT identifier from string, quote if needed.
>>> quote('') # doctest: +NO_EXE
'""'
>>> quote('spam')
'spam'
>>> quote('spam spam')
'"spam spam"'
>>> quote('-4.2')
'-4.2'
>>> quote('.42')
'.42'
>>> quote('<<b>spam</b>>')
'<<b>spam</b>>'
>>> quote(nohtml('<>'))
'"<>"'
>>> print(quote('"'))
"\""
>>> print(quote('\\"'))
"\""
>>> print(quote('\\\\"'))
"\\\""
>>> print(quote('\\\\\\"'))
"\\\""
"""
if is_html_string(identifier) and not isinstance(identifier, NoHtml):
pass
elif not is_valid_id(identifier) or identifier.lower() in dot_keywords:
if endswith_odd_number_of_backslashes(identifier):
warnings.warn('expect syntax error scanning invalid quoted string:'
f' {identifier!r}',
category=exceptions.DotSyntaxWarning)
return f'"{escape_unescaped_quotes(identifier)}"'
return identifier
def quote_edge(identifier: str) -> str:
"""Return DOT edge statement node_id from string, quote if needed.
>>> quote_edge('spam') # doctest: +NO_EXE
'spam'
>>> quote_edge('spam spam:eggs eggs')
'"spam spam":"eggs eggs"'
>>> quote_edge('spam:eggs:s')
'spam:eggs:s'
"""
node, _, rest = identifier.partition(':')
parts = [quote(node)]
if rest:
port, _, compass = rest.partition(':')
parts.append(quote(port))
if compass:
parts.append(compass)
return ':'.join(parts)
@_tools.deprecate_positional_args(supported_number=1)
def a_list(label: typing.Optional[str] = None,
kwargs=None, attributes=None) -> str:
"""Return assembled DOT a_list string.
>>> a_list('spam', kwargs={'spam': None, 'ham': 'ham ham', 'eggs': ''}) # doctest: +NO_EXE
'label=spam eggs="" ham="ham ham"'
"""
result = [f'label={quote(label)}'] if label is not None else []
if kwargs:
result += [f'{quote(k)}={quote(v)}'
for k, v in _tools.mapping_items(kwargs) if v is not None]
if attributes:
if hasattr(attributes, 'items'):
attributes = _tools.mapping_items(attributes)
result += [f'{quote(k)}={quote(v)}'
for k, v in attributes if v is not None]
return ' '.join(result)
@_tools.deprecate_positional_args(supported_number=1)
def attr_list(label: typing.Optional[str] = None,
kwargs=None, attributes=None) -> str:
"""Return assembled DOT attribute list string.
Sorts ``kwargs`` and ``attributes`` if they are plain dicts
(to avoid unpredictable order from hash randomization in Python < 3.7).
>>> attr_list() # doctest: +NO_EXE
''
>>> attr_list('spam spam', kwargs={'eggs': 'eggs', 'ham': 'ham ham'})
' [label="spam spam" eggs=eggs ham="ham ham"]'
>>> attr_list(kwargs={'spam': None, 'eggs': ''})
' [eggs=""]'
"""
content = a_list(label, kwargs=kwargs, attributes=attributes)
if not content:
return ''
return f' [{content}]'
class Quote:
"""Quote strings to be valid DOT identifiers, assemble quoted attribute lists."""
_quote = staticmethod(quote)
_quote_edge = staticmethod(quote_edge)
_a_list = staticmethod(a_list)
_attr_list = staticmethod(attr_list)
def escape(s: str) -> str:
r"""Return string disabling special meaning of backslashes and ``'<...>'``.
Args:
s: String in which backslashes and ``'<...>'``
should be treated as literal.
Returns:
Escaped string subclass instance.
Raises:
TypeError: If ``s`` is not a ``str``.
Example:
>>> import graphviz # doctest: +NO_EXE
>>> print(graphviz.escape(r'\l'))
\\l
See also:
Upstream documentation:
https://www.graphviz.org/doc/info/attrs.html#k:escString
"""
return nohtml(s.replace('\\', '\\\\'))
class NoHtml(str):
"""String subclass that does not treat ``'<...>'`` as DOT HTML string."""
__slots__ = ()
def nohtml(s: str) -> str:
"""Return string not treating ``'<...>'`` as DOT HTML string in quoting.
Args:
s: String in which leading ``'<'`` and trailing ``'>'``
should be treated as literal.
Returns:
String subclass instance.
Raises:
TypeError: If ``s`` is not a ``str``.
Example:
>>> import graphviz # doctest: +NO_EXE
>>> g = graphviz.Graph()
>>> g.node(graphviz.nohtml('<>-*-<>'))
>>> print(g.source) # doctest: +NORMALIZE_WHITESPACE
graph {
"<>-*-<>"
}
"""
return NoHtml(s)
| {
"content_hash": "cf7154371fcf19d1cd51750bd7a80f23",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 95,
"avg_line_length": 28.70135746606335,
"alnum_prop": 0.5391770455620369,
"repo_name": "xflr6/graphviz",
"id": "e5297f8c9710152cf3fc453cd8b92625e37f1aa4",
"size": "6343",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "graphviz/quoting.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "196982"
}
],
"symlink_target": ""
} |
import datetime
import decimal
import uuid
from functools import lru_cache
from itertools import chain
from django.conf import settings
from django.core.exceptions import FieldError
from django.db import DatabaseError, NotSupportedError, models
from django.db.backends.base.operations import BaseDatabaseOperations
from django.db.models.expressions import Col
from django.utils import timezone
from django.utils.dateparse import parse_date, parse_datetime, parse_time
from django.utils.functional import cached_property
class DatabaseOperations(BaseDatabaseOperations):
cast_char_field_without_max_length = 'text'
cast_data_types = {
'DateField': 'TEXT',
'DateTimeField': 'TEXT',
}
explain_prefix = 'EXPLAIN QUERY PLAN'
def bulk_batch_size(self, fields, objs):
"""
SQLite has a compile-time default (SQLITE_LIMIT_VARIABLE_NUMBER) of
999 variables per query.
If there's only a single field to insert, the limit is 500
(SQLITE_MAX_COMPOUND_SELECT).
"""
if len(fields) == 1:
return 500
elif len(fields) > 1:
return self.connection.features.max_query_params // len(fields)
else:
return len(objs)
def check_expression_support(self, expression):
bad_fields = (models.DateField, models.DateTimeField, models.TimeField)
bad_aggregates = (models.Sum, models.Avg, models.Variance, models.StdDev)
if isinstance(expression, bad_aggregates):
for expr in expression.get_source_expressions():
try:
output_field = expr.output_field
except (AttributeError, FieldError):
# Not every subexpression has an output_field which is fine
# to ignore.
pass
else:
if isinstance(output_field, bad_fields):
raise NotSupportedError(
'You cannot use Sum, Avg, StdDev, and Variance '
'aggregations on date/time fields in sqlite3 '
'since date/time is saved as text.'
)
if (
isinstance(expression, models.Aggregate) and
expression.distinct and
len(expression.source_expressions) > 1
):
raise NotSupportedError(
"SQLite doesn't support DISTINCT on aggregate functions "
"accepting multiple arguments."
)
def date_extract_sql(self, lookup_type, field_name):
"""
Support EXTRACT with a user-defined function django_date_extract()
that's registered in connect(). Use single quotes because this is a
string and could otherwise cause a collision with a field name.
"""
return "django_date_extract('%s', %s)" % (lookup_type.lower(), field_name)
def format_for_duration_arithmetic(self, sql):
"""Do nothing since formatting is handled in the custom function."""
return sql
def date_trunc_sql(self, lookup_type, field_name, tzname=None):
return "django_date_trunc('%s', %s, %s, %s)" % (
lookup_type.lower(),
field_name,
*self._convert_tznames_to_sql(tzname),
)
def time_trunc_sql(self, lookup_type, field_name, tzname=None):
return "django_time_trunc('%s', %s, %s, %s)" % (
lookup_type.lower(),
field_name,
*self._convert_tznames_to_sql(tzname),
)
def _convert_tznames_to_sql(self, tzname):
if tzname and settings.USE_TZ:
return "'%s'" % tzname, "'%s'" % self.connection.timezone_name
return 'NULL', 'NULL'
def datetime_cast_date_sql(self, field_name, tzname):
return 'django_datetime_cast_date(%s, %s, %s)' % (
field_name, *self._convert_tznames_to_sql(tzname),
)
def datetime_cast_time_sql(self, field_name, tzname):
return 'django_datetime_cast_time(%s, %s, %s)' % (
field_name, *self._convert_tznames_to_sql(tzname),
)
def datetime_extract_sql(self, lookup_type, field_name, tzname):
return "django_datetime_extract('%s', %s, %s, %s)" % (
lookup_type.lower(), field_name, *self._convert_tznames_to_sql(tzname),
)
def datetime_trunc_sql(self, lookup_type, field_name, tzname):
return "django_datetime_trunc('%s', %s, %s, %s)" % (
lookup_type.lower(), field_name, *self._convert_tznames_to_sql(tzname),
)
def time_extract_sql(self, lookup_type, field_name):
return "django_time_extract('%s', %s)" % (lookup_type.lower(), field_name)
def pk_default_value(self):
return "NULL"
def _quote_params_for_last_executed_query(self, params):
"""
Only for last_executed_query! Don't use this to execute SQL queries!
"""
# This function is limited both by SQLITE_LIMIT_VARIABLE_NUMBER (the
# number of parameters, default = 999) and SQLITE_MAX_COLUMN (the
# number of return values, default = 2000). Since Python's sqlite3
# module doesn't expose the get_limit() C API, assume the default
# limits are in effect and split the work in batches if needed.
BATCH_SIZE = 999
if len(params) > BATCH_SIZE:
results = ()
for index in range(0, len(params), BATCH_SIZE):
chunk = params[index:index + BATCH_SIZE]
results += self._quote_params_for_last_executed_query(chunk)
return results
sql = 'SELECT ' + ', '.join(['QUOTE(?)'] * len(params))
# Bypass Django's wrappers and use the underlying sqlite3 connection
# to avoid logging this query - it would trigger infinite recursion.
cursor = self.connection.connection.cursor()
# Native sqlite3 cursors cannot be used as context managers.
try:
return cursor.execute(sql, params).fetchone()
finally:
cursor.close()
def last_executed_query(self, cursor, sql, params):
# Python substitutes parameters in Modules/_sqlite/cursor.c with:
# pysqlite_statement_bind_parameters(self->statement, parameters, allow_8bit_chars);
# Unfortunately there is no way to reach self->statement from Python,
# so we quote and substitute parameters manually.
if params:
if isinstance(params, (list, tuple)):
params = self._quote_params_for_last_executed_query(params)
else:
values = tuple(params.values())
values = self._quote_params_for_last_executed_query(values)
params = dict(zip(params, values))
return sql % params
# For consistency with SQLiteCursorWrapper.execute(), just return sql
# when there are no parameters. See #13648 and #17158.
else:
return sql
def quote_name(self, name):
if name.startswith('"') and name.endswith('"'):
return name # Quoting once is enough.
return '"%s"' % name
def no_limit_value(self):
return -1
def __references_graph(self, table_name):
query = """
WITH tables AS (
SELECT %s name
UNION
SELECT sqlite_master.name
FROM sqlite_master
JOIN tables ON (sql REGEXP %s || tables.name || %s)
) SELECT name FROM tables;
"""
params = (
table_name,
r'(?i)\s+references\s+("|\')?',
r'("|\')?\s*\(',
)
with self.connection.cursor() as cursor:
results = cursor.execute(query, params)
return [row[0] for row in results.fetchall()]
@cached_property
def _references_graph(self):
# 512 is large enough to fit the ~330 tables (as of this writing) in
# Django's test suite.
return lru_cache(maxsize=512)(self.__references_graph)
def sql_flush(self, style, tables, *, reset_sequences=False, allow_cascade=False):
if tables and allow_cascade:
# Simulate TRUNCATE CASCADE by recursively collecting the tables
# referencing the tables to be flushed.
tables = set(chain.from_iterable(self._references_graph(table) for table in tables))
sql = ['%s %s %s;' % (
style.SQL_KEYWORD('DELETE'),
style.SQL_KEYWORD('FROM'),
style.SQL_FIELD(self.quote_name(table))
) for table in tables]
if reset_sequences:
sequences = [{'table': table} for table in tables]
sql.extend(self.sequence_reset_by_name_sql(style, sequences))
return sql
def sequence_reset_by_name_sql(self, style, sequences):
if not sequences:
return []
return [
'%s %s %s %s = 0 %s %s %s (%s);' % (
style.SQL_KEYWORD('UPDATE'),
style.SQL_TABLE(self.quote_name('sqlite_sequence')),
style.SQL_KEYWORD('SET'),
style.SQL_FIELD(self.quote_name('seq')),
style.SQL_KEYWORD('WHERE'),
style.SQL_FIELD(self.quote_name('name')),
style.SQL_KEYWORD('IN'),
', '.join([
"'%s'" % sequence_info['table'] for sequence_info in sequences
]),
),
]
def adapt_datetimefield_value(self, value):
if value is None:
return None
# Expression values are adapted by the database.
if hasattr(value, 'resolve_expression'):
return value
# SQLite doesn't support tz-aware datetimes
if timezone.is_aware(value):
if settings.USE_TZ:
value = timezone.make_naive(value, self.connection.timezone)
else:
raise ValueError("SQLite backend does not support timezone-aware datetimes when USE_TZ is False.")
return str(value)
def adapt_timefield_value(self, value):
if value is None:
return None
# Expression values are adapted by the database.
if hasattr(value, 'resolve_expression'):
return value
# SQLite doesn't support tz-aware datetimes
if timezone.is_aware(value):
raise ValueError("SQLite backend does not support timezone-aware times.")
return str(value)
def get_db_converters(self, expression):
converters = super().get_db_converters(expression)
internal_type = expression.output_field.get_internal_type()
if internal_type == 'DateTimeField':
converters.append(self.convert_datetimefield_value)
elif internal_type == 'DateField':
converters.append(self.convert_datefield_value)
elif internal_type == 'TimeField':
converters.append(self.convert_timefield_value)
elif internal_type == 'DecimalField':
converters.append(self.get_decimalfield_converter(expression))
elif internal_type == 'UUIDField':
converters.append(self.convert_uuidfield_value)
elif internal_type in ('NullBooleanField', 'BooleanField'):
converters.append(self.convert_booleanfield_value)
return converters
def convert_datetimefield_value(self, value, expression, connection):
if value is not None:
if not isinstance(value, datetime.datetime):
value = parse_datetime(value)
if settings.USE_TZ and not timezone.is_aware(value):
value = timezone.make_aware(value, self.connection.timezone)
return value
def convert_datefield_value(self, value, expression, connection):
if value is not None:
if not isinstance(value, datetime.date):
value = parse_date(value)
return value
def convert_timefield_value(self, value, expression, connection):
if value is not None:
if not isinstance(value, datetime.time):
value = parse_time(value)
return value
def get_decimalfield_converter(self, expression):
# SQLite stores only 15 significant digits. Digits coming from
# float inaccuracy must be removed.
create_decimal = decimal.Context(prec=15).create_decimal_from_float
if isinstance(expression, Col):
quantize_value = decimal.Decimal(1).scaleb(-expression.output_field.decimal_places)
def converter(value, expression, connection):
if value is not None:
return create_decimal(value).quantize(quantize_value, context=expression.output_field.context)
else:
def converter(value, expression, connection):
if value is not None:
return create_decimal(value)
return converter
def convert_uuidfield_value(self, value, expression, connection):
if value is not None:
value = uuid.UUID(value)
return value
def convert_booleanfield_value(self, value, expression, connection):
return bool(value) if value in (1, 0) else value
def bulk_insert_sql(self, fields, placeholder_rows):
return " UNION ALL ".join(
"SELECT %s" % ", ".join(row)
for row in placeholder_rows
)
def combine_expression(self, connector, sub_expressions):
# SQLite doesn't have a ^ operator, so use the user-defined POWER
# function that's registered in connect().
if connector == '^':
return 'POWER(%s)' % ','.join(sub_expressions)
elif connector == '#':
return 'BITXOR(%s)' % ','.join(sub_expressions)
return super().combine_expression(connector, sub_expressions)
def combine_duration_expression(self, connector, sub_expressions):
if connector not in ['+', '-']:
raise DatabaseError('Invalid connector for timedelta: %s.' % connector)
fn_params = ["'%s'" % connector] + sub_expressions
if len(fn_params) > 3:
raise ValueError('Too many params for timedelta operations.')
return "django_format_dtdelta(%s)" % ', '.join(fn_params)
def integer_field_range(self, internal_type):
# SQLite doesn't enforce any integer constraints
return (None, None)
def subtract_temporals(self, internal_type, lhs, rhs):
lhs_sql, lhs_params = lhs
rhs_sql, rhs_params = rhs
params = (*lhs_params, *rhs_params)
if internal_type == 'TimeField':
return 'django_time_diff(%s, %s)' % (lhs_sql, rhs_sql), params
return 'django_timestamp_diff(%s, %s)' % (lhs_sql, rhs_sql), params
def insert_statement(self, ignore_conflicts=False):
return 'INSERT OR IGNORE INTO' if ignore_conflicts else super().insert_statement(ignore_conflicts)
| {
"content_hash": "9b87dc4f7ee1ec4912f04a7828b982a4",
"timestamp": "",
"source": "github",
"line_count": 364,
"max_line_length": 114,
"avg_line_length": 41.027472527472526,
"alnum_prop": 0.5985000669612963,
"repo_name": "wkschwartz/django",
"id": "71ef000c93c5c16c3fbe6c00a71c93ac969c2629",
"size": "14934",
"binary": false,
"copies": "3",
"ref": "refs/heads/stable/3.2.x",
"path": "django/db/backends/sqlite3/operations.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "43253"
},
{
"name": "HTML",
"bytes": "171790"
},
{
"name": "JavaScript",
"bytes": "105066"
},
{
"name": "Makefile",
"bytes": "125"
},
{
"name": "Python",
"bytes": "11050239"
},
{
"name": "Shell",
"bytes": "809"
},
{
"name": "Smarty",
"bytes": "130"
}
],
"symlink_target": ""
} |
package org.ontosoft.client.application;
import com.gwtplatform.mvp.client.View;
public interface ParameterizedView extends View {
public void initializeParameters(String[] parameters);
}
| {
"content_hash": "f5b13c1f2a850e54a2083a10172a6b0a",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 56,
"avg_line_length": 27.428571428571427,
"alnum_prop": 0.8177083333333334,
"repo_name": "saumishr/ontosoft",
"id": "6788e0b5da665b9aa6eb79dcadfacc77dc17935c",
"size": "192",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "client/src/main/java/org/ontosoft/client/application/ParameterizedView.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "13990"
},
{
"name": "HTML",
"bytes": "1167"
},
{
"name": "Java",
"bytes": "446553"
},
{
"name": "JavaScript",
"bytes": "10963"
},
{
"name": "Web Ontology Language",
"bytes": "58202"
}
],
"symlink_target": ""
} |
/* ###
* IP: GHIDRA
*
* 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 ghidra.file.formats.ios.img3.tag;
import ghidra.app.util.bin.BinaryReader;
import ghidra.file.formats.ios.img3.AbstractImg3Tag;
import java.io.IOException;
public class TypeTag extends AbstractImg3Tag {
private int type;
private int unknown0;
private int unknown1;
private int unknown2;
private int unknown3;
TypeTag(BinaryReader reader) throws IOException {
super(reader);
type = reader.readNextInt();
unknown0 = reader.readNextInt();
unknown1 = reader.readNextInt();
unknown2 = reader.readNextInt();
unknown3 = reader.readNextInt();
}
public int getType() {
return type;
}
public int getUnknown0() {
return unknown0;
}
public int getUnknown1() {
return unknown1;
}
public int getUnknown2() {
return unknown2;
}
public int getUnknown3() {
return unknown3;
}
}
| {
"content_hash": "a2d8ea0c94bbc31bfa0fb77839bb5e7b",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 75,
"avg_line_length": 25.70909090909091,
"alnum_prop": 0.7227722772277227,
"repo_name": "NationalSecurityAgency/ghidra",
"id": "a4c7eb74c2a8e32582f70a2b3f4d9af56cae18a2",
"size": "1414",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/ios/img3/tag/TypeTag.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "77536"
},
{
"name": "Batchfile",
"bytes": "21610"
},
{
"name": "C",
"bytes": "1132868"
},
{
"name": "C++",
"bytes": "7334484"
},
{
"name": "CSS",
"bytes": "75788"
},
{
"name": "GAP",
"bytes": "102771"
},
{
"name": "GDB",
"bytes": "3094"
},
{
"name": "HTML",
"bytes": "4121163"
},
{
"name": "Hack",
"bytes": "31483"
},
{
"name": "Haskell",
"bytes": "453"
},
{
"name": "Java",
"bytes": "88669329"
},
{
"name": "JavaScript",
"bytes": "1109"
},
{
"name": "Lex",
"bytes": "22193"
},
{
"name": "Makefile",
"bytes": "15883"
},
{
"name": "Objective-C",
"bytes": "23937"
},
{
"name": "Pawn",
"bytes": "82"
},
{
"name": "Python",
"bytes": "587415"
},
{
"name": "Shell",
"bytes": "234945"
},
{
"name": "TeX",
"bytes": "54049"
},
{
"name": "XSLT",
"bytes": "15056"
},
{
"name": "Xtend",
"bytes": "115955"
},
{
"name": "Yacc",
"bytes": "127754"
}
],
"symlink_target": ""
} |
package org.apache.struts2.rest;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.ConfigurationManager;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import org.apache.struts2.dispatcher.mapper.DefaultActionMapper;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
/**
* <!-- START SNIPPET: description -->
*
* This Restful action mapper enforces Ruby-On-Rails Rest-style mappings. If the method
* is not specified (via '!' or 'method:' prefix), the method is "guessed" at using
* ReST-style conventions that examine the URL and the HTTP method. Special care has
* been given to ensure this mapper works correctly with the codebehind plugin so that
* XML configuration is unnecessary.
*
* <p>
* This mapper supports the following parameters:
* </p>
* <ul>
* <li><code>struts.mapper.idParameterName</code> - If set, this value will be the name
* of the parameter under which the id is stored. The id will then be removed
* from the action name. Whether or not the method is specified, the mapper will
* try to truncate the identifier from the url and store it as a parameter.
* </li>
* <li><code>struts.mapper.indexMethodName</code> - The method name to call for a GET
* request with no id parameter. Defaults to 'index'.
* </li>
* <li><code>struts.mapper.getMethodName</code> - The method name to call for a GET
* request with an id parameter. Defaults to 'show'.
* </li>
* <li><code>struts.mapper.postMethodName</code> - The method name to call for a POST
* request with no id parameter. Defaults to 'create'.
* </li>
* <li><code>struts.mapper.putMethodName</code> - The method name to call for a PUT
* request with an id parameter. Defaults to 'update'.
* </li>
* <li><code>struts.mapper.deleteMethodName</code> - The method name to call for a DELETE
* request with an id parameter. Defaults to 'destroy'.
* </li>
* <li><code>struts.mapper.editMethodName</code> - The method name to call for a GET
* request with an id parameter and the 'edit' view specified. Defaults to 'edit'.
* </li>
* <li><code>struts.mapper.newMethodName</code> - The method name to call for a GET
* request with no id parameter and the 'new' view specified. Defaults to 'editNew'.
* </li>
* </ul>
* <p>
* The following URL's will invoke its methods:
* </p>
* <ul>
* <li><code>GET: /movies => method="index"</code></li>
* <li><code>GET: /movies/Thrillers => method="show", id="Thrillers"</code></li>
* <li><code>GET: /movies/Thrillers;edit => method="edit", id="Thrillers"</code></li>
* <li><code>GET: /movies/Thrillers/edit => method="edit", id="Thrillers"</code></li>
* <li><code>GET: /movies/new => method="editNew"</code></li>
* <li><code>POST: /movies => method="create"</code></li>
* <li><code>PUT: /movies/Thrillers => method="update", id="Thrillers"</code></li>
* <li><code>DELETE: /movies/Thrillers => method="destroy", id="Thrillers"</code></li>
* </ul>
* <p>
* To simulate the HTTP methods PUT and DELETE, since they aren't supported by HTML,
* the HTTP parameter "_method" will be used.
* </p>
* <!-- END SNIPPET: description -->
*/
public class RestActionMapper extends DefaultActionMapper {
protected static final Logger LOG = LoggerFactory.getLogger(RestActionMapper.class);
public static final String HTTP_METHOD_PARAM = "_method";
private String idParameterName = "id";
private String indexMethodName = "index";
private String getMethodName = "show";
private String postMethodName = "create";
private String editMethodName = "edit";
private String newMethodName = "editNew";
private String deleteMethodName = "destroy";
private String putMethodName = "update";
private String optionsMethodName = "options";
private String postContinueMethodName = "createContinue";
private String putContinueMethodName = "updateContinue";
private boolean allowDynamicMethodCalls = true;
public RestActionMapper() {
}
public String getIdParameterName() {
return idParameterName;
}
@Inject(required=false,value=StrutsConstants.STRUTS_ID_PARAMETER_NAME)
public void setIdParameterName(String idParameterName) {
this.idParameterName = idParameterName;
}
@Inject(required=false,value="struts.mapper.indexMethodName")
public void setIndexMethodName(String indexMethodName) {
this.indexMethodName = indexMethodName;
}
@Inject(required=false,value="struts.mapper.getMethodName")
public void setGetMethodName(String getMethodName) {
this.getMethodName = getMethodName;
}
@Inject(required=false,value="struts.mapper.postMethodName")
public void setPostMethodName(String postMethodName) {
this.postMethodName = postMethodName;
}
@Inject(required=false,value="struts.mapper.editMethodName")
public void setEditMethodName(String editMethodName) {
this.editMethodName = editMethodName;
}
@Inject(required=false,value="struts.mapper.newMethodName")
public void setNewMethodName(String newMethodName) {
this.newMethodName = newMethodName;
}
@Inject(required=false,value="struts.mapper.deleteMethodName")
public void setDeleteMethodName(String deleteMethodName) {
this.deleteMethodName = deleteMethodName;
}
@Inject(required=false,value="struts.mapper.putMethodName")
public void setPutMethodName(String putMethodName) {
this.putMethodName = putMethodName;
}
@Inject(required=false,value="struts.mapper.optionsMethodName")
public void setOptionsMethodName(String optionsMethodName) {
this.optionsMethodName = optionsMethodName;
}
@Inject(required=false,value="struts.mapper.postContinueMethodName")
public void setPostContinueMethodName(String postContinueMethodName) {
this.postContinueMethodName = postContinueMethodName;
}
@Inject(required=false,value="struts.mapper.putContinueMethodName")
public void setPutContinueMethodName(String putContinueMethodName) {
this.putContinueMethodName = putContinueMethodName;
}
@Inject(required = false, value = StrutsConstants.STRUTS_ENABLE_DYNAMIC_METHOD_INVOCATION)
public void setAllowDynamicMethodCalls(String allowDynamicMethodCalls) {
this.allowDynamicMethodCalls = "true".equalsIgnoreCase(allowDynamicMethodCalls);
}
public ActionMapping getMapping(HttpServletRequest request,
ConfigurationManager configManager) {
ActionMapping mapping = new ActionMapping();
String uri = getUri(request);
uri = dropExtension(uri, mapping);
if (uri == null) {
return null;
}
parseNameAndNamespace(uri, mapping, configManager);
handleSpecialParameters(request, mapping);
if (mapping.getName() == null) {
return null;
}
// handle "name!method" convention.
handleDynamicMethodInvocation(mapping, mapping.getName());
String fullName = mapping.getName();
// Only try something if the action name is specified
if (fullName != null && fullName.length() > 0) {
// cut off any ;jsessionid= type appendix but allow the rails-like ;edit
int scPos = fullName.indexOf(';');
if (scPos > -1 && !"edit".equals(fullName.substring(scPos + 1))) {
fullName = fullName.substring(0, scPos);
}
int lastSlashPos = fullName.lastIndexOf('/');
String id = null;
if (lastSlashPos > -1) {
// fun trickery to parse 'actionName/id/methodName' in the case of 'animals/dog/edit'
int prevSlashPos = fullName.lastIndexOf('/', lastSlashPos - 1);
if (prevSlashPos > -1) {
mapping.setMethod(fullName.substring(lastSlashPos + 1));
fullName = fullName.substring(0, lastSlashPos);
lastSlashPos = prevSlashPos;
}
id = fullName.substring(lastSlashPos + 1);
}
// If a method hasn't been explicitly named, try to guess using ReST-style patterns
if (mapping.getMethod() == null) {
if (isOptions(request)) {
mapping.setMethod(optionsMethodName);
// Handle uris with no id, possibly ending in '/'
} else if (lastSlashPos == -1 || lastSlashPos == fullName.length() -1) {
// Index e.g. foo
if (isGet(request)) {
mapping.setMethod(indexMethodName);
// Creating a new entry on POST e.g. foo
} else if (isPost(request)) {
if (isExpectContinue(request)) {
mapping.setMethod(postContinueMethodName);
} else {
mapping.setMethod(postMethodName);
}
}
// Handle uris with an id at the end
} else if (id != null) {
// Viewing the form to edit an item e.g. foo/1;edit
if (isGet(request) && id.endsWith(";edit")) {
id = id.substring(0, id.length() - ";edit".length());
mapping.setMethod(editMethodName);
// Viewing the form to create a new item e.g. foo/new
} else if (isGet(request) && "new".equals(id)) {
mapping.setMethod(newMethodName);
// Removing an item e.g. foo/1
} else if (isDelete(request)) {
mapping.setMethod(deleteMethodName);
// Viewing an item e.g. foo/1
} else if (isGet(request)) {
mapping.setMethod(getMethodName);
// Updating an item e.g. foo/1
} else if (isPut(request)) {
if (isExpectContinue(request)) {
mapping.setMethod(putContinueMethodName);
} else {
mapping.setMethod(putMethodName);
}
}
}
}
// cut off the id parameter, even if a method is specified
if (id != null) {
if (!"new".equals(id)) {
if (mapping.getParams() == null) {
mapping.setParams(new HashMap());
}
mapping.getParams().put(idParameterName, new String[]{id});
}
fullName = fullName.substring(0, lastSlashPos);
}
mapping.setName(fullName);
return mapping;
}
// if action name isn't specified, it can be a normal request, to static resource, return null to allow handle that case
return null;
}
private void handleDynamicMethodInvocation(ActionMapping mapping, String name) {
int exclamation = name.lastIndexOf("!");
if (exclamation != -1) {
mapping.setName(name.substring(0, exclamation));
if (allowDynamicMethodCalls) {
mapping.setMethod(name.substring(exclamation + 1));
} else {
mapping.setMethod(null);
}
}
}
/**
* Parses the name and namespace from the uri. Uses the configured package
* namespaces to determine the name and id parameter, to be parsed later.
*
* @param uri
* The uri
* @param mapping
* The action mapping to populate
*/
protected void parseNameAndNamespace(String uri, ActionMapping mapping,
ConfigurationManager configManager) {
String namespace, name;
int lastSlash = uri.lastIndexOf("/");
if (lastSlash == -1) {
namespace = "";
name = uri;
} else if (lastSlash == 0) {
// ww-1046, assume it is the root namespace, it will fallback to
// default
// namespace anyway if not found in root namespace.
namespace = "/";
name = uri.substring(lastSlash + 1);
} else {
// Try to find the namespace in those defined, defaulting to ""
Configuration config = configManager.getConfiguration();
String prefix = uri.substring(0, lastSlash);
namespace = "";
// Find the longest matching namespace, defaulting to the default
for (Object o : config.getPackageConfigs().values()) {
String ns = ((PackageConfig) o).getNamespace();
if (ns != null && prefix.startsWith(ns) && (prefix.length() == ns.length() || prefix.charAt(ns.length()) == '/')) {
if (ns.length() > namespace.length()) {
namespace = ns;
}
}
}
name = uri.substring(namespace.length() + 1);
}
mapping.setNamespace(namespace);
mapping.setName(name);
}
protected boolean isGet(HttpServletRequest request) {
return "get".equalsIgnoreCase(request.getMethod());
}
protected boolean isPost(HttpServletRequest request) {
return "post".equalsIgnoreCase(request.getMethod());
}
protected boolean isPut(HttpServletRequest request) {
if ("put".equalsIgnoreCase(request.getMethod())) {
return true;
} else {
return isPost(request) && "put".equalsIgnoreCase(request.getParameter(HTTP_METHOD_PARAM));
}
}
protected boolean isDelete(HttpServletRequest request) {
if ("delete".equalsIgnoreCase(request.getMethod())) {
return true;
} else {
return "delete".equalsIgnoreCase(request.getParameter(HTTP_METHOD_PARAM));
}
}
protected boolean isOptions(HttpServletRequest request) {
return "options".equalsIgnoreCase(request.getMethod());
}
protected boolean isExpectContinue(HttpServletRequest request) {
String expect = request.getHeader("Expect");
return (expect != null && expect.toLowerCase().contains("100-continue"));
}
}
| {
"content_hash": "47bbd423b84ebc57424d46e5bdc5217d",
"timestamp": "",
"source": "github",
"line_count": 368,
"max_line_length": 131,
"avg_line_length": 40.516304347826086,
"alnum_prop": 0.6036887994634473,
"repo_name": "WillJiang/WillJiang",
"id": "bf20fb3691072f55d418e92178140e8e44ba51aa",
"size": "15793",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionMapper.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ActionScript",
"bytes": "22970"
},
{
"name": "CSS",
"bytes": "74192"
},
{
"name": "Java",
"bytes": "9706375"
},
{
"name": "JavaScript",
"bytes": "4013533"
},
{
"name": "XSLT",
"bytes": "8414"
}
],
"symlink_target": ""
} |
cask 'xguardian' do
version :latest
sha256 :no_check
url 'http://xara.openscanner.cc/download'
name 'XGuardian'
homepage 'http://xara.openscanner.cc'
license :mit
app 'xguardian.app'
zap :delete => [
'~/Library/Application Support/xguardian',
'~/Library/Caches/cc.openscanner.XGuardian',
]
end
| {
"content_hash": "c044fd5858aecd2273e6ac8654f0c296",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 63,
"avg_line_length": 23,
"alnum_prop": 0.6005434782608695,
"repo_name": "cedwardsmedia/homebrew-cask",
"id": "ea8d38ce828152fd9aaa7ff392588fb287e99525",
"size": "368",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Casks/xguardian.rb",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Ruby",
"bytes": "1861253"
},
{
"name": "Shell",
"bytes": "59564"
}
],
"symlink_target": ""
} |
import {Component,ElementRef,OnDestroy,DoCheck,Input,Output,ContentChild,TemplateRef} from '@angular/core';
import {Button} from '../button/button';
import {DomHandler} from '../dom/domhandler';
@Component({
selector: 'p-pickList',
template: `
<div [class]="styleClass" [ngStyle]="style" [ngClass]="{'ui-picklist ui-widget ui-helper-clearfix': true, 'ui-picklist-responsive': responsive}">
<div class="ui-picklist-source-controls ui-picklist-buttons">
<div class="ui-picklist-buttons-cell">
<button type="button" pButton icon="fa-angle-up" (click)="moveUp(sourcelist,source)"></button>
<button type="button" pButton icon="fa-angle-double-up" (click)="moveTop(sourcelist,source)"></button>
<button type="button" pButton icon="fa-angle-down" (click)="moveDown(sourcelist,source)"></button>
<button type="button" pButton icon="fa-angle-double-down" (click)="moveBottom(sourcelist,source)"></button>
</div>
</div>
<div class="ui-picklist-listwrapper ui-picklist-source-wrapper">
<div class="ui-picklist-caption ui-widget-header ui-corner-tl ui-corner-tr" *ngIf="sourceHeader">{{sourceHeader}}</div>
<ul #sourcelist class="ui-widget-content ui-picklist-list ui-picklist-source ui-corner-bottom" [ngStyle]="sourceStyle"
(mouseover)="onMouseover($event)" (mouseout)="onMouseout($event)" (click)="onClick($event)">
<template ngFor [ngForOf]="source" [ngForTemplate]="itemTemplate"></template>
</ul>
</div>
<div class="ui-picklist-buttons">
<div class="ui-picklist-buttons-cell">
<button type="button" pButton icon="fa-angle-right" (click)="moveRight(sourcelist)"></button>
<button type="button" pButton icon="fa-angle-double-right" (click)="moveAllRight(sourcelist)"></button>
<button type="button" pButton icon="fa-angle-left" (click)="moveLeft(targetlist)"></button>
<button type="button" pButton icon="fa-angle-double-left" (click)="moveAllLeft(targetlist)"></button>
</div>
</div>
<div class="ui-picklist-listwrapper ui-picklist-target-wrapper">
<div class="ui-picklist-caption ui-widget-header ui-corner-tl ui-corner-tr" *ngIf="targetHeader">{{targetHeader}}</div>
<ul #targetlist class="ui-widget-content ui-picklist-list ui-picklist-source ui-corner-bottom" [ngStyle]="targetStyle"
(mouseover)="onMouseover($event)" (mouseout)="onMouseout($event)" (click)="onClick($event)">
<template ngFor [ngForOf]="target" [ngForTemplate]="itemTemplate"></template>
</ul>
</div>
<div class="ui-picklist-target-controls ui-picklist-buttons">
<div class="ui-picklist-buttons-cell">
<button type="button" pButton icon="fa-angle-up" (click)="moveUp(targetlist,target)"></button>
<button type="button" pButton icon="fa-angle-double-up" (click)="moveTop(targetlist,target)"></button>
<button type="button" pButton icon="fa-angle-down" (click)="moveDown(targetlist,target)"></button>
<button type="button" pButton icon="fa-angle-double-down" (click)="moveBottom(targetlist,target)"></button>
</div>
</div>
</div>
`,
directives: [Button],
providers: [DomHandler]
})
export class PickList implements OnDestroy {
@Input() source: any[];
@Input() target: any[];
@Input() sourceHeader: string;
@Input() targetHeader: string;
@Input() responsive: boolean;
@Input() style: any;
@Input() styleClass: string;
@Input() sourceStyle: any;
@Input() targetStyle: any;
@ContentChild(TemplateRef) itemTemplate: TemplateRef<any>;
constructor(private el: ElementRef, private domHandler: DomHandler) {}
onMouseover(event) {
let element = event.target;
if(element.nodeName != 'UL') {
let item = this.findListItem(element);
this.domHandler.addClass(item, 'ui-state-hover');
}
}
onMouseout(event) {
let element = event.target;
if(element.nodeName != 'UL') {
let item = this.findListItem(element);
this.domHandler.removeClass(item, 'ui-state-hover');
}
}
onClick(event) {
let element = event.target;
if(element.nodeName != 'UL') {
let item = this.findListItem(element);
this.onItemClick(event, item);
}
}
findListItem(element) {
if(element.nodeName == 'LI') {
return element;
}
else {
let parent = element.parentElement;
while(parent.nodeName != 'LI') {
parent = parent.parentElement;
}
return parent;
}
}
onItemClick(event, item) {
let metaKey = (event.metaKey||event.ctrlKey);
if(this.domHandler.hasClass(item, 'ui-state-highlight')) {
if(metaKey) {
this.domHandler.removeClass(item, 'ui-state-highlight');
}
}
else {
if(!metaKey) {
let siblings = this.domHandler.siblings(item);
for(let i = 0; i < siblings.length; i++) {
let sibling = siblings[i];
if(this.domHandler.hasClass(sibling, 'ui-state-highlight')) {
this.domHandler.removeClass(sibling, 'ui-state-highlight');
}
}
}
this.domHandler.removeClass(item, 'ui-state-hover');
this.domHandler.addClass(item, 'ui-state-highlight');
}
}
moveUp(listElement, list) {
let selectedElements = this.getSelectedListElements(listElement);
for(let i = 0; i < selectedElements.length; i++) {
let selectedElement = selectedElements[i];
let selectedElementIndex: number = this.domHandler.index(selectedElement);
if(selectedElementIndex != 0) {
let movedItem = list[selectedElementIndex];
let temp = list[selectedElementIndex-1];
list[selectedElementIndex-1] = movedItem;
list[selectedElementIndex] = temp;
this.domHandler.scrollInView(listElement, this.getListElements(listElement)[selectedElementIndex - 1]);
}
else {
break;
}
}
}
moveTop(listElement, list) {
let selectedElements = this.getSelectedListElements(listElement);
for(let i = 0; i < selectedElements.length; i++) {
let selectedElement = selectedElements[i];
let selectedElementIndex: number = this.domHandler.index(selectedElement);
if(selectedElementIndex != 0) {
let movedItem = list.splice(selectedElementIndex,1)[0];
list.unshift(movedItem);
listElement.scrollTop = 0;
}
else {
break;
}
}
}
moveDown(listElement, list) {
let selectedElements = this.getSelectedListElements(listElement);
for(let i = selectedElements.length - 1; i >= 0; i--) {
let selectedElement = selectedElements[i];
let selectedElementIndex: number = this.domHandler.index(selectedElement);
if(selectedElementIndex != (list.length - 1)) {
let movedItem = list[selectedElementIndex];
let temp = list[selectedElementIndex+1];
list[selectedElementIndex+1] = movedItem;
list[selectedElementIndex] = temp;
this.domHandler.scrollInView(listElement, this.getListElements(listElement)[selectedElementIndex + 1]);
}
else {
break;
}
}
}
moveBottom(listElement, list) {
let selectedElements = this.getSelectedListElements(listElement);
for(let i = selectedElements.length - 1; i >= 0; i--) {
let selectedElement = selectedElements[i];
let selectedElementIndex: number = this.domHandler.index(selectedElement);
if(selectedElementIndex != (list.length - 1)) {
let movedItem = list.splice(selectedElementIndex,1)[0];
list.push(movedItem);
listElement.scrollTop = listElement.scrollHeight;
}
else {
break;
}
}
}
moveRight(sourceListElement) {
let selectedElements = this.getSelectedListElements(sourceListElement);
let i = selectedElements.length;
while(i--) {
this.target.push(this.source.splice(this.domHandler.index(selectedElements[i]),1)[0]);
}
}
moveAllRight() {
for(let i = 0; i < this.source.length; i++) {
this.target.push(this.source[i]);
}
this.source.splice(0, this.source.length);
}
moveLeft(targetListElement) {
let selectedElements = this.getSelectedListElements(targetListElement);
let i = selectedElements.length;
while(i--) {
this.source.push(this.target.splice(this.domHandler.index(selectedElements[i]),1)[0]);
}
}
moveAllLeft() {
for(let i = 0; i < this.target.length; i++) {
this.source.push(this.target[i]);
}
this.target.splice(0, this.target.length);
}
getListElements(listElement) {
return listElement.children;
}
getSelectedListElements(listElement) {
return this.domHandler.find(listElement, 'li.ui-state-highlight');
}
ngOnDestroy() {
}
}
| {
"content_hash": "1f749f236d8fd3478c50e63db917a958",
"timestamp": "",
"source": "github",
"line_count": 250,
"max_line_length": 153,
"avg_line_length": 39.82,
"alnum_prop": 0.5763937719738824,
"repo_name": "AjaySharm/primeng",
"id": "b0ddce3ae4cce2baa876a832c9f64774794cb17b",
"size": "9957",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "components/picklist/picklist.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1116434"
},
{
"name": "HTML",
"bytes": "867244"
},
{
"name": "JavaScript",
"bytes": "2672232"
},
{
"name": "TypeScript",
"bytes": "512854"
}
],
"symlink_target": ""
} |
package com.olayinkapeter.toodoo.models;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* Created by Olayinka_Peter on 11/9/2016.
*/
public class ItemModel {
private String id, item, label, dueDate, reminder;
private Date dueDateValue, reminderValue;
public ItemModel() {}
public ItemModel(String id, String item, String label, String dueDate, Date dueDateValue, String reminder, Date reminderValue) {
this.id = id;
this.item = item;
this.label = label;
this.dueDate = dueDate;
this.dueDateValue = dueDateValue;
this.reminder = reminder;
this.reminderValue = reminderValue;
}
public ItemModel(String id, String item, String label, String dueDate, String reminder) {
this.id = id;
this.item = item;
this.label = label;
this.dueDate = dueDate;
this.reminder = reminder;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getitem() {
return item;
}
public void setItem(String item) {
this.item = item;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getDueDate() {
return dueDate;
}
public void setDueDate(String dueDate) {
this.dueDate = dueDate;
}
public Date getDueDateValue() {
return dueDateValue;
}
public void setDueDateValue(Date dueDateValue) {
this.dueDateValue = dueDateValue;
}
public String getReminder() {
return reminder;
}
public void setReminder(String reminder) {
this.reminder = reminder;
}
public Date getReminderValue() {
return reminderValue;
}
public void setReminderValue(Date reminderValue) {
this.reminderValue = reminderValue;
}
public Map<String,Object> toMap() {
HashMap<String, Object> result = new HashMap<>();
result.put("id", id);
result.put("item", item);
result.put("label", label);
result.put("dueDate", dueDate);
result.put("dueDateValue", dueDateValue);
result.put("dueDate", reminder);
result.put("reminderValue", reminderValue);
return result;
}
}
| {
"content_hash": "89356f6996d060b696b15e368df784ef",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 132,
"avg_line_length": 23.362745098039216,
"alnum_prop": 0.6093159882501049,
"repo_name": "OlayinkaPeter/Toodoo",
"id": "1f6281b6127daee72f8109051fec7d7ec79f88cc",
"size": "2383",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/java/com/olayinkapeter/toodoo/models/ItemModel.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "301804"
},
{
"name": "Kotlin",
"bytes": "1065"
}
],
"symlink_target": ""
} |
set -e
test_version() {
version=$1
bash --login -c \
"rvm install $version && rvm use $version && \
which ruby && \
gem install bundler && bundle && \
rake test"
}
test_version $1
| {
"content_hash": "4f27488d5de4f6162f5bdc2c678c7a0f",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 50,
"avg_line_length": 17.083333333333332,
"alnum_prop": 0.5609756097560976,
"repo_name": "kidaa/kythe",
"id": "a240dd65733018e35953a77e9272f1a6ffad9b0d",
"size": "247",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "third_party/proto/ruby/travis-test.sh",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "2096"
},
{
"name": "C++",
"bytes": "918357"
},
{
"name": "CSS",
"bytes": "12176"
},
{
"name": "Clojure",
"bytes": "38541"
},
{
"name": "Go",
"bytes": "526259"
},
{
"name": "HTML",
"bytes": "6541"
},
{
"name": "Java",
"bytes": "383857"
},
{
"name": "JavaScript",
"bytes": "1164"
},
{
"name": "Lex",
"bytes": "5344"
},
{
"name": "Makefile",
"bytes": "222"
},
{
"name": "OCaml",
"bytes": "12639"
},
{
"name": "Objective-C",
"bytes": "32"
},
{
"name": "Protocol Buffer",
"bytes": "40444"
},
{
"name": "Python",
"bytes": "110243"
},
{
"name": "Ruby",
"bytes": "3939"
},
{
"name": "Shell",
"bytes": "93647"
},
{
"name": "TeX",
"bytes": "2455"
},
{
"name": "Yacc",
"bytes": "4549"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "1d1361605856e35519c63caa380001de",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "1770be48a485ece87721a67e2b6b9f7f080e58a9",
"size": "185",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Fagales/Betulaceae/Alnus/Alnus matsumurae/ Syn. Alnus incana emarginata/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
"""Model architecture factory."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl import logging
from modeling.architecture import efficientnet
from modeling.architecture import fpn
from modeling.architecture import heads
from modeling.architecture import identity
from modeling.architecture import nasfpn
from modeling.architecture import nn_ops
from modeling.architecture import resnet
from modeling.architecture import spinenet
from modeling.architecture import spinenet_mbconv
from projects.fashionpedia.modeling.architecture import fast_rcnn_head
def batch_norm_activation_generator(params):
return nn_ops.BatchNormActivation(
momentum=params.batch_norm_momentum,
epsilon=params.batch_norm_epsilon,
trainable=params.batch_norm_trainable,
use_sync_bn=params.use_sync_bn,
activation=params.activation)
def dropblock_generator(params):
return nn_ops.Dropblock(
dropblock_keep_prob=params.dropblock_keep_prob,
dropblock_size=params.dropblock_size)
def backbone_generator(params):
"""Generator function for various backbone models."""
if params.architecture.backbone == 'resnet':
resnet_params = params.resnet
backbone_fn = resnet.Resnet(
resnet_depth=resnet_params.resnet_depth,
dropblock=dropblock_generator(params.dropblock),
activation=params.batch_norm_activation.activation,
batch_norm_activation=batch_norm_activation_generator(
params.batch_norm_activation),
init_drop_connect_rate=resnet_params.init_drop_connect_rate,
space_to_depth_block_size=params.architecture.space_to_depth_block_size)
elif params.architecture.backbone == 'spinenet':
spinenet_params = params.spinenet
backbone_fn = spinenet.spinenet_builder(
model_id=spinenet_params.model_id,
min_level=params.architecture.min_level,
max_level=params.architecture.max_level,
use_native_resize_op=spinenet_params.use_native_resize_op,
activation=params.batch_norm_activation.activation,
batch_norm_activation=batch_norm_activation_generator(
params.batch_norm_activation),
init_drop_connect_rate=spinenet_params.init_drop_connect_rate)
elif params.architecture.backbone == 'spinenet_mbconv':
spinenet_mbconv_params = params.spinenet_mbconv
backbone_fn = spinenet_mbconv.spinenet_mbconv_builder(
model_id=spinenet_mbconv_params.model_id,
min_level=params.architecture.min_level,
max_level=params.architecture.max_level,
use_native_resize_op=spinenet_mbconv_params.use_native_resize_op,
se_ratio=spinenet_mbconv_params.se_ratio,
activation=params.batch_norm_activation.activation,
batch_norm_activation=batch_norm_activation_generator(
params.batch_norm_activation),
init_drop_connect_rate=spinenet_mbconv_params.init_drop_connect_rate)
elif 'efficientnet' in params.architecture.backbone:
backbone_fn = efficientnet.Efficientnet(params.architecture.backbone)
else:
raise ValueError(
'Backbone model %s is not supported.' % params.architecture.backbone)
return backbone_fn
def multilevel_features_generator(params):
"""Generator function for various FPN models."""
if params.architecture.multilevel_features == 'fpn':
fpn_params = params.fpn
fpn_fn = fpn.Fpn(
min_level=params.architecture.min_level,
max_level=params.architecture.max_level,
fpn_feat_dims=fpn_params.fpn_feat_dims,
use_separable_conv=fpn_params.use_separable_conv,
use_batch_norm=fpn_params.use_batch_norm,
batch_norm_activation=batch_norm_activation_generator(
params.batch_norm_activation))
elif params.architecture.multilevel_features == 'nasfpn':
nasfpn_params = params.nasfpn
fpn_fn = nasfpn.Nasfpn(
min_level=params.architecture.min_level,
max_level=params.architecture.max_level,
fpn_feat_dims=nasfpn_params.fpn_feat_dims,
num_repeats=nasfpn_params.num_repeats,
use_separable_conv=nasfpn_params.use_separable_conv,
dropblock=dropblock_generator(params.dropblock),
block_fn=nasfpn_params.block_fn,
activation=params.batch_norm_activation.activation,
batch_norm_activation=batch_norm_activation_generator(
params.batch_norm_activation),
init_drop_connect_rate=nasfpn_params.init_drop_connect_rate)
elif params.architecture.multilevel_features == 'identity':
fpn_fn = identity.Identity()
else:
raise ValueError('The multi-level feature model %s is not supported.'
% params.architecture.multilevel_features)
return fpn_fn
def rpn_head_generator(params):
"""Generator function for RPN head architecture."""
head_params = params.rpn_head
if head_params.anchors_per_location:
logging.info('[Deprecation]: `rpn_head.anchors_per_location` '
'is no longer used.')
anchor_aspect_ratios = len(params.anchor.aspect_ratios)
anchor_num_scales = params.anchor.num_scales
anchors_per_location = anchor_aspect_ratios * anchor_num_scales
return heads.RpnHead(
params.architecture.min_level,
params.architecture.max_level,
anchors_per_location,
head_params.num_convs,
head_params.num_filters,
head_params.use_separable_conv,
params.batch_norm_activation.activation,
head_params.use_batch_norm,
batch_norm_activation=batch_norm_activation_generator(
params.batch_norm_activation))
def fast_rcnn_head_generator(params):
"""Generator function for Fast R-CNN head architecture."""
head_params = params.frcnn_head
return fast_rcnn_head.FastrcnnHead(
params.architecture.num_classes,
params.architecture.num_attributes,
head_params.num_convs,
head_params.num_filters,
head_params.use_separable_conv,
head_params.num_fcs,
head_params.fc_dims,
params.batch_norm_activation.activation,
head_params.use_batch_norm,
batch_norm_activation=batch_norm_activation_generator(
params.batch_norm_activation))
def mask_rcnn_head_generator(params):
"""Generator function for Mask R-CNN head architecture."""
head_params = params.mrcnn_head
return heads.MaskrcnnHead(
params.architecture.num_classes,
params.architecture.mask_target_size,
head_params.num_convs,
head_params.num_filters,
head_params.use_separable_conv,
params.batch_norm_activation.activation,
head_params.use_batch_norm,
batch_norm_activation=batch_norm_activation_generator(
params.batch_norm_activation))
| {
"content_hash": "c15a3cd22664378de229a21f448a3f9a",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 80,
"avg_line_length": 40.67878787878788,
"alnum_prop": 0.7219904648390941,
"repo_name": "tensorflow/tpu",
"id": "d7a5a1e83af21f36620f188291d5aaa0c70284a1",
"size": "7401",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "models/official/detection/projects/fashionpedia/modeling/architecture/factory.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "754301"
},
{
"name": "Dockerfile",
"bytes": "2734"
},
{
"name": "Go",
"bytes": "226317"
},
{
"name": "Jupyter Notebook",
"bytes": "56231509"
},
{
"name": "Makefile",
"bytes": "2369"
},
{
"name": "Python",
"bytes": "3444271"
},
{
"name": "Shell",
"bytes": "21032"
},
{
"name": "Starlark",
"bytes": "164"
}
],
"symlink_target": ""
} |
// load image data
window.initExport = function(){
var sel = d3.select('#export').html('')
.on('click', function(){
var range = document.createRange()
range.selectNode(this)
window.getSelection().removeAllRanges()
window.getSelection().addRange(range)
})
.append('pre')
function update(){
var text = `# click on an image to generate code`
var colorArray = scales.active.samples.slice(0, config.nSamples)
.map(d => d.concat(255))
text = `
# ${scales.active.name} colormap generated by github.com/PAIR-code/colormap
flatcolors = np.array([${colorArray}])
colors = np.reshape(flatcolors, (4, -1)) / 255.0
newcmp = ListedColormap(colors)
# TODO data transform/brush
# TODO contrast/brightness
# TODO plot code
`.trim()
sel.text(text)
}
return {update, debouncedUpdate: _.debounce(update, 0)}
}
if (window.init) init()
| {
"content_hash": "8e78100346cab5a0ef5c60e754087b35",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 75,
"avg_line_length": 19.565217391304348,
"alnum_prop": 0.6522222222222223,
"repo_name": "PAIR-code/colormap",
"id": "acd1097120547ca8a0db0634fdb698c9b560e776",
"size": "1556",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "comparison/init-export.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "7166"
},
{
"name": "HTML",
"bytes": "5566"
},
{
"name": "JavaScript",
"bytes": "41997"
}
],
"symlink_target": ""
} |
@interface CategorySummaryTableViewCell : UITableViewCell {
UILabel* categoryNameLabel;
UILabel* budgetedAmountLabel;
UILabel* amountRemainingLabel;
}
@property (retain, nonatomic) UILabel* categoryNameLabel;
@property (retain, nonatomic) UILabel* budgetedAmountLabel;
@property (retain, nonatomic) UILabel* amountRemainingLabel;
@end
| {
"content_hash": "2722ca335327c4fa9baeac3429eb088b",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 60,
"avg_line_length": 30.90909090909091,
"alnum_prop": 0.8176470588235294,
"repo_name": "adambyram/budgee-ios",
"id": "2afeefca4e5b7ea72d777828ec2d2a2fb8450b74",
"size": "511",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CategorySummaryTableViewCell.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Objective-C",
"bytes": "373164"
}
],
"symlink_target": ""
} |
<?php
namespace Armd\OAuthBundle\Entity;
use FOS\OAuthServerBundle\Entity\AccessToken as BaseAccessToken;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="oauth_access_token")
*/
class AccessToken extends BaseAccessToken
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\ManyToOne(targetEntity="Client")
* @ORM\JoinColumn(nullable=false)
*/
protected $client;
/**
* @ORM\ManyToOne(targetEntity="Armd\UserBundle\Entity\User")
*/
protected $user;
} | {
"content_hash": "178e61963d5c4084ebd1bc0d2c5bd76f",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 65,
"avg_line_length": 19.03125,
"alnum_prop": 0.6371100164203612,
"repo_name": "damedia/culture.ru",
"id": "53ceceaed3fa4ddf2a2ce490eb170fa01c60e6fd",
"size": "609",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Armd/OAuthBundle/Entity/AccessToken.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1823103"
},
{
"name": "JavaScript",
"bytes": "4818245"
},
{
"name": "PHP",
"bytes": "2439432"
},
{
"name": "Perl",
"bytes": "60"
},
{
"name": "Ruby",
"bytes": "2913"
},
{
"name": "Shell",
"bytes": "800"
}
],
"symlink_target": ""
} |
.PHONY: all clean install objd
all: objd
objd:
cd objd && $(MAKE)
clean:
cd objd && $(MAKE) clean
install:
cd objd && $(MAKE) install
| {
"content_hash": "571f6fb0c9c70f0797505df9e7418c18",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 30,
"avg_line_length": 11.75,
"alnum_prop": 0.6312056737588653,
"repo_name": "jspahrsummers/objective-d",
"id": "a9665a1dded2ddda9fe3da86aa4a5ce255f20712",
"size": "141",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/Makefile",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "D",
"bytes": "139300"
},
{
"name": "DM",
"bytes": "18869"
},
{
"name": "Makefile",
"bytes": "4829"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,minimum-scale=1,maximum-scale=1">
<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="alternate" href="/atom.xml" title="MengQi Yang">
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=1.1" />
<link rel="canonical" href="http://5mengqi.cc/tags/MVC/"/>
<meta property="og:type" content="website">
<meta property="og:title" content="MengQi Yang">
<meta property="og:url" content="http://5mengqi.cc/tags/MVC/index.html">
<meta property="og:site_name" content="MengQi Yang">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="MengQi Yang">
<link rel="stylesheet" type="text/css" href="/css/style.css?v=1.1" />
<link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet'>
<script type="text/javascript">
var themeConfig = {
fancybox: {
enable: false
},
};
</script>
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-93547748-1', 'auto');
ga('send', 'pageview');
</script>
<title>
MVC - MengQi Yang
</title>
</head>
<body>
<div id="page">
<header id="masthead"><div class="site-header-inner">
<h1 class="site-title">
<a href="/." class="logo">MengQi Yang</a>
</h1>
<nav id="nav-top">
<ul id="menu-top" class="nav-top-items">
<li class="menu-item">
<a href="/archives">
Archives
</a>
</li>
</ul>
</nav>
</div>
</header>
<div id="content">
<div id="primary">
<section id="archive" class="archive">
<div class="archive-title tag">
<h2 class="archive-name">MVC</h2>
</div>
<div class="archive-post">
<span class="archive-post-time">
2017-5-2
</span>
<span class="archive-post-title">
<a href="/blogs/talk-about-mvc-and-mvvm/" class="archive-post-link">
谈谈MVC和MVVM
</a>
</span>
</div>
</section>
</div>
<nav class="pagination">
</nav>
</div>
<footer id="colophon"><span class="copyright-year">
©
2016 -
2017
<span class="footer-author">MengQi Yang.</span>
<span class="power-by">
由 <a class="hexo-link" href="https://hexo.io/">Hexo</a> and <a class="theme-link" href="https://github.com/frostfan/hexo-theme-polarbear">Polar Bear</a> 强力驱动
</span>
</span>
</footer>
<div class="back-to-top" id="back-to-top">
<i class="iconfont icon-up"></i>
</div>
</div>
<script type="text/javascript">
var disqus_shortname = 'monkiyang';
var disqus_identifier = 'tags/MVC/index.html';
var disqus_title = "";
var disqus = {
load : function disqus(){
if(typeof DISQUS !== 'object') {
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
$('#load-disqus').remove(); ///加载后移除按钮
}
}
}
</script>
<script type="text/javascript" src="/lib/jquery/jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="/js/src/theme.js?v=1.1"></script>
<script type="text/javascript" src="/js/src/bootstrap.js?v=1.1"></script>
</body>
</html>
| {
"content_hash": "d117897b09eb2fac564eb363b2c58b75",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 165,
"avg_line_length": 21.09090909090909,
"alnum_prop": 0.5349364791288567,
"repo_name": "monkiyang/monkiyang.github.io",
"id": "fbb7415932afef12e66912e7bb6b18ab0acbd328",
"size": "4438",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tags/MVC/index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "32280"
},
{
"name": "HTML",
"bytes": "242116"
},
{
"name": "JavaScript",
"bytes": "13077"
}
],
"symlink_target": ""
} |
.Travelite_error_bg{
background:url("../../svg/error_bg_img.svg") no-repeat;
background-size: cover;
}
.main_center_error_wrap {
text-align: center;
}
.Travelite_error_heading p {
font-size: 18px;
color: #808b8d;
line-height: 36px;
}
.Travelite_error_heading, .main_center_error_wrap, .error_text_with_icon, .error_next_prev_links, .serach_here{
float:left;
width:100%;
}
.error_text_with_icon ul {
margin:0px;
}
.error_text_with_icon ul li {
display: inline-block;
color: #2c3e50;
font: 700 86.4px "Lato",sans-serif ;
text-transform: uppercase;
}
.error_text_with_icon {
float: left;
width: 100%;
padding-top: 70px;
padding-bottom: 86px;
}
.error_text_with_icon ul li:nth-child(1), .error_text_with_icon ul li:nth-child(3) {
position: relative;
}
.error_next_prev_links a {
text-transform: uppercase;
padding: 14px 0px;
width: 150px;
display: inline-block;
background: #fdb714;
color: #fff;
font: normal 13px Open Sans;
letter-spacing: .4px;
border-radius: 21px;
margin-right: 6px;
border: 1px solid transparent;
}
.error_next_prev_links a.home_page:hover {
border: 1px solid #fdb714;
background: transparent !important;
color: #fdb714;
}
.error_next_prev_links a.prev_page:hover {
border: 1px solid #86b817;
background: transparent !important;
color: #86b817;
}
.main_center_error_wrap {
padding-top: 75px;
padding-bottom: 57px;
}
.error_next_prev_links a.home_page{
background: #fdb714;
}
.error_next_prev_links a.prev_page{
background: #86b817;
}
.serach_here h5 {
font-weight: 700;
text-transform: uppercase;
color: #2c3e50;
margin-left: 5px;
display: inline-block;
}
.serach_here {
line-height: 36px;
font-size: 16px;
color: #808b8d;
padding: 15px 0px;
}
.bottom_searching_part{
display: inline-block;
width: 374px;
position:relative;
}
.bottom_searching_part input.search_page {
width: 100%;
height: 47px;
border: 2px solid #eeeeee;
border-radius: 5px;
padding-left: 10px;
color: #aaaaaa;
padding-right: 40px;
}
.bottom_searching_part button {
position: absolute;
top: 11px;
right: 20px;
background: transparent;
border: none;
font-size: 16px;
color: #aaaaaa;
}
/* responsive media query start */
@media (max-width:480px){
.bottom_searching_part {
width: 80%;
}
.Travelite_error_heading h3 {
font-size: 16px;
}
}
/* responsive media query end */ | {
"content_hash": "79730f02621c84679565fb6a4fd6d853",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 111,
"avg_line_length": 20.308943089430894,
"alnum_prop": 0.6545236188951161,
"repo_name": "safaridato/travelite",
"id": "0588fe8120fd777262a2306cb23e9ce29de3f0a5",
"size": "2709",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "assets/css/default/404.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "1062"
},
{
"name": "CSS",
"bytes": "1468312"
},
{
"name": "HTML",
"bytes": "23226"
},
{
"name": "JavaScript",
"bytes": "2179173"
},
{
"name": "PHP",
"bytes": "3836514"
}
],
"symlink_target": ""
} |
import { Composite } from './';
class Mock extends Composite< Mock >{}
function createComposite(): any {
return new Mock();
}
describe( 'Composite', () => {
beforeEach( () => {
this.parent = createComposite();
this.child = createComposite();
});
describe( 'addChild()', () => {
beforeEach( () => {
spyOn( this.parent, 'onAfterChildAdded' );
spyOn( this.child, 'onAfterAdd' );
this.parent.addChild( this.child );
});
it( 'should add a child', () => {
expect( this.parent.children.length ).toBe( 1 );
expect( this.parent.children[0] ).toBe( this.child );
});
it( 'should mark the child parent', () => {
expect( this.child.parent ).toBe( this.parent );
});
it( 'should throw if the child added is an ancestor', () => {
let addParentToChild = () => this.child.addChild( this.parent );
expect( addParentToChild ).toThrow();
});
it( 'should notify the parent that a child has been added', () => {
expect( this.parent.onAfterChildAdded ).toHaveBeenCalledWith( this.child );
});
it( 'should notify the child after it has been added', () => {
expect( this.child.onAfterAdd ).toHaveBeenCalled();
});
});
describe( 'addChildren()', () => {
it( 'should add a child', () => {
var iAnotherChild = createComposite();
this.parent.addChildren( this.child, iAnotherChild );
expect( this.parent.children.length ).toBe( 2 );
});
});
describe( 'getParent()', () => {
it( 'should the child`s parent', () => {
this.parent.addChildren( this.child );
expect( this.child.getParent() ).toBe( this.parent );
});
});
describe( 'getAncestors()', () => {
it( 'should return all the child ancestors in top-down order', () => {
this.parent.addChildren( this.child );
this.grandparent = createComposite();
this.grandparent.addChildren( this.parent );
this.grandgrandparent = createComposite();
this.grandgrandparent.addChildren( this.grandparent );
expect( this.child.getAncestors() ).toEqual( [ this.grandgrandparent, this.grandparent, this.parent ] );
});
});
describe( 'removeChild()', () => {
beforeEach( () => {
spyOn( this.child, 'onBeforeRemove' );
spyOn( this.parent, 'onAfterChildRemoved' );
this.parent.addChild( this.child );
this.parent.removeChild( this.child );
});
it( 'should remove the child', () => {
expect( this.parent.children.length ).toBe( 0 );
});
it( 'should unlink the child to its parent', () => {
expect( this.child.parent ).toBe( null );
});
it( 'should raise an execption if the child was not found', () => {
var iAnotherChild = createComposite();
var functionCall = () => {
this.parent.removeChild( iAnotherChild );
}
expect( functionCall ).toThrow();
});
it( 'should notify the child before its removal', () => {
expect( this.child.onBeforeRemove ).toHaveBeenCalled();
});
it( 'should notify the parent that a child has been removed', () => {
expect( this.parent.onAfterChildRemoved ).toHaveBeenCalledWith( this.child );
});
});
describe( 'forEachChild()', () => {
beforeEach( () => {
this.anotherChild = createComposite();
this.parent.addChildren( this.child, this.anotherChild );
});
it( 'should iterate each child', () => {
var iCallback = jasmine.createSpy('iCallback');
this.parent.forEachChild( iCallback );
expect( iCallback.calls.argsFor(0) ).toEqual([ this.child, 0 ]);
expect( iCallback.calls.argsFor(1) ).toEqual([ this.anotherChild, 1 ]);
});
});
describe( 'forEachAncestor()', () => {
beforeEach( () => {
this.parent.addChildren( this.child );
this.grandparent = createComposite();
this.grandparent.addChildren( this.parent );
this.grandgrandparent = createComposite();
this.grandgrandparent.addChildren( this.grandparent );
});
it( 'should iterate each parent', () => {
var iCallback = jasmine.createSpy('iCallback');
this.child.forEachAncestor( iCallback );
expect( iCallback.calls.argsFor(0) ).toEqual([ this.grandgrandparent ]);
expect( iCallback.calls.argsFor(1) ).toEqual([ this.grandparent ]);
expect( iCallback.calls.argsFor(2) ).toEqual([ this.parent ]);
});
});
describe( 'isChildless()', () => {
it( 'should return true if there are no children', () => {
expect( this.parent.isChildless() ).toBe( true );
});
it( 'should return false if there are children', () => {
this.parent.addChild( this.child );
expect( this.parent.isChildless() ).toBe( false );
});
});
describe( 'hasParent()', () => {
it( 'should return false', () => {
expect( this.child.hasParent() ).toBe( false );
});
it( 'should return true', () => {
this.parent.addChild( this.child );
expect( this.child.hasParent() ).toBe( true );
});
});
});
| {
"content_hash": "617dbaf36efa55f0f333d10b387eb73e",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 116,
"avg_line_length": 28.535353535353536,
"alnum_prop": 0.5316814159292036,
"repo_name": "Izhaki/gefri",
"id": "8d58aa363f836adf779075ce35a3b99209d639c3",
"size": "5650",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/core/Composite.spec.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "TypeScript",
"bytes": "148650"
}
],
"symlink_target": ""
} |
import sublime_plugin
from ..libs.view_helpers import *
from ..libs import *
from .event_hub import EventHub
class TypeScriptEventListener(sublime_plugin.EventListener):
"""To avoid duplicated behavior among event listeners"""
# During the "close all" process, handling on_activated events is
# undesirable (not required and can be costly due to reloading buffers).
# This flag provides a way to know whether the "close all" process is
# happening so we can ignore unnecessary on_activated callbacks.
about_to_close_all = False
def on_activated(self, view):
log.debug("on_activated")
if TypeScriptEventListener.about_to_close_all:
return
if is_special_view(view):
self.on_activated_special_view(view)
else:
info = get_info(view)
if info:
self.on_activated_with_info(view, info)
def on_activated_special_view(self, view):
log.debug("on_activated_special_view")
EventHub.run_listeners("on_activated_special_view", view)
def on_activated_with_info(self, view, info):
log.debug("on_activated_with_info")
EventHub.run_listeners("on_activated_with_info", view, info)
def on_modified(self, view):
"""
Usually called by Sublime when the buffer is modified
not called for undo, redo
"""
log.debug("on_modified")
if is_special_view(view):
self.on_modified_special_view(view)
else:
info = get_info(view)
if info:
self.on_modified_with_info(view, info)
self.post_on_modified(view)
def on_modified_special_view(self, view):
log.debug("on_modified_special_view")
EventHub.run_listeners("on_modified_special_view", view)
def on_modified_with_info(self, view, info):
log.debug("on_modified_with_info")
# A series state-updating for the info object to sync the file content on the server
info.modified = True
# Todo: explain
if IS_ST2:
info.modify_count += 1
info.last_modify_change_count = change_count(view)
last_command, args, repeat_times = view.command_history(0)
if info.pre_change_sent:
# change handled in on_text_command
info.client_info.change_count = change_count(view)
info.pre_change_sent = False
else:
if last_command == "insert":
if (
"\n" not in args['characters'] # no new line inserted
and info.prev_sel # it is not a newly opened file
and len(info.prev_sel) == 1 # not a multi-cursor session
and info.prev_sel[0].empty() # the last selection is not a highlighted selection
and not info.client_info.pending_changes # no pending changes in the buffer
):
info.client_info.change_count = change_count(view)
prev_cursor = info.prev_sel[0].begin()
cursor = view.sel()[0].begin()
key = view.substr(sublime.Region(prev_cursor, cursor))
send_replace_changes_for_regions(view, static_regions_to_regions(info.prev_sel), key)
# mark change as handled so that on_post_text_command doesn't try to handle it
info.change_sent = True
else:
# request reload because we have strange insert
info.client_info.pending_changes = True
# Reload buffer after insert_snippet.
# For Sublime 2 only. In Sublime 3, this logic is implemented in
# on_post_text_command callback.
# Issue: https://github.com/Microsoft/TypeScript-Sublime-Plugin/issues/277
if IS_ST2 and last_command == "insert_snippet":
reload_buffer(view);
# Other listeners
EventHub.run_listeners("on_modified_with_info", view, info)
def post_on_modified(self, view):
log.debug("post_on_modified")
EventHub.run_listeners("post_on_modified", view)
def on_selection_modified(self, view):
"""
Called by Sublime when the cursor moves (or when text is selected)
called after on_modified (when on_modified is called)
"""
log.debug("on_selection_modified")
# Todo: why do we only check this here? anyway to globally disable the listener for non-ts files
if not is_typescript(view):
return
EventHub.run_listeners("on_selection_modified", view)
info = get_info(view)
if info:
self.on_selection_modified_with_info(view, info)
def on_selection_modified_with_info(self, view, info):
log.debug("on_selection_modified_with_info")
if not info.client_info:
info.client_info = cli.get_or_add_file(view.file_name())
if (
info.client_info.change_count < change_count(view)
and info.last_modify_change_count != change_count(view)
):
# detected a change to the view for which Sublime did not call
# 'on_modified' and for which we have no hope of discerning
# what changed
info.client_info.pending_changes = True
# save the current cursor position so that we can see (in
# on_modified) what was inserted
info.prev_sel = regions_to_static_regions(view.sel())
EventHub.run_listeners("on_selection_modified_with_info", view, info)
def on_load(self, view):
log.debug("on_load")
EventHub.run_listeners("on_load", view)
def on_window_command(self, window, command_name, args):
log.debug("on_window_command")
if command_name == "hide_panel" and cli.worker_client.started():
cli.worker_client.stop()
elif command_name == "exit":
cli.service.exit()
elif command_name in ["close_all", "close_window", "close_project"]:
# Only set <about_to_close_all> flag if there exists at least one
# view in the active window. This is important because we need
# some view's on_close callback to reset the flag.
window = sublime.active_window()
if window is not None and window.views():
TypeScriptEventListener.about_to_close_all = True
def on_text_command(self, view, command_name, args):
"""
ST3 only (called by ST3 for some, but not all, text commands)
for certain text commands, learn what changed and notify the
server, to avoid sending the whole buffer during completion
or when key can be held down and repeated.
If we had a popup session active, and we get the command to
hide it, then do the necessary clean up.
"""
log.debug("on_text_command")
EventHub.run_listeners("on_text_command", view, command_name, args)
info = get_info(view)
if info:
self.on_text_command_with_info(view, command_name, args, info)
def on_text_command_with_info(self, view, command_name, args, info):
log.debug("on_text_command_with_info")
info.change_sent = True
info.pre_change_sent = True
if command_name == "left_delete":
# backspace
send_replace_changes_for_regions(view, left_expand_empty_region(view.sel()), "")
elif command_name == "right_delete":
# delete
send_replace_changes_for_regions(view, right_expand_empty_region(view.sel()), "")
else:
# notify on_modified and on_post_text_command events that
# nothing was handled. There are multiple flags because Sublime
# does not always call all three events.
info.pre_change_sent = False
info.change_sent = False
info.modified = False
EventHub.run_listeners("on_text_command_with_info", view, command_name, args, info)
def on_post_text_command(self, view, command_name, args):
"""
ST3 only
called by ST3 for some, but not all, text commands
not called for insert command
"""
log.debug("on_post_text_command")
info = get_info(view)
if info:
if not info.change_sent and info.modified:
self.on_post_text_command_with_info(view, command_name, args, info)
# we are up-to-date because either change was sent to server or
# whole buffer was sent to server
info.client_info.change_count = view.change_count()
# reset flags and saved regions used for communication among
# on_text_command, on_modified, on_selection_modified,
# on_post_text_command, and on_query_completion
info.change_sent = False
info.modified = False
info.completion_sel = None
def on_post_text_command_with_info(self, view, command_name, args, info):
log.debug("on_post_text_command_with_info")
if command_name not in \
["commit_completion",
"insert_best_completion",
"typescript_format_on_key",
"typescript_format_document",
"typescript_format_selection",
"typescript_format_line",
"typescript_paste_and_format"]:
print(command_name)
# give up and send whole buffer to server (do this eagerly
# to avoid lag on next request to server)
reload_buffer(view, info.client_info)
EventHub.run_listeners("on_post_text_command_with_info", view, command_name, args, info)
def on_query_completions(self, view, prefix, locations):
log.debug("on_query_completions")
return EventHub.run_listener_with_return("on_query_completions", view, prefix, locations)
def on_query_context(self, view, key, operator, operand, match_all):
log.debug("on_query_context")
return EventHub.run_listener_with_return("on_query_context", view, key, operator, operand, match_all)
def on_close(self, view):
log.debug("on_close")
file_name = view.file_name()
info = get_info(view, open_if_not_cached=False)
if info:
info.is_open = False
if view.is_scratch() and view.name() == "Find References":
cli.dispose_ref_info()
else:
# info = get_info(view)
# if info:
# if info in most_recent_used_file_list:
# most_recent_used_file_list.remove(info)
# notify the server that the file is closed
cli.service.close(file_name)
# If this is the last view that is closed by a close_all command,
# reset <about_to_close_all> flag.
if TypeScriptEventListener.about_to_close_all:
window = sublime.active_window()
if window is None or not window.views():
TypeScriptEventListener.about_to_close_all = False
log.debug("all views have been closed")
def on_pre_save(self, view):
log.debug("on_pre_save")
check_update_view(view)
def on_hover(self, view, point, hover_zone):
log.debug("on_hover")
EventHub.run_listeners("on_hover", view, point, hover_zone) | {
"content_hash": "d83122298044904c0cc6bbfb2172451a",
"timestamp": "",
"source": "github",
"line_count": 273,
"max_line_length": 109,
"avg_line_length": 41.857142857142854,
"alnum_prop": 0.6013826901198915,
"repo_name": "nimzco/Environment",
"id": "a83fc85c50f0228992681516cb69663dd3172210",
"size": "11427",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Sublime/Packages/TypeScript/typescript/listeners/listeners.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "332445"
},
{
"name": "Python",
"bytes": "3101171"
},
{
"name": "Shell",
"bytes": "26630"
}
],
"symlink_target": ""
} |
.class Lcom/baidu/internal/keyguard/slide/TransportControlView$1;
.super Landroid/os/Handler;
.source "TransportControlView.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/baidu/internal/keyguard/slide/TransportControlView;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x0
name = null
.end annotation
# instance fields
.field final synthetic this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
# direct methods
.method constructor <init>(Lcom/baidu/internal/keyguard/slide/TransportControlView;)V
.locals 0
.parameter
.prologue
.line 96
iput-object p1, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
invoke-direct {p0}, Landroid/os/Handler;-><init>()V
return-void
.end method
# virtual methods
.method public handleMessage(Landroid/os/Message;)V
.locals 3
.parameter "msg"
.prologue
const/4 v2, 0x0
.line 99
iget v0, p1, Landroid/os/Message;->what:I
packed-switch v0, :pswitch_data_0
.line 175
:cond_0
:goto_0
return-void
.line 101
:pswitch_0
const-string v0, "TransportControlView"
const-string v1, "handleMessage: MSG_UPDATE_STATE"
invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 102
iget-object v0, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
#getter for: Lcom/baidu/internal/keyguard/slide/TransportControlView;->mClientGeneration:I
invoke-static {v0}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$000(Lcom/baidu/internal/keyguard/slide/TransportControlView;)I
move-result v0
iget v1, p1, Landroid/os/Message;->arg1:I
if-ne v0, v1, :cond_0
.line 103
iget-object v0, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
iget v1, p1, Landroid/os/Message;->arg2:I
#calls: Lcom/baidu/internal/keyguard/slide/TransportControlView;->updatePlayPauseState(I)V
invoke-static {v0, v1}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$100(Lcom/baidu/internal/keyguard/slide/TransportControlView;I)V
goto :goto_0
.line 107
:pswitch_1
const-string v0, "TransportControlView"
const-string v1, "handleMessage: MSG_SET_METADATA"
invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 108
iget-object v0, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
#getter for: Lcom/baidu/internal/keyguard/slide/TransportControlView;->mClientGeneration:I
invoke-static {v0}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$000(Lcom/baidu/internal/keyguard/slide/TransportControlView;)I
move-result v0
iget v1, p1, Landroid/os/Message;->arg1:I
if-ne v0, v1, :cond_0
.line 109
iget-object v1, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;
check-cast v0, Landroid/os/Bundle;
#calls: Lcom/baidu/internal/keyguard/slide/TransportControlView;->updateMetadata(Landroid/os/Bundle;)V
invoke-static {v1, v0}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$200(Lcom/baidu/internal/keyguard/slide/TransportControlView;Landroid/os/Bundle;)V
goto :goto_0
.line 113
:pswitch_2
const-string v0, "TransportControlView"
const-string v1, "handleMessage: MSG_SET_TRANSPORT_CONTROLS"
invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 114
iget-object v0, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
#getter for: Lcom/baidu/internal/keyguard/slide/TransportControlView;->mClientGeneration:I
invoke-static {v0}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$000(Lcom/baidu/internal/keyguard/slide/TransportControlView;)I
move-result v0
iget v1, p1, Landroid/os/Message;->arg1:I
if-ne v0, v1, :cond_0
.line 115
iget-object v0, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
iget v1, p1, Landroid/os/Message;->arg2:I
#calls: Lcom/baidu/internal/keyguard/slide/TransportControlView;->updateTransportControls(I)V
invoke-static {v0, v1}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$300(Lcom/baidu/internal/keyguard/slide/TransportControlView;I)V
goto :goto_0
.line 119
:pswitch_3
const-string v0, "TransportControlView"
const-string v1, "handleMessage: MSG_SET_ARTWORK"
invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 120
iget-object v0, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
#getter for: Lcom/baidu/internal/keyguard/slide/TransportControlView;->mClientGeneration:I
invoke-static {v0}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$000(Lcom/baidu/internal/keyguard/slide/TransportControlView;)I
move-result v0
iget v1, p1, Landroid/os/Message;->arg1:I
if-ne v0, v1, :cond_0
.line 121
iget-object v0, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
#getter for: Lcom/baidu/internal/keyguard/slide/TransportControlView;->mMetadata:Lcom/baidu/internal/keyguard/slide/TransportControlView$Metadata;
invoke-static {v0}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$400(Lcom/baidu/internal/keyguard/slide/TransportControlView;)Lcom/baidu/internal/keyguard/slide/TransportControlView$Metadata;
move-result-object v1
iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;
check-cast v0, Landroid/graphics/Bitmap;
#setter for: Lcom/baidu/internal/keyguard/slide/TransportControlView$Metadata;->bitmap:Landroid/graphics/Bitmap;
invoke-static {v1, v0}, Lcom/baidu/internal/keyguard/slide/TransportControlView$Metadata;->access$502(Lcom/baidu/internal/keyguard/slide/TransportControlView$Metadata;Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap;
.line 122
iget-object v0, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
#getter for: Lcom/baidu/internal/keyguard/slide/TransportControlView;->mMetadata:Lcom/baidu/internal/keyguard/slide/TransportControlView$Metadata;
invoke-static {v0}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$400(Lcom/baidu/internal/keyguard/slide/TransportControlView;)Lcom/baidu/internal/keyguard/slide/TransportControlView$Metadata;
move-result-object v0
#getter for: Lcom/baidu/internal/keyguard/slide/TransportControlView$Metadata;->bitmap:Landroid/graphics/Bitmap;
invoke-static {v0}, Lcom/baidu/internal/keyguard/slide/TransportControlView$Metadata;->access$500(Lcom/baidu/internal/keyguard/slide/TransportControlView$Metadata;)Landroid/graphics/Bitmap;
move-result-object v0
if-eqz v0, :cond_1
iget-object v0, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
#getter for: Lcom/baidu/internal/keyguard/slide/TransportControlView;->mTransportWidgetCallbacks:Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;
invoke-static {v0}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$600(Lcom/baidu/internal/keyguard/slide/TransportControlView;)Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;
move-result-object v0
if-eqz v0, :cond_1
.line 123
iget-object v0, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
#getter for: Lcom/baidu/internal/keyguard/slide/TransportControlView;->mTransportWidgetCallbacks:Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;
invoke-static {v0}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$600(Lcom/baidu/internal/keyguard/slide/TransportControlView;)Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;
move-result-object v0
iget-object v1, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
iget-object v2, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
#getter for: Lcom/baidu/internal/keyguard/slide/TransportControlView;->mMetadata:Lcom/baidu/internal/keyguard/slide/TransportControlView$Metadata;
invoke-static {v2}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$400(Lcom/baidu/internal/keyguard/slide/TransportControlView;)Lcom/baidu/internal/keyguard/slide/TransportControlView$Metadata;
move-result-object v2
#getter for: Lcom/baidu/internal/keyguard/slide/TransportControlView$Metadata;->bitmap:Landroid/graphics/Bitmap;
invoke-static {v2}, Lcom/baidu/internal/keyguard/slide/TransportControlView$Metadata;->access$500(Lcom/baidu/internal/keyguard/slide/TransportControlView$Metadata;)Landroid/graphics/Bitmap;
move-result-object v2
invoke-virtual {v1, v2}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->createImage(Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap;
move-result-object v1
invoke-interface {v0, v1}, Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;->setBackground(Landroid/graphics/Bitmap;)V
.line 124
const-string v0, "TransportControlView"
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "music album set to :"
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
iget-object v2, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
#getter for: Lcom/baidu/internal/keyguard/slide/TransportControlView;->mMetadata:Lcom/baidu/internal/keyguard/slide/TransportControlView$Metadata;
invoke-static {v2}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$400(Lcom/baidu/internal/keyguard/slide/TransportControlView;)Lcom/baidu/internal/keyguard/slide/TransportControlView$Metadata;
move-result-object v2
#getter for: Lcom/baidu/internal/keyguard/slide/TransportControlView$Metadata;->bitmap:Landroid/graphics/Bitmap;
invoke-static {v2}, Lcom/baidu/internal/keyguard/slide/TransportControlView$Metadata;->access$500(Lcom/baidu/internal/keyguard/slide/TransportControlView$Metadata;)Landroid/graphics/Bitmap;
move-result-object v2
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
goto/16 :goto_0
.line 126
:cond_1
iget-object v0, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
#getter for: Lcom/baidu/internal/keyguard/slide/TransportControlView;->mTransportWidgetCallbacks:Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;
invoke-static {v0}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$600(Lcom/baidu/internal/keyguard/slide/TransportControlView;)Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;
move-result-object v0
if-eqz v0, :cond_2
.line 127
iget-object v0, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
#getter for: Lcom/baidu/internal/keyguard/slide/TransportControlView;->mTransportWidgetCallbacks:Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;
invoke-static {v0}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$600(Lcom/baidu/internal/keyguard/slide/TransportControlView;)Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;
move-result-object v0
iget-object v1, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
#getter for: Lcom/baidu/internal/keyguard/slide/TransportControlView;->mDefaultBitmap:Landroid/graphics/Bitmap;
invoke-static {v1}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$700(Lcom/baidu/internal/keyguard/slide/TransportControlView;)Landroid/graphics/Bitmap;
move-result-object v1
invoke-interface {v0, v1}, Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;->setBackground(Landroid/graphics/Bitmap;)V
.line 129
:cond_2
const-string v0, "TransportControlView"
const-string v1, "music album set to default bitmap"
invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
goto/16 :goto_0
.line 135
:pswitch_4
const-string v0, "TransportControlView"
const-string v1, "handleMessage: MSG_SET_GENERATION_ID"
invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 136
iget v0, p1, Landroid/os/Message;->arg2:I
if-eqz v0, :cond_4
.line 139
iget-object v0, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
#getter for: Lcom/baidu/internal/keyguard/slide/TransportControlView;->mTransportWidgetCallbacks:Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;
invoke-static {v0}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$600(Lcom/baidu/internal/keyguard/slide/TransportControlView;)Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;
move-result-object v0
if-eqz v0, :cond_3
.line 140
iget-object v0, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
#getter for: Lcom/baidu/internal/keyguard/slide/TransportControlView;->mAudioManager:Landroid/media/AudioManager;
invoke-static {v0}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$800(Lcom/baidu/internal/keyguard/slide/TransportControlView;)Landroid/media/AudioManager;
move-result-object v0
invoke-virtual {v0}, Landroid/media/AudioManager;->isMusicActive()Z
move-result v0
if-nez v0, :cond_3
.line 147
invoke-static {}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$900()I
move-result v0
const/4 v1, 0x2
if-eq v0, v1, :cond_3
.line 148
invoke-static {}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$900()I
move-result v0
const/4 v1, 0x3
if-eq v0, v1, :cond_3
.line 149
iget-object v0, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
#getter for: Lcom/baidu/internal/keyguard/slide/TransportControlView;->mTransportWidgetCallbacks:Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;
invoke-static {v0}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$600(Lcom/baidu/internal/keyguard/slide/TransportControlView;)Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;
move-result-object v0
if-eqz v0, :cond_3
.line 150
iget-object v0, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
#getter for: Lcom/baidu/internal/keyguard/slide/TransportControlView;->mTransportWidgetCallbacks:Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;
invoke-static {v0}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$600(Lcom/baidu/internal/keyguard/slide/TransportControlView;)Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;
move-result-object v0
invoke-interface {v0, v2}, Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;->onPlayStateChanged(I)V
.line 152
iget-object v0, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
#getter for: Lcom/baidu/internal/keyguard/slide/TransportControlView;->mTransportWidgetCallbacks:Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;
invoke-static {v0}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$600(Lcom/baidu/internal/keyguard/slide/TransportControlView;)Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;
move-result-object v0
iget-object v1, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
invoke-interface {v0, v1}, Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;->requestHide(Landroid/view/View;)V
.line 170
:cond_3
:goto_1
const-string v0, "TransportControlView"
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "New genId = "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
iget v2, p1, Landroid/os/Message;->arg1:I
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v1
const-string v2, ", clearing = "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
iget v2, p1, Landroid/os/Message;->arg2:I
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
.line 171
iget-object v0, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
iget v1, p1, Landroid/os/Message;->arg1:I
#setter for: Lcom/baidu/internal/keyguard/slide/TransportControlView;->mClientGeneration:I
invoke-static {v0, v1}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$002(Lcom/baidu/internal/keyguard/slide/TransportControlView;I)I
.line 172
iget-object v1, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;
check-cast v0, Landroid/app/PendingIntent;
#setter for: Lcom/baidu/internal/keyguard/slide/TransportControlView;->mClientIntent:Landroid/app/PendingIntent;
invoke-static {v1, v0}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$1002(Lcom/baidu/internal/keyguard/slide/TransportControlView;Landroid/app/PendingIntent;)Landroid/app/PendingIntent;
goto/16 :goto_0
.line 160
:cond_4
const-string v0, "mounted"
invoke-static {}, Landroid/os/Environment;->getExternalStorageState()Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-nez v0, :cond_3
.line 162
iget-object v0, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
#getter for: Lcom/baidu/internal/keyguard/slide/TransportControlView;->mTransportWidgetCallbacks:Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;
invoke-static {v0}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$600(Lcom/baidu/internal/keyguard/slide/TransportControlView;)Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;
move-result-object v0
if-eqz v0, :cond_3
.line 163
iget-object v0, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
#getter for: Lcom/baidu/internal/keyguard/slide/TransportControlView;->mTransportWidgetCallbacks:Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;
invoke-static {v0}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$600(Lcom/baidu/internal/keyguard/slide/TransportControlView;)Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;
move-result-object v0
invoke-interface {v0, v2}, Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;->onPlayStateChanged(I)V
.line 165
iget-object v0, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
#getter for: Lcom/baidu/internal/keyguard/slide/TransportControlView;->mTransportWidgetCallbacks:Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;
invoke-static {v0}, Lcom/baidu/internal/keyguard/slide/TransportControlView;->access$600(Lcom/baidu/internal/keyguard/slide/TransportControlView;)Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;
move-result-object v0
iget-object v1, p0, Lcom/baidu/internal/keyguard/slide/TransportControlView$1;->this$0:Lcom/baidu/internal/keyguard/slide/TransportControlView;
invoke-interface {v0, v1}, Lcom/baidu/internal/keyguard/slide/TransportWidgetCallback;->requestHide(Landroid/view/View;)V
goto :goto_1
.line 99
nop
:pswitch_data_0
.packed-switch 0x64
:pswitch_0
:pswitch_1
:pswitch_2
:pswitch_3
:pswitch_4
.end packed-switch
.end method
| {
"content_hash": "d8bef54c65c59d433bd33dc28e5462a3",
"timestamp": "",
"source": "github",
"line_count": 513,
"max_line_length": 222,
"avg_line_length": 43.63352826510721,
"alnum_prop": 0.7695675482487491,
"repo_name": "baidurom/reference",
"id": "5382d19d0acbc243eccb2b530d39fa7dd3cb6f3a",
"size": "22384",
"binary": false,
"copies": "1",
"ref": "refs/heads/coron-4.2",
"path": "bosp/android.policy.jar.out/smali/com/baidu/internal/keyguard/slide/TransportControlView$1.smali",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<?php
// src/Acme/DemoBundle/Admin/PostAdmin.php
namespace Admin\AdminBundle\Admin;
use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;
class VideoAdmin extends Admin
{
// Fields to be shown on create/edit forms
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
->add('biography')
;
}
// Fields to be shown on filter forms
protected function configureDatagridFilters(DatagridMapper $datagridMapper)
{
$datagridMapper
->add('biography')
;
}
// Fields to be shown on lists
protected function configureListFields(ListMapper $listMapper)
{
$listMapper
->addIdentifier('biography')
;
}
}
| {
"content_hash": "d060c5b3f374fe9497175ef29b579fd8",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 79,
"avg_line_length": 23.97222222222222,
"alnum_prop": 0.6732329084588644,
"repo_name": "davideugenepeterson/DenverPortfolio",
"id": "3dac8067a942d6de702417f52a582e33c90b3063",
"size": "863",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Admin/AdminBundle/Admin/VideoAdmin.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "491"
},
{
"name": "C",
"bytes": "8656"
},
{
"name": "CSS",
"bytes": "19762"
},
{
"name": "HTML",
"bytes": "275237"
},
{
"name": "JavaScript",
"bytes": "3337"
},
{
"name": "PHP",
"bytes": "11656008"
},
{
"name": "PLSQL",
"bytes": "7498"
},
{
"name": "Shell",
"bytes": "2579"
},
{
"name": "TypeScript",
"bytes": "195"
}
],
"symlink_target": ""
} |
/*!
This file is kept for backward compatibility.
It is no longer required.
*/ | {
"content_hash": "14d47973acfa48fe16a38921ce11412c",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 45,
"avg_line_length": 15.8,
"alnum_prop": 0.7341772151898734,
"repo_name": "cdnjs/cdnjs",
"id": "5d407fc7fc4bec6f50e40a640c782da6bc373792",
"size": "331",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ajax/libs/devextreme/21.2.1-alpha-21230-1556/css/dx.common.css",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
FROM balenalib/intel-edison-ubuntu:eoan-build
# remove several traces of debian python
RUN apt-get purge -y python.*
# http://bugs.python.org/issue19846
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
ENV LANG C.UTF-8
# key 63C7CC90: public key "Simon McVittie <smcv@pseudorandom.co.uk>" imported
# key 3372DCFA: public key "Donald Stufft (dstufft) <donald@stufft.io>" imported
RUN gpg --keyserver keyring.debian.org --recv-keys 4DE8FF2A63C7CC90 \
&& gpg --keyserver keyserver.ubuntu.com --recv-key 6E3CBCE93372DCFA \
&& gpg --keyserver keyserver.ubuntu.com --recv-keys 0x52a43a1e4b77b059
ENV PYTHON_VERSION 3.6.12
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
ENV PYTHON_PIP_VERSION 21.0.1
ENV SETUPTOOLS_VERSION 56.0.0
RUN set -x \
&& curl -SLO "http://resin-packages.s3.amazonaws.com/python/v$PYTHON_VERSION/Python-$PYTHON_VERSION.linux-i386-openssl1.1.tar.gz" \
&& echo "9cd9ed174d7508f08ce2ba72ba8062139cc94129942f0a393874a78f5cfb6f1a Python-$PYTHON_VERSION.linux-i386-openssl1.1.tar.gz" | sha256sum -c - \
&& tar -xzf "Python-$PYTHON_VERSION.linux-i386-openssl1.1.tar.gz" --strip-components=1 \
&& rm -rf "Python-$PYTHON_VERSION.linux-i386-openssl1.1.tar.gz" \
&& ldconfig \
&& if [ ! -e /usr/local/bin/pip3 ]; then : \
&& curl -SLO "https://raw.githubusercontent.com/pypa/get-pip/430ba37776ae2ad89f794c7a43b90dc23bac334c/get-pip.py" \
&& echo "19dae841a150c86e2a09d475b5eb0602861f2a5b7761ec268049a662dbd2bd0c get-pip.py" | sha256sum -c - \
&& python3 get-pip.py \
&& rm get-pip.py \
; fi \
&& pip3 install --no-cache-dir --upgrade --force-reinstall pip=="$PYTHON_PIP_VERSION" setuptools=="$SETUPTOOLS_VERSION" \
&& find /usr/local \
\( -type d -a -name test -o -name tests \) \
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
-exec rm -rf '{}' + \
&& cd / \
&& rm -rf /usr/src/python ~/.cache
# install "virtualenv", since the vast majority of users of this image will want it
RUN pip3 install --no-cache-dir virtualenv
ENV PYTHON_DBUS_VERSION 1.2.8
# install dbus-python dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
libdbus-1-dev \
libdbus-glib-1-dev \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get -y autoremove
# install dbus-python
RUN set -x \
&& mkdir -p /usr/src/dbus-python \
&& curl -SL "http://dbus.freedesktop.org/releases/dbus-python/dbus-python-$PYTHON_DBUS_VERSION.tar.gz" -o dbus-python.tar.gz \
&& curl -SL "http://dbus.freedesktop.org/releases/dbus-python/dbus-python-$PYTHON_DBUS_VERSION.tar.gz.asc" -o dbus-python.tar.gz.asc \
&& gpg --verify dbus-python.tar.gz.asc \
&& tar -xzC /usr/src/dbus-python --strip-components=1 -f dbus-python.tar.gz \
&& rm dbus-python.tar.gz* \
&& cd /usr/src/dbus-python \
&& PYTHON_VERSION=$(expr match "$PYTHON_VERSION" '\([0-9]*\.[0-9]*\)') ./configure \
&& make -j$(nproc) \
&& make install -j$(nproc) \
&& cd / \
&& rm -rf /usr/src/dbus-python
# make some useful symlinks that are expected to exist
RUN cd /usr/local/bin \
&& ln -sf pip3 pip \
&& { [ -e easy_install ] || ln -s easy_install-* easy_install; } \
&& ln -sf idle3 idle \
&& ln -sf pydoc3 pydoc \
&& ln -sf python3 python \
&& ln -sf python3-config python-config
# set PYTHONPATH to point to dist-packages
ENV PYTHONPATH /usr/lib/python3/dist-packages:$PYTHONPATH
CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"]
RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@python.sh" \
&& echo "Running test-stack@python" \
&& chmod +x test-stack@python.sh \
&& bash test-stack@python.sh \
&& rm -rf test-stack@python.sh
RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: Intel 32-bit (x86) \nOS: Ubuntu eoan \nVariant: build variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nPython v3.6.12, Pip v21.0.1, Setuptools v56.0.0 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info
RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
&& chmod +x /bin/sh-shim \
&& cp /bin/sh /bin/sh.real \
&& mv /bin/sh-shim /bin/sh | {
"content_hash": "2397c5b14b4a516a131476a837b8b655",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 721,
"avg_line_length": 50.63157894736842,
"alnum_prop": 0.7031185031185031,
"repo_name": "nghiant2710/base-images",
"id": "67a036c9c80ea9316975c2dd7b4862cd678180aa",
"size": "4831",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "balena-base-images/python/intel-edison/ubuntu/eoan/3.6.12/build/Dockerfile",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "144558581"
},
{
"name": "JavaScript",
"bytes": "16316"
},
{
"name": "Shell",
"bytes": "368690"
}
],
"symlink_target": ""
} |
<?xml version='1.0' encoding='UTF-8'?>
<org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage_-Tag plugin="workflow-support@2.14">
<node class="org.jenkinsci.plugins.workflow.cps.nodes.StepAtomNode" plugin="workflow-cps@2.32">
<parentIds>
<string>5</string>
</parentIds>
<id>6</id>
<descriptorId>experimental.DhPwdStep</descriptorId>
</node>
<actions>
<org.jenkinsci.plugins.workflow.actions.TimingAction plugin="workflow-api@2.16">
<startTime>1506401016479</startTime>
</org.jenkinsci.plugins.workflow.actions.TimingAction>
</actions>
</org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage_-Tag> | {
"content_hash": "7dd8bb21ba8b966dc390717aaa7753b3",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 113,
"avg_line_length": 45.666666666666664,
"alnum_prop": 0.7445255474452555,
"repo_name": "10000TB/state-replay",
"id": "20f8df3fda973762af230eb3f42b9fd3da06c8d0",
"size": "685",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "work/jobs/test-step-plugins/builds/26/workflow/6.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "356523"
},
{
"name": "Groovy",
"bytes": "6983"
},
{
"name": "HTML",
"bytes": "850883"
},
{
"name": "Java",
"bytes": "23693"
},
{
"name": "JavaScript",
"bytes": "23479115"
},
{
"name": "Roff",
"bytes": "541"
},
{
"name": "Shell",
"bytes": "1898"
}
],
"symlink_target": ""
} |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.peterfranza</groupId>
<artifactId>PropertyTranslator</artifactId>
<version>1.3.14-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
<name>PropertyTranslator</name>
<url>https://github.com/pfranza/LanguagePropertyTranslator</url>
<properties>
<mavenVersion>3.2.1</mavenVersion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.thedeanda</groupId>
<artifactId>lorem</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>com.github.javaparser</groupId>
<artifactId>javaparser-symbol-solver-core</artifactId>
<version>3.6.10</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>1.7.2</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>${mavenVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${mavenVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>file-management</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
<version>${mavenVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<version>3.1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>0.9.12</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-translate</artifactId>
<version>1.11.840</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.13.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<scm>
<url>https://github.com/pfranza/LanguagePropertyTranslator</url>
<developerConnection>scm:git:git@github.com:pfranza/LanguagePropertyTranslator.git</developerConnection>
<connection>scm:git:git@github.com:pfranza/LanguagePropertyTranslator.git</connection>
<tag>PropertyTranslator-1.1.2</tag>
</scm>
<issueManagement>
<url>https://github.com/pfranza/LanguagePropertyTranslator/issues</url>
<system>github</system>
</issueManagement>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<distributionManagement>
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus snapshot repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>sonatype-nexus-staging</id>
<name>Sonatype Nexus release repository</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgument>-proc:none</compilerArgument>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.3</version>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>release-sign-artifacts</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<filtering>true</filtering>
<directory>src/main/resources</directory>
</resource>
<resource>
<filtering>false</filtering>
<directory>src/main/java</directory>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
</build>
</profile>
</profiles>
<description>The LanguagePropertyTranslator takes a fileset of property files that represent the source language, and a set of translators. and generates a sister set of language property files.</description>
<organization>
<name>Peter Franza</name>
<url>https://www.peterfranza.com/</url>
</organization>
<developers>
<developer>
<id>pfranza</id>
<name>Peter Franza</name>
<email>pfranza@gmail.com</email>
<timezone>America/New_York</timezone>
<url>https://www.peterfranza.com/</url>
<roles>
<role>architect</role>
<role>developer</role>
</roles>
</developer>
</developers>
</project>
| {
"content_hash": "99e6d816b2f7d16a119edc49b2ef0688",
"timestamp": "",
"source": "github",
"line_count": 235,
"max_line_length": 209,
"avg_line_length": 26.825531914893617,
"alnum_prop": 0.6789340101522843,
"repo_name": "pfranza/LanguagePropertyTranslator",
"id": "604eae2cb49f519c749ed8742c24b0f8c3e2e886",
"size": "6304",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "60045"
}
],
"symlink_target": ""
} |
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**_class** | **NSString*** | | [optional]
**busyExecutors** | **NSNumber*** | | [optional]
**computer** | [**NSArray<OAIHudsonMasterComputer>***](OAIHudsonMasterComputer.md) | | [optional]
**displayName** | **NSString*** | | [optional]
**totalExecutors** | **NSNumber*** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
| {
"content_hash": "6589f2acd78cd45cd2c78fa44c4bc83c",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 161,
"avg_line_length": 51.09090909090909,
"alnum_prop": 0.5693950177935944,
"repo_name": "cliffano/swaggy-jenkins",
"id": "3fb66efab0f1fc345036365c6af9373777890a77",
"size": "594",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "clients/objc/generated/docs/OAIComputerSet.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ada",
"bytes": "569823"
},
{
"name": "Apex",
"bytes": "741346"
},
{
"name": "Batchfile",
"bytes": "14792"
},
{
"name": "C",
"bytes": "971274"
},
{
"name": "C#",
"bytes": "5131336"
},
{
"name": "C++",
"bytes": "7799032"
},
{
"name": "CMake",
"bytes": "20609"
},
{
"name": "CSS",
"bytes": "4873"
},
{
"name": "Clojure",
"bytes": "129018"
},
{
"name": "Crystal",
"bytes": "864941"
},
{
"name": "Dart",
"bytes": "876777"
},
{
"name": "Dockerfile",
"bytes": "7385"
},
{
"name": "Eiffel",
"bytes": "424642"
},
{
"name": "Elixir",
"bytes": "139252"
},
{
"name": "Elm",
"bytes": "187067"
},
{
"name": "Emacs Lisp",
"bytes": "191"
},
{
"name": "Erlang",
"bytes": "373074"
},
{
"name": "F#",
"bytes": "556012"
},
{
"name": "Gherkin",
"bytes": "951"
},
{
"name": "Go",
"bytes": "345227"
},
{
"name": "Groovy",
"bytes": "89524"
},
{
"name": "HTML",
"bytes": "2367424"
},
{
"name": "Haskell",
"bytes": "680841"
},
{
"name": "Java",
"bytes": "12164874"
},
{
"name": "JavaScript",
"bytes": "1959006"
},
{
"name": "Kotlin",
"bytes": "1280953"
},
{
"name": "Lua",
"bytes": "322316"
},
{
"name": "Makefile",
"bytes": "11882"
},
{
"name": "Nim",
"bytes": "65818"
},
{
"name": "OCaml",
"bytes": "94665"
},
{
"name": "Objective-C",
"bytes": "464903"
},
{
"name": "PHP",
"bytes": "4383673"
},
{
"name": "Perl",
"bytes": "743304"
},
{
"name": "PowerShell",
"bytes": "678274"
},
{
"name": "Python",
"bytes": "5529523"
},
{
"name": "QMake",
"bytes": "6915"
},
{
"name": "R",
"bytes": "840841"
},
{
"name": "Raku",
"bytes": "10945"
},
{
"name": "Ruby",
"bytes": "328360"
},
{
"name": "Rust",
"bytes": "1735375"
},
{
"name": "Scala",
"bytes": "1387368"
},
{
"name": "Shell",
"bytes": "407167"
},
{
"name": "Swift",
"bytes": "342562"
},
{
"name": "TypeScript",
"bytes": "3060093"
}
],
"symlink_target": ""
} |
name: Dr. Trent McConaghy
id: trent-mcconaghy
company: "BigchainDB"
position: "CTO and Co-Founder"
location: "Berlin, Germany"
talk_id: data-ai-and-tokens
intro: >
Trent McConaghy has 15 years of deep technology experience with a focus on machine learning, data visualization and user experience. He was a researcher at the Canadian Department of Defense and in 1999, he co-founded Analog Design Automation Inc. and was its CTO until its acquisition by Synopsys Inc.
links:
- text: "@trentmc0"
url: "https://twitter.com/trentmc0"
- text: "Facebook"
url: "https://facebook.com/trent.mcconaghy"
- text: "GitHub"
url: "https://github.com/trentmc"
- text: "LinkedIn"
url: "https://www.linkedin.com/in/trentmc"
---
In 2004, he co-founded Solido Design Automation Inc., once again in the role of CTO. Trent has written two critically acclaimed books on machine learning, creativity and circuit design and has authored or co-authored more than 40 papers and patents.
Trent has a PhD in Engineering from KU Leuven, Belgium and Bachelor’s degrees in Engineering and in Computer Science from the University of Saskatchewan where he won awards for the top PhD thesis and top undergraduate thesis.
| {
"content_hash": "89a36d90b39db39d353f2244287f9162",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 306,
"avg_line_length": 51.416666666666664,
"alnum_prop": 0.7487844408427877,
"repo_name": "9984/2017.9984.io",
"id": "0c2415ef88939d779f29a8a601db9eac297d76ef",
"size": "1240",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_src/_speakers/trent-mcconaghy.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "20312"
},
{
"name": "HTML",
"bytes": "25234"
},
{
"name": "JavaScript",
"bytes": "24744"
},
{
"name": "Ruby",
"bytes": "145"
},
{
"name": "Shell",
"bytes": "2463"
}
],
"symlink_target": ""
} |
package util;
public class Util {
public static String removeSpaces(String str) {
if (str.charAt(0) == ' ') {
return removeSpaces(str.substring(1));
}
if (str.charAt(str.length()-1) == ' ') {
return removeSpaces(str.substring(0, str.length()-1));
}
return str;
}
}
| {
"content_hash": "29a2d2c5db8cf2301936b55327f995e5",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 57,
"avg_line_length": 19.066666666666666,
"alnum_prop": 0.6258741258741258,
"repo_name": "aishikawa/nezumi-tspsolver",
"id": "d7835221e37667ce3354ce1c6a3376afe659e0b3",
"size": "882",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/util/Util.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "40643"
}
],
"symlink_target": ""
} |
@class GHUIYapTableView;
@protocol GHUIYapTableViewDelegate <NSObject>
@optional
- (void)tableViewDidChange:(GHUIYapTableView *)tableView;
@end
@interface GHUIYapTableView : GHUITableView
@property (readonly) YapDatabaseViewMappings *mappings;
@property (weak) id<GHUIYapTableViewDelegate> yapDelegate;
- (void)setDatabase:(YapDatabase *)database collection:(NSString *)collection grouping:(YapDatabaseViewGrouping *)grouping groupFilterBlock:(YapDatabaseViewMappingGroupFilter)groupFilterBlock groupSortBlock:(YapDatabaseViewMappingGroupSort)groupSortBlock sorting:(YapDatabaseViewSorting *)sorting completion:(void (^)(GHUIYapTableView *tableView, GHUIYapTableViewDataSource *dataSource))completion;
- (void)setDatabase:(YapDatabase *)database collection:(NSString *)collection completion:(void (^)(GHUIYapTableView *tableView, GHUIYapTableViewDataSource *dataSource))completion;
- (void)setDatabase:(YapDatabase *)database extension:(NSString *)extension groups:(NSArray *)groups;
@end
| {
"content_hash": "b35a5a3b49e9967cbd009ecf62efe117",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 398,
"avg_line_length": 49.85,
"alnum_prop": 0.8304914744232698,
"repo_name": "gabriel/GHUITable",
"id": "dd2207cbdf0a7fbf36991f8bb7fc8b0bb935ec88",
"size": "1317",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "YapTableView/GHUIYapTableView.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "90238"
},
{
"name": "Ruby",
"bytes": "1436"
}
],
"symlink_target": ""
} |
package org.huberb.nbgzip.util;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import org.netbeans.api.progress.ProgressHandle;
import org.openide.util.Cancellable;
/**
* Encapsulate <code>ProgressHandle</code> tasks here.
* <p>
* This class supports a progress handle which tracks the amount of bytes read
* from an <code>ProgressInputStream</code>.
*
* @see ProgressInputStream
*
* @author HuberB1
*/
public class ProgressHandleWrapper implements Cancellable {
private ProgressHandle progressHandle;
private final ProgressInputStream pis;
private boolean cancel;
/**
* Create a new instance.
*
* @param newPis watch this input stream, and use the amount of read bytes
* as progress indication.
*/
public ProgressHandleWrapper(ProgressInputStream newPis) {
this.cancel = false;
this.pis = newPis;
}
/**
* Set progress handle
*
* @param newProgressHandle
*/
public void setProgressHandle(ProgressHandle newProgressHandle) {
this.progressHandle = newProgressHandle;
this.cancel = false;
this.progressHandle.start(100);
final PropertyChangeListener pcl = new ProgressInputStreamPropertyChangeListener(this.progressHandle);
pis.addPropertyChangeListener(pcl);
}
public ProgressHandle getProgressHandle() {
return this.progressHandle;
}
public ProgressInputStream getProgressInputStream() {
return this.pis;
}
/**
* Implement the <code>Cancellable</code> interface.
*/
@Override
public boolean cancel() {
this.cancel = true;
return this.cancel;
}
public boolean isCancelled() {
return this.cancel;
}
/**
* Encapsulate updating the ProgressHandle progress.
*/
public static class ProgressInputStreamPropertyChangeListener implements PropertyChangeListener {
private final ProgressHandle progressHandle;
public ProgressInputStreamPropertyChangeListener(ProgressHandle progressHandle) {
this.progressHandle = progressHandle;
}
/**
* This callback is invoked each time bytes are read from a
* <code>ProgressInputStream</code>. This method updates the
* <code>ProgressHandle</code> progress
*
* @param evt the property change event delivered from the
* <code>ProgressInputStream</code>
*
* @see ProgressInputStream
*/
@Override
public void propertyChange(final PropertyChangeEvent evt) {
final ProgressInputStream pis = (ProgressInputStream) evt.getSource();
final int progress = pis.getReadPercentage();
progressHandle.progress(progress);
}
}
}
| {
"content_hash": "6f5831e060d0011bb918fac5a17cb5f4",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 110,
"avg_line_length": 29.575757575757574,
"alnum_prop": 0.6478825136612022,
"repo_name": "bernhardhuber/netbeansplugins",
"id": "e257c315f42bc3f278c7d672dad0246b9d99b5ce",
"size": "2928",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "nb-gzip/src/org/huberb/nbgzip/util/ProgressHandleWrapper.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "6585"
},
{
"name": "HTML",
"bytes": "458513"
},
{
"name": "Haskell",
"bytes": "2913"
},
{
"name": "Java",
"bytes": "1376336"
},
{
"name": "XSLT",
"bytes": "72671"
}
],
"symlink_target": ""
} |
import {AfterViewInit, ChangeDetectorRef, Component, ElementRef} from "@angular/core";
import {HttpClient} from "@angular/common/http";
import {TimeGr, GrItem, Shortcut, RangeTimeDataRanges} from "jigsaw/public_api";
import {AsyncDescription} from "../../../template/demo-template/demo-template";
@Component({
selector: 'range-date-time-picker-gr-items',
templateUrl: './demo.component.html'
})
export class RangeDateTimeGrItemsComponent extends AsyncDescription implements AfterViewInit {
public demoPath = "demo/range-date-time-picker/gr-items";
beginDate = "now-1d";
endDate = "now";
// 这个demo还必须用于演示shortcut (/pc/range-date-time-picker/shortcut),因此这部分功能不能去
shortcuts: Shortcut[] = [{label: "最近三天", dateRange: ["now-3d", "now"]},
{label: "本周", dateRange: RangeTimeDataRanges.RecentWeek}];
grItems: GrItem[] = [
{label: "Day", value: TimeGr.date, shortcuts: this.shortcuts, span: "15d"},
{label: "Week", value: TimeGr.week},
{label: "Month", value: TimeGr.month}
];
constructor(public changeDetectorRef: ChangeDetectorRef, http: HttpClient, el: ElementRef) {
super(http, el);
}
ngAfterViewInit() {
this.changeDetectorRef.detectChanges();
}
onChange($event) {
console.log($event)
}
}
| {
"content_hash": "6817e6a7293bd163fe000962b26a13ce",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 96,
"avg_line_length": 34,
"alnum_prop": 0.665158371040724,
"repo_name": "rdkmaster/jigsaw",
"id": "c80370c1082c56e27053043984fc10e565f676b1",
"size": "1378",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/app/for-external/demo/range-date-time-picker/gr-items/demo.component.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "AutoIt",
"bytes": "7636"
},
{
"name": "CSS",
"bytes": "3231221"
},
{
"name": "HTML",
"bytes": "10423519"
},
{
"name": "JavaScript",
"bytes": "1132519"
},
{
"name": "SCSS",
"bytes": "535631"
},
{
"name": "Shell",
"bytes": "12910"
},
{
"name": "TypeScript",
"bytes": "4455145"
}
],
"symlink_target": ""
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>lua-nucleo</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Modules</h2>
<ul>
<li><a href="../modules/lua-nucleo.algorithm.html">lua-nucleo.algorithm</a></li>
<li><a href="../modules/lua-nucleo.args.html">lua-nucleo.args</a></li>
<li><strong>lua-nucleo.assert</strong></li>
<li><a href="../modules/lua-nucleo.checker.html">lua-nucleo.checker</a></li>
<li><a href="../modules/lua-nucleo.code.exports.html">lua-nucleo.code.exports</a></li>
<li><a href="../modules/lua-nucleo.code.foreign-global.lua5_1.html">lua-nucleo.code.foreign-global.lua5_1</a></li>
<li><a href="../modules/lua-nucleo.code.foreign-global.luajit2.html">lua-nucleo.code.foreign-global.luajit2</a></li>
<li><a href="../modules/lua-nucleo.code.globals.html">lua-nucleo.code.globals</a></li>
<li><a href="../modules/lua-nucleo.code.profile.html">lua-nucleo.code.profile</a></li>
<li><a href="../modules/lua-nucleo.coro.html">lua-nucleo.coro</a></li>
<li><a href="../modules/lua-nucleo.deque.html">lua-nucleo.deque</a></li>
<li><a href="../modules/lua-nucleo.diagnostics.html">lua-nucleo.diagnostics</a></li>
<li><a href="../modules/lua-nucleo.dsl.common_load_schema.html">lua-nucleo.dsl.common_load_schema</a></li>
<li><a href="../modules/lua-nucleo.dsl.dsl_loader.html">lua-nucleo.dsl.dsl_loader</a></li>
<li><a href="../modules/lua-nucleo.dsl.dump_nodes.html">lua-nucleo.dsl.dump_nodes</a></li>
<li><a href="../modules/lua-nucleo.dsl.tagged-tree.html">lua-nucleo.dsl.tagged-tree</a></li>
<li><a href="../modules/lua-nucleo.dsl.walk_data_with_schema.html">lua-nucleo.dsl.walk_data_with_schema</a></li>
<li><a href="../modules/lua-nucleo.ensure.html">lua-nucleo.ensure</a></li>
<li><a href="../modules/lua-nucleo.factory.html">lua-nucleo.factory</a></li>
<li><a href="../modules/lua-nucleo.functional.html">lua-nucleo.functional</a></li>
<li><a href="../modules/lua-nucleo.import.html">lua-nucleo.import</a></li>
<li><a href="../modules/lua-nucleo.init.html">lua-nucleo.init</a></li>
<li><a href="../modules/lua-nucleo.language.html">lua-nucleo.language</a></li>
<li><a href="../modules/lua-nucleo.log.html">lua-nucleo.log</a></li>
<li><a href="../modules/lua-nucleo.math.html">lua-nucleo.math</a></li>
<li><a href="../modules/lua-nucleo.misc.html">lua-nucleo.misc</a></li>
<li><a href="../modules/lua-nucleo.module.html">lua-nucleo.module</a></li>
<li><a href="../modules/lua-nucleo.ordered_named_cat_manager.html">lua-nucleo.ordered_named_cat_manager</a></li>
<li><a href="../modules/lua-nucleo.pcall.html">lua-nucleo.pcall</a></li>
<li><a href="../modules/lua-nucleo.prettifier.html">lua-nucleo.prettifier</a></li>
<li><a href="../modules/lua-nucleo.priority_queue.html">lua-nucleo.priority_queue</a></li>
<li><a href="../modules/lua-nucleo.random.html">lua-nucleo.random</a></li>
<li><a href="../modules/lua-nucleo.require_and_declare.html">lua-nucleo.require_and_declare</a></li>
<li><a href="../modules/lua-nucleo.sandbox.html">lua-nucleo.sandbox</a></li>
<li><a href="../modules/lua-nucleo.scoped_cat_tree_manager.html">lua-nucleo.scoped_cat_tree_manager</a></li>
<li><a href="../modules/lua-nucleo.stack_with_factory.html">lua-nucleo.stack_with_factory</a></li>
<li><a href="../modules/lua-nucleo.strict.html">lua-nucleo.strict</a></li>
<li><a href="../modules/lua-nucleo.string.html">lua-nucleo.string</a></li>
<li><a href="../modules/lua-nucleo.suite.html">lua-nucleo.suite</a></li>
<li><a href="../modules/lua-nucleo.table.html">lua-nucleo.table</a></li>
<li><a href="../modules/lua-nucleo.table-utils.html">lua-nucleo.table-utils</a></li>
<li><a href="../modules/lua-nucleo.tdeepequals.html">lua-nucleo.tdeepequals</a></li>
<li><a href="../modules/lua-nucleo.testing.decorator.html">lua-nucleo.testing.decorator</a></li>
<li><a href="../modules/lua-nucleo.times_queue.html">lua-nucleo.times_queue</a></li>
<li><a href="../modules/lua-nucleo.timestamp.html">lua-nucleo.timestamp</a></li>
<li><a href="../modules/lua-nucleo.tpretty.html">lua-nucleo.tpretty</a></li>
<li><a href="../modules/lua-nucleo.tserialize.html">lua-nucleo.tserialize</a></li>
<li><a href="../modules/lua-nucleo.tstr.html">lua-nucleo.tstr</a></li>
<li><a href="../modules/lua-nucleo.type.html">lua-nucleo.type</a></li>
<li><a href="../modules/lua-nucleo.typeassert.html">lua-nucleo.typeassert</a></li>
<li><a href="../modules/lua-nucleo.util.anim.interpolator.html">lua-nucleo.util.anim.interpolator</a></li>
<li><a href="../modules/test.test-lib.generate-test-list.html">test.test-lib.generate-test-list</a></li>
<li><a href="../modules/test.test-lib.import.html">test.test-lib.import</a></li>
<li><a href="../modules/test.test-lib.init.no-suite.html">test.test-lib.init.no-suite</a></li>
<li><a href="../modules/test.test-lib.init.no-suite-no-import.html">test.test-lib.init.no-suite-no-import</a></li>
<li><a href="../modules/test.test-lib.init.strict.html">test.test-lib.init.strict</a></li>
<li><a href="../modules/test.test-lib.table.html">test.test-lib.table</a></li>
<li><a href="../modules/test.test-lib.tdeepequals-test-utils.html">test.test-lib.tdeepequals-test-utils</a></li>
<li><a href="../modules/test.test-lib.tserialize-test-utils.html">test.test-lib.tserialize-test-utils</a></li>
<li><a href="../modules/test.test-lib.value-generators.html">test.test-lib.value-generators</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>lua-nucleo.assert</code></h1>
<p>Enhanced assertions</p>
<p>
This file is a part of lua-nucleo library</p>
<h3>Info:</h3>
<ul>
<li><strong>Copyright</strong>: lua-nucleo authors (see file `COPYRIGHT` for the license)</li>
</ul>
<br/>
<br/>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.3.12</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>
| {
"content_hash": "df682a181d2c1d121749c5374b479b0e",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 118,
"avg_line_length": 50.7578125,
"alnum_prop": 0.6649222718177621,
"repo_name": "LuaDist2/lua-nucleo",
"id": "625874a19debec881291196c9cef6028020daaa2",
"size": "6497",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "doc/modules/lua-nucleo.assert.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "9841"
},
{
"name": "Lua",
"bytes": "682217"
},
{
"name": "Shell",
"bytes": "10387"
}
],
"symlink_target": ""
} |
"use strict";
var _ = require('lodash');
var actions_1 = require('./actions');
var redux_1 = require('redux');
var redux_actions_1 = require('redux-actions');
var defaultState = {
entry: {
word: '',
body: []
},
status: 'pending',
history: {
present: {
words: [],
cursor: null
},
past: {
words: [],
cursor: null
}
}
};
var entry = redux_actions_1.handleActions((_a = {},
_a[actions_1.FETCH.INIT] = function (state, action) { return _.assign({}, state, {
word: action.payload,
body: state.body
}); },
_a[actions_1.FETCH.SUCC] = function (state, action) { return _.assign({}, state, {
word: state.word,
body: action.payload
}); },
_a
), defaultState.entry);
var status = redux_actions_1.handleActions((_b = {},
_b[actions_1.STATUS.INIT] = function (state, action) { return 'pending'; },
_b[actions_1.STATUS.SUCC] = function (state, action) { return 'succeed'; },
_b[actions_1.STATUS.FAIL] = function (state, action) { return 'failed'; },
_b
), defaultState.status);
var history = redux_actions_1.handleActions((_c = {},
_c[actions_1.LOOKUP.INIT] = function (state, action) {
var backup = state.present;
var nextWord = state.present.words[state.present.cursor + 1];
if (nextWord && nextWord !== action.payload) {
return {
past: backup,
present: {
words: _.concat(_.take(state.present.words, state.present.cursor + 1), action.payload),
cursor: state.present.cursor + 1
}
};
}
else {
return {
past: backup,
present: {
words: _.concat(state.present.words, action.payload),
cursor: state.present.words.length
}
};
}
},
_c[actions_1.LOOKUP.FAIL] = function (state, action) { return _.assign({}, state, {
present: state.past
}); },
_c[actions_1.BACKWARD.INIT] = function (state, action) {
var backup = state.present;
return {
past: backup,
present: {
words: state.present.words,
cursor: _.max([state.present.cursor - 1, 0])
}
};
},
_c[actions_1.BACKWARD.FAIL] = function (state, action) { return _.assign({}, state, {
present: state.past
}); },
_c[actions_1.FORWARD.INIT] = function (state, action) {
var backup = state.present;
return {
past: backup,
present: {
words: state.present.words,
cursor: state.present.cursor + 1
}
};
},
_c[actions_1.FORWARD.FAIL] = function (state, action) { return _.assign({}, state, {
present: state.past
}); },
_c
), defaultState.history);
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = redux_1.combineReducers({
entry: entry,
status: status,
history: history
});
var _a, _b, _c;
//# sourceMappingURL=reducer.js.map | {
"content_hash": "686dbe39509030497ee368128e6ad96b",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 107,
"avg_line_length": 31.683168316831683,
"alnum_prop": 0.5175,
"repo_name": "banacorn/lookup",
"id": "c3f5a86dcbbf71b1b9b2d2848f49e2373e84617e",
"size": "3200",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dist/reducer.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "222932"
},
{
"name": "HTML",
"bytes": "621"
},
{
"name": "JavaScript",
"bytes": "1700924"
},
{
"name": "TypeScript",
"bytes": "47955"
}
],
"symlink_target": ""
} |
#ifndef WPA_I_H
#define WPA_I_H
struct rsn_pmksa_candidate;
#ifdef _MSC_VER
#pragma pack(push, 1)
#endif /* _MSC_VER */
/**
* struct wpa_ptk - WPA Pairwise Transient Key
* IEEE Std 802.11i-2004 - 8.5.1.2 Pairwise key hierarchy
*/
struct wpa_ptk {
u8 kck[16]; /* EAPOL-Key Key Confirmation Key (KCK) */
u8 kek[16]; /* EAPOL-Key Key Encryption Key (KEK) */
u8 tk1[16]; /* Temporal Key 1 (TK1) */
union {
u8 tk2[16]; /* Temporal Key 2 (TK2) */
struct {
u8 tx_mic_key[8];
u8 rx_mic_key[8];
} auth;
} u;
} STRUCT_PACKED;
#ifdef _MSC_VER
#pragma pack(pop)
#endif /* _MSC_VER */
#ifdef CONFIG_PEERKEY
#define PEERKEY_MAX_IE_LEN 80
struct wpa_peerkey {
struct wpa_peerkey *next;
int initiator; /* whether this end was initator for SMK handshake */
u8 addr[ETH_ALEN]; /* other end MAC address */
u8 inonce[WPA_NONCE_LEN]; /* Initiator Nonce */
u8 pnonce[WPA_NONCE_LEN]; /* Peer Nonce */
u8 rsnie_i[PEERKEY_MAX_IE_LEN]; /* Initiator RSN IE */
size_t rsnie_i_len;
u8 rsnie_p[PEERKEY_MAX_IE_LEN]; /* Peer RSN IE */
size_t rsnie_p_len;
u8 smk[PMK_LEN];
int smk_complete;
u8 smkid[PMKID_LEN];
u32 lifetime;
os_time_t expiration;
int cipher; /* Selected cipher (WPA_CIPHER_*) */
u8 replay_counter[WPA_REPLAY_COUNTER_LEN];
int replay_counter_set;
struct wpa_ptk stk, tstk;
int stk_set, tstk_set;
};
#else /* CONFIG_PEERKEY */
struct wpa_peerkey;
#endif /* CONFIG_PEERKEY */
/**
* struct wpa_sm - Internal WPA state machine data
*/
struct wpa_sm {
u8 pmk[PMK_LEN];
size_t pmk_len;
struct wpa_ptk ptk, tptk;
int ptk_set, tptk_set;
u8 snonce[WPA_NONCE_LEN];
u8 anonce[WPA_NONCE_LEN]; /* ANonce from the last 1/4 msg */
int renew_snonce;
u8 rx_replay_counter[WPA_REPLAY_COUNTER_LEN];
int rx_replay_counter_set;
u8 request_counter[WPA_REPLAY_COUNTER_LEN];
struct eapol_sm *eapol; /* EAPOL state machine from upper level code */
struct rsn_pmksa_cache *pmksa; /* PMKSA cache */
struct rsn_pmksa_cache_entry *cur_pmksa; /* current PMKSA entry */
struct rsn_pmksa_candidate *pmksa_candidates;
struct l2_packet_data *l2_preauth;
struct l2_packet_data *l2_preauth_br;
u8 preauth_bssid[ETH_ALEN]; /* current RSN pre-auth peer or
* 00:00:00:00:00:00 if no pre-auth is
* in progress */
struct eapol_sm *preauth_eapol;
struct wpa_sm_ctx *ctx;
void *scard_ctx; /* context for smartcard callbacks */
int fast_reauth; /* whether EAP fast re-authentication is enabled */
struct wpa_ssid *cur_ssid;
u8 own_addr[ETH_ALEN];
const char *ifname;
const char *bridge_ifname;
u8 bssid[ETH_ALEN];
unsigned int dot11RSNAConfigPMKLifetime;
unsigned int dot11RSNAConfigPMKReauthThreshold;
unsigned int dot11RSNAConfigSATimeout;
unsigned int dot11RSNA4WayHandshakeFailures;
/* Selected configuration (based on Beacon/ProbeResp WPA IE) */
unsigned int proto;
unsigned int pairwise_cipher;
unsigned int group_cipher;
unsigned int key_mgmt;
unsigned int mgmt_group_cipher;
u8 *assoc_wpa_ie; /* Own WPA/RSN IE from (Re)AssocReq */
size_t assoc_wpa_ie_len;
u8 *ap_wpa_ie, *ap_rsn_ie;
size_t ap_wpa_ie_len, ap_rsn_ie_len;
#ifdef CONFIG_PEERKEY
struct wpa_peerkey *peerkey;
#endif /* CONFIG_PEERKEY */
};
static inline void wpa_sm_set_state(struct wpa_sm *sm, wpa_states state)
{
sm->ctx->set_state(sm->ctx->ctx, state);
}
static inline wpa_states wpa_sm_get_state(struct wpa_sm *sm)
{
return sm->ctx->get_state(sm->ctx->ctx);
}
static inline void wpa_sm_deauthenticate(struct wpa_sm *sm, int reason_code)
{
sm->ctx->deauthenticate(sm->ctx->ctx, reason_code);
}
static inline void wpa_sm_disassociate(struct wpa_sm *sm, int reason_code)
{
sm->ctx->disassociate(sm->ctx->ctx, reason_code);
}
static inline int wpa_sm_set_key(struct wpa_sm *sm, wpa_alg alg,
const u8 *addr, int key_idx, int set_tx,
const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len)
{
return sm->ctx->set_key(sm->ctx->ctx, alg, addr, key_idx, set_tx,
seq, seq_len, key, key_len);
}
static inline struct wpa_ssid * wpa_sm_get_ssid(struct wpa_sm *sm)
{
return sm->ctx->get_ssid(sm->ctx->ctx);
}
static inline int wpa_sm_get_bssid(struct wpa_sm *sm, u8 *bssid)
{
return sm->ctx->get_bssid(sm->ctx->ctx, bssid);
}
static inline int wpa_sm_ether_send(struct wpa_sm *sm, const u8 *dest,
u16 proto, const u8 *buf, size_t len)
{
return sm->ctx->ether_send(sm->ctx->ctx, dest, proto, buf, len);
}
static inline int wpa_sm_get_beacon_ie(struct wpa_sm *sm)
{
return sm->ctx->get_beacon_ie(sm->ctx->ctx);
}
static inline void wpa_sm_cancel_auth_timeout(struct wpa_sm *sm)
{
sm->ctx->cancel_auth_timeout(sm->ctx->ctx);
}
static inline u8 * wpa_sm_alloc_eapol(struct wpa_sm *sm, u8 type,
const void *data, u16 data_len,
size_t *msg_len, void **data_pos)
{
return sm->ctx->alloc_eapol(sm->ctx->ctx, type, data, data_len,
msg_len, data_pos);
}
static inline int wpa_sm_add_pmkid(struct wpa_sm *sm, const u8 *bssid,
const u8 *pmkid)
{
return sm->ctx->add_pmkid(sm->ctx->ctx, bssid, pmkid);
}
static inline int wpa_sm_remove_pmkid(struct wpa_sm *sm, const u8 *bssid,
const u8 *pmkid)
{
return sm->ctx->remove_pmkid(sm->ctx->ctx, bssid, pmkid);
}
static inline int wpa_sm_mlme_setprotection(struct wpa_sm *sm, const u8 *addr,
int protect_type, int key_type)
{
return sm->ctx->mlme_setprotection(sm->ctx->ctx, addr, protect_type,
key_type);
}
#endif /* WPA_I_H */
| {
"content_hash": "47232d3934863d92f054149e42a7f655",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 78,
"avg_line_length": 25.875598086124402,
"alnum_prop": 0.678069526627219,
"repo_name": "wilebeast/FireFox-OS",
"id": "d1cab4bbf945a309c02d22b86fafc4c7a9b95877",
"size": "5851",
"binary": false,
"copies": "33",
"ref": "refs/heads/master",
"path": "B2G/external/wpa_supplicant/wpa_i.h",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
const actions = {
modal(context, obj) {
context.commit('MODAL', obj);
},
alert(context, obj) {
context.commit('ALERT', obj);
},
user(context) {
context.commit('USER');
},
changeLocale(context, lang) {
context.commit('LOCALE');
},
logout(context) {
context.commit('LOGOUT');
},
isLogin(context) {
context.commit('ISLOGIN');
}
};
export default actions;
| {
"content_hash": "f34bae6ad714c5cfd82b4d0f644562e7",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 37,
"avg_line_length": 21.333333333333332,
"alnum_prop": 0.5357142857142857,
"repo_name": "lovelypig5/mock-server",
"id": "3c6d8706e7cf9f02be9c4a6dc6b793d01fe0e63c",
"size": "448",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "assets/js/vuex/actions.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "28996"
},
{
"name": "HTML",
"bytes": "17806"
},
{
"name": "Java",
"bytes": "1973"
},
{
"name": "JavaScript",
"bytes": "125622"
},
{
"name": "Objective-C",
"bytes": "4416"
},
{
"name": "Python",
"bytes": "1722"
},
{
"name": "Smarty",
"bytes": "13871"
},
{
"name": "Vue",
"bytes": "37166"
}
],
"symlink_target": ""
} |
var loaderUtils = require('loader-utils');
var hashFiles = require('./utils').hashFiles;
module.exports = {
createArrayCodepointFiles (codepointFiles, elem) {
const defaultElem = { fileName: '[fontname].codepoints.js', type: 'web' };
if (typeof (elem) === 'boolean') {
codepointFiles.push(Object.assign({}, defaultElem));
} else if (typeof (elem) === 'string') {
codepointFiles.push(Object.assign({}, defaultElem, { fileName: elem }));
} else if (Array.isArray(elem)) {
elem.forEach(e => this.createArrayCodepointFiles(codepointFiles, e));
} else if (typeof (elem) === 'object') {
codepointFiles.push(Object.assign({}, defaultElem, elem));
}
},
emitFiles (loaderContext, emitCodepointsOptions, generatorOptions, options) {
var codepointFiles = [];
this.createArrayCodepointFiles(codepointFiles, emitCodepointsOptions);
codepointFiles.forEach(emitOption => {
var codepointsContent = JSON.stringify(generatorOptions.codepoints);
switch (emitOption.type) {
case 'commonjs': {
codepointsContent = 'module.exports = ' + codepointsContent + ';';
break;
}
case 'web': {
codepointsContent = [
'if (typeof webfontIconCodepoints === \'undefined\') {',
' webfontIconCodepoints = {};',
'}',
'webfontIconCodepoints[' + JSON.stringify(generatorOptions.fontName) + '] = ' + codepointsContent + ';'
].join('\n');
break;
}
case 'json': {
break;
}
}
var codepointsFilename = emitOption.fileName;
var chunkHash = codepointsFilename.indexOf('[chunkhash]') !== -1
? hashFiles(generatorOptions.files, options.hashLength) : '';
codepointsFilename = codepointsFilename
.replace('[chunkhash]', chunkHash)
.replace('[fontname]', generatorOptions.fontName);
codepointsFilename = loaderUtils.interpolateName(loaderContext,
codepointsFilename,
{
context: loaderContext.rootContext || loaderContext.options.context || loaderContext.context,
content: codepointsContent
}
);
loaderContext.emitFile(codepointsFilename, codepointsContent);
});
}
};
| {
"content_hash": "5539650c8c7dabfab1cf3d638e8e6e62",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 115,
"avg_line_length": 37.85,
"alnum_prop": 0.6252752091589608,
"repo_name": "jeerbl/webfonts-loader",
"id": "f2288331e208c4aac01d9d125311b7c826274e53",
"size": "2271",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "emit-codepoints.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "15054"
},
{
"name": "Shell",
"bytes": "98"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>square-matrices: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.8.2 / square-matrices - 8.6.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
square-matrices
<small>
8.6.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-09-22 01:18:02 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-09-22 01:18:02 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-ocamlbuild base OCamlbuild binary and libraries distributed with the OCaml compiler
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 2 Virtual package relying on perl
coq 8.8.2 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.02.3 The OCaml compiler (virtual package)
ocaml-base-compiler 4.02.3 Official 4.02.3 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.5 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "Hugo.Herbelin@inria.fr"
homepage: "https://github.com/coq-contribs/square-matrices"
license: "LGPL 2.1"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/SquareMatrices"]
depends: [
"ocaml"
"coq" {>= "8.6" & < "8.7~"}
]
tags: [ "keyword: exponentiation" "keyword: vectors" "keyword: matrices" "keyword: polymorphic recursion" "keyword: nested datatypes" "category: Mathematics/Algebra" ]
authors: [ "Jean-Christophe Filliâtre" ]
bug-reports: "https://github.com/coq-contribs/square-matrices/issues"
dev-repo: "git+https://github.com/coq-contribs/square-matrices.git"
synopsis: "From Fast Exponentiation to Square Matrices"
description: """
This development is a formalization of Chris Okasaki's article
``From Fast Exponentiation to Square Matrices: An Adventure in Types''"""
flags: light-uninstall
url {
src:
"https://github.com/coq-contribs/square-matrices/archive/v8.6.0.tar.gz"
checksum: "md5=bb9f13979dbe764afff08adb3e72d98d"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-square-matrices.8.6.0 coq.8.8.2</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.8.2).
The following dependencies couldn't be met:
- coq-square-matrices -> coq < 8.7~ -> ocaml < 4.02.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-square-matrices.8.6.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "8f0b8d063613a1c34cb2ea7ad76a7e26",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 227,
"avg_line_length": 43.18934911242604,
"alnum_prop": 0.5528154541718043,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "288987efb1c0ae826c3b17ca7b06259f3466e8b7",
"size": "7325",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.02.3-2.0.6/released/8.8.2/square-matrices/8.6.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
<header class="navbar navbar-expand-lg navbar-light fixed-top headroom">
<div class="container">
<h1><a class="navbar-brand" href="<?php echo home_url(); ?>/" style="background-image:url('/assets/img/logo.png');" title="Me :)"></a></h1>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavDropdown">
@include('partials/nav')
</div>
</div>
</header> | {
"content_hash": "16d0a3654ccf0e52c18135bc70d755f8",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 190,
"avg_line_length": 55.09090909090909,
"alnum_prop": 0.7029702970297029,
"repo_name": "aaronjheinen/aaronranard.com",
"id": "48aa7f15491ab69bbb94730dba72987cf1312149",
"size": "606",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "web/app/themes/roots/templates/partials/header.blade.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "21727"
},
{
"name": "HTML",
"bytes": "19973"
},
{
"name": "JavaScript",
"bytes": "14645"
},
{
"name": "PHP",
"bytes": "44784"
}
],
"symlink_target": ""
} |
sap.ui.define([
'jquery.sap.global',
'sap/ui/core/ComponentContainer'
], function (jQuery, ComponentContainer) {
"use strict";
var $ = jQuery,
_loadingStarted = false,
_oComponentContainer = null,
_$Component = null;
/**
* By using start launcher will instantiate and place the component into html.
* By using teardown launcher will destroy the component and remove the div from html.
* Calling start twice without teardown is not allowed
* @private
* @class
* @author SAP SE
* @alias sap.ui.test.launchers.componentLauncher
*/
return {
start: function (mComponentConfig) {
if (_loadingStarted) {
throw "sap.ui.test.launchers.componentLauncher: Start was called twice without teardown";
}
mComponentConfig.async = true;
var oPromise = sap.ui.component(mComponentConfig);
_loadingStarted = true;
return oPromise.then(function (oComponent) {
var sId = jQuery.sap.uid();
// create and add div to html
_$Component = $('<div id="' + sId + '" class="sapUiOpaComponent"></div>');
$("body").append(_$Component);
$("body").addClass("sapUiOpaBodyComponent");
// create and place the component into html
_oComponentContainer = new ComponentContainer({component: oComponent});
_oComponentContainer.placeAt(sId);
});
},
teardown: function () {
// Opa prevent the case if teardown was called after the start but before the promise was fulfilled
if (!_loadingStarted){
throw "sap.ui.test.launchers.componentLauncher: Teardown has been called but there was no start";
}
_oComponentContainer.destroy();
_$Component.remove();
_loadingStarted = false;
$("body").removeClass("sapUiOpaBodyComponent");
}
};
}, /* export= */ true); | {
"content_hash": "67b9d96a62204bb0adffc2daa0b6b15f",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 102,
"avg_line_length": 28.080645161290324,
"alnum_prop": 0.6858127512923607,
"repo_name": "pro100den/openui5-bundle",
"id": "3eb4ad3d8911834adc76b66f74822bdc397fdbd3",
"size": "1926",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "Resources/public/sap/ui/test/launchers/componentLauncher-dbg.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "4658931"
},
{
"name": "HTML",
"bytes": "1908"
},
{
"name": "JavaScript",
"bytes": "31869243"
},
{
"name": "PHP",
"bytes": "121"
}
],
"symlink_target": ""
} |
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'chrome://os-settings/chromeos/lazy_load.js';
import {CrSettingsPrefs, Router, routes} from 'chrome://os-settings/chromeos/os_settings.js';
import {assert} from 'chrome://resources/js/assert.js';
import {getDeepActiveElement} from 'chrome://resources/js/util.js';
import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
import {waitAfterNextRender} from 'chrome://webui-test/polymer_test_util.js';
import {assertEquals} from 'chrome://webui-test/chai_assert.js';
suite('TimezoneSubpageTests', function() {
/** @type {TimezoneSubpage} */
let timezoneSubpage = null;
setup(function() {
PolymerTest.clearBody();
const prefElement = document.createElement('settings-prefs');
document.body.appendChild(prefElement);
return CrSettingsPrefs.initialized.then(function() {
timezoneSubpage = document.createElement('timezone-subpage');
timezoneSubpage.prefs = prefElement.prefs;
document.body.appendChild(timezoneSubpage);
});
});
teardown(function() {
timezoneSubpage.remove();
CrSettingsPrefs.resetForTesting();
Router.getInstance().resetRouteForTesting();
});
test('Timezone autodetect by geolocation radio', async () => {
const timezoneRadioGroup =
assert(timezoneSubpage.shadowRoot.querySelector('#timeZoneRadioGroup'));
// Resolve timezone by geolocation is on.
timezoneSubpage.setPrefValue(
'generated.resolve_timezone_by_geolocation_on_off', true);
flush();
assertEquals('true', timezoneRadioGroup.selected);
// Resolve timezone by geolocation is off.
timezoneSubpage.setPrefValue(
'generated.resolve_timezone_by_geolocation_on_off', false);
flush();
assertEquals('false', timezoneRadioGroup.selected);
// Set timezone autodetect on by clicking the 'on' radio.
const timezoneAutodetectOn = assert(
timezoneSubpage.shadowRoot.querySelector('#timeZoneAutoDetectOn'));
timezoneAutodetectOn.click();
assertTrue(timezoneSubpage
.getPref('generated.resolve_timezone_by_geolocation_on_off')
.value);
// Turn timezone autodetect off by clicking the 'off' radio.
const timezoneAutodetectOff = assert(
timezoneSubpage.shadowRoot.querySelector('#timeZoneAutoDetectOff'));
timezoneAutodetectOff.click();
assertFalse(timezoneSubpage
.getPref('generated.resolve_timezone_by_geolocation_on_off')
.value);
});
test('Deep link to time zone setter on subpage', async () => {
// Resolve timezone by geolocation is on.
timezoneSubpage.setPrefValue(
'generated.resolve_timezone_by_geolocation_on_off', true);
const params = new URLSearchParams();
params.append('settingId', '1001');
Router.getInstance().navigateTo(routes.DATETIME_TIMEZONE_SUBPAGE, params);
const deepLinkElement =
timezoneSubpage.shadowRoot.querySelector('#timeZoneAutoDetectOn')
.shadowRoot.querySelector('#button');
await waitAfterNextRender(deepLinkElement);
assertEquals(
deepLinkElement, getDeepActiveElement(),
'Auto set time zone toggle should be focused for settingId=1001.');
});
});
| {
"content_hash": "8d3b32b25fa472110217372aedf577a0",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 93,
"avg_line_length": 38.25,
"alnum_prop": 0.7067736185383244,
"repo_name": "chromium/chromium",
"id": "129af2a587787d89dc85ebad21b4eed48b727f82",
"size": "3366",
"binary": false,
"copies": "6",
"ref": "refs/heads/main",
"path": "chrome/test/data/webui/settings/chromeos/timezone_subpage_test.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
```php
public Result->getNumberOfSeats ( ): ?int
```
Get number of Seats for STV methods result.
### Return value:
*(```?int```)* Number of seats if this result is a STV method. Else NULL.
---------------------------------------
### Related method(s)
* [Election::setNumberOfSeats](../Election%20Class/public%20Election--setNumberOfSeats.md)
* [Election::getNumberOfSeats](../Election%20Class/public%20Election--getNumberOfSeats.md)
| {
"content_hash": "8ea6f6cf3c8d580780571c251a916488",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 94,
"avg_line_length": 25.666666666666668,
"alnum_prop": 0.6233766233766234,
"repo_name": "julien-boudry/Condorcet",
"id": "6275df1879780948018d164f7b281822ce2ef2ad",
"size": "519",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Documentation/Result Class/public Result--getNumberOfSeats.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "1218"
},
{
"name": "PHP",
"bytes": "775090"
}
],
"symlink_target": ""
} |
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Threading.Tasks;
using Windows.UI.Xaml.Media;
using JetBrains.Annotations;
using Player.ViewModels;
namespace Player.Model
{
internal static class _BuiltInSlides
{
public const string WhiskeyFileName = "whisky.jpeg";
private const string WhiskeyName = "whisky";
private const string CarFileName = "burning_car.jpeg";
private const string CarName = "car";
[NotNull] private static readonly Lazy<ImageLoader> ImageData = new Lazy<ImageLoader>(_InitImageData);
[NotNull]
public static Task<_SlideLibrary> LoadAllSlides()
{
var loader = ImageData.Value;
Debug.Assert(loader != null, "loader != null");
var allSlides = new[] {_MakeWhiskySlide(loader), _MakeBurningCarSlide(loader)};
return Task.FromResult(new _SlideLibrary(allSlides, loader));
}
[NotNull]
private static _ImageLoaderHardCoded _InitImageData()
{
var imageData = new _ImageLoaderHardCoded();
imageData.Add(WhiskeyName, ImageDataFor(WhiskeyFileName));
imageData.Add(CarName, ImageDataFor(CarFileName));
return imageData;
}
[NotNull]
public static Slide BurningCar()
{
return _MakeBurningCarSlide(ImageData.Value);
}
[NotNull]
private static Slide _MakeBurningCarSlide([NotNull] ImageLoader imageData)
{
var result = new Slide(imageData)
{
BackgroundImageName = CarName,
BackgroundFill = Stretch.UniformToFill,
BackgroundColor = ColorScheme.FromHtmlArgbStringValue("#FF000000"),
MessageTop = "You are so advanced!"
};
result.UseWhiteText();
return result;
}
[NotNull]
private static Slide _MakeWhiskySlide([NotNull] ImageLoader imageData)
{
var result = new Slide(imageData)
{
BackgroundImageName = WhiskeyName,
BackgroundFill = Stretch.Uniform,
BackgroundColor = ColorScheme.FromHtmlArgbStringValue("#FFFFFFFF"),
MessageCenter = "Let's play!"
};
result.UseBlackText();
return result;
}
[NotNull]
public static Stream ImageDataFor([NotNull] string name)
{
return typeof (_BuiltInSlides).GetTypeInfo()
.Assembly.GetManifestResourceStream("Player.Assets." + name);
}
[NotNull]
public static Task CopyArbitraryImageToStream([NotNull] Stream destination)
{
var fileStream = ImageDataFor(WhiskeyFileName);
return fileStream.CopyToAsync(destination)
.ContinueWith(t => fileStream.Dispose());
}
}
} | {
"content_hash": "932272e76979da67c147873e8c178952",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 104,
"avg_line_length": 27.602272727272727,
"alnum_prop": 0.7303417044051049,
"repo_name": "arlobelshee/PresentationKaraoke",
"id": "f51ade6f9b530c89bad872d0bbd10cfae55bf55a",
"size": "2573",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Player/Player/Model/_BuiltInSlides.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "119022"
},
{
"name": "PowerShell",
"bytes": "196"
}
],
"symlink_target": ""
} |
#ifndef DATEXREQUEST_H
#define DATEXREQUEST_H
#include "config.h"
#include "Request.h"
#include "StreetSegmentItemPacket.h"
#include "GetTMCCoordinatePacket.h"
#include "AddDisturbancePacket.h"
#include "RemoveDisturbancePacket.h"
#include <time.h>
#include <vector>
#include <queue>
#include <memory>
#include "TopRegionPacket.h"
#include "TopRegionMatch.h"
#include "IDTranslationPacket.h"
#include "TrafficSituation.h"
#include "TrafficDataTypes.h"
#include "MC2String.h"
#include "ExpandItemID.h"
#include "RouteRequest.h"
#include "GenericServer.h"
class CoveredIDsRequest;
class TopRegionRequest;
class TrafficPointRequest;
/**
* Request the processing of a DATEX message in a TRISS server.
* The result of the processing of this request is the addition,
* modification or removal of one or more Disturbances in the InfoModule
*/
class DATEXRequest : public Request
{
public:
/**
* Constructor
* @param topReq Pointer to valid TopRegionRequest with data
*/
DATEXRequest(uint16 requestID,
TrafficSituation* trafficSituation,
const TopRegionRequest* topReq);
/**
* Constructor
* @param topReq Pointer to valid TopRegionRequest with data
*/
DATEXRequest(uint16 requestID,
vector<TrafficSituation*> trafficVector,
const TopRegionRequest* topReq,
MC2String supplier,
vector<MC2String> toBeKept);
/**
* Delete this Request and release allocated memory.
*/
virtual ~DATEXRequest();
/// init the member variables
void init();
/**
* The state variable.
*/
enum datex_state {
STATE_TMC = 0,
STATE_STREET_SEGMENT_ITEM,
STATE_COVERED_IDS,
STATE_ROUTE_REQUEST,
STATE_TOP_REGION_REQUEST,
STATE_ID_TRANSLATION_REQUEST,
STATE_ADD_DISTURBANCE,
STATE_DONE,
STATE_ERROR
} m_state;
/// Processes a situation
datex_state processSituation();
/**
* Process a ReplyPacket received from a Module.
* @param packetCont PacketContainer with the reply from a Module.
*/
void processPacket(PacketContainer* packetCont);
/**
* Method for recieving the result of the Request. This is always
* NULL for a DATEXRequest.
* @return Always NULL for a DATEXRequest.
*/
PacketContainer* getAnswer() {
return NULL;
}
/**
* Get the current state of the DATEXRequest.
* @return The current state of the DATEXRequest.
*/
datex_state getState() {
return m_state;
}
protected:
/**
* Creates the GetTMCCoordinateRequestPacket(s).
* @return The PacketContainer to send to the InfoModule.
*/
datex_state createGetTMCCoordinateRequestPacket();
/**
* Handles the information of the GetTMCCoordinateReplyPacket from the
* InfoModule and returns the next Request state.
* @param pack The reply packet from the InfoModule.
* @return The next state of the request.
*/
datex_state processGetTMCCoordinateReplyPacket(PacketContainer* packet);
/**
* Processes all the StreetSegmentItemReplyPackets.
*/
void processStreetReplyPackets();
/**
* Creates the StreetSegmentItemRequestPacket(s).
* @return The next state of the request.
*/
datex_state createStreetSegmentItemRequestPackets();
/**
* Handles the information of the StreetSegmentItemReplyPacket from
* the MapModule and returns the next Request state.
* @param packet The reply packet from the MapModule.
* @return The next state of the request.
*/
datex_state processStreetSegmentItemReplyPacket(PacketContainer* packet);
/**
* Returns two arrays, one with the angles and one with the extra
* costC for the routeModule.
* @param expItemID The ExpandItemID from the route
* @param stringItems The ExpandStringItem array from the route
* module.
* @param angle A reference to the angle array, where the angles are
* put.
* @param costC A reference to the costC array, where the costC:s are
* put.
*/
void getAngle(ExpandItemID* expItemID,
uint32* &angle);
/**
* Creates a CoveredIDsRequestRequest to get multiple start and origins.
* @return The next state of the request.
*/
datex_state createCoveredIDsRequestRequest();
/**
* Handle when a covered ID is finnished.
*/
datex_state handleCoveredIDsDone();
/**
* Handles the next replypacket from the CoveredIDsRequest.
* @param pack The reply packet from the CoveredIDsRequest.
* @return The next state of the request.
*/
datex_state processCoveredIDsReply(PacketContainer* pack);
/**
* Creates the RouteRequest if we have a two-point disturbance.
* @return The next state of the request.
*/
datex_state createRouteRequest();
/**
* Handles the next replypacket from the RouteRequest.
* @param pack The reply packet from the RouteRequest.
* @return The next state of the request.
*/
datex_state processRouteReply(PacketContainer* pack);
/**
* Handles the information in the ExpandRouteReplyPacket from the
* RouteRequest.
* @return The next state of the request.
*/
datex_state handleRouteReply();
/**
* Creates the TopRegionRequestPacket.
* @return The next state of the request.
*/
datex_state createTopRegionRequestPacket();
/**
* Processes the TopRegionReplyPacket from the MapModule.
* @param packet The TopRegionReplyPacket.
* @return The next state of the request.
*/
datex_state processTopRegionReplyPacket(PacketContainer* packet);
/**
* Creates the IDTranslationRequestPacket(s).
* @return The next state of the request.
*/
datex_state createIDTranslationRequestPacket();
/**
* Handles the reply from the IDTranslationRequesPacket and
* creates the map, which transforms low level nodes to nodes on the
* overview map.
* @param pack The IDTranslationReplyPacket.
* @return The next state of the request.
*/
datex_state processIDTranslationReplyPacket(PacketContainer* packet);
/**
* Creates the AddDisturbanceRequestPackets.
* @return The next state of the request.
*/
datex_state createAddDisturbanceRequestPacket();
/**
* Handles the information of the AddDisturbanceReplyPacket from the
* InfoModule and returns the next state of the Request.
* @param pack The reply packet from the InfoModule.
* @return The next state of the request.
*/
datex_state processAddDisturbanceReplyPacket(PacketContainer* packet);
private:
// Member variables
/// The message ID from the file
MC2String m_situationReference;
/// The location table for the situation
MC2String m_locationTable;
/// The element reference
MC2String m_elementReference;
/// The start time
uint32 m_startTime;
/// The expiry time
uint32 m_expiryTime;
/// The creation time
uint32 m_creationTime;
/// The disturbance type
TrafficDataTypes::disturbanceType m_type;
/// The phrase
TrafficDataTypes::phrase m_phrase;
/// The eventcode
uint32 m_eventCode;
/// The text
MC2String m_text;
/// The severity
TrafficDataTypes::severity m_severity;
/// The severity factor
TrafficDataTypes::severity_factor m_severityFactor;
/// The first location code as a string
MC2String m_firstLocation;
/// The direction
TrafficDataTypes::direction m_direction;
/// The second location code as a string
MC2String m_secondLocation;
/// The extent
int16 m_extent;
/// The extra cost
uint32 m_costFactor;
/// Vector with coordinates from Triss server
vector<pair<int32, int32> > m_tmcCoords;
/// The queue length
uint32 m_queueLength;
/// Request packets that is going to be sent
list<StreetSegmentItemRequestPacket*> m_streetSegmentRequestPackets;
queue<IDTranslationRequestPacket*> m_idRequestPackets;
list<AddDisturbanceRequestPacket*> m_addRequestPackets;
/// The number of request packets that is going to be sent
uint32 m_nbrRequestPackets;
/// A vector with all the RouteRequests.
vector<RouteRequest*> m_routeRequests;
/// The number of route requests.
uint32 m_nbrRouteRequests;
/// A vector with all the mapIDs.
vector<uint32> m_mapID;
/// The nodeID's for affected StreetSegmentItems.
vector<uint32> m_nodeID;
/**
* The latitudes and longitudes from the MapModule, the coordinates
* in the middle of the StreetSegmentItem
*/
vector<pair<int32, int32> > m_coords;
/// The latitudes and longitudes from the TMC-database
vector<pair<int32, int32> > m_tmcFirst;
vector<pair<int32, int32> > m_tmcSecond;
/**
* The angles from the MapModule, which decribes the direction of
* the Disturbance on the StreetSegmentItem.
*/
vector<uint32> m_angle;
/// The number of packets sent so far.
uint32 m_sent;
/// The number of packets recieved in the current state so far.
uint32 m_received;
/** The total map ID tree structure. */
auto_ptr<ItemIDTree> m_mapIDTree;
/// A vector that contains all the nodes on the low level map.
vector<IDPair_t> m_lowLevelNodes;
/**
* A vector with nodeVectors, used when creating the
* IDTranslationRequestPacket. You put all the pairs with nodeIDs and
* mapIDs that is going to translated in the vector.
*/
IDPairVector_t* m_nodeVectors[1];
/// A map that transforms a pair of mapID and nodeID, to a pair of
// mapID and nodeID on the overview map.
map<IDPair_t, IDPair_t> m_lowLevelPairToHighLevel;
/// A multimap with the StreetSegmentItemReplyPackets.
multimap<uint32, PacketContainer*> m_streetReplyPackets;
/// A vector with all the traffic situations
vector<TrafficSituation*> m_trafficSituations;
/// pointer to valid topregionrequest *with* data
const TopRegionRequest* m_topReq;
/**
* Flag showing that we had TMC location but failed to use it
* The severity of the traffic situation should be minimal.
*/
bool m_tmcFailed;
/// Coverd id reqesuts
CoveredIDsRequest* m_coveredIDreq;
auto_ptr<TrafficPointRequest> m_trafficPointReq;
/// The status of the request. Returned if m_state == ERROR
StringTable::stringCode m_status;
/// if the origin is covered or not
bool m_originsCovered;
/// The origin ids
set<IDPair_t> m_originIDs;
/// the destination ids
set<IDPair_t> m_destinationIDs;
/// The disturbance length.
float64 m_distance;
};
#endif
| {
"content_hash": "01586a7a70421e0c9fa11bf6b29a3b72",
"timestamp": "",
"source": "github",
"line_count": 386,
"max_line_length": 76,
"avg_line_length": 28.1580310880829,
"alnum_prop": 0.6759591498757935,
"repo_name": "wayfinder/Wayfinder-Server",
"id": "4d8d7cd208e406bcdee5501a9352906c234e392b",
"size": "12397",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Server/Servers/include/DATEXRequest.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "305133"
},
{
"name": "C++",
"bytes": "31013369"
},
{
"name": "Java",
"bytes": "398162"
},
{
"name": "Perl",
"bytes": "1192824"
},
{
"name": "Python",
"bytes": "28913"
},
{
"name": "R",
"bytes": "712964"
},
{
"name": "Shell",
"bytes": "388202"
}
],
"symlink_target": ""
} |
using System.Collections.Generic;
using System.Threading.Tasks;
using OpenStardriveServer.Domain.Database;
namespace OpenStardriveServer.Domain;
public interface ICommandRepository
{
Task InitializeTable();
Task Save(Command command);
Task<IEnumerable<Command>> LoadPage(long cursor = 0, int pageSize = 1000);
}
public class CommandRepository : ICommandRepository
{
private readonly ISqliteAdapter sqliteAdapter;
public CommandRepository(ISqliteAdapter sqliteAdapter)
{
this.sqliteAdapter = sqliteAdapter;
}
public async Task InitializeTable()
{
var sql = "CREATE TABLE IF NOT EXISTS CommandLog" +
" (CommandId text, ClientId text, Type text, Payload text, Timestamp text)";
await sqliteAdapter.ExecuteAsync(sql);
}
public async Task Save(Command command)
{
var sql = "INSERT INTO CommandLog (CommandId, ClientId, Type, Payload, Timestamp)" +
" VALUES (@CommandId, @ClientId, @Type, @Payload, @Timestamp)";
await sqliteAdapter.ExecuteAsync(sql, command);
}
public async Task<IEnumerable<Command>> LoadPage(long cursor = 0, int pageSize = 1000)
{
var sql = "SELECT RowId, CommandId, ClientId, Type, Payload, Timestamp" +
" FROM CommandLog WHERE ROWID > @cursor ORDER BY ROWID LIMIT @pageSize";
return await sqliteAdapter.QueryAsync<Command>(sql, new {cursor, pageSize});
}
} | {
"content_hash": "c1d1f2ab50e911b85cb4f584067d1ecd",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 94,
"avg_line_length": 34,
"alnum_prop": 0.6826265389876881,
"repo_name": "openstardrive/server",
"id": "f9d5bd6cbd7aceb66fd6f0ce9e14b4b075c1e0d1",
"size": "1462",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "OpenStardriveServer/Domain/CommandRepository.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "382042"
},
{
"name": "CSS",
"bytes": "1712"
},
{
"name": "HTML",
"bytes": "9649"
},
{
"name": "JavaScript",
"bytes": "31361"
}
],
"symlink_target": ""
} |
'use strict'
const client = require('..')
// Explicit basic auth
const options1 = {
application: 'demo',
profiles: ['test', 'timeout'],
auth: {
user: 'username',
pass: 'password'
}
}
client.load(options1).then((cfg) => {
console.log(cfg.get('test.users', 'multi.uid'))
console.log(cfg.toString(2))
}).catch((error) => console.error(error))
// Implicit basic auth
const options2 = {
endpoint: 'http://user:pass@localhost:8888',
application: 'demo',
profiles: ['test', 'timeout']
}
client.load(options2).then((cfg) => {
console.log(cfg.get('test.users', 'multi.uid'))
console.log(cfg.toString(2))
}).catch((error) => console.error(error))
| {
"content_hash": "d1310ba5f73fc349a67e07adbe26d274",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 49,
"avg_line_length": 22.4,
"alnum_prop": 0.6398809523809523,
"repo_name": "victorherraiz/cloud-config-client",
"id": "26292f278923098feb6fb4e22e4615bff85b483b",
"size": "672",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/auth.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "23469"
}
],
"symlink_target": ""
} |
<section data-ng-controller="ActionsController" data-ng-init="findOne()">
<div class="page-header">
<h1>Edit Action</h1>
</div>
<div class="col-md-12">
<form class="form-horizontal" data-ng-submit="update()" novalidate autocomplete="off">
<fieldset>
<alert data-ng-show="error" data-ng-bind="error" type="danger"></alert>
<div class="form-group">
<label class="control-label" for="networkEvent">Network Event</label>
<div class="controls">
<select id="networkEvent" class="form-control" data-ng-model="action.networkEvent._id" ng-options="networkEvent._id as networkEvent.listName() for networkEvent in networkEvents">
<option value="">-- Not associated with an event -- </option>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label" for="actor">Find actor</label>
<div class="controls">
<input id="actor" type="text" ng-model="action.actor.displayName" typeahead-editable="false" typeahead-on-select="action.actor = $item" typeahead="participant.listName() for participant in findParticipants($viewValue)" class="form-control" placeholder="Find actor">
</div>
</div>
<div class="form-group">
<label class="control-label" for="type">Type of action?</label>
<span id="identityHelpBlock" class="help-block">Action: Offering, Request, Declaration, BOTN</span>
<div class="controls">
<select id="type" name="type" class="form-control" data-ng-model="action.type" placeholder="Action?">
<option>Offering</option>
<option>Request</option>
<option>Declaration</option>
<option>BOTN</option>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label" for="description">Description</label>
<div class="controls">
<input type="text" data-ng-model="action.description" id="description" class="form-control" placeholder="Description" required>
</div>
</div>
<div class="form-group">
<label class="control-label" for="match">Find match</label>
<div class="controls">
<input type="text" ng-model="selectedMatch" typeahead-editable="false" typeahead-on-select="addMatch(action.matches, $item)" typeahead="participant.listName() for participant in findParticipants($viewValue)" class="form-control" placeholder="Find match">
</div>
</div>
<div class="list-group">
<span data-ng-repeat="match in action.matches" class="list-group-item">
<span>
<span data-ng-bind="match.displayName"></span>
<a class="btn" data-ng-click="removeMatch(action.matches, $index);">
<i class="glyphicon glyphicon-remove"></i>
</a>
</span>
</span>
</div>
<div class="form-group">
<input type="submit" value="Update" class="btn btn-default">
</div>
</fieldset>
</form>
</div>
</section> | {
"content_hash": "9fa6545fd982c1f4e8c7d9bbbc9ba67c",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 289,
"avg_line_length": 55.904761904761905,
"alnum_prop": 0.5357751277683135,
"repo_name": "TadBirmingham/home",
"id": "593786156ae58d3f714590712df30d42f932ff95",
"size": "3522",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "public/modules/actions/views/edit-action.client.view.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "500"
},
{
"name": "HTML",
"bytes": "55237"
},
{
"name": "JavaScript",
"bytes": "232908"
},
{
"name": "Shell",
"bytes": "414"
}
],
"symlink_target": ""
} |
import lasagne.layers as L
import lasagne.nonlinearities as LN
import lasagne.init as LI
import theano.tensor as TT
import theano
from rllab.misc import ext
from rllab.core.lasagne_layers import OpLayer
from rllab.core.lasagne_powered import LasagnePowered
from rllab.core.serializable import Serializable
import numpy as np
def wrapped_conv(*args, **kwargs):
copy = dict(kwargs)
copy.pop("image_shape", None)
copy.pop("filter_shape", None)
assert copy.pop("filter_flip", False)
input, W, input_shape, get_W_shape = args
if theano.config.device == 'cpu':
return theano.tensor.nnet.conv2d(*args, **kwargs)
try:
return theano.sandbox.cuda.dnn.dnn_conv(
input.astype('float32'),
W.astype('float32'),
**copy
)
except Exception as e:
print("falling back to default conv2d")
return theano.tensor.nnet.conv2d(*args, **kwargs)
class MLP(LasagnePowered, Serializable):
def __init__(self, output_dim, hidden_sizes, hidden_nonlinearity,
output_nonlinearity, hidden_W_init=LI.GlorotUniform(), hidden_b_init=LI.Constant(0.),
output_W_init=LI.GlorotUniform(), output_b_init=LI.Constant(0.),
name=None, input_var=None, input_layer=None, input_shape=None, batch_norm=False):
Serializable.quick_init(self, locals())
if name is None:
prefix = ""
else:
prefix = name + "_"
if input_layer is None:
l_in = L.InputLayer(shape=(None,) + input_shape, input_var=input_var)
else:
l_in = input_layer
self._layers = [l_in]
l_hid = l_in
for idx, hidden_size in enumerate(hidden_sizes):
l_hid = L.DenseLayer(
l_hid,
num_units=hidden_size,
nonlinearity=hidden_nonlinearity,
name="%shidden_%d" % (prefix, idx),
W=hidden_W_init,
b=hidden_b_init,
)
if batch_norm:
l_hid = L.batch_norm(l_hid)
self._layers.append(l_hid)
l_out = L.DenseLayer(
l_hid,
num_units=output_dim,
nonlinearity=output_nonlinearity,
name="%soutput" % (prefix,),
W=output_W_init,
b=output_b_init,
)
self._layers.append(l_out)
self._l_in = l_in
self._l_out = l_out
# self._input_var = l_in.input_var
self._output = L.get_output(l_out)
LasagnePowered.__init__(self, [l_out])
@property
def input_layer(self):
return self._l_in
@property
def output_layer(self):
return self._l_out
# @property
# def input_var(self):
# return self._l_in.input_var
@property
def layers(self):
return self._layers
@property
def output(self):
return self._output
class GRULayer(L.Layer):
"""
A gated recurrent unit implements the following update mechanism:
Reset gate: r(t) = f_r(x(t) @ W_xr + h(t-1) @ W_hr + b_r)
Update gate: u(t) = f_u(x(t) @ W_xu + h(t-1) @ W_hu + b_u)
Cell gate: c(t) = f_c(x(t) @ W_xc + r(t) * (h(t-1) @ W_hc) + b_c)
New hidden state: h(t) = (1 - u(t)) * h(t-1) + u_t * c(t)
Note that the reset, update, and cell vectors must have the same dimension as the hidden state
"""
def __init__(self, incoming, num_units, hidden_nonlinearity,
gate_nonlinearity=LN.sigmoid, name=None,
W_init=LI.GlorotUniform(), b_init=LI.Constant(0.),
hidden_init=LI.Constant(0.), hidden_init_trainable=True):
if hidden_nonlinearity is None:
hidden_nonlinearity = LN.identity
if gate_nonlinearity is None:
gate_nonlinearity = LN.identity
super(GRULayer, self).__init__(incoming, name=name)
input_shape = self.input_shape[2:]
input_dim = ext.flatten_shape_dim(input_shape)
# self._name = name
# Weights for the initial hidden state
self.h0 = self.add_param(hidden_init, (num_units,), name="h0", trainable=hidden_init_trainable,
regularizable=False)
# Weights for the reset gate
self.W_xr = self.add_param(W_init, (input_dim, num_units), name="W_xr")
self.W_hr = self.add_param(W_init, (num_units, num_units), name="W_hr")
self.b_r = self.add_param(b_init, (num_units,), name="b_r", regularizable=False)
# Weights for the update gate
self.W_xu = self.add_param(W_init, (input_dim, num_units), name="W_xu")
self.W_hu = self.add_param(W_init, (num_units, num_units), name="W_hu")
self.b_u = self.add_param(b_init, (num_units,), name="b_u", regularizable=False)
# Weights for the cell gate
self.W_xc = self.add_param(W_init, (input_dim, num_units), name="W_xc")
self.W_hc = self.add_param(W_init, (num_units, num_units), name="W_hc")
self.b_c = self.add_param(b_init, (num_units,), name="b_c", regularizable=False)
self.gate_nonlinearity = gate_nonlinearity
self.num_units = num_units
self.nonlinearity = hidden_nonlinearity
def step(self, x, hprev):
r = self.gate_nonlinearity(x.dot(self.W_xr) + hprev.dot(self.W_hr) + self.b_r)
u = self.gate_nonlinearity(x.dot(self.W_xu) + hprev.dot(self.W_hu) + self.b_u)
c = self.nonlinearity(x.dot(self.W_xc) + r * (hprev.dot(self.W_hc)) + self.b_c)
h = (1 - u) * hprev + u * c
return h.astype(theano.config.floatX)
def get_step_layer(self, l_in, l_prev_hidden):
return GRUStepLayer(incomings=[l_in, l_prev_hidden], gru_layer=self)
def get_output_shape_for(self, input_shape):
n_batch, n_steps = input_shape[:2]
return n_batch, n_steps, self.num_units
def get_output_for(self, input, **kwargs):
n_batches = input.shape[0]
n_steps = input.shape[1]
input = TT.reshape(input, (n_batches, n_steps, -1))
h0s = TT.tile(TT.reshape(self.h0, (1, self.num_units)), (n_batches, 1))
# flatten extra dimensions
shuffled_input = input.dimshuffle(1, 0, 2)
hs, _ = theano.scan(fn=self.step, sequences=[shuffled_input], outputs_info=h0s)
shuffled_hs = hs.dimshuffle(1, 0, 2)
return shuffled_hs
class GRUStepLayer(L.MergeLayer):
def __init__(self, incomings, gru_layer, name=None):
super(GRUStepLayer, self).__init__(incomings, name)
self._gru_layer = gru_layer
def get_params(self, **tags):
return self._gru_layer.get_params(**tags)
def get_output_shape_for(self, input_shapes):
n_batch = input_shapes[0]
return n_batch, self._gru_layer.num_units
def get_output_for(self, inputs, **kwargs):
x, hprev = inputs
n_batch = x.shape[0]
x = x.reshape((n_batch, -1))
return self._gru_layer.step(x, hprev)
class GRUNetwork(object):
def __init__(self, input_shape, output_dim, hidden_dim, hidden_nonlinearity=LN.rectify,
output_nonlinearity=None, name=None, input_var=None, input_layer=None):
if input_layer is None:
l_in = L.InputLayer(shape=(None, None) + input_shape, input_var=input_var, name="input")
else:
l_in = input_layer
l_step_input = L.InputLayer(shape=(None,) + input_shape)
l_step_prev_hidden = L.InputLayer(shape=(None, hidden_dim))
l_gru = GRULayer(l_in, num_units=hidden_dim, hidden_nonlinearity=hidden_nonlinearity,
hidden_init_trainable=False)
l_gru_flat = L.ReshapeLayer(
l_gru, shape=(-1, hidden_dim)
)
l_output_flat = L.DenseLayer(
l_gru_flat,
num_units=output_dim,
nonlinearity=output_nonlinearity,
)
l_output = OpLayer(
l_output_flat,
op=lambda flat_output, l_input:
flat_output.reshape((l_input.shape[0], l_input.shape[1], -1)),
shape_op=lambda flat_output_shape, l_input_shape:
(l_input_shape[0], l_input_shape[1], flat_output_shape[-1]),
extras=[l_in]
)
l_step_hidden = l_gru.get_step_layer(l_step_input, l_step_prev_hidden)
l_step_output = L.DenseLayer(
l_step_hidden,
num_units=output_dim,
nonlinearity=output_nonlinearity,
W=l_output_flat.W,
b=l_output_flat.b,
)
self._l_in = l_in
self._hid_init_param = l_gru.h0
self._l_gru = l_gru
self._l_out = l_output
self._l_step_input = l_step_input
self._l_step_prev_hidden = l_step_prev_hidden
self._l_step_hidden = l_step_hidden
self._l_step_output = l_step_output
@property
def input_layer(self):
return self._l_in
@property
def input_var(self):
return self._l_in.input_var
@property
def output_layer(self):
return self._l_out
@property
def step_input_layer(self):
return self._l_step_input
@property
def step_prev_hidden_layer(self):
return self._l_step_prev_hidden
@property
def step_hidden_layer(self):
return self._l_step_hidden
@property
def step_output_layer(self):
return self._l_step_output
@property
def hid_init_param(self):
return self._hid_init_param
class ConvNetwork(object):
def __init__(self, input_shape, output_dim, hidden_sizes,
conv_filters, conv_filter_sizes, conv_strides, conv_pads,
hidden_W_init=LI.GlorotUniform(), hidden_b_init=LI.Constant(0.),
output_W_init=LI.GlorotUniform(), output_b_init=LI.Constant(0.),
# conv_W_init=LI.GlorotUniform(), conv_b_init=LI.Constant(0.),
hidden_nonlinearity=LN.rectify,
output_nonlinearity=LN.softmax,
name=None, input_var=None):
if name is None:
prefix = ""
else:
prefix = name + "_"
if len(input_shape) == 3:
l_in = L.InputLayer(shape=(None, np.prod(input_shape)), input_var=input_var)
l_hid = L.reshape(l_in, ([0],) + input_shape)
elif len(input_shape) == 2:
l_in = L.InputLayer(shape=(None, np.prod(input_shape)), input_var=input_var)
input_shape = (1,) + input_shape
l_hid = L.reshape(l_in, ([0],) + input_shape)
else:
l_in = L.InputLayer(shape=(None,) + input_shape, input_var=input_var)
l_hid = l_in
for idx, conv_filter, filter_size, stride, pad in zip(
range(len(conv_filters)),
conv_filters,
conv_filter_sizes,
conv_strides,
conv_pads,
):
l_hid = L.Conv2DLayer(
l_hid,
num_filters=conv_filter,
filter_size=filter_size,
stride=(stride, stride),
pad=pad,
nonlinearity=hidden_nonlinearity,
name="%sconv_hidden_%d" % (prefix, idx),
convolution=wrapped_conv,
)
for idx, hidden_size in enumerate(hidden_sizes):
l_hid = L.DenseLayer(
l_hid,
num_units=hidden_size,
nonlinearity=hidden_nonlinearity,
name="%shidden_%d" % (prefix, idx),
W=hidden_W_init,
b=hidden_b_init,
)
l_out = L.DenseLayer(
l_hid,
num_units=output_dim,
nonlinearity=output_nonlinearity,
name="%soutput" % (prefix,),
W=output_W_init,
b=output_b_init,
)
self._l_in = l_in
self._l_out = l_out
self._input_var = l_in.input_var
@property
def input_layer(self):
return self._l_in
@property
def output_layer(self):
return self._l_out
@property
def input_var(self):
return self._l_in.input_var
| {
"content_hash": "679d0ea114d6ff06124fe2e37b70bf05",
"timestamp": "",
"source": "github",
"line_count": 344,
"max_line_length": 103,
"avg_line_length": 35.35174418604651,
"alnum_prop": 0.5599046131074747,
"repo_name": "brain-research/mirage-rl-qprop",
"id": "95033583c43644985549a45e0341d59b156579d9",
"size": "12163",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "rllab/core/network.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "8270"
},
{
"name": "Dockerfile",
"bytes": "2310"
},
{
"name": "HTML",
"bytes": "14896"
},
{
"name": "JavaScript",
"bytes": "28156"
},
{
"name": "Jupyter Notebook",
"bytes": "151886"
},
{
"name": "Mako",
"bytes": "3714"
},
{
"name": "Python",
"bytes": "1831569"
},
{
"name": "Ruby",
"bytes": "12147"
},
{
"name": "Shell",
"bytes": "13760"
}
],
"symlink_target": ""
} |
from __future__ import absolute_import, division, print_function, unicode_literals
from mock import Mock
from nose.tools import eq_, raises
from cg.utils import Disposable, gather
class TestDisposable(object):
def setup(self):
class TestClass(Disposable):
counter = 0
def perform_dispose(self):
self.counter += 1
self.TestClass = TestClass
@raises(TypeError)
def test_disposable_is_actually_abstract(self):
disposable = Disposable()
def test_dispose_is_idempotent(self):
disposable = self.TestClass()
counters = [disposable.counter]
dispose_count = 3
for i in range(dispose_count):
disposable.dispose()
counters.append(disposable.counter)
eq_(counters, [0] + [1] * dispose_count)
def test_dispose_is_called_from_finalizer(self):
disposable = self.TestClass()
disposable.__del__()
eq_(disposable.counter, 1)
class TestGather(object):
def test_gather_works_correctly(self):
for data_set in (
(),
(1,),
(3, 4, 5),
):
yield self.check_data_set, data_set
def check_data_set(self, data_set):
bridge = Mock()
owner = 'xxx'
def get_first(my_owner):
eq_(my_owner, owner)
return data_set[0] if data_set else None
def get_next(element):
index = data_set.index(element) + 1
if index < len(data_set):
return data_set[index]
else:
return None
result = gather(owner, get_first, get_next)
eq_(result, data_set)
| {
"content_hash": "6644352ffd08c418f16ae93db205d85e",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 82,
"avg_line_length": 22.015625,
"alnum_prop": 0.6841731724627396,
"repo_name": "jstasiak/python-cg",
"id": "62bc8006c17471a82323ce71b5d1e29debac6174",
"size": "1433",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/utils_tests.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "74"
},
{
"name": "Python",
"bytes": "85659"
}
],
"symlink_target": ""
} |
"use strict";
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
_Object$defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var radioRole = {
abstract: false,
accessibleNameRequired: true,
baseConcepts: [],
childrenPresentational: true,
nameFrom: ['author', 'contents'],
prohibitedProps: [],
props: {
'aria-checked': null,
'aria-posinset': null,
'aria-setsize': null
},
relatedConcepts: [{
concept: {
attributes: [{
name: 'type',
value: 'radio'
}],
name: 'input'
},
module: 'HTML'
}],
requireContextRole: [],
requiredContextRole: [],
requiredOwnedElements: [],
requiredProps: {
'aria-checked': null
},
superClass: [['roletype', 'widget', 'input']]
};
var _default = radioRole;
exports.default = _default; | {
"content_hash": "756cff9628b7ab89e986bbf11cf8b621",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 101,
"avg_line_length": 21.585365853658537,
"alnum_prop": 0.6259887005649718,
"repo_name": "ChromeDevTools/devtools-frontend",
"id": "7c7d9ae0839adb94fc1738d757830609ac1ac2d3",
"size": "885",
"binary": false,
"copies": "8",
"ref": "refs/heads/main",
"path": "node_modules/aria-query/lib/etc/roles/literal/radioRole.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "615241"
},
{
"name": "Dart",
"bytes": "205"
},
{
"name": "HTML",
"bytes": "317251"
},
{
"name": "JavaScript",
"bytes": "1401177"
},
{
"name": "LLVM",
"bytes": "1918"
},
{
"name": "Makefile",
"bytes": "687"
},
{
"name": "Python",
"bytes": "133111"
},
{
"name": "Shell",
"bytes": "1122"
},
{
"name": "TypeScript",
"bytes": "15230731"
},
{
"name": "WebAssembly",
"bytes": "921"
}
],
"symlink_target": ""
} |
$foundCert = Test-Certificate -Cert Cert:\CurrentUser\my\8ef9a86dfd4bd0b4db313d55c4be8b837efa7b77 -User
if(!$foundCert)
{
Write-Host "Certificate doesn't exist. Exit."
exit
}
Write-Host "Certificate found. Sign the assemblies."
$signtool = "C:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool\signtool.exe"
Write-Host "Verify digital signature."
$files = Get-ChildItem .\* -Include ('*.msi') -File
$files | ForEach-Object {
& $signtool sign /tr http://timestamp.digicert.com /td sha256 /fd sha256 /d "Jexus Manager" /a $_.FullName 2>&1 | Write-Debug
& $signtool verify /pa /q $_.FullName 2>&1 | Write-Debug
if ($LASTEXITCODE -ne 0)
{
Write-Host "$_.FullName is not signed. Exit."
exit $LASTEXITCODE
}
}
Write-Host "Verification finished."
| {
"content_hash": "7302e570e32b2d606e68c5f90d8688fb",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 129,
"avg_line_length": 34.391304347826086,
"alnum_prop": 0.6890012642225032,
"repo_name": "jexuswebserver/JexusManager",
"id": "266b1508cd54062fe3e21811030ff0947584c35e",
"size": "791",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sign.installers.ps1",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "1193"
},
{
"name": "C#",
"bytes": "3017979"
},
{
"name": "HTML",
"bytes": "161"
},
{
"name": "PowerShell",
"bytes": "4614"
}
],
"symlink_target": ""
} |
package jaakko.jaaska.apptycoon.engine.project;
/**
* Representation of a project slot.
*
* Created by jaakko on 7.5.2017.
*/
public class ProjectSlot {
/** Project that is currently occupying the slot. This is null when the slot is empty. */
private Project mProject;
/** The fraction of work that is provisioned for this project slot. A value between 0 and 1. */
private double mWorkFraction;
public ProjectSlot(Project project, double workFraction) {
mProject = project;
mWorkFraction = workFraction;
}
public boolean isFree() {
return mProject == null;
}
public double getWorkFraction() {
return mWorkFraction;
}
public void setWorkFraction(double workFraction) {
mWorkFraction = workFraction;
}
public Project getProject() {
return mProject;
}
public void setProject(Project project) {
mProject = project;
}
}
| {
"content_hash": "2b503fc6589e62aa3e330e9c506cbf4f",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 99,
"avg_line_length": 22.61904761904762,
"alnum_prop": 0.6568421052631579,
"repo_name": "zak0/AppTycoon",
"id": "68b47e5846ed81077fed506a5e247180363196a1",
"size": "950",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/java/jaakko/jaaska/apptycoon/engine/project/ProjectSlot.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "940"
},
{
"name": "HTML",
"bytes": "1564"
},
{
"name": "Java",
"bytes": "258799"
},
{
"name": "JavaScript",
"bytes": "17362"
}
],
"symlink_target": ""
} |
#ifndef vnsw_agent_hpp
#define vnsw_agent_hpp
#include <vector>
#include <stdint.h>
#include <string>
#include <net/ethernet.h>
#include <boost/intrusive_ptr.hpp>
#include <base/intrusive_ptr_back_ref.h>
#include <cmn/agent_cmn.h>
#include <base/connection_info.h>
#include "net/mac_address.h"
#include "oper/agent_types.h"
class Agent;
class AgentParam;
class AgentConfig;
class AgentStats;
class KSync;
class AgentUveBase;
class PktModule;
class VirtualGateway;
class ServicesModule;
class MulticastHandler;
class AgentDBEntry;
class XmppClient;
class OperDB;
class AgentRoute;
class TaskScheduler;
class AgentInit;
class AgentStatsCollector;
class FlowStatsCollector;
class SessionStatsCollector;
class FlowStatsManager;
class MetaDataIpAllocator;
class ResourceManager;
class SecurityLoggingObjectTable;
class PortConfig;
namespace OVSDB {
class OvsdbClient;
};
class ConfigManager;
class EventNotifier;
class Interface;
typedef boost::intrusive_ptr<Interface> InterfaceRef;
typedef boost::intrusive_ptr<const Interface> InterfaceConstRef;
void intrusive_ptr_release(const Interface* p);
void intrusive_ptr_add_ref(const Interface* p);
typedef IntrusivePtrRef<Interface> InterfaceBackRef;
void intrusive_ptr_add_back_ref(const IntrusiveReferrer ref, const Interface* p);
void intrusive_ptr_del_back_ref(const IntrusiveReferrer ref, const Interface* p);
class VmEntry;
typedef boost::intrusive_ptr<VmEntry> VmEntryRef;
typedef boost::intrusive_ptr<const VmEntry> VmEntryConstRef;
void intrusive_ptr_release(const VmEntry* p);
void intrusive_ptr_add_ref(const VmEntry* p);
typedef IntrusivePtrRef<VmEntry> VmEntryBackRef;
typedef IntrusivePtrRef<const VmEntry> VmEntryConstBackRef;
void intrusive_ptr_add_back_ref(const IntrusiveReferrer ref, const VmEntry* p);
void intrusive_ptr_del_back_ref(const IntrusiveReferrer ref, const VmEntry* p);
class VnEntry;
typedef boost::intrusive_ptr<VnEntry> VnEntryRef;
typedef boost::intrusive_ptr<const VnEntry> VnEntryConstRef;
void intrusive_ptr_release(const VnEntry* p);
void intrusive_ptr_add_ref(const VnEntry* p);
class SgEntry;
typedef boost::intrusive_ptr<SgEntry> SgEntryRef;
typedef boost::intrusive_ptr<const SgEntry> SgEntryConstRef;
void intrusive_ptr_release(const SgEntry* p);
void intrusive_ptr_add_ref(const SgEntry* p);
class TagEntry;
typedef boost::intrusive_ptr<TagEntry> TagEntryRef;
typedef boost::intrusive_ptr<const TagEntry> TagEntryConstRef;
void intrusive_ptr_release(const TagEntry* p);
void intrusive_ptr_add_ref(const TagEntry* p);
class VrfEntry;
typedef IntrusivePtrRef<VrfEntry> VrfEntryRef;
typedef IntrusivePtrRef<const VrfEntry> VrfEntryConstRef;
void intrusive_ptr_add_back_ref(const IntrusiveReferrer ref, const VrfEntry* p);
void intrusive_ptr_del_back_ref(const IntrusiveReferrer ref, const VrfEntry* p);
void intrusive_ptr_release(const VrfEntry* p);
void intrusive_ptr_add_ref(const VrfEntry* p);
class MplsLabel;
typedef boost::intrusive_ptr<MplsLabel> MplsLabelRef;
void intrusive_ptr_release(const MplsLabel* p);
void intrusive_ptr_add_ref(const MplsLabel* p);
class MirrorEntry;
typedef boost::intrusive_ptr<MirrorEntry> MirrorEntryRef;
void intrusive_ptr_release(const MirrorEntry* p);
void intrusive_ptr_add_ref(const MirrorEntry* p);
class VxLanId;
typedef boost::intrusive_ptr<VxLanId> VxLanIdRef;
void intrusive_ptr_release(const VxLanId* p);
void intrusive_ptr_add_ref(const VxLanId* p);
class InetUnicastRouteEntry;
class Inet4MulticastRouteEntry;
class EvpnRouteEntry;
class BridgeRouteEntry;
class Route;
typedef boost::intrusive_ptr<Route> RouteRef;
void intrusive_ptr_release(const Route* p);
void intrusive_ptr_add_ref(const Route* p);
class NextHop;
typedef boost::intrusive_ptr<NextHop> NextHopRef;
typedef boost::intrusive_ptr<const NextHop> NextHopConstRef;
void intrusive_ptr_release(const NextHop* p);
void intrusive_ptr_add_ref(const NextHop* p);
class CryptTunnelEntry;
typedef boost::intrusive_ptr<CryptTunnelEntry> CryptTunnelEntryRef;
typedef boost::intrusive_ptr<const CryptTunnelEntry> CryptTunnelEntryConstRef;
void intrusive_ptr_release(const CryptTunnelEntry* p);
void intrusive_ptr_add_ref(const CryptTunnelEntry* p);
class AddrBase;
typedef boost::intrusive_ptr<AddrBase> AddrRef;
void intrusive_ptr_release(const AddrBase* p);
void intrusive_ptr_add_ref(const AddrBase* p);
class AclDBEntry;
typedef boost::intrusive_ptr<AclDBEntry> AclDBEntryRef;
typedef boost::intrusive_ptr<const AclDBEntry> AclDBEntryConstRef;
void intrusive_ptr_release(const AclDBEntry* p);
void intrusive_ptr_add_ref(const AclDBEntry* p);
class PolicySet;
typedef boost::intrusive_ptr<PolicySet> PolicySetRef;
typedef boost::intrusive_ptr<const AclDBEntry> PolicySetConstRef;
void intrusive_ptr_release(const PolicySet* p);
void intrusive_ptr_add_ref(const PolicySet* p);
class PhysicalDevice;
typedef boost::intrusive_ptr<PhysicalDevice> PhysicalDeviceRef;
typedef boost::intrusive_ptr<const PhysicalDevice> PhysicalDeviceConstRef;
void intrusive_ptr_release(const PhysicalDevice *p);
void intrusive_ptr_add_ref(const PhysicalDevice *p);
class PhysicalDeviceVn;
typedef boost::intrusive_ptr<PhysicalDeviceVn> PhysicalDeviceVnRef;
typedef boost::intrusive_ptr<const PhysicalDeviceVn> PhysicalDeviceVnConstRef;
void intrusive_ptr_release(const PhysicalDeviceVn *p);
void intrusive_ptr_add_ref(const PhysicalDeviceVn *p);
class HealthCheckService;
typedef boost::intrusive_ptr<HealthCheckService> HealthCheckServiceRef;
void intrusive_ptr_release(const HealthCheckService* p);
void intrusive_ptr_add_ref(const HealthCheckService* p);
class ForwardingClass;
typedef boost::intrusive_ptr<ForwardingClass> ForwardingClassRef;
typedef boost::intrusive_ptr<const ForwardingClass> ForwardingClassConstRef;
void intrusive_ptr_release(const ForwardingClass *p);
void intrusive_ptr_add_ref(const ForwardingClass *p);
class AgentQosConfig;
typedef boost::intrusive_ptr<AgentQosConfig> AgentQosConfigRef;
typedef boost::intrusive_ptr<const AgentQosConfig> AgentQosConfigConstRef;
void intrusive_ptr_release(const AgentQosConfig *p);
void intrusive_ptr_add_ref(const AgentQosConfig *p);
class QosQueue;
typedef boost::intrusive_ptr<QosQueue> QosQueueRef;
typedef boost::intrusive_ptr<const QosQueue> QosQueueConstRef;
void intrusive_ptr_release(const QosQueueRef *p);
void intrusive_ptr_add_ref(const QosQueueRef *p);
class BridgeDomainEntry;
typedef boost::intrusive_ptr<BridgeDomainEntry> BridgeDomainRef;
typedef boost::intrusive_ptr<const BridgeDomainEntry> BridgeDomainConstRef;
void intrusive_ptr_release(const BridgeDomainEntry *p);
void intrusive_ptr_add_ref(const BridgeDomainEntry *p);
class SecurityLoggingObject;
typedef boost::intrusive_ptr<SecurityLoggingObject> SecurityLoggingObjectRef;
typedef boost::intrusive_ptr<const SecurityLoggingObject> SecurityLoggingObjectConstRef;
void intrusive_ptr_release(const SecurityLoggingObject *p);
void intrusive_ptr_add_ref(const SecurityLoggingObject *p);
//class SecurityGroup;
typedef std::vector<int> SecurityGroupList;
typedef std::vector<int> TagList;
typedef std::vector<boost::uuids::uuid> UuidList;
typedef std::vector<std::string> CommunityList;
typedef std::set<std::string> VnListType;
class AgentDBTable;
class InterfaceTable;
class HealthCheckTable;
class NextHopTable;
class CryptTunnelTable;
class VmTable;
class VnTable;
class SgTable;
class TagTable;
class VrfTable;
class MplsTable;
class RouteTable;
class AgentRouteTable;
class InetUnicastAgentRouteTable;
class Inet4MulticastAgentRouteTable;
class EvpnAgentRouteTable;
class BridgeAgentRouteTable;
class AclTable;
class PolicySetTable;
class MirrorTable;
class VrfAssignTable;
class DomainConfig;
class VxLanTable;
class MulticastGroupObject;
class PhysicalDeviceTable;
class PhysicalDeviceVnTable;
class ForwardingClassTable;
class AgentQosConfigTable;
class QosQueueTable;
class MirrorCfgTable;
class IntfMirrorCfgTable;
class BridgeDomainTable;
class XmppInit;
class AgentXmppChannel;
class AgentIfMapXmppChannel;
class AgentDnsXmppChannel;
class EventManager;
class TaskTbbKeepAwake;
class IFMapAgentStaleCleaner;
class ArpProto;
class DhcpProto;
class Dhcpv6Proto;
class DnsProto;
class BfdProto;
class IcmpProto;
class Icmpv6Proto;
class FlowProto;
class IgmpProto;
class Peer;
class LifetimeManager;
class DiagTable;
class VNController;
class AgentSignal;
class ServiceInstanceTable;
class Agent;
class RESTServer;
class PortIpcHandler;
class MacLearningProto;
class MacLearningModule;
extern void RouterIdDepInit(Agent *agent);
#define MULTICAST_LABEL_RANGE_START 1024
#define MULTICAST_LABEL_BLOCK_SIZE 2048
#define MIN_UNICAST_LABEL_RANGE 4098
#define MAX_XMPP_SERVERS 2
#define XMPP_SERVER_PORT 5269
#define XMPP_DNS_SERVER_PORT 53
#define METADATA_IP_ADDR ntohl(inet_addr("169.254.169.254"))
#define METADATA_PORT 8775
#define METADATA_NAT_PORT 80
#define AGENT_INIT_TASKNAME "Agent::Init"
#define INSTANCE_MANAGER_TASK_NAME "Agent::InstanceManager"
#define AGENT_SHUTDOWN_TASKNAME "Agent::Shutdown"
#define AGENT_FLOW_STATS_MANAGER_TASK "Agent::FlowStatsManager"
#define AGENT_SANDESH_TASKNAME "Agent::Sandesh"
#define IPV4_MULTICAST_BASE_ADDRESS "224.0.0.0"
#define IPV6_MULTICAST_BASE_ADDRESS "ff00::"
#define MULTICAST_BASE_ADDRESS_PLEN 8
#define VROUTER_SERVER_PORT 20914
#define kLogFilesCount 10
#define kLogFileSize (2*1024*1024)
/****************************************************************************
* Definitions related to config/resource backup/restore
****************************************************************************/
#define CFG_BACKUP_DIR "/var/lib/contrail/backup"
#define CFG_BACKUP_COUNT 2
#define CFG_BACKUP_IDLE_TIMEOUT (10*1000)
#define CFG_RESTORE_AUDIT_TIMEOUT (15*1000)
/****************************************************************************
* Task names
****************************************************************************/
#define kTaskFlowEvent "Agent::FlowEvent"
#define kTaskFlowKSync "Agent::FlowKSync"
#define kTaskFlowUpdate "Agent::FlowUpdate"
#define kTaskFlowDelete "Agent::FlowDelete"
#define kTaskFlowMgmt "Agent::FlowMgmt"
#define kTaskFlowAudit "KSync::FlowAudit"
#define kTaskFlowLogging "Agent::FlowLogging"
#define kTaskFlowStatsCollector "Flow::StatsCollector"
#define kTaskSessionStatsCollector "Flow::SessionStatsCollector"
#define kTaskFlowStatsUpdate "Agent::FlowStatsUpdate"
#define kTaskHealthCheck "Agent::HealthCheck"
#define kTaskCryptTunnel "Agent::CryptTunnel"
#define kTaskDBExclude "Agent::DBExcludeTask"
#define kTaskConfigManager "Agent::ConfigManager"
#define kTaskHttpRequstHandler "http::RequestHandlerTask"
#define kAgentResourceRestoreTask "Agent::ResoureRestore"
#define kAgentResourceBackUpTask "Agent::ResourceBackup"
#define kTaskMacLearning "Agent::MacLearning"
#define kTaskMacLearningMgmt "Agent::MacLearningMgmt"
#define kTaskMacAging "Agent::MacAging"
#define kInterfaceDbTablePrefix "db.interface"
#define kVnDbTablePrefix "db.vn"
#define kVmDbTablePrefix "db.vm"
#define kVrfDbTablePrefix "db.vrf.0"
#define kMplsDbTablePrefix "db.mpls"
#define kAclDbTablePrefix "db.acl"
#define kV4UnicastRouteDbTableSuffix "uc.route.0"
#define kV6UnicastRouteDbTableSuffix "uc.route6.0"
#define kL2RouteDbTableSuffix "l2.route.0"
#define kMcastRouteDbTableSuffix "mc.route.0"
#define kEvpnRouteDbTableSuffix "evpn.route.0"
#define kEventNotifierTask "Agent::EventNotifier"
class Agent {
public:
static const uint32_t kDefaultMaxLinkLocalOpenFds = 2048;
// max open files in the agent, excluding the linklocal bind ports
static const uint32_t kMaxOtherOpenFds = 512;
// max BGP-as-a-server sessions, for which local ports are reserved
static const uint32_t kMaxBgpAsAServerSessions = 512;
// default timeout zero means, this timeout is not used
static const uint32_t kDefaultFlowCacheTimeout = 0;
// default number of flow index-manager events logged per flow
static const uint32_t kDefaultFlowIndexSmLogCount = 0;
// default number of threads for flow setup
static const uint32_t kDefaultFlowThreadCount = 1;
// Log a message if latency in processing flow queue exceeds limit
static const uint32_t kDefaultFlowLatencyLimit = 0;
// Max number of threads
static const uint32_t kMaxTbbThreads = 8;
static const uint32_t kDefaultTbbKeepawakeTimeout = (20); //time-millisecs
static const uint32_t kDefaultTaskMonitorTimeout = (20000); //time-millisecs
// Default number of tx-buffers on pkt0 interface
static const uint32_t kPkt0TxBufferCount = 1000;
// Default value for cleanup of stale interface entries
static const uint32_t kDefaultStaleInterfaceCleanupTimeout = 60;
static const uint16_t kDefaultVmiVmVnUveInterval;
static const uint32_t kFlowAddTokens = 50;
static const uint32_t kFlowKSyncTokens = 25;
static const uint32_t kFlowDelTokens = 16;
static const uint32_t kFlowUpdateTokens = 16;
static const uint32_t kMacLearningDefaultTokens = 256;
static const uint8_t kMinAapPrefixLen = 24;
static const uint8_t kInvalidQueueId = 255;
static const int kInvalidCpuId = -1;
static const uint8_t kMaxSessionEndpoints = 5;
static const uint8_t kMaxSessionAggs = 8;
static const uint8_t kMaxSessions = 100;
static const uint16_t kFabricSnatTableSize = 4096;
// kDropNewFlowsRecoveryThreshold is set to 90% of the Max flows for a
// VM this value represents that recovery from the drop new flows will
// happen only when total number of flow fall below this value
static const int kDropNewFlowsRecoveryThreshold = 90;
enum ForwardingMode {
NONE,
L2_L3,
L2,
L3
};
enum VxLanNetworkIdentifierMode {
AUTOMATIC,
CONFIGURED
};
enum RouteTableType {
INVALID = 0,
INET4_UNICAST,
INET4_MULTICAST,
EVPN,
BRIDGE,
INET6_UNICAST,
INET4_MPLS,
ROUTE_TABLE_MAX
};
static const uint8_t ROUTE_TABLE_START = (Agent::INVALID + 1);
typedef void (*FlowStatsReqHandler)(Agent *agent,
uint32_t proto, uint32_t port,
uint64_t timeout);
typedef void (*PortConfigHandler)(Agent *agent,
uint8_t proto, const PortConfig *);
Agent();
virtual ~Agent();
static Agent *GetInstance() {return singleton_;}
static const std::string &NullString() {return null_string_;}
static const std::set<std::string> &NullStringList() {return null_string_list_;}
static const MacAddress &vrrp_mac() {return vrrp_mac_;}
static const MacAddress &pkt_interface_mac() {return pkt_interface_mac_;}
static const std::string &BcastMac() {return bcast_mac_;}
static const MacAddress &left_si_mac() {return left_si_mac_;}
static const MacAddress &right_si_mac() {return right_si_mac_;}
static const std::string &xmpp_dns_server_prefix() {
return xmpp_dns_server_connection_name_prefix_;
}
static const std::string &xmpp_control_node_prefix() {
return xmpp_control_node_connection_name_prefix_;
}
const std::string &program_name() const {return prog_name_;}
const std::string &config_file() const {return config_file_;}
const std::string &log_file() const {return log_file_;}
const std::string &v4_link_local_subnet() const {
return v4_link_local_subnet_;
}
const std::string &v6_link_local_subnet() const {
return v6_link_local_subnet_;
}
const uint16_t v4_link_local_plen() const { return v4_link_local_plen_; }
const uint16_t v6_link_local_plen() const { return v6_link_local_plen_; }
// DB Table accessor methods
IpAddress GetMirrorSourceIp(const IpAddress &dest);
InterfaceTable *interface_table() const {return intf_table_;}
void set_interface_table(InterfaceTable *table) {
intf_table_ = table;
}
MirrorCfgTable *mirror_cfg_table() const {return mirror_cfg_table_;}
void set_mirror_cfg_table(MirrorCfgTable *table) {
mirror_cfg_table_ = table;
}
NextHopTable *nexthop_table() const {return nh_table_;}
void set_nexthop_table(NextHopTable *table) {
nh_table_ = table;
}
CryptTunnelTable *crypt_tunnel_table() const {return crypt_tunnel_table_;}
void set_crypt_tunnel_table(CryptTunnelTable *table) {
crypt_tunnel_table_ = table;
}
VrfTable *vrf_table() const { return vrf_table_;}
void set_vrf_table(VrfTable *table) {
vrf_table_ = table;
}
VmTable *vm_table() const { return vm_table_;}
void set_vm_table(VmTable *table) {
vm_table_ = table;
}
VnTable *vn_table() const { return vn_table_;}
void set_vn_table(VnTable *table) {
vn_table_ = table;
}
SgTable *sg_table() const { return sg_table_;}
void set_sg_table(SgTable *table) {
sg_table_ = table;
}
TagTable *tag_table() const { return tag_table_;}
void set_tag_table(TagTable *table) {
tag_table_ = table;
}
MplsTable *mpls_table() const { return mpls_table_;}
void set_mpls_table(MplsTable *table) {
mpls_table_ = table;
}
AclTable *acl_table() const { return acl_table_;}
void set_acl_table(AclTable *table) {
acl_table_ = table;
}
PolicySetTable* policy_set_table() const { return policy_set_table_;}
void set_policy_set_table(PolicySetTable *table) {
policy_set_table_ = table;
}
MirrorTable *mirror_table() const { return mirror_table_;}
void set_mirror_table(MirrorTable *table) {
mirror_table_ = table;
}
VrfAssignTable *vrf_assign_table() const {return vrf_assign_table_;}
void set_vrf_assign_table(VrfAssignTable *table) {
vrf_assign_table_ = table;
}
VxLanTable *vxlan_table() const { return vxlan_table_;}
void set_vxlan_table(VxLanTable *table) {
vxlan_table_ = table;
}
ForwardingClassTable *forwarding_class_table() const {
return forwarding_class_table_;
}
void set_forwarding_class_table(ForwardingClassTable *table) {
forwarding_class_table_ = table;
}
SecurityLoggingObjectTable *slo_table() const {
return slo_table_;
}
void set_slo_table(SecurityLoggingObjectTable *table) {
slo_table_ = table;
}
AgentQosConfigTable *qos_config_table() const {
return qos_config_table_;
}
void set_qos_config_table(AgentQosConfigTable *qos_config_table) {
qos_config_table_ = qos_config_table;
}
QosQueueTable *qos_queue_table() const {
return qos_queue_table_;
}
void set_qos_queue_table(QosQueueTable *table) {
qos_queue_table_ = table;
}
DomainConfig *domain_config_table() const;
IntfMirrorCfgTable *interface_mirror_cfg_table() const {
return intf_mirror_cfg_table_;
}
void set_interface_mirror_cfg_table(IntfMirrorCfgTable *table) {
intf_mirror_cfg_table_ = table;
}
InetUnicastAgentRouteTable *fabric_inet4_unicast_table() const {
return uc_rt_table_;
}
void set_fabric_inet4_unicast_table(InetUnicastAgentRouteTable *
table) {
uc_rt_table_ = table;
}
void set_fabric_inet4_unicast_table(RouteTable * table) {
uc_rt_table_ = (InetUnicastAgentRouteTable *)table;
}
InetUnicastAgentRouteTable *fabric_inet4_mpls_table() const {
return mpls_rt_table_;
}
void set_fabric_inet4_mpls_table(InetUnicastAgentRouteTable *
table) {
mpls_rt_table_ = table;
}
void set_fabric_inet4_mpls_table(RouteTable * table) {
mpls_rt_table_ = (InetUnicastAgentRouteTable *)table;
}
Inet4MulticastAgentRouteTable *fabric_inet4_multicast_table() const {
return mc_rt_table_;
}
void set_fabric_inet4_multicast_table
(Inet4MulticastAgentRouteTable *table) {
mc_rt_table_ = table;
}
void set_fabric_inet4_multicast_table(RouteTable *table) {
mc_rt_table_ = (Inet4MulticastAgentRouteTable *)table;
}
EvpnAgentRouteTable *fabric_evpn_table() const {
return evpn_rt_table_;
}
void set_fabric_evpn_table(RouteTable *table) {
evpn_rt_table_ = (EvpnAgentRouteTable *)table;
}
BridgeAgentRouteTable *fabric_l2_unicast_table() const {
return l2_rt_table_;
}
void set_fabric_l2_unicast_table(BridgeAgentRouteTable *table) {
l2_rt_table_ = table;
}
void set_fabric_l2_unicast_table(RouteTable *table) {
l2_rt_table_ = (BridgeAgentRouteTable *)table;
}
PhysicalDeviceTable *physical_device_table() const {
return physical_device_table_;
}
void set_physical_device_table(PhysicalDeviceTable *table) {
physical_device_table_ = table;
}
PhysicalDeviceVnTable *physical_device_vn_table() const {
return physical_device_vn_table_;
}
void set_physical_device_vn_table(PhysicalDeviceVnTable *table) {
physical_device_vn_table_ = table;
}
// VHOST related
Ip4Address vhost_prefix() const {return prefix_;}
void set_vhost_prefix(const Ip4Address &addr) {
prefix_ = addr;
}
uint32_t vhost_prefix_len() const {return prefix_len_;}
void set_vhost_prefix_len(uint32_t plen) {prefix_len_ = plen;}
Ip4Address vhost_default_gateway() const {return gateway_id_;}
void set_vhost_default_gateway(const Ip4Address &addr) {
gateway_id_ = addr;
}
Ip4Address router_id() const {return router_id_;}
const Ip4Address *router_ip_ptr() const {return &router_id_;}
void set_router_id(const Ip4Address &addr) {
router_id_ = addr;
set_router_id_configured(true);
}
bool router_id_configured() { return router_id_configured_; }
void set_router_id_configured(bool value) {
router_id_configured_ = value;
}
Ip4Address compute_node_ip() const {return compute_node_ip_;}
void set_compute_node_ip(const Ip4Address &addr) {
compute_node_ip_ = addr;
}
AgentSignal *agent_signal() const { return agent_signal_.get(); }
std::vector<string> &GetControllerlist() {
return (controller_list_);
}
uint32_t GetControllerlistChksum() {
return (controller_chksum_);
}
std::vector<string> &GetDnslist() {
return (dns_list_);
}
uint32_t GetDnslistChksum() {
return (dns_chksum_);
}
std::vector<string> &GetCollectorlist() {
return (collector_list_);
}
uint32_t GetCollectorlistChksum() {
return (collector_chksum_);
}
// Common XMPP Client for control-node and config clients
const std::string &controller_ifmap_xmpp_server(uint8_t idx) const {
return xs_addr_[idx];
}
void set_controller_ifmap_xmpp_server(const std::string &addr, uint8_t idx) {
xs_addr_[idx] = addr;
}
void reset_controller_ifmap_xmpp_server(uint8_t idx) {
xs_addr_[idx].clear();
xs_port_[idx] = 0;
}
const bool xmpp_auth_enabled() const {
return xs_auth_enable_;
}
const std::string &xmpp_server_cert() const {
return xs_server_cert_;
}
const std::string &xmpp_server_key() const {
return xs_server_key_;
}
const std::string &xmpp_ca_cert() const {
return xs_ca_cert_;
}
const std::string &subcluster_name() const {
return subcluster_name_;
}
const uint16_t controller_ifmap_xmpp_port(uint8_t idx) const {
return xs_port_[idx];
}
void set_controller_ifmap_xmpp_port(uint16_t port, uint8_t idx) {
xs_port_[idx] = port;
}
XmppInit *controller_ifmap_xmpp_init(uint8_t idx) const {
return xmpp_init_[idx];
}
void set_controller_ifmap_xmpp_init(XmppInit *init, uint8_t idx) {
xmpp_init_[idx] = init;
}
XmppClient *controller_ifmap_xmpp_client(uint8_t idx) {
return xmpp_client_[idx];
}
void set_controller_ifmap_xmpp_client(XmppClient *client, uint8_t idx) {
xmpp_client_[idx] = client;
}
// Config XMPP server specific
const int8_t &ifmap_active_xmpp_server_index() const { return xs_idx_; }
const std::string &ifmap_active_xmpp_server() const { return xs_cfg_addr_; }
void set_ifmap_active_xmpp_server(const std::string &addr,
uint8_t xs_idx) {
xs_cfg_addr_ = addr;
xs_idx_ = xs_idx;
}
void reset_ifmap_active_xmpp_server() {
xs_cfg_addr_.clear();
xs_idx_ = -1;
}
AgentIfMapXmppChannel *ifmap_xmpp_channel(uint8_t idx) const {
return ifmap_channel_[idx];
}
void set_ifmap_xmpp_channel(AgentIfMapXmppChannel *channel,
uint8_t idx) {
ifmap_channel_[idx] = channel;
}
// Controller XMPP server
const uint64_t controller_xmpp_channel_setup_time(uint8_t idx) const {
return xs_stime_[idx];
}
void set_controller_xmpp_channel_setup_time(uint64_t time, uint8_t idx) {
xs_stime_[idx] = time;
}
boost::shared_ptr<AgentXmppChannel> controller_xmpp_channel_ref(uint8_t idx);
AgentXmppChannel *controller_xmpp_channel(uint8_t idx) const {
return (agent_xmpp_channel_[idx]).get();
}
void set_controller_xmpp_channel(AgentXmppChannel *channel, uint8_t idx);
void reset_controller_xmpp_channel(uint8_t idx);
// Service instance
ServiceInstanceTable *service_instance_table() const {
return service_instance_table_;
}
void set_service_instance_table(ServiceInstanceTable *table) {
service_instance_table_= table;
}
// DNS XMPP Server
const bool dns_auth_enabled() const {
return dns_auth_enable_;
}
XmppInit *dns_xmpp_init(uint8_t idx) const {
return dns_xmpp_init_[idx];
}
void set_dns_xmpp_init(XmppInit *xmpp, uint8_t idx) {
dns_xmpp_init_[idx] = xmpp;
}
XmppClient *dns_xmpp_client(uint8_t idx) const {
return dns_xmpp_client_[idx];
}
void set_dns_xmpp_client(XmppClient *client, uint8_t idx) {
dns_xmpp_client_[idx] = client;
}
AgentDnsXmppChannel *dns_xmpp_channel(uint8_t idx) const {
return dns_xmpp_channel_[idx];
}
void set_dns_xmpp_channel(AgentDnsXmppChannel *chnl, uint8_t idx) {
dns_xmpp_channel_[idx] = chnl;
}
bool is_dns_xmpp_channel(AgentDnsXmppChannel *channel) {
if (channel == dns_xmpp_channel_[0] || channel == dns_xmpp_channel_[1])
return true;;
return false;
}
// DNS Server and port
const std::string &dns_server(uint8_t idx) const {
return dns_addr_[idx];
}
void set_dns_server(const std::string &addr, uint8_t idx) {
dns_addr_[idx] = addr;
}
void reset_dns_server(uint8_t idx) {
dns_addr_[idx].clear();
dns_port_[idx] = 0;
}
const uint16_t dns_server_port(uint8_t idx) const {
return dns_port_[idx];
}
void set_dns_server_port(uint16_t port, uint8_t idx) {
dns_port_[idx] = port;
}
const std::string &host_name() const {
return host_name_;
}
const std::string &agent_name() const {
return agent_name_;
}
void set_agent_name(const std::string &name) {
agent_name_ = name;
}
const std::string &instance_id() const { return instance_id_; }
void set_instance_id(const std::string &id) { instance_id_ = id; }
const int &module_type() const { return module_type_; }
void set_module_type(int id) { module_type_ = id; }
const std::string &module_name() const { return module_name_; }
void set_module_name(const std::string &name) { module_name_ = name; }
AgentXmppChannel* mulitcast_builder() {
return cn_mcast_builder_;
};
void set_cn_mcast_builder(AgentXmppChannel *peer);
// Fabric related
const std::string &fabric_vn_name() const {return fabric_vn_name_; }
const std::string &fabric_vrf_name() const { return fabric_vrf_name_; }
void set_fabric_vrf_name(const std::string &name) {
fabric_vrf_name_ = name;
}
const std::string &fabric_policy_vrf_name() const {
return fabric_policy_vrf_name_;
}
void set_fabric_policy_vrf_name(const std::string &name) {
fabric_policy_vrf_name_ = name;
}
VrfEntry *fabric_vrf() const { return fabric_vrf_; }
void set_fabric_vrf(VrfEntry *vrf) { fabric_vrf_ = vrf; }
VrfEntry *fabric_policy_vrf() const { return fabric_policy_vrf_; }
void set_fabric_policy_vrf(VrfEntry *vrf) { fabric_policy_vrf_ = vrf; }
const std::string &linklocal_vn_name() {return link_local_vn_name_;}
const std::string &linklocal_vrf_name() {return link_local_vrf_name_;}
const std::string &vhost_interface_name() const;
void set_vhost_interface_name(const std::string &name) {
vhost_interface_name_ = name;
}
const std::string &pkt_interface_name() const {
return pkt_interface_name_;
}
void set_pkt_interface_name(const std::string &name) {
pkt_interface_name_ = name;
}
const std::string &GetHostInterfaceName() const;
const Interface *vhost_interface() const {
return vhost_interface_;
}
void set_vhost_interface(const Interface *intrface) {
vhost_interface_ = intrface;
}
process::ConnectionState* connection_state() const {
return connection_state_;
}
void set_connection_state(process::ConnectionState* state) {
connection_state_ = state;
}
uint16_t metadata_server_port() const {return metadata_server_port_;}
void set_metadata_server_port(uint16_t port) {
metadata_server_port_ = port;
}
void set_vrouter_server_ip(Ip4Address ip) {
vrouter_server_ip_ = ip;
}
const Ip4Address vrouter_server_ip() const {
return vrouter_server_ip_;
}
void set_vrouter_server_port(uint32_t port) {
vrouter_server_port_ = port;
}
const uint32_t vrouter_server_port() const {
return vrouter_server_port_;
}
// Protocol objects
ArpProto *GetArpProto() const { return arp_proto_; }
void SetArpProto(ArpProto *proto) { arp_proto_ = proto; }
DhcpProto *GetDhcpProto() const { return dhcp_proto_; }
void SetDhcpProto(DhcpProto *proto) { dhcp_proto_ = proto; }
Dhcpv6Proto *dhcpv6_proto() const { return dhcpv6_proto_; }
void set_dhcpv6_proto(Dhcpv6Proto *proto) { dhcpv6_proto_ = proto; }
DnsProto *GetDnsProto() const { return dns_proto_; }
void SetDnsProto(DnsProto *proto) { dns_proto_ = proto; }
BfdProto *GetBfdProto() const { return bfd_proto_; }
void SetBfdProto(BfdProto *proto) { bfd_proto_ = proto; }
IcmpProto *GetIcmpProto() const { return icmp_proto_; }
void SetIcmpProto(IcmpProto *proto) { icmp_proto_ = proto; }
Icmpv6Proto *icmpv6_proto() const { return icmpv6_proto_; }
void set_icmpv6_proto(Icmpv6Proto *proto) { icmpv6_proto_ = proto; }
FlowProto *GetFlowProto() const { return flow_proto_; }
void SetFlowProto(FlowProto *proto) { flow_proto_ = proto; }
IgmpProto *GetIgmpProto() const { return igmp_proto_; }
void SetIgmpProto(IgmpProto *proto) { igmp_proto_ = proto; }
MacLearningProto* mac_learning_proto() const {
return mac_learning_proto_;
}
void set_mac_learning_proto(MacLearningProto *mac_learning_proto) {
mac_learning_proto_ = mac_learning_proto;
}
MacLearningModule* mac_learning_module() const {
return mac_learning_module_;
}
void set_mac_learning_module(MacLearningModule *mac_learning_module) {
mac_learning_module_ = mac_learning_module;
}
// Peer objects
const Peer *local_peer() const {return local_peer_.get();}
const Peer *local_vm_peer() const {return local_vm_peer_.get();}
const Peer *link_local_peer() const {return linklocal_peer_.get();}
const Peer *ecmp_peer() const {return ecmp_peer_.get();}
const Peer *vgw_peer() const {return vgw_peer_.get();}
const Peer *evpn_routing_peer() const {return evpn_routing_peer_.get();}
const Peer *evpn_peer() const {return evpn_peer_.get();}
const Peer *multicast_peer() const {return multicast_peer_.get();}
const Peer *multicast_tor_peer() const {return multicast_tor_peer_.get();}
const Peer *multicast_tree_builder_peer() const {
return multicast_tree_builder_peer_.get();}
const Peer *mac_vm_binding_peer() const {return mac_vm_binding_peer_.get();}
const Peer *inet_evpn_peer() const {return inet_evpn_peer_.get();}
const Peer *mac_learning_peer() const {return mac_learning_peer_.get();}
const Peer *fabric_rt_export_peer() const {
return fabric_rt_export_peer_.get();
}
const Peer *local_vm_export_peer() const {
return local_vm_export_peer_.get();
}
// Agent Modules
AgentConfig *cfg() const;
void set_cfg(AgentConfig *cfg);
AgentStats *stats() const;
void set_stats(AgentStats *stats);
KSync *ksync() const;
void set_ksync(KSync *ksync);
AgentUveBase *uve() const;
void set_uve(AgentUveBase *uve);
AgentStatsCollector *stats_collector() const;
void set_stats_collector(AgentStatsCollector *asc);
FlowStatsManager *flow_stats_manager() const;
void set_flow_stats_manager(FlowStatsManager *fsc);
HealthCheckTable *health_check_table() const;
void set_health_check_table(HealthCheckTable *table);
BridgeDomainTable *bridge_domain_table() const;
void set_bridge_domain_table(BridgeDomainTable *table);
MetaDataIpAllocator *metadata_ip_allocator() const;
void set_metadata_ip_allocator(MetaDataIpAllocator *allocator);
PktModule *pkt() const;
void set_pkt(PktModule *pkt);
ServicesModule *services() const;
void set_services(ServicesModule *services);
VirtualGateway *vgw() const;
void set_vgw(VirtualGateway *vgw);
RESTServer *rest_server() const;
void set_rest_server(RESTServer *r);
PortIpcHandler *port_ipc_handler() const;
void set_port_ipc_handler(PortIpcHandler *r);
OperDB *oper_db() const;
void set_oper_db(OperDB *oper_db);
VNController *controller() const;
void set_controller(VNController *val);
ResourceManager *resource_manager() const;
void set_resource_manager(ResourceManager *resource_manager);
EventNotifier *event_notifier() const;
void set_event_notifier(EventNotifier *mgr);
// Miscellaneous
EventManager *event_manager() const {return event_mgr_;}
void set_event_manager(EventManager *evm) {
event_mgr_ = evm;
}
DiagTable *diag_table() const;
void set_diag_table(DiagTable *table);
uint16_t mirror_port() const {return mirror_src_udp_port_;}
void set_mirror_port(uint16_t mirr_port) {
mirror_src_udp_port_ = mirr_port;
}
int introspect_port() const { return introspect_port_;}
DB *db() const {return db_;}
TaskScheduler *task_scheduler() const { return task_scheduler_; }
void set_task_scheduler(TaskScheduler *t) { task_scheduler_ = t; }
AgentInit *agent_init() const { return agent_init_; }
void set_agent_init(AgentInit *init) { agent_init_ = init; }
OVSDB::OvsdbClient *ovsdb_client() const { return ovsdb_client_; }
void set_ovsdb_client(OVSDB::OvsdbClient *client) { ovsdb_client_ = client; }
const std::string &fabric_interface_name() const {
return ip_fabric_intf_name_;
}
const std::string &crypt_interface_name() const {
return crypt_intf_name_;
}
const Interface *crypt_interface() const {
return crypt_interface_;
}
void set_crypt_interface(const Interface *interface) {
crypt_interface_ = interface;
}
VxLanNetworkIdentifierMode vxlan_network_identifier_mode() const {
return vxlan_network_identifier_mode_;
}
void set_vxlan_network_identifier_mode(VxLanNetworkIdentifierMode mode) {
vxlan_network_identifier_mode_ = mode;
}
bool simulate_evpn_tor() const {return simulate_evpn_tor_;}
void set_simulate_evpn_tor(bool mode) {simulate_evpn_tor_ = mode;}
bool tsn_no_forwarding_enabled() const {return tsn_no_forwarding_enabled_;}
void set_tsn_no_forwarding_enabled(bool val) {
tsn_no_forwarding_enabled_ = val;
}
bool tsn_enabled() const {return tsn_enabled_;}
void set_tsn_enabled(bool val) {tsn_enabled_ = val;}
bool tor_agent_enabled() const {return tor_agent_enabled_;}
void set_tor_agent_enabled(bool val) {tor_agent_enabled_ = val;}
bool forwarding_enabled() const {return forwarding_enabled_;}
void set_forwarding_enabled(bool val) {forwarding_enabled_ = val;}
bool server_gateway_mode() const {return server_gateway_mode_;}
bool vcpe_gateway_mode() const {return vcpe_gateway_mode_;}
bool pbb_gateway_mode() const { return pbb_gateway_mode_;}
IFMapAgentParser *ifmap_parser() const {return ifmap_parser_;}
void set_ifmap_parser(IFMapAgentParser *parser) {
ifmap_parser_ = parser;
}
IFMapAgentStaleCleaner *ifmap_stale_cleaner() const {
return agent_stale_cleaner_;
}
void set_ifmap_stale_cleaner(IFMapAgentStaleCleaner *cl) {
agent_stale_cleaner_ = cl;
}
std::string GetUuidStr(boost::uuids::uuid uuid_val) const;
bool ksync_sync_mode() const {return ksync_sync_mode_;}
void set_ksync_sync_mode(bool sync_mode) {
ksync_sync_mode_ = sync_mode;
}
bool test_mode() const { return test_mode_; }
void set_test_mode(bool test_mode) { test_mode_ = test_mode; }
bool xmpp_dns_test_mode() const { return xmpp_dns_test_mode_; }
void set_xmpp_dns_test_mode(bool xmpp_dns_test_mode) {
xmpp_dns_test_mode_ = xmpp_dns_test_mode;
}
uint32_t flow_table_size() const { return flow_table_size_; }
void set_flow_table_size(uint32_t count);
uint16_t flow_thread_count() const { return flow_thread_count_; }
bool flow_trace_enable() const { return flow_trace_enable_; }
uint32_t max_vm_flows() const { return max_vm_flows_; }
void set_max_vm_flows(uint32_t count) { max_vm_flows_ = count; }
uint32_t flow_add_tokens() const { return flow_add_tokens_; }
uint32_t flow_ksync_tokens() const { return flow_ksync_tokens_; }
uint32_t flow_del_tokens() const { return flow_del_tokens_; }
uint32_t flow_update_tokens() const { return flow_update_tokens_; }
bool init_done() const { return init_done_; }
void set_init_done(bool done) { init_done_ = done; }
ConfigManager *config_manager() const;
AgentParam *params() const { return params_; }
bool isXenMode();
bool isKvmMode();
bool isDockerMode();
// Agent param accessor functions
bool isVmwareMode() const;
bool isVmwareVcenterMode() const;
bool vrouter_on_nic_mode() const;
bool vrouter_on_host_dpdk() const;
bool vrouter_on_windows() const;
bool vrouter_on_host() const;
void SetAgentTaskPolicy();
void CopyConfig(AgentParam *params);
void CopyFilteredParams();
bool ResourceManagerReady() const { return resource_manager_ready_; }
void SetResourceManagerReady();
void Init(AgentParam *param);
void InitPeers();
void InitDone();
void InitXenLinkLocalIntf();
void InitCollector();
void ReConnectCollectors();
void ReconfigSignalHandler(boost::system::error_code , int);
LifetimeManager *lifetime_manager() { return lifetime_manager_;}
void CreateLifetimeManager();
void ShutdownLifetimeManager();
// Default concurrency checker. Checks for "Agent::KSync" and "db::DBTable"
void ConcurrencyCheck();
uint32_t vrouter_max_labels() const {
return vrouter_max_labels_;
}
void set_vrouter_max_labels(uint32_t max_labels) {
vrouter_max_labels_ = max_labels;
}
uint32_t vrouter_max_nexthops() const {
return vrouter_max_nexthops_;
}
void set_vrouter_max_nexthops(uint32_t max_nexthop) {
vrouter_max_nexthops_ = max_nexthop;
}
uint32_t vrouter_max_interfaces() const {
return vrouter_max_interfaces_;
}
void set_vrouter_max_interfaces(uint32_t max_interfaces) {
vrouter_max_interfaces_ = max_interfaces;
}
uint32_t vrouter_max_vrfs() const {
return vrouter_max_vrfs_;
}
void set_vrouter_max_vrfs(uint32_t max_vrf) {
vrouter_max_vrfs_ = max_vrf;
}
uint32_t vrouter_max_mirror_entries() const {
return vrouter_max_mirror_entries_;
}
void set_vrouter_max_mirror_entries(uint32_t max_mirror_entries) {
vrouter_max_mirror_entries_ = max_mirror_entries;
}
uint32_t vrouter_max_bridge_entries() const {
return vrouter_max_bridge_entries_;
}
void set_vrouter_max_bridge_entries(uint32_t bridge_entries) {
vrouter_max_bridge_entries_ = bridge_entries;
}
uint32_t vrouter_max_oflow_bridge_entries() const {
return vrouter_max_oflow_bridge_entries_;
}
void set_vrouter_max_oflow_bridge_entries(uint32_t
oflow_bridge_entries) {
vrouter_max_oflow_bridge_entries_ = oflow_bridge_entries;
}
uint32_t vrouter_max_flow_entries() const {
return vrouter_max_flow_entries_;
}
void set_vrouter_max_flow_entries(uint32_t value) {
vrouter_max_flow_entries_ = value;
}
uint32_t vrouter_max_oflow_entries() const {
return vrouter_max_oflow_entries_;
}
void set_vrouter_max_oflow_entries(uint32_t value) {
vrouter_max_oflow_entries_ = value;
}
void set_vrouter_build_info(std::string version) {
vrouter_build_info_ = version;
}
std::string vrouter_build_info() const {
return vrouter_build_info_;
}
void set_vrouter_priority_tagging(bool tagging) {
vrouter_priority_tagging_ = tagging;
}
bool vrouter_priority_tagging() const {
return vrouter_priority_tagging_;
}
Agent::ForwardingMode TranslateForwardingMode(const std::string &mode) const;
FlowStatsReqHandler& flow_stats_req_handler() {
return flow_stats_req_handler_;
}
void set_flow_stats_req_handler(FlowStatsReqHandler req) {
flow_stats_req_handler_ = req;
}
PortConfigHandler& port_config_handler() {
return port_config_handler_;
}
void set_port_config_handler(PortConfigHandler handler) {
port_config_handler_ = handler;
}
void SetMeasureQueueDelay(bool val);
bool MeasureQueueDelay();
void TaskTrace(const char *file_name, uint32_t line_no, const Task *task,
const char *description, uint64_t delay);
static uint16_t ProtocolStringToInt(const std::string &str);
VrouterObjectLimits GetVrouterObjectLimits();
void SetXmppDscp(uint8_t val);
void set_global_slo_status(bool flag) {
global_slo_status_ = flag;
}
bool global_slo_status() const {
return global_slo_status_;
}
void set_fabric_vn_uuid(const boost::uuids::uuid &uuid) {
fabric_vn_uuid_ = uuid;
}
const boost::uuids::uuid& fabric_vn_uuid() const {
return fabric_vn_uuid_;
}
uint8_t GetInterfaceTransport() const;
void set_inet_labeled_flag(bool flag) {
inet_labeled_enabled_ = flag;
}
bool get_inet_labeled_flag() {
return inet_labeled_enabled_;}
private:
uint32_t GenerateHash(std::vector<std::string> &);
void InitializeFilteredParams();
void InitControllerList();
void InitDnsList();
AgentParam *params_;
AgentConfig *cfg_;
AgentStats *stats_;
KSync *ksync_;
AgentUveBase *uve_;
AgentStatsCollector *stats_collector_;
FlowStatsManager *flow_stats_manager_;
PktModule *pkt_;
ServicesModule *services_;
VirtualGateway *vgw_;
RESTServer *rest_server_;
PortIpcHandler *port_ipc_handler_;
OperDB *oper_db_;
DiagTable *diag_table_;
VNController *controller_;
ResourceManager *resource_manager_;
EventNotifier *event_notifier_;
EventManager *event_mgr_;
boost::shared_ptr<AgentXmppChannel> agent_xmpp_channel_[MAX_XMPP_SERVERS];
AgentIfMapXmppChannel *ifmap_channel_[MAX_XMPP_SERVERS];
XmppClient *xmpp_client_[MAX_XMPP_SERVERS];
XmppInit *xmpp_init_[MAX_XMPP_SERVERS];
AgentDnsXmppChannel *dns_xmpp_channel_[MAX_XMPP_SERVERS];
XmppClient *dns_xmpp_client_[MAX_XMPP_SERVERS];
XmppInit *dns_xmpp_init_[MAX_XMPP_SERVERS];
IFMapAgentStaleCleaner *agent_stale_cleaner_;
AgentXmppChannel *cn_mcast_builder_;
uint16_t metadata_server_port_;
// Host name of node running the daemon
std::string host_name_;
// Unique name of the agent. When multiple instances are running, it will
// use instance-id to make unique name
std::string agent_name_;
std::string prog_name_;
int introspect_port_;
std::string instance_id_;
int module_type_;
std::string module_name_;
// DB handles
DB *db_;
TaskScheduler *task_scheduler_;
AgentInit *agent_init_;
VrfEntry *fabric_vrf_;
VrfEntry *fabric_policy_vrf_;
InterfaceTable *intf_table_;
HealthCheckTable *health_check_table_;
BridgeDomainTable *bridge_domain_table_;
std::auto_ptr<MetaDataIpAllocator> metadata_ip_allocator_;
NextHopTable *nh_table_;
InetUnicastAgentRouteTable *uc_rt_table_;
InetUnicastAgentRouteTable *mpls_rt_table_;
Inet4MulticastAgentRouteTable *mc_rt_table_;
EvpnAgentRouteTable *evpn_rt_table_;
BridgeAgentRouteTable *l2_rt_table_;
VrfTable *vrf_table_;
VmTable *vm_table_;
VnTable *vn_table_;
SgTable *sg_table_;
TagTable *tag_table_;
MplsTable *mpls_table_;
AclTable *acl_table_;
MirrorTable *mirror_table_;
VrfAssignTable *vrf_assign_table_;
VxLanTable *vxlan_table_;
ServiceInstanceTable *service_instance_table_;
PhysicalDeviceTable *physical_device_table_;
PhysicalDeviceVnTable *physical_device_vn_table_;
ForwardingClassTable *forwarding_class_table_;
SecurityLoggingObjectTable *slo_table_;
QosQueueTable *qos_queue_table_;
AgentQosConfigTable *qos_config_table_;
PolicySetTable *policy_set_table_;
CryptTunnelTable *crypt_tunnel_table_;
std::auto_ptr<ConfigManager> config_manager_;
// Mirror config table
MirrorCfgTable *mirror_cfg_table_;
// Interface Mirror config table
IntfMirrorCfgTable *intf_mirror_cfg_table_;
Ip4Address router_id_;
Ip4Address prefix_;
uint32_t prefix_len_;
Ip4Address gateway_id_;
// IP address on the compute node used by agent to run services such
// as metadata service. This is different than router_id when vhost0
// is un-numbered interface in host-os
// The compute_node_ip_ is used only in adding Flow NAT rules.
Ip4Address compute_node_ip_;
std::string xs_cfg_addr_;
int8_t xs_idx_;
std::string xs_addr_[MAX_XMPP_SERVERS];
uint16_t xs_port_[MAX_XMPP_SERVERS];
uint64_t xs_stime_[MAX_XMPP_SERVERS];
bool xs_auth_enable_;
std::string xs_server_cert_;
std::string xs_server_key_;
std::string xs_ca_cert_;
std::string subcluster_name_;
int8_t xs_dns_idx_;
std::string dns_addr_[MAX_XMPP_SERVERS];
uint16_t dns_port_[MAX_XMPP_SERVERS];
bool dns_auth_enable_;
// Config
std::vector<std::string>controller_list_;
uint32_t controller_chksum_;
std::vector<std::string>dns_list_;
uint32_t dns_chksum_;
std::vector<std::string>collector_list_;
uint32_t collector_chksum_;
std::string ip_fabric_intf_name_;
std::string crypt_intf_name_;
std::string vhost_interface_name_;
std::string pkt_interface_name_;
ArpProto *arp_proto_;
DhcpProto *dhcp_proto_;
DnsProto *dns_proto_;
BfdProto *bfd_proto_;
IcmpProto *icmp_proto_;
Dhcpv6Proto *dhcpv6_proto_;
Icmpv6Proto *icmpv6_proto_;
FlowProto *flow_proto_;
IgmpProto *igmp_proto_;
MacLearningProto *mac_learning_proto_;
MacLearningModule *mac_learning_module_;
std::auto_ptr<Peer> local_peer_;
std::auto_ptr<Peer> local_vm_peer_;
std::auto_ptr<Peer> linklocal_peer_;
std::auto_ptr<Peer> ecmp_peer_;
std::auto_ptr<Peer> vgw_peer_;
std::auto_ptr<Peer> evpn_routing_peer_;
std::auto_ptr<Peer> evpn_peer_;
std::auto_ptr<Peer> multicast_peer_;
std::auto_ptr<Peer> multicast_tor_peer_;
std::auto_ptr<Peer> multicast_tree_builder_peer_;
std::auto_ptr<Peer> mac_vm_binding_peer_;
std::auto_ptr<Peer> inet_evpn_peer_;
std::auto_ptr<Peer> mac_learning_peer_;
std::auto_ptr<Peer> fabric_rt_export_peer_;
std::auto_ptr<Peer> local_vm_export_peer_;
std::auto_ptr<AgentSignal> agent_signal_;
IFMapAgentParser *ifmap_parser_;
bool router_id_configured_;
uint16_t mirror_src_udp_port_;
LifetimeManager *lifetime_manager_;
bool ksync_sync_mode_;
std::string mgmt_ip_;
static Agent *singleton_;
VxLanNetworkIdentifierMode vxlan_network_identifier_mode_;
const Interface *vhost_interface_;
const Interface *crypt_interface_;
process::ConnectionState* connection_state_;
bool test_mode_;
bool xmpp_dns_test_mode_;
bool init_done_;
bool resource_manager_ready_;
bool simulate_evpn_tor_;
bool tsn_no_forwarding_enabled_;
bool tsn_enabled_;
bool tor_agent_enabled_;
bool forwarding_enabled_;
bool server_gateway_mode_;
bool vcpe_gateway_mode_;
bool pbb_gateway_mode_;
bool inet_labeled_enabled_;
// Flow information
uint32_t flow_table_size_;
uint16_t flow_thread_count_;
bool flow_trace_enable_;
uint32_t max_vm_flows_;
uint32_t flow_add_tokens_;
uint32_t flow_ksync_tokens_;
uint32_t flow_del_tokens_;
uint32_t flow_update_tokens_;
// OVSDB client ptr
OVSDB::OvsdbClient *ovsdb_client_;
//IP address to be used for sending vrouter sandesh messages
Ip4Address vrouter_server_ip_;
//TCP port number to be used for sending vrouter sandesh messages
uint32_t vrouter_server_port_;
//Max label space of vrouter
uint32_t vrouter_max_labels_;
//Max nexthop supported by vrouter
uint32_t vrouter_max_nexthops_;
//Max interface supported by vrouter
uint32_t vrouter_max_interfaces_;
//Max VRF supported by vrouter
uint32_t vrouter_max_vrfs_;
//Max Mirror entries
uint32_t vrouter_max_mirror_entries_;
//Bridge entries that can be porgrammed in vrouter
uint32_t vrouter_max_bridge_entries_;
uint32_t vrouter_max_oflow_bridge_entries_;
//Max Flow entries
uint32_t vrouter_max_flow_entries_;
//Max OverFlow entries
uint32_t vrouter_max_oflow_entries_;
std::string vrouter_build_info_;
//Priority tagging status
bool vrouter_priority_tagging_;
FlowStatsReqHandler flow_stats_req_handler_;
PortConfigHandler port_config_handler_;
uint32_t tbb_keepawake_timeout_;
// Monitor task library and assert if inactivity detected
uint32_t task_monitor_timeout_msec_;
// List of TSN who are alive(Relevant for TSN mode only).
std::vector<std::string> active_tsn_servers_;
bool global_slo_status_;
// Constants
boost::uuids::uuid fabric_vn_uuid_;
public:
static const std::string config_file_;
static const std::string log_file_;
static const std::string null_string_;
static const std::set<std::string> null_string_list_;
static std::string fabric_vrf_name_;
static const std::string fabric_vn_name_;
static std::string fabric_policy_vrf_name_;
static const std::string link_local_vrf_name_;
static const std::string link_local_vn_name_;
static const MacAddress vrrp_mac_;
static const MacAddress pkt_interface_mac_;
static const std::string bcast_mac_;
static const MacAddress left_si_mac_;
static const MacAddress right_si_mac_;
static const std::string xmpp_dns_server_connection_name_prefix_;
static const std::string xmpp_control_node_connection_name_prefix_;
static const std::string dpdk_exception_pkt_path_;
static const std::string vnic_exception_pkt_interface_;
static const std::string v4_link_local_subnet_;
static const std::string v6_link_local_subnet_;
static const uint16_t v4_link_local_plen_ = 16;
static const uint16_t v6_link_local_plen_ = 10;
};
#endif // vnsw_agent_hpp
| {
"content_hash": "d38c9ca9d015e4ce1886918308598f3c",
"timestamp": "",
"source": "github",
"line_count": 1555,
"max_line_length": 88,
"avg_line_length": 33.75627009646302,
"alnum_prop": 0.685469890076394,
"repo_name": "rombie/contrail-controller",
"id": "84a88c2dc989c1e87cc41fdf9d7bae11cab262f3",
"size": "52563",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/vnsw/agent/cmn/agent.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "722850"
},
{
"name": "C++",
"bytes": "22461123"
},
{
"name": "GDB",
"bytes": "39260"
},
{
"name": "Go",
"bytes": "59593"
},
{
"name": "Java",
"bytes": "91653"
},
{
"name": "Lua",
"bytes": "13345"
},
{
"name": "PowerShell",
"bytes": "2391"
},
{
"name": "Python",
"bytes": "7791777"
},
{
"name": "Roff",
"bytes": "41295"
},
{
"name": "Ruby",
"bytes": "13596"
},
{
"name": "Shell",
"bytes": "52086"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2015-2017 Red Hat, Inc. and/or its affiliates
and other 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.hawkular.agent</groupId>
<artifactId>hawkular-wildfly-agent-parent</artifactId>
<version>0.29.5.Final-SNAPSHOT</version>
</parent>
<artifactId>hawkular-javaagent</artifactId>
<name>Hawkular Agent: Javaagent</name>
<description>A VM javaagent that is able to collect metrics and send them to Hawkular.</description>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hawkular.agent</groupId>
<artifactId>hawkular-agent-core</artifactId>
<version>${project.version}</version>
</dependency>
<!-- this is flagged as "provided" within a transitive dep; we need it as "compile" -->
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<scope>compile</scope>
</dependency>
<!-- Some third-party libraries (e.g. okhttp3) use SLF4J logging API.
To avoid errors spitting out, we need to include an SLF4J binding -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>1.7.21</version>
<scope>compile</scope>
</dependency>
<!-- Strangely, the Jolokia client requires this, but is not listed as a dependency
of the Jolokia client artifact. We need to add it here so the shade plugin pulls it in. -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.3</version>
<scope>compile</scope>
</dependency>
<!-- these logging dependencies are only compile-time deps for generating log messages -->
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-annotations</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>assembly-javaagent</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Premain-Class>org.hawkular.agent.javaagent.JavaAgent</Premain-Class>
<Main-Class>org.hawkular.agent.javaagent.JavaAgent</Main-Class>
</manifestEntries>
</transformer>
</transformers>
</configuration>
</plugin>
</plugins>
</build>
</project>
| {
"content_hash": "62831a97bd5938fab27b76f1ce88be0d",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 204,
"avg_line_length": 33.8828125,
"alnum_prop": 0.6569056951810007,
"repo_name": "Jiri-Kremser/hawkular-agent",
"id": "37c88ac8f9054e8c1dc3edd79cf3c09802515adb",
"size": "4337",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "hawkular-javaagent/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "5271"
},
{
"name": "HTML",
"bytes": "1761"
},
{
"name": "Java",
"bytes": "2600325"
},
{
"name": "Shell",
"bytes": "8523"
},
{
"name": "XSLT",
"bytes": "24253"
}
],
"symlink_target": ""
} |
export class Move
{
constructor(target)
{
this._target = target;
}
get Target(){
return this._target;
}
equals(other)
{
if(this === other)
return true;
if(typeof other != typeof this)
{
return false;
}
return this._target.equals(other._target);
}
toString ()
{
return "Move("+this._target+")";
}
} | {
"content_hash": "a45629fc499abcc3b351f73342926fd8",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 50,
"avg_line_length": 13.545454545454545,
"alnum_prop": 0.44742729306487694,
"repo_name": "ericknajjar/tictactoejs",
"id": "e7d069ae3580ad8f0151b519859b850904077e31",
"size": "448",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/js/gameContext/move.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "120"
},
{
"name": "HTML",
"bytes": "339"
},
{
"name": "JavaScript",
"bytes": "49607"
}
],
"symlink_target": ""
} |
set(aquaautopilot_MESSAGE_FILES "/home/2014/tko4/robotAss1/src/aquaautopilot/msg/UberpilotStatus.msg")
set(aquaautopilot_SERVICE_FILES "")
| {
"content_hash": "4442f70afa1fc44e112645da2e27bc1e",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 102,
"avg_line_length": 69.5,
"alnum_prop": 0.8201438848920863,
"repo_name": "newphew92/robotAss2",
"id": "b2f6bae9730d54266793e782d890af3ca8db0645",
"size": "139",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "devel/share/aquaautopilot/cmake/aquaautopilot-msg-extras.cmake",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "1285806"
},
{
"name": "CMake",
"bytes": "92316"
},
{
"name": "Common Lisp",
"bytes": "648657"
},
{
"name": "NewLisp",
"bytes": "235855"
},
{
"name": "Python",
"bytes": "39186"
},
{
"name": "Shell",
"bytes": "3580"
}
],
"symlink_target": ""
} |
typedef double Real;
template <typename Real>
using XX = Optizelle::Rm <Real>;
typedef XX <Real> X;
typedef typename X::Vector X_Vector;
template <typename Real>
using YY = Optizelle::Rm <Real>;
typedef YY <Real> X;
typedef typename X::Vector X_Vector;
| {
"content_hash": "57bc84ca4c96896ab71959cd72a1451f",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 36,
"avg_line_length": 23.181818181818183,
"alnum_prop": 0.7333333333333333,
"repo_name": "OptimoJoe/Optizelle",
"id": "6c58409e00c04b165c9332a15a9ac7131a210f29",
"size": "313",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/unit/core/spaces.h",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "C",
"bytes": "212"
},
{
"name": "C++",
"bytes": "1497824"
},
{
"name": "CMake",
"bytes": "113521"
},
{
"name": "Mathematica",
"bytes": "11313"
},
{
"name": "Matlab",
"bytes": "177318"
},
{
"name": "Python",
"bytes": "121166"
},
{
"name": "TeX",
"bytes": "247884"
}
],
"symlink_target": ""
} |
> Polymer Element with GitHub Flavored Markdown (GFM) editor with file drop and paste functionality
## Demo

[Check it live!](http://Juicy.github.io/juicy-markdown-editor)
## Install
Install the component using [Bower](http://bower.io/):
```sh
$ bower install juicy-markdown-editor --save
```
Or [download as ZIP](https://github.com/Juicy/juicy-markdown-editor/archive/master.zip).
## Usage
1. Import Web Components' polyfill:
```html
<script src="bower_components/platform/platform.js"></script>
```
2. Import Custom Element:
```html
<link rel="import" href="bower_components/juicy-markdown-editor/juicy-markdown-editor.html">
```
3. Start using it!
```html
<my-element uploadurl="/storage/server/path"></my-element>
```
## Options
Attribute | Options | Default | Description
--- | --- | --- | ---
`uploadurl` | *string* | `` | URL to files storage server, see [`<juicy-filedrop url>`](https://github.com/Juicy/juicy-filedrop#options).
`customheader` | *string* | `x-file` | Name for custom header that contains JSON with file meta data, see [`<juicy-filedrop customheader>`](https://github.com/Juicy/juicy-filedrop#options).
`ghcss` | *boolean* | `false` | Should ghithub-markdown.css be imported? see [`<juicy-markdown ghcss>`](https://github.com/Juicy/juicy-markdown#options).
`value` | *string* | `` | Markdown to render.
`placeholder` | *string* | `` | Input placeholder.
## See also
- [`<juicy-markdown>`](https://github.com/Juicy/juicy-markdown) - Markdown viewer
- [`<juicy-filedrop>`](https://github.com/Juicy/juicy-filedrop) - just file drop panel
- [`<juicy-markdown-tabbededitor>`](https://github.com/Juicy/juicy-markdown-tabbededitor) - Markdown editor, with tabs like the one at GitHub.com
## Contributing
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -m 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D
## History
For detailed changelog, check [Releases](https://github.com/Juicy/juicy-markdown-editor/releases).
## License
MIT
| {
"content_hash": "db5e87a401e2496f146ee85a49d965ef",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 189,
"avg_line_length": 32.76470588235294,
"alnum_prop": 0.6804308797127468,
"repo_name": "StarcounterApps/Content",
"id": "3261cad5aff83c53061389ff2a3199eba6d0d11d",
"size": "2261",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Content/wwwroot/Content/elements/juicy-markdown-editor/README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "1637"
},
{
"name": "C#",
"bytes": "43850"
},
{
"name": "CSS",
"bytes": "141886"
},
{
"name": "HTML",
"bytes": "1555174"
},
{
"name": "JavaScript",
"bytes": "3540236"
},
{
"name": "Makefile",
"bytes": "751"
},
{
"name": "Roff",
"bytes": "2072"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>InstallArgs - FAKE - F# Make</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="Steffen Forkmann, Mauricio Scheffer, Colin Bull">
<script src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="http://fsharp.github.io/FAKE/content/style.css" />
<script type="text/javascript" src="http://fsharp.github.io/FAKE/content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="http://fsharp.org">fsharp.org</a></li>
<li><a href="http://github.com/fsharp/fake">github page</a></li>
</ul>
<h3 class="muted"><a href="http://fsharp.github.io/FAKE/index.html">FAKE - F# Make</a></h3>
</div>
<hr />
<div class="row">
<div class="span9" id="main">
<h1>InstallArgs</h1>
<div class="xmldoc">
<p>Arguments for the Bower install command</p>
</div>
<h3>Union Cases</h3>
<table class="table table-bordered member-list">
<thead>
<tr><td>Union Case</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '1372', 1372)" onmouseover="showTip(event, '1372', 1372)">
Forced
</code>
<div class="tip" id="1372">
<strong>Signature:</strong> <br />
</div>
</td>
<td class="xmldoc">
<a href="https://github.com/fsharp/FAKE/blob/master/src/app/FakeLib/BowerHelper.fs#L16-16" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
</td>
</tr>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '1373', 1373)" onmouseover="showTip(event, '1373', 1373)">
Standard
</code>
<div class="tip" id="1373">
<strong>Signature:</strong> <br />
</div>
</td>
<td class="xmldoc">
<a href="https://github.com/fsharp/FAKE/blob/master/src/app/FakeLib/BowerHelper.fs#L15-15" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
</td>
</tr>
</tbody>
</table>
</div>
<div class="span3">
<a href="http://fsharp.github.io/FAKE/index.html">
<img src="http://fsharp.github.io/FAKE/pics/logo.png" style="width:140px;height:140px;margin:10px 0px 0px 35px;border-style:none;" />
</a>
<ul class="nav nav-list" id="menu">
<li class="nav-header">FAKE - F# Make</li>
<li class="divider"></li>
<li><a href="http://fsharp.github.io/FAKE/index.html">Home page</a></li>
<li class="divider"></li>
<li><a href="https://www.nuget.org/packages/FAKE">Get FAKE - F# Make via NuGet</a></li>
<li><a href="http://github.com/fsharp/fake">Source Code on GitHub</a></li>
<li><a href="http://github.com/fsharp/fake/blob/master/License.txt">License (Apache 2)</a></li>
<li><a href="http://fsharp.github.io/FAKE/RELEASE_NOTES.html">Release Notes</a></li>
<li><a href="http://fsharp.github.io/FAKE//contributing.html">Contributing to FAKE - F# Make</a></li>
<li><a href="http://fsharp.github.io/FAKE/users.html">Who is using FAKE?</a></li>
<li><a href="http://stackoverflow.com/questions/tagged/f%23-fake">Ask a question</a></li>
<li class="nav-header">Tutorials</li>
<li><a href="http://fsharp.github.io/FAKE/gettingstarted.html">Getting started</a></li>
<li><a href="http://fsharp.github.io/FAKE/cache.html">Build script caching</a></li>
<li class="divider"></li>
<li><a href="http://fsharp.github.io/FAKE/nuget.html">NuGet package restore</a></li>
<li><a href="http://fsharp.github.io/FAKE/fxcop.html">Using FxCop in a build</a></li>
<li><a href="http://fsharp.github.io/FAKE/assemblyinfo.html">Generating AssemblyInfo</a></li>
<li><a href="http://fsharp.github.io/FAKE/create-nuget-package.html">Create NuGet packages</a></li>
<li><a href="http://fsharp.github.io/FAKE/specifictargets.html">Running specific targets</a></li>
<li><a href="http://fsharp.github.io/FAKE/commandline.html">Running FAKE from command line</a></li>
<li><a href="http://fsharp.github.io/FAKE/parallel-build.html">Running targets in parallel</a></li>
<li><a href="http://fsharp.github.io/FAKE/fsc.html">Using the F# compiler from FAKE</a></li>
<li><a href="http://fsharp.github.io/FAKE/customtasks.html">Creating custom tasks</a></li>
<li><a href="http://fsharp.github.io/FAKE/soft-dependencies.html">Soft dependencies</a></li>
<li><a href="http://fsharp.github.io/FAKE/teamcity.html">TeamCity integration</a></li>
<li><a href="http://fsharp.github.io/FAKE/canopy.html">Running canopy tests</a></li>
<li><a href="http://fsharp.github.io/FAKE/octopusdeploy.html">Octopus Deploy</a></li>
<li><a href="http://fsharp.github.io/FAKE/typescript.html">TypeScript support</a></li>
<li><a href="http://fsharp.github.io/FAKE/azurewebjobs.html">Azure WebJobs support</a></li>
<li><a href="http://fsharp.github.io/FAKE/azurecloudservices.html">Azure Cloud Services support</a></li>
<li><a href="http://fsharp.github.io/FAKE/fluentmigrator.html">FluentMigrator support</a></li>
<li><a href="http://fsharp.github.io/FAKE/androidpublisher.html">Android publisher</a></li>
<li><a href="http://fsharp.github.io/FAKE/watch.html">File Watcher</a></li>
<li><a href="http://fsharp.github.io/FAKE/wix.html">WiX Setup Generation</a></li>
<li><a href="http://fsharp.github.io/FAKE/chocolatey.html">Using Chocolatey</a></li>
<li><a href="http://fsharp.github.io/FAKE/slacknotification.html">Using Slack</a></li>
<li><a href="http://fsharp.github.io/FAKE/sonarcube.html">Using SonarQube</a></li>
<li class="divider"></li>
<li><a href="http://fsharp.github.io/FAKE/deploy.html">Fake.Deploy</a></li>
<li><a href="http://fsharp.github.io/FAKE/iis.html">Fake.IIS</a></li>
<li class="nav-header">Reference</li>
<li><a href="http://fsharp.github.io/FAKE/apidocs/index.html">API Reference</a></li>
</ul>
</div>
</div>
</div>
<a href="http://github.com/fsharp/fake"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
</body>
</html>
| {
"content_hash": "ffc7f20053197bc3c4bc572ec0bbf33e",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 209,
"avg_line_length": 53.308724832214764,
"alnum_prop": 0.5802593478534559,
"repo_name": "kirill-gerasimenko/fseye",
"id": "645f23314bbfb93544f67023de1f94763a1e233b",
"size": "7943",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "packages/FAKE/docs/apidocs/fake-bowerhelper-installargs.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1800"
},
{
"name": "CSS",
"bytes": "4399"
},
{
"name": "F#",
"bytes": "133658"
},
{
"name": "HTML",
"bytes": "6695232"
},
{
"name": "JavaScript",
"bytes": "1340"
}
],
"symlink_target": ""
} |
using LitJson;
using LinqToTwitter.Common;
namespace LinqToTwitter
{
/// <summary>
/// User returned by Control Stream query
/// </summary>
public class ControlStreamUser
{
public ControlStreamUser(JsonData userJson)
{
UserID = userJson.GetValue<ulong>("id");
Name = userJson.GetValue<string>("name");
DM = userJson.GetValue<bool>("dm");
}
/// <summary>
/// User's unique Twitter ID
/// </summary>
public ulong UserID { get; set; }
/// <summary>
/// User's screen name
/// </summary>
public string Name { get; set; }
/// <summary>
/// Does the authenticated user have RW+DM access to user
/// </summary>
public bool DM { get; set; }
}
}
| {
"content_hash": "ab04908df1b4352f6c8484e743024cd8",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 65,
"avg_line_length": 24.90909090909091,
"alnum_prop": 0.5328467153284672,
"repo_name": "Dashue/LinqToTwitter",
"id": "8430630de236f1c1c44aed97286f2492b4f2d622",
"size": "824",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Old/Libraries/LinqToTwitterAg/Streaming/ControlStreamUser.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "52873"
},
{
"name": "Batchfile",
"bytes": "740"
},
{
"name": "C#",
"bytes": "6191462"
},
{
"name": "CSS",
"bytes": "15258"
},
{
"name": "HTML",
"bytes": "44938"
},
{
"name": "JavaScript",
"bytes": "398136"
},
{
"name": "Pascal",
"bytes": "6951"
},
{
"name": "PowerShell",
"bytes": "290874"
},
{
"name": "Visual Basic",
"bytes": "44185"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>aac-tactics: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.7.2 / aac-tactics - 8.5.1</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
aac-tactics
<small>
8.5.1
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-11-15 02:05:52 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-11-15 02:05:52 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 2 Virtual package relying on perl
coq 8.7.2 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.07.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.07.1 Official release 4.07.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.5 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "matej.kosik@inria.fr"
homepage: "https://github.com/coq-contribs/aac-tactics"
license: "LGPL"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/AAC_tactics"]
depends: [
"ocaml"
"coq" {>= "8.5" & < "8.6~"}
]
tags: [ "keyword:reflexive tactic" "keyword:rewriting" "keyword:rewriting modulo associativity and commutativity" "keyword:rewriting modulo ac" "keyword:decision procedure" "category:Miscellaneous/Coq Extensions" ]
authors: [ "Damien Pous <damien.pous@inria.fr>" "Thomas Braibant <thomas.braibant@gmail.com>" ]
bug-reports: "https://github.com/coq-contribs/aac-tactics/issues"
dev-repo: "git+https://github.com/coq-contribs/aac-tactics.git"
synopsis: "AAC tactics"
description:
"This Coq plugin provides tactics for rewriting universally quantified equations, modulo associative (and possibly commutative) operators."
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/aac-tactics/archive/v8.5.1.tar.gz"
checksum: "md5=30bef1d940f0a13246318883bcc29baf"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-aac-tactics.8.5.1 coq.8.7.2</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.7.2).
The following dependencies couldn't be met:
- coq-aac-tactics -> coq < 8.6~ -> ocaml < 4.06.0
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-aac-tactics.8.5.1</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "a797ad5f37037a73537a5f605af97c7b",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 274,
"avg_line_length": 43.1840490797546,
"alnum_prop": 0.5472368234124165,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "fcdff63c46bc08fea13a3bdf4bd86387d28a21f9",
"size": "7064",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.07.1-2.0.6/released/8.7.2/aac-tactics/8.5.1.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2011 Couchbase, Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "config.h"
#include <string>
#include <utility>
#include <vector>
#include "checkpoint.h"
#include "ep_engine.h"
#define STATWRITER_NAMESPACE checkpoint
#include "statwriter.h"
#undef STATWRITER_NAMESPACE
#include "vbucket.h"
/**
* A listener class to update checkpoint related configs at runtime.
*/
class CheckpointConfigChangeListener : public ValueChangedListener {
public:
CheckpointConfigChangeListener(CheckpointConfig &c) : config(c) { }
virtual ~CheckpointConfigChangeListener() { }
virtual void sizeValueChanged(const std::string &key, size_t value) {
if (key.compare("chk_period") == 0) {
config.setCheckpointPeriod(value);
} else if (key.compare("chk_max_items") == 0) {
config.setCheckpointMaxItems(value);
} else if (key.compare("max_checkpoints") == 0) {
config.setMaxCheckpoints(value);
}
}
virtual void booleanValueChanged(const std::string &key, bool value) {
if (key.compare("inconsistent_slave_chk") == 0) {
config.allowInconsistentSlaveCheckpoint(value);
} else if (key.compare("item_num_based_new_chk") == 0) {
config.allowItemNumBasedNewCheckpoint(value);
} else if (key.compare("keep_closed_chks") == 0) {
config.allowKeepClosedCheckpoints(value);
}
}
private:
CheckpointConfig &config;
};
Checkpoint::~Checkpoint() {
LOG(EXTENSION_LOG_INFO,
"Checkpoint %llu for vbucket %d is purged from memory",
checkpointId, vbucketId);
stats.memOverhead.decr(memorySize());
assert(stats.memOverhead.get() < GIGANTOR);
}
void Checkpoint::setState(checkpoint_state state) {
checkpointState = state;
}
void Checkpoint::popBackCheckpointEndItem() {
if (!toWrite.empty() && toWrite.back()->getOperation() == queue_op_checkpoint_end) {
keyIndex.erase(toWrite.back()->getKey());
toWrite.pop_back();
}
}
bool Checkpoint::keyExists(const std::string &key) {
return keyIndex.find(key) != keyIndex.end();
}
queue_dirty_t Checkpoint::queueDirty(const queued_item &qi, CheckpointManager *checkpointManager) {
assert (checkpointState == CHECKPOINT_OPEN);
uint64_t newMutationId = checkpointManager->nextMutationId();
queue_dirty_t rv;
checkpoint_index::iterator it = keyIndex.find(qi->getKey());
// Check if this checkpoint already had an item for the same key.
if (it != keyIndex.end()) {
rv = EXISTING_ITEM;
std::list<queued_item>::iterator currPos = it->second.position;
uint64_t currMutationId = it->second.mutation_id;
CheckpointCursor &pcursor = checkpointManager->persistenceCursor;
if (*(pcursor.currentCheckpoint) == this) {
// If the existing item is in the left-hand side of the item pointed by the
// persistence cursor, decrease the persistence cursor's offset by 1.
const std::string &key = (*(pcursor.currentPos))->getKey();
checkpoint_index::iterator ita = keyIndex.find(key);
if (ita != keyIndex.end()) {
uint64_t mutationId = ita->second.mutation_id;
if (currMutationId <= mutationId) {
checkpointManager->decrCursorOffset_UNLOCKED(pcursor, 1);
rv = PERSIST_AGAIN;
}
}
// If the persistence cursor points to the existing item for the same key,
// shift the cursor left by 1.
if (pcursor.currentPos == currPos) {
checkpointManager->decrCursorPos_UNLOCKED(pcursor);
}
}
std::map<const std::string, CheckpointCursor>::iterator map_it;
for (map_it = checkpointManager->tapCursors.begin();
map_it != checkpointManager->tapCursors.end(); ++map_it) {
if (*(map_it->second.currentCheckpoint) == this) {
const std::string &key = (*(map_it->second.currentPos))->getKey();
checkpoint_index::iterator ita = keyIndex.find(key);
if (ita != keyIndex.end()) {
uint64_t mutationId = ita->second.mutation_id;
if (currMutationId <= mutationId) {
checkpointManager->decrCursorOffset_UNLOCKED(map_it->second, 1);
}
}
// If an TAP cursor points to the existing item for the same key, shift it left by 1
if (map_it->second.currentPos == currPos) {
checkpointManager->decrCursorPos_UNLOCKED(map_it->second);
}
}
}
queued_item &existing_itm = *currPos;
existing_itm->setOperation(qi->getOperation());
existing_itm->setQueuedTime(qi->getQueuedTime());
toWrite.push_back(existing_itm);
// Remove the existing item for the same key from the list.
toWrite.erase(currPos);
} else {
if (qi->getOperation() == queue_op_set || qi->getOperation() == queue_op_del) {
++numItems;
}
rv = NEW_ITEM;
// Push the new item into the list
toWrite.push_back(qi);
}
if (qi->getKey().size() > 0) {
std::list<queued_item>::iterator last = toWrite.end();
// --last is okay as the list is not empty now.
index_entry entry = {--last, newMutationId};
// Set the index of the key to the new item that is pushed back into the list.
keyIndex[qi->getKey()] = entry;
if (rv == NEW_ITEM) {
size_t newEntrySize = qi->getKey().size() + sizeof(index_entry) + sizeof(queued_item);
memOverhead += newEntrySize;
stats.memOverhead.incr(newEntrySize);
assert(stats.memOverhead.get() < GIGANTOR);
}
}
return rv;
}
size_t Checkpoint::mergePrevCheckpoint(Checkpoint *pPrevCheckpoint) {
size_t numNewItems = 0;
size_t newEntryMemOverhead = 0;
std::list<queued_item>::reverse_iterator rit = pPrevCheckpoint->rbegin();
LOG(EXTENSION_LOG_INFO,
"Collapse the checkpoint %llu into the checkpoint %llu for vbucket %d",
pPrevCheckpoint->getId(), checkpointId, vbucketId);
keyIndex["dummy_key"].mutation_id =
pPrevCheckpoint->getMutationIdForKey("dummy_key");
keyIndex["checkpoint_start"].mutation_id =
pPrevCheckpoint->getMutationIdForKey("checkpoint_start");
for (; rit != pPrevCheckpoint->rend(); ++rit) {
const std::string &key = (*rit)->getKey();
if ((*rit)->getOperation() != queue_op_del &&
(*rit)->getOperation() != queue_op_set) {
continue;
}
checkpoint_index::iterator it = keyIndex.find(key);
if (it == keyIndex.end()) {
std::list<queued_item>::iterator pos = toWrite.begin();
// Skip the first two meta items
++pos; ++pos;
toWrite.insert(pos, *rit);
index_entry entry = {--pos, pPrevCheckpoint->getMutationIdForKey(key)};
keyIndex[key] = entry;
newEntryMemOverhead += key.size() + sizeof(index_entry);
++numItems;
++numNewItems;
}
}
memOverhead += newEntryMemOverhead;
stats.memOverhead.incr(newEntryMemOverhead);
assert(stats.memOverhead.get() < GIGANTOR);
return numNewItems;
}
uint64_t Checkpoint::getMutationIdForKey(const std::string &key) {
uint64_t mid = 0;
checkpoint_index::iterator it = keyIndex.find(key);
if (it != keyIndex.end()) {
mid = it->second.mutation_id;
}
return mid;
}
CheckpointManager::~CheckpointManager() {
LockHolder lh(queueLock);
std::list<Checkpoint*>::iterator it = checkpointList.begin();
while(it != checkpointList.end()) {
delete *it;
++it;
}
}
uint64_t CheckpointManager::getOpenCheckpointId_UNLOCKED() {
if (checkpointList.empty()) {
return 0;
}
uint64_t id = checkpointList.back()->getId();
return checkpointList.back()->getState() == CHECKPOINT_OPEN ? id : id + 1;
}
uint64_t CheckpointManager::getOpenCheckpointId() {
LockHolder lh(queueLock);
return getOpenCheckpointId_UNLOCKED();
}
uint64_t CheckpointManager::getLastClosedCheckpointId_UNLOCKED() {
if (!isCollapsedCheckpoint) {
uint64_t id = getOpenCheckpointId_UNLOCKED();
lastClosedCheckpointId = id > 0 ? (id - 1) : 0;
}
return lastClosedCheckpointId;
}
uint64_t CheckpointManager::getLastClosedCheckpointId() {
LockHolder lh(queueLock);
return getLastClosedCheckpointId_UNLOCKED();
}
void CheckpointManager::setOpenCheckpointId_UNLOCKED(uint64_t id) {
if (!checkpointList.empty()) {
LOG(EXTENSION_LOG_INFO, "Set the current open checkpoint id to %llu "
"for vbucket %d", id, vbucketId);
checkpointList.back()->setId(id);
// Update the checkpoint_start item with the new Id.
queued_item qi = createCheckpointItem(id, vbucketId, queue_op_checkpoint_start);
std::list<queued_item>::iterator it = ++(checkpointList.back()->begin());
*it = qi;
}
}
bool CheckpointManager::addNewCheckpoint_UNLOCKED(uint64_t id) {
// This is just for making sure that the current checkpoint should be closed.
if (!checkpointList.empty() &&
checkpointList.back()->getState() == CHECKPOINT_OPEN) {
closeOpenCheckpoint_UNLOCKED(checkpointList.back()->getId());
}
LOG(EXTENSION_LOG_INFO, "Create a new open checkpoint %llu for vbucket %d",
id, vbucketId);
bool empty = checkpointList.empty() ? true : false;
Checkpoint *checkpoint = new Checkpoint(stats, id, vbucketId, CHECKPOINT_OPEN);
// Add a dummy item into the new checkpoint, so that any cursor referring to the actual first
// item in this new checkpoint can be safely shifted left by 1 if the first item is removed
// and pushed into the tail.
queued_item dummyItem(new QueuedItem("dummy_key", 0xffff, queue_op_empty));
checkpoint->queueDirty(dummyItem, this);
// This item represents the start of the new checkpoint and is also sent to the slave node.
queued_item qi = createCheckpointItem(id, vbucketId, queue_op_checkpoint_start);
checkpoint->queueDirty(qi, this);
++numItems;
checkpointList.push_back(checkpoint);
if (empty) {
return true;
}
// Move the persistence cursor to the next checkpoint if it already reached to
// the end of its current checkpoint.
++(persistenceCursor.currentPos);
if (persistenceCursor.currentPos != (*(persistenceCursor.currentCheckpoint))->end()) {
if ((*(persistenceCursor.currentPos))->getOperation() == queue_op_checkpoint_end) {
// Skip checkpoint_end meta item that is only used by TAP replication cursors.
++(persistenceCursor.offset);
++(persistenceCursor.currentPos); // cursor now reaches to the checkpoint end.
}
}
if (persistenceCursor.currentPos == (*(persistenceCursor.currentCheckpoint))->end()) {
if ((*(persistenceCursor.currentCheckpoint))->getState() == CHECKPOINT_CLOSED) {
uint64_t chkid = (*(persistenceCursor.currentCheckpoint))->getId();
if (moveCursorToNextCheckpoint(persistenceCursor)) {
pCursorPreCheckpointId = chkid;
} else {
--(persistenceCursor.currentPos);
}
} else {
// The persistence cursor is already reached to the end of the open checkpoint.
--(persistenceCursor.currentPos);
}
} else {
--(persistenceCursor.currentPos);
}
return true;
}
bool CheckpointManager::addNewCheckpoint(uint64_t id) {
LockHolder lh(queueLock);
return addNewCheckpoint_UNLOCKED(id);
}
bool CheckpointManager::closeOpenCheckpoint_UNLOCKED(uint64_t id) {
if (checkpointList.empty()) {
return false;
}
if (id != checkpointList.back()->getId() ||
checkpointList.back()->getState() == CHECKPOINT_CLOSED) {
return true;
}
LOG(EXTENSION_LOG_INFO, "Close the open checkpoint %llu for vbucket %d",
id, vbucketId);
// This item represents the end of the current open checkpoint and is sent to the slave node.
queued_item qi = createCheckpointItem(id, vbucketId, queue_op_checkpoint_end);
checkpointList.back()->queueDirty(qi, this);
++numItems;
checkpointList.back()->setState(CHECKPOINT_CLOSED);
return true;
}
bool CheckpointManager::closeOpenCheckpoint(uint64_t id) {
LockHolder lh(queueLock);
return closeOpenCheckpoint_UNLOCKED(id);
}
void CheckpointManager::registerPersistenceCursor() {
LockHolder lh(queueLock);
assert(!checkpointList.empty());
persistenceCursor.currentCheckpoint = checkpointList.begin();
persistenceCursor.currentPos = checkpointList.front()->begin();
checkpointList.front()->registerCursorName(persistenceCursor.name);
}
bool CheckpointManager::registerTAPCursor(const std::string &name, uint64_t checkpointId,
bool closedCheckpointOnly, bool alwaysFromBeginning) {
LockHolder lh(queueLock);
return registerTAPCursor_UNLOCKED(name,
checkpointId,
closedCheckpointOnly,
alwaysFromBeginning);
}
bool CheckpointManager::registerTAPCursor_UNLOCKED(const std::string &name,
uint64_t checkpointId,
bool closedCheckpointOnly,
bool alwaysFromBeginning) {
assert(!checkpointList.empty());
bool found = false;
std::list<Checkpoint*>::iterator it = checkpointList.begin();
for (; it != checkpointList.end(); ++it) {
if (checkpointId == (*it)->getId()) {
found = true;
break;
}
}
LOG(EXTENSION_LOG_INFO,
"Register the tap cursor with the name \"%s\" for vbucket %d",
name.c_str(), vbucketId);
// Get the current open_checkpoint_id. The cursor that grabs items from closed checkpoints
// only walks the checkpoint datastructure until it reaches to the beginning of the
// checkpoint with open_checkpoint_id. One of the typical use cases is the cursor for the
// incremental backup client.
uint64_t open_chk_id = getOpenCheckpointId_UNLOCKED();
// If the tap cursor exists, remove its name from the checkpoint that is
// currently referenced by the tap cursor.
std::map<const std::string, CheckpointCursor>::iterator map_it = tapCursors.find(name);
if (map_it != tapCursors.end()) {
(*(map_it->second.currentCheckpoint))->removeCursorName(name);
}
if (!found) {
LOG(EXTENSION_LOG_DEBUG,
"Checkpoint %llu for vbucket %d doesn't exist in memory. "
"Set the cursor with the name \"%s\" to the open checkpoint.\n",
checkpointId, vbucketId, name.c_str());
it = --(checkpointList.end());
CheckpointCursor cursor(name, it, (*it)->begin(),
numItems - ((*it)->getNumItems() + 1), // 1 is for checkpoint start item
closedCheckpointOnly, open_chk_id);
tapCursors.insert(std::pair<std::string, CheckpointCursor>(name, cursor));
(*it)->registerCursorName(name);
} else {
size_t offset = 0;
std::list<queued_item>::iterator curr;
LOG(EXTENSION_LOG_DEBUG,
"Checkpoint %llu for vbucket %d exists in memory. "
"Set the cursor with the name \"%s\" to the checkpoint %llu\n",
checkpointId, vbucketId, name.c_str(), checkpointId);
if (!alwaysFromBeginning &&
map_it != tapCursors.end() &&
(*(map_it->second.currentCheckpoint))->getId() == (*it)->getId()) {
// If the cursor is currently in the checkpoint to start with, simply start from
// its current position.
curr = map_it->second.currentPos;
offset = map_it->second.offset;
} else {
// Set the cursor's position to the begining of the checkpoint to start with
curr = (*it)->begin();
std::list<Checkpoint*>::iterator pos = checkpointList.begin();
for (; pos != it; ++pos) {
offset += (*pos)->getNumItems() + 2; // 2 is for checkpoint start and end items.
}
}
CheckpointCursor cursor(name, it, curr, offset, closedCheckpointOnly, open_chk_id);
tapCursors.insert(std::pair<std::string, CheckpointCursor>(name, cursor));
// Register the tap cursor's name to the checkpoint.
(*it)->registerCursorName(name);
}
return found;
}
bool CheckpointManager::removeTAPCursor(const std::string &name) {
LockHolder lh(queueLock);
LOG(EXTENSION_LOG_INFO,
"Remove the checkpoint cursor with the name \"%s\" from vbucket %d",
name.c_str(), vbucketId);
std::map<const std::string, CheckpointCursor>::iterator it = tapCursors.find(name);
if (it == tapCursors.end()) {
return false;
}
// We can simply remove the cursor's name from the checkpoint to which it currently belongs,
// by calling
// (*(it->second.currentCheckpoint))->removeCursorName(name);
// However, we just want to do more sanity checks by looking at each checkpoint. This won't
// cause much overhead because the max number of checkpoints allowed per vbucket is small.
std::list<Checkpoint*>::iterator cit = checkpointList.begin();
for (; cit != checkpointList.end(); ++cit) {
(*cit)->removeCursorName(name);
}
tapCursors.erase(it);
return true;
}
uint64_t CheckpointManager::getCheckpointIdForTAPCursor(const std::string &name) {
LockHolder lh(queueLock);
std::map<const std::string, CheckpointCursor>::iterator it = tapCursors.find(name);
if (it == tapCursors.end()) {
return 0;
}
return (*(it->second.currentCheckpoint))->getId();
}
size_t CheckpointManager::getNumOfTAPCursors() {
LockHolder lh(queueLock);
return tapCursors.size();
}
size_t CheckpointManager::getNumCheckpoints() {
LockHolder lh(queueLock);
return checkpointList.size();
}
std::list<std::string> CheckpointManager::getTAPCursorNames() {
LockHolder lh(queueLock);
std::list<std::string> cursor_names;
std::map<const std::string, CheckpointCursor>::iterator tap_it = tapCursors.begin();
for (; tap_it != tapCursors.end(); ++tap_it) {
cursor_names.push_back((tap_it->first));
}
return cursor_names;
}
bool CheckpointManager::tapCursorExists(const std::string &name) {
return tapCursors.find(name) != tapCursors.end();
}
bool CheckpointManager::isCheckpointCreationForHighMemUsage(const RCPtr<VBucket> &vbucket) {
bool forceCreation = false;
double memoryUsed = static_cast<double>(stats.getTotalMemoryUsed());
// pesistence and tap cursors are all currently in the open checkpoint?
bool allCursorsInOpenCheckpoint =
(tapCursors.size() + 1) == checkpointList.back()->getNumberOfCursors();
if (memoryUsed > stats.mem_high_wat &&
allCursorsInOpenCheckpoint &&
(checkpointList.back()->getNumItems() >= MIN_CHECKPOINT_ITEMS ||
checkpointList.back()->getNumItems() == vbucket->ht.getNumItems())) {
forceCreation = true;
}
return forceCreation;
}
size_t CheckpointManager::removeClosedUnrefCheckpoints(const RCPtr<VBucket> &vbucket,
bool &newOpenCheckpointCreated) {
// This function is executed periodically by the non-IO dispatcher.
LockHolder lh(queueLock);
assert(vbucket);
uint64_t oldCheckpointId = 0;
bool canCreateNewCheckpoint = false;
if (checkpointList.size() < checkpointConfig.getMaxCheckpoints() ||
(checkpointList.size() == checkpointConfig.getMaxCheckpoints() &&
checkpointList.front()->getNumberOfCursors() == 0)) {
canCreateNewCheckpoint = true;
}
if (vbucket->getState() == vbucket_state_active &&
!checkpointConfig.isInconsistentSlaveCheckpoint() &&
canCreateNewCheckpoint) {
bool forceCreation = isCheckpointCreationForHighMemUsage(vbucket);
// Check if this master active vbucket needs to create a new open checkpoint.
oldCheckpointId = checkOpenCheckpoint_UNLOCKED(forceCreation, true);
}
newOpenCheckpointCreated = oldCheckpointId > 0;
if (oldCheckpointId > 0) {
// If the persistence cursor reached to the end of the old open checkpoint, move it to
// the new open checkpoint.
if ((*(persistenceCursor.currentCheckpoint))->getId() == oldCheckpointId) {
if (++(persistenceCursor.currentPos) ==
(*(persistenceCursor.currentCheckpoint))->end()) {
moveCursorToNextCheckpoint(persistenceCursor);
} else {
decrCursorPos_UNLOCKED(persistenceCursor);
}
}
// If any of TAP cursors reached to the end of the old open checkpoint, move them to
// the new open checkpoint.
std::map<const std::string, CheckpointCursor>::iterator tap_it = tapCursors.begin();
for (; tap_it != tapCursors.end(); ++tap_it) {
CheckpointCursor &cursor = tap_it->second;
if ((*(cursor.currentCheckpoint))->getId() == oldCheckpointId) {
if (++(cursor.currentPos) == (*(cursor.currentCheckpoint))->end()) {
moveCursorToNextCheckpoint(cursor);
} else {
decrCursorPos_UNLOCKED(cursor);
}
}
}
}
if (checkpointConfig.canKeepClosedCheckpoints()) {
double memoryUsed = static_cast<double>(stats.getTotalMemoryUsed());
if (memoryUsed < stats.mem_high_wat &&
checkpointList.size() <= checkpointConfig.getMaxCheckpoints()) {
return 0;
}
}
size_t numUnrefItems = 0;
size_t numCheckpointsRemoved = 0;
std::list<Checkpoint*> unrefCheckpointList;
std::list<Checkpoint*>::iterator it = checkpointList.begin();
for (; it != checkpointList.end(); ++it) {
removeInvalidCursorsOnCheckpoint(*it);
if ((*it)->getNumberOfCursors() > 0) {
break;
} else {
numUnrefItems += (*it)->getNumItems() + 2; // 2 is for checkpoint start and end items.
++numCheckpointsRemoved;
if (checkpointConfig.canKeepClosedCheckpoints() &&
(checkpointList.size() - numCheckpointsRemoved) <=
checkpointConfig.getMaxCheckpoints()) {
// Collect unreferenced closed checkpoints until the number of checkpoints is
// equal to the number of max checkpoints allowed.
++it;
break;
}
}
}
if (numUnrefItems > 0) {
numItems -= numUnrefItems;
decrCursorOffset_UNLOCKED(persistenceCursor, numUnrefItems);
std::map<const std::string, CheckpointCursor>::iterator map_it = tapCursors.begin();
for (; map_it != tapCursors.end(); ++map_it) {
decrCursorOffset_UNLOCKED(map_it->second, numUnrefItems);
}
}
unrefCheckpointList.splice(unrefCheckpointList.begin(), checkpointList,
checkpointList.begin(), it);
// If any cursor on a replica vbucket or downstream active vbucket receiving checkpoints from
// the upstream master is very slow and causes more closed checkpoints in memory,
// collapse those closed checkpoints into a single one to reduce the memory overhead.
if (!checkpointConfig.canKeepClosedCheckpoints() &&
(vbucket->getState() == vbucket_state_replica ||
(vbucket->getState() == vbucket_state_active &&
checkpointConfig.isInconsistentSlaveCheckpoint()))) {
collapseClosedCheckpoints(unrefCheckpointList);
}
lh.unlock();
std::list<Checkpoint*>::iterator chkpoint_it = unrefCheckpointList.begin();
for (; chkpoint_it != unrefCheckpointList.end(); ++chkpoint_it) {
delete *chkpoint_it;
}
return numUnrefItems;
}
void CheckpointManager::removeInvalidCursorsOnCheckpoint(Checkpoint *pCheckpoint) {
std::list<std::string> invalidCursorNames;
const std::set<std::string> &cursors = pCheckpoint->getCursorNameList();
std::set<std::string>::const_iterator cit = cursors.begin();
for (; cit != cursors.end(); ++cit) {
// Check it with persistence cursor
if ((*cit).compare(persistenceCursor.name) == 0) {
if (pCheckpoint != *(persistenceCursor.currentCheckpoint)) {
invalidCursorNames.push_back(*cit);
}
} else { // Check it with tap cursors
std::map<const std::string, CheckpointCursor>::iterator mit = tapCursors.find(*cit);
if (mit == tapCursors.end() || pCheckpoint != *(mit->second.currentCheckpoint)) {
invalidCursorNames.push_back(*cit);
}
}
}
std::list<std::string>::iterator it = invalidCursorNames.begin();
for (; it != invalidCursorNames.end(); ++it) {
pCheckpoint->removeCursorName(*it);
}
}
void CheckpointManager::collapseClosedCheckpoints(std::list<Checkpoint*> &collapsedChks) {
// If there are one open checkpoint and more than one closed checkpoint, collapse those
// closed checkpoints into one checkpoint to reduce the memory overhead.
if (checkpointList.size() > 2) {
std::map<std::string, uint64_t> slowCursors;
std::set<std::string> fastCursors;
std::list<Checkpoint*>::iterator lastClosedChk = checkpointList.end();
--lastClosedChk; --lastClosedChk; // Move to the lastest closed checkpoint.
fastCursors.insert((*lastClosedChk)->getCursorNameList().begin(),
(*lastClosedChk)->getCursorNameList().end());
std::list<Checkpoint*>::reverse_iterator rit = checkpointList.rbegin();
++rit; ++rit;// Move to the second lastest closed checkpoint.
size_t numDuplicatedItems = 0, numMetaItems = 0;
for (; rit != checkpointList.rend(); ++rit) {
size_t numAddedItems = (*lastClosedChk)->mergePrevCheckpoint(*rit);
numDuplicatedItems += ((*rit)->getNumItems() - numAddedItems);
numMetaItems += 2; // checkpoint start and end meta items
std::set<std::string>::iterator nameItr =
(*rit)->getCursorNameList().begin();
for (; nameItr != (*rit)->getCursorNameList().end(); ++nameItr) {
if (nameItr->compare(persistenceCursor.name) == 0) {
const std::string& key = (*(persistenceCursor.currentPos))->getKey();
slowCursors[*nameItr] = (*rit)->getMutationIdForKey(key);
} else {
std::map<const std::string, CheckpointCursor>::iterator cc =
tapCursors.find(*nameItr);
const std::string& key = (*(cc->second.currentPos))->getKey();
slowCursors[*nameItr] = (*rit)->getMutationIdForKey(key);
}
}
}
putCursorsInChk(slowCursors, lastClosedChk);
numItems -= (numDuplicatedItems + numMetaItems);
Checkpoint *pOpenCheckpoint = checkpointList.back();
const std::set<std::string> &openCheckpointCursors = pOpenCheckpoint->getCursorNameList();
fastCursors.insert(openCheckpointCursors.begin(), openCheckpointCursors.end());
std::set<std::string>::const_iterator cit = fastCursors.begin();
// Update the offset of each fast cursor.
for (; cit != fastCursors.end(); ++cit) {
if ((*cit).compare(persistenceCursor.name) == 0) {
decrCursorOffset_UNLOCKED(persistenceCursor, numDuplicatedItems + numMetaItems);
} else {
std::map<const std::string, CheckpointCursor>::iterator mit = tapCursors.find(*cit);
if (mit != tapCursors.end()) {
decrCursorOffset_UNLOCKED(mit->second, numDuplicatedItems + numMetaItems);
}
}
}
collapsedChks.splice(collapsedChks.end(), checkpointList,
checkpointList.begin(), lastClosedChk);
}
}
bool CheckpointManager::queueDirty(const queued_item &qi, const RCPtr<VBucket> &vbucket) {
LockHolder lh(queueLock);
if (vbucket->getState() != vbucket_state_active &&
checkpointList.back()->getState() == CHECKPOINT_CLOSED) {
// Replica vbucket might receive items from the master even if the current open checkpoint
// has been already closed, because some items from the backfill with an invalid token
// are on the wire even after that backfill thread is closed. Simply ignore those items.
return false;
}
assert(vbucket);
bool canCreateNewCheckpoint = false;
if (checkpointList.size() < checkpointConfig.getMaxCheckpoints() ||
(checkpointList.size() == checkpointConfig.getMaxCheckpoints() &&
checkpointList.front()->getNumberOfCursors() == 0)) {
canCreateNewCheckpoint = true;
}
if (vbucket->getState() == vbucket_state_active &&
!checkpointConfig.isInconsistentSlaveCheckpoint() &&
canCreateNewCheckpoint) {
// Only the master active vbucket can create a next open checkpoint.
checkOpenCheckpoint_UNLOCKED(false, true);
}
// Note that the creation of a new checkpoint on the replica vbucket will be controlled by TAP
// mutation messages from the active vbucket, which contain the checkpoint Ids.
assert(checkpointList.back()->getState() == CHECKPOINT_OPEN);
queue_dirty_t result = checkpointList.back()->queueDirty(qi, this);
if (result == NEW_ITEM) {
++numItems;
}
return result != EXISTING_ITEM;
}
void CheckpointManager::getAllItemsFromCurrentPosition(CheckpointCursor &cursor,
uint64_t barrier,
std::vector<queued_item> &items) {
while (true) {
if ( barrier > 0 ) {
if ((*(cursor.currentCheckpoint))->getId() >= barrier) {
break;
}
}
while (++(cursor.currentPos) != (*(cursor.currentCheckpoint))->end()) {
items.push_back(*(cursor.currentPos));
}
if ((*(cursor.currentCheckpoint))->getState() == CHECKPOINT_CLOSED) {
if (!moveCursorToNextCheckpoint(cursor)) {
--(cursor.currentPos);
break;
}
} else { // The cursor is currently in the open checkpoint and reached to
// the end() of the open checkpoint.
--(cursor.currentPos);
break;
}
}
}
void CheckpointManager::getAllItemsForPersistence(std::vector<queued_item> &items) {
LockHolder lh(queueLock);
// Get all the items up to the end of the current open checkpoint.
getAllItemsFromCurrentPosition(persistenceCursor, 0, items);
persistenceCursor.offset = numItems;
pCursorPreCheckpointId = getLastClosedCheckpointId_UNLOCKED();
LOG(EXTENSION_LOG_DEBUG,
"Grab %ld items through the persistence cursor from vbucket %d",
items.size(), vbucketId);
}
void CheckpointManager::getAllItemsForTAPConnection(const std::string &name,
std::vector<queued_item> &items) {
LockHolder lh(queueLock);
std::map<const std::string, CheckpointCursor>::iterator it = tapCursors.find(name);
if (it == tapCursors.end()) {
LOG(EXTENSION_LOG_DEBUG,
"The cursor for TAP connection \"%s\" is not found in the checkpoint",
name.c_str());
return;
}
getAllItemsFromCurrentPosition(it->second, 0, items);
it->second.offset = numItems;
LOG(EXTENSION_LOG_DEBUG,
"Grab %ld items through the tap cursor with name \"%s\" from vbucket %d",
items.size(), name.c_str(), vbucketId);
}
queued_item CheckpointManager::nextItem(const std::string &name, bool &isLastMutationItem) {
LockHolder lh(queueLock);
isLastMutationItem = false;
std::map<const std::string, CheckpointCursor>::iterator it = tapCursors.find(name);
if (it == tapCursors.end()) {
LOG(EXTENSION_LOG_WARNING, "The cursor with name \"%s\" is not found in"
" the checkpoint of vbucket %d.\n", name.c_str(), vbucketId);
queued_item qi(new QueuedItem("", 0xffff, queue_op_empty));
return qi;
}
if (checkpointList.back()->getId() == 0) {
LOG(EXTENSION_LOG_INFO,
"VBucket %d is still in backfill phase that doesn't allow "
" the tap cursor to fetch an item from it's current checkpoint",
vbucketId);
queued_item qi(new QueuedItem("", 0xffff, queue_op_empty));
return qi;
}
CheckpointCursor &cursor = it->second;
if ((*(it->second.currentCheckpoint))->getState() == CHECKPOINT_CLOSED) {
return nextItemFromClosedCheckpoint(cursor, isLastMutationItem);
} else {
return nextItemFromOpenCheckpoint(cursor, isLastMutationItem);
}
}
queued_item CheckpointManager::nextItemFromClosedCheckpoint(CheckpointCursor &cursor,
bool &isLastMutationItem) {
// The cursor already reached to the beginning of the checkpoint that had "open" state
// when registered. Simply return an empty item so that the corresponding TAP client
// can close the connection.
if (cursor.closedCheckpointOnly &&
cursor.openChkIdAtRegistration <= (*(cursor.currentCheckpoint))->getId()) {
queued_item qi(new QueuedItem("", vbucketId, queue_op_empty));
return qi;
}
++(cursor.currentPos);
if (cursor.currentPos != (*(cursor.currentCheckpoint))->end()) {
++(cursor.offset);
isLastMutationItem = isLastMutationItemInCheckpoint(cursor);
return *(cursor.currentPos);
} else {
if (!moveCursorToNextCheckpoint(cursor)) {
--(cursor.currentPos);
queued_item qi(new QueuedItem("", 0xffff, queue_op_empty));
return qi;
}
if ((*(cursor.currentCheckpoint))->getState() == CHECKPOINT_CLOSED) {
++(cursor.currentPos); // Move the cursor to point to the actual first item.
++(cursor.offset);
isLastMutationItem = isLastMutationItemInCheckpoint(cursor);
return *(cursor.currentPos);
} else { // the open checkpoint.
return nextItemFromOpenCheckpoint(cursor, isLastMutationItem);
}
}
}
queued_item CheckpointManager::nextItemFromOpenCheckpoint(CheckpointCursor &cursor,
bool &isLastMutationItem) {
if (cursor.closedCheckpointOnly) {
queued_item qi(new QueuedItem("", vbucketId, queue_op_empty));
return qi;
}
++(cursor.currentPos);
if (cursor.currentPos != (*(cursor.currentCheckpoint))->end()) {
++(cursor.offset);
isLastMutationItem = isLastMutationItemInCheckpoint(cursor);
return *(cursor.currentPos);
} else {
--(cursor.currentPos);
queued_item qi(new QueuedItem("", 0xffff, queue_op_empty));
return qi;
}
}
void CheckpointManager::clear(vbucket_state_t vbState) {
LockHolder lh(queueLock);
std::list<Checkpoint*>::iterator it = checkpointList.begin();
// Remove all the checkpoints.
while(it != checkpointList.end()) {
delete *it;
++it;
}
checkpointList.clear();
numItems = 0;
mutationCounter = 0;
uint64_t checkpointId = vbState == vbucket_state_active ? 1 : 0;
// Add a new open checkpoint.
addNewCheckpoint_UNLOCKED(checkpointId);
resetCursors();
}
void CheckpointManager::resetCursors(bool resetPersistenceCursor) {
// Reset the persistence cursor.
if (resetPersistenceCursor) {
persistenceCursor.currentCheckpoint = checkpointList.begin();
persistenceCursor.currentPos = checkpointList.front()->begin();
persistenceCursor.offset = 0;
checkpointList.front()->registerCursorName(persistenceCursor.name);
}
// Reset all the TAP cursors.
std::map<const std::string, CheckpointCursor>::iterator cit = tapCursors.begin();
for (; cit != tapCursors.end(); ++cit) {
cit->second.currentCheckpoint = checkpointList.begin();
cit->second.currentPos = checkpointList.front()->begin();
cit->second.offset = 0;
checkpointList.front()->registerCursorName(cit->second.name);
}
}
void CheckpointManager::resetTAPCursors(const std::list<std::string> &cursors) {
LockHolder lh(queueLock);
std::list<std::string>::const_iterator it = cursors.begin();
for (; it != cursors.end(); ++it) {
registerTAPCursor_UNLOCKED(*it, getOpenCheckpointId_UNLOCKED(), false, true);
}
}
bool CheckpointManager::moveCursorToNextCheckpoint(CheckpointCursor &cursor) {
if ((*(cursor.currentCheckpoint))->getState() == CHECKPOINT_OPEN) {
return false;
} else if ((*(cursor.currentCheckpoint))->getState() == CHECKPOINT_CLOSED) {
std::list<Checkpoint*>::iterator currCheckpoint = cursor.currentCheckpoint;
if (++currCheckpoint == checkpointList.end()) {
return false;
}
}
// Remove the cursor's name from its current checkpoint.
(*(cursor.currentCheckpoint))->removeCursorName(cursor.name);
// Move the cursor to the next checkpoint.
++(cursor.currentCheckpoint);
cursor.currentPos = (*(cursor.currentCheckpoint))->begin();
// Register the cursor's name to its new current checkpoint.
(*(cursor.currentCheckpoint))->registerCursorName(cursor.name);
return true;
}
size_t CheckpointManager::getNumOpenChkItems() {
LockHolder lh(queueLock);
if (checkpointList.empty()) {
return 0;
}
return checkpointList.back()->getNumItems();
}
uint64_t CheckpointManager::checkOpenCheckpoint_UNLOCKED(bool forceCreation, bool timeBound) {
int checkpoint_id = 0;
if (checkpointExtension) {
return checkpoint_id;
}
timeBound = timeBound &&
(ep_real_time() - checkpointList.back()->getCreationTime()) >=
checkpointConfig.getCheckpointPeriod();
// Create the new open checkpoint if any of the following conditions is satisfied:
// (1) force creation due to online update or high memory usage
// (2) current checkpoint is reached to the max number of items allowed.
// (3) time elapsed since the creation of the current checkpoint is greater than the threshold
if (forceCreation ||
(checkpointConfig.isItemNumBasedNewCheckpoint() &&
checkpointList.back()->getNumItems() >= checkpointConfig.getCheckpointMaxItems()) ||
(checkpointList.back()->getNumItems() > 0 && timeBound)) {
checkpoint_id = checkpointList.back()->getId();
closeOpenCheckpoint_UNLOCKED(checkpoint_id);
addNewCheckpoint_UNLOCKED(checkpoint_id + 1);
}
return checkpoint_id;
}
bool CheckpointManager::eligibleForEviction(const std::string &key) {
LockHolder lh(queueLock);
uint64_t smallest_mid;
// Get the mutation id of the item pointed by the slowest cursor.
// This won't cause much overhead as the number of cursors per vbucket is
// usually bounded to 3 (persistence cursor + 2 replicas).
const std::string &pkey = (*(persistenceCursor.currentPos))->getKey();
smallest_mid = (*(persistenceCursor.currentCheckpoint))->getMutationIdForKey(pkey);
std::map<const std::string, CheckpointCursor>::iterator mit = tapCursors.begin();
for (; mit != tapCursors.end(); ++mit) {
const std::string &tkey = (*(mit->second.currentPos))->getKey();
uint64_t mid = (*(mit->second.currentCheckpoint))->getMutationIdForKey(tkey);
if (mid < smallest_mid) {
smallest_mid = mid;
}
}
bool can_evict = true;
std::list<Checkpoint*>::reverse_iterator it = checkpointList.rbegin();
for (; it != checkpointList.rend(); ++it) {
uint64_t mid = (*it)->getMutationIdForKey(key);
if (mid == 0) { // key doesn't exist in a checkpoint.
continue;
}
if (smallest_mid < mid) { // The slowest cursor is still sitting behind a given key.
can_evict = false;
break;
}
}
return can_evict;
}
size_t CheckpointManager::getNumItemsForTAPConnection(const std::string &name) {
LockHolder lh(queueLock);
size_t remains = 0;
std::map<const std::string, CheckpointCursor>::iterator it = tapCursors.find(name);
if (it != tapCursors.end()) {
remains = (numItems >= it->second.offset) ? numItems - it->second.offset : 0;
}
return remains;
}
void CheckpointManager::decrTapCursorFromCheckpointEnd(const std::string &name) {
LockHolder lh(queueLock);
std::map<const std::string, CheckpointCursor>::iterator it = tapCursors.find(name);
if (it != tapCursors.end() &&
(*(it->second.currentPos))->getOperation() == queue_op_checkpoint_end) {
decrCursorOffset_UNLOCKED(it->second, 1);
decrCursorPos_UNLOCKED(it->second);
}
}
uint64_t CheckpointManager::getMutationIdForKey(uint64_t chk_id, std::string key) {
std::list<Checkpoint*>::iterator itr = checkpointList.begin();
for (; itr != checkpointList.end(); ++itr) {
if (chk_id == (*itr)->getId()) {
return (*itr)->getMutationIdForKey(key);
}
}
return 0;
}
bool CheckpointManager::isLastMutationItemInCheckpoint(CheckpointCursor &cursor) {
std::list<queued_item>::iterator it = cursor.currentPos;
++it;
if (it == (*(cursor.currentCheckpoint))->end() ||
(*it)->getOperation() == queue_op_checkpoint_end) {
return true;
}
return false;
}
void CheckpointManager::checkAndAddNewCheckpoint(uint64_t id) {
LockHolder lh(queueLock);
// Ignore CHECKPOINT_START message with ID 0 as 0 is reserved for representing backfill.
if (id == 0) {
return;
}
// If the replica receives a checkpoint start message right after backfill completion,
// simply set the current open checkpoint id to the one received from the active vbucket.
if (checkpointList.back()->getId() == 0) {
setOpenCheckpointId_UNLOCKED(id);
resetCursors(false);
return;
}
std::list<Checkpoint*>::iterator it = checkpointList.begin();
// Check if a checkpoint exists with ID >= id.
while (it != checkpointList.end()) {
if (id <= (*it)->getId()) {
break;
}
++it;
}
if (it == checkpointList.end()) {
if ((checkpointList.back()->getId() + 1) < id) {
isCollapsedCheckpoint = true;
uint64_t oid = getOpenCheckpointId_UNLOCKED();
lastClosedCheckpointId = oid > 0 ? (oid - 1) : 0;
} else if ((checkpointList.back()->getId() + 1) == id) {
isCollapsedCheckpoint = false;
}
if (checkpointList.back()->getState() == CHECKPOINT_OPEN &&
checkpointList.back()->getNumItems() == 0) {
// If the current open checkpoint doesn't have any items, simply set its id to
// the one from the master node.
setOpenCheckpointId_UNLOCKED(id);
// Reposition all the cursors in the open checkpoint to the begining position
// so that a checkpoint_start message can be sent again with the correct id.
const std::set<std::string> &cursors = checkpointList.back()->getCursorNameList();
std::set<std::string>::const_iterator cit = cursors.begin();
for (; cit != cursors.end(); ++cit) {
if ((*cit).compare(persistenceCursor.name) == 0) { // Persistence cursor
continue;
} else { // TAP cursors
std::map<const std::string, CheckpointCursor>::iterator mit =
tapCursors.find(*cit);
mit->second.currentPos = checkpointList.back()->begin();
}
}
} else {
closeOpenCheckpoint_UNLOCKED(checkpointList.back()->getId());
addNewCheckpoint_UNLOCKED(id);
}
} else {
collapseCheckpoints(id);
}
}
void CheckpointManager::collapseCheckpoints(uint64_t id) {
assert(!checkpointList.empty());
std::map<std::string, uint64_t> cursorMap;
std::map<const std::string, CheckpointCursor>::iterator itr;
for (itr = tapCursors.begin(); itr != tapCursors.end(); itr++) {
Checkpoint* chk = *(itr->second.currentCheckpoint);
const std::string& key = (*(itr->second.currentPos))->getKey();
cursorMap[itr->first.c_str()] = chk->getMutationIdForKey(key);
}
Checkpoint* chk = *(persistenceCursor.currentCheckpoint);
std::string key = (*(persistenceCursor.currentPos))->getKey();
cursorMap[persistenceCursor.name.c_str()] = chk->getMutationIdForKey(key);
std::list<Checkpoint*>::reverse_iterator rit = checkpointList.rbegin();
++rit; // Move to the last closed checkpoint.
size_t numDuplicatedItems = 0, numMetaItems = 0;
// Collapse all checkpoints.
for (; rit != checkpointList.rend(); ++rit) {
size_t numAddedItems = checkpointList.back()->mergePrevCheckpoint(*rit);
numDuplicatedItems += ((*rit)->getNumItems() - numAddedItems);
numMetaItems += 2; // checkpoint start and end meta items
delete *rit;
}
numItems -= (numDuplicatedItems + numMetaItems);
if (checkpointList.size() > 1) {
checkpointList.erase(checkpointList.begin(), --checkpointList.end());
}
assert(checkpointList.size() == 1);
if (checkpointList.back()->getState() == CHECKPOINT_CLOSED) {
checkpointList.back()->popBackCheckpointEndItem();
--numItems;
checkpointList.back()->setState(CHECKPOINT_OPEN);
}
setOpenCheckpointId_UNLOCKED(id);
putCursorsInChk(cursorMap, checkpointList.begin());
}
void CheckpointManager::putCursorsInChk(std::map<std::string, uint64_t> &cursors,
std::list<Checkpoint*>::iterator chkItr) {
int i;
Checkpoint *chk = *chkItr;
std::list<queued_item>::iterator cit = chk->begin();
std::list<queued_item>::iterator last = chk->begin();
for (i = 0; cit != chk->end(); ++i, ++cit) {
uint64_t id = chk->getMutationIdForKey((*cit)->getKey());
std::map<std::string, uint64_t>::iterator mit = cursors.begin();
while (mit != cursors.end()) {
if (mit->second < id) {
if (mit->first.compare(persistenceCursor.name) == 0) {
persistenceCursor.currentCheckpoint = chkItr;
persistenceCursor.currentPos = last;
persistenceCursor.offset = (i > 0) ? i - 1 : 0;
chk->registerCursorName(persistenceCursor.name);
} else {
std::map<const std::string, CheckpointCursor>::iterator cc =
tapCursors.find(mit->first);
cc->second.currentCheckpoint = chkItr;
cc->second.currentPos = last;
cc->second.offset = (i > 0) ? i - 1 : 0;
chk->registerCursorName(cc->second.name);
}
cursors.erase(mit);
break;
}
++mit;
}
last = cit;
}
std::map<std::string, uint64_t>::iterator mit = cursors.begin();
for (; mit != cursors.end(); ++mit) {
if (mit->first.compare(persistenceCursor.name) == 0) {
persistenceCursor.currentCheckpoint = chkItr;
persistenceCursor.currentPos = last;
persistenceCursor.offset = (i > 0) ? i - 1 : 0;
chk->registerCursorName(persistenceCursor.name);
} else {
std::map<const std::string, CheckpointCursor>::iterator cc =
tapCursors.find(mit->first);
cc->second.currentCheckpoint = chkItr;
cc->second.currentPos = last;
cc->second.offset = (i > 0) ? i - 1 : 0;
chk->registerCursorName(cc->second.name);
}
}
}
bool CheckpointManager::hasNext(const std::string &name) {
LockHolder lh(queueLock);
std::map<const std::string, CheckpointCursor>::iterator it = tapCursors.find(name);
if (it == tapCursors.end() || getOpenCheckpointId_UNLOCKED() == 0) {
return false;
}
bool hasMore = true;
std::list<queued_item>::iterator curr = it->second.currentPos;
++curr;
if (curr == (*(it->second.currentCheckpoint))->end() &&
(*(it->second.currentCheckpoint)) == checkpointList.back()) {
hasMore = false;
}
return hasMore;
}
queued_item CheckpointManager::createCheckpointItem(uint64_t id,
uint16_t vbid,
enum queue_operation checkpoint_op) {
assert(checkpoint_op == queue_op_checkpoint_start || checkpoint_op == queue_op_checkpoint_end);
std::stringstream key;
if (checkpoint_op == queue_op_checkpoint_start) {
key << "checkpoint_start";
} else {
key << "checkpoint_end";
}
queued_item qi(new QueuedItem(key.str(), vbid, checkpoint_op, id));
return qi;
}
bool CheckpointManager::hasNextForPersistence() {
LockHolder lh(queueLock);
bool hasMore = true;
std::list<queued_item>::iterator curr = persistenceCursor.currentPos;
++curr;
if (curr == (*(persistenceCursor.currentCheckpoint))->end() &&
(*(persistenceCursor.currentCheckpoint)) == checkpointList.back()) {
hasMore = false;
}
return hasMore;
}
uint64_t CheckpointManager::createNewCheckpoint() {
LockHolder lh(queueLock);
if (checkpointList.back()->getNumItems() > 0) {
uint64_t chk_id = checkpointList.back()->getId();
closeOpenCheckpoint_UNLOCKED(chk_id);
addNewCheckpoint_UNLOCKED(chk_id + 1);
}
return checkpointList.back()->getId();
}
void CheckpointManager::decrCursorOffset_UNLOCKED(CheckpointCursor &cursor, size_t decr) {
if (cursor.offset >= decr) {
cursor.offset -= decr;
} else {
cursor.offset = 0;
LOG(EXTENSION_LOG_WARNING,
"%s cursor offset is negative. Reset it to 0.",
cursor.name.c_str());
}
}
void CheckpointManager::decrCursorPos_UNLOCKED(CheckpointCursor &cursor) {
if (cursor.currentPos != (*(cursor.currentCheckpoint))->begin()) {
--(cursor.currentPos);
}
}
uint64_t CheckpointManager::getPersistenceCursorPreChkId() {
LockHolder lh(queueLock);
return pCursorPreCheckpointId;
}
void CheckpointConfig::addConfigChangeListener(EventuallyPersistentEngine &engine) {
Configuration &configuration = engine.getConfiguration();
configuration.addValueChangedListener("chk_period",
new CheckpointConfigChangeListener(engine.getCheckpointConfig()));
configuration.addValueChangedListener("chk_max_items",
new CheckpointConfigChangeListener(engine.getCheckpointConfig()));
configuration.addValueChangedListener("max_checkpoints",
new CheckpointConfigChangeListener(engine.getCheckpointConfig()));
configuration.addValueChangedListener("inconsistent_slave_chk",
new CheckpointConfigChangeListener(engine.getCheckpointConfig()));
configuration.addValueChangedListener("item_num_based_new_chk",
new CheckpointConfigChangeListener(engine.getCheckpointConfig()));
configuration.addValueChangedListener("keep_closed_chks",
new CheckpointConfigChangeListener(engine.getCheckpointConfig()));
}
CheckpointConfig::CheckpointConfig(EventuallyPersistentEngine &e) {
Configuration &config = e.getConfiguration();
checkpointPeriod = config.getChkPeriod();
checkpointMaxItems = config.getChkMaxItems();
maxCheckpoints = config.getMaxCheckpoints();
inconsistentSlaveCheckpoint = config.isInconsistentSlaveChk();
itemNumBasedNewCheckpoint = config.isItemNumBasedNewChk();
keepClosedCheckpoints = config.isKeepClosedChks();
}
bool CheckpointConfig::validateCheckpointMaxItemsParam(size_t checkpoint_max_items) {
if (checkpoint_max_items < MIN_CHECKPOINT_ITEMS ||
checkpoint_max_items > MAX_CHECKPOINT_ITEMS) {
std::stringstream ss;
ss << "New checkpoint_max_items param value " << checkpoint_max_items
<< " is not ranged between the min allowed value " << MIN_CHECKPOINT_ITEMS
<< " and max value " << MAX_CHECKPOINT_ITEMS;
LOG(EXTENSION_LOG_WARNING, "%s", ss.str().c_str());
return false;
}
return true;
}
bool CheckpointConfig::validateCheckpointPeriodParam(size_t checkpoint_period) {
if (checkpoint_period < MIN_CHECKPOINT_PERIOD ||
checkpoint_period > MAX_CHECKPOINT_PERIOD) {
std::stringstream ss;
ss << "New checkpoint_period param value " << checkpoint_period
<< " is not ranged between the min allowed value " << MIN_CHECKPOINT_PERIOD
<< " and max value " << MAX_CHECKPOINT_PERIOD;
LOG(EXTENSION_LOG_WARNING, "%s\n", ss.str().c_str());
return false;
}
return true;
}
bool CheckpointConfig::validateMaxCheckpointsParam(size_t max_checkpoints) {
if (max_checkpoints < DEFAULT_MAX_CHECKPOINTS ||
max_checkpoints > MAX_CHECKPOINTS_UPPER_BOUND) {
std::stringstream ss;
ss << "New max_checkpoints param value " << max_checkpoints
<< " is not ranged between the min allowed value " << DEFAULT_MAX_CHECKPOINTS
<< " and max value " << MAX_CHECKPOINTS_UPPER_BOUND;
LOG(EXTENSION_LOG_WARNING, "%s\n", ss.str().c_str());
return false;
}
return true;
}
void CheckpointConfig::setCheckpointPeriod(size_t value) {
if (!validateCheckpointPeriodParam(value)) {
value = DEFAULT_CHECKPOINT_PERIOD;
}
checkpointPeriod = static_cast<rel_time_t>(value);
}
void CheckpointConfig::setCheckpointMaxItems(size_t value) {
if (!validateCheckpointMaxItemsParam(value)) {
value = DEFAULT_CHECKPOINT_ITEMS;
}
checkpointMaxItems = value;
}
void CheckpointConfig::setMaxCheckpoints(size_t value) {
if (!validateMaxCheckpointsParam(value)) {
value = DEFAULT_MAX_CHECKPOINTS;
}
maxCheckpoints = value;
}
void CheckpointManager::addStats(ADD_STAT add_stat, const void *cookie) {
LockHolder lh(queueLock);
char buf[256];
snprintf(buf, sizeof(buf), "vb_%d:open_checkpoint_id", vbucketId);
add_casted_stat(buf, getOpenCheckpointId_UNLOCKED(), add_stat, cookie);
snprintf(buf, sizeof(buf), "vb_%d:last_closed_checkpoint_id", vbucketId);
add_casted_stat(buf, getLastClosedCheckpointId_UNLOCKED(), add_stat, cookie);
snprintf(buf, sizeof(buf), "vb_%d:num_tap_cursors", vbucketId);
add_casted_stat(buf, tapCursors.size(), add_stat, cookie);
snprintf(buf, sizeof(buf), "vb_%d:num_checkpoint_items", vbucketId);
add_casted_stat(buf, numItems, add_stat, cookie);
snprintf(buf, sizeof(buf), "vb_%d:num_open_checkpoint_items", vbucketId);
add_casted_stat(buf, checkpointList.empty() ? 0 : checkpointList.back()->getNumItems(),
add_stat, cookie);
snprintf(buf, sizeof(buf), "vb_%d:num_checkpoints", vbucketId);
add_casted_stat(buf, checkpointList.size(), add_stat, cookie);
snprintf(buf, sizeof(buf), "vb_%d:num_items_for_persistence", vbucketId);
add_casted_stat(buf, getNumItemsForPersistence_UNLOCKED(), add_stat, cookie);
snprintf(buf, sizeof(buf), "vb_%d:checkpoint_extension", vbucketId);
add_casted_stat(buf, isCheckpointExtension() ? "true" : "false",
add_stat, cookie);
std::map<const std::string, CheckpointCursor>::iterator tap_it = tapCursors.begin();
for (; tap_it != tapCursors.end(); ++tap_it) {
snprintf(buf, sizeof(buf),
"vb_%d:%s:cursor_checkpoint_id", vbucketId, tap_it->first.c_str());
add_casted_stat(buf, (*(tap_it->second.currentCheckpoint))->getId(),
add_stat, cookie);
}
}
| {
"content_hash": "a744cf0913cf99771f98de23d690c012",
"timestamp": "",
"source": "github",
"line_count": 1389,
"max_line_length": 100,
"avg_line_length": 41.31317494600432,
"alnum_prop": 0.6267077931130629,
"repo_name": "abhinavdangeti/ep-engine",
"id": "cefe53ce1052f86ace6777a3d8292b80679ac049",
"size": "57384",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/checkpoint.cc",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "155701"
},
{
"name": "C++",
"bytes": "1381062"
},
{
"name": "D",
"bytes": "2990"
},
{
"name": "Perl",
"bytes": "1498"
},
{
"name": "Python",
"bytes": "83763"
},
{
"name": "Shell",
"bytes": "9577"
}
],
"symlink_target": ""
} |
import { reduxForm } from 'redux-form/immutable';
import ItemForm from 'components/ItemForm';
export default reduxForm({
form: 'newItemForm',
})(ItemForm);
| {
"content_hash": "ce39f457be6a8a3376d5b88784994fb2",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 49,
"avg_line_length": 22.857142857142858,
"alnum_prop": 0.7375,
"repo_name": "dmitrykrylov/my-test-store",
"id": "efb494f6b48e9cf56e61b8fccd1582c00da51053",
"size": "160",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/containers/HomePage/NewItemForm.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "1787"
},
{
"name": "HTML",
"bytes": "9574"
},
{
"name": "JavaScript",
"bytes": "88700"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>FileSystem class - polymer_app_layout library - Dart API</title>
<!-- required because all the links are pseudo-absolute -->
<base href="..">
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro|Roboto:500,400italic,300,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="static-assets/prettify.css">
<link rel="stylesheet" href="static-assets/css/bootstrap.min.css">
<link rel="stylesheet" href="static-assets/styles.css">
<meta name="description" content="API docs for the FileSystem class from the polymer_app_layout library, for the Dart programming language.">
<link rel="icon" href="static-assets/favicon.png">
<!-- Do not remove placeholder -->
<!-- Header Placeholder -->
</head>
<body>
<div id="overlay-under-drawer"></div>
<header class="container-fluid" id="title">
<nav class="navbar navbar-fixed-top">
<div class="container">
<button id="sidenav-left-toggle" type="button"> </button>
<ol class="breadcrumbs gt-separated hidden-xs">
<li><a href="index.html">polymer_app_layout_template</a></li>
<li><a href="polymer_app_layout/polymer_app_layout-library.html">polymer_app_layout</a></li>
<li class="self-crumb">FileSystem</li>
</ol>
<div class="self-name">FileSystem</div>
</div>
</nav>
<div class="container masthead">
<ol class="breadcrumbs gt-separated visible-xs">
<li><a href="index.html">polymer_app_layout_template</a></li>
<li><a href="polymer_app_layout/polymer_app_layout-library.html">polymer_app_layout</a></li>
<li class="self-crumb">FileSystem</li>
</ol>
<div class="title-description">
<h1 class="title">
<div class="kind">class</div> FileSystem
</h1>
<!-- p class="subtitle">
</p -->
</div>
<ul class="subnav">
<li><a href="polymer_app_layout/FileSystem-class.html#static-properties">Static Properties</a></li>
<li><a href="polymer_app_layout/FileSystem-class.html#instance-properties">Properties</a></li>
</ul>
</div>
</header>
<div class="container body">
<div class="col-xs-6 col-sm-3 col-md-3 sidebar sidebar-offcanvas-left">
<h5><a href="index.html">polymer_app_layout_template</a></h5>
<h5><a href="polymer_app_layout/polymer_app_layout-library.html">polymer_app_layout</a></h5>
<ol>
<li class="section-title"><a href="polymer_app_layout/polymer_app_layout-library.html#typedefs">Typedefs</a></li>
<li><a href="polymer_app_layout/DatabaseCallback.html">DatabaseCallback</a></li>
<li><a href="polymer_app_layout/EventListener.html">EventListener</a></li>
<li><a href="polymer_app_layout/FontFaceSetForEachCallback.html">FontFaceSetForEachCallback</a></li>
<li><a href="polymer_app_layout/HeadersForEachCallback.html">HeadersForEachCallback</a></li>
<li><a href="polymer_app_layout/MediaDeviceInfoCallback.html">MediaDeviceInfoCallback</a></li>
<li><a href="polymer_app_layout/MediaStreamTrackSourcesCallback.html">MediaStreamTrackSourcesCallback</a></li>
<li><a href="polymer_app_layout/MetadataCallback.html">MetadataCallback</a></li>
<li><a href="polymer_app_layout/MidiErrorCallback.html">MidiErrorCallback</a></li>
<li><a href="polymer_app_layout/MidiSuccessCallback.html">MidiSuccessCallback</a></li>
<li><a href="polymer_app_layout/MutationCallback.html">MutationCallback</a></li>
<li><a href="polymer_app_layout/RequestAnimationFrameCallback.html">RequestAnimationFrameCallback</a></li>
<li><a href="polymer_app_layout/RtcStatsCallback.html">RtcStatsCallback</a></li>
<li><a href="polymer_app_layout/StorageErrorCallback.html">StorageErrorCallback</a></li>
<li><a href="polymer_app_layout/StorageQuotaCallback.html">StorageQuotaCallback</a></li>
<li><a href="polymer_app_layout/StorageUsageCallback.html">StorageUsageCallback</a></li>
<li><a href="polymer_app_layout/TimeoutHandler.html">TimeoutHandler</a></li>
<li><a href="polymer_app_layout/VoidCallback.html">VoidCallback</a></li>
<li class="section-title"><a href="polymer_app_layout/polymer_app_layout-library.html#properties">Properties</a></li>
<li><a href="polymer_app_layout/document.html">document</a></li>
<li><a href="polymer_app_layout/htmlBlinkMap.html">htmlBlinkMap</a></li>
<li><a href="polymer_app_layout/window.html">window</a></li>
<li class="section-title"><a href="polymer_app_layout/polymer_app_layout-library.html#functions">Functions</a></li>
<li><a href="polymer_app_layout/make_dart_rectangle.html">make_dart_rectangle</a></li>
<li><a href="polymer_app_layout/query.html">query</a></li>
<li><a href="polymer_app_layout/queryAll.html">queryAll</a></li>
<li><a href="polymer_app_layout/querySelector.html">querySelector</a></li>
<li><a href="polymer_app_layout/querySelectorAll.html">querySelectorAll</a></li>
<li><a href="polymer_app_layout/spawnDomUri.html">spawnDomUri</a></li>
<li><a href="polymer_app_layout/unwrap_jso.html">unwrap_jso</a></li>
<li><a href="polymer_app_layout/wrap_jso.html">wrap_jso</a></li>
<li><a href="polymer_app_layout/wrap_jso_list.html">wrap_jso_list</a></li>
<li class="section-title"><a href="polymer_app_layout/polymer_app_layout-library.html#classes">Classes</a></li>
<li><a href="polymer_app_layout/AbstractWorker-class.html">AbstractWorker</a></li>
<li><a href="polymer_app_layout/AnchorElement-class.html">AnchorElement</a></li>
<li><a href="polymer_app_layout/Animation-class.html">Animation</a></li>
<li><a href="polymer_app_layout/AnimationEffect-class.html">AnimationEffect</a></li>
<li><a href="polymer_app_layout/AnimationEvent-class.html">AnimationEvent</a></li>
<li><a href="polymer_app_layout/AnimationNode-class.html">AnimationNode</a></li>
<li><a href="polymer_app_layout/AnimationPlayer-class.html">AnimationPlayer</a></li>
<li><a href="polymer_app_layout/AnimationPlayerEvent-class.html">AnimationPlayerEvent</a></li>
<li><a href="polymer_app_layout/AnimationTimeline-class.html">AnimationTimeline</a></li>
<li><a href="polymer_app_layout/ApplicationCache-class.html">ApplicationCache</a></li>
<li><a href="polymer_app_layout/ApplicationCacheErrorEvent-class.html">ApplicationCacheErrorEvent</a></li>
<li><a href="polymer_app_layout/AppPage-class.html">AppPage</a></li>
<li><a href="polymer_app_layout/AreaElement-class.html">AreaElement</a></li>
<li><a href="polymer_app_layout/AudioElement-class.html">AudioElement</a></li>
<li><a href="polymer_app_layout/AudioTrack-class.html">AudioTrack</a></li>
<li><a href="polymer_app_layout/AudioTrackList-class.html">AudioTrackList</a></li>
<li><a href="polymer_app_layout/AutocompleteErrorEvent-class.html">AutocompleteErrorEvent</a></li>
<li><a href="polymer_app_layout/BarProp-class.html">BarProp</a></li>
<li><a href="polymer_app_layout/BaseElement-class.html">BaseElement</a></li>
<li><a href="polymer_app_layout/BatteryManager-class.html">BatteryManager</a></li>
<li><a href="polymer_app_layout/BeforeUnloadEvent-class.html">BeforeUnloadEvent</a></li>
<li><a href="polymer_app_layout/Blob-class.html">Blob</a></li>
<li><a href="polymer_app_layout/Body-class.html">Body</a></li>
<li><a href="polymer_app_layout/BodyElement-class.html">BodyElement</a></li>
<li><a href="polymer_app_layout/BRElement-class.html">BRElement</a></li>
<li><a href="polymer_app_layout/ButtonElement-class.html">ButtonElement</a></li>
<li><a href="polymer_app_layout/ButtonInputElement-class.html">ButtonInputElement</a></li>
<li><a href="polymer_app_layout/CacheStorage-class.html">CacheStorage</a></li>
<li><a href="polymer_app_layout/Canvas2DContextAttributes-class.html">Canvas2DContextAttributes</a></li>
<li><a href="polymer_app_layout/CanvasElement-class.html">CanvasElement</a></li>
<li><a href="polymer_app_layout/CanvasGradient-class.html">CanvasGradient</a></li>
<li><a href="polymer_app_layout/CanvasImageSource-class.html">CanvasImageSource</a></li>
<li><a href="polymer_app_layout/CanvasPattern-class.html">CanvasPattern</a></li>
<li><a href="polymer_app_layout/CanvasRenderingContext-class.html">CanvasRenderingContext</a></li>
<li><a href="polymer_app_layout/CanvasRenderingContext2D-class.html">CanvasRenderingContext2D</a></li>
<li><a href="polymer_app_layout/CDataSection-class.html">CDataSection</a></li>
<li><a href="polymer_app_layout/CharacterData-class.html">CharacterData</a></li>
<li><a href="polymer_app_layout/CheckboxInputElement-class.html">CheckboxInputElement</a></li>
<li><a href="polymer_app_layout/ChildNode-class.html">ChildNode</a></li>
<li><a href="polymer_app_layout/CircularGeofencingRegion-class.html">CircularGeofencingRegion</a></li>
<li><a href="polymer_app_layout/CloseEvent-class.html">CloseEvent</a></li>
<li><a href="polymer_app_layout/Comment-class.html">Comment</a></li>
<li><a href="polymer_app_layout/CompositionEvent-class.html">CompositionEvent</a></li>
<li><a href="polymer_app_layout/Console-class.html">Console</a></li>
<li><a href="polymer_app_layout/ConsoleBase-class.html">ConsoleBase</a></li>
<li><a href="polymer_app_layout/ContentElement-class.html">ContentElement</a></li>
<li><a href="polymer_app_layout/Coordinates-class.html">Coordinates</a></li>
<li><a href="polymer_app_layout/Credential-class.html">Credential</a></li>
<li><a href="polymer_app_layout/CredentialsContainer-class.html">CredentialsContainer</a></li>
<li><a href="polymer_app_layout/Crypto-class.html">Crypto</a></li>
<li><a href="polymer_app_layout/CryptoKey-class.html">CryptoKey</a></li>
<li><a href="polymer_app_layout/Css-class.html">Css</a></li>
<li><a href="polymer_app_layout/CssCharsetRule-class.html">CssCharsetRule</a></li>
<li><a href="polymer_app_layout/CssClassSet-class.html">CssClassSet</a></li>
<li><a href="polymer_app_layout/CssFilterRule-class.html">CssFilterRule</a></li>
<li><a href="polymer_app_layout/CssFontFaceRule-class.html">CssFontFaceRule</a></li>
<li><a href="polymer_app_layout/CssImportRule-class.html">CssImportRule</a></li>
<li><a href="polymer_app_layout/CssKeyframeRule-class.html">CssKeyframeRule</a></li>
<li><a href="polymer_app_layout/CssKeyframesRule-class.html">CssKeyframesRule</a></li>
<li><a href="polymer_app_layout/CssMediaRule-class.html">CssMediaRule</a></li>
<li><a href="polymer_app_layout/CssPageRule-class.html">CssPageRule</a></li>
<li><a href="polymer_app_layout/CssRect-class.html">CssRect</a></li>
<li><a href="polymer_app_layout/CssRule-class.html">CssRule</a></li>
<li><a href="polymer_app_layout/CssStyleDeclaration-class.html">CssStyleDeclaration</a></li>
<li><a href="polymer_app_layout/CssStyleDeclarationBase-class.html">CssStyleDeclarationBase</a></li>
<li><a href="polymer_app_layout/CssStyleRule-class.html">CssStyleRule</a></li>
<li><a href="polymer_app_layout/CssStyleSheet-class.html">CssStyleSheet</a></li>
<li><a href="polymer_app_layout/CssSupportsRule-class.html">CssSupportsRule</a></li>
<li><a href="polymer_app_layout/CssViewportRule-class.html">CssViewportRule</a></li>
<li><a href="polymer_app_layout/CustomEvent-class.html">CustomEvent</a></li>
<li><a href="polymer_app_layout/CustomStream-class.html">CustomStream</a></li>
<li><a href="polymer_app_layout/DataListElement-class.html">DataListElement</a></li>
<li><a href="polymer_app_layout/DataTransfer-class.html">DataTransfer</a></li>
<li><a href="polymer_app_layout/DataTransferItem-class.html">DataTransferItem</a></li>
<li><a href="polymer_app_layout/DataTransferItemList-class.html">DataTransferItemList</a></li>
<li><a href="polymer_app_layout/DateInputElement-class.html">DateInputElement</a></li>
<li><a href="polymer_app_layout/DedicatedWorkerGlobalScope-class.html">DedicatedWorkerGlobalScope</a></li>
<li><a href="polymer_app_layout/DeprecatedStorageInfo-class.html">DeprecatedStorageInfo</a></li>
<li><a href="polymer_app_layout/DeprecatedStorageQuota-class.html">DeprecatedStorageQuota</a></li>
<li><a href="polymer_app_layout/DetailsElement-class.html">DetailsElement</a></li>
<li><a href="polymer_app_layout/DeviceAcceleration-class.html">DeviceAcceleration</a></li>
<li><a href="polymer_app_layout/DeviceLightEvent-class.html">DeviceLightEvent</a></li>
<li><a href="polymer_app_layout/DeviceMotionEvent-class.html">DeviceMotionEvent</a></li>
<li><a href="polymer_app_layout/DeviceOrientationEvent-class.html">DeviceOrientationEvent</a></li>
<li><a href="polymer_app_layout/DeviceRotationRate-class.html">DeviceRotationRate</a></li>
<li><a href="polymer_app_layout/DialogElement-class.html">DialogElement</a></li>
<li><a href="polymer_app_layout/Dimension-class.html">Dimension</a></li>
<li><a href="polymer_app_layout/DirectoryEntry-class.html">DirectoryEntry</a></li>
<li><a href="polymer_app_layout/DirectoryReader-class.html">DirectoryReader</a></li>
<li><a href="polymer_app_layout/DivElement-class.html">DivElement</a></li>
<li><a href="polymer_app_layout/DListElement-class.html">DListElement</a></li>
<li><a href="polymer_app_layout/Document-class.html">Document</a></li>
<li><a href="polymer_app_layout/DocumentFragment-class.html">DocumentFragment</a></li>
<li><a href="polymer_app_layout/DomError-class.html">DomError</a></li>
<li><a href="polymer_app_layout/DomException-class.html">DomException</a></li>
<li><a href="polymer_app_layout/DomImplementation-class.html">DomImplementation</a></li>
<li><a href="polymer_app_layout/DomIterator-class.html">DomIterator</a></li>
<li><a href="polymer_app_layout/DomMatrix-class.html">DomMatrix</a></li>
<li><a href="polymer_app_layout/DomMatrixReadOnly-class.html">DomMatrixReadOnly</a></li>
<li><a href="polymer_app_layout/DomParser-class.html">DomParser</a></li>
<li><a href="polymer_app_layout/DomPoint-class.html">DomPoint</a></li>
<li><a href="polymer_app_layout/DomPointReadOnly-class.html">DomPointReadOnly</a></li>
<li><a href="polymer_app_layout/DomRectReadOnly-class.html">DomRectReadOnly</a></li>
<li><a href="polymer_app_layout/DomSettableTokenList-class.html">DomSettableTokenList</a></li>
<li><a href="polymer_app_layout/DomStringList-class.html">DomStringList</a></li>
<li><a href="polymer_app_layout/DomStringMap-class.html">DomStringMap</a></li>
<li><a href="polymer_app_layout/DomTokenList-class.html">DomTokenList</a></li>
<li><a href="polymer_app_layout/Element-class.html">Element</a></li>
<li><a href="polymer_app_layout/ElementEvents-class.html">ElementEvents</a></li>
<li><a href="polymer_app_layout/ElementList-class.html">ElementList</a></li>
<li><a href="polymer_app_layout/ElementStream-class.html">ElementStream</a></li>
<li><a href="polymer_app_layout/ElementUpgrader-class.html">ElementUpgrader</a></li>
<li><a href="polymer_app_layout/EmailInputElement-class.html">EmailInputElement</a></li>
<li><a href="polymer_app_layout/EmbedElement-class.html">EmbedElement</a></li>
<li><a href="polymer_app_layout/Entry-class.html">Entry</a></li>
<li><a href="polymer_app_layout/ErrorEvent-class.html">ErrorEvent</a></li>
<li><a href="polymer_app_layout/Event-class.html">Event</a></li>
<li><a href="polymer_app_layout/Events-class.html">Events</a></li>
<li><a href="polymer_app_layout/EventSource-class.html">EventSource</a></li>
<li><a href="polymer_app_layout/EventStreamProvider-class.html">EventStreamProvider</a></li>
<li><a href="polymer_app_layout/EventTarget-class.html">EventTarget</a></li>
<li><a href="polymer_app_layout/ExtendableEvent-class.html">ExtendableEvent</a></li>
<li><a href="polymer_app_layout/FederatedCredential-class.html">FederatedCredential</a></li>
<li><a href="polymer_app_layout/FetchEvent-class.html">FetchEvent</a></li>
<li><a href="polymer_app_layout/FieldSetElement-class.html">FieldSetElement</a></li>
<li><a href="polymer_app_layout/File-class.html">File</a></li>
<li><a href="polymer_app_layout/FileEntry-class.html">FileEntry</a></li>
<li><a href="polymer_app_layout/FileError-class.html">FileError</a></li>
<li><a href="polymer_app_layout/FileList-class.html">FileList</a></li>
<li><a href="polymer_app_layout/FileReader-class.html">FileReader</a></li>
<li><a href="polymer_app_layout/FileStream-class.html">FileStream</a></li>
<li><a href="polymer_app_layout/FileSystem-class.html">FileSystem</a></li>
<li><a href="polymer_app_layout/FileUploadInputElement-class.html">FileUploadInputElement</a></li>
<li><a href="polymer_app_layout/FileWriter-class.html">FileWriter</a></li>
<li><a href="polymer_app_layout/FixedSizeListIterator-class.html">FixedSizeListIterator</a></li>
<li><a href="polymer_app_layout/FocusEvent-class.html">FocusEvent</a></li>
<li><a href="polymer_app_layout/FontFace-class.html">FontFace</a></li>
<li><a href="polymer_app_layout/FontFaceSet-class.html">FontFaceSet</a></li>
<li><a href="polymer_app_layout/FontFaceSetLoadEvent-class.html">FontFaceSetLoadEvent</a></li>
<li><a href="polymer_app_layout/FormData-class.html">FormData</a></li>
<li><a href="polymer_app_layout/FormElement-class.html">FormElement</a></li>
<li><a href="polymer_app_layout/Gamepad-class.html">Gamepad</a></li>
<li><a href="polymer_app_layout/GamepadButton-class.html">GamepadButton</a></li>
<li><a href="polymer_app_layout/GamepadEvent-class.html">GamepadEvent</a></li>
<li><a href="polymer_app_layout/Geofencing-class.html">Geofencing</a></li>
<li><a href="polymer_app_layout/GeofencingRegion-class.html">GeofencingRegion</a></li>
<li><a href="polymer_app_layout/Geolocation-class.html">Geolocation</a></li>
<li><a href="polymer_app_layout/Geoposition-class.html">Geoposition</a></li>
<li><a href="polymer_app_layout/GlobalEventHandlers-class.html">GlobalEventHandlers</a></li>
<li><a href="polymer_app_layout/HashChangeEvent-class.html">HashChangeEvent</a></li>
<li><a href="polymer_app_layout/HeadElement-class.html">HeadElement</a></li>
<li><a href="polymer_app_layout/Headers-class.html">Headers</a></li>
<li><a href="polymer_app_layout/HeadingElement-class.html">HeadingElement</a></li>
<li><a href="polymer_app_layout/HiddenInputElement-class.html">HiddenInputElement</a></li>
<li><a href="polymer_app_layout/History-class.html">History</a></li>
<li><a href="polymer_app_layout/HistoryBase-class.html">HistoryBase</a></li>
<li><a href="polymer_app_layout/HRElement-class.html">HRElement</a></li>
<li><a href="polymer_app_layout/HtmlCollection-class.html">HtmlCollection</a></li>
<li><a href="polymer_app_layout/HtmlDocument-class.html">HtmlDocument</a></li>
<li><a href="polymer_app_layout/HtmlElement-class.html">HtmlElement</a></li>
<li><a href="polymer_app_layout/HtmlFormControlsCollection-class.html">HtmlFormControlsCollection</a></li>
<li><a href="polymer_app_layout/HtmlHtmlElement-class.html">HtmlHtmlElement</a></li>
<li><a href="polymer_app_layout/HtmlOptionsCollection-class.html">HtmlOptionsCollection</a></li>
<li><a href="polymer_app_layout/HttpRequest-class.html">HttpRequest</a></li>
<li><a href="polymer_app_layout/HttpRequestEventTarget-class.html">HttpRequestEventTarget</a></li>
<li><a href="polymer_app_layout/HttpRequestUpload-class.html">HttpRequestUpload</a></li>
<li><a href="polymer_app_layout/IconBehavior-class.html">IconBehavior</a></li>
<li><a href="polymer_app_layout/IFrameElement-class.html">IFrameElement</a></li>
<li><a href="polymer_app_layout/ImageBitmap-class.html">ImageBitmap</a></li>
<li><a href="polymer_app_layout/ImageButtonInputElement-class.html">ImageButtonInputElement</a></li>
<li><a href="polymer_app_layout/ImageData-class.html">ImageData</a></li>
<li><a href="polymer_app_layout/ImageElement-class.html">ImageElement</a></li>
<li><a href="polymer_app_layout/ImmutableListMixin-class.html">ImmutableListMixin</a></li>
<li><a href="polymer_app_layout/InjectedScriptHost-class.html">InjectedScriptHost</a></li>
<li><a href="polymer_app_layout/InputElement-class.html">InputElement</a></li>
<li><a href="polymer_app_layout/InputElementBase-class.html">InputElementBase</a></li>
<li><a href="polymer_app_layout/InputMethodContext-class.html">InputMethodContext</a></li>
<li><a href="polymer_app_layout/InstallEvent-class.html">InstallEvent</a></li>
<li><a href="polymer_app_layout/IronIcon-class.html">IronIcon</a></li>
<li><a href="polymer_app_layout/IronMediaQuery-class.html">IronMediaQuery</a></li>
<li><a href="polymer_app_layout/KeyboardEvent-class.html">KeyboardEvent</a></li>
<li><a href="polymer_app_layout/KeyboardEventStream-class.html">KeyboardEventStream</a></li>
<li><a href="polymer_app_layout/KeyCode-class.html">KeyCode</a></li>
<li><a href="polymer_app_layout/KeyEvent-class.html">KeyEvent</a></li>
<li><a href="polymer_app_layout/KeygenElement-class.html">KeygenElement</a></li>
<li><a href="polymer_app_layout/KeyLocation-class.html">KeyLocation</a></li>
<li><a href="polymer_app_layout/LabelElement-class.html">LabelElement</a></li>
<li><a href="polymer_app_layout/LayoutApp-class.html">LayoutApp</a></li>
<li><a href="polymer_app_layout/LayoutListCardOver-class.html">LayoutListCardOver</a></li>
<li><a href="polymer_app_layout/LayoutNavHeader-class.html">LayoutNavHeader</a></li>
<li><a href="polymer_app_layout/LayoutNavView-class.html">LayoutNavView</a></li>
<li><a href="polymer_app_layout/LeftNavBehavior-class.html">LeftNavBehavior</a></li>
<li><a href="polymer_app_layout/LegendElement-class.html">LegendElement</a></li>
<li><a href="polymer_app_layout/LIElement-class.html">LIElement</a></li>
<li><a href="polymer_app_layout/LinkElement-class.html">LinkElement</a></li>
<li><a href="polymer_app_layout/LocalCredential-class.html">LocalCredential</a></li>
<li><a href="polymer_app_layout/LocalDateTimeInputElement-class.html">LocalDateTimeInputElement</a></li>
<li><a href="polymer_app_layout/Location-class.html">Location</a></li>
<li><a href="polymer_app_layout/LocationBase-class.html">LocationBase</a></li>
<li><a href="polymer_app_layout/MapElement-class.html">MapElement</a></li>
<li><a href="polymer_app_layout/MediaController-class.html">MediaController</a></li>
<li><a href="polymer_app_layout/MediaDeviceInfo-class.html">MediaDeviceInfo</a></li>
<li><a href="polymer_app_layout/MediaElement-class.html">MediaElement</a></li>
<li><a href="polymer_app_layout/MediaError-class.html">MediaError</a></li>
<li><a href="polymer_app_layout/MediaKeyError-class.html">MediaKeyError</a></li>
<li><a href="polymer_app_layout/MediaKeyEvent-class.html">MediaKeyEvent</a></li>
<li><a href="polymer_app_layout/MediaKeyMessageEvent-class.html">MediaKeyMessageEvent</a></li>
<li><a href="polymer_app_layout/MediaKeyNeededEvent-class.html">MediaKeyNeededEvent</a></li>
<li><a href="polymer_app_layout/MediaKeys-class.html">MediaKeys</a></li>
<li><a href="polymer_app_layout/MediaKeySession-class.html">MediaKeySession</a></li>
<li><a href="polymer_app_layout/MediaList-class.html">MediaList</a></li>
<li><a href="polymer_app_layout/MediaQueryList-class.html">MediaQueryList</a></li>
<li><a href="polymer_app_layout/MediaQueryListEvent-class.html">MediaQueryListEvent</a></li>
<li><a href="polymer_app_layout/MediaSource-class.html">MediaSource</a></li>
<li><a href="polymer_app_layout/MediaStream-class.html">MediaStream</a></li>
<li><a href="polymer_app_layout/MediaStreamEvent-class.html">MediaStreamEvent</a></li>
<li><a href="polymer_app_layout/MediaStreamTrack-class.html">MediaStreamTrack</a></li>
<li><a href="polymer_app_layout/MediaStreamTrackEvent-class.html">MediaStreamTrackEvent</a></li>
<li><a href="polymer_app_layout/MemoryInfo-class.html">MemoryInfo</a></li>
<li><a href="polymer_app_layout/MenuElement-class.html">MenuElement</a></li>
<li><a href="polymer_app_layout/MenuItemElement-class.html">MenuItemElement</a></li>
<li><a href="polymer_app_layout/MessageChannel-class.html">MessageChannel</a></li>
<li><a href="polymer_app_layout/MessageEvent-class.html">MessageEvent</a></li>
<li><a href="polymer_app_layout/MessagePort-class.html">MessagePort</a></li>
<li><a href="polymer_app_layout/Metadata-class.html">Metadata</a></li>
<li><a href="polymer_app_layout/MetaElement-class.html">MetaElement</a></li>
<li><a href="polymer_app_layout/MeterElement-class.html">MeterElement</a></li>
<li><a href="polymer_app_layout/MidiAccess-class.html">MidiAccess</a></li>
<li><a href="polymer_app_layout/MidiConnectionEvent-class.html">MidiConnectionEvent</a></li>
<li><a href="polymer_app_layout/MidiInput-class.html">MidiInput</a></li>
<li><a href="polymer_app_layout/MidiInputMap-class.html">MidiInputMap</a></li>
<li><a href="polymer_app_layout/MidiMessageEvent-class.html">MidiMessageEvent</a></li>
<li><a href="polymer_app_layout/MidiOutput-class.html">MidiOutput</a></li>
<li><a href="polymer_app_layout/MidiOutputMap-class.html">MidiOutputMap</a></li>
<li><a href="polymer_app_layout/MidiPort-class.html">MidiPort</a></li>
<li><a href="polymer_app_layout/MimeType-class.html">MimeType</a></li>
<li><a href="polymer_app_layout/MimeTypeArray-class.html">MimeTypeArray</a></li>
<li><a href="polymer_app_layout/ModElement-class.html">ModElement</a></li>
<li><a href="polymer_app_layout/MonthInputElement-class.html">MonthInputElement</a></li>
<li><a href="polymer_app_layout/MouseEvent-class.html">MouseEvent</a></li>
<li><a href="polymer_app_layout/MutationObserver-class.html">MutationObserver</a></li>
<li><a href="polymer_app_layout/MutationRecord-class.html">MutationRecord</a></li>
<li><a href="polymer_app_layout/Navigator-class.html">Navigator</a></li>
<li><a href="polymer_app_layout/NavigatorCpu-class.html">NavigatorCpu</a></li>
<li><a href="polymer_app_layout/NavigatorID-class.html">NavigatorID</a></li>
<li><a href="polymer_app_layout/NavigatorLanguage-class.html">NavigatorLanguage</a></li>
<li><a href="polymer_app_layout/NavigatorOnLine-class.html">NavigatorOnLine</a></li>
<li><a href="polymer_app_layout/NavigatorUserMediaError-class.html">NavigatorUserMediaError</a></li>
<li><a href="polymer_app_layout/NeonAnimatedPages-class.html">NeonAnimatedPages</a></li>
<li><a href="polymer_app_layout/NetworkInformation-class.html">NetworkInformation</a></li>
<li><a href="polymer_app_layout/Node-class.html">Node</a></li>
<li><a href="polymer_app_layout/NodeFilter-class.html">NodeFilter</a></li>
<li><a href="polymer_app_layout/NodeIterator-class.html">NodeIterator</a></li>
<li><a href="polymer_app_layout/NodeList-class.html">NodeList</a></li>
<li><a href="polymer_app_layout/NodeTreeSanitizer-class.html">NodeTreeSanitizer</a></li>
<li><a href="polymer_app_layout/NodeValidator-class.html">NodeValidator</a></li>
<li><a href="polymer_app_layout/NodeValidatorBuilder-class.html">NodeValidatorBuilder</a></li>
<li><a href="polymer_app_layout/Notification-class.html">Notification</a></li>
<li><a href="polymer_app_layout/NumberInputElement-class.html">NumberInputElement</a></li>
<li><a href="polymer_app_layout/ObjectElement-class.html">ObjectElement</a></li>
<li><a href="polymer_app_layout/OListElement-class.html">OListElement</a></li>
<li><a href="polymer_app_layout/OptGroupElement-class.html">OptGroupElement</a></li>
<li><a href="polymer_app_layout/OptionElement-class.html">OptionElement</a></li>
<li><a href="polymer_app_layout/OutputElement-class.html">OutputElement</a></li>
<li><a href="polymer_app_layout/OverflowEvent-class.html">OverflowEvent</a></li>
<li><a href="polymer_app_layout/Page-class.html">Page</a></li>
<li><a href="polymer_app_layout/PageTransitionEvent-class.html">PageTransitionEvent</a></li>
<li><a href="polymer_app_layout/PaperDrawerPanel-class.html">PaperDrawerPanel</a></li>
<li><a href="polymer_app_layout/PaperHeaderPanel-class.html">PaperHeaderPanel</a></li>
<li><a href="polymer_app_layout/PaperIconButton-class.html">PaperIconButton</a></li>
<li><a href="polymer_app_layout/PaperItem-class.html">PaperItem</a></li>
<li><a href="polymer_app_layout/PaperMaterial-class.html">PaperMaterial</a></li>
<li><a href="polymer_app_layout/PaperMenu-class.html">PaperMenu</a></li>
<li><a href="polymer_app_layout/PaperTab-class.html">PaperTab</a></li>
<li><a href="polymer_app_layout/PaperTabs-class.html">PaperTabs</a></li>
<li><a href="polymer_app_layout/PaperToolbar-class.html">PaperToolbar</a></li>
<li><a href="polymer_app_layout/ParagraphElement-class.html">ParagraphElement</a></li>
<li><a href="polymer_app_layout/ParamElement-class.html">ParamElement</a></li>
<li><a href="polymer_app_layout/ParentNode-class.html">ParentNode</a></li>
<li><a href="polymer_app_layout/PasswordInputElement-class.html">PasswordInputElement</a></li>
<li><a href="polymer_app_layout/Path2D-class.html">Path2D</a></li>
<li><a href="polymer_app_layout/Performance-class.html">Performance</a></li>
<li><a href="polymer_app_layout/PerformanceEntry-class.html">PerformanceEntry</a></li>
<li><a href="polymer_app_layout/PerformanceMark-class.html">PerformanceMark</a></li>
<li><a href="polymer_app_layout/PerformanceMeasure-class.html">PerformanceMeasure</a></li>
<li><a href="polymer_app_layout/PerformanceNavigation-class.html">PerformanceNavigation</a></li>
<li><a href="polymer_app_layout/PerformanceResourceTiming-class.html">PerformanceResourceTiming</a></li>
<li><a href="polymer_app_layout/PerformanceTiming-class.html">PerformanceTiming</a></li>
<li><a href="polymer_app_layout/PictureElement-class.html">PictureElement</a></li>
<li><a href="polymer_app_layout/Platform-class.html">Platform</a></li>
<li><a href="polymer_app_layout/Plugin-class.html">Plugin</a></li>
<li><a href="polymer_app_layout/PluginArray-class.html">PluginArray</a></li>
<li><a href="polymer_app_layout/PluginPlaceholderElement-class.html">PluginPlaceholderElement</a></li>
<li><a href="polymer_app_layout/Point-class.html">Point</a></li>
<li><a href="polymer_app_layout/PolymerIncludeElement-class.html">PolymerIncludeElement</a></li>
<li><a href="polymer_app_layout/PolymerIncludeElementBehavior-class.html">PolymerIncludeElementBehavior</a></li>
<li><a href="polymer_app_layout/PolymerRouteBehavior-class.html">PolymerRouteBehavior</a></li>
<li><a href="polymer_app_layout/PopStateEvent-class.html">PopStateEvent</a></li>
<li><a href="polymer_app_layout/PositionError-class.html">PositionError</a></li>
<li><a href="polymer_app_layout/PreElement-class.html">PreElement</a></li>
<li><a href="polymer_app_layout/Presentation-class.html">Presentation</a></li>
<li><a href="polymer_app_layout/ProcessingInstruction-class.html">ProcessingInstruction</a></li>
<li><a href="polymer_app_layout/ProgressElement-class.html">ProgressElement</a></li>
<li><a href="polymer_app_layout/ProgressEvent-class.html">ProgressEvent</a></li>
<li><a href="polymer_app_layout/PushEvent-class.html">PushEvent</a></li>
<li><a href="polymer_app_layout/PushManager-class.html">PushManager</a></li>
<li><a href="polymer_app_layout/PushRegistration-class.html">PushRegistration</a></li>
<li><a href="polymer_app_layout/QuoteElement-class.html">QuoteElement</a></li>
<li><a href="polymer_app_layout/RadioButtonInputElement-class.html">RadioButtonInputElement</a></li>
<li><a href="polymer_app_layout/Range-class.html">Range</a></li>
<li><a href="polymer_app_layout/RangeInputElement-class.html">RangeInputElement</a></li>
<li><a href="polymer_app_layout/RangeInputElementBase-class.html">RangeInputElementBase</a></li>
<li><a href="polymer_app_layout/ReadableStream-class.html">ReadableStream</a></li>
<li><a href="polymer_app_layout/ReadyState-class.html">ReadyState</a></li>
<li><a href="polymer_app_layout/Rectangle-class.html">Rectangle</a></li>
<li><a href="polymer_app_layout/RelatedEvent-class.html">RelatedEvent</a></li>
<li><a href="polymer_app_layout/ResetButtonInputElement-class.html">ResetButtonInputElement</a></li>
<li><a href="polymer_app_layout/ResourceProgressEvent-class.html">ResourceProgressEvent</a></li>
<li><a href="polymer_app_layout/RtcDataChannel-class.html">RtcDataChannel</a></li>
<li><a href="polymer_app_layout/RtcDataChannelEvent-class.html">RtcDataChannelEvent</a></li>
<li><a href="polymer_app_layout/RtcDtmfSender-class.html">RtcDtmfSender</a></li>
<li><a href="polymer_app_layout/RtcDtmfToneChangeEvent-class.html">RtcDtmfToneChangeEvent</a></li>
<li><a href="polymer_app_layout/RtcIceCandidate-class.html">RtcIceCandidate</a></li>
<li><a href="polymer_app_layout/RtcIceCandidateEvent-class.html">RtcIceCandidateEvent</a></li>
<li><a href="polymer_app_layout/RtcPeerConnection-class.html">RtcPeerConnection</a></li>
<li><a href="polymer_app_layout/RtcSessionDescription-class.html">RtcSessionDescription</a></li>
<li><a href="polymer_app_layout/RtcStatsReport-class.html">RtcStatsReport</a></li>
<li><a href="polymer_app_layout/RtcStatsResponse-class.html">RtcStatsResponse</a></li>
<li><a href="polymer_app_layout/Screen-class.html">Screen</a></li>
<li><a href="polymer_app_layout/ScreenOrientation-class.html">ScreenOrientation</a></li>
<li><a href="polymer_app_layout/ScriptElement-class.html">ScriptElement</a></li>
<li><a href="polymer_app_layout/ScrollAlignment-class.html">ScrollAlignment</a></li>
<li><a href="polymer_app_layout/SearchInputElement-class.html">SearchInputElement</a></li>
<li><a href="polymer_app_layout/SecurityPolicyViolationEvent-class.html">SecurityPolicyViolationEvent</a></li>
<li><a href="polymer_app_layout/SelectElement-class.html">SelectElement</a></li>
<li><a href="polymer_app_layout/Selection-class.html">Selection</a></li>
<li><a href="polymer_app_layout/ServiceWorkerClient-class.html">ServiceWorkerClient</a></li>
<li><a href="polymer_app_layout/ServiceWorkerClients-class.html">ServiceWorkerClients</a></li>
<li><a href="polymer_app_layout/ServiceWorkerContainer-class.html">ServiceWorkerContainer</a></li>
<li><a href="polymer_app_layout/ServiceWorkerGlobalScope-class.html">ServiceWorkerGlobalScope</a></li>
<li><a href="polymer_app_layout/ServiceWorkerRegistration-class.html">ServiceWorkerRegistration</a></li>
<li><a href="polymer_app_layout/ShadowElement-class.html">ShadowElement</a></li>
<li><a href="polymer_app_layout/ShadowRoot-class.html">ShadowRoot</a></li>
<li><a href="polymer_app_layout/SharedWorker-class.html">SharedWorker</a></li>
<li><a href="polymer_app_layout/SharedWorkerGlobalScope-class.html">SharedWorkerGlobalScope</a></li>
<li><a href="polymer_app_layout/SourceBuffer-class.html">SourceBuffer</a></li>
<li><a href="polymer_app_layout/SourceBufferList-class.html">SourceBufferList</a></li>
<li><a href="polymer_app_layout/SourceElement-class.html">SourceElement</a></li>
<li><a href="polymer_app_layout/SourceInfo-class.html">SourceInfo</a></li>
<li><a href="polymer_app_layout/SpanElement-class.html">SpanElement</a></li>
<li><a href="polymer_app_layout/SpeechGrammar-class.html">SpeechGrammar</a></li>
<li><a href="polymer_app_layout/SpeechGrammarList-class.html">SpeechGrammarList</a></li>
<li><a href="polymer_app_layout/SpeechRecognition-class.html">SpeechRecognition</a></li>
<li><a href="polymer_app_layout/SpeechRecognitionAlternative-class.html">SpeechRecognitionAlternative</a></li>
<li><a href="polymer_app_layout/SpeechRecognitionError-class.html">SpeechRecognitionError</a></li>
<li><a href="polymer_app_layout/SpeechRecognitionEvent-class.html">SpeechRecognitionEvent</a></li>
<li><a href="polymer_app_layout/SpeechRecognitionResult-class.html">SpeechRecognitionResult</a></li>
<li><a href="polymer_app_layout/SpeechSynthesis-class.html">SpeechSynthesis</a></li>
<li><a href="polymer_app_layout/SpeechSynthesisEvent-class.html">SpeechSynthesisEvent</a></li>
<li><a href="polymer_app_layout/SpeechSynthesisUtterance-class.html">SpeechSynthesisUtterance</a></li>
<li><a href="polymer_app_layout/SpeechSynthesisVoice-class.html">SpeechSynthesisVoice</a></li>
<li><a href="polymer_app_layout/Storage-class.html">Storage</a></li>
<li><a href="polymer_app_layout/StorageEvent-class.html">StorageEvent</a></li>
<li><a href="polymer_app_layout/StorageInfo-class.html">StorageInfo</a></li>
<li><a href="polymer_app_layout/StorageQuota-class.html">StorageQuota</a></li>
<li><a href="polymer_app_layout/StyleElement-class.html">StyleElement</a></li>
<li><a href="polymer_app_layout/StyleMedia-class.html">StyleMedia</a></li>
<li><a href="polymer_app_layout/StyleSheet-class.html">StyleSheet</a></li>
<li><a href="polymer_app_layout/SubmitButtonInputElement-class.html">SubmitButtonInputElement</a></li>
<li><a href="polymer_app_layout/TableCaptionElement-class.html">TableCaptionElement</a></li>
<li><a href="polymer_app_layout/TableCellElement-class.html">TableCellElement</a></li>
<li><a href="polymer_app_layout/TableColElement-class.html">TableColElement</a></li>
<li><a href="polymer_app_layout/TableElement-class.html">TableElement</a></li>
<li><a href="polymer_app_layout/TableRowElement-class.html">TableRowElement</a></li>
<li><a href="polymer_app_layout/TableSectionElement-class.html">TableSectionElement</a></li>
<li><a href="polymer_app_layout/TelephoneInputElement-class.html">TelephoneInputElement</a></li>
<li><a href="polymer_app_layout/TemplateElement-class.html">TemplateElement</a></li>
<li><a href="polymer_app_layout/Text-class.html">Text</a></li>
<li><a href="polymer_app_layout/TextAreaElement-class.html">TextAreaElement</a></li>
<li><a href="polymer_app_layout/TextEvent-class.html">TextEvent</a></li>
<li><a href="polymer_app_layout/TextInputElement-class.html">TextInputElement</a></li>
<li><a href="polymer_app_layout/TextInputElementBase-class.html">TextInputElementBase</a></li>
<li><a href="polymer_app_layout/TextMetrics-class.html">TextMetrics</a></li>
<li><a href="polymer_app_layout/TextTrack-class.html">TextTrack</a></li>
<li><a href="polymer_app_layout/TextTrackCue-class.html">TextTrackCue</a></li>
<li><a href="polymer_app_layout/TextTrackCueList-class.html">TextTrackCueList</a></li>
<li><a href="polymer_app_layout/TextTrackList-class.html">TextTrackList</a></li>
<li><a href="polymer_app_layout/TimeInputElement-class.html">TimeInputElement</a></li>
<li><a href="polymer_app_layout/TimeRanges-class.html">TimeRanges</a></li>
<li><a href="polymer_app_layout/Timing-class.html">Timing</a></li>
<li><a href="polymer_app_layout/TitleElement-class.html">TitleElement</a></li>
<li><a href="polymer_app_layout/ToolbarBehavior-class.html">ToolbarBehavior</a></li>
<li><a href="polymer_app_layout/Touch-class.html">Touch</a></li>
<li><a href="polymer_app_layout/TouchEvent-class.html">TouchEvent</a></li>
<li><a href="polymer_app_layout/TouchList-class.html">TouchList</a></li>
<li><a href="polymer_app_layout/TrackElement-class.html">TrackElement</a></li>
<li><a href="polymer_app_layout/TrackEvent-class.html">TrackEvent</a></li>
<li><a href="polymer_app_layout/TransitionEvent-class.html">TransitionEvent</a></li>
<li><a href="polymer_app_layout/TreeWalker-class.html">TreeWalker</a></li>
<li><a href="polymer_app_layout/UIEvent-class.html">UIEvent</a></li>
<li><a href="polymer_app_layout/UListElement-class.html">UListElement</a></li>
<li><a href="polymer_app_layout/UnknownElement-class.html">UnknownElement</a></li>
<li><a href="polymer_app_layout/UriPolicy-class.html">UriPolicy</a></li>
<li><a href="polymer_app_layout/Url-class.html">Url</a></li>
<li><a href="polymer_app_layout/UrlInputElement-class.html">UrlInputElement</a></li>
<li><a href="polymer_app_layout/UrlUtils-class.html">UrlUtils</a></li>
<li><a href="polymer_app_layout/UrlUtilsReadOnly-class.html">UrlUtilsReadOnly</a></li>
<li><a href="polymer_app_layout/ValidityState-class.html">ValidityState</a></li>
<li><a href="polymer_app_layout/VideoElement-class.html">VideoElement</a></li>
<li><a href="polymer_app_layout/VideoPlaybackQuality-class.html">VideoPlaybackQuality</a></li>
<li><a href="polymer_app_layout/VideoTrack-class.html">VideoTrack</a></li>
<li><a href="polymer_app_layout/VideoTrackList-class.html">VideoTrackList</a></li>
<li><a href="polymer_app_layout/VttCue-class.html">VttCue</a></li>
<li><a href="polymer_app_layout/VttRegion-class.html">VttRegion</a></li>
<li><a href="polymer_app_layout/VttRegionList-class.html">VttRegionList</a></li>
<li><a href="polymer_app_layout/WebSocket-class.html">WebSocket</a></li>
<li><a href="polymer_app_layout/WeekInputElement-class.html">WeekInputElement</a></li>
<li><a href="polymer_app_layout/WheelEvent-class.html">WheelEvent</a></li>
<li><a href="polymer_app_layout/Window-class.html">Window</a></li>
<li><a href="polymer_app_layout/WindowBase-class.html">WindowBase</a></li>
<li><a href="polymer_app_layout/WindowBase64-class.html">WindowBase64</a></li>
<li><a href="polymer_app_layout/WindowEventHandlers-class.html">WindowEventHandlers</a></li>
<li><a href="polymer_app_layout/Worker-class.html">Worker</a></li>
<li><a href="polymer_app_layout/WorkerConsole-class.html">WorkerConsole</a></li>
<li><a href="polymer_app_layout/WorkerGlobalScope-class.html">WorkerGlobalScope</a></li>
<li><a href="polymer_app_layout/WorkerPerformance-class.html">WorkerPerformance</a></li>
<li><a href="polymer_app_layout/XmlDocument-class.html">XmlDocument</a></li>
<li><a href="polymer_app_layout/XmlSerializer-class.html">XmlSerializer</a></li>
<li><a href="polymer_app_layout/XPathEvaluator-class.html">XPathEvaluator</a></li>
<li><a href="polymer_app_layout/XPathExpression-class.html">XPathExpression</a></li>
<li><a href="polymer_app_layout/XPathNSResolver-class.html">XPathNSResolver</a></li>
<li><a href="polymer_app_layout/XPathResult-class.html">XPathResult</a></li>
<li><a href="polymer_app_layout/XsltProcessor-class.html">XsltProcessor</a></li>
</ol>
</div>
<div class="col-xs-12 col-sm-9 col-md-6 main-content">
<section class="desc markdown">
<p class="no-docs">Not documented.</p>
</section>
<section>
<dl class="dl-horizontal">
<dt>Annotations</dt>
<dd><ul class="annotation-list class-relationships">
<li>DocsEditable()</li>
<li>DomName('DOMFileSystem')</li>
<li>SupportedBrowser(SupportedBrowser.CHROME)</li>
<li>Experimental()</li>
</ul></dd>
</dl>
</section>
<section class="summary" id="static-properties">
<h2>Static Properties</h2>
<dl class="properties">
<dt id="supported" class="property">
<span class="top-level-variable-type">bool</span>
<a href="polymer_app_layout/FileSystem/supported.html">supported</a>
</dt>
<dd>
<div class="readable-writable">
read-only
</div>
Checks if this type is supported on the current platform.
</dd>
</dl>
</section>
<section class="summary" id="instance-properties">
<h2>Properties</h2>
<dl class="properties">
<dt id="name" class="property">
<span class="top-level-variable-type">String</span>
<a href="polymer_app_layout/FileSystem/name.html">name</a>
</dt>
<dd>
<div class="readable-writable">
read-only
</div>
</dd>
<dt id="root" class="property">
<span class="top-level-variable-type"><a href="polymer_app_layout/DirectoryEntry-class.html">DirectoryEntry</a></span>
<a href="polymer_app_layout/FileSystem/root.html">root</a>
</dt>
<dd>
<div class="readable-writable">
read-only
</div>
</dd>
</dl>
</section>
</div> <!-- /.main-content -->
<div class="col-xs-6 col-sm-6 col-md-3 sidebar sidebar-offcanvas-right">
<h5>FileSystem</h5>
<ol>
<li class="section-title"><a href="polymer_app_layout/FileSystem-class.html#static-properties">Static properties</a></li>
<li><a href="polymer_app_layout/FileSystem/supported.html">supported</a></li>
<li class="section-title"><a href="polymer_app_layout/FileSystem-class.html#instance-properties">Properties</a></li>
<li><a href="polymer_app_layout/FileSystem/name.html">name</a>
</li>
<li><a href="polymer_app_layout/FileSystem/root.html">root</a>
</li>
</ol>
</div><!--/.sidebar-offcanvas-->
</div> <!-- container -->
<footer>
<div class="container-fluid">
<div class="container">
<p class="text-center">
<span class="no-break">
polymer_app_layout_template 0.1.0 api docs
</span>
•
<span class="copyright no-break">
<a href="https://www.dartlang.org">
<img src="static-assets/favicon.png" alt="Dart" title="Dart"width="16" height="16">
</a>
</span>
•
<span class="copyright no-break">
<a href="http://creativecommons.org/licenses/by-sa/4.0/">cc license</a>
</span>
</p>
</div>
</div>
</footer>
<script src="static-assets/prettify.js"></script>
<script src="static-assets/script.js"></script>
<!-- Do not remove placeholder -->
<!-- Footer Placeholder -->
</body>
</html>
| {
"content_hash": "a9d0fc23f05a4d34908c827fe2a99b8e",
"timestamp": "",
"source": "github",
"line_count": 666,
"max_line_length": 145,
"avg_line_length": 71.55105105105105,
"alnum_prop": 0.686420582124945,
"repo_name": "lejard-h/polymer_app_layout_templates",
"id": "c496b8c262a5c2a437a5ded148b476d57883f38b",
"size": "47653",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/api/polymer_app_layout/FileSystem-class.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "2381"
},
{
"name": "Dart",
"bytes": "25778"
},
{
"name": "HTML",
"bytes": "17680"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.