answer stringlengths 15 1.25M |
|---|
// Compare ptp time and system time
#include "time.h"
#include "stdio.h"
#include "fcntl.h"
#include <unistd.h>
#include <stdlib.h>
#define DEVICE "/dev/ptp0"
#define CLOCKFD 3
#define FD_TO_CLOCKID(fd) ((~(clockid_t) (fd) << 3) | CLOCKFD)
#define CLOCKID_TO_FD(clk) ((unsigned int) ~((clk) >> 3))
#define CLOCK_INVAL... |
<?php
class CalculadoraDePrecos {
private $tabela;
private $entrega;
public function __construct(TabelaDePreco $tabela, ServicoDeEntrega $frete) {
$this->tabela = $tabela;
$this->entrega = $frete;
}
public function calcula(Compra $produto) {
$desconto = $this->tabela->descontoPa... |
// <API key>.h
// WJActivityIndicator
#import <Foundation/Foundation.h>
@interface <API key> : NSObject
@end |
@(guildShortName: String, steps: Seq[bot.VerificationStep], tosForm: Form[controllers.TOSFormData])(implicit messages: Messages, flash: Flash)
@verify(guildShortName, steps) {
<h1>Welcome</h1>
<p>Please complete the following steps to be invited to the @guildShortName server.</p>
@helper.form(action = route... |
'
' Inicio del codigo
'
' Importando librerias
'
Imports System.Data
'
' Inicio de clase "<API key>"
'
Partial Class <API key>
Inherits vis2formularios.frmReporte
Dim loObjetoReporte As CrystalDecisions.CrystalReports.Engine.ReportDocument
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.Ev... |
export { default } from 'ember-flexberry-gis/utils/layer-to-jsts'; |
import React from 'react';
import { Route, RouteComponentProps, Redirect, Switch } from 'react-router-dom';
import { App } from 'modules/App';
import { routes } from 'modules/routes';
import { IModule } from 'shared/types/app';
function getRoutes(modules: IModule[]): React.ReactElement<RouteComponentProps<any>> {
ret... |
using System;
using System.Collections.Generic;
namespace MediaManager.Library
{
public interface IRadio : IContentItem
{
string Uri { get; set; }
string Title { get; set; }
string Description { get; set; }
string Tags { get; set; }
string Genre { get; set; }
obje... |
package invoices
import (
"io/ioutil"
"os"
"testing"
"time"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/lntypes"
"github.com/lightningnetwork/lnd/lnwire"
)
var (
testTimeout = 5 * time.Second
preimage = lntypes.Preimage{
0, 0, 0, 0, 0, 0, 0, 0... |
#include <inttypes.h>
#include <csp/csp_debug.h>
#include <stddef.h>
#if (<API key>)
void csp_hex_dump_format(const char * desc, void * addr, int len, int format) {
int i;
unsigned char buff[17];
unsigned char * pc = (unsigned char *)addr;
// Output description if given.
if (desc != NULL)
cs... |
import { readFile, sanityCheck } from '../src/file';
import { lexFile } from '../src/lexer';
import { parseFile } from '../src/parser';
import {
FILENAME_4,
} from '../__mocks__/fs';
import {
AMBIGUOUS,
} from '../src/parser';
jest.mock('fs');
jest.unmock('../src/file');
jest.unmock('../src/lexer');
jest.unmock('..... |
'use strict';
System.register(['aurelia-templating', '<API key>', 'aurelia-framework', '../common/attributeManager', '../common/attributes', '../element/element'], function (_export, _context) {
"use strict";
var bindable, customElement, noView, inject, computedFrom, AttributeManager, <API key>, Ui5Element, _cr... |
using System;
using System.Diagnostics;
using System.Resources;
using System.Windows;
using System.Windows.Markup;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using InnerFence.ChargeDemo.Phone.Resources;
using InnerFence.ChargeAPI;
using Microsoft.Xna.Framework.GamerSer... |
-- phpMyAdmin SQL Dump
-- version 4.1.6
-- http:
-- Client : localhost
-- Version du serveur : 5.6.15
-- Version de PHP : 5.3.28
SET time_zone = "+00:00";
/*!40101 SET @<API key>=@@<API key> */;
/*!40101 SET @<API key>=@@<API key> */;
/*!40101 SET @<API key>=@@<API key> */;
/*!40101 SET NAMES utf8 */;
-- Structure d... |
author: robmyers
comments: true
date: 2006-07-03 09:39:25+00:00
layout: post
slug: i-heart-my-roomba
title: I Heart My Roomba
wordpress_id: 1019
categories:
- Personal
- Reviews

I like my [roomba](http://store.irobot.com/product/index.jsp?... |
package org.crossfit.app.web.rest.dto;
import java.util.ArrayList;
import java.util.List;
import org.crossfit.app.domain.TimeSlot;
import org.crossfit.app.domain.TimeSlotType;
import org.crossfit.app.domain.util.<API key>;
import org.crossfit.app.domain.util.<API key>;
import org.joda.time.DateTime;
import org.joda.tim... |
package com.puzzletimer.parsers;
import java.util.HashMap;
public class <API key> {
private ScrambleParser[] scrambleParsers;
private HashMap<String, ScrambleParser> scrambleParserMap;
public <API key>() {
this.scrambleParsers = new ScrambleParser[] {
new EmptyScrambleParser(),
... |
module Assembler.Types where
import Data.Word
-- Constant is either an int or a label which resolves to an int
type Label = String
type Constant = Either Int Label
type RegId = Word8
data Instr = Halt
| Nop
| Rrmovl RegId RegId
| Irmovl RegId Constant
| Rmmovl RegId Reg... |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AltTabHelperV2
{
using System.Runtime.InteropServices;
using HWND = IntPtr;
<summary>Contains functionality to get all the open windows.</summary>
public static class OpenWindowG... |
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>HCI Project Portfolio</title>
<link rel="stylesheet" href="styles.css">
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
... |
package org.gete.android.dorongkotak;
import android.graphics.Canvas;
import android.util.Log;
import android.view.SurfaceHolder;
/**
* Kelas yang digunakan untuk menangani proses kecil
* @author Adnanto Ahmad Ramadhon
*
*/
public class PanelThread extends Thread {
private SurfaceHolder surfaceHolder;
priva... |
import pickle
import unittest
import numpy as np
import scipy.sparse as sp
from sklearn import linear_model, datasets, metrics
from sklearn.base import clone
from sklearn.linear_model import SGDClassifier, SGDRegressor
from sklearn.preprocessing import LabelEncoder, scale, MinMaxScaler
from sklearn.utils.testing import... |
package com.progrexor.hive.udaf;
import java.util.HashMap;
import java.util.Map.Entry;
import org.apache.hadoop.hive.ql.exec.UDAF;
import org.apache.hadoop.hive.ql.exec.UDAFEvaluator;
@SuppressWarnings("deprecation")
public final class Mode extends UDAF {
public static class Evaluator implements UDAFEvaluator {
p... |
import Vue from "vue";
const template = '<div class="confirm-modal modal-box" v-if="display">' +
'<div class="modal-overlay"></div>' +
'<div class="modal-container">' +
'<div :class="contentClass">' +
'<p class="title"></p>' +
'<p class="text">{{text}}</p>' +
'<div class=... |
<?php
declare(strict_types=1);
namespace Orchid\Press\Entities;
use Illuminate\Foundation\Validation\ValidatesRequests;
trait Structure
{
use ValidatesRequests;
/**
* Visible name of entity.
*
* @var string
*/
public $name = '';
/**
* Visible description of entity.
*
*... |
Arena = class()
function Arena:init(l, b, r, t)
self.robots = {}
self.timer = 0
self.tourney = false
self.gameOver = false
self.game = 1
self.pulse = 0
self.pulseDirection = 2
self.skeet = {}
self.walls = {}
self.tracks = {}
self.launchTime = ElapsedTime
self:sizeFrames(l... |
package com.j0rsa.caricyno.vk.query;
import com.j0rsa.caricyno.vk.actor.ServiceActorData;
import com.vk.api.sdk.exceptions.ApiException;
import com.vk.api.sdk.exceptions.ClientException;
import com.vk.api.sdk.objects.wall.responses.GetResponse;
import com.vk.api.sdk.queries.wall.WallGetFilter;
import com.vk.api.sdk.que... |
<?php
namespace MusicCast\Api;
/**
* @author Sam Van der Borght <samvanderborght@gmail.com>
* @author Damien Surot <damien@toxeek.com>
*/
/**
* @author Sam Van der Borght <samvanderborght@gmail.com>
*/
class System extends AbstractApi
{
/**
* For retrieving basic information of a Device
*
* @ret... |
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import { createUserGroup } from 'actions'
import GroupCreate from 'components/admin/Group/GroupCreate'
export default connect(
state => ({}),
dispatch => bindActionCreators({createUserGroup}, dispatch),
)(GroupCreate) |
"use strict";
const tap = require('tap')
const mocks = require('pom-test-stubs')
const PluginFinder = require('../../lib/PluginFinder')
const PluginValidator = require('../../lib/PluginValidator')
tap.test('Validating plugins', (t) => {
let mockDir = mocks.findMockDir(__dirname, '../mocks/unit/PluginValidator/mixedPl... |
package eu.bcvsolutions.idm.core.model.service.impl;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.transaction.annotation.Transactional;
import eu.b... |
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
public class Inventory : MonoBehaviour
{
GameObject inventoryPanel;
GameObject slotPanel;
ItemDatabase database;
public GameObject inventorySlot;
public GameObject inventoryItem;
private int slot... |
import Ember from 'ember';
import EmberValidations from 'ember-validations';
export default Ember.Controller.extend(EmberValidations.Mixin, {
validations: {
"model.def": {
generic: true,
definitionlike: true,
},
"model.example": {
generic: true,
nongendered: true,
sentencelik... |
namespace FreshBooks.Api.PaymentList {
<remarks/>
[System.CodeDom.Compiler.<API key>("System.Xml", "4.6.81.0")]
[System.<API key>()]
[System.Diagnostics.<API key>()]
[System.ComponentModel.<API key>("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http:
[Sys... |
import webtools
import re
class Trip():
""" Models a megabus trip."""
def __init__(self, data, number, mode, crawling_day):
""" Initializes basic trip Data."""
self.data = data
self.trip_number = number
self.mode = mode
self.day = crawling_day
def price(self, verbose=... |
#if defined(HAVE_CONFIG_H)
#include <config/bitcoin-config.h>
#endif
#include <chainparams.h>
#include <chainparamsbase.h>
#include <logging.h>
#include <util/strencodings.h>
#include <util/system.h>
#include <util/translation.h>
#include <wallet/wallettool.h>
#include <functional>
#include <stdio.h>
const std::functio... |
package pt.utl.ist.cmov.bomberman.game.drawing;
import pt.utl.ist.cmov.bomberman.util.Position;
public class RobotDrawing extends Drawing {
private static final long serialVersionUID = -<API key>;
public RobotDrawing() {
super();
}
public RobotDrawing(Integer id, Position pos) {
super(id... |
gulp is a toolkit for automating painful or time-consuming tasks in your development workflow, so you can stop messing around and build something.
Gulp
Node.js IO
Gulp
API Gulp
http:
gulp
http://gulpjs.com/
1. gulp
$ npm install --global gulp
2. devDependencies
$ npm install --save-dev gulp
3. gulpfile.js
var gulp... |
/* Dutch (UTF-8) initialisation for the jQuery UI date picker plugin. */
jQuery(function($){
$.datepicker.regional.nl = {
closeText: 'Sluiten',
prevText: '←',
nextText: '→',
currentText: 'Vandaag',
monthNames... |
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import { Field, reduxForm } from 'redux-form';
import { connect } from 'react-redux';
import { createPost } from '../actions';
class PostsNew extends Component {
renderField(field) {
const className = `form-group ${field.meta... |
#ifndef <API key>
#define <API key>
#include "agraph.hpp"
template<typename Node>
class Graph : public AbstractGraph<Node> {
public:
using super = AbstractGraph<Node>;
using nodes = typename super::nodes;
using edges = typename super::edges;
Graph() : super() {}
explicit Graph(edges es) : super(es)... |
#!/usr/bin/env python3
import calendar
if __name__ == "__main__":
for num in range(1, 13):
month = calendar.month_name[num]
print(f"{num:02} - {month}") |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>: 2016/8 | </title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description">
<meta property="og:type" content="website">
<meta property="og:title" content="">
<meta property="og:url" conten... |
layout: single
title: RGB LED POV Globe - Parts shopping
date: 2011-03-23 21:30
categories: Development News
I spent most of the last week doing research and ordering parts samples and testing equipment, trying to get everything set up for this project.
<strong>Things I have ordered.</strong>
<ul>
<li>$75 USD - <a ... |
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for lib/</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../prettify.css">
<style>
body, html {
margin:0; padding: 0;
}
body {
font-family: Helvetica Neue, Helvetica,Arial;
... |
var requirejs = require('requirejs');
requirejs.config({nodeRequire: require});
requirejs(['./srv.app', './srv.socket'],function(app, io) {
var kickstart = app.kickstart,
router = kickstart.listen();
console.log("Listening on http://%s:%d", kickstart.conf().name, router.address().port);
}); |
var webpack = require('webpack')
var WebpackDevServer = require('webpack-dev-server')
var config = require('./webpack.config')
var express = require('express')
const PORT = 3009
var app = new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
hot: true,
historyApiFallback: true,
contentBa... |
<header id="header">
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="container">
<div class="navbar-header">
<button type="button" id="nav-toggle" class="navbar-toggle" data-toggle="collapse" data-target="#navigation-menu">
... |
// Generated by class-dump 3.5 (64 bit).
#import "NSView.h"
@interface NSView (IBViewAdditions)
+ (id)ib_viewWithSize:(struct CGSize)arg1;
- (void)<API key>;
- (void)<API key>:(id)arg1;
- (id)<API key>;
- (void)<API key>:(struct CGRect)arg1;
- (id)<API key>;
- (BOOL)isMouse:(struct CGPoint)arg1 inRect:(struct CGRec... |
#ifndef _CPP_LOAD_JPEG_H_
#define _CPP_LOAD_JPEG_H_
#include "../export.h"
#include <dlib/image_io.h>
#include "../shared.h"
#include "../template.h"
using namespace dlib;
using namespace std;
#pragma region template
#define load_jpeg_template(__TYPE__, error, type, ...) \
dlib::load_jpeg(*((array2d<__TYPE__>*)image), ... |
export { default } from 'ember-cli-uniq/components/uni-mobile-number'; |
path: "/article/change-log"
date: "2018-03-22"
title: "Change Log SUT 2.0 Neo"
author: "Daivd Kviloria"
| |
|
| ```sut.createHistory``` | ```ADD``` | ```2.0-NEO``` |
| ```Assert.Obj``` | ```Removed``` | ```2.0-NEO``` |
| ```sut.connect``` | ```ADD``` | ```2.0-NEO``` |
| ```sut.temp... |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Cadastrar Funcionário</title>
<link rel="stylesheet" href="css/bootstrap.min.css" media="screen" title="no title">
<link rel="stylesheet" href="css/vanilla.css" media="screen" title="no title">
<script src="js/jquery.js" charset="utf-8"><... |
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public interface ICoinCollector {
int CollectedCoins { get; set; }
// give coin to collector
void GiveCoins(int coins);
// recive coins from collector
int TakeCoins();
} |
module.exports = {
port: 8089,
devServerPort: 8088
} |
class DefinitionDslTest < ActiveSupport::TestCase
def definition_dsl
MergingQueue::DefinitionDSL.new(:new_enquiry)
end
def <API key>
assert definition_dsl.attributes[:name] == :new_enquiry
end
def <API key>
dsl = definition_dsl
dsl.actor(:User)
assert dsl.attributes[:actor] == :User
end
... |
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>moo-java: com.msu.moo.model.interfaces.IFactory< T extends IVariable > Interface Refer... |
var Promise = require('bluebird')
, _ = require('lodash')
, passport = require('passport')
, config = require('config-url')
, strategy = require('./strategy')
, handler = require('./handler')
, User = require('../model/User')
, { URL, URLSearchParams } = require('url')
... |
#import "MOBProjection.h"
@interface <API key> : MOBProjection
@end |
#include "<API key>.h"
void init_trampoline(int running_mode)
{
continuation_stack = (void_ptr_ptr_func*) malloc(sizeof(void_ptr_ptr_func) * <API key>);
<API key> = continuation_stack;
<API key> = &(continuation_stack[<API key>]);
}
void shutdown_trampoline()
{
free(continuation_stack);
continuation... |
order: 10
title:
en-US: size
zh-CN:
## zh-CN
## en-US
Two compacted table size: `middle` and `small`, `small` size is used in Modal only.
`jsx
import { Table } from 'igroot';
const columns = [{
title: 'Name',
dataIndex: 'name',
}, {
title: 'Age',
dataIndex: 'age',
}, {
title: 'Address',
dataIndex: 'addr... |
(function() {
define([
'angular',
'user/services/session',
'messenger/services/messenger',
'$socket'
], function (
angular,
SessionService,
MessengerService,
$socket
) {
return angular.module("application.controllers")
.controller("MessengerCtrl", [
"$rootScope",
... |
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
namespace Autofac.Features.OpenGenerics {
using System;
using System.Reflection;
<summary>
A strongly-typed reso... |
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C
#region Using directives
using System;
using System.Diagnostics;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.ServiceP... |
<aside class="{{ include.classes }}" style="background-color:{{ include.bgcolor }};">
<h2>Resurrecting the Past?</h2>
{% asset 2015/cover-shapiro-book.jpg @magick:resize=200 alt:"How to clone a mammoth by Beth Shapiro" class:"left" %}
<p>Shapiro's brand-new book, How to Clone a Mammoth: The Science of De-Extinction, is... |
import $ from "jquery";
import { getCLS, getFID, getLCP } from "web-vitals";
export class GoogleAnalytics {
<API key>({ name, delta, id }) {
window.gtag("event", name, {
event_category: "web_vitals",
event_label: id,
value: Math.round(name === "CLS" ? delta * 1000 : delta),
non_interaction... |
import pygame as pg
class Spritesheet:
def __init__(self, filename, tile_size):
self.sheet = pg.image.load(filename).convert_alpha()
self.tile_size = tile_size
def get_image(self, x, y, width, height):
image = pg.Surface((width, height))
image.blit(self.sheet, (0, 0), (x, y, widt... |
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Dice: dice::decomposi... |
#include <debug.h>
#include <dev/gpio.h>
#include <kernel/thread.h>
#include "gpio_hw.h"
#include "panel.h"
#include <platform/machtype.h>
#include <dev/lcdc.h>
#if DISPLAY_TYPE_MDDI
#include <mddi.h>
#define <API key> 0x108000
#define <API key> 0x110000
#define SPI_BLOCK_BASE 0x120000
#define I2C_BLOCK_BASE ... |
package de.npe.gameanalytics.events;
import de.npe.gameanalytics.Analytics;
import de.npe.gameanalytics.util.JSON;
/**
* @author NPException
*/
public class GAErrorEvent extends GAEvent {
public enum Severity {
critical,
error,
warning,
info,
debug
}
private final S... |
<?php
return array (
'id' => 'agfa_40970_ver1',
'fallback' => '<API key>',
'capabilities' =>
array (
'is_tablet' => 'true',
'model_name' => '40970',
'brand_name' => 'Agfa',
'<API key>' => 'false',
'<API key>' => '160',
'<API key>' => '80',
'resolution_width' => '400',
'resolution... |
#include <iostream>
#include "reader.h"
using namespace std;
using AMOS::Overlap;
int main(int argc, char** argv) {
auto reader = new AMOS::Reader(cin);
while (reader->has_next()) {
Overlap o;
reader->next(&o);
cout << o.adjacency << " " << o.a_id << " " << o.b_id << " " << o.a_hang << " " << o.b_hang <... |
$(document).ready(function() {
$(".myChart").each(function( index ) {
//console.log( index + ": " + $( this ).text() );
//Get context with jQuery - using jQuery's .get() method.
var ctx = $(".myChart").get(index).getContext("2d");
//This will get the first returned node in the jQuery c... |
var path = require('path')
module.exports = {
build: {
env: require('./prod.env'),
index: path.resolve(__dirname, '../dist/index.html'),
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
productionSourceMap: true,
// Gzip off by default as... |
#ifndef ADC_H_
#define ADC_H_
#define MUX5 3
extern void init_adc();
extern void check_adc();
extern void adc_msg_all(char *txtbuffer);
#endif /* ADC_H_ */ |
package org.openapitools.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.openapitools.model.Link;
import javax.validation.constraints.*;
import io.swagger.... |
namespace CloudTemple.SQLServer.Contracts
{
using System;
using System.Linq;
using System.Linq.Expressions;
public interface IGenericRepository<T>
where T : class
{
IQueryable<T> All();
void Add(T entity);
T Delete(T entity);
IQueryable<T> Search(Expression<Fu... |
export function resizeImg(img, maxWidth = 1920, maxHeight = 1080) {
const canvas = document.createElement('canvas');
let width = img.width;
let height = img.height;
// calculate the width and height, constraining the proportions
if (width > height) {
if (width > maxWidth) {
height *= maxWidth / widt... |
import {createAction} from 'redux-actions'
import type from '../../constants/actionType'
import ActionCreator from '../../actionCreators/me'
const mockRegister = createAction(type.MOVIE_LIST, ActionCreator.register, ActionCreator.registerValidator)
const actionCreators = {
mockRegister
}
export default {actionCreator... |
title: "Failures"
date: 2017-08-23 03:30
tags: [Ramblings,Poetry]
I know you're my weakness,
and I know you're aware.
I try to compose melodies,
they end up a prayer.
They say you make me strong,
but do they even care ?
For I am tired of asking you for strength,
when you visit my nightmares.
You've toyed with my laught... |
Example of calling Twitter's API
This is an example of consuming Twitter's REST API using Application-only Authentication.
It uses the standard `HttpURLConnection` of Java for making the requests.
Application-only authentication uses OAuth.
The code currently fetches the most recent tweet of the user whose screen_name ... |
// Queue(Vector).h
// Algorithm(C++)
#ifndef <API key>
#define <API key>
#include <iostream>
#include <vector>
using namespace std;
template <class Type>
class Queue {
public:
private:
unsigned int capacity_;
unsigned int size_;
typename vector<Type>::iterator front;
typename vector<Type>::iterator re... |
'use strict';var <API key> = require('./application_common');
exports.bootstrap = <API key>.commonBootstrap;
var application_ref_1 = require('./application_ref');
exports.ApplicationRef = application_ref_1.ApplicationRef;
//# sourceMappingURL=application.js.map |
'use strict';
const Hapi = require('hapi');
const Inert = require('inert');
const Vision = require('vision');
const Handlebars = require('handlebars');
const Config = require('./config');
const Models = require('./models');
const Handlers = require('./handlers');
const Routes = require('./routes');
const server = new H... |
package models;
import com.fasterxml.jackson.annotation.JsonIgnore;
public class Student {
private String academicTermUid;
private String name;
private String studentGroupUid;
@JsonIgnore
private String key;
public Student() {
}
public String getAcademicTermUid() {
return academi... |
#! /usr/bin/python
#-*- coding:utf-8 -*
__author__ = "Cedric Bonhomme"
__version__ = "$Revision: 0.3 $"
__date__ = "$Date: 2015/08/31$"
__revision__ = "$Date: 2015/10/26 $"
__copyright__ = ""
__license__ = ""
import sys
import requests
import json
import pickle
import clusters
import list_clusters
def recommend(user_id... |
import os
from django.core.wsgi import <API key>
os.environ.setdefault("<API key>", "django_shopfront.settings")
application = <API key>() |
'use strict';
/**
* Module dependencies.
*/
var log4js = require('log4js');
var log = log4js.getLogger('controller/render.js');
var config = require('nconf');
// End of dependencies.
/**
* Wrapper over res.render().
*/
module.exports = function(template, variables) {
return function (req, res) {
res.render(te... |
from django.apps import AppConfig
class ClothesConfig(AppConfig):
name = 'clothes' |
# postimg
:rocket: upload images on imgur & share instantly.(link will be copied to clipboard automatically)
<img src="http://i.imgur.com/aBoKRZe.png" alt="snap" height="200">
[ IMGUR_CLIENT_ID and save it as an environment ... |
<table width="90%" border="0"><tr><td><script>function openfile(url) {fullwin = window.open(url, "fulltext", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");}</script><div class="flayoutclass"><div class="flayoutclass_first"><table class="tableoutfmt2"><tr><th class="std1"><b>... |
#!/bin/bash
SAVEIMAGES=""
COMPAREIMAGES=""
ARGS=""
RED='\e[0;31m'
GREEN='\e[0;32m'
NOCOLOR='\e[0m'
RETVAL=0
# run all of the samples
# parse the arguments
while test $# -gt 0; do
case "$1" in
--save-images)
SAVEIMAGES="true"
ARGS="$ARGS --save-images"
;;
-... |
'use strict';
var gulp = require('gulp'),
sass = require('gulp-sass'),
zip = require('gulp-zip'),
pack = require('./package.json');
gulp.task('sass', [], function() { |
<?php
namespace Colin\Bundle\ActionBundle\Action;
use Symfony\Component\Form\<API key>;
use Symfony\Component\Templating\EngineInterface;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Doctrine\ORM\EntityManager;
class Read... |
package jdk.util;
import java.util.Arrays;
import java.util.Optional;
public final class Optionals {
private Optionals() { }
@SafeVarargs
public static <T> T any(Optional<T>... optionals) {
return Arrays
.stream(optionals)
.filter(Optional::isPresent)
... |
import React, { Component } from 'react' // eslint-disable-line no-unused-vars
class MainModOptions extends Component {
componentWillMount(){
this.data = {}
fetch('/mods/mainModData/' + this.props.modId)
.then(res => res.json())
.then(result => {
... |
$var title:
<div class="row">
<div class="col-md-12">
<div class="jumbotron">
<h1></h1>
<p class="lead">
Web API</p>
$if 'user' not in session:
<p>
<a href="/qq_login"><img src="static/qq_login.png" /></a>
</p>
... |
using System.Linq;
using System.Text;
using Spreadsheet.Core.Utils;
namespace Spreadsheet.Core.Cells
{
public struct CellAddress
{
public int Row { get; }
public int Column { get; }
public CellAddress(int row, int column)
{
Row = row;
if (row < 0)
... |
<ion-view>
<ion-content>
<<API key>></<API key>>
</ion-content>
</ion-view> |
using System;
using <API key>.Foundation.MSSDK.Enums;
using <API key>.Foundation.SCSDK.Wrappers;
using <API key>.Foundation.MSSDK.Repositories.Bing;
using System.Threading.Tasks;
using <API key>.Foundation.MSSDK;
using <API key>.Foundation.MSSDK.Models.Bing.WebSearch;
using <API key>.Foundation.SCSDK.Policies;
namespac... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.