This repository has been archived by the owner on Sep 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
0. update dirs and dslings impl 1. book: add cpp basic 2. dslings: template and range-base for Signed-off-by: SPeak <[email protected]>
- Loading branch information
1 parent
a403790
commit 9d95095
Showing
26 changed files
with
691 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef __DSLINGS_CONFIG_HPP__D2DS | ||
#define __DSLINGS_CONFIG_HPP__D2DS | ||
|
||
/* | ||
// checker config | ||
#define DSLINGS_0_CHECKER CHCKER_ENABLE | ||
#define DSLINGS_1_CHECKER CHCKER_ENABLE | ||
#define DSLINGS_2_CHECKER CHCKER_ENABLE | ||
#define TEMPLATE_0_CHECKER CHCKER_ENABLE | ||
#define TEMPLATE_1_CHECKER CHCKER_ENABLE | ||
#define TEMPLATE_2_CHECKER CHCKER_ENABLE | ||
#define CHCKER_ENABLE | ||
#define CHCKER_PASS return 0; | ||
*/ | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifndef __LOGGER_HPP__HONLY | ||
#define __LOGGER_HPP__HONLY | ||
|
||
#include <cstdio> | ||
|
||
#ifndef HONLY_LOGGER_TAG | ||
#define HONLY_LOGGER_TAG "HONLY" | ||
#endif | ||
|
||
#define LOG_ENABLE true | ||
#define _HONLY_LOG(fd, ...) if (LOG_ENABLE) fprintf (fd, __VA_ARGS__); fprintf (fd, "\033[0m\n") | ||
#define HONLY_LOGI(...) fprintf (stdout, "\033[32m[%s LOGI]: \t%s: %s:%d - ", HONLY_LOGGER_TAG, __func__, __FILE__, __LINE__); _HONLY_LOG(stdout, __VA_ARGS__) | ||
#define HONLY_LOGD(...) fprintf (stdout, "\033[37m[%s LOGD]: \t%s: %s:%d - ", HONLY_LOGGER_TAG, __func__, __FILE__, __LINE__); _HONLY_LOG(stdout, __VA_ARGS__) | ||
#define HONLY_LOGW(...) fprintf (stdout, "\033[33m[%s LOGW]: \t%s: %s:%d - ", HONLY_LOGGER_TAG, __func__, __FILE__, __LINE__); _HONLY_LOG(stdout, __VA_ARGS__) | ||
#define HONLY_LOGE(...) fprintf (stderr, "\033[31m[%s LOGE]: \t%s: %s:%d - ", HONLY_LOGGER_TAG, __func__, __FILE__, __LINE__); _HONLY_LOG(stderr, __VA_ARGS__) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
#ifndef __ARRAY_HPP__D2DS | ||
#define __ARRAY_HPP__D2DS | ||
|
||
//#include <DStruct/dstruct.hpp> | ||
|
||
namespace d2ds { | ||
|
||
//using dstruct::Array; | ||
|
||
} | ||
// show your code | ||
|
||
template <typename T, unsigned int N> | ||
class Array { | ||
|
||
|
||
}; | ||
|
||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#ifndef __RANGE_BASE_FOR_HPP__D2DS | ||
#define __RANGE_BASE_FOR_HPP__D2DS | ||
|
||
#include <common/common.hpp> | ||
|
||
namespace d2ds { | ||
// show your code | ||
|
||
class py_range { | ||
public: | ||
py_range(int start, int end) : py_range(start, 1, end) { } | ||
|
||
py_range(int start, int step, int end) { | ||
|
||
__mLen = (end - start) / step; | ||
|
||
d2ds_assert(start < end); | ||
d2ds_assert(step > 0); | ||
d2ds_assert(__mLen <= 100); | ||
|
||
for (int i = 0; i < __mLen; i++) { | ||
__mArr[i] = start; | ||
start = start + step; | ||
} | ||
} | ||
|
||
public: | ||
const int * begin() const { | ||
return __mArr; | ||
} | ||
|
||
const int * end() const { | ||
return __mArr + __mLen; | ||
} | ||
|
||
private: | ||
int __mLen; | ||
int __mArr[100]; | ||
}; | ||
|
||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#ifndef __TEMPLATE_HPP__D2DS | ||
#define __TEMPLATE_HPP__D2DS | ||
|
||
namespace d2ds { | ||
// show your code | ||
|
||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# C++ 基础 | ||
|
Oops, something went wrong.