Skip to content

Instantly share code, notes, and snippets.

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')
{
"pages": [
{
"totals": 80,
"perpagenum": 10,
"allpage": 8,
"cpage": 1
}
],
"typeApps": [
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;
/*
* 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
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.
// 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);
@dzwillpower
dzwillpower / FindOnlyRepeat.java
Last active December 14, 2015 01:09
问题描述:给定包含101个元素的数组arr,数组中元素一定属于[1,100],并且[1,100]之间的每个数都在arr中出现过。 解决方案:分析,数组中有101个元素,如果[1,100]之间的每个数出现一次,那就是100个元素了,剩下的那个元素就是唯一的重复出现的元素。我们可以通过遍历arr,得到arr中所有元素的总和,然后既然[1,100]之间的每个数出现一次,那么我们减去1+2+……+99+100的和,结果就是我们需要的唯一的重复出现的元素了。时间复杂度是O(n)。
package com.wits.practice;
/**
* 找出数组中唯一的重复元素
* @author dzwillpower
* 2013-2-21下午08:27:56
*/
public class FindOnlyRepeat {
public static void main(String[] args) {
int[] array =new int[]{1,2,3,4,4,5,6,7,8,9,10,11};
System.out.println("repeat num: "+findRepeat(array));
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>
@dzwillpower
dzwillpower / DomXmlParse.java
Created September 26, 2012 11:43
xml解析 dom 解析
package com.example.xmlparse;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
@dzwillpower
dzwillpower / gist:3174950
Created July 25, 2012 07:40
Android 获取当前系统的语言 Language
context.getResources().getConfiguration().locale.getLanguage()