Skip to content

Instantly share code, notes, and snippets.

View pppoe's full-sized avatar
🎮
:)

Haoxiang Li pppoe

🎮
:)
View GitHub Profile
@pppoe
pppoe / DrawROC.m
Created February 2, 2012 22:28
Draw ROC Curve from two arrays
function [Tps, Fps] = ROC(scores, labels)
%% Sort Labels and Scores by Scores
sl = [scores; labels];
[d1 d2] = sort(sl(1,:));
sorted_sl = sl(:,d2);
s_scores = sorted_sl(1,:);
s_labels = round(sorted_sl(2,:));
@pppoe
pppoe / InitializeStruct.m
Created August 25, 2011 02:46
An unfamiliar way to initialize structure array
typedef struct demoStruct {
int val;
float *point;
} DemoStruct;
@implementation InitStructureAppDelegate
@synthesize window=_window;
@pppoe
pppoe / LayoutImageInText.m
Created June 14, 2011 09:46
Image-text-mixed Layout
//
// TestView.m
// LayoutImageInText
//
// Created by Haoxiang on 6/14/11.
// Copyright 2011 DEV. All rights reserved.
//
#import "TestView.h"
#import "NSString+Extern.h"
@pppoe
pppoe / FixWidthText.h
Created June 14, 2011 05:40
Change Symbols to Fixed Width Symbols
//
// FixWidthText.h
// LayoutImageInText
//
// Created by Haoxiang on 6/14/11.
// Copyright 2011 DEV. All rights reserved.
//
#import <Foundation/Foundation.h>
@pppoe
pppoe / EventParser.rb
Created June 2, 2011 09:17
get information of an event from douban, use for learning only
require 'open-uri'
require 'rubygems'
require 'nokogiri'
require 'photoParser'
#rootURL = "http://www.douban.com/event/13967079/"
class EventParser
def self.parse(rootURL)
html = open(rootURL)