Skip to content

Instantly share code, notes, and snippets.

@lzsucceed
lzsucceed / CustomizedTouchInterceptor
Last active December 21, 2015 14:28
I modified TouchInterceptor.java for my purpose. It can deal with various height items.
package com.music;
/*
* Copyright (C) 2008 The Android Open Source Project
*
* 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
import java.util.ArrayDeque;
public class MaxFee {
/**
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
import java.util.*;
public class MemoizeSearch {
static Scanner stdin;
static int[] w,v;
static int n,W;
static int[][] KNP;
static int MAX_N = 500, MAX_W = 10000;
public static void main(String[] args) {
stdin = new Scanner(System.in);
new MemoizeSearch();
<?php
if (! defined ( 'BASEPATH' ))
exit ( 'No direct script access allowed' );
require_once APPPATH . '/third_party/src/Mustache/Autoloader.php';
Mustache_Autoloader::register ();
/**
* helper library for Mustache.
* This library must be located in third_party folder.
* You can use like this:
@lzsucceed
lzsucceed / gist:7052297
Created October 19, 2013 06:30
river crossing problem
(function () {
window.CodeIq = {
};
var c = CodeIq;
c.Stack = function Stack() {
this.__a = new Array();
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.List;
# coding:utf-8
import heapq
import time
current_milli_time = lambda: int(round(time.time() * 1000))
timeStart = current_milli_time()
class State:
def __init__(self, initialCost, routeArray, visitedNodeArray, costArray):
@lzsucceed
lzsucceed / TouchInterceptorGridView.java
Created May 12, 2014 12:30
TouchInterceptorGridView.java
package com.lzy.music.parts;
/*
* Copyright (C) 2013 TInoue
*
* 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
Intent playpause = new Intent(context, MusicPlayerService.class);
playpause.putExtra(MusicPlayerService.REQUEST_TYPE, MusicPlayerService.PLAY_PAUSE);
playpause.putExtra("from_widget", true);
PendingIntent pendingIntent4 = PendingIntent.getService(context, 0, playpause,
PendingIntent.FLAG_UPDATE_CURRENT);
views.setOnClickPendingIntent(R.id.playpause, pendingIntent4);
Intent prev = new Intent(context, MusicPlayerService.class);
prev.putExtra("from_widget", true);
prev.putExtra(MusicPlayerService.REQUEST_TYPE, MusicPlayerService.REWIND);
<receiver
android:name="com.lzy.music.widget.MusicWidgetProvider"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="com.lzy.music.broadcast" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"