Skip to content

Instantly share code, notes, and snippets.

View mmanishh's full-sized avatar
🎯
Focusing

manish maharjan mmanishh

🎯
Focusing
View GitHub Profile
public PointF calcNextPoint(float theta) {
int t = (int) (theta * 1000);
float temp = (radius * ct.objMathHelper.Sin[t]);
return
new PointF(radius*(3*ct.objMathHelper.Sin[t]-4*ct.objMathHelper.Sin[t]*ct.objMathHelper.Sin[t]*ct.objMathHelper.Sin[t])+mCenter.x
,radius*0.6f*ct.objMathHelper.Cos[t]+mCenter.y
);
}
public PointF calcNextPoint(float theta) {
int t = (int) (theta * 1000);
float temp = (radius * ct.objMathHelper.Sin[t]);
return
new PointF(
(radius*ct.objMathHelper.Cos[t]*ct.objMathHelper.Cos[t]*ct.objMathHelper.Cos[t]*ct.objMathHelper.Cos[t]*ct.objMathHelper.Cos[t])
+ ct.objMathHelper.Cos[t]+ mCenter.x,
(radius*ct.objMathHelper.Sin[t]*ct.objMathHelper.Sin[t]*ct.objMathHelper.Sin[t]*ct.objMathHelper.Sin[t]*ct.objMathHelper.Sin[t])
-ct.objMathHelper.Sin[t]+ mCenter.y
);
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
package com.manishm.popularmovies.ui.activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import com.manishm.popularmovies.R;
import com.manishm.popularmovies.adapter.LoadsheddingAdapter;
import com.manishm.popularmovies.model.Loadshedding;
package info.androidhive.volleyexamples.app;
import info.androidhive.volleyexamples.volley.utils.LruBitmapCache;
import android.app.Application;
import android.text.TextUtils;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.Volley;
public class LoggingExceptionHandler implements java.lang.Thread.UncaughtExceptionHandler {
@Override
public void uncaughtException(Thread thread, Throwable ex) {
StringWriter stackTrace = new StringWriter();
ex.printStackTrace(new PrintWriter(stackTrace));
String msg = "WALT crashed with the following exception:\n" + stackTrace;
// Fire a new activity showing the stack trace
Intent intent = new Intent(MainActivity.this, CrashLogActivity.class);
<?php
$message = array("Alert! EarthQuake is likely to occur within 15 mins.", "Hi! from Manish", "Wassup ?");
$pos =mt_rand(0,count($message));
$api_url = "http://api.sparrowsms.com/v2/sms/?".
http_build_query(array(
'token' => 'QRtl8w1FQvlVqcrWrkHv ',
@mmanishh
mmanishh / EndlessRecyclerOnScrollListener.java
Created November 23, 2015 07:53 — forked from ssinss/EndlessRecyclerOnScrollListener.java
Endless RecyclerView OnScrollListener
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener {
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName();
private int previousTotal = 0; // The total number of items in the dataset after the last load
private boolean loading = true; // True if we are still waiting for the last set of data to load.
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more.
int firstVisibleItem, visibleItemCount, totalItemCount;
@mmanishh
mmanishh / gist:c8d180e0b103c583caca
Created October 12, 2015 05:23 — forked from ec84b4/gist:d56c00fb5fd2dfaf279b
recycler view header adapter
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
/**
* Created by khaled bakhtiari on 10/26/2014.
* <a href="http://about.me/kh.bakhtiari">
*/
@mmanishh
mmanishh / EmptyRecyclerView.java
Created October 9, 2015 11:01 — forked from meoyawn/EmptyRecyclerView.java
RecyclerView doesn't have an emptyView support, we gotta fix that
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.View;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class EmptyRecyclerView extends RecyclerView {
@Nullable View emptyView;