array(2) {
["docs"]=>
array(10) {
[0]=>
array(10) {
["id"]=>
string(3) "428"
["text"]=>
string(77) "Visual Studio 2017 单独启动MSDN帮助(Microsoft Help Viewer)的方法"
["intro"]=>
string(288) "目录
ECharts
异步加载
ECharts
数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。
chart.setOption({
color: [
"
["username"]=>
string(8) "DonetRen"
["tagsname"]=>
string(55) "Visual Studio 2017|MSDN帮助|C#程序|.NET|Help Viewer"
["tagsid"]=>
string(23) "[401,402,403,"300",404]"
["catesname"]=>
string(0) ""
["catesid"]=>
string(2) "[]"
["createtime"]=>
string(10) "1511400964"
["_id"]=>
string(3) "428"
}
[1]=>
array(10) {
["id"]=>
string(3) "427"
["text"]=>
string(42) "npm -v;报错 cannot find module "wrapp""
["intro"]=>
string(288) "目录
ECharts
异步加载
ECharts
数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。
chart.setOption({
color: [
"
["username"]=>
string(4) "zzty"
["tagsname"]=>
string(50) "node.js|npm|cannot find module "wrapp“|node"
["tagsid"]=>
string(19) "[398,"239",399,400]"
["catesname"]=>
string(0) ""
["catesid"]=>
string(2) "[]"
["createtime"]=>
string(10) "1511400760"
["_id"]=>
string(3) "427"
}
[2]=>
array(10) {
["id"]=>
string(3) "426"
["text"]=>
string(54) "说说css中pt、px、em、rem都扮演了什么角色"
["intro"]=>
string(288) "目录
ECharts
异步加载
ECharts
数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。
chart.setOption({
color: [
"
["username"]=>
string(12) "zhengqiaoyin"
["tagsname"]=>
string(0) ""
["tagsid"]=>
string(2) "[]"
["catesname"]=>
string(0) ""
["catesid"]=>
string(2) "[]"
["createtime"]=>
string(10) "1511400640"
["_id"]=>
string(3) "426"
}
[3]=>
array(10) {
["id"]=>
string(3) "425"
["text"]=>
string(83) "深入学习JS执行--创建执行上下文(变量对象,作用域链,this)"
["intro"]=>
string(288) "目录
ECharts
异步加载
ECharts
数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。
chart.setOption({
color: [
"
["username"]=>
string(7) "Ry-yuan"
["tagsname"]=>
string(33) "Javascript|Javascript执行过程"
["tagsid"]=>
string(13) "["169","191"]"
["catesname"]=>
string(0) ""
["catesid"]=>
string(2) "[]"
["createtime"]=>
string(10) "1511399901"
["_id"]=>
string(3) "425"
}
[4]=>
array(10) {
["id"]=>
string(3) "424"
["text"]=>
string(30) "C# 排序技术研究与对比"
["intro"]=>
string(288) "目录
ECharts
异步加载
ECharts
数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。
chart.setOption({
color: [
"
["username"]=>
string(9) "vveiliang"
["tagsname"]=>
string(0) ""
["tagsid"]=>
string(2) "[]"
["catesname"]=>
string(8) ".Net Dev"
["catesid"]=>
string(5) "[199]"
["createtime"]=>
string(10) "1511399150"
["_id"]=>
string(3) "424"
}
[5]=>
array(10) {
["id"]=>
string(3) "423"
["text"]=>
string(72) "【算法】小白的算法笔记:快速排序算法的编码和优化"
["intro"]=>
string(288) "目录
ECharts
异步加载
ECharts
数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。
chart.setOption({
color: [
"
["username"]=>
string(9) "penghuwan"
["tagsname"]=>
string(6) "算法"
["tagsid"]=>
string(7) "["344"]"
["catesname"]=>
string(0) ""
["catesid"]=>
string(2) "[]"
["createtime"]=>
string(10) "1511398109"
["_id"]=>
string(3) "423"
}
[6]=>
array(10) {
["id"]=>
string(3) "422"
["text"]=>
string(64) "JavaScript数据可视化编程学习(二)Flotr2,雷达图"
["intro"]=>
string(288) "目录
ECharts
异步加载
ECharts
数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。
chart.setOption({
color: [
"
["username"]=>
string(7) "chengxs"
["tagsname"]=>
string(28) "数据可视化|前端学习"
["tagsid"]=>
string(9) "[396,397]"
["catesname"]=>
string(18) "前端基本知识"
["catesid"]=>
string(5) "[198]"
["createtime"]=>
string(10) "1511397800"
["_id"]=>
string(3) "422"
}
[7]=>
array(10) {
["id"]=>
string(3) "421"
["text"]=>
string(36) "C#表达式目录树(Expression)"
["intro"]=>
string(288) "目录
ECharts
异步加载
ECharts
数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。
chart.setOption({
color: [
"
["username"]=>
string(4) "wwym"
["tagsname"]=>
string(0) ""
["tagsid"]=>
string(2) "[]"
["catesname"]=>
string(4) ".NET"
["catesid"]=>
string(7) "["119"]"
["createtime"]=>
string(10) "1511397474"
["_id"]=>
string(3) "421"
}
[8]=>
array(10) {
["id"]=>
string(3) "420"
["text"]=>
string(47) "数据结构 队列_队列实例:事件处理"
["intro"]=>
string(288) "目录
ECharts
异步加载
ECharts
数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。
chart.setOption({
color: [
"
["username"]=>
string(7) "idreamo"
["tagsname"]=>
string(40) "C语言|数据结构|队列|事件处理"
["tagsid"]=>
string(23) "["246","247","248",395]"
["catesname"]=>
string(12) "数据结构"
["catesid"]=>
string(7) "["133"]"
["createtime"]=>
string(10) "1511397279"
["_id"]=>
string(3) "420"
}
[9]=>
array(10) {
["id"]=>
string(3) "419"
["text"]=>
string(47) "久等了,博客园官方Android客户端发布"
["intro"]=>
string(288) "目录
ECharts
异步加载
ECharts
数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。
chart.setOption({
color: [
"
["username"]=>
string(3) "cmt"
["tagsname"]=>
string(0) ""
["tagsid"]=>
string(2) "[]"
["catesname"]=>
string(0) ""
["catesid"]=>
string(2) "[]"
["createtime"]=>
string(10) "1511396549"
["_id"]=>
string(3) "419"
}
}
["count"]=>
int(200)
}
222
crack the coding interview - 爱码网
1.1
-
#ifndef __Question_1_1_h__
-
#define __Question_1_1_h__
-
-
#include <string>
-
-
using std::string;
-
-
class Question1_1
- {
-
public:
- int run();
- bool isUniqueChars(const string& str);
- bool isUniqueChars2(const string& str);
- string result(bool value);
- };
-
-
#endif
-
-
#include<iostream>
-
#include<string>
-
#include "Question1_1.h"
-
using namespace std;
-
-
bool Question1_1::isUniqueChars(const string& str)
- {
- if (str.length() > 256)
- {
- return false;
- }
-
- unsigned int checker = 0;
-
- for (int i = 0; i < str.length(); ++i)
- {
- int value = str[i] - 'a';
-
- if ((checker & (1 << value)) != 0)
- {
- return false;
- }
-
- checker |= (1 << value);
- }
-
- return true;
- }
-
-
bool Question1_1::isUniqueChars2(const string& str)
- {
- if (str.length() > 256)
- {
- return false;
- }
-
- bool ascii_set[256] = { false };
-
- for (int i = 0; i < str.length(); ++i)
- {
- int value = str[i];
-
- if (ascii_set[value])
- {
- return false;
- }
-
- ascii_set[value] = true;
- }
-
- return true;
- }
-
-
-
string Question1_1::result(bool value)
- {
- if (value)
- {
- return "True";
- }
-
- return "False";
- }
-
-
int Question1_1::run()
- {
- string input[] ={"abcde", "aba"};
-
- for (int i = 0; i < 2; i++)
- {
- cout << input[i] << " has unique characters: " << result(isUniqueChars(input[i])) << endl;
- cout << input[i] << " has unique characters: " << result(isUniqueChars2(input[i])) << endl;
- }
-
- return 0;
- }
1.2
-
#ifndef __Question_1_2_h__
-
#define __Question_1_2_h__
-
-
class Question1_2
- {
-
public:
- int run();
- void reverse(char* str);
- };
-
-
#endif
-
#include<iostream>
-
#include "Question1_2.h"
-
-
using std::cout;
-
using std::endl;
-
-
void Question1_2::reverse(char* str)
- {
- char *ptrEnd = str;
- char temp;
-
- if (str)
- {
- while (*ptrEnd)
- {
- ptrEnd++;
- }
- ptrEnd--;
-
- while (str < ptrEnd)
- {
- temp = *str;
- *str++ = *ptrEnd;
- *ptrEnd-- = temp;
- }
- }
- }
-
-
int Question1_2::run()
- {
- char input[][10] = { "abcde", "cat" };
-
- for (int i = 0; i < 2; i++)
- {
- cout << "reversing the string: " << input[i] << endl;
- reverse(input[i]);
- cout << "reverse of input string is " << input[i] << endl;
- }
-
- return 0;
- }
1.3
-
#ifndef __Question_1_3_B_h__
-
#define __Question_1_3_B_h__
-
-
#include <string>
-
-
using std::string;
-
-
class Question1_3_B
- {
-
public:
- int run();
- bool permutation(const string& a, const string& b);
- string result(bool value);
- };
-
-
#endif
-
-
#include<iostream>
-
#include<string>
-
#include<algorithm>
-
#include "Question1_3_B.h"
-
-
using namespace std;
-
-
bool Question1_3_B::permutation(const string& a, const string& b)
- {
- if (a.length() != b.length())
- {
- return false;
- }
-
- int ascii_set[256] = {0};
-
- for (int i = 0; i < a.length(); i++)
- {
- int val = static_cast<int>(a[i]);
- ascii_set[val]++;
- }
-
- for (int i = 0; i < b.length(); i++)
- {
- int val = static_cast<int>(b[i]);
-
- if ((--ascii_set[val]) < 0)
- {
- return false;
- }
- }
-
- return true;
- }
-
-
string Question1_3_B::result(bool value)
- {
- if (value)
- {
- return "True";
- }
-
- return "False";
- }
-
-
int Question1_3_B::run()
- {
- string a = "apple";
- string b = "papel";
-
- cout << "Result for " << a << " and " << b << " is " << result(permutation(a, b)) << endl;
-
- return 0;
- }
1.4
-
#ifndef __Question_1_4_h__
-
#define __Question_1_4_h__
-
#include <memory>
-
-
class Question1_4
- {
-
public:
- int run();
- void replaceSpaces(std::unique_ptr<char[]>&, int length);
- };
-
-
#endif
-
-
#include<iostream>
-
#include<memory>
-
#include<string>
-
#include "Question1_4.h"
-
-
using namespace std;
-
-
void Question1_4::replaceSpaces(unique_ptr<char[]> &str, int length)
- {
- int newLength, spaceCount = 0;
-
-
- for (int i = 0; i < length; i++)
- {
- if (str[i] == ' ')
- {
- spaceCount++;
- }
- }
-
-
- newLength = length + spaceCount * 2;
- str[newLength] = '\0';
-
-
- for (int i = length - 1; i >= 0; i--)
- {
- if (str[i] == ' ')
- {
- str[newLength - 1] = '0';
- str[newLength - 2] = '2';
- str[newLength - 3] = '%';
- newLength -= 3;
- }
- else
- {
- str[newLength - 1] = str[i];
- newLength--;
- }
- }
- }
-
-
int Question1_4::run()
- {
- string str = "abc d e f";
-
-
- auto newStr = make_unique<char[]>(str.length() + 3 * 2 + 1);
-
- for (int i = 0; i < str.length(); i++)
- {
- newStr[i] = str[i];
- }
-
- cout << "Original string is " << str << endl;
- replaceSpaces(newStr, str.length());
- cout << "New string with %20 is " << newStr.get() << endl;
-
- return 0;
- }
1.5
1.6
-
-
#ifndef __Question_1_6_h__
-
#define __Question_1_6_h__
-
-
class Question1_6
- {
-
public:
-
-
-
-
- void rotate(int* matrix, int n);
- void printMatrix(int* matrix, int m, int n);
- int run();
- };
-
-
#endif
-
-
#include <iostream>
-
#include <memory>
-
#include "Question1_6.h"
-
-
using namespace std;
-
-
void Question1_6::rotate(int* matrix, int n)
- {
- for (int layer = 0; layer < n / 2; ++layer)
- {
- int first = layer;
- int last = n - 1 - layer;
-
- for (int i = first; i < last; ++i)
- {
- int offset = i - first;
-
- int top = matrix[first * n + i];
-
-
- matrix[first * n + i] = matrix[(last-offset) * n + first];
-
-
- matrix[(last-offset) * n + first] = matrix[last * n + (last-offset)];
-
-
- matrix[last * n + (last-offset)] = matrix[i * n + last];
-
-
- matrix[i * n + last] = top;
- }
- }
- }
-
-
void Question1_6::printMatrix(int* matrix, int m, int n)
- {
- for (int i = 0; i < m; ++i)
- {
- for (int j = 0; j < n; ++j)
- {
- cout << matrix[i * n + j] << " ";
- }
-
- cout << endl;
- }
- }
-
-
int Question1_6::run()
- {
- int matrix[][5] ={{1, 2, 3, 4, 5},
- {6, 7, 8, 9, 10},
- {11, 12, 13, 14, 15},
- {16, 17, 18, 19, 20},
- {21, 22, 23, 24, 25}};
- int* matrixPtr = (int*)matrix;
-
- cout << "original matrix is :" << endl;
- printMatrix(matrixPtr, 5, 5);
- rotate(matrixPtr, 5);
- cout << "rotated matrix is: " << endl;
- printMatrix(matrixPtr, 5, 5);
-
- return 0;
- }
1.7
-
#ifndef __Question_1_7_h__
-
#define __Question_1_7_h__
-
-
class Question1_7
- {
-
public:
-
-
-
-
- void setZeros(int* matrix, int m, int n);
- void printMatrix(int* matrix, int m, int n);
- int run();
- };
-
-
#endif
-
-
#include <iostream>
-
#include "Question1_7.h"
-
-
using namespace std;
-
-
void Question1_7::setZeros(int* matrix, int m, int n)
- {
-
- int m_rows = 0;
- int m_cols = 0;
-
- for (int i = 0; i < m; ++i)
- {
- for (int j = 0; j < n; ++j)
- {
- if (matrix[i * n + j] == 0)
- {
- m_rows |= (1 << i);
- m_cols |= (1 << j);
- }
- }
- }
-
- for (int i = 0; i < m; ++i)
- {
- for (int j = 0; j < n; ++j)
- {
- if (((m_rows & (1 << i)) != 0) || ((m_cols & (1 << j)) != 0))
- {
- matrix[i * n + j] = 0;
- }
- }
- }
- }
-
-
void Question1_7::printMatrix(int* matrix, int m, int n)
- {
- for (int i = 0; i < m; ++i)
- {
- for (int j = 0; j < n; ++j)
- {
- cout << matrix[i * n + j] << " ";
- }
-
- cout << endl;
- }
- }
-
-
-
int Question1_7::run()
- {
- int matrix[4][5] ={{1, 2, 3, 4, 5},
- {6, 7, 8, 9, 10},
- {11, 12, 0, 14, 15},
- {16, 17, 18, 0, 20}};
- int* matrixPtr = (int*)matrix;
- cout << "original matrix is :" << endl;
- printMatrix(matrixPtr, 4, 5);
-
- setZeros(matrixPtr, 4, 5);
- cout << "zeroed matrix is: " << endl;
- printMatrix(matrixPtr, 4, 5);
-
- return 0;
- }
1.8
-
#ifndef __Question_1_8_h__
-
#define __Question_1_8_h__
-
-
#include <string>
-
-
using std::string;
-
-
class Question1_8
- {
-
public:
- string result(bool value);
- bool isRotation(const string& s1, const string& s2);
- int run();
- };
-
-
#endif
-
-
#include<iostream>
-
#include<string>
-
#include "Question1_8.h"
-
-
using namespace std;
-
-
bool Question1_8::isRotation(const string& s1, const string& s2)
- {
- int len = s1.length();
-
- if(len == s2.length() && len > 0)
- {
- string s1s1 = s1 + s1;
- return s1s1.find(s2) != string::npos;
- }
-
- return false;
- }
-
-
string Question1_8::result(bool value)
- {
- if (value)
- {
- return "True";
- }
-
- return "False";
- }
-
-
int Question1_8::run()
- {
- string a = "apple";
- string b = "leapp";
- cout << "Checking if string: " << a << " is a rotation of string: " << b << ": "
- << result(isRotation(a, b)) << endl;
-
- a = "james";
- b = "mesje";
- cout << "Checking if string: " << a << " is a rotation of string: " << b << ": "
- << result(isRotation(a, b)) << endl;
-
- return 0;
- }
相关文章: