In the blink of an eye, I bid farewell to 2018 and march towards 2019..
As the first year of a completely independent life, I lost my inhibitions and let myself go wild.Then, unexpectedly also accomplished many things unexpectedly..
{% raw %}</span>{% endraw %}
<!--more-->
{% raw %}
<script>
session.onload(function(){
if(page.tran.getLang() == 'en'){
tips.warning({
title: 'Caution',
position: 'topRight',
message: 'This page was translated by Machine!!',
buttons: [['<button>Show Original Page</button>', function (instance, toast) {
- The most rewarding part was discovering and joining Github
- Master a lot of new languages, including C, C++, PHP, JavaScript, VBS, HTML, CSS, Python, shell, DOS, Matlab (roughly in the order of proficiency)
- Runs 7 servers, 1 Win2012 in Shanghai (the first), 3 Cent in Sydney, Atlanta, and London, 2 Cent in China in Shenzhen and Beijing, plus Ubuntu Raspberry Pie in my dorm room, hahaha,,,,
### The First Half of The Year
- In the first half of the year, I helped my father to do 10,000 businesses, connected with the Server in Shanghai via FTP, and managed to make a company website. Unfortunately, in the summer vacation, I was lost by the hacker friends in Latvia (at least IP is), so I abandoned the pit of Windows
- 5 or 6 months trying to make a platform Steel15 high school classmate, but because the planning mode is impractical, the schedule has been put on hold, and finally in August hacked together (from a good habit to pay close attention to regular backups (, ̀ omega, ́) y)
- in July, when I was in the r&d department of euron, I worked with my team members to make a student electronic ID card based on WeChat small program. I worked as a back-end engineer in the card, and finally I did a project defense in front of the school and enterprise bosses
- During the summer vacation, I conducted two projects with Wifiduino at home, such as solar energy automatic water addition and self-induction of corridor lights. During the designing and purchasing of materials, I got some knowledge of water pipes and electric wires.It is said that the board is still running well
### September and October
- In September, it started to move into Linux, experimenting with servers through Vultr, setting up a private SS server that has been scientifically connected ever since
- In September, NextCloud based on open source set up the first private network disk in London Docker. It has been used until now, except for domestic access speed, ~ ~ ~ ", hoping to get better after going to Britain
- In September, the dormitory IoT system was rebuilt and has been working well despite a few bugs so far
- In October, frustrated by the number of banned Yimian dramas, the first Yimian Video platform was set up
- In October, I tried to run Linux Mail service for several times, but failed. So far, I still use The Windows Mail in May
- In October and November, C language as made a small game of rock scissors with data network synchronization and background music
- In October, developed an SMS verification code login system
- In October, based on shell and a series of Linux software combined with Nginx, I built a port traffic management and statistics system for SS server, and then opened it to my classmates and friends to help them access the Internet scientifically (But my friends in Beijing didn't respond well, maybe the wall in Beijing is relatively high, I hope this year we can solve this problem by adding confusion).
### November and December
- In November, following an online class at Peking University, I tried to engage in image recognition of Python TensorFlow, and then successfully abandoned it halfway. . But finally I have a practical understanding of AI, and understand that the essence of the current neural network is to use a tuft of polynomials to fit a complex natural function
- In November, I started my life’s first Raspberry Pi with an infrared camera. Currently, it can provide live streaming video services.
- In December, I tried to develop a WeChat applet for automatic sign-in in class, but failed by ICE's powerful restriction algorithm.
- In December, built a blog platform based on Wordpress that loads slowly,
- In December, I stumbled upon frp, successfully achieved service intranet penetration, and applied it to the Raspberry Pi and my PC
- In December, I worked on a hotel management system with 5 people in the C language team, and my biggest contribution was to build a bottom-level database system from scratch. The processing speed was slow, even though the hash algorithm had been introduced. .
- At the end of December, I entered the pit of Github and came into contact with the DIYgod god
- At the end of December, based on Dplayer, improved Yimian Video to the third generation, supported hls, built a bullet screen server, added a bullet screen function, and connected to station B bullet screen through a third-party API
- At the end of December, based on Aplayer, a web music player plug-in based on PHP control was developed, which can directly play NetEase Cloud designated playlists
- At the end of December, improved the previous login page, added original anti-robot algorithm, and upgraded it to a fully dynamic page
- At the end of December, contacted pjax, YimianVideo, and video list pilot applications, and started the dynamic transformation of the whole site
- At the end of December, started the Cuckoo machine, using its API to automatically print today's site visit statistics every night
## Learning Aspect:
- After completing the English EAP course, IELTS exchange is about 6.5 points. After all, it has been taught in English for a year and a half.
- In the liberal arts, I am very happy in history and law. Well, I don’t comment.
- I supplemented basic psychology, social psychology, developmental psychology, abnormal psychology, psychological counseling, and psychometrics at the beginning of the year. I planned to take the counselor exam, but I was very sorry because I was under the age requirement. I'm so happy to learn so many things I like
- Circuits, at least basic DC and AC analysis can be done
- Daily physical modeling in November, and finally the daily construction can not be solved...
- I took the course of urban planning, although I can’t bear to look directly at the impact on the equalization, but now I feel more and more feeling about the city.
- The club joined Infoco and got into the management based on the relationship, and then it was always the occasional meeting to come up with ideas, etc.
## Research:
In terms of research, there are mainly three. In the first half of the year, we investigated the impact of the Personality trait on Second Language Acquisition, and finally found that only the introverted type and the Grammar advantage have a significant correlation. During the summer vacation in Oulang, I conducted a survey on the Internet of Things industry and found that there is a significant trend of customization and decentralization in the industry. In the second half of the year, I studied Fog Computing on the basis of the conclusion of the summer vacation. I basically read the IEEE articles on Fog in the past two years, and I became more and more convinced of the trend of Internet cloud and fog combination in the next 10 years. There is a feeling that China will be the key to this Internet architecture change
## Life aspect
### ACG
- Chasing Fan 56, which are
> "Touken Ranbu-Hanamaru"
> "Juvenile Jinyiwei"
> "April is your lie"
> "Swaying Camping"
> "The Moonlight Is Really Beautiful"
> "Takagi-san who is good at teasing"
>《 CLANNAD》
>《 KANON》
>《 AIR》
>《Plastic Memory》
> "Bingguo"
> "Charlotte"
> "Dragon and Tiger"
> "Star Dream"
>《Angel Beats》
> "Slash the Crimson Eye"
> "Guilty Crown"
> "The Garden of Words"
> "Sakura Village's Pet Girl"
> "Unheard Flower Names"
> "Sword Art Online"
> "The Disappearance of Haruhi Suzumiya"
> "A certain scientific super-electromagnetic gun"
> "Violet Evergarden"
> "Firefly Forest"
> "The Shape of Sound"
> "Dating in the Second Disease"
> "Fate of Space"
> "Tokyo Ghoul"
> "Strength Doctrine Classroom"
> "Working Cells"
> "Aria the Scarlet Ammo"
> "Zero-Starting Life in Another World"
> "Teacher Eromanga"
> "My sister can't be so cute"
> "My youth romance story really has a problem"
>《White Album 2》
> "Beyond the Realm"
> "Game of Life"
>《 citrus》
> "The Gate of Destiny Stones"
> "What are you doing in the future? Is there any time? Can you come to save? 》
> "How to raise a passerby heroine"
>《 fate》
> "Attack on Titan"
> "Jade Market"
> "The Dragon Maid of the Kobayashi Family"
> "Blow, Euphonium"
> "Natsume's Book of Friends"
> "The Little Things of the Fairy Forest"
> "Gintama"
> "Small Buried Qianwumei"
> "A Certain Magical Index"
> "Blow, Euphonium Season 2"
> "Leeds and the Bluebird"
> "Qingyin Girl Season 1"
- Watch TV series: "lie to me", "Silicon Valley", "negotiator", "translator", "unnatural death"
### Happiness
- Bilibili watched the video for 425 hours, and probably finished Jack Ma's speech. The most obsessed up host turned out to be the Global Times. .
- 1017 hours of listening to songs in Yuncun
- Listened to a symphony concert
- Five trips in Qufu, Taihu Lake, Suzhou Humble Administrator's Garden, Jinan and Nanjing
- Go to the bar once
- Three karaoke
- Visit grandma, grandpa, and cousin and nephew
- Learn to drive, subject one, subject two, driving from Fangte to Yamaguchi without a license
- I watched a lot of movies, so I won’t count them
- Pay more attention to life and hair in the later period, and average 2 boxes of milk a day, and gradually keep up with it early
## Economic Aspect
- Project expenses are getting longer, spending 1000+ in 18 years, but still manageable
- Scholarship subsidy
- Relatively stable investment strategy, average 7-day annualization can reach 4+, the highest time is 7
- Cash flow control is okay, there is no cash shortage in one year
- Then I found that if I just want to spend more money, I really need to work hard
## Exhibition:
- Participate in the China Developers Conference, open source
- Go to Shanghai to participate in the World Mobile Conference and get a glimpse of the future of China's Internet
## Reflection:
- Staying up late is a bit too small, visually check the average of going to bed at 1:30 in the second half of the semester
- The number of overnight stays is slightly higher, about 15 times, of which 3 times are more than 30 hours overnight
- Less exercise, only one swim, not much running
- I can't get up often so I skip breakfast
- The rhythm of life is chaotic when I start the process, and I am too eager to pursue functional perfection and perfection
- Rhythm is unstable in the second half of the second semester of high school, and mathematics is basically not learned in the half semester
- Too much attributed to the school curriculum, which is very problematic in itself
Recently, I have used Arduino to build LoRa gateways and nodes in the development of the Internet of Things, and I found that some strange phenomena are always encountered when calling String. After investigation, it was found that it was caused by overloading of the []= operator elsewhere.
{% raw %}</span>{% endraw %}
<!--more-->
{% raw %}
<script>
session.onload(function(){
if(page.tran.getLang() == 'en'){
tips.warning({
title: 'Caution',
position: 'topRight',
message: 'This page was translated by Machine!!',
buttons: [['<button>Show Original Page</button>', function (instance, toast) {
For convenience, we used [LoRa-Socket](https://github.com/iotcat/lora-socket) and [ArduinoJSON](https://arduinojson.org/) as dependencies when developing nodes. We found that these two dependencies perform well when used separately, but if used in the same project file, it will cause some weird problems.
## Situation One
When calling a function through a pointer, the String parameter passing is abnormal. code show as below:
In this case, we found that the value of msg and other String in this function is all normal, but it was not successfully passed to _f. After a series of Sao operations, we come to the following conclusions:
- Found that if you change String to int or other types, the parameters passed to _f are all normal. Only the String and char types are problematic.
- We tried to convert String to other types, and then back, but to no avail.
- The declaration of global variables of type String or char will crash the microcontroller.
- When we delete the ArduinoJSON dependency, the passing of String parameters is normal.
We can conclude that this strange phenomenon is caused by the conflict with the ArduinoJSON package.
## Situation Two
When using [ArduinoVector](https://github.com/tomstewart89/Vector) to make a String type Vector, we also discovered the instability of the String type. The magic is that this phenomenon only occurs in the use of String, other types such as int work well.
These instabilities can be summarized as follows:
- Truncated during assignment
- String values are locally out of order
- Part of the String value is garbled
- It will fail when passed as a parameter to the function, and it will be empty (similar to case 1)
## Summary
Through the above two cases, we can preliminarily conclude that this is due to the conflict between the overload of the []= assignment operator and String. As long as you use []= to redefine String, string weird problems may occur.
Re-build the 236 IoT underlying platform and control it through Blinker mobile phone to realize control and monitoring. The platform has strong scalability and portability. At present, it has realized the design of automatic lighting at night, fire and smoke alarm, and bed curtain: the night light on the bed, automatic ventilation, and LED automatic sensing reading status.
{% raw %}</span>{% endraw %}
<!--more-->
{% raw %}
<script>
session.onload(function(){
if(page.tran.getLang() == 'en'){
tips.warning({
title: 'Caution',
position: 'topRight',
message: 'This page was translated by Machine!!',
buttons: [['<button>Show Original Page</button>', function (instance, toast) {
早在大一上学期,意外接触Arduino,开始了解单片机。17年11到12月份,曾利用Arduino uno 3搭建了一台功能简易的自动控制平台,主要实现了由红外遥控器控制床帘Light以及小夜灯的功能。在运行一个半月后,由于一次上传代码时意外短路,导致单片机烧毁,自此系统报废,但线路依旧保留。
@ -71,4 +101,65 @@ tags:
已完结
[1]: https://github.com/iotgod/wIoT
[1]: https://github.com/iotgod/wIoT
{% raw %}</span>{% endraw %}
{% raw %}<spanclass=".en">{% endraw %}
## Build reason
As early as the first semester of my freshman year, I accidentally came into contact with Arduino and started to understand microcontrollers. From November to December 2017, I used Arduino uno 3 to build a simple automatic control platform, which mainly realized the function of controlling the bed curtain Light and night light by the infrared remote control. After running for a month and a half, due to an accidental short circuit when uploading the code once, the single-chip microcomputer was burned out. Since then, the system has been scrapped, but the circuit remains.
Considering that the code is completely new to the first time, the code lacks necessary comments, and dozens of lines leading to the bed curtain are completely entangled, and it is impossible to distinguish which sensors or devices are controlled by the specific ones. Therefore, the reconstruction plan is temporarily shelved.
In the summer vacation half a year later, I participated in the IETE project of Oulang China. During the course, I had a pleasant experience with the software and hardware engineers of the company’s R&D team in the application and development of some single-chip microcomputers, and learned about the basic composition and development status of single-chip microcomputers and the Internet of Things. In addition, the original circuit was tested, classified, and labeled to enable it to be used normally.
In August, the project ended and I returned home. Considering that the original solar energy in the home needs to be turned off manually after adding water, it often happens that the water is forgotten to turn off after taking a bath at night, resulting in a lot of water waste. So combined with what Oulang has learned and his own practical experience, he built a solar automatic water filling system based on wifiduino and solenoid valve. In order to take care of the elderly grandma and facilitate the use of the toilet at night, the original abandoned wired network lines were used in the corridors to build an automatic induction light-on system closely integrated with the manual switch. This has gained a lot of experience in the installation of home wiring.
Back in Suzhou, considering the relevant experience in the past year, I thought it was time to try to build a long-term commodity-level and highly scalable IoT system, so...start doing things
## Build experience
At the beginning of the construction, everything went smoothly. However, as the system gradually improves and the code becomes more complex, the classic Arduino-style software and hardware compatibility problems are gradually starting to mess up~
The first problem encountered is (probably due to some magical activities between esp8266 and wifiduino) when the code is transferred to wifiduino via usb, the code runs normally, but after a power failure or reset, it will die . . . Moreover, this problem only appeared after uploading a program that occupies about ten Digital communication ports. If you only upload a simple sample program, it runs normally. Finally, I fished a USB-DC9V boost cable for routers from Taobao. , Use its continuous power supply to ensure the normal operation of the board.
The second problem encountered is also very magical. That is, wifiduino can't upload code after connecting tx and rx! ! ! I always thought the board was broken
Originally there was only one board, but when he loaded too many consoles, it probably died and the wifi could not connect to Blinker.. So I only used it as a controller, and then connected another board to wifi, and it would accept The information is passed to the motherboard for execution through the serial port. As a result, the operation was finally normal,,, inexplicably thought of the decoder of Oulang at that time.
## The main function
In terms of functions, it seems that there are not many at present. 4 sensors: 2 Ultra Sure Wave Ranging, 1 photosensitive, 1 smoke, 4 control terminals: 1 outdoor searchlight ledB, 1 night light, 1 bed Headlight, 1 small fan. If it is realized, it is nothing more than their mutual cooperation. Currently, 4 locations of my existence and 1 location of my roommate can be accurately identified. Then program and adjust the lights and fans in accordance with behavior habits.
In the future, it is planned to be implemented gradually-Sensing layer: Recognition of whether there are people in the room. Intelligent layer: Learning the time rules of roommates in the dormitory (neural network). Control layer: Air-conditioning infrared control, based on esp8266 miniature relay for dormitory headlights Control, and, if you are happy, consider automatically raising a pepper plant...
## At last
Finally, the codes of the two boards are attached, and they will be updated.//Happy life~
The board has been running for more than 150 days and everything is running normally.
There have been several minute-level control failure events. It is suspected that the dormitory's power grid is not stable, and they are automatically repaired afterwards.
-------------------
## 2019.2.28 update
The above code link has been deprecated, if you are interested, you can check the [wIoT project][1] developed by its code!
------------
## 2019.6.12 update
Stable operation for 611 days, 18 hours and 32 minutes, officially retired!
Nextcloud is an open-source software project coded with PHP. It had provided a ideal private cloud-storage solution which was considered to be reliable and stable. This blog aims to present a Nextcloud Building instruction step by step for the purpose of helping freshman and future reviewing. Nextcloud is an open-source software project coded with PHP. It had provided a ideal private cloud-storage solution which was considered to be reliable and stable. This blog aims to present a Nextcloud Building instruction step by step for the purpose of helping freshman and future reviewing. Nextcloud is an open-source software project coded with PHP. It had provided a ideal private cloud-storage solution which was considered to be reliable and stable. This blog aims to present a Nextcloud Building instruction step by step for the purpose of helping freshman and future reviewing.
{% raw %}</span>{% endraw %}
<!-- more -->
{% raw %}
<script>
session.onload(function(){
if(page.tran.getLang() == 'zh'){
tips.warning({
title: '注意',
position: 'topRight',
message: '此页面由机器翻译为中文!!',
buttons: [['<button>查看原文</button>', function (instance, toast) {
- Only tested Alibaba Cloud Tencent Cloud Centos7 student machine
- The system is very clean, preferably just reinstalled
- Use root privileges
## A key installation
Boring to write a one-click build script, use the following commands to run (see [github][2] for details)
````
$ wget https://yimian-setup.obs.myhwclouds.com/sh/auto.sh && sh auto.sh
````
If nothing happens, the installation will proceed automatically. At the end of the installation, you need to manually enter the following database configuration instructions.
````
use mysql
UPDATE user SET Password ='Your password' WHERE User ='root';
create database typecho;
quit
````
## Easy start
After the installation is complete, use your browser to visit the following link
````
http://your server ip
````
Install typecho according to the page prompt
Leave most of the content as default, just fill in:
- Database password (the one you just set)
- Administrator username
- Administrator login password
- Administrator email address
## Custom domain configuration
First, resolve your domain name A to your server ip at your domain name service provider (Tencent Cloud, Alibaba Cloud)
**Open the nginx configuration file on the server**
````
$ vi /etc/nginx/nginx.conf
````
Just replace your_domain on lines 42, 47, and 48 in the file with your own domain name.
**Restart nginx service**
````
$ systemctl nginx -t # nginx.conf syntax check
$ systemctl restart nginx # restart nginx
````
Then after about 10 minutes, you can access typecho via `https://your domain name`
## https configuration
If you are still unable to access and are directed to a filing page, then you may need to use https
### Method One
For configuring automatic renewal of ssl certificate, please refer to my other article ([Nginx under Centos7 configure ssl certificate automatic renewal][3])
### Method two
- Apply for and download a certificate from Tencent Cloud, etc., and then upload the two certificates in the nginx folder to the server
- Remove the comments on lines 39, 47-54 in nginx.conf mentioned earlier
- Replace the second half of lines 47 and 48 with the addresses of your own .crt and .key certificate files respectively
- `systemctl restart nginx` restart nginx
- Use a browser to visit `https://your domain name`
After reading Chairman Mao’s theory of practice and contradiction, it was the first time to systematically come into contact with the methodology of dialectical materialism, and I deeply felt its power and nature. Combining my own previous experience and understanding, I refined the view of cognitive derivation.
{% raw %}</span>{% endraw %}
<!--more-->
{% raw %}
<script>
session.onload(function(){
if(page.tran.getLang() == 'en'){
tips.warning({
title: 'Caution',
position: 'topRight',
message: 'This page was translated by Machine!!',
buttons: [['<button>Show Original Page</button>', function (instance, toast) {
From Pavlov’s dog bell experiment[1] to Festinger’s cognitive dissonance theory in the 1950s[2], to the Stanford prison experiment led by Professor Zimbardo in 1971[3], this A series of psychology students' physical experiments that broke expectations reveals step by step that the role of people's psychology does not seem to be what most people think. In fact, this seemingly important psychological discovery was actually put forward by Marx, Engels and others from a sociological point of view two centuries ago and perfected it into a theory. Later, Lenin, Stalin and others improved it through practice. After being introduced to China, it was collected by Mao Zedong, combined with the heritage of Chinese traditional culture, and developed into Mao Zedong's thought of materialist dialectics. The formation of this theory stems from these people's summary of the social phenomena they observe and the social movements they practice based on the theory. And this reasoning guided the founding of the Communist Party of China and solidly completed the miracle of domestic capital accumulation.
Dialectical materialism is a set of self-consistent methodology, which can effectively guide our life practice, conclude the theory from practice, and then apply the theory to the process of practice. The efficient operation of this cycle is precisely the ultimate meaning of human cognition.
## in conclusion
Methodology is a very effective and important tool. It provides people with a set of paradigms (habits) to help people practice the model of "social practice -> knowledge -> theory -> social practice" more effectively.
As a header file, there are generally declarations of corresponding classes and functions in .h.
A typical .h file is as follows: (FileName: yimian.h)
````C++
#ifndef YIMIAN_H //Prevent this file from being compiled multiple times
#define YIMIAN_H //The value of'YIMIAN_H' needs to be customized
//Lib may be used in.h
#include<iostream>
#include<string>
using namespace std; //Use the std namespace, so you don’t need to write std::cout below
//Declare the yimian class
class yimian{
public: //Public domain (can be directly called by the outside world)
void hi();
static string version;
private: //Private (not public)
};
#endif //Correspond to the anti-multiple compilation at the beginning of the file
````
For safety, the initialization of functions and variables is generally not carried out in the .h file. Instead, I am used to creating a new .cpp file with the same name.
The following is an example of a .cpp file corresponding to the morning: (FileName: yimian.cpp)
````C++
#include"yimian.h" //Need to point to yimian.h
string yimian::version = "Version 0.0.1"; //Assign a value to a string variable
void yimian::hi(){ //Define the content of the hi() function in the yimian class
Then you can use g++ to compile happily, the instructions are as follows: (How to build a GNU environment in win)
````
$ g++ test.cpp yimian.cpp -o [name of target file]
````
Then start the compiled program from the command line (what is the command line ⌇●﹏●⌇)
````
$ ./Target file name.exe
````
As you might expect, the result of the above program is:
> Hellow Yimian~
> Version 0.0.1
----------
**Pit** ::aru:meditation::
- The defined class declared in the header file must be instantiated (called) in main(), otherwise an error will be reported
------------
## Summarize the related knowledge of the class
### Class access modifier
- **public:** Content accessible inside and outside the class
- **private:** not accessible outside the class, only accessible by yourself and friends, not accessible by subclasses
- **protected:** Inaccessible from outside, accessible by yourself, friends and subclasses
### Special function types
- **Constructor:** It will be executed every time an object is created, that is, initialization
````C++
class Line{
public:
void setLength( double len );
double getLength( void );
Line(); // This is the constructor
private:
double length;
};
````
- **Destructor:** The function executed when the object is deleted, that is, the aftermath
````C++
class Line{
public:
void setLength( double len );
double getLength( void );
Line(); // This is the constructor declaration
~Line(); // This is the destructor declaration
private:
double length;
};
````
- **Copy constructor:** Transfer parameters between objects of the same type when copying objects
````C++
class Line{
public:
int getLength( void );
Line( int len ); // simple constructor
Line( const Line &obj); // copy constructor
~Line(); // Destructor
private:
int *ptr;
};
·········
Line::Line(const Line &obj){
cout << "Call the copy constructor and allocate memory for the pointer ptr" <<endl;
ptr = new int;
*ptr = *obj.ptr; // copy value
}
·········
int main( ){
Line line1(10);
Line line2 = line1; // The copy constructor is also called here
return 0;
}
````
- The difference between construction and copy construction:
````C++
A x(2);//Direct initialization, call the constructor
A y = x;//Copy initialization, call the copy constructor
````
### Friend function/class
- **Youyuan:** Youyuan is like an old neighbor, you can take whatever you want at home
````C++
class INTEGER{
friend void Print(const INTEGER& obj);//Declare friend function
};
void Print(const INTEGER& obj) {
//Function body
}
void main(){
INTEGER obj;
Print(obj);//Call directly
}
````
### Inline functions
- In short, the number of lines is small and the function is very simple. There are no loops and switch statements. If you want to improve the efficiency of the function, use inline (╯‵□′)╯︵┴─┴
````C++
inline int Max(int x, int y){
return (x> y)? x: y;
}
// The main function of the program
int main(){
cout << "Max (20,10): "<<Max(20,10)<<endl;
cout << "Max (0,200): "<<Max(0,200)<<endl;
cout << "Max (100,1010): "<<Max(100,1010)<<endl;
return 0;
}
````
### this pointer
- Similar to this in js, pointing to the parameter object itself
I studied in the UK and shared with 4 roommates. In order to better control and monitor public expenditures and maintain the balance of public expenditures between each other, I designed and developed this ERP public expenditure planning system during the welcome Wednesday. I hope that this system will make life easier for the next year, reduce conflicts between everyone, and promote the sustainability of public expenditure projects full of happiness OωO
{% raw %}</span>{% endraw %}
<!--more-->
{% raw %}
<script>
session.onload(function(){
if(page.tran.getLang() == 'en'){
tips.warning({
title: 'Caution',
position: 'topRight',
message: 'This page was translated by Machine!!',
buttons: [['<button>Show Original Page</button>', function (instance, toast) {
@ -53,3 +86,43 @@ mail系统使用[Yimian Mail API](https://www.eee.dog/tech/mail-api.html)快速
{% raw %}</span>{% endraw %}
{% raw %}<spanclass=".en">{% endraw %}
## 1. Function introduction
- Calculate the daily average weekly flow rate to visualize public expenditure
- The user declares a public expenditure and submits the invoice photo certificate
- Monitor the disequilibrium of expenditure among members, calculate the variance, and display it visually
- Compare spending this week and last week, and give the percentage increase or decrease
- When there is one person whose expenditure exceeds the average threshold, and there is at least one person whose expenditure is less than the average threshold, the two people will be emailed to generate an internal transaction
- When the recipient receives the money in the above example, he needs to go to the platform to confirm receipt
- All historical public expenditures and invoices on the platform can be checked
## 2. System Architecture
### 2.1 Frontend
The front end is based on a Bitcoin website platform template found on the Internet, and a deep transformation is realized. It is worth mentioning that the front end uses [Ushio-js project](https://github.com/iotcat/ushio-js) as a security and logging plug-in, and got [Ushio](https://ushio.cool) The system does behind the scenes.
### 2.2 Backend
The backend is written in php language. Provides 5 interfaces, which respectively provide the functions of obtaining account events, obtaining internal circulation information, obtaining public expenditure information, obtaining weekly statements, and operating.
The mail system is quickly constructed using [Yimian Mail API](https://www.eee.dog/tech/mail-api.html).
### 2.3 Database
The database uses yimian-db/mysql. Three tables are constructed, which are used to store flow, public expenditure details, and internal circulation.
### 2.4 Image upload
Directly quote the code of [呓喵酱の图床](https://imgbed.yimian.xyz) with a small amount of rewriting.
### 2.5 User System
At present, it is simple to implement with additional web pages, waiting for the [ushio-auth project](https://github.com/iotcat/ushio-auth) to complete the unified integration.
## 3. Appearance
Nothing to say, show the picture, see for yourself
- No case of admission, it is said that because of military industry related not to accept Asians
### [MSc Signal Processing and Communications](https://www.ed.ac.uk/studying/postgraduate/degrees/index.php?r=site/view&edition=2020&id=20)
- Fee`-`
- 1 year
**Condition**
- EE and signal related major first class degree
- Ielts 6.5 score 6.0/ TOEFL 92 score 20
----------------------------
# **USA**
## **Cornell University**
> `QS`: 14
> `USNews`: 23
> `ARWU`: 13
> `csrank`: 7
### [M.Eng. Electrical and Computer Engineering (Ithaca)](https://gradschool.cornell.edu/academics/fields-of-study/subject/electrical-and-computer-engineering/electrical-and-computer-engineering-meng-ithaca/)
- Fee`$56,550`
- Duration: one year (most extensions: one and a half years)
## **Condition**
- 3.8 GPA
- the GRE 320 +
- IELTS 7.0/ TOEFL small say 22 Read 20 listen 15 write 20
- Two letters of recommendation
**Case**
- gre320,Strong scientific research
### [M.Eng. Electrical and Computer Engineering (NewYork)](https://tech.cornell.edu/programs/masters-programs/master-in-electrical-and-computer-engineering/)
- Fee`$58,586`
- 1 year
**Condition**
- GPA 3.8+
- GRE 320+
- IELTS 7.0/ TOEFL small say 22 Read 20 listen 15 write 20
- Two letters of recommendation
## **Carnegie Mellon University**
> `QS`: 48
> `USNews`: 82
> `ARWU`: 95
> `csrank`: 1
### [Master of Science in Information Networking](https://www.cmu.edu/ini/academics/msin/index.html)
- Fee`$50,100`
- 2 Years
**Condition**
- GPA 3.9+
- GRE 330+
- Toefl 102
- Three letters of recommendation
**Case**
- 宁诺85+gre326(优留)
## **Columbia University**
> `QS`: 18
> `USNews`: 7
> `ARWU`: 8
> `csrank`: 15
### [Master of Science in Electrical Engineering](http://www.ee.columbia.edu/ms-program-ee)
**Condition**
- GPA 3.7+
- GRE 320+
- the toefl 102
- Three letters of recommendation
- There might be an interview
---------------------------------
# **Singapore**
## **National University of Singapore**
> `QS`: 11
> `USNews`: 34
> `ARWU`: 67
> `csrank`: 16
- Different colleges can apply for multiple majors
### [Master of Technology in Software Engineering](https://www.iss.nus.edu.sg/graduate-programmes/programme/detail/master-of-technology-in-software-engineering)
### [MSc Computer Control & Automation](http://www.eee.ntu.edu.sg/Programmes/ProspectiveStudents/Graduate/MOE_sub_MSc/MSc_CCA/Pages/Curriculum.aspx)
- Fee` S$3,350.00`
- 1 year
**Condition**
- GPA 3.6+
- IELTS 6.5/ TOEFL 100
----------------------------------
# **Canada**
## **University of Toronto**
> `QS`: 29
> `USNews`: 18
> `ARWU`: 24
> `csrank`: 18
### [MEng. Electrical and Computer Engineering](https://www.sgs.utoronto.ca/programs/electrical-and-computer-engineering/)
- Length`12-24`months
- All Fee`400,000 RMB`/year
**Condition**
- GPA 3.6+
- IELTS 6.5 score 6.0/ TOEFL 100 writing 22
- gre
- Three letters of recommendation
------------------------------------
# **Switzerland**
## **Eth Zurich**
> `QS`: 6
> `USNews`: 25
> `ARWU`: 19
> `csrank`: 10
- Switching majors is not friendly
- Undergraduate school is important
- There is a quota for each region
### [Master Electrical Engineering and Information Technology](https://ethz.ch/en/studies/prospective-masters-degree-students/masters-degree-programmes/engineering-sciences/master-electrical-engineering-and-information-technology.html)
- 1.5 year
**Condition**
- GPA 3.8+ (top 5-10%)
- IELTS 7.0/ TOEFL 100
- GRE 320+ (not mandatory)
- Three academic letters of recommendation
- Total tuition and living expenses are 200,000 to 300,000 YUAN
- With a scholarship.
## **Federal Institute of Technology in Lausanne**
> `QS`: 18
> `USNews`: 45
> `ARWU`: 78
> `csrank`: 28
- Only one major
- No regional quotas, global competition for applicants
### [Electrical and electronic Engineering](https://www.epfl.ch/education/master/programs/electrical-and-electronic-engineering/)
- 1.5 year
- Switching majors is not friendly
- Total tuition and living expenses are 200,000 to 300,000 YUAN
The complement is often used to represent negative numbers for easy calculation.
Positive numbers and zero complement are themselves, and the complement method of negative numbers is as follows:
Binary subtraction can be implemented by adding the complement of the subtracted number to the subtracted number.
**<MethodOne> Direct Method**
$$(N)_{COMP}=\begin{cases}N&\text{N is a positive number}\\2^{n}-N& \text{N is a negative number} \end{cases}$$
When the sign bit is zero (positive number), the complement is the same as the source code. When the sign bit is 1 (negative number), the complement is $2^{n}-N$.
**<MethodTwo> Observation Method**
If you want the complement, you can find the inverse first.
$$(N)_{INV}=\begin{cases}N&\text{N is a positive number}\\(2^{n}-1)-N& \text{N is a negative number} \end{cases}$$
That is, except for the sign bit, 0 changes to 1, and 1 changes to 0.
Then add 1 to the whole complement to get the complement~
## Common coding
### DCB
That is, the 8421 constant weight code. When DCB is displayed as a decimal number, 6 must be added to each Invalid bit (>9).
### Signed Numbers
8 bits are used, the leftmost bit represents the sign, and the remaining 7 bits represent the value.
## Mid-term summary
### First week-first acquaintance with digital telephony
- The analog quantity is too complicated to conform to human thinking
- Non-linear devices such as triode and MOS tube provide the device basis for the magic speed
- Because analog electricity is too difficult, we have to learn math electricity
**Some points**
- TTL means transistor logic circuit, composed of various transistors and resistors, and is characterized by fast speed
- 0-0.8V in TTL is low level, 2-5V is high level
- Conversion between binary and decimal (integer/decimal)
- LSB(Least Significant Bit)/MSB(Most S B)
### Second week-Number system
- 1's Complement
- 2's Complement
- Sometimes the binary is too long to use, which makes hexadecimal very convenient
- Hexadecimal is similar to binary mnemonic, if you observe `1100 0101`, you can write `C5` directly
- BCD uses a hexadecimal number to represent a decimal number
- BCD is in line with human thinking habits, but it causes a great waste of resources
- BCD four arithmetic, I think it’s best to convert to decimal and then convert it back. Anyway, it’s very convenient
- Computer BCD addition adopts +6 carry method
- When storing numbers, the leftmost digit is the sign bit
- Negative numbers are stored using one's complement ([chestnut][1])
- 1 byte signed number range `-128-127`
- Reasonably design the number of storage bits and be careful of overflow
Economics is a study of choice. People are always making various choices in the world. Countries that are underdeveloped hope to industrialize and develop their economy as soon as possible to improve their living environment. The post-industrial countries hope to develop while taking the environment into consideration. So backward countries need 50 years to develop industry, engage in infrastructure construction, and destroy the environment. For the next 50 years, he worked hard to control the environment and develop the ecology. Because the earth's ecology is a whole, developed countries are very upset and backward countries are engaged in industrialization and polluting the environment, so various contradictions arise. However, in the 21st century, it is expected to use information and digital technology to break the 50-50 year rule and provide a path for the rise of a new group of countries (๑´•ω•) "
{% raw %}</span>{% endraw %}
<!--more-->
{% raw %}
<script>
session.onload(function(){
if(page.tran.getLang() == 'en'){
tips.warning({
title: 'Caution',
position: 'topRight',
message: 'This page was translated by Machine!!',
buttons: [['<button>Show Original Page</button>', function (instance, toast) {
The natural environment is relatively harsh and not entirely suitable for human survival. Therefore, human beings with subjective initiative begin to change the environment from the impulse. This psychological behavior gradually resulted in a magnificent story called "development", and everyone was convinced of it. As described in the story, in order to achieve this goal, people begin to reduce internal friction (war), and society tends to be highly divided.
Human beings have a basic psychological effect called the Zeignik effect, which means that if a person starts to do something, it will be difficult to stop in the middle. This effect will be intensified in group behavior. When people start to pursue development, and get a certain amount of incentives (life is indeed more comfortable, at least people think so), then this momentum will not easily stop, so mankind has entered a millennium-level development period.
In the early stages of development, too much infrastructure needs to be built, too much industry needs to be developed, and the most important thing is that everyone is very poor at this time, and they are only working hard towards the goal of development under the support of a belief. And generally at this time, there will often be other powerful countries looking at you, so at this time, everyone will be very united, but they will not care about the environment and ecology like their ancestors and descendants. There is only one idea that I hope to develop.
After about 50 years of development, my life is better and I am more confident, and I start to pay attention to some longer-term things, such as education and the environment. So in the next 50 years, I began to work hard to improve the environment and engage in education. As a result, the environment gradually improved, and the next generation grew up. So the younger generation made use of the book knowledge in their minds and began to criticize their ancestors for destroying the environment, which is not good or not, and began to invest in scientific research funds. The stock market began to remain high in environmental protection-related sectors, and sustainable development began to become many people. Mantra. At this time, the culprits who were damaging the environment at that time were retiring at home and happily watching this happen. It's probably such a process.
## Environmental Kuznet Curve
![Environmental Kuznet Curve][1]
The curve in the figure above shows us very scientifically the inevitable trend of a country swinging between development and the environment. Behind this chart, the following points are reflected:
- People tend to only consider their own assumptions
- Different from individual characteristics of the population
- Survival resources are scarce
- Inefficient circulation of production materials
This means that if any of the above conditions can be changed, the Kuznet curse will hopefully be changed, thereby reducing the swing cycle and amplitude, controlling the cost of environmental reconstruction and restoration, and truly achieving the high-efficiency and sustainable development that people hope on the macro level. . The new generation of digital information technology is the key to this possibility.
- Suppose two electric charges $Q_{1}$ and $Q_{2}$ in space are separated by d, and the electric field force they want to interact with.
- Now take $Q_{1}$ as the center of the circle and $d$ as the radius to make the ball. According to the Gaussian law, the electric flux on the sphere is only related to the amount of charge in the sphere, which is $\frac{Q_{1}}{\varepsilon_0}$ in this example.
- Divide the electric flux in the above formula by the surface area to get the electric field intensity $\frac{Q_{1}}{4\pi d^{2}\varepsilon_0}$
- Field strength is multiplied by $Q_{2}$ to get Coulomb force $\frac{Q_{1}Q_{2}}{4\pi d^{2}\varepsilon_0}$
- Let $k=\frac{1}{4\pi \varepsilon_0}$ to get
$$F = \frac{k Q_{1}Q_{2}}{d^{2}}$$
Completed
## Chapter 2-Gauss Golden Cudgel
- Assuming that a uniformly charged length is positively infinitely thin and the charge density is $\lambda$, find the field strength $d$ away from it.
- Draw a cylinder around the rod and set the height to be $x$.
- Due to the infinite length of the rod, the electric fields on the two bottom surfaces of the cylinder are cancelled.
- The cylindrical side area is $2\pi dx$
- The amount of charge in the cylinder is $\lambda x$
- Introduce Gaussian, get
$$
2\pi dxE = \frac{\lambda x}{\varepsilon_{0}}
$$
Organized
$$
E = \frac{\lambda}{2\pi d\varepsilon_{0}}
$$
Completed
## Gauss Ball Ball
- First, there must be a charged ball with electricity $Q$, and I want to find the field strength at the distance of $d$ from the center of the ball.
- Then columnable
$$
4\pi d^2 E = \frac{Q}{\varepsilon_0}
$$
Organized
$$
E = \frac{Q}{4\pi \varepsilon_0 d^2}
$$
complete
## Gaussian Noodles
- First, there is a uniformly charged infinite surface, the charged surface density is $\rho$, and the field strength of the point $d$ is desired.
- Using the infinite plane as the central cross section, make a cylinder with the center of the bottom surface as the point to be found, and the radius is $r$.
- Since the electric field lines are all parallel, only two bottom surfaces have electric field lines passing through.
In the past few decades, Internet has been rapidly expanding and it plays an increasingly important role in people’s life. After the involvement of nearly all humans on the earth [1], developers, inevitably, expected to make more things available for the internet, which then generated the idea of the Internet of Things (IoT). Regrettably, in the case that a considerable number of things connect to the internet, its current architecture seems not to be a so efficient solution for IoT. Bonomi et al. [2] from Cisco firstly noticed this issue and they then put forward a revolutionary concept of Fog to satisfy the access of a surging number and variety of devices in the coming IoT era. This essay will argue that the Fog concept can have considerable impact on promoting IoT construction.
<!--more-->
{% raw %}</span>{% endraw %}
<!-- more -->
{% raw %}
<script>
session.onload(function(){
if(page.tran.getLang() == 'zh'){
tips.warning({
title: '注意',
position: 'topRight',
message: '此页面由机器翻译为中文!!',
buttons: [['<button>查看原文</button>', function (instance, toast) {
[6] A. Yousefpour,G。Ishigaki和J. P. Jue,“雾计算:努力使物联网中的延迟最小化”,2017 IEEE国际边缘计算会议(EDGE),美国檀香山,檀香山。 [线上]。 2017年,第17-24页。可用:https://uk.cloud.yimian.xyz/index.php/s/EsDjHnHHGND2SoD
[7] S. Sarkar,S。Chatterjee和S. Misra,“在物联网环境下进行雾计算的适用性评估”,在IEEE交易云计算中。[在线]。卷6号1,第46-59页,2018年1月至3月。可用:https://uk.cloud.yimian.xyz/index.php/s/m7of3EjZ6Tji7jF
Internet’s architecture had been widely controverted concerning whether it should be centralized or distributed. In the past few years, centralization, which is also regarded as the Cloud, has been gradually applied to the practical structure for modern internet. Under this concept, it has become a popular trend to move functions such as computing, storage and control from end-user devices to Cloud servers [3].Different from the Cloud, the Fog proposes to distribute these functions from servers to the users and let users share them with each other.
@ -62,4 +154,7 @@ To conclude, although the IoT based on Fog concept may be currently doubted in p
----------------------
Attachment
Fog and IoT PPT: https://uk.cloud.yimian.xyz/index.php/s/GbLfqxX2CBTDdRR
Fog and IoT PPT: https://uk.cloud.yimian.xyz/index.php/s/GbLfqxX2CBTDdRR
Global climate change has a significant correlation with human behavior, and human behavior will change the natural changes in climate. By studying Archives such as Ice core, it is found that there is a significant positive correlation between the temperature and the concentration of $CO_{2}$ in the history of the earth. Nowadays, human behavior makes the atmospheric content of $CO_{2}$ far exceed its normal level, which may cause global warming, melting of glaciers, etc., but it is only possible...
{% raw %}</span>{% endraw %}
<!--more-->
{% raw %}
<script>
session.onload(function(){
if(page.tran.getLang() == 'en'){
tips.warning({
title: 'Caution',
position: 'topRight',
message: 'This page was translated by Machine!!',
buttons: [['<button>Show Original Page</button>', function (instance, toast) {
Weather refers to the state of the atmosphere in a short period of time, and climate research mainly focuses on the law of atmospheric state in a longer period of time. In short, climate is weather that changes periodically. The climate is regional and closely related to the distribution of land and sea with latitude. In a longer time dimension, we find that the Earth’s climate change also shows significant periodicity.
![The temperature changes in the history of the earth][2]
The figure above describes the historical temperature of the earth, which has obvious periodicity. It is worth noting that whenever the global climate warms, it will trigger an explosion of species. But now, it is in a small-scale temperature rise period, and the temperature rise rate is not too abnormal with historical data, so it is impossible to conclusively prove that it is related to human carbon dioxide emissions.
## research method
### Direct method (research modern)
1. Record the temperature
2. Record rainfall (Precipitation)
3. Research vegetation (Vegetation)
4. Sea level
5. Glaciers :: Balance, mainly through the study of the melting and formation of ice sheets
### Indirect Method (Research History)
1. Proxy
2. Archive e.g. "Ice Core" :: a layered ice lolly specimen extracted from the Ice Sheet
### Ice Core layering reasons
After snow cover, over time, snow cover will experience the following states:
1. Snow (a few hours, the main component is air)
2. Firn (a few days, snow)
3. Glacial Ice (several years)
### Time tracking method
Because the temperature of snow is different, the ice layer will change periodically in units of years, and the age of a certain ice layer can be obtained by counting the number of layers.
![冰层][3]
### Historical temperature research method
The ratio of ${}^{18}O/{}^{16}O$ in the atmosphere is closely related to temperature. Therefore, the current temperature can be indirectly inferred by measuring the isotope ratio of the corresponding position in the ice layer.
In addition, the concentration of $CO_{2}$ in each historical period can also be measured by a similar method.
## The study found
### Carbon dioxide concentration is closely related to temperature
![History of carbon dioxide and temperature][4]
As can be seen from the above figure, in the history of the earth, the concentration of carbon dioxide has a close correlation with temperature. Until the past 150 years, this rule was broken, and the concentration of atmospheric carbon dioxide increased dramatically. People expressed panic ⌇●﹏●⌇
## With humans
### A formula
$$Increase CO_{2} = Increasing Population + \Delta Emission per Person + Efficiency of CO_{2} Use$$
This formula can also be translated as:
$$Carbon emissions = population + economy-technology$$
### An organization
The Intergovernmental Panel on Climate Change (IPCC) has set a small goal to limit greenhouse gas emissions in various countries, stating that by 2050, global carbon dioxide emissions will have to be half. . In fact, this is equivalent to linking emissions with money, giving each country a portion of the emissions, and paying for more emissions. As a result, the industrialized developed countries cut away more than 40% of the cake. The president of the National University of Science and Technology, Lao Ding, said that this is unbearable. Do people in developing countries have human rights? ヾ(´・ ・`。)ノ"
## Climate warming impact
### Good
- Data shows that the higher the temperature, the fewer wars worldwide
- Experiments show that when the temperature is high, the yield of vegetation such as grain is higher
### Bad
- Southern animals (bugs) move northward faster than plants. There are no natural enemies in the north, and plants are eaten up by bugs.
- Sea level rises, flooding Suzhou
{% raw %}
<!-- Introduce mermaid drawing-->
<divclass="mermaid">
graph TD
A{Climate Change}
B[Economy]
C[Politic]
D[Tech]
E[Agriculture]
F[Human Health]
A --> |influence| E
E --> |change| B
E --> |change| C
B --> |change| C
B --> |determine| D
C --> |determine| D
B --> |influence| F
D --> |affect| F
D --> A
C --> A
D --> E
E --> |Green Plant| A
E --> F
F --> E
</div>
{% endraw %}
-------------
Reference courseware:
[Climate change-From past to Future-Yi Zou-2019.pdf][1]
I studied in the UK, traveled to Europe on Christmas, and DIYed an Italian Schengen visa. Now come back from the tour, summarize a Schengen sign strategy.
{% raw %}</span>{% endraw %}
<!--more-->
{% raw %}
<script>
session.onload(function(){
if(page.tran.getLang() == 'en'){
tips.warning({
title: 'Caution',
position: 'topRight',
message: 'This page was translated by Machine!!',
buttons: [['<button>Show Original Page</button>', function (instance, toast) {
- Read [Official Website](https://www.vfsglobal.com/Italy/UK/London/tourist.html) conditions carefully to check whether you meet all the requirements
- Online [Interview Appointment](https://www.vfsglobal.com/Italy/UK/London/Schedule_an_Appointment1.html) online as early as possible (the time can be modified later)
- Carefully study the [required materials](https://www.vfsglobal.com/Italy/UK/London/tourist.html) (must follow the official website)
- Generate visa application form ([Online generation](https://www.vfsvisaonline.com/OnlineVaf-Italy?Country=QcpCgYPkPBcUOc3/C92SWQ==))
- Prepare other materials
## Material category
### Regular visa materials
- Visa application form
- personal I.D
- Proof of residence
- Photos
### Additional visa materials
- Proof of employment
- Proof of property
- Travel certificate
- Proof of accommodation
- Insurance certificate
## Material CheckList
- Original visa application form (print after online generation)
- Original passport + photocopy (black and white)
- BRP original + copy (black and white)
- A passport photo-consistent with the UK visa ([Requirements](https://www.vfsglobal.com/Italy/UK/London/tourist.html#tourist_photoSpecs))
- student letter
- Original traveler's check + copy or three-month bank account
- Travel itinerary (for easy explanation with visa officer)
- joint travel confirmation letter (if your name is not on a certain ticket or accommodation certificate)
- Copy of the passport signature page of the ticket purchaser (if your name is not on the ticket or accommodation certificate)
## Material Description
### visa application form
- After filling out the first page online, remember to click SAVE, and write down the Reference Number ::aru:shy::
- Click [RETRIEVE INCOMPLETE FILLED VAF](https://www.vfsvisaonline.com/OnlineVAF-Italy/Applicant/Search) above to continue to fill in after logging in next time
- Fill in the reference [this guide](https://travel.uk2hand.com/ukvisa/italy-schengen-visa/)
- Single-sided black and white A4 printing
- After printing, do not fill in, do not sign, do not post photos, the visa officer will tell you what to do
- Do not staple, it is recommended to use a loop pin
### Student Letter
- Go to school FB to open
- A signature is required, and an electronically printed signature will not work
- Head up to write `Italy Consulate`
### Travel Proof
- Need to provide paid air tickets and inter-city train tickets
- A website link is required at the bottom of the ticket
- All tickets need to have your name
- If a ticket does not have your name, the person named on the ticket is required to provide a signed `joint travel confirmation letter` and a copy of `passport`
- Please refer to our `joint travel confirmation letter`
titleEN: Liverpool student apartment conditions survey
date: 2019-10-10
categories:
- life
@ -9,11 +10,43 @@ tags:
- accomodation
- investigation
---
{% raw %}<spanclass=".zh">{% endraw %}
为了更清晰更直观的选择出明年居住的公寓,本文汇总了网络上对各公寓的评价信息,供决策参考。
{% raw %}</span>{% endraw %}
{% raw %}<spanclass=".en">{% endraw %}
In order to more clearly and intuitively choose the apartment to live in next year, this article summarizes the evaluation information of each apartment on the Internet for decision-making reference.
{% raw %}</span>{% endraw %}
<!--more-->
{% raw %}
<script>
session.onload(function(){
if(page.tran.getLang() == 'en'){
tips.warning({
title: 'Caution',
position: 'topRight',
message: 'This page was translated by Machine!!',
buttons: [['<button>Show Original Page</button>', function (instance, toast) {
My coding style is roughly in the following situations: I follow the leadership of the organization, the boss in the company is right, and the big guys in the school teach well ╮(╯▽╰)╭ Only some other small open source projects of their own follow The following style→_→
{% raw %}</span>{% endraw %}
<!--more-->
{% raw %}
<script>
session.onload(function(){
if(page.tran.getLang() == 'en'){
tips.warning({
title: 'Caution',
position: 'topRight',
message: 'This page was translated by Machine!!',
buttons: [['<button>Show Original Page</button>', function (instance, toast) {
Name it so that others can understand it at a glance. Ideally, looking at your code is as comfortable as reading a little English poem ::aru:insidious::
### Often/variable naming
The compiler constants are all uppercase, and the characters are connected by a single underscore. Such as:
````C
#define WIFI_PASSWD 12345
````
Variables are basically named with small camels. The rule is to connect words directly (without underscores), the first word is all lowercase, and the first letter of subsequent words is capitalized. Such as:
````C++
String usrName = "IoTgod";
````
Variable names that are frequently called should not be too long, but they should be clear.
To achieve this, you can try to partially omit non-initial vowels in words. For example, user can be abbreviated as usr, and password can be omitted as passwd or psswd. But the simplified name still needs to be easy to recognize.
Global variables are named using g_ plus the variable name, such as
````C++
global int g_isLightOn = 0;
````
Local static variables use s_ plus the variable name, such as
````C++
static int s_errorCounter = 0;
````
Constant variables, naming the same as ordinary variables, such as
````C++
const float pi = 3.14159265;
````
### Function Naming
The function naming technique is stolen from the famous [Nginx][1] and slightly changed on its basis.
The basic rule is *lowercase label name+__ (double underscore)+lowercase verb+lowercase noun()*
Use a single underline link between nouns and nouns.
E.g:
````php
function db__get_usr_info();
````
Among them, db means Database, prompting that this function belongs to the database operation label, and its function is to obtain user information.
If you don't need tags (such as in some object-oriented languages), you can arbitrarily omit tags. Such as:
````php
function get_usr_info();
//or
function db::get_usr_info();
````
Different from variable naming, function naming need not be short, aiming at expressing clearly the function function
## About comments
In fact, if you can name the variable function well, you don't need any comments, but unfortunately, we still have to comment. .
### File Notes
File comments are mainly used to declare some file functions, category names, file names, copyright and other information. A style is as follows:
````php
/**
* cookie support #file function
*
* @category typecho #The category to which the file belongs
* @package Cookie #File name
* @copyright Copyright (c) 2008 Typecho team (http://www.typecho.org) #Author and copyright information
* @license GNU General Public License 2.0 #Open source agreement
* @version 2.1.1 #Version
*/
````
### Class comments
Class annotations are used to declare some basic information of the class, such as class function, author name, classification, and file. E.g:
````php
/**
* Database support #Function description
*
* @author qining #author
* @category typecho #Category
* @package Cookie #File name
*/
````
### Function comments
The function comment before the function mainly includes the function function, the function modifier, the type, name, and text description of each parameter, and the type and text description of the return value.
````php
/**
* Get the specified COOKIE value #Function function
*
* @access public #Function modifier, that is, whether the function can be accessed by the outside world
* @param string key specified parameter #Parameter 1, type is string, name is key, function description is specified parameter
* @param string default Default parameters #Parameter 2, type string, name default, function description Default parameters
* @return int #Return the integer return value
*/
````
## Some small details
- There must be spaces on both sides of the equal sign, such as ``b = c; b = 15;''
This API is based on Huawei Cloud Object Storage and uses Huawei CDN Cloud acceleration. The global average download speed is 10MB/s. The API has included 1100+ two-dimensional pictures, 20+ Bing wallpapers (automatically captured daily), 150+ two-dimensional avatars, and 10+ pictures uploaded on the bed.
If this parameter is set to true, 302 jump will be disabled and the complete picture encoding will be returned directly. This method is **very low** and slow. Please use it carefully.
**false (default)**
- `GET/POST /img?display=false`
- Description: 302 Jump to return to the picture, recommended
Based on Home Assisstant, build a smart home with integrated home lighting system, multimedia system and water flow system. Technical points: Tmall Genie interaction, LoRa communication, MQTT protocol, FRP intranet penetration, NAS storage, and toggle switch circuit transformation.
{% raw %}</span>{% endraw %}
<!--more-->
{% raw %}
<script>
session.onload(function(){
if(page.tran.getLang() == 'en'){
tips.warning({
title: 'Caution',
position: 'topRight',
message: 'This page was translated by Machine!!',
buttons: [['<button>Show Original Page</button>', function (instance, toast) {
Combining the knowledge I have learned and using cutting-edge technology to benefit life has been my unremitting pursuit for a long time. In order to let my family experience a more stable, comfortable and intelligent lifestyle, and to consolidate the technical foundation and architecture experience accumulated in the school smartfarm project and my own ushio system, I decided to use 20 to 23 before going abroad. All day long, reconstruct the old IoT system at home. Adopt a layered architecture and interface-oriented, test-oriented, and **document-oriented** development principles, with **Available** and **Reliable** as the highest priority indicators to build an operational target 3. A highly modular, easy-to-remote control, open source home software and hardware intelligent sensor control system for more than years.
## 0 Architecture overview
## 1 Hardware Design
### 1.1 Single Chip Microcomputer Material Selection
Use Arduino UNO as the calculation unit. On the one hand, Arduino Uno has high reliability. My previous smart curtain system used Arduino Uno as the main control board, and it ran smoothly for one and a half years without hardware problems. On the other hand, Arduino Uno has a larger RAM, so there is no need to bother to program the microcontroller in order to compete for RAM.
The main disadvantage of Arduino UNO is its high price, but this cost is necessary to ensure long-term stable operation.
### 1.2 WiFi communication module selection
Use ESP-01 as the WiFi communication module. The main reason is that the ESP-01 has been used to build a remote control car in the previous school courses, and I have a better understanding of its working methods and performance to reduce development costs.
### 1.3 LoRa communication module selection
Use **Anxinke LORA RA-02 LORA** as the communication module between LoRa node and LoRa gateway. The reason is that this module is used in the surf project, so I understand it better.
### 1.4 Smart speaker selection
As the most important interface for human-computer interaction in this Internet of Things system, smart speakers play a pivotal role. After research, I use Tmall Elf Sugar R as a home smart speaker. On the one hand, the price/performance ratio of Tmall Genie is very cheap. Second, unlike Xiaomi’s development of Xiao Ai, the purpose of Ali’s development of Tmall Genie is to provide a platform that allows developers to access its network in various forms, which is very important to me.
### 1.5 Light toggle switch
Initial idea: one-way control + reset device.
Actual realization: The original single-opening is transformed into double-opening, one is connected in series with the relay, and the other is connected with two pin ports.
Two communication modes of WiFi+LoRa are adopted. In scenarios that require high-speed and high-quality communication, such as Tmall Genie, mobile phones, and notebooks, use WiFi as a means of communication. In places where the WiFi signal is unstable, use LoRa for communication. Use MQTT as the application layer protocol.
## 3 Main control system design
Use the python3 open source project Home Assistant as the basis to build the main control system of this project.
## 4 Multimedia system design
Multimedia is mainly provided by Tmall Genie. In addition, through the Xiaomi box, the video, pictures, and music in the home network disk can be played on the TV and stereo.
## 5 Cloud support system design
dns.yimian.xyz provides dns resolution service.
## 6 NAS storage system design
By mounting the idle 500G mechanical hard disk removed from the old computer to the old IBM server, the storage system is built.
In the local area network, since the home is a win system, smb is used as a sharing protocol to realize file transfer and supports mounting in the local area network. The speed is stable, and the whole network reads and writes about 10MB/s. Access to the external network is realized through http and frp reverse generation, but the speed is slow.
------------------------
2020.6 update
## RNN realizes light control
Based on the previously accumulated human sensor data, the LSTM model is used to train the neural network using keras to realize the prediction of the light state.
This article introduces in detail the design ideas, implementation status and defect reflections of the SmartFarming Proj IoT architecture of XJTLU University's 2019 summer scientific research.
{% raw %}</span>{% endraw %}
<!--more-->
{% raw %}
<script>
session.onload(function(){
if(page.tran.getLang() == 'en'){
tips.warning({
title: 'Caution',
position: 'topRight',
message: 'This page was translated by Machine!!',
buttons: [['<button>Show Original Page</button>', function (instance, toast) {
[1] OASIS, (2015,12.10). MQTT Version 3.1.1 Plus Errata 01 [Online]. Available: https://docs.oasis-open.org/mqtt/mqtt/v3.1.1/errata01/os/mqtt-v3.1.1-errata01-os-complete.html
[2] Sinha, R.S., Wei, Y. and Hwang, S.H., "A survey on LPWA technology: LoRa and NB-IoT", in Ict Express, 3(1), pp.14-21, 2017.
{% raw %}</span>{% endraw %}
{% raw %}<spanclass=".en">{% endraw %}
## 1 Background
### 1.1 Requirements
In order to explore the feasibility of agricultural Internet of Things technology, instructor Alam Mohammed hopes that we can provide a **Available** and **Reliable** Internet of Things system to realize intelligent monitoring and management of farmland. This system will be able to timely detect the parameters related to plant health in the soil and the air, process and store these data (proposed by Alam). At the same time, the automatic control irrigation function (proposed by Caleb) and some data display methods (optional requirements proposed by Alam) are also expected to be provided by this system.
### 1.2 Positioning
As it is a small scientific research project designed for the agricultural Internet of Things, the goal of the project is to explore the feasibility of the agricultural Internet of Things, and the vision is to simulate the most common small-scale agricultural Internet of Things application scenarios. Therefore, the positioning of this architecture is ** applicable to most small agricultural IoT projects with sensing, control and display functions**.
## 2 Glossary
> + `MQTT`: MQTT Message Queuing Telemetry Transport is a message protocol based on the publish/subscribe paradigm under the ISO standard (ISO/IEC PRF 20922). It works on the TCP/IP protocol suite and is a publish/subscribe message protocol designed for remote devices with low hardware performance and poor network conditions [1].
> + `LoRa`: LoRa is an emerging technology in the current market, which operates in the public frequency band below 1 GHz for long-distance low-power communication [2].
## 3 Design goals
### 3.1 Implementing functions
The functional requirements of this architecture mainly include land data collection, weather data collection, irrigation system control, interaction with the drone group system, web console (can view real-time and historical sensor data, index data; be able to control the system).
### 3.2 Performance indicators
+ `Communication range (test)`: the radius is not less than 1km
+ `Communication range (production)`: the radius is not less than 3km
+ `Delay`: average less than 1s
+ `Timeout rate`: no more than 5%
+ `Resource occupation`: Node RAM does not exceed 2k
<td><ahref="https://detail.tmall.com/item.htm?spm=a1z10.3-bs.w4011-21581912015.52.23e05535hDDYEB&id=13302081252&rn=ced14f01f4a9179e7b090c544cf5836a&abbucket=14">MQ-135 air quality sensor </a></td>
<td><ahref="https://detail.tmall.com/item.htm?spm=a230r.1.14.9.791b1000Beu0tp&id=555610012670&cm_id=140105335569ed55e27b&abbucket=14">DC frequency conversion water pump</a></td>
According to the production scenario, a data set is generated every 15 minutes, and a data set occupies about 253-291 bytes. According to 291 calculation, 27.93KB of data will be added every day.
## 5 Design Ideas
### 5.1 Idea
- Document-oriented
- Interface-oriented
- Test-oriented
### 5.2 Key Issues
- Land node RAM resources are scarce, only 2K
- LoRa communication adopts 433MHz, single-channel transceiving, much interference
- The server needs to collect and aggregate hash data from multiple nodes
- Reserve a method of interaction with the drone AI team
- Push real-time messages to the front-end browser
### 5.3 Scheme selection
In order to **prioritize** to ensure the **stability** and **scalability** of communication and services, we select **layered model** as the design mode of the architecture. The entire system is divided into multiple levels, with necessary interactions between levels. Each level runs independently, restarts quickly when it crashes, and has a high degree of reliability.
In terms of safety, the method of **internal and external network isolation** is adopted. Taking into account the scarcity of computing resources of some devices in the intranet, the interaction with the intranet server adopts an unencrypted communication mode. The intranet server interacts with the cloud server through SSL encryption. To ensure the security of the client's data, the cloud server API only accepts HTTP and WebSocket requests with SSL encryption.
## 6 Architecture Design
### 6.1 Basic introduction
The main purpose of this architecture is to provide a **stable (Available)** and **reliable** Internet of Things system, which collects real-time data in farmland, combines pictures collected by drones and judged by CNN Plant health, realize intelligent management of irrigation system and plant health. This framework is theoretically suitable for most farm environments. The test environment is within a radius of 2~5km (depending on the antenna), and the wind is below level 3. This system acquires farmland data through sensors, controls the irrigation system through transistor circuits, relays, etc., and interacts with managers through web pages and APIs.
### 6.2 System hierarchy diagram
![Smart Farm system hierarchical structure diagram](https://api.yimian.xyz/img/?path=imgbed/img_c46f5639_577x906_8_null_normal.jpeg)
This figure shows the abstract hierarchy of this architecture. As pointed out, this layered architecture can be clearly defined as the **perception layer**, **network layer**, **application layer**, three horizontal operation layers, and a vertical **error handling layer**.
Among them, the **perception layer** can be further refined into **environment layer** and **hardware layer**. The environment layer contains plants, soil, air, water and other natural objects that we want to detect and control. The hardware layer provides the underlying technology for the system's interactive behavior (detection, control) of natural elements through artificial electrical devices such as sensors and controllers. Sex. When the perception layer realizes the interaction of natural information, the corresponding digital information is transmitted to the network layer for communication. Correspondingly, the perception layer will also receive corresponding control information from the network layer, and make corresponding control actions according to these instructions.
**Network layer** is divided into three layers. The lowest layer is the **preprocessing layer**. Its main task is to package the data collected by the perception layer and transform it into a form suitable for network circulation, such as sockets. Therefore, the pre-processing layer requires a small amount of computing storage resources, such as a single-chip microcomputer, EEPROM, etc. After encapsulation by the preprocessing layer, the data is transmitted to the **physical layer**. Based on devices such as gateways and routers in the physical layer, these data packets can be distributed and transmitted in an orderly manner. The application of the MQTT protocol in the **communication layer** makes the management of these data packet distribution more efficient and convenient. In addition, the implementation of the QoS service quality detection system in the communication layer also makes the performance of the network layer more fault-tolerant and reliable.
**Application layer** is mainly responsible for some application-level services for business logic, such as data analysis, event processing, etc. At the bottom of the application layer, the **service layer** is running for a long time. The service layer is the closest part of the application layer to the network layer. Its main purpose is to process the incoming data from the network layer in real time and respond quickly to corresponding requests and error events. At the same time, the service layer is also responsible for sorting and analyzing the data collected by the sensors and passing it to the **database** layer for storage. In order to ensure the reliability of the service, the implementation program of the service layer is registered as a system service and guarded by a special daemon. Unlike the long-term operation of the service layer, the **business layer** is invoked on demand. When a new request comes in from the interface layer or a specific event occurs in the service layer, the business layer will be called and processed. In addition to some basic data analysis, the business layer also has the authority to make analysis requests to the AI layer. **AI layer** After analyzing the image data returned from the drone, it will send back a judgment result to the business layer. According to the specific content of the request, the business layer will organize the image recognition results, historical sensor data, etc., and pass them to the interface layer. **Interface layer** is mainly used to provide different forms of interfaces, such as HTTP interface and WebSocket interface, to facilitate client calls.
### 6.3 System Topology Diagram
![Smart Farm system topology diagram](https://api.yimian.xyz/img/?path=imgbed/img_27df1756_1426x710_8_null_normal.png)
From the topological structure, as shown in the figure above, the entire system can be physically divided into land nodes, weather nodes, LoRa gateways, intranet servers, cloud servers, databases and user terminals.
From the perspective of functional mechanism, the entire system includes: sensor module, LoRa communication module, LoRa gateway module, MQTT-Proxy proxy module, water pump control module, MQTT+ data processing module, web interface module, daemon module and database module.
***Land Node***
Land nodes are deployed in farmland in different regions to detect soil temperature and humidity parameters, and can provide control of water flow solenoid valves at corresponding locations. The land node uses Arduino Nano as the computing unit, uses LoRa as the communication method to connect to the LoRa gateway (and other nodes), and uses battery power. Its large number, harsh working environment and unstable wireless communication are the biggest source of uncertainty in the system.
***Weather Node***
Meteorological nodes are deployed at specific locations in farmland to detect meteorological parameters such as air temperature, humidity, atmospheric pressure, rainfall, light, NH3 concentration, and CO concentration. The weather node uses Arduino Nano as the computing unit, uses LoRa as the communication method to connect to the LoRa gateway (and the land node), and uses battery or wired power. The working environment is harsh and the wireless communication quality is average.
***LoRa Gateway***
The LoRa gateway is deployed indoors. In order to expand the effective communication radius, its antenna can be extended outdoors. The LoRa gateway connects to various land nodes and weather nodes through LoRa, and connects to the intranet server through WiFi. The LoRa gateway can convert the socket packet incoming through LoRa into an mqtt message and pass it to the intranet server, and convert the mqtt message from the intranet server into a socket packet and send it to the designated node through LoRa.
***Intranet server***
The intranet server is a Raspberry Pi 3B, which contains three functional modules: MQTT-Proxy proxy module, water pump control module and daemon process module.
*MQTT-Proxy proxy module* can receive the mqtt message sent by the LoRa gateway via WiFi, encrypt it with SSL and forward it to the cloud server. At the same time, the MQTT-Proxy proxy module will also accept the specified mqtt message from the cloud server, decrypt it and forward it to the LoRa gateway.
*Water pump control module* The state of the water pump is controlled through a relay through the GPIO of the Raspberry Pi. The mqtt communication with the water pump control module directly communicates with the cloud server without passing through the MQTT-Proxy proxy.
*Daemon module* runs on Linux and is used to monitor the MQTT-Proxy proxy module and the water pump control module. When modules are detected to stop running, the daemon module will restart these modules in time to ensure the stability and continuity of services.
***Cloud Server***
The cloud server runs on Huawei Cloud located in Beijing and includes MQTT+ data processing module, web interface module and daemon module.
*MQTT+data processing module* includes the Service layer and the Business layer in the hierarchical structure. This module communicates with the intranet through mqtt, and interacts with the web interface module (and AI module) through mqtt and redis. After receiving various hashed data from the intranet, this module will automatically aggregate them, organize them into one piece of data, store it in the database, and push it to the web interface module through redis. In addition, this module will periodically send requests to each node to obtain their data, and these requests will be tracked to calculate the delay.
*web interface module* provides a series of HTTP and WebSocket interfaces. These interfaces can be used to get data, send instructions, refresh data, and get push messages.
*Daemon module* runs on Linux and is used to monitor MQTT+ data processing module and web interface module. When modules are detected to stop running, the daemon module will restart these modules in time to ensure the stability and continuity of services.
## 7 Module description
### 7.1 LoRa communication module
The LoRa communication module is used to realize stable and reliable socket communication in a single channel. This module includes LoRa-socket and LoRa-mqtt.
LoRa-socket encapsulates data packets on the basis of LoRa-Arduino, realizes simple udp and tcp communication, and makes traditional LoRa communication more reliable. By adding the sending and receiving ip address to the head of the data packet, and adding the hash check value at the end of the data packet, LoRa-socket supports point-to-point communication and broadcast communication, and has powerful noise processing capabilities and data tamper resistance.
LoRa-mqtt is a simple reproduction of the mqtt protocol based on LoRa-socket. Based on udp and tcp, LoRa-mqtt supports mqtt communication with qos 0 and 1.
The figure above shows the line graphs of the delay statistics of the land node (left), the weather node (right), and the water pump (bottom). It can be seen from the figure that the average delay of the land node is about 730ms, the delay of the weather node is about 900ms, and the delay of the water pump is relatively low, about 45ms.
### 9.2 Sensor data
[Click here to view the weather sensor data of 2019-7-31](https://smartfarm.yimian.xyz/chart-station.html?f=1564484461&t=1564570861)
-------------------------------
**Reference List:**
[1] OASIS, (2015,12.10). MQTT Version 3.1.1 Plus Errata 01 [Online]. Available: https://docs.oasis-open.org/mqtt/mqtt/v3.1.1/errata01/os/mqtt -v3.1.1-errata01-os-complete.html
[2] Sinha, R.S., Wei, Y. and Hwang, S.H., "A survey on LPWA technology: LoRa and NB-IoT", in Ict Express, 3(1), pp.14-21, 2017.
I’ve been playing on the web intermittently for a year, and some of the TrustAsia certificates from Tencent’s Yunshang have started to expire one after another. It’s very fragrant.. So I started to try to apply for Let’s Encrypt’s free certificate, and realized automatic renewal|´・ω・)ノ
{% raw %}</span>{% endraw %}
<!--more-->
{% raw %}
<script>
session.onload(function(){
if(page.tran.getLang() == 'en'){
tips.warning({
title: 'Caution',
position: 'topRight',
message: 'This page was translated by Machine!!',
buttons: [['<button>Show Original Page</button>', function (instance, toast) {
Regarding negotiations, there are relatively large disputes within the party, but in the end it is very likely that they will refuse to make concessions.
When U.S. tariffs rise, related domestic industrial chains will be transferred to Taiwan and Southeast Asian countries in large numbers, which will cause employment problems for 100 million people. Unlike previous crises, this time we not only have to guard against the intensification of the housing market bubble, but also there is not so much infrastructure that can provide employment. On the other hand, in recent years, China's overcapacity problem has been solved mainly through exports, and the trade surplus is used to develop the domestic economy in order to achieve incredible economic growth. Now that the Trump administration imposes tariffs, this strategy will no longer work.
If it compromises in the negotiation, China will lose the opportunity of the Fourth Industrial Revolution that it finally took over, and its economy will be at the mercy of Japan and South Korea.
I think that under the premise of no compromise, there are three ways to break the game.
1. Wu Tong Taiwan
This depends on whether Taiwan’s general election next year can find a legitimate reason for military reunification. But it does help alleviate domestic social focus issues.
2. Housing market reform
It is very possible to turn the bubble crisis into capital for job creation.
3. Games
Transfer the surplus labor force in the society into the game industry to ease the formation of social conflicts.
In order to alleviate the intensity of the unemployment shock, the central bank will increase imports and exports by printing the renminbi to depreciate the renminbi, attracting other countries to supplement the vacancy of the withdrawal of US capital.
Before I went to Europe for a tourist visa, I had to buy a traveler’s cheque as a proof of funds because I did not have a three-month bank flow. However, when I arrived in Europe, I found that traveler’s cheques were difficult to use. If I didn’t understand the market, I would be defrauded of 15%-20% handling fees. This blog records the pits and Tips we found in redeeming traveler’s checks!
{% raw %}</span>{% endraw %}
<!--more-->
{% raw %}
<script>
session.onload(function(){
if(page.tran.getLang() == 'en'){
tips.warning({
title: 'Caution',
position: 'topRight',
message: 'This page was translated by Machine!!',
buttons: [['<button>Show Original Page</button>', function (instance, toast) {
[scode type="info"]**Experience One**: **Do not use** traveler’s checks if possible[/scode]
[scode type="info"]**Experience Two**: The **minimum handling fee** for travel exchange is around 4%[/scode]
> If you don't want to see the experience, you can directly transfer to the Tips where you can redeem traveler's cheques at the end of the article!
## My experience
During the Christmas holiday, I went to Europe with my roommates and a group of four on a DIY trip to 5 cities in Italy and Austria. Since the UK bank card has not been used for three months, it is not possible to apply for a visa by printing the record, so we chose another method-buying American Express's Euro traveler's cheque. As everyone knows, exchanging and using traveler's checks is really a big pit.
According to the official website of traveler’s cheques, traveler’s cheques can be used directly in shops in many European cities. In this way, it’s definitely more cost-effective to spend it when traveling than to exchange it back in British pounds after returning to the UK. The British pound process requires a loss of 8%). Ran goose, we found through reading other people's travel notes before departure that many stores in Europe cannot directly spend traveler's checks (according to our actual travel situation later, we only saw the traveler's check logo in several stores in Venice), so we When I decided to go, I changed all of them to Euros at the Red Marked Change at the airport.
But after I found the red Change at the first stop in Rome (pictured), I found that 700 euros could only give us more than 590 euros. This is really not the slightest loss. My subject checked the phone number of American Express on the spot. I called it and found that there is no location in Italy, but the other party suggested to change to the bank, saying that there is no loss (note that this is also a pit,,,). Since two people have already exchanged them, in order to stop the loss, we decided not to exchange the 700 Euro traveler's cheques of the remaining two people, and kept them to the bank for exchange.
On the third day, we went to the Vatican to play. By the way, we went to the bank recommended by the staff of American Express nearby. We also called the Bank of China, but we were all told not to accept travel. How can this be neat?
At this time, I just found a bunch of changes around the Vatican, so I asked for a quote again. One of them originally only reported more than 590, but we heard that the other offered us a student discount of more than 610, and then it was a good deal and reported a 640. This is great, we are beginning to discover the doorway inside: there are actually no discounts, but I want to find an excuse to attract you. These changes are all profitable. You give them your travel, and they sell them to American Express elsewhere. There may be a little tax in the middle, but as long as they charge you at a lower price than the tax deducted If you buy it here, he will definitely make a profit (generally, he will make a lot of money), but it's just the difference between earning more and less. And there are several changes in the local area. We mainly found the one with red change and the one with blue. If this family thinks that you are demanding and unacceptable, then the money will be made by others.
Therefore, at this time, if we want to get a higher offer, we have to pinpoint what is acceptable to others (it’s really too cruel to cut off people’s wealth, then it’s okay), and then let them have a sense of crisis. Increase the offer. You can ask a few companies first to see how much they generally give, and then tell him how much other companies give me a price. Next, this person may start to call the above to see what a higher price can be offered, and after a bunch of them, they will give you a slightly higher price. Haha, if you are not satisfied, you can ask another one. Ask (but be careful, if it is a different store in the same store, be careful, after all, there may be one person above them, maybe I will remember you). Generally speaking, if you say that the tax may be two or three percent, then you still have to earn a 20 or 30 pounds. (Of course, you can try to chop and chop again, but it may be more difficult. Big).
So our last two transactions were 640 Euros and 645 Euros respectively (645 Euros were replaced by a similar method).
## Tips
- There are not too many places in Italy for travel and consumption. Among the Rome, Florence, and Venice we go to, there are only a few in Venice;
- If you want to exchange for Euro travel in Italy, you can only change it at the place marked with the change sign (Of course, some changes do not accept travel, but very few). There should be no direct exchange points for American Express, at least in Italy, so there is no way to exchange them without loss. But there are indeed many changes in Italy, especially near the Vatican;
- Don't meet a family, if he quotes a very low price, you will accept it, and don't believe him too much. You must know that this is probably because you don't know the inside story;
- You can ask two families first to find out the situation. A rough estimate. If the tax may be two or three percent, then you still have to make people earn 20 or 30 pounds. First ask them for their quotation. You can say that the price is given to you by another family. Ask if they can give you a higher price. Of course, if you have a thin skin and are embarrassed to talk nonsense, you can just give them the price of this one when the price is lower than that of others.
## to sum up
The above is all the personal experiences and small tips about the exchange of travel expenses. Of course, these are just some things summarized based on our personal experience, we still need to analyze the specific situation. If you want to go out and play, you still want to walk around more to see how you feel. Therefore, it is not recommended that you waste too much time on this matter when economic conditions permit, as long as you feel that it is almost acceptable. Finally, I still want to say that if you don't need traveler's checks to play in Italy, you should not use it. After all, it is really troublesome and there are pits everywhere!
In the past hundreds of millions of years, due to the scarcity of survival resources, nature has constantly selected species through the law of "natural selection by nature, survival of the fittest". This makes "all for survival" the "objective function" of almost all species. Among the many surviving species, only humans have created and effectively used language as a tool. Language enables humans to carry out more complex reasoning thinking (imagination) and more effective communication of information between individuals. Thanks to language, human beings wittily prepare necessary survival resources in advance by predicting potential natural selection requirements and establish an effective system (market, trade) that coordinates resource creation (division of labor) and resource allocation. Inevitably, based on the habit of “everything for survival” and the ability to imagine and predict, human beings have formed a behavioral pattern that independently creates needs and solves needs, which results in two basic behavior motives, namely, the need to create needs. And the need to solve the needs.
## Theoretical verification
Observing the existing human social structure, whether the social group is a government, a social organization or an enterprise (company), its essence is a part of a closed-loop ecology that coordinates the needs of different human creation needs and the needs of solving needs. If a government, social organization, or enterprise can no longer serve as a link in a closed-loop ecology that coordinates human needs, it will quickly be replaced by other similar or different social groups that can perform its role more efficiently.
Jack Ma is a great entrepreneur and strategist. The Taobao e-commerce platform and mobile fast payment created by him have made the coordination of people's demand creation and demand resolution more efficient. This has enabled Alibaba to gain the trust of the masses, which is manifested in the extremely high resource control power that Alibaba possesses, which is its extremely high market value.
## Theoretical prediction
When the internal resources of human beings are insufficient to support the survival of all people for some reason (problems in production or circulation), the excess human population will always be erased in some form, which is the famous Malthus trap. When a country or nation encounters the Malthusian trap, it will always choose to launch a war to solve it. Since the number of people to be erased is relatively fixed, if a war is launched, more people of their own tribe or country will survive, but part of the death will be transferred to the Gentile population. The Huns in ancient times, Germany and Japan in World War II are all very typical examples.
Observing the wars in history, there were two large-scale wars, which we call the First and Second World Wars. The First World War was due to the replacement of manpower by a large number of machines, which necessitated the transfer of a large number of original manpower and labor. However, there is too much labor force to transfer in a short time. It shows that the unemployment rate is soaring, too many people have nothing to do, no income, and it is difficult to survive. In order to prevent this part of the labor force from getting out of control and making trouble, they had to divert their attention and start wars. This is caused by the stagnation of resource circulation caused by problems in the market system that coordinates the needs of people to create needs and meet the needs of needs. The same was true in World War II. When electric drives replaced the previous steam drives, a large number of laborers needed to be transformed. The United States took the lead in such problems in 1933. Because the Roosevelt administration had capital accumulated over the years of development, it was able to forcibly modify the ecological chain of resource circulation through the construction of a large number of civilian settings through the New Deal. However, Germany, which was looted just because of the First World War, and Japan, with its small territory and scarce resources, were not so lucky. They had to transfer their inevitable Malthusian trap to Jews and East Asia.
Now that computing technology is fully developed, artificial intelligence algorithms that can fit natural complex functions (laws of nature) by building polynomials have emerged. This makes most non-creative mental work tend to be replaced. So, where will this part of the original mental workforce go? Especially in populous countries such as China and India, once the transition of the labor force is not good, the cost of the Malthusian trap will be huge and will eventually be borne by the world.
My idea is, thanks to the development of digital technology, what if we can create a closed-loop ecosystem that can coordinate people's needs to create needs and needs to solve them? What if these original labor forces can quickly enter and adapt to the closed-loop ecosystem that we have created when the mental labor is replaced? Maybe we can avoid the terrible Malthus trap.
After thousands of years of civilization development, contemporary mankind is no longer satisfied with simply solving the needs of nature, but has begun to try and create some very cool and interesting needs that are not very conducive to survival. In other words, we do not need all humans to work hard to ensure that they can survive. We can spare a large part of humans to explore some new and interesting fields.
One possible idea is immersive online games. This online game is different from most existing online games. The business models of existing games mostly restrict the user's part of the functional experience through the program, and only users who have paid can use these functions. But the game I envision is more like a platform, from which players can propose their own (in-game) needs and can also solve other people's needs (ie transactions). This means that virtual currency can appear in a game, and the public recognition of the game will be reflected in the exchange rate between the game currency and the real currency. Game developers will develop through open source communities rather than enterprises, which means that the developers are not related to the game to a certain extent, thus ensuring the purity and efficiency of the game and making it possible to become a form of social infrastructure.
The low threshold of the game and the game conforms to the thinking habits of brain workers, so that the mental labor force can be relatively easily transferred from the original occupation to the corresponding immersive game. Moreover, due to the virtualization technology, the game has sufficient flexibility to accommodate a large number of new people. Different from the present, public opinion and social thinking will also set off a wave of pride in transitioning to the game, in order to avoid more harmful wars.
A bit similar to the view of function encapsulation in programming, the real world is similar to the main function, and each immersive online game is similar to sub-functions. The current society is like a program with only the main function, all functions are implemented in the main function. This makes the more complex the program functions, the more likely it is that various bugs will occur, which manifests as conflict or even war. And the future society is more like a main function with many sub-functions (immersive games). Each function is independent and dependent on each other, each game can coordinate its own closed-loop ecology, and partly interact with the main function. Such a social structure will become decentralized and look more stable and efficient.
-----------------
Note: Some of the ideas were inspired by [知 transit][1]
@ -469,3 +502,505 @@ gugu.print("This is from wIoT!!");
```
{% raw %}</span>{% endraw %}
{% raw %}<spanclass=".en">{% endraw %}
# Quick Start
## Current Support devices
- D1 MINI
## Node.js Install Node.js
Node.js is a widely used programming language for web developers. To make use of wIoT, you should first install Node.js to your computer.
For **windows** user, you can follow the instruction in [this website](https://www.jianshu.com/p/03a76b2e7e00)
## Install wIoT package
After install Node.js and configure npm successfully, you should then use npm to download wIoT package by enter following command in your command window.
```shell
npm install wiot
```
Windows user can use cmd or powershell.It should be notice that this may report error for some users. The solution is to open your cmd window as administrator. You can right click on cmd and choose *run as an administrator*. You can also press windows+R and input *cmd* then press Ctrl+Shift+Enter to open it as administrator.
## Burn firmware
## Connect your device to D1 MINI
- After burning the firmware, you should try to connect your device to D1 MINI
Follow the steps below, I'm sure it would not be a problem for such a smart person like you
### 1. Reset your D1 MINI
- Find pin **D0** on your D1 MINI, it should be in the middle of A0 and D5.
- Use a wire to connect **3V3** to **D0**. If your MINI works normally, you would see its BUILT-IN LED blink.
- You **don't** have to wait until it stops blink, just stay for **2s**, then you can pull out the wire and your MINI would reset.
### 2.Find your D1 MINI on your device
- After you finish step 1, your MINI would work in AP mode, which means you can search it with your smart phone or personal computer by scanning the Wi-Fi around
- If your MINI was reset successfully, you would find a Wi-Fi with SSID in the form of **wiot-xx:xx:xx:xx:xx:xx**.
In this page, you can see the MAC Address and wIoT version of your MINI
Again, please **remember** the MAC Address
### 2.Submit SSID and password to your MINI
From the page, you can see two blanks that ask the SSID and password of your Wi-Fi
Input information of the Wi-FI which you would like to connect your MINI, click *Submit*
If you have input the right SSID and password, you will see a page showing the message: **Set Successfully!! Rebooting!!**
Then, after a minute, you will see the SSID of D1 MINI has vanished
If you submitted the wrong message, do not try to directly reconnect to D1 MINI. Restart the whole procedure from the reset part of the last section
## Execute Example Code
If you have successfully connect D1 MINI to your Wi-Fi, you can execute the example code below to realize a simple function of wIoT
Before executing the code, you should first connect a LED to D1 MINI with positive pole connect to pin D4 and negative pole connect to GND
```js
var wiot = require('wiot'); //Import wiot package from npm
// Create an object of single chip
// Here are two parameters, MAC is the MAC adress of single chip, the output port should be defined in pin
// The MAC address should be editted by user
var MyMCU = new wiot.client({MAC: "3C:71:BF:3A:F6:CF", pin: {D4 : 1}, hint : true});
// The following code can let the BUILTIN_LED turn on for one second and off for one second periodically
// Wait for all the chips to get ready
wiot.begin([MyMCU], ()=>{
// First parameter is the name of chip, second parameter is the function that is going to be executed
// Set timer, pin 3 of MyMCU will pull up every 2 seconds
setInterval(()=>{
MyMCU.write(wiot.D4, wiot.HIGH);
}, 2000);
// Set timer, executer the command in {} after a one-second delay
setTimeout(()=>{
// Set timer, pin 3 of MyMCU will pull down every 2 seconds
setInterval(()=>{
MyMCU.write(wiot.D4, wiot.LOW);
}, 2000);
}, 1000);
});
```
The LED is expected to blink after you execute the code
# Advanced development
## Parameters
Name | Default Value | Declaration
----|-------|----
MAC | "" | MAC Address of MCU
pin | {D1: 0, D2: 0, D3: 0, D4: 0, D5: 0, D6: 0, D7: 0, D8: 0} | Mode of each pin, 0 is INPUT, 1 is OUTPUT, 2is INPUT_PULLUP
hint | true | Whether print the status prompt
debug | false | Whether open the debug mode
ip | "default" | Specify MCU IP, please try this option when you cannot find IP for a long time
port | 8848 | TCP Socket communication port for Client, default 8848
ip_range | "192.168.0" | IP search field, try this option if you cannot find IP for a long time
localIP | "127.0.0.1" | local IP
errDelayTime | 2000 | Retry interval when network error is encountered (milliseconds)
okDelayTime | 30 | Waiting time after receiving the network request (milliseconds)
resetDelayTime | 4500 | Waiting time for stop sending new messages after sending reset instructions to MCU (milliseconds)
noTryMaxTime | 15000 | If the MCU fails to respond after this time, the message will be sent again (milliseconds).
IntervalTime | 2000 | Interval between monitoring (heartbeat)
MaxToReScanTime | 180000 | After this time, if the MCU has no response, it will scan the IP address again (in milliseconds).
MinResearchTime | 5000 | Interval between each polling
IpScanTimeout | 1 | Ping detection timeout for IP scanning (seconds)
pingTimeout | 2 | Timeout of Heartbeat Ping detection (seconds)
MaxTraceBackTimes | 8 | Determine the number of historical heartbeats traced back to the connection state
## Parameters Declaration Example
### General Example
```js
var MyMCU = new wiot.client({
MAC: "xx:xx:xx:xx:xx:xx",
pin: {
D1: 0,
D2: 0,
D3: 1,
D4: 1,
D5: 0,
D6: 1,
D7: 0,
D8: 0
},
hint: true,
debug: false,
ip: "192.168.0.55",
port: 6666,
ip_range: "192.168.0",
localIP: "127.0.0.1",
errDelayTime: 2000,
okDelayTime: 30,
resetDelayTime: 4500,
noTryMaxTime: 15000,
IntervalTime: 2000,
MaxToReScanTime: 180000,
MinResearchTime: 5000,
IpScanTimeOut: 1,
pingTimeout: 2,
MaxTraceBackTimes: 8
});
```
## Event Binding
### Client
`.on(event, handler)`
#### Event List of client
- `begin` It begins when MCU starts to interact normally
- `disConnected` Disconnect from MCU
- `reConnected` Connection with MCU restored
```
js
var MCU = new wiot.client({"MAC": "xx:xx:xx:xx:xx:xx"});
MCU.on('disConnected', function () {
// Execute the command below when lost connection with MCU
console.log('Disconnected with MCU!!');
});
```
### Pin
`.pinOn(pin, event, handler)`
#### Event List of pin
- `on` Change output of pin from LOW to HIGH
- `off` Change output of pin from HIGH to LOW
- `change` Change the output of pin
```js
var MCU = new wiot.client({"MAC": "xx:xx:xx:xx:xx:xx"});
MCU.pinOn(wiot.D2, 'on', function () {
// Execute when the output of D2 changes from LOW to HIGH
console.log('D2 from LOW to HIGH!!');
});
```
### API
+ `wiot.begin()`: Execute when MCU is ready
```js
MCU0 = new wiot.client({MAC: "xx:xx:xx:xx:xx:xx", pin: {D4: wiot.OUTPUT}});
MCU1 = new wiot.client({MAC: "xx:xx:xx:xx:xx:ww"});
wiot.begin([MCU0, MCU1], ()=>{
//Write the command you want to execute here
//These command would execute once MCU0 and MCU1 are ready
});
```
+
`wiot.loop()`: A loop command,Suitable for conditional control statements
```js
MCU0 = new wiot.client({MAC: "xx:xx:xx:xx:xx:xx", pin: {D4: wiot.OUTPUT}});
MCU1 = new wiot.client({MAC: "xx:xx:xx:xx:xx:ww"});
// Following code would realize: When pin D5 of MCU0 receive HIGH,D4 of MCU1 would output HIGH
// When pin D5 of MCU0 receive LOW,D4 of MCU1 would output LOW
// This function receives two parameters: first is an array of objects for MCU, second is a function which use MCU array of objects as its parameter
wiot.loop([MCU0, MCU1], () => {
if(MCU1.read(wiot.D5) == wiot.HIGH){
MCU0.write(wiot.D4, wiot.HIGH);
}else{
MCU0.write(wiot.D4, wiot.LOW);
}
});
```
### Register
+ `wiot.register.set(status1, status2, function)`: Add a rule to register that status can be either value or function,
function would trigger if status1 == status2
The registry is designed to facilitate the use of various extension modules, See [extension module] below (# Sensor Extension Module).
+ `wiot.register.set(status, function)`: You can also pass in two functions, where the return value of status is of type bool, it would trigger the function if it changes to true
```js
var myLED = wiot.led(MyMCU, wiot.D4);
var pir = wiot.pir(MyMCU, wiot.D2);
//Sign up for a rule that says myLED lights up when pir detects a person
wiot.register.set(pir.getStatus, wiot.HIGH, ()=>{
myLED.set(wiot.HIGH);
});
//Sign up for a rule that when people leave, myLED goes off
wiot.register.set(()=>{
return (wiot.LOW == pir.getStatus);
}, ()=>{
myLED.clear();
});
```
## Sensor extension module
### LED
+ `wiot.led(MCU, pin)`: Declare a LED module
+ `wiot.led.getStatus()`: Get status of LED
+ `wiot.led.set(status, time = 0, isSmooth = false)`: Set led state, initial state, intermediate state, final state, period
+ `wiot.led.breath(period)`: Set a breathing LED
+ `wiot.led.clear()`: Reset LED
```js
var wiot = require('wiot'); //Import wiot package from npm
MCU0 = new wiot.client({MAC: "3C:71:BF:3A:F6:CF", pin: {D4: wiot.OUTPUT}});
var myLED = wiot.led(MCU0, wiot.D4); //Create a new led object using the D4 port on MCU0
/* If myLED is not shining, light it up*/
if(!myLED.getStatus()){
myLED.set(wiot.HIGH);
}
/* Set a breathing light with cycle of 2s */
myLED.breath(2000);
/* Set a LED which light 3 seconds and off 4 seconds */
myLED.set([wiot.HIGH, wiot.LOW], [3000, 4000]);
/* Set a breathing light which use 1 second to light and 3 second to extinguish */
+ `wiot.pir.getStatus()`: Gets the PIR state, returns the value wiot.high (have people), wiot.low (no people)
#### Event Trigger
+ `wiot.pir.on(event, handler)`
**Events List**
- `detected` Person detected
- `undetected` People out of the detective field
- `change` State change, includes from detected to undetected and from undetected to detected
```js
var wiot = require('wiot'); //Import wiot package from npm
MCU0 = new wiot.client({MAC: "3C:71:BF:3A:F6:CF"});
var myPIR = wiot.pir(MCU0, wiot.D2); //Create an object of pir, use the D2 port on MCU0
/* Output the status of pir to console */
console.log(myPIR.getStatus());
/* When human is detected,print "Detected People!" to console */
myPIR.on("detected", ()=>{
console.log("Detected People!");
});
/* When human is out of the detection zone,print "No People!!" to console */
myPIR.on("undetected", ()=>{
console.log("No People!!");
});
/* When there is a change to status, execute your command */
myPIR.on("change", ()=>{
/* Write command in here */
});
```
### IR Infrared Sensor
+ `wiot.ir(MCU, pin)`: Declare an IR module, pin can be analog or digital port
+ `wiot.ir.getStatus()`: Get IR state, return value wiot.high (with a barrier), wiot.low (with no barrier), or a value of 0-1024 (only for analog port)
#### Event Trigger
+ `wiot.ir.on(event, handler)`
**Event List**
- `detected` Barrier detected
- `undetected` Barrier vanished
- `change` Change state
```js
MCU0 = new wiot.client({MAC: "xx:xx:xx:xx:xx:xx"});
var myIR = wiot.ir(MCU0, wiot.D2); //Create a new ir object using the D2 port on MCU0
/* Output ir status to console */
console.log(myIR.getStatus());
/* When an object is detected, print "Detected Object!" to the console */
myIR.on("detected", ()=>{
console.log("Detected Object!");
});
/* When the object move out of the detective area, print "No Object!!" to the console */
myIR.on("undetected", ()=>{
console.log("No Object!!");
});
/* Execute the command when state changes */
myIR.on("change", ()=>{
/* Your command */
});
```
### lightSensor
+ `wiot.lightSensor(MCU, pin)`: Declare a lightSensor module, pin can be analog or digital port
+ `wiot.lightSensor.getStatus()`: Get lightSensor state, return value wiot.HIGH(light), wiot.LOW(dark), or a value of 0-1024 (limited to analog port)
#### Event Trigger
+ `wiot.light.on(event, handler)`
**Event List**
- `light` From dark to light
- `dark` From light to dark
- `change` Change state
```js
MCU0 = new wiot.client({MAC: "xx:xx:xx:xx:xx:xx"});
var myLightSensor = wiot.lightSensor(MCU0, wiot.D1); //Create a new pir object using the D2 port on MCU0
/* Output the LightSensor state to the console */
console.log(mylightSensor.getStatus());
/* When going from dark to Light, print "Light!!!" to the console */
myLightSensor.on("light", ()=>{
console.log("Light!");
});
/* When going from light to Dark, print "Dark!!" to the console */
myLightSensor.on("dark", ()=>{
console.log("Dark!!");
});
/* When the state changes, execute the command */
myLightSensor.on("change", ()=>{
/* Your command */
});
```
## Internet Extension Module
### Mail module
Use this module to send messages to the specified mailbox. Proudly built with reference to [Yimian API](https://api.yimian.xyz/)!
+ `wiot.mail(to, from = "wIoT")`: Declare an mail module with sender's name and reveiver's address
+ `wiot.mail.send(subject, body)`: Send email with a subject and content
```js
var mail = wiot.mail("i@iotcat.me", "wIoT Test");
mail.send("Test", "Test from wiot!!");
```
### guguji
Use this module to send messages to the specified cooing machine.Goo goo is a portable private printer, see [official website](https://www.memobird.shop/).
To use this module, you need to apply for your own developer ak in advance on the official website. See [here](https://api.yimian.xyz/gugu/intro.php). Proudly reference [Yimian API](https://api.yimian.xyz/)!
+ `wiot.guguji(ak, userID, memobirdID)`: Declare a goo goo chicken module, parameter: developer's ak, user id, cooing machine id
+ `wiot.guguji.send(msg)`: Send message, need to pass in the message to be sent
```js
var gugu = wiot.guguji("9e55121803474371bfa25d20e554b31f", "832598", "b3ee06a8bd9b49e1");