Skip to content

Instantly share code, notes, and snippets.

Avatar

Hai Vo talobin

View GitHub Profile
@talobin
talobin / controller
Last active Feb 27, 2020 — 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
View controller
/*
-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
View gist:a8891c4d27bc6d9d1652e05590ed11aa
private final class MyPlaylistEventListener implements PlaylistEventListener {
@Override
public void onNext() {
log("NEXT VIDEO");
}
@Override
public void onPrevious() {
log("PREVIOUS VIDEO");
}
View rotate
@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);
View Where shit happends
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;
View TIL April-18-2014
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
View Power function recursive java
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));
}
View print descending java
public class HelloWorld{
public static void main(String []args){
//test with 5
System.out.println("Test print(5)");
print(5);
//test with 10
System.out.println("Test print(10)");
print(10);
View recursive problem java
//first problem
int min (array a){
if (a.size() == 1 )
return a[0]
else
{
if (a[0] < a[a.size()-1] )
{
//copy everything but the last element to new array b
create a new array b with size = a.size()-1;
View void reverse(char *str)
#include <iostream>
using namespace std;
//this method complexity is O(n) time and O(1) space
void reverse(char *str) {
cout<<str<<endl;
char *end=str;
while(*end)
end++;
end--;
View Unique String Check
#include <iostream>
using namespace std;
//this method complexity is O(n) time and O(1) space
bool check_unique_string(string to_be_checked){
bool check_array[256]={};
for(int i=0;i<to_be_checked.length();i++){
if (check_array[to_be_checked[i]])
return false;
else check_array[to_be_checked[i]] = true;
You can’t perform that action at this time.