- 博客(41)
- 资源 (1)
- 收藏
- 关注
原创 VUE中table的行高被撑大
table被撑大的两种情况:1.字符串内容过长,使表格自动换行。解决方法:自行搜索,有很多。2.被table中的组件大小被撑大。这是一种很难被发现的撑大现象。解决方案:增大表格的高度、或者直接减小组件的大小,即直接在vue中修改组件的样式。...
2021-03-17 15:01:42 1310 2
原创 Spring Boot 的@Value注解获取配置文件中常量的值
1.application.properties#songsong.age = 172.controller或service等文件public class Person{ @Value("${song.age}") private int age;}
2020-11-04 17:14:08 757
原创 JAVA把特定的变量输出到日志
JAVA把特定的变量输出到日志例子在service中写的import org.slf4j.Logger;import org.slf4j.LoggerFactory;@Servicepublic class StatusServiceImpl implements StatusService { private static Logger logger = LoggerFactory.getLogger(StatusServiceImpl.class); //在想输出的位置下面的语句
2020-10-30 11:27:12 374
原创 C++课后题(重载函数)
1>为什么不能通过返回值不同来重载函数?2>利用重载函数的方法来设计一个程序,该程序通过函数“calc()”进行计算并返回结果。/* * */#include<iostream>using namespace std;int calc(int Squ){ return Squ*Squ;}int calc(int a,int b){ return ...
2019-07-07 22:31:28 680
原创 C++的比较
/* * */#include<iostream>using namespace std;int main(){ char str1[] = "abc"; char str2[] = "abc"; const char str3[] = "abc"; const char str4[] = "abc"; const char* str5 = "abc"; co...
2019-07-02 20:04:04 527
原创 C++的a+++b
/* * */#include<iostream>using namespace std;int main(){ int a=1; int b=2; cout << a+++b << endl; system("pause"); return 0;}
2019-07-02 17:53:55 1680
原创 C++的在不用第三个参数的情况下,交换两个参数。
/* *在不用第三个参数的情况下,交换两个参数。 */#include<iostream>using namespace std;int main(){ int a=1; int b=2; a = a + b; b = a - b; a = a - b; cout <<"a="<< a << endl; cout <...
2019-07-02 17:37:35 402
原创 C++的sizeof()与指针
/* *sizeof()与指针 */#include<iostream>using namespace std;void main(){ //字符和字符串 char str[] = "world"; char* p = str; char i = 10; //整形 int j = 10; short int k = 10; long int l = 10; ...
2019-07-02 17:21:22 1767
原创 C++求一行的整数和
/* *输入一串整数和任意数目的空格,这些整数必须位于同一行中,输出所有的整数的和。 */#include<iostream>using namespace std;void main(){ int sum=0; cout << "请输入一串整数和任意数目的空格:" << endl; int i; while(cin >> i)...
2019-06-25 10:47:27 772
原创 C++ 指针与sizeof
/* *指针和sizeof */#include<iostream>//using namespace std;void main(){ int* a; short* b; double* c; std::cout << sizeof(a)<<std::endl; std::cout << sizeof(b) <<...
2019-06-24 22:41:00 335
转载 单链表反转
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: ListNode* re...
2019-06-20 22:31:53 385
原创 VIVO的2020年秋招(提前批)(软件开发岗)第一题(VS2015)
/*VIVO的2019年秋招(提前批)(软件开发岗)第一题A,B为两个数组集合,请输出A中不包含B的全部数;例如输入:1 2 3 5 2 3 4输出:1 5*/#include<iostream>using namespace std;#define ARRAY1_MAX_LEN 100#define ARRAY2_MAX_LEN 100//W...
2019-06-09 15:56:38 827
原创 C++中return的作用
一直不明白return是什么。return分两类:1.return不带返回值,应用于void,相当于break。2.return带返回值,
2019-06-07 18:05:16 21898 1
原创 c++核心篇11(继承与派生)
1.以公有方式继承#include <iostream> using namespace std;class CEmployee //定义员工类{public: int m_ID; //定义员工ID char m...
2019-05-04 17:46:13 484
原创 c++核心技术10(类和对象)
1.使用构造函数进行初始化操作#include <iostream>using namespace std;class CPerson{public: CPerson(); CPerson(int ilndex, short m_shAge, double m_dSalary); int m_ilndex; short m_shAge; double m_dSala...
2019-04-28 11:45:11 347
原创 c++基础篇8(构造数据类型)
1.为结构体成员赋值#include <iostream>using namespace std;void main(){ struct Personlnfo { int index; char name[30]; short age; }plnfo; plnfo.index = 0; plnfo.age = 20; cout << pln...
2019-04-25 21:39:18 601
原创 c++基础篇7(数组、指针、引用)
1.单一数组元素赋值#include <iostream>using namespace std;void main(){ char a[3]; a[0] = 'j'; a[2] = 'k'; cout << a[0] << endl; system("pause");}结果:2.一维数组赋值#include <iost...
2019-04-21 21:06:13 165
原创 c++基础篇6(函数)
1.声明、定义和使用函数#include <iostream>using namespace std;void show(); //函数声明语句void main(){ show(); //函数调用 system("pause");}void show() //函数定义{ cout << "爱你,胖胖" <<...
2019-04-19 21:20:33 2132
原创 c++基础篇5(循环语句)
1.实现1到10的求和(while)#include <iostream>//using namespace std;void main(){ int i = 1,sum=0; while (i <= 10) { sum = sum + i; i = i + 1; } printf("sum=%d\n",sum); system("pause");}...
2019-04-18 14:15:22 947
原创 c++基础篇4(条件判断语句)
1.判断输入数是否为奇数#include<iostream>using namespace std;void main(){ int input; cout << "请输入整数" << endl; cin >> input; if (input % 2 != 0) { cout << "输入为奇数" <<...
2019-04-12 14:55:13 15259
原创 c++ 基础篇3(表达式与语句)
1求逻辑表达式的值#include<iostream>void main(){ int i = 5, j = 8, k = 12, l = 4, x1, x2; x1 = i > j&&k > l; x2 = !(i > j) && k > l; printf("%d,%d\n", x1, x2); system(...
2019-04-09 22:45:34 182
原创 c++基础篇2(数据类型)
1.字符型数据进行运算#include <iostream>//using namespace std;void main(){ char ch1, ch2; ch1 = 'a'; ch2 = 'A'; printf("ch1=%d\n",ch1); printf("ch2=%d\n",ch2); printf("ch1=%c,ch2=%c\n", ch1 - 32...
2019-04-09 10:02:13 145
原创 c++运行报错
一严重性 代码 说明 项目 文件 行 禁止显示状态错误 LNK1168 无法打开 D:\Documents\Visual Studio 2015\Projects\Project3-2.2\Debug\Project3-2.2.exe 进行写入 Project3-2.2 D:\Documents\Visual Studio 2015\Projects\Project3-2.2\Project3...
2019-04-09 09:12:35 985
翻译 c++字符型数据与整数型数据间运算
#include <iostream>using namespace std;void main(){ char a1, a2; a1 = 'a'; a2 = 'b'; printf("%c%d\n%c%d\n", a1, a1, a2, a2); printf("%c,%d\n%c,%d\n", a1, a1, a2, a2); system("pause");}...
2019-04-08 22:45:22 1022
翻译 c++ 输出字符常量
#include <iostream>void main(){ std::cout << "A" << std::endl; std::cout << "\101" << std::endl; std::cout << "\x41" << std::endl; std::cout << "\...
2019-04-08 22:32:02 1636
翻译 c++ 输出常量
#include <iostream>using namespace std;void main(){ cout << 2017 << endl; cout << 2.17 << endl; cout << 'a' << endl; cout << "jk"<< endl; ...
2019-04-08 21:51:19 1216
翻译 c++ 注释例子
/*zhushi.cpp*/ #include <iostream> //头文件引用using namespace std; //命名空间void main() //主函数{ cout << "helloworld\n"; //执行输出...
2019-04-07 21:30:49 823
原创 c++ 实现helloworld例子(vs2015)
#include <iostream>using namespace std; //cout需要用void main(){ cout << "helloworld\n"; system("pause"); //显示控制台窗口}
2019-04-07 20:56:14 1338
翻译 tensorflow中神经网络的plot可视化
自己看吧# --coding:utf-8--import tensorflow as tfimport numpy as npimport matplotlib.pyplot as plt#添加隐藏层def add_layer(inputs,in_size,out_size,activation_function=None): Weights=tf.Variable(tf.r...
2019-04-07 11:25:19 1182
翻译 tensorflow实现一个神经网络例子
输入层是1个神经元隐藏层是10个神经元输出层是1个神经元希望对初学者有所帮助# --coding:utf-8--import tensorflow as tfimport numpy as np#添加隐藏层def add_layer(inputs,in_size,out_size,activation_function=None): Weights=tf.Variable...
2019-04-07 11:05:38 704
转载 tensorflow的添加层
import tensorflow as tfdef add_layer(inputs,in_size,out_size,activation_function=None): Weights=tf.Variable(tf.random_normal([in_size,out_size])) biases=tf.Variable(tf.zeros([1,out_size])+0.1...
2019-04-02 10:27:24 446
转载 tensorflow中的placehold
placehold和feed_dict必须一起用,feed_dict用于传入数值import tensorflow as tfa1=tf.placeholder(tf.float32)a2=tf.placeholder(tf.float32)output=tf.multiply(a1,a2)with tf.Session() as sess: print(sess.run(o...
2019-04-01 15:33:48 787
原创 tensorflow展开张量报错
InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'model_inputs/input_xc' with dtype float and shape [?,32,32,6] [[node model_inputs/input_xc (defined at ....
2019-03-31 17:45:27 642
翻译 tensorflow的Variable例子
实现一个不断加一的例子import tensorflow as tfs=tf.Variable(1,name='mengmengsong')#变量初始值,名字叫‘mengmengsong’print(s.name)a=tf.constant(1) #定义常量y=tf.add(s,a)update=tf.assign(s,y)init=tf....
2019-03-31 14:33:52 171
翻译 tensorflow中Session
Session的两种方式举例方式1:# -*- coding: utf-8 -*-import tensorflow as tfa=tf.constant([[1,1]])b=tf.constant([[3], [3]])y=tf.matmul(a,b)with tf.Session() as sess: result=sess.run(y)...
2019-03-31 09:19:47 811
转载 tensorflow寻求最优参数初学小例子
# -*- coding: utf-8 -*-import tensorflow as tfimport numpy as np#创建数据x_data=np.random.rand(100).astype(np.float32)y_data=x_data*0.1+0.4##create tensorflow structure start###Weights=tf.Variab...
2019-03-30 10:26:33 211
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人