text:
module HasEnumeration
  module Arel
    module TableExtensionsArelOne
      def self.included(base)
        base.class_eval do
          alias_method_chain :attributes, :has_enumeration

          def self.has_enumeration_mappings
            @has_enumeration_mappings ||= Hash.new {|h,k| h[k] = Hash.new}
          end
        end
      end

      def attributes_with_has_enumeration
        return @attributes if @attributes
        attrs = attributes_without_has_enumeration
        mappings = self.class.has_enumeration_mappings[name]
        if mappings
          mappings.each do |attr_name, mapping|
            attr = attrs[attr_name]
            install_has_enumeration_attribute_mapping(attr, mapping)
          end
        end
        attrs
      end

    private
      def install_has_enumeration_attribute_mapping(arel_attr, mapping)
        # For this attribute only, override all of the methods defined
        # in Arel::Attribute::PREDICATES so that they will perform the
        # symbol-to-underlying-value mapping before proceeding with their work.
        (class <<arel_attr;self;end).class_eval do
          define_method :map_enumeration_arg do |arg|
            if arg.is_a?(Symbol)
              unless mapping.has_key?(arg)
                raise ArgumentError.new(
                  "#{arg.inspect} is not one of {#{mapping.keys.map(&:inspect).sort.join(', ')}}"
                )
              end
              mapping[arg]
            elsif arg.is_a?(Array)
              arg.map {|a| map_enumeration_arg(a)}
            else
              arg
            end
          end

          ::Arel::Attribute::PREDICATES.each do |method_name|
            # Preserve the arity of the method we are overriding
            arity = ::Arel::Attribute.instance_method(method_name).arity
            case arity
            when 1
              define_method method_name do |arg|
                super(map_enumeration_arg(arg))
              end
            when -1
              define_method method_name do |*args|
                super(map_enumeration_arg(args))
              end
            else
              raise "Unexpected arity #{arity} for #{method_name}"
            end
          end
        end
      end
    end
  end
end


text:
<?php

declare(strict_types=1);

namespace Hail\Http\Client\Exception;

/**
 * Thrown whenever a required call-flow is not respected.
 */
class LogicException extends \LogicException implements ExceptionInterface
{
}

redpajama_set_name: RedPajamaGithub


text:
namespace CivGen
{
    using System;
    using System.Collections.Generic;

    public partial class StartingBuilding
    {
        public string Building { get; set; }
        public string Era { get; set; }
        public string District { get; set; }

        public virtual Building Building1 { get; set; }
        public virtual District District1 { get; set; }
        public virtual Era Era1 { get; set; }
    }
}


text:
This repository includes the two files that **must be included** in all project submissions for Sacramento County's [Hack4Sac Civic Tech Challenge](http://hack4sac.saccounty.net/):

1. this `README` containing instructions and information to include in your submission; and,
2. a `LICENSE` that allows anyone to do anything they want with your code as long as they provide attribution back to you and don't hold you liable.

## Project Information
Sacramento County Hack4Sac Project to provide Homeless Resource Information for Sacramento County Area and way to engage community organizations and volunteers to provide resources.

### Project Name
SacSOS - (SacHomeless)

### Project Description
SacHomeless provides Homeless_resources information for the Sacramento County area to homeless people, advocates, and social services professionals and provides a way to engage the community organizations and volunteers to provide resources.

### Team Members
- Team Leader Name Joanne Werneke, joannemwerneke@gmail.com
- Jeff Roush
- Michael Tel, michael@hollyhox.com
- Kevin Fries
- Emily Quinn Finney
- Jared Garst
- Hillary Gaines - customer/client experience gaines.household@icloud.com
- Kayla Granderson - customer/client experience

### Stakeholder Engagement
- Julie Field - Dept. of Human Services, Sacramento County
- Veronica Beaty - The People's Guide, veronica@sachousingalliance.org
- Dave Coburn - Pilgrimage Sacramento - Corburn180@gmail.com
- Hillary Gaines - EMQ FamiliesFirst

### Developer Documentation

### Additional Information (optional)

Our code changes were made to several repositories:

 * A mobile site, the source code for which is in the doc_root directory of this repository
 * A forked copy of the [Ohana api site](https://github.com/SacHomeless/ohana-api.git)
 * A forked copy of the [Ohana Web Search project](https://github.com/SacHomeless/ohana-web-search.git)
 * Our [Ohana Client](https://github.com/SacHomeless/ohana-client.git), a Ruby script for uploading data.

## Submission Instructions

### Step 1: Fork this Repository
By forking this repository, we'll be able to find your project which will allow the judges to review your submission. Please note that cloning this repository or copying the contents of this `README` to your project will not allow us to find your project. Learn more about [how to fork a project repository](https://help.github.com/articles/fork-a-repo/).

### Step 2: Rename Your New Project Repository
You probably want your project to have a name other than `Hack4Sac`, so go ahead and rename your project repository. Also, feel free to edit the description and URL of your deployed app at the top of your repository on GitHub.

### Step 3: Add Your Project Files
As long as you keep this `README.md` file in your repository, hack away on your project to your heart's content.

### Step 4: Add Your Team Information
Add your project name, description, and team members at the top of this file by [committing changes](https://help.github.com/articles/adding-a-file-to-a-repository-from-the-command-line/). In the `LICENSE` file, replace `[fullname]` with the name of the individual(s) or team you want attributed to your project. *Hint: a [commit history](https://github.com/rust-lang/rust/commits/master/README.md) will provide valuable information to the judges about the work your team invested in developing your particular solution.*

### Step 5: Submit Your Project
Guess what? If you've already forked this repository, then you've already submitted your project. On April 12, 2016, the judges will review all of [the repositories listed here](https://github.com/SacCounty/Hack4Sac/network/members). If your repository is not listed, [please let us know](mailto:hack4sac@saccounty.net).

**IMPORTANT: If you haven't already done so, make sure you've joined the Hack4Sac Slack Community**
- [Sign up](http://slackin.saccounty.net)
- [Login](https://hackforsac.slack.com)

### Optional: Waffle.io Hackshop Tools

*Hint: while optional, these tools will result in projects that help meet the needs of users and help the judges better understand the thinking behind your particular solution.*

#### To use these tools, first replace `GITHUB_ACCOUNT` with the GitHub username or organization name to which you forked this repository so that the links correctly work.

[![Stories Ready to Work On](https://badge.waffle.io/GITHUB_ACCOUNT/project-submission-template.svg?label=ready&title=Cards%20Ready%20To%20Work%20On)](https://waffle.io/GITHUB_ACCOUNT/project-submission-template)

This repo was created from http://hackshop.waffle.io. Use [the Waffle board](https://waffle.io/GITHUB_ACCOUNT/project-submission-template) for this repo to always know what to do next for your hackshop project!

#### Why Hackshops?

##### Transparent, Simple Tooling
We've put together the right set of tools to help teams be productive in the shortest period of time. In addition to helping teams move fast, this tool set will allow transparency for optimized community engagement and easy continuation of the project following the event.

##### Learn Lean by Being Lean
Hackshops apply lean principles to hackathons. By using the Hackshop format, hackathon teams can expect to learn:
- how to maximize resources in hyper-limited time constraints
- how to validate with customers before building the wrong thing
- how to document a brief, living, and lean business model
- how to continually test assumptions with rapid experimentation to deliver an MVP

Hackshops are still hackathons. The difference is the addition of the Hackshop framework for running in a lean way, to be as efficient as possible, focused on continuously experimenting and learning throughout the development process.

##### The Traditional Hackathon
Hackathons traditionally center around building solutions, the most time-consuming and expensive part of the development lifecycle.

Individuals and teams show up to the event already knowing what they plan to build. Sometimes, problem statements are pre-defined, which is a step in the right direction -- but what if you're not passionate about the problem to be solved? Or what if you already have an amazing solution in mind?

Unfortunately, your amazing solution is probably not actually as amazing as you think. You may have even skipped identifying what the underlying problem is altogether. You could spend 24 hours coding a chat app for retired seniors only to find out that 10% of them use smart phones.

##### The Hackshop Way
Hackshops focus on problems and customers first. What problem are you solving and for who are you solving it? Can you make a compelling promise to that customer that you can deliver a solution that meets their needs? Before we even talk about solutions, we focus on the customer, problem, and promise, first.

We've learned that when starting with a problem or an idea, the more we can be wrong, faster, the more we can get to a solution worth building. This approach sounds backwards, because your solution is so obviously brilliant, right? Unfortunately, probably not. Solutions that go from idea to launch without any attempt to validate or invalidate the underlying problem with a customer segment and if your solution fits their needs are rarely successful.

The Hackshop format leaves the traditional hackathon's solution-centric format behind. Hackshops focus on customers, problems, and promises first, and advocate moving quickly using succinct timeboxes to get from idea to MVP as quickly as possible. Throughout the event, teams work to prove their own assumptions wrong on their path to a viable solution.

#### Hackshops vs. Hackathons

##### 5 Unique Elements
- problem-centric approach (no solutions for the first 1/4 of the event)
- use of a [lean business canvas](https://github.com/waffleio/hackshop-playbook/raw/master/resources/leancanvas.pdf) as central to process
- customer validation before building
- rapid prototyping and experimentation
- use of continuous feedback loop (frame/build/measure/learn)

##### Recommended (Lightweight) Tooling
- An electronic or paper version of a [lean business canvas](https://github.com/waffleio/hackshop-playbook/raw/master/resources/leancanvas.pdf)
- GitHub, for collaboration on code and issues
- [hackshop.waffle.io](https://hackshop.waffle.io), a pre-built project template for managing issues in GitHub using a lean workflow
- [Slack](http://hackforsac.slack.com), for remote and ongoing communications (optional)

#### Hackshops specifically limit risk around:
- solving problems that aren't painful or impactful
- building the wrong thing for the wrong customer
- post-hackathon death due to lack of focus or centralization of team/data


text:
namespace dscr = discreture; // for backward compatibility
namespace ds = discreture;


text:
var slider1 = document.getElementById('disable1'),
	slider2 = document.getElementById('disable2'),
	checkbox1 = document.getElementById('checkbox1'),
	checkbox2 = document.getElementById('checkbox2'),
	checkbox3 = document.getElementById('checkbox3'),
	origins = slider2.getElementsByClassName('noUi-origin');

function toggle ( element ){

	// If the checkbox is checked, disabled the slider.
	// Otherwise, re-enable it.
	if ( this.checked ) {
		element.setAttribute('disabled', true);
	} else {
		element.removeAttribute('disabled');
	}
}

noUiSlider.create(slider1, {
	start: 80,
	connect: [true, false],
	range: {
		min: 0,
		max: 100
	}
});

noUiSlider.create(slider2, {
	start: [20, 80],
	range: {
		min: 0,
		max: 100
	}
});

checkbox1.addEventListener('click', function(){
	toggle.call(this, slider1);
});

checkbox2.addEventListener('click', function(){
	toggle.call(this, origins[0]);
});

checkbox3.addEventListener('click', function(){
	toggle.call(this, origins[1]);
});


text:
extern "C"
{
#endif

// This logic was borrowed (then namespaced) from the examples on the gcc wiki:
//     https://gcc.gnu.org/wiki/Visibility

#if defined _WIN32 || defined __CYGWIN__
  #ifdef __GNUC__
    #define IMAGE_GEOMETRY_EXPORT __attribute__ ((dllexport))
    #define IMAGE_GEOMETRY_IMPORT __attribute__ ((dllimport))
  #else
    #define IMAGE_GEOMETRY_EXPORT __declspec(dllexport)
    #define IMAGE_GEOMETRY_IMPORT __declspec(dllimport)
  #endif
  #ifdef IMAGE_GEOMETRY_BUILDING_DLL
    #define IMAGE_GEOMETRY_PUBLIC IMAGE_GEOMETRY_EXPORT
  #else
    #define IMAGE_GEOMETRY_PUBLIC IMAGE_GEOMETRY_IMPORT
  #endif
  #define IMAGE_GEOMETRY_PUBLIC_TYPE IMAGE_GEOMETRY_PUBLIC
  #define IMAGE_GEOMETRY_LOCAL
#else
  #define IMAGE_GEOMETRY_EXPORT __attribute__ ((visibility("default")))
  #define IMAGE_GEOMETRY_IMPORT
  #if __GNUC__ >= 4
    #define IMAGE_GEOMETRY_PUBLIC __attribute__ ((visibility("default")))
    #define IMAGE_GEOMETRY_LOCAL  __attribute__ ((visibility("hidden")))
  #else
    #define IMAGE_GEOMETRY_PUBLIC
    #define IMAGE_GEOMETRY_LOCAL
  #endif
  #define IMAGE_GEOMETRY_PUBLIC_TYPE
#endif

#if __cplusplus
}
#endif

#endif  // IMAGE_GEOMETRY__VISIBILITY_CONTROL_H_


text:
export function pageLoaded(args) {
    var page = args.object;

    page.bindingContext = { html: "one<br>two" };
}


text:
package org.swiften.javautilities.localizer;

import org.jetbrains.annotations.Nullable;
import org.swiften.javautilities.string.HStrings;
import org.swiften.javautilities.util.HLogs;
import org.swiften.javautilities.rx.CustomTestSubscriber;
import io.reactivex.Flowable;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.Function;
import io.reactivex.subscribers.TestSubscriber;
import org.jetbrains.annotations.NotNull;
import org.reactivestreams.Publisher;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;

import static org.mockito.Mockito.spy;

/**
 * Created by haipham on 3/26/17.
 */
public final class ActualLocalizerTest implements LocalizeErrorType {
    @NotNull private final Localizer LOCALIZER;
    @NotNull private final String[] STRINGS;
    @NotNull private final LCFormat[] FORMATS;

    {
        LOCALIZER = spy(Localizer.builder()
            .addBundle("Strings", Locale.US)
            .addBundle("Strings", new Locale("vi_VN"))
            .build());

        STRINGS = new String[] {
            "auth_title_email",
            "auth_title_password",
            "auth_title_signInOrRegister",
            "non_localizable_text"
        };

        FORMATS = new LCFormat[] {
            LCFormat.builder()
                .withPattern("format_pattern_1")
                .addArgument(2)
                .addArgument("localizable_cake")
                .addArgument("localizable_table")
                .build(),

            LCFormat.builder()
                .withPattern("format_pattern_2")
                .addArgument("localizable_game")
                .addArgument(LCFormat.builder()
                    .withPattern("nested_format_pattern")
                    .addArgument("localizable_addition")
                    .addArgument("localizable_collection")
                    .build())
                .build()
        };
    }

    @NotNull
    @DataProvider
    public Iterator<Object[]> localeProvider() {
        List<Locale> locales = LOCALIZER.locales();
        List<Object[]> data = new LinkedList<Object[]>();

        for (Locale locale : locales) {
            data.add(new Object[] { locale });
        }

        return data.iterator();
    }

    @SuppressWarnings("unchecked")
    @Test(dataProvider = "localeProvider")
    public void test_rxLocalizeText_shouldSucceed(@Nullable final Locale LOCALE) {
        // Setup
        TestSubscriber subscriber = CustomTestSubscriber.create();

        // When
        Flowable.fromArray(STRINGS)
            .flatMap(new Function<String,Publisher<String>>() {
                @Override
                public Publisher<String> apply(@NotNull String s) throws Exception {
                    return LOCALIZER.rxa_localize(s, LOCALE);
                }
            })
            .doOnNext(new Consumer<String>() {
                @Override
                public void accept(@NotNull String s) throws Exception {
                    HLogs.println(s);
                }
            })
            .doOnNext(new Consumer<String>() {
                @Override
                public void accept(@NotNull String s) throws Exception {
                    Assert.assertTrue(HStrings.isNotNullOrEmpty(s));
                }
            })
            .subscribe(subscriber);

        subscriber.awaitTerminalEvent();

        // Then
        subscriber.assertSubscribed();
        subscriber.assertNoErrors();
        subscriber.assertComplete();
    }

    @SuppressWarnings("unchecked")
    @Test(dataProvider = "localeProvider")
    public void test_rxLocalizeWithFormat_shouldSucceed(@Nullable final Locale LOCALE) {
        // Setup
        TestSubscriber subscriber = CustomTestSubscriber.create();

        // When
        Flowable.fromArray(FORMATS)
            .flatMap(new Function<LCFormat,Publisher<String>>() {
                @NotNull
                @Override
                public Publisher<String> apply(
                    @NotNull LCFormat format
                ) throws Exception {
                    return LOCALIZER.rxa_localize(format, LOCALE);
                }
            })
            .doOnNext(new Consumer<String>() {
                @Override
                public void accept(@NotNull String s) throws Exception {
                    HLogs.println(s);
                }
            })
            .subscribe(subscriber);

        subscriber.awaitTerminalEvent();

        // Then
        subscriber.assertSubscribed();
        subscriber.assertNoErrors();
        subscriber.assertComplete();
    }
}


text:
/* Customized footer example */

var gui = require ( '../../' )       // stand alone: replace with  require( 'easy-web-app' )

/* Initialize the framework and the default page */
var mainPage = gui.init ( 'Customized Footer Example' )

mainPage.addView (  { id : 'dummy', title: 'Empty View' } )

/* now we customize the footer */
mainPage.setCopyright( 'Example page, (c) 2018, M.H.' )
mainPage.addFooterLink( 'Release Notes', 'https://github.com/ma-ha/easy-web-app/blob/master/ReleaseNotes.md', '_blank' )
mainPage.addFooterLink( 'About', 'https://github.com/ma-ha/easy-web-app/' )


text:
package org.sfs.integration.java.func;

import com.google.common.collect.ListMultimap;
import io.vertx.core.http.HttpClient;
import io.vertx.core.http.HttpClientRequest;
import io.vertx.core.http.HttpClientResponse;
import io.vertx.core.logging.Logger;
import org.sfs.rx.ObservableFuture;
import org.sfs.rx.RxHelper;
import rx.Observable;
import rx.functions.Func1;

import static com.google.common.collect.ArrayListMultimap.create;
import static com.google.common.net.HttpHeaders.AUTHORIZATION;
import static io.vertx.core.logging.LoggerFactory.getLogger;
import static org.sfs.integration.java.help.AuthorizationFactory.Producer;

public class PostObject implements Func1<Void, Observable<HttpClientResponse>> {

    private static final Logger LOGGER = getLogger(PostObject.class);
    private final HttpClient httpClient;
    private final String accountName;
    private final String containerName;
    private final String objectName;
    private final Producer auth;
    private final ListMultimap<String, String> headers;

    public PostObject(HttpClient httpClient, String accountName, String containerName, String objectName, Producer auth) {
        this.httpClient = httpClient;
        this.accountName = accountName;
        this.containerName = containerName;
        this.objectName = objectName;
        this.auth = auth;
        this.headers = create();
    }

    public PostObject setHeader(String name, String value) {
        headers.removeAll(name);
        headers.put(name, value);
        return this;
    }

    public PostObject setHeader(String name, String value, String... values) {
        headers.removeAll(name);
        headers.put(name, value);
        for (String v : values) {
            headers.put(name, v);
        }
        return this;
    }

    @Override
    public Observable<HttpClientResponse> call(Void aVoid) {
        return auth.toHttpAuthorization()
                .flatMap(new Func1<String, Observable<HttpClientResponse>>() {
                    @Override
                    public Observable<HttpClientResponse> call(String s) {
                        ObservableFuture<HttpClientResponse> handler = RxHelper.observableFuture();
                        HttpClientRequest httpClientRequest =
                                httpClient.post("/openstackswift001/" + accountName + "/" + containerName + "/" + objectName, handler::complete)
                                        .exceptionHandler(handler::fail)
                                        .setTimeout(5000)
                                        .putHeader(AUTHORIZATION, s);
                        for (String entry : headers.keySet()) {
                            httpClientRequest = httpClientRequest.putHeader(entry, headers.get(entry));
                        }
                        httpClientRequest.end();
                        return handler
                                .single();
                    }
                });

    }
}


text:
@interface MFProgressView : NSView

@property (weak) IBOutlet NSTextField *label;

- (void)startProgressIndicator;
- (void)stopProgressIndicator;

@end