Skip to content

Instantly share code, notes, and snippets.

yang wzyuliyang

Block or report user

Report or block wzyuliyang

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@wzyuliyang
wzyuliyang / BSync.java
Created Oct 10, 2014
屏蔽模型【全球天气例子】
View BSync.java
public class BSync {
int totalThreads;
int currentThreads;
public BSync(int x) {
totalThreads = x;
currentThreads = 0;
}
public synchronized void waitForAll() {
currentThreads++;
if(currentThreads < totalThreads) {
@wzyuliyang
wzyuliyang / hibenate-test-in-idea-Main.java
Created Oct 11, 2014
Hibernate框架在IDEA中的测试,Idea专业版
View hibenate-test-in-idea-Main.java
import cn.cn.com.database.StudentEntity;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import org.hibernate.service.ServiceRegistry;
import org.hibernate.service.ServiceRegistryBuilder;
import java.util.Iterator;
@wzyuliyang
wzyuliyang / JsoupDEMO.java
Created Oct 11, 2014
Jsoup的简单使用
View JsoupDEMO.java
package cn.com.leeyoung.main;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import java.io.IOException;
/**
* Created by leeyoung on 2014/10/11.
*/
@wzyuliyang
wzyuliyang / server.py
Created Oct 14, 2014
socket python服务器端
View server.py
__author__ = 'leeyoung'
#! /usr/bin/python
# -*- coding: utf-8 -*-
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_address = ('10.104.1.91', 3200)
print "Starting up on %s:%s" % server_address
sock.bind(server_address)
sock.listen(1)
@wzyuliyang
wzyuliyang / corners_bg.xml
Last active Aug 29, 2015
圆角android textview
View corners_bg.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#FFFFFF" />
<corners android:topLeftRadius="20dp"
android:topRightRadius="20dp"
android:bottomRightRadius="20dp"
android:bottomLeftRadius="20dp"/>
</shape>
View main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.server2.MainActivity"
tools:ignore="MergeRootFrame" android:background="#ff96ff72">
<LinearLayout
@wzyuliyang
wzyuliyang / net_connect.sh
Created Oct 29, 2014
Rapberry Pi AUTO CONNECT TO THE WEB
View net_connect.sh
#!/bin/bash
result=$(curl -s -o /dev/null -w "%{http_code}" http://www.baidu.com)
echo $result
okflag=200
if [ $result -eq 200 ] ; then
echo "Network is ok"
else
echo "Network connection down! Attempting reconnection."
curl --silent -d 'DDDDD=your-bupt-student-id&upass=your-password&AMKKey=' '10.3.8.211/a11.$
@wzyuliyang
wzyuliyang / qtcreator.cpp
Last active Aug 29, 2015
test-opencv-qtcreator
View qtcreator.cpp
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/core/core.hpp>
using namespace cv;
int main()
{
VideoCapture cap(0);
if(!cap.isOpened())
{
return -1;
@wzyuliyang
wzyuliyang / octpress-temple.md
Created Nov 9, 2014
ooctpress 文章 模板
View octpress-temple.md
layout title keywords date description comments categories tags
post
This is a new post
octopress, analytics
2014-11-08 10:12:00 +0800
Octopress博客搭建问题
true
Octopress
octopress
博客
@wzyuliyang
wzyuliyang / StringIO.py
Last active Aug 29, 2015
From http://www.bogotobogo.com/python/python_files.php python 内存中加载 已存在的 String 当文件使用
View StringIO.py
>>> import io
>>> my_string = 'C is quirky, flawed, and an enormous success. - Dennis Ritchie (1941-2011)'
>>> my_file = io.StringIO(my_string)
>>> my_file.read()
'C is quirky, flawed, and an enormous success. - Dennis Ritchie (1941-2011)'
>>> my_file.read()
''
>>> my_file.seek(0)
0
>>> my_file.read(10)
You can’t perform that action at this time.