Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Ye Lin Aung yelinaung

🏠
Working from home
View GitHub Profile
View gist:7397121
11-10 18:00:31.423: W/dalvikvm(450): Unable to resolve superclass of Landroid/support/v4/app/_ActionBarSherlockTrojanHorse; (150)
11-10 18:00:31.423: W/dalvikvm(450): Link of class 'Landroid/support/v4/app/_ActionBarSherlockTrojanHorse;' failed
11-10 18:00:31.423: W/dalvikvm(450): Unable to resolve superclass of Lcom/actionbarsherlock/app/SherlockFragmentActivity; (160)
11-10 18:00:31.423: W/dalvikvm(450): Link of class 'Lcom/actionbarsherlock/app/SherlockFragmentActivity;' failed
11-10 18:00:31.423: W/dalvikvm(450): Unable to resolve superclass of Lorg/devcon/android/BaseActivity; (335)
11-10 18:00:31.423: W/dalvikvm(450): Link of class 'Lorg/devcon/android/BaseActivity;' failed
11-10 18:00:31.423: W/dalvikvm(450): Unable to resolve superclass of Lorg/devcon/android/HomeActivity; (1495)
11-10 18:00:31.434: W/dalvikvm(450): Link of class 'Lorg/devcon/android/HomeActivity;' failed
11-10 18:00:31.434: E/dalvikvm(450): Could not find class 'org.devcon.android.HomeActivity', referenced from method org.devcon.andr
View gist:5915722
package introtocs;
import java.util.Date;
import java.text.ParseException;
import java.text.SimpleDateFormat;
public class DateCompare {
/**
* @param args
View gist:5906927
.pure-button-success,
.pure-button-error,
.pure-button-warning,
.pure-button-secondary {
color: white;
border-radius: 4px;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}
.pure-button-success {
background: rgb(28, 184, 65); /* this is a green */
View location
# Controller
def index
@locations = Location.all
respond_to do |format|
format.json { render json: @locations }
end
end
@yelinaung
yelinaung / gist:5763890
Created Jun 12, 2013
Application Controller
View gist:5763890
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :get_menu_ready
def after_sign_in_path_for(resource)
session[:return_to] = request.fullpath if request.get? and controller_name != "user_sessions" and controller_name != "sessions"
end
def after_sign_out_path_for(resource)
View Frequent.java
public static int getFreq(List<Integer> list) {
int mostFreq = 0;
//System.out.println("list is " + list);
Map<Integer, Integer> map = new HashMap<>();
for (int i : list) {
int freq = Collections.frequency(list, i);
map.put(i, freq);
}
View .htaccess
# ----------------------------------------------------------------------
# Expires headers (for better cache control)
# ----------------------------------------------------------------------
# These are pretty far-future expires headers.
# They assume you control versioning with filename-based cache busting
# Additionally, consider that outdated proxies may miscache
# www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
# If you don't use filenames to version, lower the CSS and JS to something like
View gist:8d50fc737168ca2f2bb0
When I open "My Location" button, the app crashes. Here are the logs
```
Google Maps Android API I Google Play services package version: 7899438
msg D first lat long : 16.8049667 96.1374455
AndroidRuntime D Shutting down VM
E FATAL EXCEPTION: main
E Process: org.maepaysoh.maepaysoh, PID: 5192
E java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.gson.JsonArray org.maepaysoh.maepaysohsdk.models.Geometry.getCoordinates(
)' on a null object reference
View VoterCall.java
String voterName = "အောင်ဆန်းစုကြည်";
String voteDob = "1945-06-19";
Map<String, String> params = new HashMap<>();
params.put("dateofbirth", voteDob);
params.put("nrcno", null);
params.put("father_name", null); // optional
Call<Voter> voterCall = checkVoterService.searchVoter(voterName, params);
voterCall.enqueue(new Callback<Voter>() {
@Override public void onResponse(Response<Voter> response) {
View activity_mail.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="org.mmaug.checkvoterlist.MainActivity">