#项目整体架构
##概述
本项目采用基于Node全栈式开发的NodeJS Midway架构,详细实现原理请参照 淘宝UED。
前端除了需要编写UI层的HTML、CSS和JavaScript等浏览器端UI和控制逻辑,还需要编写NodeJS中间层控制逻辑。NodeJS中间层与后端服务器进行RESTful通信并预渲染页面,同时返回部分静态文件。用户在浏览器端访问的服务器是NodeJS中间层的预渲染服务,真后端服务器不暴露。
- 交互图示如下:
/* eslint-disable no-var */ | |
var path = require('path'); | |
var autoprefixer = require('autoprefixer'); | |
const MATCH_ALL_NON_RELATIVE_IMPORTS = /^\w.*$/i; | |
module.exports = [{ | |
output: { | |
filename: '[name].js', | |
library: 'atrium-react-plugin-beta', |
electCourseTable.config.time=500; | |
window.confirm=function(){ | |
return true; | |
}; | |
function updateCountHint(){ | |
$('.stdCount').each(function(){ | |
var numArray = $(this).html().split('/'); | |
if (numArray[2] >= 1) { | |
$(this).css({'background-color':'red'}); | |
if ($(this).parent().find('a[title="点击查看教学任务信息"]').html().indexOf('日语') !== -1) { |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <arpa/inet.h> | |
#include <string.h> | |
#include "trans_packet.h" | |
void on_packet_recv(char* from_ip, uint16_t from_port, char* payload, int size, unsigned int seq) { | |
printf("Packet received from=%s:%d, seq=%d\n", from_ip, from_port, seq); | |
char* message = (char*)malloc(size); | |
memcpy(message, payload, size); |
obj-m += tcp_svr_sample.o | |
all: | |
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules | |
clean: | |
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clea |
#!/bin/bash | |
LOG_FILE=/var/log/xiaoyu/error.log | |
ERROR_KEYWORD="Error" | |
EMAIL="[email protected]" | |
SUBJECT="Error Report from loveoncampus.cn" | |
PREFIX="<h2>Error detected on server loveoncampus!</h2><br/>Error log:<br/><div style='background-color:#f1f1f1;padding:10px;'>" | |
FOLLOW="</div>" | |
LAST_LOG_TIME=$(stat -c %Y $LOG_FILE) |
from PIL import Image | |
ASCII_CHARS = [ '#', '?', '%', '.', 'S', '+', '.', '*', ':', ',', '@'] | |
def scale_image(image, new_width=100): | |
"""Resizes an image preserving the aspect ratio. | |
""" | |
(original_width, original_height) = image.size | |
aspect_ratio = original_height/float(original_width) | |
new_height = int(aspect_ratio * new_width) |
#!/bin/sh | |
usage() { | |
cat <<-EOF | |
Usage: ss-rules [options] | |
Valid options are: | |
-s <server_host> hostname or ip of shadowsocks remote server | |
-l <local_port> port number of shadowsocks local server |
http://chiontang.zyns.com:90 |
#项目整体架构
##概述
本项目采用基于Node全栈式开发的NodeJS Midway架构,详细实现原理请参照 淘宝UED。
前端除了需要编写UI层的HTML、CSS和JavaScript等浏览器端UI和控制逻辑,还需要编写NodeJS中间层控制逻辑。NodeJS中间层与后端服务器进行RESTful通信并预渲染页面,同时返回部分静态文件。用户在浏览器端访问的服务器是NodeJS中间层的预渲染服务,真后端服务器不暴露。
<!--TODO : 修改图片路径 --> | |
<img src="test.jpg" id="pic" /> | |
<textarea id="result_text" rows="10" cols="30"> | |
</textarea> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"></script> | |
<script> | |
(function() { | |
function get_init_point(e) { |