text:
// Copyright (c) 2009- Facebook
// Distributed under the Scribe Software License
//
// See accompanying file LICENSE or visit the Scribe site at:
// http://developers.facebook.com/scribe/
//
#ifndef HDFS_FILE_H
#define HDFS_FILE_H

#ifdef USE_SCRIBE_HDFS
#include "hdfs.h"

#ifdef HAVE_LZO
#define LZO_STREAMING 1
#endif

#ifdef LZO_STREAMING
#include "lzo/lzoconf.h"
#include "lzo/lzo1x.h"
#endif

class HdfsFile : public FileInterface {
 public:
  HdfsFile(const std::string& name);
  virtual ~HdfsFile();

  static void init();        // initialize hdfs subsystem
  bool openRead();           // open for reading file
  bool openWrite();          // open for appending to file
  bool openTruncate();       // truncate and open for write
  bool isOpen();             // is file open?
  void close();
  bool write(const std::string& data);
  void flush();
  unsigned long fileSize();
  long readNext(std::string& _return);
  void deleteFile();
  void listImpl(const std::string& path, std::vector<std::string>& _return);
  std::string getFrame(unsigned data_size);
  bool createDirectory(std::string path);
  bool createSymlink(std::string newpath, std::string oldpath);

 private:
  char* inputBuffer_;
  unsigned bufferSize_;
  hdfsFS fileSys;
  hdfsFile hfile;
  hdfsFS connectToPath(const char* uri);
  bool writeHelper(const std::string& data); // Actually write data.

#ifdef LZO_STREAMING
  /* Streaming LZO write support */
  void setShouldLZOCompress(int compressionLevel);
  bool LZOStringAppendChar(std::string&str, int x);
  bool LZOStringAppendInt16(std::string&str, unsigned x);
  bool LZOStringAppendInt32(std::string&str, lzo_uint x);
  const std::string LZOCompress(const std::string& data, bool force, bool *success);
  lzo_uint32 lzo_checksum;
  std::string LZObacklogBuffer;
#endif

  // disallow copy, assignment, and empty construction
  HdfsFile();
  HdfsFile(HdfsFile& rhs);
  HdfsFile& operator=(HdfsFile& rhs);
};

/**
 * A static lock
 */
class HdfsLock {
  private:
    static bool lockInitialized;

  public:
    static pthread_mutex_t lock;
    static bool initLock() {
      pthread_mutex_init(&lock, NULL);
      return true;
    }
};

#else

class HdfsFile : public FileInterface {
 public:
  HdfsFile(const std::string& name) : FileInterface(name, false) {
    LOG_OPER("[hdfs] ERROR: HDFS is not supported.  file: %s", name.c_str());
    LOG_OPER("[hdfs] If you want HDFS Support, please recompile scribe with HDFS support");
  }
  static void init() {};
  bool openRead() { return false; };           // open for reading file
  bool openWrite(){ return false; };           // open for appending to file
  bool openTruncate() { return false; }        // open for write and truncate
  bool isOpen()   { return false; };           // is file open?
  void close()    {};
  bool write(const std::string& data) { return false; };
  void flush()    {};
  void sync()     {};
  unsigned long fileSize() { return 0; };
  long readNext(std::string& _return) { return false; };
  void deleteFile() {};
  void listImpl(const std::string& path, std::vector<std::string>& _return) {};
  std::string getFrame(unsigned data_size) { return 0; };
  bool createDirectory(std::string path) { return false; };
  bool createSymlink(std::string newpath, std::string oldpath) { return false; };
};
#endif // USE_SCRIBE_HDFS

#endif // HDFS_FILE_H


text:
package com.bizosys.hsearch.dictionary;

import java.util.ArrayList;
import java.util.List;

import com.bizosys.hsearch.filter.Storable;
import com.bizosys.hsearch.hbase.IScanCallBack;

public class DictionaryBook implements IScanCallBack {
	private List<String> lines = new ArrayList<String>();

	private int cursor = 0;
	private int WORDS_IN_A_LINE = 0;
	private char WORD_SEPARATOR = ' ';
	private int keyPrefixLen = 0;

	public StringBuilder aLine = new StringBuilder(4096);

	public DictionaryBook(int maxWordsInALine, char wordSeparator, String keyPrefix) {
		this.WORDS_IN_A_LINE = maxWordsInALine;
		this.WORD_SEPARATOR = wordSeparator;
		if ( null != keyPrefix) {
			this.keyPrefixLen = keyPrefix.length();
		}
	}

	public void process(byte[] storedBytes) {
		String word = Storable.getString(storedBytes);

		if ( cursor < WORDS_IN_A_LINE) {
			if ( cursor != 0) aLine.append(WORD_SEPARATOR);

			if ( this.keyPrefixLen > 0) aLine.append(word.substring(this.keyPrefixLen));
			else aLine.append(word);

			cursor++;
		} else {
			this.lines.add(aLine.toString());
			aLine.delete(0, aLine.capacity());
			cursor = 0;
		}
	}

	/**
	 * Push the last remaining words to the last line
	 * @return
	 */
	public List<String> getLines() {
		String lastLine = aLine.toString();
		aLine.delete(0, aLine.capacity());
		this.lines.add(lastLine);
		return this.lines;
	}
}

redpajama_set_name: RedPajamaGithub


text:
@interface ViewController : UIViewController

@property (strong, nonatomic) IBOutletCollection(UIView) NSArray *views;

@property (strong, nonatomic) NSMutableArray *centers;

@end


text:
FROM ubuntu:trusty
MAINTAINER 2GIS

ENV DEBIAN_FRONTEND=noninteractive \
    CONFD_OPTS='-interval 10 -node 172.17.42.1:4001' \
    CONFD_VERSION=0.10.0 \
    TERM=xterm \
    SVDIR=/etc/service \
    DGIS_OPENSTACK_SCRIPTS_PATH='/opt/2gis/openstack'

RUN apt-get update && \
    apt-get install -y --no-install-recommends software-properties-common && \
    add-apt-repository cloud-archive:kilo && \
    apt-get update && \
    apt-get install -y \
        curl \
        git \
        runit \
        ca-certificates \
        python-keystoneclient \
        python-openstackclient \
        mariadb-client \
        python-mysqldb \
        python-psycopg2 && \
    apt-get clean

RUN curl -sSL https://github.com/kelseyhightower/confd/releases/download/v${CONFD_VERSION}/confd-${CONFD_VERSION}-linux-amd64 \
        -o /usr/local/bin/confd && \
    chmod +x /usr/local/bin/confd

RUN curl -sSL https://raw.githubusercontent.com/phusion/baseimage-docker/master/image/bin/my_init \
        -o /sbin/my_init && \
    chmod +x /sbin/my_init

ADD root/ /

ENTRYPOINT ["/sbin/my_init"]


text:
[![Build Status](https://travis-ci.org/libgdx/gdx-pay.svg?branch=master)](https://travis-ci.org/libgdx/gdx-pay)
[![Maven Central](http://maven-badges.herokuapp.com/maven-central/com.badlogicgames.gdxpay/gdx-pay/badge.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.badlogicgames.gdxpay%22)
[![Dependency Status](https://dependencyci.com/github/libgdx/gdx-pay/badge)](https://dependencyci.com/github/libgdx/gdx-pay)

This project aims to provide a **cross-platform API for InApp purchasing**.
The gdx-pay project is a libGDX extension. Current release version is 0.11.2. Please use at least libGDX v1.9.6, Robovm 2.3.2 or multi-os-engine v1.3.8.

### Getting Started

The purchasing API comes in two parts.

* **Client-Side API**: This is what is integrated into your game or application and will handle the
purchase flow for the application.

* **Server-Side API (optional)**: If you have a server running and would like to do a purchase verification
on your server, you can use the API to verify purchases sent to your server.

The recommended way to use gdx-pay is via dependency management with Gradle or Maven. Artifacts are available in [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.badlogicgames.gdxpay%22). [Guide for using gdx-pay with Maven](https://github.com/libgdx/gdx-pay/wiki/Maven-Integration).

#### Client-Side API

Dependency can be configured using Gradle or by manually downloading the dependencies.

**Configure dependencies using Gradle**

*project-root/build.gradle:*

    ext {
        gdxPayVersion = '0.11.2'
    }

*core:*

    dependencies {
        compile "com.badlogicgames.gdxpay:gdx-pay-client:$gdxPayVersion"
    }

*android:*

    dependencies {
        compile "com.badlogicgames.gdxpay:gdx-pay-android:$gdxPayVersion"
        compile "com.badlogicgames.gdxpay:gdx-pay-android-googleplay:${gdxPayVersion}@aar"
    }

*ios-robovm:*

    dependencies {
        compile "com.badlogicgames.gdxpay:gdx-pay-iosrobovm-apple:$gdxPayVersion"
    }

*ios-moe:*

    dependencies {
        compile "com.badlogicgames.gdxpay:gdx-pay-iosmoe-apple:$gdxPayVersion"
    }

**Configure dependencies manually**

*core:*
* [gdx-pay.jar](https://oss.sonatype.org/content/repositories/releases/com/badlogicgames/gdxpay/gdx-pay/0.11.2/gdx-pay-0.11.2-library.jar)
* [gdx-pay-client.jar](https://oss.sonatype.org/content/repositories/releases/com/badlogicgames/gdxpay/gdx-pay-client/0.11.2/gdx-pay-client-0.11.2-library.jar)

*android:*
* [gdx-pay-android.jar](https://oss.sonatype.org/content/repositories/releases/com/badlogicgames/gdxpay/gdx-pay-android/0.11.2/gdx-pay-android-0.11.2-library.jar)
* [gdx-pay-android-googleplay.jar](https://oss.sonatype.org/content/repositories/releases/com/badlogicgames/gdxpay/gdx-pay-android-googleplay/0.11.2/gdx-pay-android-googleplay-0.11.2.jar) ( for Google Play with non-consumable products only, exclude this artifact when using other product types. [See status](gdx-pay-android-googleplay/README.md))
* [gdx-pay-android-openiab.jar](https://oss.sonatype.org/content/repositories/releases/com/badlogicgames/gdxpay/gdx-pay-android-openiab/0.11.2/gdx-pay-android-openiab-0.11.2-library.jar) (to support GooglePlay, Amazon etc. [This component is deprecated!](gdx-pay-android-openiab/README.md) Do not use if you are using gdx-pay-android-googleplay.jar, they are mutually exclusive.))
* [gdx-pay-android-ouya.jar](https://oss.sonatype.org/content/repositories/releases/com/badlogicgames/gdxpay/gdx-pay-android-ouya/0.11.2/gdx-pay-android-ouya-0.11.2-library.jar) (to support OUYA)

*iOS RoboVM:*
* [gdx-pay-iosrobovm-apple.jar](https://oss.sonatype.org/content/repositories/releases/com/badlogicgames/gdxpay/gdx-pay-iosrobovm-apple/0.11.2/gdx-pay-iosrobovm-apple-0.11.2-library.jar)

*iOS MOE:*
* [gdx-pay-iosmoe-apple.jar](https://oss.sonatype.org/content/repositories/releases/com/badlogicgames/gdxpay/gdx-pay-iosmoe-apple/0.11.2/gdx-pay-iosmoe-apple-0.11.2-library.jar)

*Desktop:*
* [gdx-pay-desktop-apple.jar](https://oss.sonatype.org/content/repositories/releases/com/badlogicgames/gdxpay/gdx-pay-desktop-apple/0.11.2/gdx-pay-desktop-apple-0.11.2-library.jar) (to support the Mac App Store): *needs implementation/volunteers wanted!*

*GWT:*
* [gdx-pay-gwt-googlewallet.jar](https://oss.sonatype.org/content/repositories/releases/com/badlogicgames/gdxpay/gdx-pay-gwt-googlewallet/0.11.2/gdx-pay-gwt-googlewallet-0.11.2-library.jar) (to support Google Wallet): *needs implementation/volunteers wanted!*

**Gdx-Pay configuration**

*iOS:*
* robovm.xml: add `<pattern>com.badlogic.gdx.pay.ios.apple.PurchaseManageriOSApple</pattern>` inside `<forceLinkClasses>...</forceLinkClasses>`.

*android:*

* AndroidManifest.xml:
```
<!--all-->
<uses-permission android:name="android.permission.INTERNET"/>
<!--Google Play-->
<uses-permission android:name="com.android.vending.BILLING"/>
<!--Open Store-->
<uses-permission android:name="org.onepf.openiab.permission.BILLING"/>
<!--Samsung Apps-->
<uses-permission android:name="com.sec.android.iap.permission.BILLING"/>
<!--Nokia-->
<uses-permission android:name="com.nokia.payment.BILLING"/>
<!--SlideME-->
<uses-permission android:name="com.slideme.sam.manager.inapp.permission.BILLING"/>
```
* proguard.cfg:
```
-keep class com.android.vending.billing.**
-keep class com.amazon.** {*;}
-keep class com.sec.android.iap.**
-keep class com.nokia.payment.iap.aidl.**
-keep class com.badlogic.gdx.pay.android.** { *; }
-dontwarn org.onepf.oms.appstore.FortumoBillingService
```

*core:*
In any case, if the correct jar files are place, all you need is to initialize the purchase system in your
core project as follows.

```
...
// Disposes static instances in case JVM is re-used on restarts
PurchaseSystem.onAppRestarted();

//If gdx-pay is called too early, a manager may not be registered which would be ONE of the reasons for hasManager to return false
if (PurchaseSystem.hasManager()) {

  // purchase system is ready to start. Let's initialize our product list etc...
  PurchaseManagerConfig config = new PurchaseManagerConfig();
  //add items that can be purchased in the store, they must be listed before being purchased.
  config.addOffer(new Offer().setType(OfferType.ENTITLEMENT).setIdentifier("ExamplePurchase"));
  config.addOffer(new Offer().setType(OfferType.CONSUMABLE).setIdentifier("ExampleConsumablePurchase"));
  ...
  //add any stores you are planning on using (Note, IOS_APPLE doesn't actually have an encoded key so pass any string as the second parameter)
  config.addStoreParam(PurchaseManagerConfig.STORE_NAME_ANDROID_GOOGLE, "<Google key>");

  config.addStoreParam(PurchaseManagerConfig.STORE_NAME_ANDROID_OUYA, new Object[] {
    OUYA_DEVELOPER_ID,
    KEYPATH
  });
  ...

  // let's start the purchase system...
  PurchaseSystem.install(new PurchaseObserver() {
   ...
   //implement all needed methods.  Check for purchases in handleRestore and handlePurchase using the transactions argument. // e.g:  if(transactions[i].getIdentifier().equals("ExamplePurchase"))
  }, config);
  ...

  // to make a purchase (results are reported to the observer)
  PurchaseSystem.purchase("product_identifier");
  ...

  // (*) to restore existing purchases (results are reported to the observer)
  PurchaseSystem.restore();
  ...

  // obtain localized product information (not supported by all platforms)
  Information information = PurchaseSystem.getInformation("product_identifier");
  ...
}
...
```

`(*)` IMPORTANT: `PurchaseSystem.restore()' should *not be called directly* by your application. Restoring purchases shall only be
called when a user explicitly requests it. In your application add a [Restore Purchases] button which in turn will call this method.
This is a requirement by Apple iOS. If you don't provide a button for purchase restores your application will be rejected! You have
been warned :)

Please note: Gdx-Pay does not work on android emulators at all and will run on apple emulators but they will not be able to complete any purchases.

For keys you have to pass in have a look at [OpenIAB's Sample Configuration](https://github.com/onepf/OpenIAB/blob/dev/samples/trivialdrive/src/main/java/org/onepf/sample/trivialdrive/InAppConfig.java).
Please note you will not need to pass in any keys for Amazon as it doesn't require them.

Here is a user-guide in the wiki on how to implement gdx-pay in your libgdx project with using platform resolvers:
 [Integration-example-with-resolvers](https://github.com/libgdx/gdx-pay/wiki/Integration-example-with-resolvers)

The gdx-pay-android-googleplay implementation supports cancellation of test purchases:

    PurchaseManager mananager = PurchaseSystem.getManager();
    if (manager instanceof PurchaseManagerTestSupport) {
        ((PurchaseManagerTestSupport) manager).cancelTestPurchases();
    }

#### Server-Side API (Optional)

**gdx-pay-server** is optional and can be used for purchase **verification on a server**. It verifies if a
purchase is valid by e.g. doing a post-back validation on a server.
Place the following two jar-files onto your server (you won't need any other libGDX
libraries on your server, all dependencies to libGDX have been removed for easy integration):

* [gdx-pay.jar](https://oss.sonatype.org/content/repositories/releases/com/badlogicgames/gdxpay/gdx-pay/0.11.2/gdx-pay-0.11.2-library.jar)
* [gdx-pay-server.jar](https://oss.sonatype.org/content/repositories/releases/com/badlogicgames/gdxpay/gdx-pay-server/0.11.2/gdx-pay-server-0.11.2-library.jar)

How to integrate in your server:
```
 // create a manager which returns "true" by default
 PurchaseVerifierManager verifier = new PurchaseVerifierManager(true);

 // add the various purchase verifiers
 verifier.addVerifier(new PurchaseVerifierAndroidGoogle(...));
 verifier.addVerifier(new PurchaseVerifierAndroidAmazon(...));
 verifier.addVerifier(new PurchaseVerifierAndroidOUYA(...));
 verifier.addVerifier(new PurchaseVerifieriOSApple(...));
 ...

 // verify a purchase
 if (verifier.isValid(transaction)) {
   // transaction appears valid
   ... add to BD etc. ...
 }
 else {
   // transaction appears bogus
   ... punish user ...
 }
 ```

Please note that the server-side functionality hasn't been fully developed yet as of this writing.
**PurchaseVerifieriOSApple** is somewhat rudimentary implemented and will need some more work. There is a main(...)
method in that fail if you want to run/test it :)

### Release History

Release history for major milestones (available via Maven):
* 0.11.2: Bugfix release for #157 (MOE iOS 9), #158 (Robovm GC issue)
* 0.11.1: Copy currency-code from iOS backend to Information (Robovm and MOE)
* 0.11.0: Support for Multi-OS-Engine, update Robovm to 2.3.0, support more than 20 skus on Android
* 0.10.3: Bugfix release for issue #118 #120 #122
* Version 0.10.2: Bugfix release for issue #117
* Version 0.10.1: Bugfix release for issue #113
* Version 0.10.0: Bugfix release for issue #110
* Version 0.9.2: Bugfix release for issue #91
* Version 0.9.1: Bugfix release for issue #88
* Version 0.9.0: New [Google Play Store implementation](gdx-pay-android-googleplay/README.md), no longer depends on OpenIAB (2016-02-06)
* Version 0.8.0: bugfix release (2015-12-16)
* Version 0.7.0: lastest updates/bugfixes integrated (2015-12-10)
* Version 0.6.0: iOS 9 support, bug fixes
* Version 0.5.0: Bugfixes for OpenIAB/Apple backends especially (2015-03-18)
* Version 0.3.0: Minor Updates and Bugfixes (2015-01-27)
* Version 0.2.0: iOS Added
* Version 0.1.0: Initial Release

### News & Community

Check the [libGDX blog](http://www.badlogicgames.com/) for news and updates.
You can get help on the [libGDX forum](http://www.badlogicgames.com/forum/) and talk to other users on the IRC channel #libgdx at irc.freenode.net.

### Reporting Issues

Something not working quite as expected? Do you need a feature that has not been implemented yet? Check the [issue tracker](https://github.com/libgdx/gdx-pay/issues) and add a new one if your problem is not already listed. Please try to provide a detailed description of your problem, including the steps to reproduce it.

### Using gdx-pay locally build binaries in a project

When Gradle is used to manage dependencies, gdx-pay locally build SNAPSHOT binaries can be used via the Maven local repository.

#### Install gdx-pay binaries in local Maven repository

Build gdx-pay with the following command:
`./gradlew assemble uploadArchives -PLOCAL`

#### Use Maven local SNAPSHOT version in a project

1: add `mavenLocal()` as Gradle repository in the root `build.gradle`

    allprojects {
        repositories {
           mavenLocal()
        }
    }

2: change the version of gdx-pay dependencies to the `version` variable value found in gdx-pay/build.gradle

### Contributing

Awesome! If you would like to contribute with a new feature or a bugfix, [fork this repo](https://help.github.com/articles/fork-a-repo) and [submit a pull request](https://help.github.com/articles/using-pull-requests).
Also, before we can accept substantial code contributions, we need you to sign the [libGDX Contributor License Agreement](https://github.com/libgdx/libgdx/wiki/Contributing#contributor-license-agreement).

### License

The gdx-pay project is licensed under the [Apache 2 License](https://github.com/libgdx/gdx-pay/blob/master/LICENSE), meaning you can use it free of charge, without strings attached in commercial and non-commercial projects. We love to get (non-mandatory) credit in case you release a game or app using gdx-pay!


text:
@media only print {
  .no-print {
    display: none !important;
  }
}

@media only screen {
  .only-print {
    display: none !important;
  }
}

code {
  counter-reset: line;
}

.code-line {
  counter-increment: line;
  position: relative;
  display: block;
  margin-left: 2.5em;
  padding-left: 1em;
  border-left: 1px solid transparent;
}

.code-line:before {
  content: '  ' counter(line);
  position: absolute;
  margin-left: -3.5em;
  color: #212529;
}

.code-line:nth-child(n + 10):before {
  content: ' ' counter(line);
}

.code-line:nth-child(n + 100):before {
  content: counter(line);
}

.code-line-vertical {
  counter-increment: line;
  position: relative;
  display: block;
  margin-left: 2.5em;
  padding-left: 1em;
  border-left: 1px solid #212529;
}

.code-line-vertical:before {
  content: '  ' counter(line);
  position: absolute;
  margin-left: -3.5em;
  color: #212529;
}

.code-line-vertical:nth-child(n + 10):before {
  content: ' ' counter(line);
}

.code-line-vertical:nth-child(n + 100):before {
  content: counter(line);
}


text:
===========
keep_source
===========

    | type: **Boolean**
    | default: **false**

By default, Galleria clears the source container when rendering the gallery.
Sometimes you need to apply the gallery some place else, like a lightbox, but still want to keep the thumbnails in the source.

This option sets if the source HTML should be left intact.
Setting this to ``true`` will also add click events inside the source code, to make your thumbnails clickable.

Useful for building custom thumbnails and still have galleria control the gallery.

Example of placing the Galleria gallery outside the source and keep the thumbnails:
...................................................................................

::