This file contains 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
Hydra.getInstance().getClient().post(getActivity(), Fields.GRAPH_CONTACTS_URL, params, new JsonHttpResponseHandler() { | |
@Override | |
public void onSuccess(int statusCode, Header[] headers, JSONObject response) { | |
Crouton.makeText(getActivity(), "Your question was sent successfully.", Style.CONFIRM, Configuration.DURATION_SHORT).show(); | |
} | |
@Override | |
public void onFailure(int statusCode, Header[] headers, Throwable e, JSONObject response) { | |
Crouton.makeText(getActivity(), R.string.no_internet_connection, Style.ALERT, Configuration.DURATION_SHORT).show(); | |
} |
This file contains 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
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse( | |
"content://media/internal/images/media")); | |
startActivity(intent); |
This file contains 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
Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK | |
Intent.FLAG_ACTIVITY_CLEAR_TOP | |
Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP |
This file contains 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
boolean[] values = new boolean[4]; | |
values[0] = true; | |
values[1] = false; | |
values[2] = false; | |
values[3] = true; | |
switch (values) { | |
case [true, false, true, false]: | |
break; |
This file contains 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 Log < ActiveRecord::Base | |
self.table_name = "versions" | |
has_one :previous_log, :class_name => "Log", | |
:order => "created_at DESC", | |
:conditions => proc{ "item_type = #{self.item_type}" } | |
end | |
=> NoMethodError: undefined method `item_type' for #<Class:0x7f9f5200c5f0> |
This file contains 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
<%= simple_form_for @menu do |m| %> | |
<%= m.simple_fields_for :meal do |p| %> | |
<%= p.input :name %> | |
<% end %> | |
<% end %> |
This file contains 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 MapActivity extends SherlockActivity { | |
private LocationManager locationManager; | |
Location location; | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); | |
} |
This file contains 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 CurrentLocationListener implements LocationListener{ | |
public static double latitude; | |
public static double longitude; | |
@SuppressWarnings("static-access") | |
@Override | |
public void onLocationChanged(Location location) { | |
location.getLatitude(); | |
location.getLongitude(); | |
this.latitude=location.getLatitude(); | |
this.longitude=location.getLongitude(); |
This file contains 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
def yolo | |
a = "WAT" | |
def frak | |
a = "WAT2" | |
end | |
frak | |
puts a | |
end |
This file contains 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
1.9.3-p194 :001 > a = " yolo" | |
=> " yolo" | |
1.9.3-p194 :002 > a.strip | |
=> "yolo" | |
1.9.3-p194 :003 > |