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 SplashActivity extends BaseActivity implements LocationListener { | |
// Splash screen timer | |
private static int SPLASH_TIME_OUT = 1000; | |
private LocationClient mLocationClient; | |
private Long mStartTime; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); |
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
@Override | |
protected void onResume() { | |
super.onResume(); | |
Intent mediaIntent = new Intent(this, NowPlayingService.class); | |
startService(mediaIntent); | |
if (mNowPlayingService == null) | |
bindService(mediaIntent, mServiceConnection, Context.BIND_AUTO_CREATE); | |
} |
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 Host implements Parcelable { | |
@Expose | |
private String id; | |
@SerializedName("display_name") | |
@Expose | |
private String displayName; | |
@Expose | |
private String username; | |
@Expose | |
private String image; |
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 JsonDeserializer<T> implements com.google.gson.JsonDeserializer<T> { | |
@Override | |
public T deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { | |
Type genericClass = ((ParameterizedType) typeOfT).getActualTypeArguments()[0]; | |
if(genericClass != Boolean.class) { | |
if (json.isJsonPrimitive()) { | |
JsonPrimitive jsonPrimitive = json.getAsJsonPrimitive(); | |
if(jsonPrimitive.isBoolean()) { | |
return null; |
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
{ | |
"Airtime": { | |
"start": "18:30:00", | |
"end": "19:30:00", | |
"weekday": "1" | |
}, | |
"id": "150", | |
"title": "Le Show", | |
"short_name": "leshow", | |
"full_description": "<p>From Firesign Theater to Spin Tap, from Saturday Night Live to the Simpsons, Harry Shearer's done it all. Now hear the world through a new prizm, Le Show with Harry Shearer.<\/p><p>Le Show airs Monday evenings at 6:30pm following Moyer's & Co. <\/p>", |
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
std::map<std::string, Expression*> *param_map = getParamMap(); | |
cout << "printing param keys" << endl; | |
for(auto it = param_map->begin(); it != param_map->end(); ++it) | |
{ | |
cout << it->first << endl; | |
cout << "parameter map size " << param_map->size() << endl; | |
} |
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 net = require('net'); | |
var HOST = '127.0.0.1'; | |
var PORT = 4242; | |
var server = net.createServer(); | |
server.listen(PORT, HOST); | |
server.on('connection', function(sock) { | |
console.log('CONNECTED'); | |
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
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
super.onCreateView(inflater, container, savedInstanceState); | |
View root = inflater.inflate(R.layout.activity_staggered_grid, container, false); | |
mGridView = (StaggeredGridView) root.findViewById(R.id.grid_view); | |
createOrRestoreGridData(savedInstanceState); | |
mGridView.setOnItemClickListener(this); | |
mGridView.setOnScrollListener(this); | |
return root; | |
} |
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
I am getting all photos through the tags table where tags has a search key and search value. I order them. | |
Is there a way to only get uniques? Right now if i have 2 tags with the same name it will return the same photo twice. | |
@photos = Photo.joins(:tags).where(tags: { key: params[:searchkey], value: params[:searchvalue] }).order("created_at DESC") | |
@photos = Photo.joins(:tags).where(:tags => { :key => params[:search_key], :value => params[:search_value] }).order("created_at DESC") |
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
<CheckBox | |
android:id="@+id/selected_check_box" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:button="@drawable/default_checkbox_btn" | |
android:text="Select" | |
android:layout_marginLeft="4dp" | |
android:layout_marginRight="32dp" | |
android:layout_alignParentRight="true" | |
android:layout_centerVertical="true"/> |