text:
package org.mrgeo.data.vector.geowave;

import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.Polygon;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.mrgeo.data.ProviderProperties;
import org.mrgeo.junit.UnitTest;

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.*;

public class GeoWaveVectorDataProviderTest
{
  private static final double EPSILON = 1e-5;

  @BeforeClass
  public static void setup()
  {
//    GeoWaveConnectionInfo connInfo = new GeoWaveConnectionInfo("", "", "", "", "", false);
//    GeoWaveVectorDataProvider.setConnectionInfo(connInfo);
    GeoWaveVectorDataProvider.initialized = true;
  }

  @Test
  @Category(UnitTest.class)
  public void testParseEmpty() throws IOException
  {
    Map<String, String> settings = new HashMap<String, String>();
    GeoWaveVectorDataProvider.parseDataSourceSettings("", settings);
    Assert.assertEquals(0, settings.size());
  }

  @Test
  @Category(UnitTest.class)
  public void testParseNoAssignment()
  {
    String strSettings = "abc";
    Map<String, String> settings = new HashMap<String, String>();
    try
    {
      GeoWaveVectorDataProvider.parseDataSourceSettings(strSettings, settings);
      Assert.fail("Expected an exception");;
    }
    catch(IOException e)
    {
      Assert.assertTrue("Wrong message", e.getMessage().equals("Invalid syntax. No value assignment in \"" +
                                                               strSettings + "\""));
    }
  }

  @Test
  @Category(UnitTest.class)
  public void testParseMissingValue()
  {
    String keyName = "abc";
    Map<String, String> settings = new HashMap<String, String>();
    try
    {
      GeoWaveVectorDataProvider.parseDataSourceSettings(keyName + "=", settings);
      Assert.fail("Expected an exception");;
    }
    catch(IOException e)
    {
      Assert.assertTrue("Wrong message", e.getMessage().equals("Missing value for " + keyName));
    }
  }

  @Test
  @Category(UnitTest.class)
  public void testParseSettingWithSpaces() throws IOException
  {
    String keyName = "abc";
    String value = "bad value";
    Map<String, String> settings = new HashMap<String, String>();
    GeoWaveVectorDataProvider.parseDataSourceSettings(keyName + "    =    " + value + "   ", settings);
    Assert.assertEquals(1, settings.size());
    String settingName = settings.keySet().iterator().next();
    Assert.assertEquals(keyName, settingName);
    Assert.assertEquals(value, settings.get(settingName));
  }

  @Test
  @Category(UnitTest.class)
  public void testParseSettingWithoutSpaces() throws IOException
  {
    String keyName = "abc";
    String value = "bad value";
    Map<String, String> settings = new HashMap<String, String>();
    GeoWaveVectorDataProvider.parseDataSourceSettings(keyName + "=" + value, settings);
    Assert.assertEquals(1, settings.size());
    String settingName = settings.keySet().iterator().next();
    Assert.assertEquals(keyName, settingName);
    Assert.assertEquals(value, settings.get(settingName));
  }

  @Test
  @Category(UnitTest.class)
  public void testParseSettingWithQuotes() throws IOException
  {
    String keyName = "abc";
    String value = "  bad value  ";
    Map<String, String> settings = new HashMap<String, String>();
    GeoWaveVectorDataProvider.parseDataSourceSettings(keyName + "=\"" + value + "\"", settings);
    Assert.assertEquals(1, settings.size());
    String settingName = settings.keySet().iterator().next();
    Assert.assertEquals(keyName, settingName);
    Assert.assertEquals(value, settings.get(settingName));
  }

  @Test
  @Category(UnitTest.class)
  public void testParseSettingMissingClosingQuotes() throws IOException
  {
    String strSetting = "abc=\"bad value";
    Map<String, String> settings = new HashMap<String, String>();
    try
    {
      GeoWaveVectorDataProvider.parseDataSourceSettings(strSetting, settings);
      Assert.fail("Expected exception for missing double quote");
    }
    catch(IOException e)
    {
      Assert.assertTrue("Wrong exception message: " + e.getMessage(),
                        e.getMessage().equals(
                                "Invalid GeoWave settings string, expected ending double quote for key abc in " +
                                strSetting));
    }
  }

  @Test
  @Category(UnitTest.class)
  public void testParseSettingWithTrailingSemiColon() throws IOException
  {
    String keyName = "abc";
    String value = "bad value";
    Map<String, String> settings = new HashMap<String, String>();
    try
    {
      GeoWaveVectorDataProvider.parseDataSourceSettings(keyName + "=" + value + ";", settings);
      Assert.fail("Expected exception");
    }
    catch(IOException e)
    {
      Assert.assertTrue("Wrong message: " + e.getMessage(),
                        e.getMessage().equals("Invalid syntax. No value assignment in \"\""));
    }
  }

  @Test
  @Category(UnitTest.class)
  public void testParseTwoSettings() throws IOException
  {
    Map<String, String> settings = new TreeMap<String, String>();
    GeoWaveVectorDataProvider.parseDataSourceSettings("setting1 = value 1;   setting2=  value 2", settings);
    Assert.assertEquals(2, settings.size());
    Iterator<String> iter = settings.keySet().iterator();
    String settingName1 = iter.next();
    String settingName2 = iter.next();
    Assert.assertEquals("setting1", settingName1);
    Assert.assertEquals("setting2", settingName2);
    Assert.assertEquals("value 1", settings.get(settingName1));
    Assert.assertEquals("value 2", settings.get(settingName2));
  }

  @Test
  @Category(UnitTest.class)
  public void testParseMultiSettingsWithQuotes() throws IOException
  {
    Map<String, String> settings = new TreeMap<String, String>();
    GeoWaveVectorDataProvider.parseDataSourceSettings("setting1 = \"value 1\";setting2=\" value 2 \"", settings);
    Assert.assertEquals(2, settings.size());
    Iterator<String> iter = settings.keySet().iterator();
    String settingName1 = iter.next();
    String settingName2 = iter.next();
    Assert.assertEquals("setting1", settingName1);
    Assert.assertEquals("setting2", settingName2);
    Assert.assertEquals("value 1", settings.get(settingName1));
    Assert.assertEquals(" value 2 ", settings.get(settingName2));
  }

  @Test
  @Category(UnitTest.class)
  public void testAssignGeometry() throws IOException, AccumuloSecurityException, AccumuloException
  {
    String strSettings = "spatial=\"POLYGON((10 20, 10 30, 20 30, 20 20, 10 20))\"";
    Map<String, String> settings = new TreeMap<String, String>();
    GeoWaveVectorDataProvider.parseDataSourceSettings(strSettings, settings);
    GeoWaveVectorDataProvider provider = new GeoWaveVectorDataProvider("geowave", "input", (ProviderProperties)null);
    provider.assignSettings("input", settings);
    Geometry spatial = provider.getSpatialConstraint();
    Assert.assertNull(provider.getCqlFilter());
    Assert.assertNull(provider.getStartTimeConstraint());
    Assert.assertNull(provider.getEndTimeConstraint());

    Assert.assertNotNull(spatial);
    Assert.assertTrue(spatial instanceof Polygon);
    Polygon poly = (Polygon)spatial;
    Coordinate[] coords = poly.getCoordinates();
    Assert.assertEquals(5, coords.length);
    Assert.assertEquals(10.0, coords[0].x, EPSILON);
    Assert.assertEquals(20.0, coords[0].y, EPSILON);
    Assert.assertEquals(10.0, coords[1].x, EPSILON);
    Assert.assertEquals(30.0, coords[1].y, EPSILON);
    Assert.assertEquals(20.0, coords[2].x, EPSILON);
    Assert.assertEquals(30.0, coords[2].y, EPSILON);
    Assert.assertEquals(20.0, coords[3].x, EPSILON);
    Assert.assertEquals(20.0, coords[3].y, EPSILON);
    Assert.assertEquals(10.0, coords[4].x, EPSILON);
    Assert.assertEquals(20.0, coords[4].y, EPSILON);
  }

  @Test
  @Category(UnitTest.class)
  public void testAssignInvalidGeometry() throws IOException, AccumuloSecurityException, AccumuloException
  {
    String strSettings = "spatial=\"POLYGON((10 20, 10 30, 20 30, 20 20))\"";
    Map<String, String> settings = new TreeMap<String, String>();
    GeoWaveVectorDataProvider.parseDataSourceSettings(strSettings, settings);
    GeoWaveVectorDataProvider provider = new GeoWaveVectorDataProvider("geowave", "input", (ProviderProperties)null);
    try
    {
      provider.assignSettings("input", settings);
      Assert.fail("Expected exception for invalid polygon definition");
    }
    catch(IllegalArgumentException e)
    {
      Assert.assertEquals("Wrong message in exception: " + e.getMessage(),
                          "Points of LinearRing do not form a closed linestring", e.getMessage());
    }
  }

  @Test
  @Category(UnitTest.class)
  public void testAssignTimeRangeWithTime() throws IOException, AccumuloSecurityException, AccumuloException
  {
    String strSettings = "startTime=2013-05-05T00:00:00.000+08:00;endTime=2013-05-06T00:00:00.000+08";
    Map<String, String> settings = new TreeMap<String, String>();
    GeoWaveVectorDataProvider.parseDataSourceSettings(strSettings, settings);
    GeoWaveVectorDataProvider provider = new GeoWaveVectorDataProvider("geowave", "input", (ProviderProperties)null);
    provider.assignSettings("input", settings);

    // Make sure the start time was correctly parsed and gives back the correct value.
    // Test the value using GMT so it's always consistent.
    Date startTime = provider.getStartTimeConstraint();
    final String ISO_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS zzz";
    final SimpleDateFormat sdf = new SimpleDateFormat(ISO_FORMAT);
    final TimeZone utc = TimeZone.getTimeZone("UTC");
    sdf.setTimeZone(utc);
    String gmtStartTime = sdf.format(startTime);
    Assert.assertEquals("2013-05-04T16:00:00.000 UTC", gmtStartTime);

    // Make sure the end time was correctly parsed and gives back the correct value.
    // Test the value using GMT so it's always consistent.
    Date endTime = provider.getEndTimeConstraint();
    String gmtEndTime = sdf.format(endTime);
    Assert.assertEquals("2013-05-05T16:00:00.000 UTC", gmtEndTime);

    Assert.assertNull(provider.getSpatialConstraint());
    Assert.assertNull(provider.getCqlFilter());
  }

  @Test
  @Category(UnitTest.class)
  public void testAssignTimeRangeWithoutTime() throws IOException, AccumuloSecurityException, AccumuloException
  {
    String strSettings = "startTime=2013-05-05;endTime=2013-05-06";
    Map<String, String> settings = new TreeMap<String, String>();
    GeoWaveVectorDataProvider.parseDataSourceSettings(strSettings, settings);
    GeoWaveVectorDataProvider provider = new GeoWaveVectorDataProvider("geowave", "input", (ProviderProperties)null);
    provider.assignSettings("input", settings);

    // Make sure the start time was correctly parsed and gives back the correct value.
    // Test the value using GMT so it's always consistent.
    Date startTime = provider.getStartTimeConstraint();
    final String timeFormat = "yyyy-MM-dd";
    final SimpleDateFormat sdf = new SimpleDateFormat(timeFormat);
    String formattedStartTime = sdf.format(startTime);
    Assert.assertEquals("2013-05-05", formattedStartTime);

    // Make sure the end time was correctly parsed and gives back the correct value.
    // Test the value using GMT so it's always consistent.
    Date endTime = provider.getEndTimeConstraint();
    String formattedEndTime = sdf.format(endTime);
    Assert.assertEquals("2013-05-06", formattedEndTime);

    Assert.assertNull(provider.getSpatialConstraint());
    Assert.assertNull(provider.getCqlFilter());
  }

  @Test
  @Category(UnitTest.class)
  public void testAssignInvalidStartTime() throws IOException, AccumuloSecurityException, AccumuloException
  {
    String strSettings = "startTime=2013-05-05BAD00:00:00.000+08:00";
    Map<String, String> settings = new TreeMap<String, String>();
    GeoWaveVectorDataProvider.parseDataSourceSettings(strSettings, settings);
    GeoWaveVectorDataProvider provider = new GeoWaveVectorDataProvider("geowave", "input", (ProviderProperties)null);
    try
    {
      provider.assignSettings("input", settings);
      Assert.fail("Expected exception for bad date format");
    }
    catch(IllegalArgumentException e)
    {
      Assert.assertTrue("Unexpected message: " + e.getMessage(),
                        e.getMessage().startsWith("Invalid format:"));
    }
  }

  @Test
  @Category(UnitTest.class)
  public void testAssignTimeRangeMissingEnd() throws IOException, AccumuloSecurityException, AccumuloException
  {
    String strSettings = "startTime=2013-05-05T00:00:00.000+08:00";
    Map<String, String> settings = new TreeMap<String, String>();
    GeoWaveVectorDataProvider.parseDataSourceSettings(strSettings, settings);
    GeoWaveVectorDataProvider provider = new GeoWaveVectorDataProvider("geowave", "input", (ProviderProperties)null);
    try
    {
      provider.assignSettings("input", settings);
      Assert.fail("Expected an exception");
    }
    catch(IOException e)
    {
      Assert.assertTrue("Unexpected exception message: " + e.getMessage(),
                        e.getMessage().equals("When querying a GeoWave data source by time," +
                                              " both the start and the end are required."));
    }
  }

  @Test
  @Category(UnitTest.class)
  public void testAssignTimeRangeMissingStart() throws IOException, AccumuloSecurityException, AccumuloException
  {
    String strSettings = "endTime=2013-05-05T00:00:00.000+08:00";
    Map<String, String> settings = new TreeMap<String, String>();
    GeoWaveVectorDataProvider.parseDataSourceSettings(strSettings, settings);
    GeoWaveVectorDataProvider provider = new GeoWaveVectorDataProvider("geowave", "input", (ProviderProperties)null);
    try
    {
      provider.assignSettings("input", settings);
      Assert.fail("Expected an exception");
    }
    catch(IOException e)
    {
      Assert.assertTrue("Unexpected exception message: " + e.getMessage(),
                        e.getMessage().equals("When querying a GeoWave data source by time," +
                                              " both the start and the end are required."));
    }
  }

  @Test
  @Category(UnitTest.class)
  public void testAssignInvalidEndTime() throws IOException, AccumuloSecurityException, AccumuloException
  {
    String strSettings = "endTime=2013-05-05BAD00:00:00.000+08:00";
    Map<String, String> settings = new TreeMap<String, String>();
    GeoWaveVectorDataProvider.parseDataSourceSettings(strSettings, settings);
    GeoWaveVectorDataProvider provider = new GeoWaveVectorDataProvider("geowave", "input", (ProviderProperties)null);
    try
    {
      provider.assignSettings("input", settings);
      Assert.fail("Expected exception for bad date format");
    }
    catch(IllegalArgumentException e)
    {
      Assert.assertTrue("Unexpected message: " + e.getMessage(),
                        e.getMessage().startsWith("Invalid format:"));
    }
  }

  @Test
  @Category(UnitTest.class)
  public void testAssignBadDateRange() throws IOException, AccumuloSecurityException, AccumuloException
  {
    String strSettings = "startTime=2013-05-06T00:00:00.000+08:00;endTime=2013-05-05T00:00:00.000+08:00";
    Map<String, String> settings = new TreeMap<String, String>();
    GeoWaveVectorDataProvider.parseDataSourceSettings(strSettings, settings);
    String dataSource = "input";
    GeoWaveVectorDataProvider provider = new GeoWaveVectorDataProvider("geowave", dataSource, (ProviderProperties)null);
    try
    {
      provider.assignSettings("input", settings);
      Assert.fail("Expected exception for bad date format");
    }
    catch(IOException e)
    {
      Assert.assertEquals("Unexpected exception message: " + e.getMessage(),
                          e.getMessage(),
                          "For GeoWave data source " + dataSource + ", startDate must be after endDate");
    }
  }

  @Test
  @Category(UnitTest.class)
  public void testAssignCqlFilter() throws IOException, AccumuloSecurityException, AccumuloException
  {
    String expectedCql = "MyField > 10";
    String strSettings = "cql=\"" + expectedCql + "\"";
    Map<String, String> settings = new TreeMap<String, String>();
    GeoWaveVectorDataProvider.parseDataSourceSettings(strSettings, settings);
    String dataSource = "input";
    GeoWaveVectorDataProvider provider = new GeoWaveVectorDataProvider("geowave", dataSource, (ProviderProperties)null);
    provider.assignSettings("input", settings);
    String cqlFilter = provider.getCqlFilter();
    Assert.assertNotNull(cqlFilter);
    Assert.assertEquals(expectedCql, cqlFilter);
  }
}


text:
static NSString * const PlaceholderColorKey = @"placeholderLabel.textColor";
@implementation UITextField (HSYTextField)
- (void)setLg_placeholderColor:(UIColor *)lg_placeholderColor{

    NSString *placeholder = self.placeholder;
    self.placeholder = @" ";
    if (lg_placeholderColor == nil) {
         lg_placeholderColor = [UIColor colorWithRed:0 green:0 blue:0.0980392 alpha:0.22];
    }
    self.placeholder = placeholder;

    [self setValue:lg_placeholderColor forKeyPath:PlaceholderColorKey];

}
- (UIColor *)placeholderColor{
     return self.placeholderColor;
}

@end

redpajama_set_name: RedPajamaGithub


text:
from __future__ import unicode_literals

AUTHOR = u'Xilin Sun'
SITENAME = u'XhaosSanctuary | Xilin Sun'
SITEURL = ''

PATH = 'content'

TIMEZONE = 'US/Pacific'

DEFAULT_LANG = u'en'

# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
TRANSLATION_FEED_ATOM = None
AUTHOR_FEED_ATOM = None
AUTHOR_FEED_RSS = None

# Blogroll
LINKS = (('Pelican', 'http://getpelican.com/'),
         ('Python.org', 'http://python.org/'),
         #('Jinja2', 'http://jinja.pocoo.org/'),
         #('You can modify those links in your config file', '#'),
         )

# Social widget
SOCIAL = (('You can add links in your config file', '#'),
          ('Another social link', '#'),)

DEFAULT_PAGINATION = 20

# Uncomment following line if you want document-relative URLs when developing
#RELATIVE_URLS = True

OUTPUT_PATH = '..'

THEME = "themes/aesimple"


text:
using System;
using Transit.Core;
using Transit.Tests.Events;

namespace Transit.Tests.Components
{

    public class OutComponent : Component
    {

        private int _intOut;
        private Random _random;
        private string _stringOut;

        [RouteOut]
        public event EventHandler<TestEventArgs> TestEventOut = delegate { };

        public OutComponent(): this("OutComponent")
        {
        }

        public OutComponent(string name) : base(name)
        {
            this._random = new Random(Environment.TickCount);
        }

        [RouteOut]
        public int IntOutProperty
        {

            get
            {
                return this._intOut;
            }

            set
            {
                SetValue(ref this._intOut, value, x => this.IntOutProperty);
            }

        }

        [RouteOut]
        public string StringOutProperty
        {

            get
            {
                return this._stringOut;
            }

            set
            {
                SetValue(ref this._stringOut, value, x => this.StringOutProperty);
            }

        }

        public void RaiseTestEventOut()
        {
            TestEventOut(this, new TestEventArgs("Event raised from FireTestEventOut.", this._random.Next()));
        }

        public void RaiseTestEventOut(TestEventArgs e)
        {
            TestEventOut(this, e);
        }

    }

}


text:
from __future__ import unicode_literals

from django.db import models, migrations

class Migration(migrations.Migration):

    dependencies = [
        ('products', '0002_auto_20150205_1722'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='product',
            options={'ordering': ['price']},
        ),
    ]


text:
<!DOCTYPE HTML>

		<meta charset="UTF-8"/>
		<title> demo myData </title>


text:
function run(argument) {
   if (argument == undefined) {
      // Inform the user that there was no argument
      LaunchBar.alert('I have to have something to put.');
   } else {
      runWithItem(argument)
   }
}

function runWithItem(item) {
   //
   // A note was sent. Save to notepad.
   //
   if (item instanceof String) {
      runWithString(item.title)
   } else if (typeof item.title !== 'undefined') {
      runwithString(item.title)
   }
}

function runWithString(msg) {
   //
   // It is definitely a string. Save.
   //
   return([
         {
            title: 'To ScriptPad 1',
            action: 'appendOrWrite',
            actionArgument: {
               msg: msg,
               noteid: 1
            }
         },
         {
            title: 'To ScriptPad 2',
            action: 'appendOrWrite',
            actionArgument: {
               msg: msg,
               noteid: 2
            }
         },
         {
            title: 'To ScriptPad 3',
            action: 'appendOrWrite',
            actionArgument: {
               msg: msg,
               noteid: 3
            }
         },
         {
            title: 'To ScriptPad 4',
            action: 'appendOrWrite',
            actionArgument: {
               msg: msg,
               noteid: 4
            }
         },
         {
            title: 'To ScriptPad 5',
            action: 'appendOrWrite',
            actionArgument: {
               msg: msg,
               noteid: 5
            }
         },
         {
            title: 'To ScriptPad 6',
            action: 'appendOrWrite',
            actionArgument: {
               msg: msg,
               noteid: 6
            }
         },
         {
            title: 'To ScriptPad 7',
            action: 'appendOrWrite',
            actionArgument: {
               msg: msg,
               noteid: 7
            }
         },
         {
            title: 'To ScriptPad 8',
            action: 'appendOrWrite',
            actionArgument: {
               msg: msg,
               noteid: 8
            }
         },
         {
            title: 'To ScriptPad 9',
            action: 'appendOrWrite',
            actionArgument: {
               msg: msg,
               noteid: 9
            }
         },
      ])
}

function appendOrWrite(obj) {
   return([         {
            title: 'Append to Note',
            action: 'pasteToScriptPad',
            actionArgument: {
               msg: obj.msg,
               noteid: obj.noteid,
               append: 'a'
            }
         },
         {
            title: 'Overwrite Note',
            action: 'pasteToScriptPad',
            actionArgument: {
               msg: obj.msg,
               noteid: obj.noteid,
               append: 'w'
            }
         },
      ])
}

function pasteToScriptPad(obj) {
   var url = 'http://localhost:9978/api/note/' + obj.noteid + '/' + obj.append
   var req = HTTP.createRequest(url, {
      method: 'PUT',
      body: { note: obj.msg },
      bodyType: 'json'
   })
   var res = HTTP.loadRequest(req)
}


text:
define({
	status: '${start} - ${end} din ${total} rezultate',
	gotoFirst: 'Mergi la prima pagină',
	gotoNext: 'Mergi la pagina următoare',
	gotoPrev: 'Mergi la pagina precedentă',
	gotoLast: 'Mergi la ultima pagină',
	gotoPage: 'Mergi la pagina',
	jumpPage: 'Sari la pagina'
});


text:
layout: post
share: true
comments: true
can-subscribe: true
title: "Month 1: November 2014 wrapup"
---

This month was humbling.  I was hoping to find a product idea for which people would pay money.  However, I ultimately failed to do so.

# Completed

I invalidated several more product ideas.  Some of them were better than others.  For my goals, the only validation that I care about right now is willingness to pay, and I received none for any of my ideas just yet.

I also attempted to just speak to many local small businesses.  That turned out to be a bad use of time.  There are plenty of local small businesses with bad software, but the software isn't bad enough for them to want to switch to a newer solution.

# In progress

This hasn't changed from last month.  I'm still contemplating different problems to solve.

# Goals for next month

This also hasn't changed from last month.  I'd like to find and validate a product idea.

A great month would be one where I've received money to build a product out.

A good, but not great, month would be one where I learn a lot, but I still don't have a product idea for which I get paid.

A bad month would be one where I learn nothing while validating no ideas.

# Things I did well

#### I resisted the temptation to quit

I wrote about it at length here.

The temptations still arise, but I do a good job of resisting them.

#### I kept my spirits up

I did a better job of this than the previous month.  This month, I had much more managed expectations.  It was very difficult for me to feel disappointed about anything.  At the same time, I didn't really get excited about anything either.

I wanted to be more level-headed, and I definitely succeeded.

#### I reconsidered ways to find product ideas

I have a lot to say here, but I'm saving it for a post later this week.  In sum, I realized that signalling from other people can save me the work of validating a market or an idea for me.

# Things I wish I did better

#### Waste less time

I wasted a good amount of time this month.  Some of it was from consulting for other people or being tempted to quit and join somebody else's startup.  Some of it was poor goal setting.  Some of it was poor decision making.

I ended up learning a lot anyway, but wasting time is still something I want to prevent in the future.  I can see it getting out of control if I don't pay attention to it.

# Things I learned

#### Shitty technology does not mean there's a market opportunity

This is the big lesson of the month.

I spent a lot of time talking to local small businesses who had shitty technology.  However, they turned out to be unwilling to spend on or switch to newer, sharper software.  Their painpoints simply weren't large enough to justify changing.

Shitty technology doesn't mean there's a market opportunity.  Simply being shitty does not signal a willingness to spend.  The pain has to be large enough to convince buyers that they want a change even without you pitching the possibility.

#### Set failable goals

I wrote about this here.

My buddy Sam DeBrule taught me this.  It's probably common sense to most people, but it wasn't to me.  Like how an effective hypothesis is falsifiable, an effective goal is failable.

# Numbers

Revenue:  $0

Technically, I made some money from consulting.  But that was money made with an hourly freelance rate.  It wasn't made by selling products.  So I still count my revenue to be precisely zero.

Maybe it's arrogent of me, but at the beginning of this month, I really didn't expect to still be making no money by this month's end.

A humbler, wiser Dillon completes Month 1 and proceeds into Month 2...


text:
@implementation RequestView

@synthesize delegate;
@synthesize youRequested;

- (id)init
{
    self = [super init];
    if (self)
    {
        self.frame = CGRectMake(10, 10, 300, 70);
        [self setBackgroundColor:[UIColor whiteColor]];

        arrowbg = [[UIImageView alloc] initWithFrame:CGRectMake(5, 10, 90, 50)];
        arrowbg.backgroundColor = [UIColor orangeColor];
        [self addSubview:arrowbg];

        bg = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 300, 70)];
        [bg setImage:[UIImage imageNamed:@"dw_contactbg.png"]];
        [self addSubview:bg];

        profile = [[RoundedImageView alloc] initWithFrame:CGRectMake(10, 10, 50, 50)];
        [bg addSubview:profile];

        name = [[BoldTextView alloc] initWithFrame:CGRectMake(65, 10, 180, 25)];
        [bg addSubview:name];

        time = [[UITextView alloc] initWithFrame:CGRectMake(80, 30, 170, 25)];
        [time setBackgroundColor:[UIColor clearColor]];
        [time setFont:[UIFont fontWithName:@"GillSans" size:14]];
        [time setTextColor:[UIColor DwollaOrange]];
        [time setUserInteractionEnabled:NO];
        [bg addSubview:time];

        marker = [[UIImageView alloc] initWithFrame:CGRectMake(70, 38, 15, 15)];
        marker.image = [UIImage imageNamed:@"dw_orangeclock.png"];
        [bg addSubview:marker];

        totalbg = [[UIImageView alloc] initWithFrame:CGRectMake(250, 20, 50, 25)];
        [totalbg setImage:[UIImage imageNamed:@"dw_distbg.png"]];
        [bg addSubview:totalbg];

        total = [[BoldTextView alloc] initWithFrame:CGRectMake(250, 16, 50, 25)];
        [total setTextColor:[UIColor whiteColor]];
        [total setFont:[UIFont fontWithName:@"GillSans-Bold" size:12]];
        [bg addSubview:total];
    }
    return self;
}

- (void)addData:(Request*)request
{
    UIImageView* indicator = [[UIImageView alloc] initWithFrame:CGRectMake(241, 25, 15, 15)];
    [bg addSubview:indicator];
    youRequested = [request youRequested];
    if ([request youRequested])
    {
        name.text = [request dest_name];
        dwolla_id = [request dest_id];
        [indicator setImage:[UIImage imageNamed:@"dw_plus.png"]];
    }
    else
    {
        name.text = [request source_name];
        dwolla_id = [request source_id];
        [indicator setImage:[UIImage imageNamed:@"dw_minus.png"]];
    }

    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:@"MM/d/yyyy HH:mm:ss a"];

    NSDate* date = [dateFormatter dateFromString:[request date]];
    [dateFormatter setDateFormat:@"MMM d 'at' hh:mma"];

    NSString* dateString = [dateFormatter stringFromDate:date];
    realDate = dateString;

    int minutes = [date timeIntervalSinceNow]/60 * -1;

    if (minutes > 525949)
    {
        time.text = [NSString stringWithFormat:@"%d yr", minutes/525949];
    }
    else if (minutes > 43829)
    {
        time.text = [NSString stringWithFormat:@"%d mon", minutes/43829];
    }
    else if (minutes > 10080)
    {
        time.text = [NSString stringWithFormat:@"%d wk", minutes/10080];
    }
    else if (minutes > 1440)
    {
        time.text = [NSString stringWithFormat:@"%d d", minutes/1440];
    }
    else if (minutes > 59)
    {
        time.text = [NSString stringWithFormat:@"%d hr", minutes/60];
    }
    else
    {
        time.text = [NSString stringWithFormat:@"%d min", minutes];
    }

    double currency = [[request amount] doubleValue];
    NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
    [numberFormatter setNumberStyle: NSNumberFormatterCurrencyStyle];
    NSString *number = [numberFormatter stringFromNumber:[NSNumber numberWithDouble:currency]];
    total.text = [NSString stringWithFormat:@"%@",number];

    req_id = [request req_id];
}

- (void)shiftView:(int)i
{
    self.center = CGPointMake(160, 45+(80*i));
}

- (UIImage*)profile
{
    return profile.image;
}

- (void)setProfile:(UIImage*)image
{
    profile.image = image;
}

- (NSString*)name
{
    return name.text;
}

- (NSString*)time
{
    return realDate;
}

- (NSString*)total
{
    return total.text;
}

- (NSString*) dwolla_id
{
    return dwolla_id;
}

- (NSString*) req_id
{
    return req_id;
}

- (void)destroy
{
    [bg removeFromSuperview];
    bg = nil;
    [marker removeFromSuperview];
    marker = nil;
    [arrowbg removeFromSuperview];
    arrowbg = nil;
    [profile removeFromSuperview];
    profile = nil;
    [name removeFromSuperview];
    name = nil;
    [total removeFromSuperview];
    total = nil;
    [totalbg removeFromSuperview];
    totalbg = nil;
}

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [super touchesEnded: touches withEvent: event];
}

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
    [super touchesEnded: touches withEvent: event];
}

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
    [[self delegate] displayRequest:self];
    [super touchesEnded: touches withEvent: event];
}

- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
{

}

@end


text:
<?php

/**
 * 標準 変更View
 *
 * 個別のレイアウト機能を実装したい場合は、機能のView配置箇所にコピーし内容をカスタマイズ.
 * Controller_CrudのView生成時のstandard_パラメータにfalseを指定.
 */
?>

	<?php echo render(FOUNDATION_MENU, array('active' => ACTION_EDIT, 'active_name' => ACTION_EDIT_NAME)); ?>
	<?php echo Form::open(array('class' => 'form-horizontal')); ?>
	<?php echo Form::csrf(); // CSRF 保護 ?>

				<?php echo render($view_form, array(ACTION_EDIT => true)); ?>

				<?php
				if (!empty($authority[ACTION_INDEX]) and ((bool)$authority[ACTION_INDEX])) {
					echo Html::anchor(Session::get('return_url'),
						'',
						array('class' => 'btn btn-default'));
				}
				?>
				<?php if (!empty($authority[ACTION_EDIT]) and ((bool)$authority[ACTION_EDIT])) { ?>
				<button type="submit" id="submit" name="<?php echo PROCESSING ?>" class="btn btn-success">

				</button>
				<?php } ?>
				<?php
				if (!empty($authority[ACTION_VIEW]) and ((bool)$authority[ACTION_VIEW])) {
					echo Html::anchor($action_url[ACTION_VIEW] . $model->id,
						'',
						array('class' => 'btn btn-info'));
				}
				?>

	<?php echo Form::close(); ?>


text:
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Z.Collections.Test
{
    [TestClass]
    public class System_Collections_Generic_ICollection_T_RemoveIf
    {
        [TestMethod]
        public void RemoveIf()
        {
            // Type
            var @this = new List<string> {"zA", "zB", "C"};

            // Exemples
            @this.RemoveIf("zA", @this.Contains); // Remove "zA" items

            // Unit Test
            Assert.AreEqual(2, @this.Count);
        }
    }
}


text:
ActiveRecord::Schema.define(version: 20200527050224) do

  create_table "account_sources", force: :cascade do |t|
    t.integer  "account_id"
    t.integer  "source_id"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  add_index "account_sources", ["account_id", "source_id"], name: "index_account_sources_on_account_id_and_source_id", using: :btree
  add_index "account_sources", ["source_id"], name: "index_account_sources_on_source_id", using: :btree

  create_table "accounts", force: :cascade do |t|
    t.integer  "user_id"
    t.string   "url"
    t.datetime "created_at",    null: false
    t.datetime "updated_at",    null: false
    t.integer  "team_id"
    t.text     "omniauth_info"
    t.string   "uid"
    t.string   "provider"
    t.string   "token"
    t.string   "email"
  end

  add_index "accounts", ["uid", "provider", "token", "email"], name: "index_accounts_on_uid_and_provider_and_token_and_email", using: :btree
  add_index "accounts", ["url"], name: "index_accounts_on_url", using: :btree

  create_table "annotations", force: :cascade do |t|
    t.string   "annotation_type",                 null: false
    t.integer  "version_index"
    t.string   "annotated_type"
    t.integer  "annotated_id"
    t.string   "annotator_type"
    t.integer  "annotator_id"
    t.text     "entities"
    t.text     "data"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "file"
    t.text     "attribution"
    t.integer  "lock_version",    default: 0,     null: false
    t.boolean  "locked",          default: false
    t.text     "fragment"
  end

  add_index "annotations", ["annotated_type", "annotated_id"], name: "index_annotations_on_annotated_type_and_annotated_id", using: :btree
  add_index "annotations", ["annotation_type"], name: "index_annotation_type_order", using: :btree
  add_index "annotations", ["annotation_type"], name: "index_annotations_on_annotation_type", using: :btree

  create_table "api_keys", force: :cascade do |t|
    t.string   "access_token", default: "", null: false
    t.datetime "expire_at"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "application"
  end

  create_table "assignments", force: :cascade do |t|
    t.integer  "assigned_id",   null: false
    t.integer  "user_id",       null: false
    t.datetime "created_at",    null: false
    t.datetime "updated_at",    null: false
    t.string   "assigned_type"
    t.integer  "assigner_id"
  end

  add_index "assignments", ["assigned_id", "assigned_type", "user_id"], name: "index_assignments_on_assigned_id_and_assigned_type_and_user_id", using: :btree
  add_index "assignments", ["assigned_id", "assigned_type"], name: "index_assignments_on_assigned_id_and_assigned_type", using: :btree
  add_index "assignments", ["assigned_id"], name: "index_assignments_on_assigned_id", using: :btree
  add_index "assignments", ["assigned_type"], name: "index_assignments_on_assigned_type", using: :btree
  add_index "assignments", ["assigner_id"], name: "index_assignments_on_assigner_id", using: :btree
  add_index "assignments", ["user_id"], name: "index_assignments_on_user_id", using: :btree

  create_table "bounces", force: :cascade do |t|
    t.string   "email",      null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  add_index "bounces", ["email"], name: "index_bounces_on_email", using: :btree

  create_table "contacts", force: :cascade do |t|
    t.integer  "team_id"
    t.string   "location"
    t.string   "phone"
    t.string   "web"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  create_table "dynamic_annotation_annotation_types", primary_key: "annotation_type", force: :cascade do |t|
    t.string   "label",                      null: false
    t.text     "description"
    t.datetime "created_at",                 null: false
    t.datetime "updated_at",                 null: false
    t.boolean  "singleton",   default: true
    t.text     "json_schema"
  end

  add_index "dynamic_annotation_annotation_types", ["json_schema"], name: "index_dynamic_annotation_annotation_types_on_json_schema", using: :gin

  create_table "dynamic_annotation_field_instances", primary_key: "name", force: :cascade do |t|
    t.string   "field_type",                     null: false
    t.string   "annotation_type",                null: false
    t.string   "label",                          null: false
    t.text     "description"
    t.boolean  "optional",        default: true
    t.text     "settings"
    t.string   "default_value"
    t.datetime "created_at",                     null: false
    t.datetime "updated_at",                     null: false
  end

  create_table "dynamic_annotation_field_types", primary_key: "field_type", force: :cascade do |t|
    t.string   "label",       null: false
    t.text     "description"
    t.datetime "created_at",  null: false
    t.datetime "updated_at",  null: false
  end

  create_table "dynamic_annotation_fields", force: :cascade do |t|
    t.integer  "annotation_id",                null: false
    t.string   "field_name",                   null: false
    t.string   "annotation_type",              null: false
    t.string   "field_type",                   null: false
    t.text     "value",                        null: false
    t.datetime "created_at",                   null: false
    t.datetime "updated_at",                   null: false
    t.text     "value_json",      default: "{}"
  end

  add_index "dynamic_annotation_fields", ["annotation_id"], name: "index_dynamic_annotation_fields_on_annotation_id", using: :btree
  add_index "dynamic_annotation_fields", ["field_type"], name: "index_dynamic_annotation_fields_on_field_type", using: :btree
  add_index "dynamic_annotation_fields", ["value"], name: "translation_request_id", using: :btree
  add_index "dynamic_annotation_fields", ["value_json"], name: "index_dynamic_annotation_fields_on_value_json", using: :gin

  create_table "login_activities", force: :cascade do |t|
    t.string   "scope"
    t.string   "strategy"
    t.string   "identity"
    t.boolean  "success"
    t.string   "failure_reason"
    t.integer  "user_id"
    t.string   "user_type"
    t.string   "context"
    t.string   "ip"
    t.text     "user_agent"
    t.text     "referrer"
    t.datetime "created_at"
  end

  add_index "login_activities", ["identity"], name: "index_login_activities_on_identity", using: :btree
  add_index "login_activities", ["ip"], name: "index_login_activities_on_ip", using: :btree

  create_table "medias", force: :cascade do |t|
    t.integer  "user_id"
    t.integer  "account_id"
    t.string   "url"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.string   "quote"
    t.string   "type"
    t.string   "file"
  end

  add_index "medias", ["id"], name: "index_medias_on_id", using: :btree
  add_index "medias", ["url"], name: "index_medias_on_url", using: :btree

  create_table "pghero_query_stats", force: :cascade do |t|
    t.text     "database"
    t.text     "user"
    t.text     "query"
    t.integer  "query_hash",  limit: 8
    t.float    "total_time"
    t.integer  "calls",       limit: 8
    t.datetime "captured_at"
  end

  add_index "pghero_query_stats", ["database", "captured_at"], name: "index_pghero_query_stats_on_database_and_captured_at", using: :btree

  create_table "project_media_projects", force: :cascade do |t|
    t.integer "project_media_id"
    t.integer "project_id"
  end

  add_index "project_media_projects", ["project_id"], name: "index_project_media_projects_on_project_id", using: :btree
  add_index "project_media_projects", ["project_media_id", "project_id"], name: "index_team_media_projects_on_team_media_id_and_project_id", using: :btree
  add_index "project_media_projects", ["project_media_id"], name: "index_project_media_projects_on_project_media_id", using: :btree

  create_table "project_medias", force: :cascade do |t|
    t.integer  "project_id"
    t.integer  "media_id"
    t.datetime "created_at",                               null: false
    t.datetime "updated_at",                               null: false
    t.integer  "user_id"
    t.integer  "cached_annotations_count", default: 0
    t.boolean  "archived",                 default: false
    t.integer  "targets_count",            default: 0,     null: false
    t.integer  "sources_count",            default: 0,     null: false
    t.boolean  "inactive",                 default: false
    t.integer  "team_id"
  end

  add_index "project_medias", ["id"], name: "index_project_medias_on_id", using: :btree
  add_index "project_medias", ["inactive"], name: "index_project_medias_on_inactive", using: :btree
  add_index "project_medias", ["media_id"], name: "index_project_medias_on_media_id", using: :btree
  add_index "project_medias", ["project_id", "media_id"], name: "index_project_medias_on_project_id_and_media_id", using: :btree
  add_index "project_medias", ["team_id"], name: "index_project_medias_on_team_id", using: :btree

  create_table "projects", force: :cascade do |t|
    t.integer  "user_id"
    t.integer  "team_id"
    t.string   "title"
    t.text     "description"
    t.string   "lead_image"
    t.datetime "created_at",                        null: false
    t.datetime "updated_at",                        null: false
    t.boolean  "archived",          default: false
    t.text     "settings"
    t.string   "token"
    t.integer  "assignments_count", default: 0
  end

  add_index "projects", ["id"], name: "index_projects_on_id", using: :btree
  add_index "projects", ["team_id"], name: "index_projects_on_team_id", using: :btree
  add_index "projects", ["token"], name: "index_projects_on_token", using: :btree

  create_table "relationships", force: :cascade do |t|
    t.integer  "source_id",         null: false
    t.integer  "target_id",         null: false
    t.string   "relationship_type", null: false
    t.datetime "created_at",        null: false
    t.datetime "updated_at",        null: false
    t.integer  "user_id"
  end

  add_index "relationships", ["source_id", "target_id", "relationship_type"], name: "relationship_index", using: :btree

  create_table "shortened_urls", force: :cascade do |t|
    t.integer  "owner_id"
    t.string   "owner_type", limit: 20
    t.text     "url",                               null: false
    t.string   "unique_key", limit: 10,             null: false
    t.string   "category"
    t.integer  "use_count",             default: 0, null: false
    t.datetime "expires_at"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "shortened_urls", ["category"], name: "index_shortened_urls_on_category", using: :btree
  add_index "shortened_urls", ["owner_id", "owner_type"], name: "index_shortened_urls_on_owner_id_and_owner_type", using: :btree
  add_index "shortened_urls", ["unique_key"], name: "index_shortened_urls_on_unique_key", using: :btree
  add_index "shortened_urls", ["url"], name: "index_shortened_urls_on_url", using: :btree

  create_table "sources", force: :cascade do |t|
    t.integer  "user_id"
    t.string   "name"
    t.string   "slogan"
    t.string   "avatar"
    t.datetime "created_at",                   null: false
    t.datetime "updated_at",                   null: false
    t.integer  "team_id"
    t.string   "file"
    t.boolean  "archived",     default: false
    t.integer  "lock_version", default: 0,     null: false
  end

  create_table "tag_texts", force: :cascade do |t|
    t.string   "text",                       null: false
    t.integer  "team_id",                    null: false
    t.integer  "tags_count", default: 0
    t.boolean  "teamwide",   default: false
    t.datetime "created_at",                 null: false
    t.datetime "updated_at",                 null: false
  end

  add_index "tag_texts", ["text", "team_id"], name: "index_tag_texts_on_text_and_team_id", using: :btree

  create_table "team_tasks", force: :cascade do |t|
    t.string   "label",                       null: false
    t.string   "task_type",                   null: false
    t.text     "description"
    t.text     "options"
    t.text     "project_ids"
    t.text     "mapping"
    t.boolean  "required",    default: false
    t.integer  "team_id",                     null: false
    t.datetime "created_at",                  null: false
    t.datetime "updated_at",                  null: false
    t.string   "json_schema"
  end

  create_table "team_users", force: :cascade do |t|
    t.integer  "team_id"
    t.integer  "user_id"
    t.string   "type"
    t.datetime "created_at",                                null: false
    t.datetime "updated_at",                                null: false
    t.string   "role"
    t.string   "status",                 default: "member"
    t.text     "settings"
    t.integer  "invited_by_id"
    t.string   "invitation_token"
    t.string   "raw_invitation_token"
    t.datetime "invitation_accepted_at"
    t.string   "invitation_email"
  end

  add_index "team_users", ["id"], name: "index_team_users_on_id", using: :btree
  add_index "team_users", ["team_id", "user_id"], name: "index_team_users_on_team_id_and_user_id", using: :btree
  add_index "team_users", ["type"], name: "index_team_users_on_type", using: :btree
  add_index "team_users", ["user_id", "team_id"], name: "index_team_users_on_user_id_and_team_id", using: :btree

  create_table "teams", force: :cascade do |t|
    t.string   "name"
    t.string   "logo"
    t.boolean  "private",     default: true
    t.boolean  "archived",    default: false
    t.datetime "created_at",                  null: false
    t.datetime "updated_at",                  null: false
    t.text     "description"
    t.string   "slug"
    t.text     "settings"
    t.boolean  "inactive",    default: false
  end

  add_index "teams", ["id"], name: "index_teams_on_id", using: :btree
  add_index "teams", ["inactive"], name: "index_teams_on_inactive", using: :btree
  add_index "teams", ["slug"], name: "index_teams_on_slug", using: :btree
  add_index "teams", ["slug"], name: "unique_team_slugs", using: :btree

  create_table "users", force: :cascade do |t|
    t.string   "name",                      default: "",    null: false
    t.string   "login",                     default: "",    null: false
    t.string   "token",                     default: "",    null: false
    t.string   "email"
    t.string   "encrypted_password",        default: ""
    t.string   "reset_password_token"
    t.datetime "reset_password_sent_at"
    t.datetime "remember_created_at"
    t.integer  "sign_in_count",             default: 0,     null: false
    t.datetime "current_sign_in_at"
    t.datetime "last_sign_in_at"
    t.string   "current_sign_in_ip"
    t.string   "last_sign_in_ip"
    t.datetime "created_at",                                null: false
    t.datetime "updated_at",                                null: false
    t.string   "image"
    t.integer  "current_team_id"
    t.text     "settings"
    t.string   "confirmation_token"
    t.datetime "confirmed_at"
    t.datetime "confirmation_sent_at"
    t.boolean  "is_admin",                  default: false
    t.text     "cached_teams"
    t.string   "type"
    t.integer  "api_key_id"
    t.integer  "source_id"
    t.string   "unconfirmed_email"
    t.integer  "current_project_id"
    t.boolean  "is_active",                 default: true
    t.string   "invitation_token"
    t.string   "raw_invitation_token"
    t.datetime "invitation_created_at"
    t.datetime "invitation_sent_at"
    t.datetime "invitation_accepted_at"
    t.integer  "invitation_limit"
    t.integer  "invited_by_id"
    t.string   "invited_by_type"
    t.datetime "last_accepted_terms_at"
    t.string   "encrypted_otp_secret"
    t.string   "encrypted_otp_secret_iv"
    t.string   "encrypted_otp_secret_salt"
    t.integer  "consumed_timestep"
    t.boolean  "otp_required_for_login"
    t.string   "otp_backup_codes",                                       array: true
  end

  add_index "users", ["email"], name: "index_users_on_email", using: :btree
  add_index "users", ["id"], name: "index_users_on_id", using: :btree
  add_index "users", ["source_id"], name: "index_users_on_source_id", using: :btree
  add_index "users", ["type"], name: "index_users_on_type", using: :btree

  create_table "versions", force: :cascade do |t|
    t.string   "item_type",       null: false
    t.string   "item_id",         null: false
    t.string   "event",           null: false
    t.string   "whodunnit"
    t.text     "object"
    t.text     "object_changes"
    t.datetime "created_at"
    t.text     "meta"
    t.string   "event_type"
    t.text     "object_after"
    t.integer  "associated_id"
    t.string   "associated_type"
    t.integer  "team_id"
  end

  add_index "versions", ["associated_id"], name: "index_versions_on_associated_id", using: :btree
  add_index "versions", ["event_type"], name: "index_versions_on_event_type", using: :btree
  add_index "versions", ["item_type", "item_id", "whodunnit"], name: "index_versions_on_item_type_and_item_id_and_whodunnit", using: :btree
  add_index "versions", ["team_id"], name: "index_versions_on_team_id", using: :btree

end


text:
Imports System.Collections.Generic

Imports Grasshopper.Kernel
Imports Rhino.Geometry
Imports Grasshopper.Kernel.Types
Imports Grasshopper.Kernel.Data

Public Class TopologyMeshVertexFilter
    Inherits GH_Component
    ''' <summary>
    ''' Initializes a new instance of the NakedPolygonVertices class.
    ''' </summary>
    Public Sub New()
        MyBase.New("Mesh Topology Vertex Filter", "Mesh Topo Vertex Filter", _
           "Filter the vertices of a mesh based on their connectivity", _
           "Sandbox", "Topology")
    End Sub

    ''' <summary>
    ''' Registers all the input parameters for this component.
    ''' </summary>
    Protected Overrides Sub RegisterInputParams(ByVal pManager As GH_Component.GH_InputParamManager)
        pManager.AddPointParameter("Vertex list", "V", "Ordered list of points", GH_ParamAccess.list)
        pManager.AddIntegerParameter("Vertex-Face structure", "VF", "For each vertex the list of adjacent face indices", GH_ParamAccess.tree)
        pManager.AddIntegerParameter("Valency filter", "Val", "Filter vertices with the specified number of adjacent faces", GH_ParamAccess.item, 1)
    End Sub

    ''' <summary>
    ''' Registers all the output parameters for this component.
    ''' </summary>
    Protected Overrides Sub RegisterOutputParams(ByVal pManager As GH_Component.GH_OutputParamManager)
        pManager.AddTextParameter("List of vertex IDs", "I", "List of vertex indices matching the valency criteria", GH_ParamAccess.list)
        pManager.AddPointParameter("List of vertices", "P", "List of vertices matching the valency criteria", GH_ParamAccess.tree)
    End Sub

    ''' <summary>
    ''' This is the method that actually does the work.
    ''' </summary>
    ''' <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
    Protected Overrides Sub SolveInstance(ByVal DA As IGH_DataAccess)

        '1. Declare placeholder variables and assign initial invalid data.
        '   This way, if the input parameters fail to supply valid data, we know when to abort.
        Dim _P As New List(Of GH_Point)
        Dim _PF As GH_Structure(Of GH_Integer) = Nothing
        Dim _V As Int32 = 0

        '2. Retrieve input data.
        If (Not DA.GetDataList(0, _P)) Then Return
        If (Not DA.GetDataTree(1, _PF)) Then Return
        If (Not DA.GetData(2, _V)) Then Return

        '3. Abort on invalid inputs.
        '3.1. get the number of branches in the trees
        If (Not _P.Count > 0) Then Return
        If (Not _PF.PathCount > 0) Then Return
        If (Not _V > 0) Then Return

        '4. Do something useful.
        Dim _idList As New List(Of Int32)
        For i As Int32 = 0 To _PF.Branches.Count - 1
            Dim _branch As List(Of GH_Integer) = _PF.Branches(i)
            If _branch.Count = _V Then
                _idList.Add(i)
            End If
        Next

        Dim _ptList As New List(Of Point3d)
        For Each _id As Int32 In _idList
            _ptList.Add(_P.Item(_id).Value)
        Next

        DA.SetDataList(0, _idList)
        DA.SetDataList(1, _ptList)

    End Sub

    ''' <summary>
    ''' Provides an Icon for every component that will be visible in the User Interface.
    ''' Icons need to be 24x24 pixels.
    ''' </summary>
    Protected Overrides ReadOnly Property Icon() As System.Drawing.Bitmap
        Get
            'You can add image files to your project resources and access them like this:
            Return My.Resources.TopologyMeshPointFilter
        End Get
    End Property

    ''' <summary>
    ''' Gets the unique ID for this component. Do not change this ID after release.
    ''' </summary>
    Public Overrides ReadOnly Property ComponentGuid() As Guid
        Get
            Return New Guid("{0d5dea63-930b-4842-92d6-6a81d9ea3fc9}")
        End Get
    End Property

    Public Overrides ReadOnly Property Exposure As Grasshopper.Kernel.GH_Exposure
        Get
            Return GH_Exposure.quarternary
        End Get
    End Property
End Class


text:
<?php

namespace Pimf\Session\Storages;

use Pimf\Contracts\Cleanable;

/**
 * @package Session_Storages
 * @author  Gjero Krsteski <gjero@krsteski.de>
 */
class Pdo extends Storage implements Cleanable
{
  /**
   * @var \Pimf\Database
   */
  protected $pdo;

  /**
   * @param \Pimf\Database $pdo
   */
  public function __construct(\Pimf\Database $pdo)
  {
    $this->pdo = $pdo;
  }

  /**
   * Load a session from storage by a given ID.
   * If no session is found for the ID, null will be returned.
   *
   * @param string $key
   *
   * @return array|null
   */
  public function load($key)
  {
    try {
      $sth = $this->pdo->prepare(
        'SELECT * FROM sessions WHERE id = :id'
      );

      $sth->bindValue(':id', $key, \PDO::PARAM_INT);
      $sth->execute();

      $session = $sth->fetchObject();

      if ($session instanceof \stdClass) {
        return array('id' => $session->id, 'last_activity' => $session->last_activity, 'data' => unserialize($session->data));
      }
    } catch (\PDOException $pdoe) {
      return null;
    }
  }

  /**
   * Save a given session to storage.
   *
   * @param array $session
   * @param array $config
   * @param bool  $exists
   */
  public function save($session, $config, $exists)
  {
    if ($exists) {
      $sth = $this->pdo->prepare(
        "INSERT INTO sessions (id, last_activity, data) VALUES (:id, :last_activity, :data)"
      );
    } else {
      $sth = $this->pdo->prepare(
        "UPDATE sessions SET last_activity = :last_activity, data = :data WHERE id = :id"
      );
    }

    $sth->bindValue(':id', $session['id'], \PDO::PARAM_INT);
    $sth->bindValue(':last_activity', $session['last_activity']);
    $sth->bindValue(':data', serialize($session['data']));
    $sth->execute();
  }

  /**
   * Delete a session from storage by a given ID.
   *
   * @param string $key
   */
  public function delete($key)
  {
    $sth = $this->pdo->prepare(
      "DELETE FROM sessions WHERE id = :id"
    );

    $sth->bindValue(':id', $key, \PDO::PARAM_INT);
    $sth->execute();
  }

  /**
   * Delete all expired sessions from persistent storage.
   *
   * @param int $expiration
   *
   * @return mixed|void
   */
  public function clean($expiration)
  {
    $sth = $this->pdo->prepare(
      "DELETE FROM sessions WHERE last_activity < :expiration"
    );

    $sth->bindValue(':expiration', $expiration);
    $sth->execute();
  }
}


text:
/**
 * cockpit.metaBoxState API
 *
 * @param object Global cockpit namespace
 * @param object jQuery
 */
;( function( cockpit, $ ) {

	/**
	 * Class cockpit.metaBoxState
	 *
	 * @method Constructor
	 *
	 * @param string metaBoxId
	 * @param object settings (Keys: curtainTitle, titleNote )
	 */
	cockpit.metaBoxState = function( metaBoxId, settings ) {

		/**
		 * @type string
		 */
		this._metaBoxId = metaBoxId;

		/**
		 * @type string
		 */
		this._metaBoxClass = 'cockpit_mb_state';

		/**
		 * @type string
		 */
		this._disabledClass = 'cockpit_mb_state_disabled';

		/**
		 * @type object jQuery element
		 */
		this._metaBox   = null;

		/**
		 * @type object jQuery element
		 */
		this._curtain   = null;

		/**
		 * @type string
		 */
		this._curtainDisabledClass = 'cockpit_mb_state_curtain_disabled';

		/**
		 * @type object jQuery element
		 */
		this._titleNote = null;

		/**
		 * @type object
		 */
		this._settings = {
			curtainTitle : settings.curtainTitle ? settings.curtainTitle : '',
			/* @todo i18n */
			titleNote  : settings.titleNote ? settings.titleNote : 'deaktiviert'
		};
	};

	/**
	 * Get the meta box element
	 *
	 * @method metaBoxState.metaBox()
	 *
	 * @returns object jQuery element
	 */
	cockpit.metaBoxState.prototype.metaBox = function() {

		if ( ! this._metaBox ) {
			this._metaBox = $( '#' + this._metaBoxId );
			this._metaBox.addClass( this._metaBoxClass );
		}

		return this._metaBox;
	};

	/**
	 * Get the curtain element which »disables« the meta box
	 *
	 * @method metaBoxState.curtain()
	 *
	 * @returns element jQuery element
	 */
	cockpit.metaBoxState.prototype.curtain = function() {

		if ( ! this._curtain ) {
			this._curtain = $( '
' );
			this._curtain.hide();
			if ( this._settings.curtainTitle )
				this._curtain.attr( 'title', this._settings.curtainTitle );
			// inject the curtain to the first element of the meta box
			this.metaBox()
				.find( 'div.inside' )
				.first()
				.prepend(
					this._curtain
				);

			// add a class to the meta box.
		}

		return this._curtain;
	};

	/**
	 * get the titleNote element
	 *
	 * @method metaBoxState.titleNote()
	 *
	 * @returns object jQuery element
	 */
	cockpit.metaBoxState.prototype.titleNote = function() {

		if ( ! this._titleNote ) {
			this._titleNote = $( '' );
			this._titleNote.html( this._settings.titleNote );
			this._titleNote.hide();
			// inject the title note to the headline
			var titleSpan = this.metaBox().find( 'h3.hndle span' );
			// append whitespace to separate the words
			this._titleNote.insertAfter(
				this.metaBox().find( 'h3.hndle span' )
			);
			this._titleNote.before( ' ' );
		}

		return this._titleNote;
	};

	/**
	 * disable meta box
	 *
	 * @method metaBoxState.disable()
	 */
	cockpit.metaBoxState.prototype.disable = function() {

		this.metaBox().addClass( this._disabledClass );
		this.curtain()
			.removeClass( this._curtainDisabledClass )
			.show();
		this.titleNote().show()
	};

	/**
	 * enable meta box
	 *
	 * @method metaBoxState.enable()
	 */
	cockpit.metaBoxState.prototype.enable = function() {

		this.metaBox().removeClass( this._disableClass );
		this.curtain()
			.addClass( this._curtainDisabledClass )
			.hide();
		this.titleNote().hide();
	};
} )(
	window.cockpit = window.cockpit || {},
	jQuery
);


text:
class Solution:
    def reorderedPowerOf2(self, N: int) -> bool:

s = Solution()
assert(s.reorderedPowerOf2(1) == True)


text:
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Management.Sql.Models;

namespace Microsoft.WindowsAzure.Management.Sql
{
    /// <summary>
    /// Represents all the operations for operating on Azure SQL Databases.
    /// Contains operations to: Create, Retrieve, Update, and Delete
    /// databases, and also includes the ability to get the event logs for a
    /// database.
    /// </summary>
    public partial interface IDatabaseOperations
    {
        /// <summary>
        /// Creates a database in an Azure SQL Database Server.
        /// </summary>
        /// <param name='serverName'>
        /// The name of the Azure SQL Database Server where the database will
        /// be created.
        /// </param>
        /// <param name='parameters'>
        /// The parameters for the create database operation.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// Represents the response to a create database request from the
        /// service.
        /// </returns>
        Task<DatabaseCreateResponse> CreateAsync(string serverName, DatabaseCreateParameters parameters, CancellationToken cancellationToken);

        /// <summary>
        /// Drops a database from an Azure SQL Database Server.
        /// </summary>
        /// <param name='serverName'>
        /// The name of the Azure SQL Database Server on which the database is
        /// hosted.
        /// </param>
        /// <param name='databaseName'>
        /// The name of the Azure SQL Database to be deleted.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// A standard service response including an HTTP status code and
        /// request ID.
        /// </returns>
        Task<OperationResponse> DeleteAsync(string serverName, string databaseName, CancellationToken cancellationToken);

        /// <summary>
        /// Returns information about an Azure SQL Database.
        /// </summary>
        /// <param name='serverName'>
        /// The name of the Azure SQL Database Server on which the database is
        /// hosted.
        /// </param>
        /// <param name='databaseName'>
        /// The name of the Azure SQL Database to be retrieved.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// Contains the response to a Get Database request.
        /// </returns>
        Task<DatabaseGetResponse> GetAsync(string serverName, string databaseName, CancellationToken cancellationToken);

        /// <summary>
        /// Returns information about an Azure SQL Database event logs.
        /// </summary>
        /// <param name='serverName'>
        /// The name of the Azure SQL Database Server on which the database is
        /// hosted.
        /// </param>
        /// <param name='databaseName'>
        /// The name of the Azure SQL Database to be retrieved.
        /// </param>
        /// <param name='parameters'>
        /// The parameters for the Get Database Event Logs operation.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// Contains the response to a Get Database Event Logs request.
        /// </returns>
        Task<DatabaseGetEventLogsResponse> GetEventLogsAsync(string serverName, string databaseName, DatabaseGetEventLogsParameters parameters, CancellationToken cancellationToken);

        /// <summary>
        /// Returns a collection of Azure SQL Databases.
        /// </summary>
        /// <param name='serverName'>
        /// The name of the Azure SQL Database Server from which to retrieve
        /// the database.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// Contains a collection of databases for a given Azure SQL Database
        /// Server.
        /// </returns>
        Task<DatabaseListResponse> ListAsync(string serverName, CancellationToken cancellationToken);

        /// <summary>
        /// Updates the properties of an Azure SQL Database.
        /// </summary>
        /// <param name='serverName'>
        /// The name of the Azure SQL Database Server where the database is
        /// hosted.
        /// </param>
        /// <param name='databaseName'>
        /// The name of the Azure SQL Database to be updated.
        /// </param>
        /// <param name='parameters'>
        /// The parameters for the Update Database operation.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// Contains the response from a request to Update Database.
        /// </returns>
        Task<DatabaseUpdateResponse> UpdateAsync(string serverName, string databaseName, DatabaseUpdateParameters parameters, CancellationToken cancellationToken);
    }
}


text:
package channel

import (
	"fmt"
	"net/http"
	"strings"
	"time"

	"github.com/emreler/finch/logger"
	"github.com/emreler/finch/models"
)

const (
	methodGet    = "GET"
	methodPost   = "POST"
	contentPlain = "text/plain"
	contentJSON  = "application/json"
	contentForm  = "application/x-www-form-urlencoded"
)

// HTTPChannel implements the http request alert method
type HTTPChannel struct {
	logger logger.InfoErrorLogger
}

// NewHTTPChannel returns new HTTPChannel struct.
func NewHTTPChannel(logger logger.InfoErrorLogger) *HTTPChannel {
	return &HTTPChannel{logger: logger}
}

func (h *HTTPChannel) Notify(alert *models.Alert) (int, error) {
	ValidMethods := map[string]bool{
		methodGet:  true,
		methodPost: true,
	}

	ValidContentTypes := map[string]bool{
		contentPlain: true,
		contentJSON:  true,
		contentForm:  true,
	}

	if alert.Method == "" {
		alert.Method = methodGet
	}

	if !ValidMethods[alert.Method] {
		return 0, fmt.Errorf("Invalid method %s", alert.Method)
	}

	if alert.ContentType == "" {
		alert.ContentType = contentPlain
	}

	if !ValidContentTypes[alert.ContentType] {
		return 0, fmt.Errorf("Invalid contentType %s", alert.ContentType)
	}

	var resp *http.Response
	var err error

	httpClient := http.Client{
		Transport: &http.Transport{DisableKeepAlives: true},
		Timeout:   time.Second * 10,
	}

	if alert.Method == methodGet {
		resp, err = httpClient.Get(alert.URL)
	} else if alert.Method == methodPost {
		resp, err = httpClient.Post(alert.URL, alert.ContentType, strings.NewReader(alert.Data))
	}

	if err != nil {
		return 0, err
	}

	resp.Body.Close()

	h.logger.Info(fmt.Sprintf("Response for %s request to %s: %d", alert.Method, alert.URL, resp.StatusCode))

	return resp.StatusCode, nil
}


text:
from setuptools import setup

setup(name='pixywerk',
      version='0.0a6',
      description='A simple filesystem based WSGI CMS',
      url='https://github.com/chaomodus/pixywerk/',
      author='Cas Rusnov',
      author_email='rusnovn@gmail.com',
      license='MIT',
      packages=['pixywerk'],
      scripts=['start-pixywerk'],
      zip_safe=True)


text:
<?xml version="1.0" encoding="utf-8"?>

<!--
       Licensed to the Apache Software Foundation (ASF) under one
       or more contributor license agreements.  See the NOTICE file
       distributed with this work for additional information
       regarding copyright ownership.  The ASF licenses this file
       to you under the Apache License, Version 2.0 (the
       "License"); you may not use this file except in compliance
       with the License.  You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

       Unless required by applicable law or agreed to in writing,
       software distributed under the License is distributed on an
       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
       KIND, either express or implied.  See the License for the
       specific language governing permissions and limitations
       under the License.
-->

<partitions>
    <!-- A partition should at least have a provider -->
    <partition id="P1">
        <!-- A sample provider level partition -->
	<provider>ec2</provider>
    </partition>
    <partition id="P2">
	<provider>openstack</provider>
        <!-- A sample region level partition -->
        <property name="region" value="region-x"/>
    </partition>
    <partition id="P3">
        <!-- A sample zone level partition -->
	<provider>ec2</provider>
        <property name="region" value="region-y"/>
        <property name="zone" value="zone-1"/>
    </partition>
</partitions>


text:
class UserData {
    constructor () {
        this._username = '';
    }

    /**
     * Handler for updating the username
     * @param {object} data Data posted to this ioDevice.
     * @property {!string} username The new username.
     */
    postData (data) {
        this._username = data.username;
    }

    /**
     * Getter for username. Initially empty string, until set via postData.
     * @returns {!string} The current username
     */
    getUsername () {
        return this._username;
    }
}

module.exports = UserData;


text:
import logging

import lingobarter.core.models as m
import os
from cached_property import cached_property, cached_property_ttl
from flask.config import Config
from lingobarter.utils import parse_conf_data

logger = logging.getLogger()

class LingobarterConfig(Config):
    """A Config object for Flask that tries to ger vars from
    database and then from Config itself"""

    @cached_property
    def store(self):
        return dict(self)

    @cached_property_ttl(300)
    def all_setings_from_db(self):
        """
        As config reads data from database on every app.config.get(key)/[key]
        This data is cached as a cached_property
        The TTL is fixed in 5 minutes because we can't read it from
        config itself.
        Find a way to set the config parameter in a file
        maybe in a config_setting.ini
        It takes 5 minutes for new values to be available
        and Make it possible to use REDIS as a cache
        """
        try:
            return {
                item.name: item.value
                for item in m.config.Config.objects.get(
                    group='settings'
                ).values
            }
        except Exception as e:
            logger.warning('Error reading all settings from db: %s' % e)
            return {}

    def get_from_db(self, key, default=None):
        return self.all_setings_from_db.get(key, default)

    def __getitem__(self, key):
        return self.get_from_db(key) or dict.__getitem__(self, key)

    def get(self, key, default=None):
        return self.get_from_db(key) or self.store.get(key) or default

    def from_object(self, obj, silent=False):
        try:
            super(LingobarterConfig, self).from_object(obj)
        except ImportError as e:
            if silent:
                return False
            e.message = 'Unable to load configuration obj (%s)' % e.message
            raise

    def from_envvar_namespace(self, namespace='LINGOBARTER', silent=False):
        try:
            data = {
                key.partition('_')[-1]: parse_conf_data(data)
                for key, data
                in os.environ.items()
                if key.startswith(namespace)
                }
            self.update(data)
        except Exception as e:
            if silent:
                return False
            e.message = 'Unable to load config env namespace (%s)' % e.message
            raise

    def load_lingobarter_config(self, config=None, mode=None, test=None, **sets):
        # first load from global settings object
        self.from_object(config or 'lingobarter.settings')
        # then load from local or test settings
        mode = mode or 'test' if test else os.environ.get(
            'LINGOBARTER_MODE', 'local')
        self.from_object('lingobarter.%s_settings' % mode, silent=True)
        path = "LINGOBARTER_SETTINGS" if not test else "LINGOBARTERTEST_SETTINGS"
        self.from_envvar(path, silent=True)
        self.from_envvar_namespace(namespace='LINGOBARTER', silent=True)
        self.update(sets)


text:
'use strict';

module.exports = {
    friendlyName: 'Create OBM settings',
    injectableName: 'Task.Base.Obm.Ipmi.CreateSettings',
    runJob: 'Job.Obm.Ipmi.CreateSettings',
    requiredOptions: [
        'user',
        'password'
    ],
    requiredProperties: {},
    properties: {
        obm: {
            type: 'ipmi'
        }
    }
};


text:
package io.github.droidkaigi.confsched2017.view.fragment;

import com.annimon.stream.Optional;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import javax.inject.Inject;

import io.github.droidkaigi.confsched2017.databinding.FragmentInformationBinding;
import io.github.droidkaigi.confsched2017.view.activity.ContributorsActivity;
import io.github.droidkaigi.confsched2017.view.activity.LicensesActivity;
import io.github.droidkaigi.confsched2017.view.activity.SponsorsActivity;
import io.github.droidkaigi.confsched2017.view.helper.IntentHelper;
import io.github.droidkaigi.confsched2017.viewmodel.InformationViewModel;

public class InformationFragment extends BaseFragment implements InformationViewModel.Callback {

    public static final String TAG = InformationFragment.class.getSimpleName();

    private FragmentInformationBinding binding;

    @Inject
    InformationViewModel viewModel;

    public static InformationFragment newInstance() {
        return new InformationFragment();
    }

    public InformationFragment() {
    }

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        getComponent().inject(this);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        binding = FragmentInformationBinding.inflate(inflater, container, false);

        viewModel.setCallback(this);
        binding.setViewModel(viewModel);

        return binding.getRoot();
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        viewModel.destroy();
    }

    @Override
    public void showSponsorsPage() {
        SponsorsActivity.start(getActivity());
    }

    @Override
    public void showQuesionnairePage() {
        // TODO
    }

    @Override
    public void showContributorsPage() {
        ContributorsActivity.start(getActivity());
    }

    @Override
    public void showTranslationsPage() {
        showHtmlUrl("https://droidkaigi2017.oneskyapp.com/collaboration");
    }

    @Override
    public void showLicensePage() {
        LicensesActivity.start(getActivity());
    }

    @Override
    public void showDevInfoPage() {
        // TODO
    }

    @Override
    public void showTwitter() {
        showHtmlUrl("https://twitter.com/DroidKaigi");
    }

    @Override
    public void showFacebook() {
        showHtmlUrl("https://www.facebook.com/DroidKaigi/");
    }

    @Override
    public void showGitHubRepository() {
        showHtmlUrl("https://github.com/DroidKaigi/conference-app-2017/");
    }

    @Override
    public void showDroidKaigiWeb() {
        showHtmlUrl("https://droidkaigi.github.io/2017/");
    }

    @Override
    public void showYouTube() {
        showHtmlUrl("https://www.youtube.com/droidkaigi");
    }

    public void showHtmlUrl(String htmlUrl) {
        Optional<Intent> intentOptional = IntentHelper.buildActionViewIntent(getContext(), htmlUrl);
        intentOptional.ifPresent(this::startActivity);
    }
}


text:
package net.dv8tion.jda.core.events.message.guild.react;

import net.dv8tion.jda.core.JDA;
import net.dv8tion.jda.core.entities.MessageReaction;
import net.dv8tion.jda.core.entities.User;

public class GuildMessageReactionAddEvent extends GenericGuildMessageReactionEvent
{
    public GuildMessageReactionAddEvent(JDA api, long responseNumber, User user, MessageReaction reaction)
    {
        super(api, responseNumber, user, reaction);
    }
}


text:
sdk which call apis of Programming Q&A Site [Teratail](https://teratail.com/)

You Can Develop an awesome web service which uses teratail's api more rapidly.

## notice
This is unofficial sdk.

## install

Write your Gemfile

```
gem 'teratail-sdk-ruby'
```

## usage

```Ruby
client = Teratail.new(access_token) #input your access token

# get questions
client.question.find_all

# with paging and array limit option
client.question.find_all(2,30) #you can get 2 page and 30 question array element

# get tags
client.tag.find_all
# get users
client.user.find_all

```

# rule
This library's license is MIT.You can alter or reproduct this.
Please follow [teratail service api term](https://teratail.com/legal) when you use.

# official document
[Teratail API Document](http://docs.teratailv1.apiary.io/#introduction)


text:
from django import forms
from django.conf import settings
from django.http import HttpResponse, HttpResponseRedirect, Http404
from manage import models as mmod
from . import templater
from django.contrib.auth.decorators import user_passes_test
import datetime

@user_passes_test(lambda u: u.is_superuser)
def process_request(request):
  '''Check for Authntication'''
  if request.user.is_authenticated():
    '''Shows all questions in the DB'''

    now = datetime.datetime.now()
    thirty_days_ago = now - datetime.timedelta(days=30)
    sixty_days_ago = now - datetime.timedelta(days=60)
    ninety_days_ago = now - datetime.timedelta(days=90)

    thirty = mmod.Rental.objects.filter(date_out__lte=thirty_days_ago).exclude(returned=True)
    sixty = mmod.Rental.objects.filter(date_out__lte=sixty_days_ago).exclude(returned=True)
    ninety = mmod.Rental.objects.filter(date_out__lte=ninety_days_ago).exclude(returned=True)

    template_vars = {
      'thirty': thirty,
      'sixty': sixty,
      'ninety': ninety,
    }
    return templater.render_to_response(request, 'overdue_rental.html', template_vars)

  else:
      return HttpResponseRedirect("/account/please_sign_in/")


text:
{% load i18n %}
<script type="text/javascript">// <![CDATA[
    jQuery(function($) {

        var uploadUrl = '{% url "admin:media_tree_filenode_upload" %}',
            uploader = $('#uploader-button').djangoAdminFileUploader({
                request: {
                    endpoint: uploadUrl,
                    customHeaders: {
                        'X-CSRFToken': '{{ csrf_token }}'
                    },
                    inputName: 'file'
                },
                uploaderType: 'basic',
                multiple: true,
                button: $('#uploader-button'),
                validation: {
                    //allowedExtensions: ['jpeg', 'jpg', 'txt'],
                    //sizeLimit: 51200 // 50 kB = 50 * 1024 bytes
                },
                showMessage: function(message) {
                },
                beforeSubmit: function(event, id, name) {
                    // Gather upload form values (such as target folder) and set as upload params
                    var params = $('#upload-form').serializeArray().reduce(function(obj, item) {
                        obj[item.name] = item.value;
                        return obj;
                    }, {});
                    uploader.fineUploader('setParams', params);
                }
            });
    });
// ]]></script>


text:
using FarseerPhysics;
using FarseerPhysics.Collision.Shapes;
using FarseerPhysics.Dynamics;

namespace Nez.Farseer
{
	internal class FSFixtureDef
	{
		public Shape Shape;
		public float Friction = 0.2f;
		public float Restitution;
		public float Density = 1f;
		public bool IsSensor;
		public Category CollidesWith = Settings.DefaultFixtureCollidesWith;
		public Category CollisionCategories = Settings.DefaultFixtureCollisionCategories;
		public Category IgnoreCCDWith = Settings.DefaultFixtureIgnoreCCDWith;
		public short CollisionGroup;
	}
}


text:
import webbrowser as browser

from utils import *

for file in TPL.iterdir():
    print(file)
    url = f'http://localhost/upracmeslovensko.sk/src/html/templates/{file.name}'
    # print(url)
    browser.open_new_tab(url)


text:
package com.alibaba.csp.sentinel.slotchain;

/**
 * The builder for processor slot chain.
 *
 * @author qinan.qn
 * @author leyou
 * @author Eric Zhao
 */
public interface SlotChainBuilder {

    /**
     * Build the processor slot chain.
     *
     * @return a processor slot that chain some slots together
     */
    ProcessorSlotChain build();
}


text:
## CouchDB

| Stability: __stable__

=== javascript

/*
	Constructor
	@connectionString {String} :: url address
*/
CouchDB(connectionString);

/*
	Usage / Constructor
	@connectionString {String} :: url address
	return {CouchDB};
*/
require('partial.js/couchdb').init(connectionString);

/*
	CouchDB command
	@cb {Function} :: function(error, object)
	return {CouchDB}
*/
couchdb.compactDatabase(cb);
couchdb.compactViews(cb);
couchdb.cleanupViews(cb);

/*
	CouchDB command
	@namespace {String}
	@name {String}
	@params {Object}
	@cb {Function} :: function(error, object)
	return {CouchDB}
*/
couchdb.view(namespace, name, params, cb);
couchdb.list(namespace, name, params, cb);
couchdb.show(namespace, name, params, cb);

/*
	CouchDB command
	@id {String}
	@revs {String} :: optional
	@cb {Function} :: function(error, object)
	return {CouchDB}
*/
CouchDB.find(id, revs, cb);

/*
	CouchDB command
	@params {Object}
	@cb {Function} :: function(error, object)
	return {CouchDB}
*/
couchdb.all(params, cb);
couchdb.changes(params, cb);

/*
	CouchDB command
	@funcMap {Function}
	@funcMfuncReduceap {Function}
	@params {Object}
	@cb {Function} :: function(error, object)
	return {CouchDB}
*/
couchdb.query(funcMap, funcReduce, params, cb);

/*
	CouchDB command
	@doc {Object}
	@cb {Function} :: function(error, object)
	return {CouchDB}
*/
couchdb.insert(doc, cb);

/*
	CouchDB command
	@doc {Object}
	@cb {Function} :: function(error, object)
	return {CouchDB}
*/
couchdb.update(doc, cb);

/*
	CouchDB command
	@namespace {String}
	@view {Object} :: view = { map: { name: 'function... ', reduce: 'function...'}}
	@cb {Function} :: function(error, object)
	return {CouchDB}
*/
couchdb.insertView(namespace, view, cb);

/*
	CouchDB command
	@rev {String} :: old revision
	@namespace {String}
	@view {Object} :: view = { map: { name: 'function... ', reduce: 'function...'}}
	@cb {Function} :: function(error, object)
	return {CouchDB}
*/
couchdb.updateView(rev, namespace, view, cb);

/*
	CouchDB command
	@path {String}
	@method {String}
	@obj {Object}
	@params {Object}
	@cb {Function} :: function(error, object)
	return {CouchDB}
*/
couchdb.request(path, method, obj, params, cb);

/*
	CouchDB command
	@doc {Object or String}
	@cb {Function} :: function(error, object)
	return {CouchDB}
*/
couchdb.delete(doc, cb);

/*
	CouchDB command
	@doc {Object}
	@fileName {String}
	@cb {Function} :: function(error, object)
	return {CouchDB}
*/
couchdb.deleteAttachment(doc, fileName, cb);

/*
	CouchDB command
	@arr {Object array}
	@cb {Function} :: function(error, object)
	return {CouchDB}
*/
couchdb.bulk(arr, cb);

/*
	CouchDB command
	@docOrId {String or Object}
	@fileName {String}
	@response {Function or ServerResponse} :: function(data)
	return {CouchDB}
*/
couchdb.attachment(docOrId, fileName, response);

/*
	CouchDB command
	@docOrId {String or Object}
	@fileName {String}
	@fileSave {String}
	@cb {Function} :: optional function(error, object)
	return {CouchDB}
*/
couchdb.upload(docOrId, fileName, fileSave, cb);

/*
	CouchDB command
	@max {Number}
	@cb {Function} :: optional function(error, object)
	return {CouchDB}
*/
couchdb.uuids(max, cb);
===


text:
package org.mesba.smartasync;

import java.util.List;
import java.util.Map;

/**
 * Created by mis on 9/1/2015.
 */
public interface IAsyncResponse {
    void onResultsFailed(String response, int statusCode, Map<String, List<String>> header);
    void onResultsSucceeded(String response, int statusCode, Map<String, List<String>> header);
}


text: var greeting:Greets.Greeting = new Greets.Greeting("Hello", "World", new Greets.MsgDivMessenger());