待完成

from django.db import models
# Create your models here.
class Book(models.Model):
nid = models.AutoField(primary_key=True) # 自增id(可以不写,默认会有自增id)
title = models.CharField(max_length=)
publishDdata = models.DateField() # 出版日期
price = models.DecimalField(max_digits=, decimal_places=) # 一共5位,保留两位小数 #一个出版社有多本书,关联字段要写在多的一方
# 不用命名为publish_id,因为django为我们自动就加上了_id
publish = models.ForeignKey("Publish",on_delete=models.CASCADE) #foreignkey(表名)建立的一对多关系
# publish是实例对象关联的出版社对象
authorlist = models.ManyToManyField("Author") #建立的多对多的关系
def __str__(self):
return self.title
class Publish(models.Model):
#不写id的时候数据库会自动给你增加自增id
name =models.CharField(max_length=)
addr = models.CharField(max_length=) def __str__(self):
return self.name
class Author(models.Model):
name = models.CharField(max_length=)
age = models.IntegerField()
def __str__(self):
return self.name class AuthorDeital(models.Model):
tel = models.IntegerField()
addr = models.CharField(max_length=)
author = models.OneToOneField("Author",on_delete=models.CASCADE) #建立的一对一的关系 class UserInfo(models.Model):
username = models.CharField(max_length=)
password = models.CharField(max_length=)

models.py

from django.conf.urls import url
from django.contrib import admin
from web import views
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^base/', views.base),
url(r'^del/(\d+)$', views.delbook),
# url(r'^test',views.test),
url(r'^add/$', views.addbook),
# 方式一:通过路径
url(r'^edit/(\d+)', views.editbook),
# 方式二:通过数据
# url(r'^edit/$', views.editbook),
url(r'^chakan/$', views.chakanbook),
url(r'^login/$', views.log_in),
url(r'^index/$', views.index),
url(r'^reg/$', views.reg),
url(r'^log_out/$', views.log_out),
url(r'^set_pwd/$', views.set_pwd),
]

urls.py

from django.shortcuts import render,redirect,HttpResponse
from web import models
# Create your views here.
from django.contrib import auth #auth模块
from django.contrib.auth.models import User #注册创建用户要用到
from django.contrib.auth.decorators import login_required #判断用户是否登录用到
from django.core.paginator import Paginator,EmptyPage,PageNotAnInteger #分页的时候要用到的
@login_required #查看用户是否登录
def delbook(request,id):
# 删除表中一行的图书信息
# islogin = request.COOKIES.get("islogin", None) # 获取cookies
# if islogin:
models.Book.objects.filter(nid=id).delete()
return redirect("/chakan/") @login_required
def addbook(request):
# islogin = request.COOKIES.get("islogin", None) # 获取cookies
# if islogin:
if request.method=="POST":
# print(request.POST)
title = request.POST.get("bookname")
publishDdata = request.POST.get("data")
author = request.POST.getlist("author")
print("作者",author)
price = request.POST.get("price")
publish =int(request.POST.get("publish"))
print("============",publish) # 吧作者添加进去
book_obj = models.Book.objects.create(title=title, publishDdata=publishDdata,price=price, publish_id=publish)
authors = models.Author.objects.filter(id__in=author)
book_obj.authorlist.add(*authors)
return redirect("/chakan/")
else:
pub_obj = models.Publish.objects.all() #查出所有的出版社对象
# print(pub_obj) authorlist= models.Author.objects.all()
print(authorlist)
return render(request,"add.html",{"publist":pub_obj,"authorlist":authorlist}) @login_required
def editbook(request,num): # islogin = request.COOKIES.get("islogin", None) # 获取cookies
# if islogin:
if request.method=="POST":
# 如果是post请求
# 先查出数据(怎么找到id呢?,隐藏一个input)
# 修改数据方式一:
id= request.POST.get("book_input_id")
print("=====",id)
title = request.POST.get("bookname")
data = request.POST.get("data")
price = request.POST.get("price")
publish =int(request.POST.get("publish"))
author = request.POST.getlist("author")
# pubsh_id = models.Publish.objects.filter(name=publish)[].id #得到出版社的id
models.Book.objects.filter(nid=id).update(title=title,publishDdata=data,price=price,publish_id=publish)
#清除关系(清除你点击的哪一行)
book_obj = models.Book.objects.filter(nid=id).first()
book_obj.authorlist.clear()
#然后再添加作者
authors = models.Author.objects.filter(id__in=author)
#绑定多对多关系
book_obj.authorlist.add(*authors)
return redirect("/chakan/")
else:
# id = request.GET.get("book_id") # print("id==========>",id)
# return HttpResponse("ok")
id = num
book_obj = models.Book.objects.filter(nid=id).first()
auth_obj = models.Author.objects.all()
#如果没有auth_obj 返回一个None why
print(book_obj) #拿到对象:Book object
publ_obj = models.Publish.objects.all() # 作者默认选定
edit_book_authors = book_obj.authorlist.all().values_list("id")
print(edit_book_authors)
l = []
for i in edit_book_authors:
l.append(i[])
print(l) #[, ] return render(request,"edit.html",{"book_obj":book_obj,"auth_obj":auth_obj,"publ_obj":publ_obj,"l":l}) @login_required
def chakanbook(request):
'''
批量导入
Booklist = []
for i in range(): Booklist.append(models.Book(title="book" + str(i), price= + i * i)) models.Book.objects.bulk_create(Booklist) :param request:
:return:
'''
book_list = models.Book.objects.all()# book_list打印的是一个对象 先查看所有的书
paginator=Paginator(book_list,) #这里的book_list必须是一个集合对象,把所有的书分页,一页有五个 print(paginator.page_range) #range(, )
page_range = paginator.page_range
num = request.GET.get("page",)#得到页数范围,默认有1页
try:
book_list = paginator.page(num) #显示第一页的内容
except:
book_list=None
return render(request,"chakan.html",{"book_list":book_list,"page_range":page_range,"num":int(num)}) def log_in(request):
print(request.POST)
if request.method =="POST":
username = request.POST.get("username")
password = request.POST.get("password")
print(username,password)
user=auth.authenticate(username=username,password=password)#验证用户名和密码
if user:
#如果认证成功,就让登录,这个login里面包括了session操作和cookie
auth.login(request,user)
return redirect("/chakan/")
else:
s = "用户名和密码输入错误"
return render(request,"login.html",{"s":s})
return render(request,"login.html") @login_required
def index(request):
# print("cookies:------->",request.COOKIES)
# islogin = request.COOKIES.get("islogin",None) #获取cookies
# print("=========",islogin)
# if islogin:
username = request.COOKIES.get("username")
return render(request,"chakan.html",{"username":username}) #用于用户注册
def reg(request):
if request.method=="POST":
username = request.POST.get("username")
password = request.POST.get("password")
#得到用户输入的用户名和密码创建一个新用户
User.objects.create_user(username=username,password=password) #User是以个对象
s = "恭喜你注册成功,现在可以登录了"
return redirect("/login/")
return render(request,"reg.html") @login_required
def log_out(request):
auth.logout(request)
return redirect("/login/") @login_required
def set_pwd(request):
if request.method=="POST":
oldpassword = request.POST.get("oldpassword")
newpassword = request.POST.get("newpassword")
#得到当前登录的用户,判断旧密码是不是和当前的密码一样
username = request.user #打印的是当前登录的用户名
user = User.objects.get(username=username) #查看用户
ret = user.check_password(oldpassword) #检查密码是否正确
if ret:
user.set_password(newpassword) #如果正确就给设置一个新密码
user.save() #保存
return redirect("/login/")
else:
info = "输入密码有误"
return render(request,"set_pwd.html",{"info":info})
return render(request,"set_pwd.html") def base(request):
return render(request,"base.html")

views.py

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width">
<title>Title</title>
<link rel="stylesheet" href="/static/bootstrap.css">
<style>
{% block style %}
/*
*/
.menu {
margin: -20px; border-bottom: 1px solid #;
width: 200px;
}
.container{
margin-top: 50px;
}
.head {
padding: 15px;
}
.menu .nav-sidebar > li > a {
padding-right: 40px;
padding-left: 40px;
width: 200px;
} table {
margin-top: 50px;
margin-left: 40px;
}
.add{
margin-top: 20px;
}
.head.bg-primary{
width: 200px;
} .left{
/*
background-color: rgba(255, 172, 73,0.2);
*/
width: %;
height: 600px;
display: inline-block;
}
.right{
/*
background-color: #4cff48;
*/
float: right;
display: inline-block;
width: %;
height: 600px; }
{% endblock %}
</style> </head>
<body>
<!--导航条--> <nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="http://v3.bootcss.com/examples/dashboard/#左侧菜单.html">海燕图书管理系统</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="/log_out/">注销</a></li>
<li><a href="/set_pwd/">修改密码</a></li>
<li><a href="">设置</a></li>
<li><a href="">个人中心</a></li>
</ul>
<form class="navbar-form navbar-right">
<input type="text" class="form-control" placeholder="Search...">
</form>
</div>
</div>
</nav> <div class="container">
<!--左侧菜单+-->
<div class="left">
<div class="row">
<div class="col-sm-3 col-md-2 sidebar">
<div class="menu">
<div class="head bg-primary">图书管理操作</div>
<ul class="nav nav-sidebar">
<li><a href="/add/">》》添加图书</a></li>
<li><a href="editbook">》》修改图书</a></li>
<li><a href="/chakan/">》》查看图书</a></li>
</ul>
</div> <div class="menu">
<div class="head bg-primary">作者管理操作</div>
<ul class="nav nav-sidebar">
<li><a href="">》》添加作者</a></li>
<li><a href="">》》查看作者</a></li>
<li><a href="">》》编辑作者</a></li>
</ul>
</div> <div class="menu">
<div class="head bg-primary">出版社管理</div>
<ul class="nav nav-sidebar">
<li><a href="">》》添加出版社</a></li>
<li><a href="">》》查看出版社</a></li>
<li><a href="">》》编辑出版社</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="right">
{% block add%} {% endblock %}
</div>
</div> <script src="/static/jquery.min.js"></script>
<script src="/static/bootstrap.min.js"></script>
<script>
//左侧菜单
$(".head").on("click", function () {
// 兄弟标签 紧挨着的ul标签 隐藏 addClass("hide")
$(this).parent().siblings().children("ul").slideUp();
// 把自己 紧挨着的ul标签显示 removeClass("hide")
// $(this).next().removeClass("hide");
$(this).next().slideToggle();
});
</script>
</body>
</html>

base.html

{% extends "base.html" %}
{% block style %}
{{ block.super }}
.form-horizontal {
margin-top: 100px;
}
.panel{
margin-top:30px;
width: 700px;
height: 500px;
margin-left: 100px;
}
{% endblock %} {% block add %}
<div class="panel panel-primary">
<div class="panel-heading">添加书籍信息</div>
<div class="panel-body">
<form class="form-horizontal" action="/add/" method="post">
{% csrf_token %}
<div class="form-group">
<label for="bookname" class="col-sm-2 control-label">书名:</label>
<div class="col-sm-10">
<input type="text" name="bookname" id="bookname">
</div>
</div>
<div class="form-group">
<label for="data" class="col-sm-2 control-label">出版日期:</label>
<div class="col-sm-10">
<input type="date" name="data" id="data">
</div>
</div>
<div class="form-group">
<label for="author" class="col-sm-2 control-label">作者:</label>
<div class="col-sm-10">
<select name="author" id="author" multiple>
{% for author_obj in authorlist %}
<option value="{{ author_obj.id }}">{{ author_obj.name }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="form-group">
<label for="price" class="col-sm-2 control-label">价格:</label>
<div class="col-sm-10">
<input type="text" name="price" id="price">
</div>
</div>
<div class="form-group">
<label for="publish" class="col-sm-2 control-label">出版社:</label>
<div class="col-sm-10">
<select name="publish" id="publish">
{% for pub_obj in publist %}
<option value="{{ pub_obj.id }}">{{ pub_obj.name }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-10 col-md-offset-2">
<input type="submit">
</div>
</div>
</form>
</div>
</div>
{% endblock %}

add.html

{% extends "base.html" %}
{% block add %}
<h1 class="pull-right" style="font-size: 30px">欢迎{{ request.user }}登录</h1>
<div class="row">
<div class="col-md-9 col-md-offset-2">
<a href="/add/">
<button class="btn btn-primary add">添加图书</button>
</a>
<table class="table table-hover">
<thead>
<tr>
<th>编号</th>
<th>书名</th>
<th>出版日期</th>
<th>作者</th>
<th>价钱</th>
<th>出版社</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{% for book in book_list %}
<tr>
<td>{{ forloop.counter }}</td>
<td>{{ book.title }}</td>
<td>{{ book.publishDdata|date:'Y-m-d' }}</td>
<td>
{% for item in book.authorlist.all %}
{{ item.name }}
{% endfor %} </td>
<td>{{ book.price }}</td>
<td>{{ book.publish }}</td>
<td>
<a href="/del/{{ book.nid }}">
<button class="btn btn-danger">删除</button>
</a>
<a href="/edit/{{ book.nid }}"><button class="btn btn-success">编辑</button></a>
<a href="/edit/?book_id={{ book.nid }}">
<button class="btn btn-success">编辑</button>
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<nav aria-label="Page navigation" class="pull-right">
<ul class="pagination">
{% if book_list.has_previous %}
<li><a href="/chakan?page={{ book_list.previous_page_number }}" aria-label="Previous">上一页</a></li>
{% else %}
<li class="disabled"><a href="" aria-label="Previous">上一页</a></li>
{% endif %} {% for index in page_range %}
{% if num == index%}
<li class="active"><a href="/chakan?page={{ index }}">{{ index }}</a></li>
{% else %}
<li><a href="/chakan?page={{ index }}">{{ index }}</a></li>
{% endif %} {% endfor %} {% if book_list.has_next %}
<li><a href="/chakan?page={{ book_list.next_page_number }}" aria-label="Previous">下一页</a></li>
{% else %}
<li class="disabled"><a href="" aria-label="Previous">下一页</a></li>
{% endif %}
</ul>
</nav>
{% endblock %}

chakan.html

{% extends "base.html" %}
{% block style %}
{{ block.super }}
.form-horizontal {
margin-top: 100px;
}
.panel{
margin-top:30px;
width: 700px;
height: 500px;
margin-left:200px;
}
{% endblock style %} {% block add %}
<div class="panel panel-primary">
<div class="panel-heading">修改图书信息</div>
<div class="panel-body">
<form class="form-horizontal" action="/edit/" method="post">
{% csrf_token %}
<div class="form-group">
<div class="col-sm-10">
<input type="hidden" name="book_input_id" value="{{ book_obj.nid }}">
</div>
</div>
<div class="form-group">
<label for="bookname" class="col-sm-2 control-label">书名:</label>
<div class="col-sm-10">
<input type="text" name="bookname" value="{{ book_obj.title }}">
</div>
</div>
<div class="form-group">
<label for="data" class="col-sm-2 control-label">出版日期:</label>
<div class="col-sm-10">
<input type="date" name="data" value="{{ book_obj.publishDdata|date:"Y-m-d" }}">
</div>
</div>
<div class="form-group">
<label for="author" class="col-sm-2 control-label">作者:</label>
<div class="col-sm-10">
<select name="author" id="author" multiple>
{% for auth in auth_obj %}
{% if auth.id in l %}
<option selected value="{{ auth.id }}">{{ auth.name }}</option>
{% else %}
<option value="{{ auth.id }}">{{ auth.name }}</option>
{% endif %}
{% endfor %}
</select>
</div>
</div>
<div class="form-group">
<label for="data" class="col-sm-2 control-label">价钱:</label>
<div class="col-sm-10">
<input type="text" name="price" value="{{ book_obj.price }}">
</div>
</div>
<div class="form-group">
<label for="publish" class="col-sm-2 control-label">出版社:</label>
<div class="col-sm-10">
<select name="publish" id="publish">
{% for publ in publ_obj %}
{% if publ.id == book_obj.publish.id %}
<option value="{{ publ.id }}" selected>{{ publ.name }}</option>
{% endif %}
<option value="{{ publ.id }}">{{ publ.name }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-10 col-md-offset-2">
<input type="submit">
</div>
</div>
</form>
</div>
</div>
{% endblock add %}

edit.html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width">
<title>Title</title>
</head>
<body>
<h1>hello{{ username }}</h1>
</body>
</html>

index.html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width">
<title>用户登录</title>
<script src="/static/jquery.min.js"></script>
<script src="/static/bootstrap.min.js"></script>
<link rel="stylesheet" href="/static/bootstrap.css"> <style>
.c1{
margin-top: 100px;
}
.btn{
width: 300px;
}
.c2{
margin-left:80px;
}
.reg{
text-decoration: none;
color: white;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="c1 col-md-5 col-md-offset-3">
<form class="form-horizontal" action="/login/" method="post" novalidate>
{% csrf_token %}
<h3 style="color: red">{{ s }}</h3>
<h3 style="text-align: center">请登录</h3>
<div class="form-group">
<label for="username" class="col-sm-2 control-label">用户名</label>
<div class="col-sm-10">
<input type="email" class="form-control" id="username" placeholder="username" name="username">
</div>
</div>
<div class="form-group">
<label for="password" class="col-sm-2 control-label">密码</label>
<div class="col-sm-10">
<input type="password" class="form-control" name="password" id="password"
placeholder="Password">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary">登录</button>
</div>
</div>
</form>
<a href="/reg/" class="reg"><button type="submit" class="btn btn-success c2">注册</button></a>
</div>
</div>
</div> </body>
</html>

login.html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width">
<title>用户登录</title>
<link rel="stylesheet" href="/static/bootstrap.css">
<script src="/static/bootstrap.min.js"></script>
<style>
.c1{
margin-top: 100px;
}
.c2{
width: 100px;
margin-left: 80px;
}
.c3{
width: 100px;
margin-left: 90px;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="c1 col-md-5 col-md-offset-3">
<form class="form-horizontal" action="/reg/" method="post" novalidate>
{% csrf_token %}
<h3 style="text-align: center">请填写下面信息注册</h3>
<div class="form-group">
<label for="username" class="col-sm-2 control-label">用户名</label>
<div class="col-sm-10">
<input type="email" class="form-control" id="username" placeholder="username" name="username">
</div>
</div>
<div class="form-group">
<label for="password" class="col-sm-2 control-label">密码</label>
<div class="col-sm-10">
<input type="password" class="form-control" name="password" id="password"
placeholder="Password">
</div>
</div>
<input type="submit" class="c2">
<input type="submit" class="c3" value="取消">
</form>
</div>
</div>
</div> </body>
</html>

reg.html

{% extends "base.html" %}
{% block style %}
{{ block.super }}
.form-horizontal {
margin-top: 100px;
}
.panel{
margin-top:30px;
width: 700px;
height: 500px;
margin-left: 200px;
}
.btn{
width:150px;
margin-left:200px;
} {% endblock %} {% block add %}
<div class="container">
<div class="row">
<div class="col-md-6 c1">
<div class="panel panel-danger">
<div class="panel-heading">
<h3 class="panel-title">修改密码</h3>
</div>
<div class="panel-body">
<form class="form-horizontal" method="post" action="/set_pwd/">
{% csrf_token %}
<div class="form-group">
<label for="oldpassword" class="col-sm-2 control-label">旧密码</label>
<div class="col-sm-6">
<input type="password" class="form-control" id="oldpassword"
placeholder="Oldpassword"
name="oldpassword">
</div>
</div>
<div class="form-group">
<label for="newpassword" class="col-sm-2 control-label">新密码</label>
<div class="col-sm-6">
<input type="password" class="form-control" id="newpassword"
placeholder="Newpassword"
name="newpassword">
</div>
</div>
<button type="submit" class="btn btn-success">确定</button>
</form> <h3>{{ info }}</h3>
</div>
</div>
</div>
</div>
</div>
{% endblock %}

set_pwd.html

django----图书管理的更多相关文章

  1. django图书管理半成品(MySQL)

    本次需要用到MySQL数据库,所以先配置数据库,在seeting文件中配置: 数据库第一次使用需要配置: python manage.py makemigrations #生成配置文件 python ...

  2. 66、django之模型层(model)--多表相关操作(图书管理小练习)

    前面几篇随笔的数据库增删改查操作都是在单表的操作上的,然而现实中不可能都是单表操作,更多的是多表操作,一对一,一对多,多对多的表结构才是我们经常需要处理的,本篇将带我们了解多表操作的一些相关操作.也会 ...

  3. django之模型层(model)--多表相关操作(图书管理小练习)

    前面几篇随笔的数据库增删改查操作都是在单表的操作上的,然而现实中不可能都是单表操作,更多的是多表操作,一对一,一对多,多对多的表结构才是我们经常需要处理的,本篇将带我们了解多表操作的一些相关操作.也会 ...

  4. day 47 Django 4的简单应用 创建简单的图书管理 (单表的增删改查)

    前情提要  Django  已经学了大半.. 很多东西已经能够使用在生产环境当中 一:模糊查询 二:单表删除 三:单表修改 四:图书管理 图书管理操作 视图结构 A:路由层 A :配置路由文件 参数解 ...

  5. Django学习笔记(11)——开发图书管理页面

    一,项目题目: 开发图书管理页面 该项目主要练习Django对多个数据库进行增删改查的操作. 二,项目需求: 基础需求:75% 1. 列出图书列表.出版社列表.作者列表 2. 点击作者,会列出其出版的 ...

  6. Django项目实践4 - Django网站管理(后台管理员)

    http://blog.csdn.net/pipisorry/article/details/45079751 上篇:Django项目实践3 - Django模型 Introduction 对于某一类 ...

  7. Django项目实践4 - Django站点管理(后台管理员)

    http://blog.csdn.net/pipisorry/article/details/45079751 上篇:Django项目实践3 - Django模型 Introduction 对于某一类 ...

  8. Django图书管理系统(前端对有外键的数据表增删改查)

    图书管理 书籍管理 book name 项目源码位置:https://gitee.com/machangwei-8/learning_materials/tree/master/%E9%A1%B9%E ...

  9. java图书管理的一个小模块(增删改查,不使用数据库)

    图书管理模块:某图书管需要对图书进行信息化管理,要求管理员能够进行新增图书,能按照书名进行模糊查看图书能进行价格统计 系统实现如下:1.新增2.查询3.统计价格 1请输入新书:图书号,书名,作者,价格 ...

  10. django站点管理

    一.启动django站点管理功能 1.关于django.contrib包   包含了django自带的众多附加组件,主要包括:   1)管理工具: django.contrib.admin   2)用 ...

随机推荐

  1. 剑指Offer-第一个只出现一次的字符位置

    题目描述 在一个字符串(1<=字符串长度<=10000,全部由字母组成)中找到第一个只出现一次的字符,并返回它的位置 思路 思路一: 使用整型数组对出现次数进行统计. 思路二: 使用Bit ...

  2. Python 9 进程,线程

    本节内容 python GIL全局解释器锁 线程 进程 Python GIL(Global Interpreter Lock) In CPython, the global interpreter l ...

  3. AngularJS--及其他js框架对比

    ----和 **类似?? Angular 2.谷歌的 React   Facebook的 Vue.js. Ember.js. https://github.com/angular/angular.js ...

  4. logistic回归为什么要使用sigmoid函数

    https://www.baidu.com/link?url=LnDjrhLG7Fx6YVgR9WljUILkPZrIzOR402wr2goIS-ARtDv9TwZ2VYVbY74fyVpQlE22n ...

  5. MySql cmd下的学习笔记 —— 有关建立表的操作(有关于数据类型)

    (01)建表的过程实际上是 声明字段 的过程 一. 列类型(字段): 存储同样的数据时,不同的列类型,所占据的空间和效率是不一样的,这就是建表时要考虑的意义. 二.MySQL三大列类型     数值型 ...

  6. Configuring Automatic Restart of an Oracle Database

    https://docs.oracle.com/cd/E11882_01/server.112/e25494/restart.htm#ADMIN12708

  7. 利用crash 分析软死锁问题【转】

    转自:https://blog.csdn.net/divlee130/article/details/47806551 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog. ...

  8. 删除元素splice、shift\pop

      splice() 方法: 向/从数组中添加/删除项目,然后返回被删除的项目. splice( index位数, 数量, 新添加 ) 该方法会改变原始数组 删除数组中第一个元素 arr.shift( ...

  9. 035_lua快速入门

    执行下面的脚本用luajit test.lua即可 一.变量及逻辑运算 --number, string, boolean, table, function, thread, userdata, ni ...

  10. svn:Item ‘XXXXXX’ is out of date

    问题描述:     工作副本没有更新到最新版本 svn: 提交失败(细节如下): svn: 目录 "D:\develop\workspace\gxcjx\src\main\resources ...