好吧,是自己反傻了,原來finish標(biāo)識設(shè)置為1之后,再次start的時候沒有重新置為0...
你都對需求進(jìn)行交付了!
可以重構(gòu),但是你要考慮當(dāng)下適不適合重構(gòu)!
你覺得有很大問題需要重構(gòu),那你要跟領(lǐng)導(dǎo)商量啊
在官方文檔的Introduction部分其實(shí)就講到了,文檔傳送門:
- Every method you invoke on a connection is queued and executed in sequence.
舉例,下面的兩個調(diào)用,在內(nèi)部是排隊(duì)執(zhí)行的。
connection.query('SELECT * FROM hello');
connection.query('SELECT * FROM world');
兩者的區(qū)別很明顯,還是以前面的代碼為例子。
1、connection.end():把查詢1、查詢2順利執(zhí)行完,得到查詢結(jié)果后,斷開mysql服務(wù)器的連接。
2、connection.destryo():直接斷開連接,不管還有多少查詢沒執(zhí)行完。
connection.query('SELECT * FROM hello'); // 查詢1
connection.query('SELECT * FROM world'); // 查詢2
jsdata() {return {content: '<a href="xxx">點(diǎn)擊進(jìn)入</a> <span>Hello 你好</span>'
}}`
模板<div>{{content}}</div>
第一種語境下,a(i);
是一個語句(statement),此時編譯器會把它解析成變量聲明,由此局部變量i
與函數(shù)參數(shù)重名。
根據(jù)語法,它可以被解釋成函數(shù)式顯式類型轉(zhuǎn)換或者聲明,存在二義性。標(biāo)準(zhǔn)約定將其解釋成聲明。
9.8.1 There is an ambiguity in the grammar involving expression-statements and declarations: An expression statement with a function-style explicit type conversion (8.2.3) as its leftmost subexpression can be indistinguishable from a declaration where the first declarator starts with a (. In those cases the statement is a declaration.
你給出的第二種語境下,a(i)
是ctor-initializer,不存在表達(dá)式、聲明二義性。
當(dāng)然有意義。
你覺得你用不到,很多時候是框架幫你做了這些事情。
我舉幾個例子
誠然,其實(shí)不用這些標(biāo)準(zhǔn)也能實(shí)現(xiàn)很多東西,但是我們?yōu)槭裁凑f面向接口編程,就是不需要知道實(shí)現(xiàn)細(xì)節(jié),也能很好的使用。
你確定你編譯出來了嗎?cout << *p;
你都沒加分號。另外#include <iostream>
和using namepspace std;
你加了嗎?還有C++的main
一定要return
一個整型的,而不是void
。
以下代碼我已經(jīng)測試過了,會輸出55。
#include <iostream>
using namespace std;
class base {
private:
int x;
public:
void setx(int a) {x = a;}
int getx() {return x;}
};
int main() {
int * p;
base a;
a.setx(55);
p = new int(a.getx());
cout << *p;
return 0;
}
因?yàn)?code>&&的優(yōu)先級比||
高,所以你給的例子去掉括號也不影響結(jié)果。加上括號只是使代碼更易讀。
但是有時候括號是必須的,比如a && (b || c)
,如果去掉括號結(jié)果就變成了(a && b) || c
。
0 荷葉,n 柱子這么想,假設(shè)河中有 n 個柱子:
這個過程似乎和漢諾塔很像,但是不是漢諾塔。
最后在這個基礎(chǔ)之上來考慮荷葉不為 0 的情況,由于荷葉上只能跳 1 只青蛙,相當(dāng)于只是將問題的規(guī)模放大了,所以最后答案是荷葉數(shù)量 + 1(直接跳到 R 柱的那個青蛙) 之后按河中柱子的個數(shù)依次乘以 2。
在/root/.bitcoin/下面創(chuàng)建配置文件bitcoin.conf
cp ./contrib/debian/examples/bitcoin.conf /root/.bitcoin/
直接運(yùn)行bitcoind
bitcoind
查看端口8332
lsof -i:8332
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
bitcoind 8331 root 9u IPv6 308456 0t0 TCP *:8332 (LISTEN)
做oj不要太依賴調(diào)試工具(比如單步debugger), 一般依次有以下解決方法:
具體到你的這份代碼, 補(bǔ)完頭文件是可以在gcc上運(yùn)行的. 如果你本地補(bǔ)完依然不行, 請貼出你的環(huán)境(編譯器)以及出錯信息.
另, 提供幾點(diǎn)出錯可能性:
#include<stdbool.h>
, 那麼需要_Bool
做聲明, #include<stdbool.h>
中的話做了typedef
, 可以直接寫bool
.#include <bits/stdc++.h>
, 所以線上粘貼時漏了頭文件.最後, 標(biāo)籤中只保留c和c++中的一個, 不要都貼.
可以看看這個java8的系列教程 : https://github.com/itguang/java8
#include <iostream>
#include <string>
const int Asize = 20;
int main()
{
using namespace std;
char line[Asize];
cout << "Type, and I shall repeat.\n";
int idx=0;
char temp{};
do{
cin.get(temp);
line[idx++] = temp;
if(idx==Asize-1){
idx=0;
}
}while(temp!='.');
cout<<string(line);
cout << "\nPlease excuse the slight confusion.\n";
return 0;
}
第一個媒體查詢后面少了個大括號,現(xiàn)在主流的編輯器應(yīng)該都會提示語法錯誤,正確的CSS代碼如下:
@media screen and (min-width:1080px) {
.outer{
width:1208px;
height:302px;
border:solid 5px red;
margin:0 auto;
}
.inner{
width:300px;
height:300px;
border:dashed 1px blue;
float:left;
text-align:center;
line-height:300px;
font-size:40px;
}
}
@media screen and (max-width:1080px) {
.outer{
width:100%;
min-width:404px;
height:604px;
border:solid 5px red;
margin:0 auto;
}
.inner{
width:49.5%;
height:300px;
border:dashed 1px blue;
float:left;
min-width:i200px;
text-align:center;
line-height:300px;
font-size:30px;
}
}
你把這個看成一個數(shù)學(xué)問題
階乘是什么?
f(1) = 1
f(n) = n * f(n-1)
所以就是
def f(n):
if n <= 0:
return 0
if n == 1:
return 1
return n * f(n-1)
ios打包需要xcode這個工具來打包,先用cordova生成文件夾,然后把ios這個文件夾移動到mac,用xcode這個工具打開文件夾,https://www.jianshu.com/p/019... 可以看一下這篇文章,寫的挺詳細(xì)的
public function msgId($spid, $sqid)
{
$timeStr = time();
//echo bindec(sprintf("%04s%05s%05s%06s%06s%022s%016s",decbin(date('m', $timeStr)),decbin(date('d', $timeStr)),decbin(date('H', $timeStr)),decbin(date('i', $timeStr)),decbin(date('s', $timeStr)),decbin($spid), decbin($sqid)));
return bindec(sprintf("%04s%05s%05s%06s%06s%022s%016s",decbin(date('m', $timeStr)),decbin(date('d', $timeStr)),decbin(date('H', $timeStr)),decbin(date('i', $timeStr)),decbin(date('s', $timeStr)),decbin($spid), decbin($sqid)));
}
$this->msgId('600010','2');
在這里面給你糾正一下思路
第一: 64位
里面只能存0-1之間的數(shù)值,也就是說都是2進(jìn)制數(shù)據(jù)
所以拼接一下2進(jìn)制數(shù)據(jù)就好了
月份(1-12)(【0001-1100】區(qū)間 4位)decbin(date('m', $timeStr))
日(1-31)(【00001-11111】區(qū)間 5位)decbin(date('d', $timeStr))
時(1-24)(【00001-11000】區(qū)間 5位)decbin(date('H', $timeStr))
分(1-59)(【000001-111011】區(qū)間 6位)decbin(date('i', $timeStr))
秒(1-59)(【000001-111011】區(qū)間 6位)decbin(date('s', $timeStr))
網(wǎng)關(guān)代碼(【0~0 - 1~1】22位)decbin($spid1)
// (如果這個網(wǎng)關(guān)代碼是22位0和1組成就不用decbin,本身就是2進(jìn)制了,如果不是的話,就變成二進(jìn)制)
序列號(區(qū)間 16位)decbin($spid2)
網(wǎng)關(guān)代碼多少位我沒洗數(shù),序列號,什么的位數(shù)你自己調(diào)就行了%04d%06d%05d%06d%06d【%021d%016d】<-這里
如果沒算錯的話是4+5+5+6+6+22+16應(yīng)該是64位了,那么這64位是一個2進(jìn)制的字符串,用bindec()轉(zhuǎn)換成十進(jìn)制的數(shù)值,存進(jìn)數(shù)據(jù)庫里面,那么數(shù)據(jù)庫存貯的2進(jìn)制數(shù)據(jù)就是符合你要的規(guī)定了,而且10進(jìn)制數(shù)據(jù),8位,64字節(jié),完美
變量名用點(diǎn)心$spid, $sqid
我以為是一個
下面這種方法也是簡單,邏輯上不好理解,但是還是挺簡單的,學(xué)習(xí)了
$messageId = 0;
$messageId |= $m << 60;
$messageId |= $d << 55;
$messageId |= $h << 50;
$messageId |= $i << 44;
$messageId |= $s << 38;
$messageId |= $spid << 16;
$messageId |= $sqid & 0xff;
echo $messageId
JS:
import lineChart from '../lineChart'
export default {
name: 'demo',
components: {
'line-chart': lineChart
},
// ...
}
HTML:
<template>
<div>
<line-chart></line-chart>
</div>
</template>
在編譯時加上參數(shù)就行了
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
不用 inplace (直接分成兩個數(shù)組排序,再合并) 的話就太簡單了,要 inplace 的話其實(shí)也可以不用手寫 iterator,手寫一個 reference 的 wrapper 就行了(然后直接調(diào)用任意 常規(guī) inplace 排序算法即可):
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
template <typename T>
class Ref {
T & t;
public:
Ref(T & t) : t(t) {
}
Ref(Ref & o) : t(o.t) {
}
Ref(Ref && o) : t(o.t) {
}
Ref & operator = (Ref & o) {
t = o.t;
return *this;
}
Ref & operator = (Ref && o) {
t = move(o.t);
return *this;
}
bool operator < (Ref const & o) const {
return t < o.t;
}
friend void swap(Ref & a, Ref & b) {
using std::swap;
swap(a.t, b.t);
}
};
void solution(vector<string> & ret) {
vector<Ref<string>> a;
vector<Ref<string>> b;
for (auto & c : ret) {
bool numeric = true;
for (auto const & d : c) {
if (!isdigit(d)) numeric = false;
}
if (numeric) a.emplace_back(c); else b.emplace_back(c);
}
sort(a.begin(), a.end());
sort(b.begin(), b.end());
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
vector<string> v;
string l;
getline(cin, l);
stringstream ss;
ss << l;
string s;
while (ss >> s) {
v.emplace_back(move(s));
}
solution(v);
bool first = true;
for (auto const & c : v) {
if (first) first = false; else cout.put(' ');
cout << c;
}
cout << '\n';
}
測試:
輸入
2 Banana 1 Apple 3 Pear
輸出
1 Apple 2 Banana 3 Pear
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
北大青鳥中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團(tuán)創(chuàng)建于1999年,經(jīng)過二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術(shù)與教育服務(wù)機(jī)構(gòu),發(fā)展為教育服務(wù)業(yè)的綜合性企業(yè)集團(tuán),成為集合面授教學(xué)培訓(xùn)、網(wǎng)
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺面向?qū)ο箝_發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。