Skip to content

Instantly share code, notes, and snippets.

private void DountChart() {
LinearLayout v = (LinearLayout)findViewById(R.id.v_dount);
v.getLayoutParams().width = mobileHeight/100*43;
v.getLayoutParams().height = mobileHeight/100*43;
ArrayList<Float> values = new ArrayList<Float>();
values.add(36f);
values.add(12f);
public class TimeMethod {
private static final String TAG = "TimeMethod";
public static final SimpleDateFormat sFull = new SimpleDateFormat("yyyy MMMdd hh:mm:ss a", StringToLocale(Locale.getDefault().getLanguage()));
public static final SimpleDateFormat sMedium = new SimpleDateFormat("MMMdd hh:mm, a", StringToLocale(Locale.getDefault().getLanguage()));
public static final SimpleDateFormat sSimple = new SimpleDateFormat("hh:mm, a", StringToLocale(Locale.getDefault().getLanguage()));
public static String ShowLogTime(long logtime) {
long now = System.currentTimeMillis();
final Calendar calendar_now = Calendar.getInstance();
final Calendar calendar_log = Calendar.getInstance();
//PBKDF2 - Derive Key from Password
// Important: Don't forget to include the call to System.loadLibrary
// as shown at the bottom of this code sample.
package com.test;
import android.app.Activity;
import com.chilkatsoft.*;
import android.widget.TextView;
mageRequest imageRequest = ImageRequestBuilder
.newBuilderWithSource(mImageCaptureUri)
.setAutoRotateEnabled(true)
.build();
ImagePipeline imagePipeline = Fresco.getImagePipeline();
final DataSource<CloseableReference<CloseableImage>>
dataSource = imagePipeline.fetchDecodedImage(imageRequest, this);
dataSource.subscribe(new BaseBitmapDataSubscriber() {
//http://stackoverflow.com/questions/32949914/try-to-fetch-bitmap-from-uri-using-fresco
ImageRequest imageRequest = ImageRequestBuilder
.newBuilderWithSource(mImageCaptureUri)
.setAutoRotateEnabled(true)
.build();
ImagePipeline imagePipeline = Fresco.getImagePipeline();
final DataSource<CloseableReference<CloseableImage>>
dataSource = imagePipeline.fetchDecodedImage(imageRequest, this);
<?xml version="1.0"?>
<DslCpeConfig version="2.0">
<InternetGatewayDevice>
<LANDeviceNumberOfEntries>1</LANDeviceNumberOfEntries>
<WANDeviceNumberOfEntries>2</WANDeviceNumberOfEntries>
<X_CHT_COM_ConfigVersion>20140221</X_CHT_COM_ConfigVersion>
<BulkData>
<Profile instance="1">
<Parameter instance="1">
</Parameter>
package com.nesterchung.chart
import android.content.Context
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.text.format.DateUtils
import android.util.Log
import android.view.WindowManager
import com.github.mikephil.charting.charts.BarChart
import com.github.mikephil.charting.components.AxisBase
@CMingTseng
CMingTseng / CodeActivity.java
Created June 10, 2018 13:10 — forked from ianbarber/CodeActivity.java
Example of handling both client and server sign in with GoogleAuthUtil and GoogleApiClient
package com.google.plus.sample.ShareTest;
import android.accounts.AccountManager;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.IntentSender;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Bundle;
@CMingTseng
CMingTseng / CalendarGson.java
Created June 13, 2018 14:34 — forked from jromero/CalendarGson.java
DateDeserializer for Gson based on different SimpleDateFormats
package org.dallasmakerspace.kiosk.data.calendar;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.dallasmakerspace.kiosk.gson.DateDeserializer;
import java.text.SimpleDateFormat;
import java.util.Date;
@CMingTseng
CMingTseng / expand-collapse.java
Created July 5, 2018 06:17 — forked from ZkHaider/expand-collapse.java
Simple Expand / Collapse RecyclerView Item
public static class ExampleViewHolder extends RecyclerView.ViewHolder
implements View.OnClickListener {
private int originalHeight = 0;
private boolean isViewExpanded = false;
private YourCustomView yourCustomView
public ExampleViewHolder(View v) {
super(v);
v.setOnClickListener(this);