This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface GithubAuth { | |
@POST("/authorizations") | |
UserToken getUserToken( | |
@Body LoginRequest body | |
); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var JSONToCSVConvertor = function (JSONData, ReportTitle, ShowLabel) { | |
//If JSONData is not an object then JSON.parse will parse the JSON string in an Object | |
var arrData = typeof JSONData != 'object' ? JSON.parse(JSONData) : JSONData; | |
var date = new Date(); | |
var CSV = ''; | |
//Set Report title in first row or line | |
CSV += 'MyTitle ' + date + '\r\n'; | |
//This condition will generate the Label/Header |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
View v = LayoutInflater.from(activityContext).inflate(R.layout.fragment_share, null); | |
v.setLayoutParams(new RelativeLayout.LayoutParams(2048, 1536)); | |
LinearLayout shareLayout = (LinearLayout) v.findViewById(R.id.share_layout); | |
shareLayout.setLayoutParams(new LinearLayout.LayoutParams(2048, 1536)); | |
Bitmap b = PictureUtils.loadBitmapFromView(shareLayout); | |
PictureUtils.saveBitmap(b, false); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void startFitnessClient() { | |
mGoogleFitClient = new GoogleApiClient.Builder(this) | |
.addApi(Fitness.API) | |
.addScope(new Scope(Scopes.FITNESS_ACTIVITY_READ_WRITE)) | |
.addConnectionCallbacks(new GoogleApiClient.ConnectionCallbacks() { | |
@Override | |
public void onConnected(Bundle bundle) { | |
if (hasWearDevice) mGoogleFitClient.connect(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Collatz { | |
//Consider a sequence of positive integers starting with x.If x is | |
// even,the next integer in the sequence is x/2.If x is odd, the | |
// next integer in the sequence is 3 * x + 1. The sequence stops when it | |
// reaches1. | |
// | |
// For example, if x is 7, the sequence is | |
// | |
// 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1 | |
// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by <a href="mailto:[email protected]">Marcus Gabilheri</a> | |
* | |
* @author Marcus Gabilheri | |
* @version 1.0 | |
* @since 3/16/15 | |
*/ | |
public class Collatz { | |
// Consider a sequence of positive integers starting with x.If x is | |
// even,the next integer in the sequence is x/2.If x is odd, the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class VideoDownloader extends AsyncTask<Void, Long, Boolean> { | |
@Override | |
protected void onPreExecute() { | |
super.onPreExecute(); | |
} | |
@Override | |
protected Boolean doInBackground(Void... params) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.Scanner; | |
/** | |
* Created by marcus on 4/12/15. | |
*/ | |
public class BinaryTreeNode { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.gson.Gson; | |
import com.oracle.javafx.jmx.json.JSONWriter; | |
import jdk.nashorn.api.scripting.JSObject; | |
import java.io.*; | |
import java.util.HashMap; | |
import java.util.Iterator; | |
import java.util.Map; | |
public class CollatzGraph { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Calculates the max of several integers at once. | |
* | |
* @param values | |
* 2 or more integers to which the maximum should be calculated | |
* @return The maximum value in the list | |
*/ | |
public static int max(@NonNull int... values) { | |
if (values.length < 2) { | |
throw new RuntimeException("At least 2 integers are needed in order to calculate the maximum value."); |