Skip to content

Instantly share code, notes, and snippets.

{
"name": "Sizerator",
"version": "1.0",
"description": "The first extension that I made.",
"toolstrips": [
"my_toolstrip.html"
],
"permissions": [
"tabs"
],
// Replace inline Images with Links
if (settings.replaceImagesWithLinks == 'true') {
jQuery('.postbody img').each(function() {
var source = jQuery(this).attr('src');
jQuery(this).after("<a href='" + source + "'>" + source + "</a>");
jQuery(this).remove();
});
}
// Replace Links with Images
if (settings.replaceLinksWithImages == 'true') {
var subset = jQuery('.postbody a');
if(settings.dontReplaceLinksSpoiler == 'true') {
subset = subset.not('.bbc-spoiler a');
}
subset.each(function() {
import urllib
import urllib2
import re
from urllib2 import URLError, HTTPError
error = None
wave = None
auth = None
package com.bestpnd.MagneticFieldMeter;
import android.app.Activity;
import android.os.Bundle;
import android.hardware.*;
import android.widget.TextView;
import java.lang.Float;
public class MagFieldMonitor extends Activity
{
from direct.showbase.ShowBase import ShowBase
class MyApp(ShowBase):
def __init__(self):
ShowBase.__init__(self)
environ = loader.loadModel("models/crash/crash_crude")
environ.reparentTo(self.render)
environ.setScale(0.25, 0.25, 0.25)
W/System.err(17841): java.lang.Exception: java.lang.Exception
W/System.err(17841): at com.gtalkstatus.android.GTalkStatusApplication.updateConnection(GTalkStatusApplication.java:87)
W/System.err(17841): at com.gtalkstatus.android.GTalkStatusUpdater.onStart(GTalkStatusUpdater.java:123)
W/System.err(17841): at com.gtalkstatus.android.GTalkStatusUpdater.onStartCommand(GTalkStatusUpdater.java:53)
W/System.err(17841): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2873)
W/System.err(17841): at android.app.ActivityThread.access$3500(ActivityThread.java:119)
W/System.err(17841): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1926)
W/System.err(17841): at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err(17841): at android.os.Looper.loop(Looper.java:123)
W/System.err(17841): at android.app.ActivityThread.main(ActivityThread.java:4363)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/widget51"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<TextView
android:id="@+id/widget40"

Reactive Forms with RxAndroid and TextInputLayout

Reactive Programming has been getting a lot of attention in the Android community lately. While it has uses throughout the application stack, we're going to focus here on using it to validate forms (exciting!). This approach cuts down on ugly nested if statements and transforms all of the validation logic to just a few simple lines using the RxJava framework. More, its robust and testable.

This post assumes some knowledge of how RxJava and lambdas work. If you need more of a refresher RxJava Retrolambda

Setup layout with TextInputLayout

10-11 19:15:48.649: INFO/ActivityManager(17687): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.wmbest.iphone4/.iPhone4Launcher }
10-11 19:15:48.707: INFO/ActivityManager(17687): Start proc com.wmbest.iphone4 for activity com.wmbest.iphone4/.iPhone4Launcher: pid=23166 uid=10113 gids={3003}
10-11 19:15:48.949: ERROR/dalvikvm(23166): Could not find class 'com.wmbest.iphone4.iPhone4Launcher$1', referenced from method com.wmbest.iphone4.iPhone4Launcher.onCreate
10-11 19:15:48.949: WARN/dalvikvm(23166): VFY: unable to resolve new-instance 155 (Lcom/wmbest/iphone4/iPhone4Launcher$1;) in Lcom/wmbest/iphone4/iPhone4Launcher;
10-11 19:15:48.949: DEBUG/dalvikvm(23166): VFY: replacing opcode 0x22 at 0x0026
10-11 19:15:48.949: DEBUG/dalvikvm(23166): VFY: dead code 0x0028-0036 in Lcom/wmbest/iphone4/iPhone4Launcher;.onCreate (Landroid/os/Bundle;)V
10-11 19:15:49.027: DEBUG/AndroidRuntime(23166): Shutting down VM
10-11 19:15:49.027: WARN/dalvikvm(231