Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
71e8778
new version
Mar 30, 2021
c1ad70f
Create c-cpp.yml
Dashark Apr 2, 2021
6994e9c
testing for Github workflow
Apr 2, 2021
5d04d87
try to testing for Github workflow
Apr 2, 2021
cf5814c
try to testing Github workflow
Apr 2, 2021
f349aea
try to test Github workflow
Apr 2, 2021
d22ab83
add Cppcheck action
Apr 2, 2021
1f00505
Update main.cpp
Biuviu Apr 2, 2021
51680d4
first homework
Apr 2, 2021
75bcbd1
构造函数好吧
Apr 6, 2021
e4417ff
对象的容器
Apr 6, 2021
0efd0c3
对象的容器
Apr 6, 2021
4f48159
first version
Apr 13, 2021
c27f395
detroyer error
Apr 13, 2021
0d5c834
cout some infos
Apr 13, 2021
3225b48
vector to create or destroy object
Apr 13, 2021
2ebfb09
version 2
Apr 13, 2021
0c6fe07
add member function
Apr 13, 2021
8c2bafe
new homework
Dashark Apr 13, 2021
d0202fd
compile new homework
Dashark Apr 13, 2021
7ced164
test
Biuviu Apr 14, 2021
9a9338c
Merge remote-tracking branch 'upstream/master'
Biuviu Apr 15, 2021
f7680ec
xx
Biuviu Apr 15, 2021
c83b380
Delete HelloWorld.cpp
Biuviu Apr 15, 2021
19886af
Create HelloWorld.cpp
Biuviu Apr 15, 2021
fd6d1a0
Update SuperPrime-HW2.cpp
Biuviu Apr 17, 2021
761d853
update
Biuviu Apr 17, 2021
e891fc6
Update SuperPrime-HW2.cpp
Biuviu Apr 17, 2021
1ffcad9
Update SuperPrime-HW2.cpp
Biuviu Apr 17, 2021
52f147e
update
Biuviu Apr 20, 2021
f154d6b
继承
Apr 20, 2021
421cd25
Update SuperPrime-HW2.cpp
Biuviu Apr 20, 2021
f9113c7
Update SuperPrime-HW2.cpp
Biuviu Apr 20, 2021
fa300d2
Update SuperPrime-HW2.cpp
Biuviu Apr 20, 2021
b25caa9
hh
Biuviu Apr 20, 2021
967da80
Update SuperPrime_HW2.cpp
Biuviu Apr 20, 2021
62aec7e
Update SuperPrime_HW2.cpp
Biuviu Apr 20, 2021
c74be46
update
Biuviu Apr 23, 2021
d27e04f
Update SuperPrime_HW2.cpp
Biuviu Apr 23, 2021
ddae170
hll
Biuviu Apr 23, 2021
c728e6c
Update SuperPrime_HW2.cpp
Biuviu Apr 23, 2021
2c790e5
hw12
Biuviu Apr 25, 2021
3e4e21a
hw12
Biuviu Apr 25, 2021
799bf2f
hw12
Biuviu Apr 25, 2021
2da15b4
hw12
Biuviu Apr 25, 2021
7778206
hw12
Biuviu Apr 25, 2021
6ecc3b2
hw12
Biuviu Apr 25, 2021
3c96f36
1930
Biuviu Apr 25, 2021
22d9cee
Update SuperPrime_HW2.cpp
Biuviu Apr 25, 2021
7e378fe
Update SuperPrime_HW2.cpp
Biuviu Apr 25, 2021
b5efd1a
Homework3
Apr 27, 2021
f3b2a36
Operator Overload
May 11, 2021
61ffa3f
merge remote-tracking branch 'upstream/master'
Biuviu May 14, 2021
97bbec7
Merge branch 'master' of https://github.com/Biuviu/hello-world
Biuviu May 14, 2021
9c3ba0c
test
Biuviu May 14, 2021
0132086
remove
Biuviu May 14, 2021
ab25034
Create SuperPrime_HW.cpp
Biuviu May 14, 2021
d39122b
Create SuperPrime_HW2.cpp
Biuviu May 14, 2021
87bf9a6
Merge pull request #162 from Biuviu/master
Dashark May 14, 2021
03f3027
Function Object && const && static
May 18, 2021
875f947
学生代码
May 25, 2021
08b51bd
helloworld add commit
Link-aka Jun 23, 2021
5e49331
丢失了上一个版本
Dashark Sep 26, 2021
e6a14df
Create leapyear1.cpp
Sep 29, 2021
25d61a8
Update leapyear1.cpp
Sep 29, 2021
ee0adb0
Update leapyear1.cpp
Sep 29, 2021
720688e
Update leapyear1.cpp
Sep 29, 2021
ecc2342
Update leapyear1.cpp
Sep 29, 2021
01acbaf
Update Course-3.cpp
Sep 29, 2021
0315bf7
Update Course-3.cpp
Sep 29, 2021
2ddb020
Update Course-3.cpp
Sep 29, 2021
1c0c058
Updated spelling
nikhilcse Oct 17, 2021
1bcf4ef
作业一
Dashark Oct 29, 2021
4167ca4
作业二
Dashark Oct 29, 2021
c31d024
作业三
Dashark Nov 4, 2021
8f637c4
作业四
Dashark Nov 4, 2021
d69a7d5
Merge pull request #165 from nikhilcse/patch-1
Dashark Nov 10, 2021
981d9d0
Merge pull request #164 from Link-aka/master
Dashark Nov 10, 2021
439c582
作业五
Dashark Nov 14, 2021
0d27443
Merge branch 'master' of github.com:Dashark/hello-world
Dashark Nov 14, 2021
52c5049
作业六
Dashark Nov 21, 2021
17deb37
一些记录
Dashark Dec 21, 2021
aa80457
SuperPrime实现
Dashark Mar 23, 2022
262d6a7
计划搞一个大纲
Dashark Apr 12, 2022
d99c778
一周小结
Dashark Apr 13, 2022
f45b27e
第9周课程
Dashark Apr 19, 2022
61d8904
Eigen的类图
Dashark Apr 24, 2022
f4ccd70
有点混淆
Dashark Apr 25, 2022
de13b94
多重继承与混杂模式
Dashark May 6, 2022
b20995d
Mixins和CRTP的大纲
Dashark May 10, 2022
51f5786
Mixins with CRTP
Dashark May 13, 2022
23ecb67
接口变更
Dashark May 17, 2022
3d790c0
交换两个变量的值
Oct 18, 2022
7ca2fbb
做了一个贾代马
Oct 18, 2022
84ade2a
条件语句
Oct 18, 2022
e00b07a
条件排序
Oct 18, 2022
c22611a
期末考试题
Dec 22, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: C/C++ CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: cppcheck-action
uses: deep5050/cppcheck-action@v2.0.0
- name: make
run: make
- name: make check
run: make check
- name: make distcheck
run: make distcheck
37 changes: 37 additions & 0 deletions Course-3.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//求一元二次方程的根
// 例如 :y = x2 + 10x + 17
// 当 x = 2, 求 y = 41
// 当 y = 2, 求 x = ?
#include <stdio.h>
#include <math.h>
float mysqrt(float n) {
// how to guess
float x = n/2;
while(...) {
if (x*x > n)
x = x/2;
else
x = (x+n)/2;
}
return 0.0f;
}
int main() {
float x1, x2;
float y, a, b, c, temp;
printf("Please input \n");
scanf("%f %f %f %f", &y, &a, &b, &c);
c = c - y;
temp = b*b - 4* a*c;
if(temp >= 0) {
temp = sqrt(temp);
a = 2 * a;
x1 = (-b + temp)/(a);
x2 = (-b - temp)/(a);
printf("Results \n");
printf("%f\n", x1);
printf("%f\n", x2);
}
else
printf("No Results \n");
return 0;
}
16 changes: 16 additions & 0 deletions Eigen/plantuml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@startuml

PlainObjectBase <|-- Matrix
PlainObjectBase <|-- Array

MatrixBase <|-- PlainObjectBase
ArrayBase <|-- PlainObjectBase

DenseBase <|-- MatrixBase
DenseBase <|-- ArrayBase

DenseCoeffsBase <|-- DenseBase

class EigenBase <<Derived>>
EigenBase <|-- DenseCoeffsBase
@enduml
69 changes: 69 additions & 0 deletions FCdemo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#include <algorithm>
#include <iostream>
#include <set>
#include <unordered_set>
#include <string>
#include <vector>
// -std=c++11
using namespace std;
//constant
class Person
{
public:
Person(string lastname, string firstname)
: _firstname(firstname), _lastname(lastname)
{
}
string firstname() const
{
return _firstname;
}
string lastname() const
{
return _lastname;
}
private:
const string _firstname = nullptr;
const string _lastname = nullptr;
};

class PersonSortCriterion
{
public:
bool operator()(const Person &p1, const Person &p2) const
{
return p1.lastname() < p2.lastname() ||
(p1.lastname() == p2.lastname() && p1.firstname() < p2.firstname());
}
};
class PersonSortCriterion1
{
public:
bool operator()(const Person &p1, const Person &p2) const
{
return p1.lastname() > p2.lastname() ||
(p1.lastname() == p2.lastname() && p1.firstname() > p2.firstname());
}
};

int main(void)
{
set<Person, PersonSortCriterion1> coll;
//unordered_set<Person> coll;
Person p1("yu", "g");
Person p2("an", "yu");
Person p3("xiao", "ming");
Person p4("xi", "biaoge");
Person p5("u", "ong");
coll.insert(p1);
coll.insert(p2);
coll.insert(p3);
coll.insert(p4);
coll.insert(p5);
for (auto i : coll)
{
cout << i.lastname() << ", " << i.firstname() << endl;
}

return 0;
}
22 changes: 19 additions & 3 deletions HelloWorld.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
#include <stdio.h>
int main() {
printf("Hello World!\n");

//try Jenkins again
int x, y, z, temp;
// �����������������մӴ�С���
scanf("%d %d %d", &x, &y, &z);
if ( y < z ) {
temp = y;
y = z;
z = temp;
}
else if ( x < y ) {
temp = x;
x = y;
y = temp;
}
else if ( y < z ) {
temp = y;
y = z;
z = temp;
}
printf("%d, %d, %d\n", x, y, z);
return 0;
}
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
all: main sp

main:main.cpp
$(CXX) main.cpp -o main

sp:SuperPrime_HW.cpp
$(CXX) SuperPrime_HW.cpp -o sp
$(CXX) SuperPrime_HW2.cpp -o sp

check:


distcheck:
72 changes: 72 additions & 0 deletions Mixins.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/**
* 组合模式
* 在 TaggableImpl 中实现打标签的逻辑
* Post 类和 TaggableImpl 类都实现 Taggable 接口
* Post 类中创建一个 TaggableImpl 实例并在实现 Taggable 时将相应方法调用委托过去。
*/


import java.util.List;
import java.util.ArrayList;

interface Entity {
public int getId();
public int getKind();
}

interface Taggable {
public void addTag(int tagId);
public List<Integer> getTags();
}

class TaggableImpl implements Taggable {
private Entity target;

public TaggableImpl(Entity target) {
this.target = target;
}

public void addTag(int tagId) {
int id = target.getId();
int kind = target.getKind();
System.out.println("insert into ... values "
+ id + ", "
+ kind + ", "
+ tagId + ")");
}

public ArrayList<Integer> getTags() {
// query from database
return new ArrayList<Integer>();
}
}

class Post implements Entity, Taggable {
public final static int KIND = 1001;

private Taggable taggable;
private int id;
private String title;

public Post(int id, String title) {
this.id = id;
this.title = title;
this.taggable = new TaggableImpl(this);
}

public int getId() {
return id;
}

public int getKind() {
return KIND;
}

public void addTag(int tagId) {
taggable.addTag(tagId); // delegate
}

public ArrayList<Integer> getTags() {
return taggable.getTags(); // delegate
}
}
45 changes: 45 additions & 0 deletions Operator.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#include <iostream>
class Parent {
public:
Parent(int n) {
flag = n;
std::cout << "Parent()" << flag << std::endl;
}
virtual ~Parent(){
std::cout << "~~~Parent()" << flag << std::endl;
}
//other methods????
void show();
private:
//attributes??
int flag;
};
class Child : public Parent {
public:
Child(int n):Parent(n) {
flag = n;
std::cout << "Child()" << n << std::endl;
}
virtual ~Child(){
std::cout << "~~~Child()" << flag << std::endl;
}
//other methods????
//function object
void operator() (int n) {
}
private:
//attributes??
int flag;
void operator= (const Child &c) {
std::cout << "operator = " << flag << std::endl;
}
};
int main() {
Parent *p;
p = new Child(1);
Child c(2);
//c = Child(3);
//p->?????();
delete p;
return 0;
}
2 changes: 2 additions & 0 deletions PQPrime.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// 求 p 和 q
// 当 p 和 q 都是素数,求 p 和 q
3 changes: 3 additions & 0 deletions PQPrime.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$p^q + q^p$是一个素数,
$p$和$q$也是素数,
求$p$和$q$
Loading