Skip to content

Instantly share code, notes, and snippets.

public class HelloWorld{
public static void main(String []args){
//test 2^2
System.out.println("Test power(2,2)");
System.out.println(power(2,2));
//test 5^3
System.out.println("Test power(5,3)");
System.out.println(power(5,3));
}
Android:
Edittext Autocapitalize, add this to properties of Edittext:
android:inputType="textCapSentences"
ListView context Menu:
//*********************************
//Inside onCreate
//Get a hold of the list
ListView list = (ListView) findViewById(R.id.list);
//Register and handle longclick
package edu.southern.cs.circ.devoted;
import android.app.Activity;
import android.app.FragmentManager;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.Menu;
import android.view.MenuInflater;
@Action(GimbalKeys.ROTATE)
public void rotate(InnerCallback callback, final Rotation rotation) {
if (rotation == null) {
CallbackUtils.onFailure(callback, DJIGimbalError.COMMON_PARAM_ILLEGAL);
return;
}
if (rotation.getMode() == null) {
callback.onFails(DJIError.COMMON_PARAM_ILLEGAL);
private final class MyPlaylistEventListener implements PlaylistEventListener {
@Override
public void onNext() {
log("NEXT VIDEO");
}
@Override
public void onPrevious() {
log("PREVIOUS VIDEO");
}
@talobin
talobin / controller
Last active February 27, 2020 19:38 — forked from mrmcpowned/custom gamepad css example.css
Removed .custom.half as there will be no need for it in a future update, as well as removing margin-left and margin-top from .controller.custom for the same reasons
/*
-How to use Custom CSS for the Gamepad Viewer-
http://mrmcpowned.com/gamepad
Enabling a custom CSS is as easy as adding &css=[url to css file]
to the end of the url like so:
http://mrmcpowned.com/gamepad?p=1&css=https://gist.github.com/anonymous/526491dc02014099cd14/raw/d7bb0477ba984f794497f3f0f82cb33484dc7889/ps3.css
If you're going to be using custom CSS for the gamepad viewer
to design your own skin, we're assuming you have some sort of