Skip to content

Instantly share code, notes, and snippets.

@freetstar
freetstar / 1to100.c
Last active October 13, 2015 08:28
将1到100以螺旋的方式输出,具体结果见代码
/*
* =====================================================================================
*
* Filename: 111.c
*
* Description:
*
* Version: 1.0
* Created: 2012年11月29日 15时08分53秒
* Revision: none
@freetstar
freetstar / findprimenumber.c
Created November 23, 2012 09:46
寻找质数
#include <stdio.h>
int main(int argc, const char *argv[])
{
int max = 100;
int num = 0;
int a[100];
for(int i=0;i<max;i++)
{
int j=2;
@freetstar
freetstar / sort.c
Created November 14, 2012 10:06
a,b,c三个整数依次从大到小输出结果
#include <stdio.h>
int max(int n,int m)
{
return m>=n?m:n;
}
int min(int n,int m)
{
return m>=n?n:m;
@freetstar
freetstar / downloadkindlescreensavor.py
Created October 9, 2012 06:35
从多看论坛下载论坛屏保附件
#!/usr/bin/env python2
#-*- coding=utf-8 -*-
import urllib2
from BeautifulSoup import BeautifulSoup
start_page = 1
end_page = 38
base_url="http://bbs.duokan.com/forum/thread-41804-%s-1.html"
img_list = []
@freetstar
freetstar / navigation.js
Created August 18, 2012 15:24 — forked from pala/navigation.js
jquery keyboard navigation
$(function(){
$(document).keydown(function(e) {
var url = false;
if (e.which == 37 || e.which == 74) { // Left arrow and J
{% if page.previous %}
url = '{{page.previous.url}}';
{% endif %}
}
else if (e.which == 39 || e.which == 75) { // Right arrow and K
{% if page.next %}
@freetstar
freetstar / navigation.js
Created August 18, 2012 15:21 — forked from pala/navigation.js
jquery keyboard navigation
$(function(){
$(document).keydown(function(e) {
var url = false;
if (e.which == 37 || e.which == 74) { // Left arrow and J
{% if page.previous %}
url = '{{page.previous.url}}';
{% endif %}
}
else if (e.which == 39 || e.which == 75) { // Right arrow and K
{% if page.next %}
@freetstar
freetstar / gist:2939585
Created June 16, 2012 01:50 — forked from fxsjy/gist:2928683
bpnn solve kindergarten problem
# Back-Propagation Neural Networks
# another way: solve it as a Regression Problem
# Written in Python. See http://www.python.org/
# Modified by JSun to solve the problem here: http://www.weibo.com/1497035431/ynPEvC78V
# Neil Schemenauer <[email protected]>
import math
import random
import string
@freetstar
freetstar / ai-class.py
Created November 13, 2011 05:01 — forked from vickychijwani/ai-class.py
Download lecture videos of ai-class, with HTTP proxy and basic resume support
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "Deepak.G.R."
__credits__ = "Sumod Hajela"
__license__ = 'Public Domain'
"""
usage:
Go to command line and type
@freetstar
freetstar / ai-class.py
Created November 12, 2011 13:17 — forked from vickychijwani/ai-class.py
Download lecture videos of ai-class, with HTTP proxy and basic resume support
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "Deepak.G.R."
__credits__ = "Sumod Hajela"
__license__ = 'Public Domain'
"""
usage:
Go to command line and type