Skip to content

Instantly share code, notes, and snippets.

View TimCastelijns's full-sized avatar

Tim Castelijns TimCastelijns

  • Coolblue
View GitHub Profile
s = '1321131112'
for n in xrange(0, 50):
chains = []
chain = s[0]
prev = s[0]
part = s[1:]
for index, c in enumerate(part, start=1):
if c == prev:
<html>
<head>
<title>Stack Overflow</title>
<link rel="shortcut icon" href="//cdn.sstatic.net/Sites/stackoverflow/img/favicon.ico?v=4f32ecc8f43d">
<link rel="apple-touch-icon image_src" href="//cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon.png?v=c78bd457575a">
<link rel="search" type="application/opensearchdescription+xml" title="Stack Overflow" href="/opensearch.xml">
<meta name="twitter:card" content="summary">
<meta name="twitter:domain" content="stackoverflow.com">
<meta property="og:type" content="website">
<meta property="og:image" itemprop="image primaryImageOfPage" content="http://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon@2.png?v=73d79a89bded&amp;a">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>stackoverflow.com wants you to log in</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript" src="/Content/js/master.js?v=KRhVz2Mn3x%2faPbHHCaUUH2w8vn0%3d"></script>
<link rel="stylesheet" type="text/css" href="/Content/css/all.css?v=KRhVz2Mn3x%2faPbHHCaUUH2w8vn0%3d">
<script type="text/javascript">common.bustFrames();</script>
<link rel="openid.server" href="https://openid.stackexchange.com/openid/provider">
<link rel="openid2.provider" href="https://openid.stackexchange.com/openid/provider">
</head>
@TimCastelijns
TimCastelijns / LocationUpdateService.java
Created February 17, 2017 15:17
requesting location updates using IntentService
public class LocationUpdateService extends IntentService {
private Realm realm;
public LocationUpdateService() {
super("LocationUpdateService");
}
@Override
protected void onHandleIntent(Intent intent) {
<div class="navbar-fixed">
<nav>
<div class="nav-wrapper">
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li><a href="#" class="dropdown-button" data-beloworigin="true" data-activates="dropdown_account"
data-constrainwidth="false" data-alignment="right"><i class="material-icons">account_circle</i></a></li>
</ul>
</div>
</nav>
</div>
public class SearchablesListAdapter extends BaseAdapter {
private interface Searchable {
String getSearchableName();
}
private class Country implements Searchable {
@Override
public String getSearchableName() {
# -*- coding: utf-8 -*-
"""
Example of how to use Poster.encode on AppEngine.
http://atlee.ca/software/poster/
The only variation needed versus the example from Poster is that
GAE's UrlFetch cannot use the generator returned by multipart_encode()
for payload, so simply create a payload string first.
"""
version: '3'
services:
thumbnail:
build: .
ports:
- "8080:8080"
volumes:
- .:/code
extra_hosts:
- "gae.com:172.18.0.1"
saBusiness.setOnSeekArcChangeListener(new SeekArc.OnSeekArcChangeListener() {
@Override
public void onProgressChanged(SeekArc seekArc, int i, boolean b) {
int text = R.string.week_overview_clear;
int color = R.color.week_overview_clear;
if (i > 75) {
text = R.string.week_overview_swamped;
color = R.color.week_overview_swamped;
} else if (i > 50) {
text = R.string.week_overview_busy;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.Priority;
import com.bumptech.glide.load.resource.bitmap.BitmapTransitionOptions;
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
import com.bumptech.glide.request.RequestOptions;