Skip to content

Instantly share code, notes, and snippets.

data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
// Please write an sequence list implements the interface with the required
// time complexity described in the comments. The users can add the same
// element as many times as they want, but it doesn't support the null item.
// You can use any types in .NET BCL but cannot use any 3rd party libraries.
// PS: You don't need to consider the multi-threaded environment.
interface IMyList<T> : IEnumerable<T>
{
// O(1)
// Add an item at the beginning of the list.
void AddFirst(T item);
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LaozhaoQ
{
// Please write an sequence list implements the interface with the required
// time complexity described in the comments. The users can add the same
// element as many times as they want, but it doesn't support the null item.
/*
* Copyright (C) 2011 Patrik Åkerfeldt
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
package com.example.touch;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.webkit.ConsoleMessage;
import android.webkit.WebChromeClient;

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Sat, 28 Apr 2012 15:50:19 GMT till Sun, 28 Apr 2013 15:50:19 GMT.

Only first 1000 GitHub users according to the count of followers are taken. Sorting algo in pseudocode:

githubUsers
  .filter((user) -> user.followers > 172)
 .sortBy('contributions')
require "open-uri"
require "rubygems"
require "json"
USERNAME = "henrik"
query = ARGV.first.downcase
gists = JSON.parse(open("http://gist.github.com/api/v1/json/gists/#{USERNAME}").read)['gists']
@dzwillpower
dzwillpower / RelativeTime.java
Last active December 19, 2015 13:39 — forked from yava555/RelativeTime.java
#SimpleDateFormat #时间转换 将时间戳转化为指定格式的时间
package com.xianguo.xreader.utils;
import java.text.SimpleDateFormat;
import java.util.Date;
import android.annotation.SuppressLint;
public class RelativeTime {
private static final long ONE_DAY = 86400000L;
@dzwillpower
dzwillpower / AndroidSettings.java
Created July 10, 2013 06:35 — forked from tediscript/AndroidSettings.java
#SharedPreferences SharedPreferences 设置
package com.tediscript.android;
import android.content.Context;
import android.content.SharedPreferences;
public class Settings {
public static String PREFS_NAME = "com.tediscript.android.settings";
public static void putString(Context ctx, String key, String value) {
package com.example.app;
import java.io.File;
import android.media.MediaScannerConnection;
import android.media.MediaScannerConnection.MediaScannerConnectionClient;
import android.net.Uri;
import android.util.Log;
public class MyMediaScannerConnectionClient implements MediaScannerConnectionClient {