自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(20)
  • 收藏
  • 关注

原创 socket编程实验-UDP文件传输

总是说UDP不可靠,试试用UDP写了个文件传输工具,顺便熟悉一下Python的文件操作。测试一下确实不靠谱啊,文件传输没问题就是不稳定。代码如下服务端:# encoding: utf-8from socket import *import osserverPort = 6666serverSocket = socket(AF_INET, SOCK_DGRAM)serverSocket

2015-12-28 17:00:38 536

原创 socket编程实验-简单的Web服务器

为了熟悉Python的网络编程,自己写了一个服务端,在浏览器联系时创建一个套接字,返回一个HTML页面,代码如下from socket import *def HttpResponse(header,html): f = file(html) contextlist = f.readlines() context = ''.join(contextlist)

2015-12-28 14:23:30 697

原创 Python的复习(上)

1. print  不解释,开头可用#--coding:utf-8--2. # 注释3. + - * / % > = 4. 变量命名用_5. print "%s" % work_hard6. print "%s %s" % (a,b)7. 输出字符串时用+可连接8. %r 9. “”“ ”“” 多行10. \ 转义字符  \t tab11. raw_inpu

2015-11-06 21:43:43 300

原创 要注意的基础知识!

两次面试失败,我收获到了很多以前忽略了的东西。注意复习基础概念,一定要细致的复习!刷过的题一定要记住,基础算法也要记牢!注意面试官的问题,别急着回答,多想想回答什么效果更好!多学习一些新知识,前沿技术!要拿实际的东西证明自己的学习能力!

2015-09-23 19:56:50 279

原创 LeetCode:ZigZag Conversion

The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA P L S I

2015-08-30 18:17:05 227

原创 LeetCode:Invert Binary Tree

Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Trivia:This problem was inspired by this original tweet by Max Howe

2015-08-29 22:14:54 204

原创 LeetCode:Summary Ranges

Given a sorted integer array without duplicates, return the summary of its ranges.For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"].class Solution {public: vector summaryRanges(v

2015-08-29 20:07:57 196

原创 LeetCode:Power of Two

Given an integer, write a function to determine if it is a power of two.好简单。。。class Solution {public: bool isPowerOfTwo(int n) { if(!n){ return 0; } while

2015-08-28 17:10:39 206

原创 LeetCode:Implement Queue using Stacks

Implement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes the element from in front of queue.peek() -- Get the front element.empty(

2015-08-28 15:26:34 245

原创 LeetCode:Palindrome Linked List

Given a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n) time and O(1) space?要求时间复杂度为n,想了一下只能用快慢两个指针做,先找到中点,然后倒置后面一半链表比较。写的过程中放了好多低级错误,基础还是要加强啊。class S

2015-08-27 22:12:53 237

原创 LeetCode:Valid Anagram

Given two strings s and t, write a function to determine if t is an anagram of s.For example,s = "anagram", t = "nagaram", return true.s = "rat", t = "car", return false.Note:You may a

2015-08-26 20:30:00 249

原创 LeetCode:Binary Tree Paths

Given a binary tree, return all root-to-leaf paths.For example, given the following binary tree: 1 / \2 3 \ 5All root-to-leaf paths are:["1->2->5", "1->3"]class Sol

2015-08-26 16:00:49 248

原创 LeetCode:Add Digits

Given a non-negative integer num, repeatedly add all its digits until the result has only one digit.For example:Given num = 38, the process is like: 3 + 8 = 11, 1 + 1 = 2. Since 2 has on

2015-08-26 12:50:19 303

原创 LeetCode:Ugly Number

Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6, 8 are ugly while 14 is not ugly si

2015-08-24 21:28:26 299

原创 LeetCode:Length of Last Word

Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word does not exist, return 0.Note: A word is

2015-08-24 17:13:43 222

原创 LeetCode:Excel Sheet Column Number

Related to question Excel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column number.For example: A -> 1 B -> 2 C -> 3 ...

2015-08-24 15:45:54 229

原创 由string删除某个字符的操作发现的一个问题

最近在看C++primer,3.2 标准库类型string有一个习题,写一个程序将输入的字符串中的符号删除后输出。我新建了一个字符串接收非符号的字符串,但是最后输出结尾部分总是多一个a。#include#include#includeusing namespace std;int main(){ string dd,dd2; cin >> dd; decltype(dd.size()

2015-05-17 21:52:16 1209

原创 c++实现快速排序

两种方法实现c++

2015-05-01 15:29:22 253

原创 wamp中Apache多站点配置,Forbidden解决

1.在\wamp\bin\apache\apache2.4.9\conf\extra中找到httpd-vhosts文件,用写字板打开,在后边可以看到【ServerAdmin ...】 ---设置管理员邮箱地址【DocumentRoot ...】 ---网站代码存放位置目录【ServerName ...】 ---主机名ServerAlias www.dummy-host.exam

2015-04-05 20:36:18 657

原创 Java实现简单的图书管理系统

最近在学习Java网络编程,写了一个图书管理系统练手。使用文件的输入和输出类实现对书记数据的保存和读取。 FileInputStream和FileOutputStream类为建立一个与文件相关的输入与输出流,提供从文件中读取或者写入一个字节或一组数据的方法。而ObjectOutputStream是用来输入对象。最后程序还有一点小问题,加入书籍会覆盖以前加入的书籍数据,之后有时间再修改。pa

2015-03-30 21:04:53 6720 2

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除