text stringlengths 8 6.88M |
|---|
//这个题第一次看到做隔了一周
//自己那个想法虽然可行,但是不知为啥总是不想去实现
//最后还是参考了别人发现的规律
//行列的字母互换就得出了相反方向旋转的结果
//3 MS 63.84%
//这是顺时针
class Solution {
public:
void rotate(vector<vector<int>>& matrix) {
int length = matrix.size();
if(length<2){
return;
}
for(int i = 0; i < length/2; ++i){ //列
for(int j = i... |
//dfs
class Solution {
public:
string decodeString(string s, int& i) {
string res;
while (i < s.length() && s[i] != ']') {
if (!isdigit(s[i]))
res += s[i++];
else {
int n = 0;
while (i < s.length() && isdigit(s[i]))
... |
#include <iostream>
#include <string>
using namespace std;
int main() {
string str;
cin >> str;
int sum = 0;
int len = str.length();
for (int i = 0; i < len; i++) {
if ('A' <= str[i] && str[i] <= 'C') {
sum += 3;
} else if ('D' <= str[i] && str[i] <= 'F') {
sum += 4;
} else if ('G' <= ... |
/*
* ·´×ªµ¥Á´±í
*/
#include <bits/stdc++.h>
struct ListNode{
ListNode *next;
int data;
ListNode(int x):data(x),next(NULL){}
};
class Solution{
public:
ListNode* list_reverse(ListNode *head){
ListNode *newHead = NULL;
while(head){
ListNode *nextNode = head->next;
... |
#include "GameController.h"
GameController::GameController()
{
isRunning = true;
gameState = GameStates::SPLASH_SCREEN;
actualScene = new SplashScreen();
}
void GameController::GoMenu()
{
gameState = GameStates::MENU;
delete actualScene;
actualScene = new Menu();
}
void GameController::GoPlay()... |
// Copyright (c) 2020 Hartmut Kaiser
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <pika/init.hpp>
#include <pika/modules/async.hpp>
#include <pika/modules/thre... |
#include "sum_float_opt.h"
#define INPUT_SIZE (18*18)
#define OUTPUT_SIZE (16*16)
extern "C" {
static void read_input(int* input, hls::stream<hw_uint<32> >& v, const int size) {
for (int i = 0; i < INPUT_SIZE; i++) {
#pragma HLS pipeline II=1
v.write(input[i]);
}
}
static void write_output(int* output, ... |
//伸展树
#include<stdio.h>
#include<algorithm>
#define MAXN 100010
#define MAXM 100010
#define Type int
using namespace std;
struct splayTree{
int size,root; // 树的大小和根的编号
int s[MAXN],left[MAXN],right[MAXN]; //儿子个数,左儿子,右儿子
Type data[MAXN]; //节点的值
splayTree () { s[0]=left[0]=... |
#define pii pair<int,int>
vector<vector<pii>> dp;
pii memo(const vector<int> &a,int sum,int i) {
if(i == 0) return {sum,0};
if(dp[sum][i].first != -1) return dp[sum][i];
if(sum-(2*a[i-1])>=0) {
// return <sum,items>
pii l,r;
l = memo(a,sum-(2*a[i-1]),i-1);
r = memo(a,sum,i-1... |
/*
a class used to compute the polygon infomation.
*/
#ifndef H_POLYGONACTION_H
#define H_POLYGONACTION_H
#include "Polygon.h"
#include "math_3d.h"
#include "Math_basics.h"
namespace P_RVD
{
class PolygonAction
{
public:
PolygonAction(Polygon* _p)
{
m_polygon = _p;
weight_sum = 0.0;
}
PolygonAc... |
#include "DBManager.hh"
#include "Encounter.hh"
#include "EncounterTemplate.hh"
#include "Unit.hh"
namespace HotaSim {
using namespace std;
using namespace CCC;
Encounter::Encounter(const EncounterTemplate& _tmpl)
: TemplateObject(_tmpl) {
for( const auto& u : tmpl.units ) {
auto unit = tmpl.dbmgr->createO... |
//
// HolyHandGrenade.cpp for cpp_indie_studio in /home/lopez_i/cpp_indie_studio/HolyHandGrenade.cpp
//
// Made by Loïc Lopez
// Login <loic.lopez@epitech.eu>
//
// Started on ven. juin 16 10:35:53 2017 Loïc Lopez
// Last update Sun Jun 18 19:54:31 2017 Stanislas Deneubourg
//
#include <iostream>
#include "Worms/Ho... |
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
string str1;
cin >> str1;
int count = 0;
for(int i = 0; i < str1.size(); i++)
{
if(str1[i] == 'a' || str1[i] == 'e' ||str1[i] == 'i' || str1[i] == 'o' ||str1[i] == 'u')
{
count++;
}
}
cout << "Vowels are:" << count;
return 0... |
//use array to store
class Solution {
public:
bool isAnagram(string s, string t) {
if (s.length() != t.length()) return false;
int n = s.length();
int counts[26] = {0};
for (int i = 0; i < n; i++) {
counts[s[i] - 'a']++;
counts[t[i] - 'a']--;
}
... |
#include "Conjunto.h"
template <class T>
Conjunto<T>::Conjunto() {
_raiz = NULL;
}
template <class T>
void Conjunto<T>::vaciar(Conjunto<T>::Nodo *a) {
if(a != NULL){
vaciar(a->izq);
vaciar(a->der);
a->izq = NULL;
a->der = NULL;
delete a;
}
}
template <class T>
Con... |
//
// Created by manout on 18-3-23.
//
#include <cmath>
static int count = 0;
__always_inline
int mypow(int n)
{
return static_cast<int>(std::pow(2, n));
}
static int coin(int n, int k, int sum)
{
int pow = mypow(k);
if (sum + pow == n)
{
++count;
}
if (sum + pow < n)
{
c... |
#ifndef _SERVER_UTILS_HH_
#define _SERVER_UTILS_HH_
#include <stdint.h>
#include <time.h>
#include <string>
uint64_t utime();
time_t utime_seconds(uint64_t t);
std::string format_time(time_t t);
std::string pexec(std::string cmdline);
void stress(double duration, int num_processes);
#endif
|
#ifndef NOTGATE_H
#define NOTGATE_H
#include <agenda.h>
extern Agenda agenda;
class NotGate : public WireListner {
private:
Wire *in;
Wire *out;
unsigned long long delay;
public :
NotGate(Wire *in, Wire *out) {
this->in = in;
this->out = out;
delay = 1;
in->addListner(this);
agenda.addO... |
#include <iostream>
#include <armadillo>
#include <cmath>
#include <vector>
#include "Body.h"
#include "Universe.h"
#include "../../lib/lib.h"
using namespace arma;
using namespace std;
int main(int argc, char *argv[]) {
bool useVerlet = true;
double mass = 1;
double h = 0.0001;
double t_max = 15;
int ... |
#include <iostream>
#include <vector>
#include <bitset>
#include <cmath>
using namespace std;
static const size_t INT_SIZE = sizeof(int) * 8;
static const size_t LONG_SIZE = sizeof(unsigned long) * 8;
class binNum{
public:
binNum(int num){
num_ = num;
}
bool getbit(size_t i){
return num_ & ... |
#pragma once
#include <tchar.h>
#include <windows.h>
class Logger
{
public:
Logger(const TCHAR *FileName);
int Write(const TCHAR * Format, ...);
private:
TCHAR m_fileName[MAX_PATH];
Logger(const Logger&);
Logger & operator=(Logger &);
};
|
/*
Copyright 2022 University of Manchester
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, s... |
#ifndef AS64_GMP_H_
#define AS64_GMP_H_
// GMP class
// Generalized movement primitive.
//
#include <gmp_lib/WSoG/WSoG.h>
#include <gmp_lib/utils.h>
#include <gmp_lib/io/file_io.h>
namespace as64_
{
namespace gmp_
{
class GMP
{
// ===================================
// ======= Public Functions ========
// ===... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
*
* Copyright (C) 2007 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#ifdef SEARCH_ENGINES
#ifndef SEARCH_MANAG... |
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int p[1300];
int rec[510][1300];
int cou[1300];
vector<int> ans[10010];
int vis[10010]
int main()
{int n = 10000,sum = 0;
for (int i = 2;i <= n; i++)
if (!vis[i])
for (int j = i+i;j <= n; j+=i)
vis[j] = 1;
for (int i ... |
#include <Arduino.h>
//* EEPROM Config
#include <EEPROM.h>
#define eepromSize 32
void readEEPROM(int address, char *data);
void writeEEPROM(int address, char *data);
char readData[128];
char pwdData[128];
//* LED & button Var
#define button 21
//* interrupt
volatile bool interruptState = false;
int totalInterrutpCou... |
#pragma once
#include <bits/stdc++.h>
using namespace std;
template <typename U, typename T>
class Context {
private:
list<pair<U, T>> clist;
public:
Context();
void add_context(pair<U, T>);
void add_context(const U&, T&&);
int get_context_size();
void resize_context(int);
T& get_value(co... |
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
// Простые перечисления и структура с функцией для вывода перечислителей
// V 2.0
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
#include <iostream>
#include <string>
using namespace std;
enum class MonsterType {
O... |
#include <stdio.h>
#include <Windows.h>
#pragma comment(lib, "kernel32.lib")
#pragma comment(lib, "user32.lib")
#pragma comment(lib, "advapi32.lib")
extern "C"
{
int RaisePrivileges(){
int retCode = 0;
HANDLE hToken;
TOKEN_PRIVILEGES tp;
TOKEN_PRIVILEGES oldtp;
DWORD dwSize = sizeof(TOKEN_PRIVILEGES);
LU... |
#include"pch.h"
#include"Application.h"
Application* g_App;
int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR lpCmdLine, _In_ int nShowCmd)
{
HRESULT hr = CoInitialize(NULL);
bool initOK = false;
g_App = &Application::getInstance();
initOK = g_App->initApplication(hInsta... |
/* leetcode 62
*
*
*
*/
#include<stdio.h>
#include<cstring>
#include<iostream>
#include<algorithm> // std::sort
#include<cstring>
#include<vector>
#include<set>
#include<string>
#include<map>
#include<queue>
#include<stack>
#include<deque>
#include<unordered_set>
#include<unordered_map>
using namespace std;
class ... |
#include "Player.h"
#include "Application.h"
Player::Player(FW::Application& app, FW::EntityManager& entities)
: FW::EntityManager::BaseEntity(app, entities),
idle(app.getResourceManager().getTexture("Idle.png"), sf::Vector2u(2, 1), 0.4f),
shooting(app.getResourceManager().getTexture("Shooting.png"), sf::V... |
//
// Created by Yujing Shen on 29/05/2017.
//
#ifndef TENSORGRAPH_NODESLINKER_H
#define TENSORGRAPH_NODESLINKER_H
#include "nodes/Inceptron.h"
namespace sjtu
{
template <typename T>
Inceptron::Inceptron(Session *sess, const Shape &shape, const T &func) :
SessionNode(sess, shape)
{
if... |
#include <iostream>
#include <string>
using namespace std;
int main() {
string S;
cin >> S;
int ver = 0, hol = 0;
for (char c : S) {
if (c == '0') { // 縦タイル
cout << 1 << " " << ver + 1 << endl;
ver = (ver + 1) % 4;
} else { // 横タイル
cout << 3 << " ... |
#include<iostream>
#include<cstdlib>
using namespace std;
typedef long long int ll;
ll tong (ll n){
if(n<=0) return 0;
return n%10 +tong(n/10);
}
int main(){
ll n; cin>>n;
n=abs(n);
cout<<tong(n);
return 0;
}
|
#define in3 12
#define in4 13
#define enA 9
#define in1 6
#define in2 7
#define enB 5
#define gled 10
#define rled 11
void setup() {
pinMode(enA,OUTPUT);
pinMode(enB ,OUTPUT);
pinMode(in1,OUTPUT);
pinMode(in2,OUTPUT);
pinMode(in3,OUTPUT);
pinMode(in4,OUTPUT);
pinMode(gled,OUTPUT);
pinMode(rled,OUTPUT);
digita... |
// Copyright (c) 2019 Hartmut Kaiser
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// This work is inspired by https://github.com/aprell/tasking-2.0
#include <pika/fut... |
#include "f3lib/types/Quaternion.h"
#include <math.h>
using namespace f3::types;
f3::types::Quaternion::Quaternion(float in_x, float in_y, float in_z, float in_w)
: x(in_x)
, y(in_y)
, z(in_z)
, w(in_w)
{
}
f3::types::Quaternion::Quaternion(const Quaternion & toCopy)
: x(toCopy.x)
, ... |
#include <EntityManager.h>
#include <ComponentManager.h>
#include <PrefabsManager.h>
#include <EntityComponentSystem.h>
#include <algorithm>
using namespace breakout;
EntityManager::EntityManager()
{
}
EntityManager::~EntityManager()
{
}
EntityManager& EntityManager::Get()
{
static EntityManager entityManager;... |
//hoare's partition
#include <iostream>
using namespace std;
void swap(int arr[],int a,int b){
int temp=arr[a];
arr[a]=arr[b];
arr[b]=temp;
}
int hpartition(int arr[],int l,int h){
int pivot=arr[l];
int i=l-1;
int j=h+1;
while (true) {
do{
i++;
}
while(arr[i]<pivot);
do{
j--;... |
/*
Generalized Menu Library
OpenMoco MoCoBus Core Libraries
See www.dynamicperception.com for more information
(c) 2008-2012 C.A. Church / Dynamic Perception LLC
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free... |
// FileDialogEx.cpp : 实现文件
//
#include "stdafx.h"
#include "CmnDlg.h"
#include "FileDialogEx.h"
// CFileDialogEx
IMPLEMENT_DYNAMIC(CFileDialogEx, CFileDialog)
CFileDialogEx::CFileDialogEx(BOOL bOpenFileDialog, LPCTSTR lpszDefExt, LPCTSTR lpszFileName,
DWORD dwFlags, LPCTSTR lpszFilter, CWnd* pParentWnd) :
CFil... |
#pragma once
#include <glm/glm.hpp>
class Program
{
public:
~Program();
GLuint getID() const {return id_;}
void load(const std::string& vertexPath, const std::string& fragmentPath);
void setUniform1i(const std::string& name, int val);
void setUniform1f(const std::string& name, flo... |
// Initialize Variables
float pot1 = 0;
float pot2 = 0;
int DesiredSteeringAngle = 0;
int past_steering_angle =0;
int wire_switch = 4;
int PistonState = 0;
unsigned long time_now = 0;
int period = 0;
int period_off = 100;
void setup() {
Serial.begin(9600);
// Configure pullup input resistor to digital pin 4
pi... |
//
// DlibInterface.h
// Author: Michael Bao
// Date: 9/6/2015
//
#pragma once
#include "shared/internal/InternalInterface.h"
#include "dlib/opencv/cv_image.h"
#include "dlib/opencv/to_open_cv.h"
template<typename ImagePixelType>
class DlibInterface: public InternalInterface<dlib::cv_image<ImagePixelType>>
{
public:
... |
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2007 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#include "core/pch.h"
#ifndef USE_ABOUT_FRAMEWORK
#include "platforms/unix/product/abo... |
#pragma once
#include <string>
#include <sstream>
#include <SDL2/SDL.h>
#include <SDL2/SDL_ttf.h>
#include "engine/graphics/LTexture.hpp"
class ScoreBoard{
private:
int PlayerScore = 0;
int OtherPlayerScore = 0;
LTexture* gScoreTextTexture = NULL;
std::stringstream scoreText;
LTextur... |
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
int main() {
vector<int> arr(5);
vector<int> nums;
for(int arr_i = 0; arr_i < 5; arr_i++){
cin >> arr[arr_i];
}
for (int i = 0; i < arr.size(); i++) {
int num = arr[i];
arr.erase(arr.begin()+i);
... |
// Created on: 1991-03-21
// Created by: Philippe DAUTRY
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GN... |
#pragma once
#include <lexer/tokens/identifier_token.hpp>
#include <lexer/tokens/literal_token.hpp>
#include <lexer/tokens/rule_token.hpp>
#include <lexer/tokens/token.hpp>
namespace prv {
namespace lex {
template <class TokenSpec>
class tokenizer {
using trie = detail::token_spec_trie<TokenSpec>;
... |
#include<iostream>
#include<cstdio>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
priority_queue<int> G[30010];
bool vis[30010];
void dfs(int k)
{
if (vis[k]) return;
for (int )
... |
#include <iostream>
#include <vector>
#include <stack>
using namespace std;
enum Operator {Plus, Minus, Prod, Divi};
class Solution {
public:
int evalRPN(vector<string>& tokens) {
for (string token: tokens) {
if(token == "+") {
calculate(Plus);
} else if(token == "-... |
// Created on: 2016-04-07
// Copyright (c) 2016 OPEN CASCADE SAS
// Created by: Oleg AGASHIN
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as publi... |
#pragma once
#include <tuple>
class QWidget;
class EditUserOutput;
class User;
namespace EditUserAssembler {
std::tuple<QWidget *, EditUserOutput *> assembly(const User &user, QWidget *parent = nullptr);
}
|
#ifndef _EnterPrivateRoomProc_H_
#define _EnterPrivateRoomProc_H_
#include "IProcess.h"
class Table;
class Player;
class EnterPrivateRoomProc :public IProcess
{
public:
EnterPrivateRoomProc();
virtual ~EnterPrivateRoomProc();
virtual int doRequest(CDLSocketHandler* clientHandler, InputPacket* inputPacket,Cont... |
class Category_673 {
class RHIB {
type = "trade_any_boat";
buy[] = {4,"ItemGoldBar10oz"};
sell[] = {2,"ItemGoldBar10oz"};
};
};
class Category_558 {
duplicate = 673;
};
|
/**
\file Selection.cpp
Selection class's implementation
\author Antoine Colmard (2014)
\author Nicolas Prugne (2014)
\copyright 2014 Institut Pascal
*/
#include "Selection.h"
// -----------------------------------------------------------------------------
// CONSTRUCTOR
// ------------------------------------------... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2011 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#ifndef _UPDATE_MAN_H_
#define _UPDATE_MAN_H_
#ifdef UPDATERS_E... |
#ifndef LEVIN_BASE_H
#define LEVIN_BASE_H
#include <boost/function.hpp>
#include <gsl/gsl_linalg.h>
#include "levinFunctions.h"
#include "Bispectrum.hpp"
/**
* Numerical integration of \f[I[F]=\int_a^b\mathrm{d}x\,\langleF,w\rangle\f] using a Levin-type method with n points
* and the basis \f$u_m(x)\f$, \f$m=1,..,n\... |
#include <iostream>
using namespace std;
bool checkWin(int board[][3], int player) {
// horizontal
for (int i = 0; i < 3; i++) {
if (board[i][0] == player && board[i][1] == player && board[i][2] == player) return true;
}
// vertical
for (int i = 0; i < 3; i++) {
if (board[0][i] ==... |
#ifndef INVOKER_H
#define INVOKER_H
#include <cstdlib>
#include "command.h"
class Invoker
{
private:
Command * executor;
Command * undoer;
public:
Invoker(void);
Invoker(Command * executor);
Invoker(Command * executor, Command * undoer);
void execute(void) thro... |
#include <string>
#include <cstdlib>
#include <sstream>
#include "BigQ.h"
//Comparison function object
Sorter::Sorter(OrderMaker &sortorder): _sortorder(sortorder){}
bool Sorter::operator()(Record *i, Record *j){
ComparisonEngine comp;
if(comp.Compare(i, j, &_sortorder) < 0)
return true;
else
return fal... |
//
// Created by Yujing Shen on 29/05/2017.
//
#include "../../include/nodes/MSENode.h"
namespace sjtu{
MSENode::MSENode(Session *sess, const Shape &shape) :
SessionNode(sess, shape)
{
}
MSENode::~MSENode()
{
}
Node MSENode::forward()
{
const Tensor pred = _port_in[0... |
// AI_Dijkstra.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include "dijkstrasSearch.h"
int main()
{
//structure looks like this
// >N5--1-->N4
// / \
// 1 1
// / \>
// N1--10-->N2--10-->N3
//set up list of nodes
std::list<Pathfinding::Node... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2008 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*
* George Refseth, rfz@opera.com
*/
#include "core/pch.h"
#i... |
#include <iostream>
#include <queue>
#include <vector>
int n, m, check[32001];
std::vector<int> next[32001];
std::priority_queue<int> pq;
int main()
{
std::cin.sync_with_stdio(false);
std::cin.tie(NULL);
std::cin >> n >> m;
for(int i = 0; i < m; i++)
{
int A, B;
std::cin >> A >> B;
... |
#pragma once
namespace BeeeOn {
/**
* Very simple evaluator of math expressions. It performs operations
* with left-associativity. Thus, there is no operator precedence
* applicated. Examples:
*
* y = 2 + 5 * 1 - 3 / 2 * 5
* -> 7 * 1 - 3 / 2 * 5
* -> 7 - 3 / 2 * 5
* -> 4 / 2 * 5
* -> 2 * 5
* ... |
#include <iostream>
using std::cout;
using std::endl;
using std::cin;
#include <random>
#include <chrono>
using namespace std::chrono;
#include <ctime>
// class called stopwatch that uses the chrono header
class StopWatch {
public:
auto StartWatch() {
//Creates the first time point
auto start = steady_clock:... |
#include <stdio.h> // basic I/O
#include <stdlib.h>
#include <sys/types.h> // standard system types
#include <netinet/in.h> // Internet address structures
#include <sys/socket.h> // socket API
#include <arpa/inet.h>
#include <netdb.h> // host to IP resolution
#include <string.h>
#include <unistd.h>
#include <ctype.h>
#... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2011 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser.
** It may not be distributed under any circumstances.
*/
#ifndef ACTUTIL_H
#define ACTUTIL_H
#include "modules/search_eng... |
/*
* Copyright 2019 LogMeIn
*
* 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 w... |
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <string>
#include <iostream>
#include <utility>
using namespace std;
//// METHODS TO MANAGE MESSAGE
/**
* Purpose:
* Convert char*... |
#include "widget.h"
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QDebug>
#include <QString>
#include <QMessageBox>
Widget::Widget(QWidget *parent)
: QWidget(parent)
{
this->setWindowTitle("多功能计算器");
this->setMinimumSize(400, 200);
this->setMaximumSize(400, 200);
op1 = new QLineEdit(this)... |
#include "positionComponents.h"
positionComponents::positionComponents(float x, float y) {
this->xposition = x;
this->yposition = y;
}
float positionComponents::getxposition() {
return xposition;
}
float positionComponents::getYposition() {
return yposition;
}
|
#include <queue>
#include <string>
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <vector>
#include <graphicsim.h>
using namespace std;
class taxiway;
extern vector<taxiway*> mainPath;
extern taxiway *rwCommon;
extern vector<taxiway*> toGate;
extern vector<taxiway*> fromGate;
class simEntity{
p... |
//: C14:Car.cpp
// Public composition
class Engine {
public:
void start() const {}
void rev() const {}
void stop() const {}
};
class Wheel {
public:
void inflate(int psi) const {}
};
class Window {
public:
void rollup() const {}
void rolldown() const {}
};
class Door {
public:
Window window;
void open() const {... |
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
// Вычислить удвоенное число, добавить к нему 5 и снова удвоить результат
// а так неправильно!
// int result = 10 << 1 + 5 << 1;
// V 1.0
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
#include<iost... |
#ifndef FORMAT_H
#define FORMAT_H
#include <codecvt>
#include <locale>
#include <string>
#include <list>
namespace utils {
inline std::wstring s2ws(const std::string &str)
{
return std::wstring_convert<std::codecvt_utf8<wchar_t>>().from_bytes(str);
}
inline std::string ws2s(const std::wstring &wstr)
{
return... |
/*
Coded by: Rajendra Jain on March 23 2017.
This is my attempt to create a library of classes dealing with time.
The background work comes from the TimeLib
The Virtual base class TimeClass maintains the methods to maintain manage
time within a local clock. It updates the local clock from a time source every
... |
#include "cJailDistrict.h"
#include <iostream>
cJailDistrict::cJailDistrict()
{
}
cJailDistrict::~cJailDistrict()
{
}
bool cJailDistrict::Actioon()
{
std::cout << "cJailDistrict::Actioon()" << std::endl;
return true;
}
|
#include <iostream>
#include <vector>
#include <exception>
#include <thread>
#include <functional>
#include <chrono>
#include <mutex>
#include <condition_variable>
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/objdetect.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/c... |
/** Kabuki SDK
@file /.../Source/Kabuki_SDK-Impl/_G/Layer.h
@author Cale McCollough
@copyright Copyright 2016 Cale McCollough ©
@license Read accompanying /.../README.md or online at http://www.boost.org/LICENSE_1_0.txt
@brief This file contains the _G.Layer class.
*/
#include "_... |
#pragma once
#include "header.h"
#include "JPGImage.h"
#include "displayableobject.h"
#include "player.h"
#include "templates.h"
class zombie :
public DisplayableObject
{
public:
//zombie(BaseEngine* pEngine, int intZombieType, char zombieFile[12]);
zombie(BaseEngine* pEngine);
~zombie(void);
void Draw();
void D... |
#define INTERRUPT_PIN 3
#define GREEN_LED 4
#define RED_LED 6
ISR(INT1_vect){
//interrupt handling
//turn on green led when subroutine is called
PORTD |= (1<<GREEN_LED);
delay(10); //hold for 10 milliseconds
cli();
sei();
}
void setup(){
DDRD &= ~(1<<INTERRUPT_PIN);
PORTD |= (1<<INTERRUPT_PIN); //inte... |
/********************************************************************************
** Form generated from reading UI file 'dialog.ui'
**
** Created by: Qt User Interface Compiler version 5.8.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************... |
#ifndef STACK_HPP
#define STACK_HPP
#include "vector.hpp"
class Stack : private Vector {
public:
void push(int value);
void pop();
void printStack();
};
#endif
|
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2003 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#include "core/pch.h"
#include "modules/dom/src/domglobaldata.... |
//知识点:状态压缩 DP/记忆化搜索
/*
可以使用二进制拆分,
来模拟队列中 牛 的存在情况
以进行状态压缩
如: 9(十进制) = 1001(二进制) ,
表示队列中有第1头和第4头牛
可以使用记忆化搜索
这里打了一个状态压缩DP
数组f[i][j]
表示 队列情况为i,队末为j的队列
满足条件的方案数
状态转移方程: f[i+(1<<(k-1))][k]+=f[i][j];
表示向 队列情况为i,队末为j的队列 的末尾
添加一头编号为k的牛
最后统计出所有满队列的答案总和
即:队列中有n人的队列的答案总和
*/
#include<cstdio>
#inclu... |
#include <swDuino.h>
#include <IRremote.h>
swDuino objswDuino;
const int low_duration = 520;
const int high_duration = 1100;
IRsend irsend;
unsigned int receivedCommand[197];
void setup() {
Serial.begin(9600);
}
void loop() {
objswDuino.read(trigger);
}
void trigger(String VARIABLE, String VALUE) {
if (V... |
/* modified from NAMD */
#ifndef COMPUTEPME_H
#define COMPUTEPME_H
#include "pmetest.h"
#include "PmeBase.h"
#include "Vector.h"
class PmeRealSpace;
class ComputePmeMgr;
class ComputePme { //: public ComputeHomePatches {
public:
ComputePme(const PmetestParams &); //ComputeID c);
virtual ~ComputePme();
void d... |
// Copyright 2020 Fuji-Iot authors. All rights reserved.
//
// 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 appli... |
/*
* MacFileHandlerCache.h
* Opera
*
* Created by Adam Minchinton on 5/14/07.
* Copyright 2007 Opera. All rights reserved.
*
*/
#include "modules/util/adt/opvector.h"
#include "modules/pi/OpBitmap.h"
class MacFileHandlerCache
{
public:
OP_STATUS CopyInto(OpVector<OpString>& handlers,
OpVector<OpStri... |
/**
* created: 2013-4-8 13:12
* filename: FKCheckNameSvr
* author: FreeKnight
* Copyright (C):
* purpose:
*/
//------------------------------------------------------------------------
#include "FKCheckNameSvr.h"
#include "../FKSvr3Common/FKCommonInclude.h"
#include <malloc.h>
#include <Ole2.h>
#include <stdi... |
#include <iostream>
#include <vector>
#include <memory>
#include <cassert>
#include <random>
#include <iomanip>
#include "Utils/NotNull.hpp"
#include "NodeSpecs.hpp"
#include "NodeBuilders/NodeBuilder.hpp"
#include "NodeBuilders/BinaryNodeBuilder.hpp"
#include "BuilderStorage.hpp"
#include "NetworkBuilder.hpp"
#include... |
#ifndef GETSAVEFILENAMEWIDGET_H
#define GETSAVEFILENAMEWIDGET_H
// RsaToolbox
#include <LastPath.h>
// Qt
#include <QWidget>
namespace RsaToolbox {
namespace Ui {
class getSaveFileNameWidget;
}
class getSaveFileNameWidget : public QWidget
{
Q_OBJECT
Q_PROPERTY(QString filePath READ filePath WRITE setFilePa... |
//
// Created by wind on 2023/3/28.
//
#include <string.h>
#include "asset_png_decoder.h"
AssetPngDecoder::AssetPngDecoder(AAssetManager* mgr ,char *fName): PngDecoder(fName) {
asset = AAssetManager_open(mgr, fName, AASSET_MODE_STREAMING);
if (asset==NULL){
ALOGE("AssetPngDecoder open assert error");... |
#include "Knight.h"
const WeaponType Knight::types = {WeaponType::lance};
Knight::Knight(std::string name):Character()
{
this->setName(name);
this->setHealth(28);
this->setStrength(12);
this->setDefense(7);
this->setSpeed(7);
this->setMovement(6);
this->setSkill(8);
this... |
#pragma once
#include "RigidBody.h"
#include "Poly.h"
#include <vector>
#include "Transform.h"
using std::vector;
class Stitched :
public RigidBody
{
public:
Stitched(vector<vector<vec2>> const& allVertices, vec2 position, vec2 velocity, float rotation, float fAngVel, float mass, float elasticity, float... |
/********************************************************************************
** Form generated from reading UI file 'classwidget.ui'
**
** Created by: Qt User Interface Compiler version 5.2.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
***************************************... |
// Created on: 1992-10-14
// Created by: Christophe MARION
// Copyright (c) 1992-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.