text:
'use strict';
var FileModel = require('./../models/file.model');

module.exports = function (dropboxClient) {

  return {
    getFiles: function (request, response) {

      FileModel.find({}, function (error, files) {
        if (error) {
          response.json(error);
        }

        response.json(files);
      });
    },

    getFile: function (request, response) {

      var path = request.params.path;
      FileModel.findOne({path: path}, function (error, file) {

        if (error) {
          response.json(error);
        }

        response.json(file);
      });
    },

    createFile: function (request, response) {

      var file = request.files.fileName;
      var options = {
        noOverwrite: true
      };

      dropboxClient.writeFile('/' + file.originalname, file.buffer, options, function (error, fileStat) {
        if (error) {
          response.json(error);
        }

        var shareOptions = {
          downloadHack: true
        };

        dropboxClient.makeUrl(fileStat.path, shareOptions, function (error, shareUrl) {
          if (error) {
            response.json(error);
          }

          FileModel.create({
            downloadUrl: shareUrl.url,
            modified: fileStat.modified,
            size: fileStat.size,
            is_dir: fileStat.is_dir,
            path: fileStat.path
          }, function (err, file) {
            if (err) {
              response.json(err);
            }

            response.json({
              message: 'File created successfully.',
              data: file
            });
          });
        });
      });
    },

    updateFile: function (request, response) {

      var file = request.files.fileName;
      var path = '/' + request.params.path;
      var options = {
        noOverwrite: false
      };

      dropboxClient.writeFile(path, file.buffer, options, function (error, fileStat) {
        if (error) {
          response.json(error);
        }

        var shareOptions = {
          downloadHack: true
        };

        dropboxClient.makeUrl(fileStat.path, shareOptions, function (error, shareUrl) {
          if (error) {
            response.json(error);
          }

          FileModel.findOneAndUpdate({
            path: path
          }, {
            downloadUrl: shareUrl.url,
            modified: fileStat.modified,
            size: fileStat.size,
            is_dir: fileStat.is_dir,
            path: fileStat.path
          },
          function (err, file) {
            if (err) {
              response.json(err);
            }

            response.json({
              message: 'File updated successfully.',
              data: file
            });
          });
        });
      });

    },

    deleteFile: function (request, response) {

      var path = '/' + request.params.path;

      dropboxClient.remove(path, function (error, fileStat) {
        if (error) {
          response.json(error);
        }

        FileModel.remove({path: path}, function (err) {
          if (err) {
            response.json(err);
          }

          response.json({
            message: 'File deleted successfully.'
          });
        });
      });
    }
  };
};


text:
/*
  Include declarations.
*/
#include "magick/studio.h"
#include "magick/attribute.h"
#include "magick/blob.h"
#include "magick/blob-private.h"
#include "magick/cache.h"
#include "magick/color-private.h"
#include "magick/colormap.h"
#include "magick/colorspace.h"
#include "magick/colorspace-private.h"
#include "magick/exception.h"
#include "magick/exception-private.h"
#include "magick/image.h"
#include "magick/image-private.h"
#include "magick/list.h"
#include "magick/magick.h"
#include "magick/memory_.h"
#include "magick/monitor.h"
#include "magick/monitor-private.h"
#include "magick/pixel-accessor.h"
#include "magick/quantum-private.h"
#include "magick/static.h"
#include "magick/string_.h"
#include "magick/module.h"
#include "magick/utility.h"

/*
  Forward declarations.
*/
static MagickBooleanType
  WriteRGFImage(const ImageInfo *,Image *,ExceptionInfo *);

/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
%                                                                             %
%                                                                             %
%   R e a d X B M I m a g e                                                   %
%                                                                             %
%                                                                             %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  ReadRGFImage() reads an RGF bitmap image file and returns it.  It
%  allocates the memory necessary for the new Image structure and returns a
%  pointer to the new image.
%
%  The format of the ReadRGFImage method is:
%
%      Image *ReadRGFImage(const ImageInfo *image_info,ExceptionInfo *exception)
%
%  A description of each parameter follows:
%
%    o image_info: the image info.
%
%    o exception: return any errors or warnings in this structure.
%
*/
static Image *ReadRGFImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
  Image
    *image;

  MagickBooleanType
    status;

  register IndexPacket
    *indexes;

  register PixelPacket
    *q;

  register ssize_t
    i,
    x;

  register unsigned char
    *p;

  size_t
    bit,
    byte;

  ssize_t
    y;

  unsigned char
    *data;

  /*
    Open image file.
  */
  assert(image_info != (const ImageInfo *) NULL);
  assert(image_info->signature == MagickSignature);
  if (image_info->debug != MagickFalse)
    (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
      image_info->filename);
  assert(exception != (ExceptionInfo *) NULL);
  assert(exception->signature == MagickSignature);
  image=AcquireImage(image_info);
  status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
  if (status == MagickFalse)
    {
      image=DestroyImageList(image);
      return((Image *) NULL);
    }
  /*
    Read RGF header.
  */
  image->columns = (unsigned long) ReadBlobByte(image);
  image->rows = (unsigned long) ReadBlobByte(image);
  image->depth=8;
  image->storage_class=PseudoClass;
  image->colors=2;
  /*
    Initialize image structure.
  */
  if (AcquireImageColormap(image,image->colors) == MagickFalse)
    ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
  /*
    Initialize colormap.
  */
  image->colormap[0].red=QuantumRange;
  image->colormap[0].green=QuantumRange;
  image->colormap[0].blue=QuantumRange;
  image->colormap[1].red=(Quantum) 0;
  image->colormap[1].green=(Quantum) 0;
  image->colormap[1].blue=(Quantum) 0;
  if (image_info->ping != MagickFalse)
    {
      (void) CloseBlob(image);
      return(GetFirstImageInList(image));
    }

  /*
    Read hex image data.
  */
  data=(unsigned char *) AcquireQuantumMemory(image->rows,image->columns*
    sizeof(*data));
  if (data == (unsigned char *) NULL)
    ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
  p=data;
  for (i=0; i < (ssize_t) (image->columns * image->rows); i++)
    {
      *p++=ReadBlobByte(image);
    }

  /*
    Convert RGF image to pixel packets.
  */
  p=data;
  for (y=0; y < (ssize_t) image->rows; y++)
  {
    q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
    if (q == (PixelPacket *) NULL)
      break;
    indexes=GetAuthenticIndexQueue(image);
    bit=0;
    byte=0;
    for (x=0; x < (ssize_t) image->columns; x++)
    {
      if (bit == 0)
        byte=(size_t) (*p++);
      SetPixelIndex(indexes+x,(Quantum) ((byte & 0x01) != 0 ? 0x01 : 0x00));
      bit++;
      byte>>=1;
      if (bit == 8)
        bit=0;
    }
    if (SyncAuthenticPixels(image,exception) == MagickFalse)
      break;
    status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y,
      image->rows);
    if (status == MagickFalse)
      break;
  }
  data=(unsigned char *) RelinquishMagickMemory(data);
  (void) SyncImage(image);
  (void) CloseBlob(image);
  return(GetFirstImageInList(image));
}

/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
%                                                                             %
%                                                                             %
%   R e g i s t e r R G F I m a g e                                           %
%                                                                             %
%                                                                             %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  RegisterRGFImage() adds attributes for the RGF image format to
%  the list of supported formats.  The attributes include the image format
%  tag, a method to read and/or write the format, whether the format
%  supports the saving of more than one frame to the same file or blob,
%  whether the format supports native in-memory I/O, and a brief
%  description of the format.
%
%  The format of the RegisterRGFImage method is:
%
%      size_t RegisterRGFImage(void)
%
*/
ModuleExport size_t RegisterRGFImage(void)
{
  MagickInfo
    *entry;

  entry=SetMagickInfo("RGF");
  entry->decoder=(DecodeImageHandler *) ReadRGFImage;
  entry->encoder=(EncodeImageHandler *) WriteRGFImage;
  entry->adjoin=MagickFalse;
  entry->description=ConstantString(
    "LEGO Mindstorms EV3 Robot Graphic Format (black and white)");
  entry->module=ConstantString("RGF");
  (void) RegisterMagickInfo(entry);
  return(MagickImageCoderSignature);
}

/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
%                                                                             %
%                                                                             %
%   U n r e g i s t e r R G F I m a g e                                       %
%                                                                             %
%                                                                             %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  UnregisterRGFImage() removes format registrations made by the
%  RGF module from the list of supported formats.
%
%  The format of the UnregisterRGFImage method is:
%
%      UnregisterRGFImage(void)
%
*/
ModuleExport void UnregisterRGFImage(void)
{
  (void) UnregisterMagickInfo("RGF");
}

/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
%                                                                             %
%                                                                             %
%   W r i t e R G F I m a g e                                                 %
%                                                                             %
%                                                                             %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  WriteRGFImage() writes an image to a file in the X bitmap format.
%
%  The format of the WriteRGFImage method is:
%
%      MagickBooleanType WriteRGFImage(const ImageInfo *image_info,
%        Image *image,ExceptionInfo *exception)
%
%  A description of each parameter follows.
%
%    o image_info: the image info.
%
%    o image:  The image.
%
%    o exception: return any errors or warnings in this structure.
%
*/
static MagickBooleanType WriteRGFImage(const ImageInfo *image_info,Image *image,
  ExceptionInfo *exception)
{
  MagickBooleanType
    status;

  register const PixelPacket
    *p;

  register ssize_t
    x;

  size_t
    bit,
    byte;

  ssize_t
    y;

  /*
    Open output image file.
  */
  assert(image_info != (const ImageInfo *) NULL);
  assert(image_info->signature == MagickSignature);
  assert(image != (Image *) NULL);
  assert(image->signature == MagickSignature);
  if (image->debug != MagickFalse)
    (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
  assert(exception != (ExceptionInfo *) NULL);
  assert(exception->signature == MagickSignature);
  status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
  if (status == MagickFalse)
    return(status);
  if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
    (void) TransformImageColorspace(image,sRGBColorspace);
  if((image->columns > 255L) || (image->rows > 255L))
    ThrowWriterException(ImageError,"Dimensions must be less than 255x255");

  /*
    Write header (just the image dimensions)
   */
  (void) WriteBlobByte(image,image->columns & 0xff);
  (void) WriteBlobByte(image,image->rows & 0xff);

  /*
    Convert MIFF to bit pixels.
  */
  (void) SetImageType(image,BilevelType);
  x=0;
  y=0;
  for (y=0; y < (ssize_t) image->rows; y++)
  {
    p=GetVirtualPixels(image,0,y,image->columns,1,exception);
    if (p == (const PixelPacket *) NULL)
      break;
    bit=0;
    byte=0;
    for (x=0; x < (ssize_t) image->columns; x++)
    {
      byte>>=1;
      if (GetPixelLuma(image,p) < (QuantumRange/2))
        byte|=0x80;
      bit++;
      if (bit == 8)
        {
          /*
            Write a bitmap byte to the image file.
          */
       	  (void) WriteBlobByte(image,byte);
          bit=0;
          byte=0;
        }
      p++;
    }
    if (bit != 0)
      (void) WriteBlobByte(image,byte);
    status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y,
      image->rows);
    if (status == MagickFalse)
      break;
  }
  (void) CloseBlob(image);
  return(MagickTrue);
}

redpajama_set_name: RedPajamaGithub


text:
class AuthenticationFailure < Devise::FailureApp
  include JsonResponse
  def respond
    if http_auth?
      http_auth
    else
      json_failure
    end
  end

  def json_failure
    result = ErrorResponse.new({ status: 'error', message: 'Authentication Error' })
    response = ErrorResponseSerializer.new(result).as_json.to_s

    self.content_type = 'application/json'
    self.response_body = response
  end
end


text:
#include <ctime>

#include <folly/portability/GTest.h>
#include <folly/ssl/OpenSSLPtrTypes.h>

using namespace folly;
using namespace folly::ssl;
using namespace testing;

TEST(OpenSSLPortabilityTest, TestRSASetter) {
  RsaUniquePtr r(RSA_new());
  BIGNUM* n = BN_new();
  BIGNUM* e = BN_new();
  BIGNUM* d = BN_new();
  BIGNUM* n_actual;
  BIGNUM* e_actual;
  BIGNUM* d_actual;
  EXPECT_TRUE(BN_set_bit(n, 1));
  EXPECT_TRUE(BN_set_bit(e, 3));
  EXPECT_TRUE(BN_set_bit(d, 2));
  RSA_set0_key(r.get(), n, e, d);
  RSA_get0_key(
      r.get(),
      (const BIGNUM**)&n_actual,
      (const BIGNUM**)&e_actual,
      (const BIGNUM**)&d_actual);
  // BN_cmp returns 0 if the two BIGNUMs are equal
  EXPECT_FALSE(BN_cmp(n, n_actual));
  EXPECT_FALSE(BN_cmp(e, e_actual));
  EXPECT_FALSE(BN_cmp(d, d_actual));

  RsaUniquePtr public_key(RSA_new());
  BIGNUM* n_public = BN_new();
  BIGNUM* e_public = BN_new();
  EXPECT_TRUE(BN_set_bit(n_public, 1));
  EXPECT_TRUE(BN_set_bit(e_public, 3));
  RSA_set0_key(public_key.get(), n_public, e_public, nullptr);
  BIGNUM* n_public_actual;
  BIGNUM* e_public_actual;
  RSA_get0_key(
      public_key.get(),
      (const BIGNUM**)&n_public_actual,
      (const BIGNUM**)&e_public_actual,
      nullptr);
  EXPECT_FALSE(BN_cmp(n_public, n_public_actual));
  EXPECT_FALSE(BN_cmp(e_public, e_public_actual));
}

TEST(OpenSSLPortabilityTest, TestEcdsaSigPortability) {
  EcdsaSigUniquePtr ecdsa(ECDSA_SIG_new());
  BIGNUM* r = BN_new();
  BIGNUM* s = BN_new();
  BIGNUM* r_actual;
  BIGNUM* s_actual;
  EXPECT_TRUE(BN_set_bit(r, 1));
  EXPECT_TRUE(BN_set_bit(s, 2));
  EXPECT_TRUE(ECDSA_SIG_set0(ecdsa.get(), r, s));
  ECDSA_SIG_get0(
      ecdsa.get(), (const BIGNUM**)&r_actual, (const BIGNUM**)&s_actual);
  // BN_cmp returns 0 if the two BIGNUMs are equal
  EXPECT_FALSE(BN_cmp(r, r_actual));
  EXPECT_FALSE(BN_cmp(s, s_actual));
}

TEST(OpenSSLPortabilityTest, TestX509RevokedApi) {
  X509_REVOKED* rev = X509_REVOKED_new();

  ASN1_INTEGER* serial = ASN1_INTEGER_new();
  ASN1_INTEGER_set(serial, 1234L);

  ASN1_TIME* revocation_date = ASN1_TIME_new();
  time_t t = time(nullptr);
  ASN1_TIME_set(revocation_date, t);

  X509_REVOKED_set_serialNumber(rev, serial);
  X509_REVOKED_set_revocationDate(rev, revocation_date);

  const ASN1_INTEGER* retrieved_serial = X509_REVOKED_get0_serialNumber(rev);
  const ASN1_TIME* retrieved_date = X509_REVOKED_get0_revocationDate(rev);

  EXPECT_EQ(0, ASN1_INTEGER_cmp(serial, retrieved_serial));

#if FOLLY_HAVE_OPENSSL_ASN1_TIME_DIFF
  int diff_days;
  int diff_secs;
  ASN1_TIME_diff(&diff_days, &diff_secs, revocation_date, retrieved_date);
  EXPECT_EQ(0, diff_days);
  EXPECT_EQ(0, diff_secs);
#else
  (void)revocation_date;
  (void)retrieved_date;
#endif

  ASN1_INTEGER_free(serial);
  ASN1_TIME_free(revocation_date);
  X509_REVOKED_free(rev);
}


text: Owo phone embedded


text:
package com.gooddata.model;

import com.gooddata.AbstractService;
import com.gooddata.FutureResult;
import com.gooddata.GoodDataSettings;
import com.gooddata.PollResult;
import com.gooddata.GoodDataRestException;
import com.gooddata.AbstractPollHandlerBase;
import com.gooddata.SimplePollHandler;
import com.gooddata.gdc.AsyncTask;
import com.gooddata.gdc.TaskStatus;
import com.gooddata.project.Project;
import org.springframework.http.client.ClientHttpResponse;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestTemplate;

import java.io.IOException;
import java.io.Reader;
import java.util.Collection;
import java.util.LinkedList;

import static com.gooddata.util.Validate.noNullElements;
import static com.gooddata.util.Validate.notNull;
import static com.gooddata.model.ModelDiff.UpdateScript;
import static java.util.Arrays.asList;

/**
 * Service for manipulating with project model
 */
public class ModelService extends AbstractService {

    public ModelService(final RestTemplate restTemplate, final GoodDataSettings settings) {
        super(restTemplate, settings);
    }

    /**
     * @deprecated use ModelService(RestTemplate, GoodDataSettings) constructor instead
     */
    @Deprecated
    public ModelService(final RestTemplate restTemplate) {
        super(restTemplate);
    }

    private FutureResult<ModelDiff> getProjectModelDiff(Project project, DiffRequest diffRequest) {
        notNull(project, "project");
        notNull(project.getId(), "project.id");
        notNull(diffRequest, "diffRequest");
        try {
            final AsyncTask asyncTask = restTemplate
                    .postForObject(DiffRequest.URI, diffRequest, AsyncTask.class, project.getId());
            return new PollResult<>(this, new SimplePollHandler<ModelDiff>(asyncTask.getUri(), ModelDiff.class) {
                @Override
                public void handlePollException(final GoodDataRestException e) {
                    throw new ModelException("Unable to get project model diff", e);
                }
            });
        } catch (GoodDataRestException | RestClientException e) {
            throw new ModelException("Unable to get project model diff", e);
        }
    }

    public FutureResult<ModelDiff> getProjectModelDiff(Project project, String targetModel) {
        notNull(project, "project");
        notNull(targetModel, "targetModel");
        return getProjectModelDiff(project, new DiffRequest(targetModel));
    }

    public FutureResult<ModelDiff> getProjectModelDiff(Project project, Reader targetModel) {
        notNull(project, "project");
        notNull(targetModel, "targetModel");
        try {
            return getProjectModelDiff(project, FileCopyUtils.copyToString(targetModel));
        } catch (IOException e) {
            throw new ModelException("Can't read target model", e);
        }
    }

    /**
     * Update project model with the MAQL script from given ModelDiff with the least side-effects
     * (see {@link ModelDiff#getUpdateMaql()}).
     *
     * @param project   project to be updated
     * @param modelDiff difference of model to be applied into the project
     * @return poll result
     */
    public FutureResult<Void> updateProjectModel(Project project, ModelDiff modelDiff) {
        notNull(modelDiff, "modelDiff");
        return updateProjectModel(project, modelDiff.getUpdateMaql());
    }

    /**
     * Update project model with the given update script (MAQL).
     *
     * @param project      project to be updated
     * @param updateScript update script to be executed in the project
     * @return poll result
     */
    public FutureResult<Void> updateProjectModel(Project project, UpdateScript updateScript) {
        notNull(updateScript, "updateScript");
        return updateProjectModel(project, updateScript.getMaqlChunks());
    }

    /**
     * Update project model with the given update script(s) (MAQL). For data manipulation use
     * {@link com.gooddata.model.ModelService#updateProjectModel}.
     *
     * @param project project to be updated
     * @param maqlDdl update script to be executed in the project
     * @return poll result
     *
     * @see com.gooddata.dataset.DatasetService#updateProjectData
     */
    public FutureResult<Void> updateProjectModel(final Project project, final String... maqlDdl) {
        return updateProjectModel(project, asList(maqlDdl));
    }

    /**
     * Update project model with the given update script(s) (MAQL).
     *
     * @param project project to be updated
     * @param maqlDdl update script to be executed in the project
     * @return poll result
     *
     * @see com.gooddata.dataset.DatasetService#updateProjectData
     */
    public FutureResult<Void> updateProjectModel(final Project project, final Collection<String> maqlDdl) {
        notNull(project, "project");
        notNull(project.getId(), "project.id");
        noNullElements(maqlDdl, "maqlDdl");
        if (maqlDdl.isEmpty()) {
            throw new IllegalArgumentException("MAQL DDL string(s) should be given");
        }
        return new PollResult<>(this, new AbstractPollHandlerBase<MaqlDdlLinks, Void>(MaqlDdlLinks.class, Void.class) {

            private final String projectId = project.getId();
            private final LinkedList<String> maqlChunks = new LinkedList<>(maqlDdl);
            private String pollUri;

            {
                executeNextMaqlChunk();
            }

            /**
             * @return true if polling should finish, false otherwise
             */
            private boolean executeNextMaqlChunk() {
                if (maqlChunks.isEmpty()) {
                    return true;
                }
                try {
                    final MaqlDdlLinks links = restTemplate.postForObject(MaqlDdl.URI, new MaqlDdl(maqlChunks.poll()),
                        MaqlDdlLinks.class, projectId);
                    this.pollUri = links.getStatusUri();
                } catch (GoodDataRestException | RestClientException e) {
                    throw new ModelException("Unable to update project model", e);
                }
                return false;
            }

            @Override
            public String getPollingUri() {
                return pollUri;
            }

            @Override
            public boolean isFinished(final ClientHttpResponse response) throws IOException {
                if (!super.isFinished(response)) {
                    return false;
                }
                final TaskStatus maqlDdlTaskStatus = extractData(response, TaskStatus.class);
                if (!maqlDdlTaskStatus.isSuccess()) {
                    throw new ModelException("Unable to update project model: " + maqlDdlTaskStatus.getMessages());
                }
                return executeNextMaqlChunk();
            }

            @Override
            public void handlePollResult(MaqlDdlLinks pollResult) {
                setResult(null);
            }

            @Override
            public void handlePollException(final GoodDataRestException e) {
                throw new ModelException("Unable to update project model", e);
            }
        });
    }

}


text:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:orientation="vertical">

    <TextView
        android:id="@+id/number"
        android:text="000"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal"
        style="@style/NumberFactorization" />

    <GridView
        android:id="@+id/choosen_numbers"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:numColumns="4" />

    <GridView
        android:id="@+id/available_numbers"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="2"
        android:numColumns="4" />

</LinearLayout>


text:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
  ~ Copyright 2010-2011 Ning, Inc.
  ~
  ~ Ning 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.
  -->

<project name="Goodwill-access">
    <publishDate position="right"/>
    <version position="right"/>

    <body>
        <links>
            <item name="Maven Central" href="http://repo1.maven.org/maven2/com/ning/"/>
        </links>

        <menu name="Dwarf">
            <item name="Dwarf project" href="http://pierre.github.com/dwarf"/>
            <item name="FAQ" href="/faq.html"/>
        </menu>

        <menu ref="modules"/>
        <menu ref="reports"/>
    </body>
</project>


text:
<?php
namespace Joswide\Commander;

class Commander{
	public $requests = [];

	// Commands instances
	public $commands = [];

	public function __construct()
	{

	}

	public function getCommands()
	{
		return $this->commands;
	}

	public function getCommand($commandText){
		if (!($this->isCommandTextDefined($commandText))){
			return false;
		}

		return $this->commands[$commandText];
	}

	public function addCommand($command, $alias = null)
	{
		if (!($command instanceof Command)){
			return false;
		}

		$commandText = $this->getCommandName($command->getName(), $alias);

		if ($this->isCommandTextDefined($commandText)){
			return false;
		}

		$this->commands[$commandText] = $command;

	}

	public function isCommandTextDefined($commandText){
		return isset($this->commands[$commandText]);
	}

	public function getCommandName($commandName, $alias = ''){
		$commandName = strtolower($commandName);

		if ($this->isNamespace($alias)){
			return $alias.$commandName;
		}

		if ($this->isGlobalAlias($alias)){
			return $alias;
		}
		if (strlen($alias) > 0){
			return $alias;
		}

		return $commandName;
	}

	public function isGlobalAlias($alias){
		if (strlen($alias) === 0){
			return false;
		}
		return (strpos($alias, ':') === false);
	}
	public function isNamespace($alias){
		$pos = strpos($alias, ':');

		if ($pos === false){
			return false;
		}

		return (strlen($alias) == ($pos + 1));
	}

	public function request($input)
	{

		if (is_string($input)){
			$request = Request\Inline::doFromString($input);

			if ($request){

				$request->execute($this);

				$this->requests[] = $request;

				return $request;
			}

		}

		//jgdebug($this);
	}
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>HorizontalListView.OnScrollStateChangedListener</title>
<meta name="date" content="2014-09-16">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

您的浏览器已禁用 JavaScript。

跳过导航链接

概览

程序包

类

使用

树

已过时

索引

帮助

上一个类

下一个类

框架

无框架

所有类

概要:

嵌套 |

字段 |

构造器 |

方法

详细资料:

字段 |

构造器 |

方法

org.kymjs.aframe.ui.widget

接口 HorizontalListView.OnScrollStateChangedListener

封闭类:

HorizontalListView

public static interface HorizontalListView.OnScrollStateChangedListener

Interface definition for a callback to be invoked when the view scroll
 state has changed.

嵌套类概要

嵌套类

限定符和类型
接口和说明

static class
HorizontalListView.OnScrollStateChangedListener.ScrollState

方法概要

All Methods Instance Methods Abstract Methods

限定符和类型
方法和说明

void
onScrollStateChanged(HorizontalListView.OnScrollStateChangedListener.ScrollState scrollState)

Callback method to be invoked when the scroll state changes.

方法详细资料

onScrollStateChanged

void onScrollStateChanged(HorizontalListView.OnScrollStateChangedListener.ScrollState scrollState)

Callback method to be invoked when the scroll state changes.

参数:

scrollState - The current scroll state.

跳过导航链接

概览

程序包

类

使用

树

已过时

索引

帮助

上一个类

下一个类

框架

无框架

所有类

概要:

嵌套 |

字段 |

构造器 |

方法

详细资料:

字段 |

构造器 |

方法


text:
/* released under bsd licence
 * see LICENCE file or http://www.opensource.org/licenses/bsd-license.php for details
 * Institute of Applied Simulation (ZHAW)
 * Author Thomas Niederberger
 */
package ch.zhaw.ias.dito.ops;

public class AddOp2 implements Operation2 {
	@Override
	public double execute(double a, double b) {
		return a + b;
	}
}


text:
namespace content {

class CONTENT_EXPORT NotificationService {
 public:
  // Returns the NotificationService object for the current thread, or NULL if
  // none.
  static NotificationService* current();

  static NotificationService* Create();

  virtual ~NotificationService() {}

  // Synchronously posts a notification to all interested observers.
  // Source is a reference to a NotificationSource object representing
  // the object originating the notification (can be
  // NotificationService::AllSources(), in which case
  // only observers interested in all sources will be notified).
  // Details is a reference to an object containing additional data about
  // the notification.  If no additional data is needed, NoDetails() is used.
  // There is no particular order in which the observers will be notified.
  virtual void Notify(int type,
                      const NotificationSource& source,
                      const NotificationDetails& details) = 0;

  // Returns a NotificationSource that represents all notification sources
  // (for the purpose of registering an observer for events from all sources).
  static Source<void> AllSources() { return Source<void>(NULL); }

  // Returns the same value as AllSources(). This function has semantic
  // differences to the programmer: We have checked that this AllSources()
  // usage is safe in the face of multiple profiles. Objects that were
  // singletons now will always have multiple instances, one per browser
  // context.
  //
  // Some usage is safe, where the Source is checked to see if it's a member of
  // a container before use. But, we want the number of AllSources() calls to
  // drop to almost nothing, because most usages are not multiprofile safe and
  // were done because it was easier to listen to everything.
  static Source<void> AllBrowserContextsAndSources() {
    return Source<void>(NULL);
  }

  // Returns a NotificationDetails object that represents a lack of details
  // associated with a notification.  (This is effectively a null pointer.)
  static Details<void> NoDetails() { return Details<void>(NULL); }
};

}  // namespace content

#endif  // CONTENT_PUBLIC_BROWSER_NOTIFICATION_SERVICE_H_


text:
node['homebrew']['formulas'].each do |formula|

  homebrew_package "Install formula #{formula}" do
    package_name formula
    homebrew_user node['user_name']
    action :install
  end

end


text:
{% load staticfiles %}
<!DOCTYPE html>

    <meta name="description"
          content="Wisely is an online social platform connecting massive online open course students with each other to motivate and learn together. Get motivated through pledging, collaborative learning, and social networking. For coursera, edx, and udemy."/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Wisely</title>
    <link rel="stylesheet" type="text/css" href="{% static 'css/foundation.min.css' %}"/>
    <link rel="stylesheet" type="text/css" href="{% static 'css/normalize.css' %}"/>
    <link href="https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
    <link href="{% static 'css/auth-buttons.css' %}" rel="stylesheet">

    <meta property="og:title" content="Wisely - Motivate your learning">
    <meta property="og:description"
          content="Wisely incentivizes you to meet your personal learning goals on Stay on track and get rewarded for your hard work.">
    <meta property="og:url" content="http://projectwisely.com/"/>
    <meta property="og:image" content="http://www.projectwisely.com/static/images/logo-in-blue.png"/>

    {% block headers_css %}
        <link rel="stylesheet" href="https://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">

    {% endblock %}
    <link rel="stylesheet" type="text/css" href="{% static 'css/style-anim.css' %}" cache="false"/>

{% block content %}

        {% include 'nav-bar-alt.html' with below="True" %}

    {% if not request.is_mobile %}

                    {% include 'nav-bar-alt.html' %}

GOAL

0%

CROWD-SOURCED MOTIVATION

                                        Wisely
                                        helps
                                        you meet your
                                        personal learning goals on Coursera, EdX, and Udemy.

                                        Keep track of your progress and earn rewards for your achievements.

                                        Get $20
                                        guaranteed rewards for course completion.

$0

REWARD

    {% endif %}

ONE PLACE FOR
                        ALL
                        YOUR ONLINE COURSES

Wisely is the new
                        centralized social
                        platform for all your online education needs.

                            PLEDGE

                            TRACK

                            CONNECT

                            ACHIEVE

PLEDGE

Set your goal and make a pledge to commit to your learning. Get rewards for
                    completing assignments and reaching your goals, paid for by members who don't.

Your first successful pledge is guaranteed a $20 award,
                    Learn more.

TRACK

Wisely helps you monitor your progress across all of your online courses in
                    one easy-to-use dashboard. Get notified of announcements, updates, and upcoming deadlines.

CONNECT

Meet your online classmates through Wisely and collaborate through live
                    study rooms. Share your progress with your followers and social networks.

ACHIEVE

Stay motivated, stay on track, and achieve your goals with Wisely.

WHAT
                    PEOPLE SAY ABOUT US

Wisely is the new centralized social platform for all your online education needs.

            {% if not user.is_authenticated %}
                <button id="sign">GET STARTED</button>
            {% endif %}

                        Contact Us

                        Privacy Policy

Contact Us

                <input style="font-size: 1.2em" type="email" name="email" id='contact-email'
                       placeholder="Your Email Address">

                <textarea id="contact-mail" style="font-size: 1.2em; font-family: Dist-light"
                          placeholder="Your Message"></textarea>

                <button id="contact-send">Send</button>

        <form action="{% url 'users:login' %}" method="post" style="margin-bottom: 0" id="login-form">

                    SIGN IN

                {% csrf_token %}

                    <input type="email" name="email" id="login-email" placeholder="Email">

                    <input type="password" name="password" id="login-password" placeholder="Password">

                            <button type="submit">LOGIN</button>

                            <button type="button" id="sign-up">SIGN UP</button>

        </form>
        <form action="{% url 'users:sign-up' %}" method="post" style="display: none" id="signup-form">

                    SIGN IN

                {% csrf_token %}

By signing up, you agree to our Privacy
                        Policy

                    <input type="text" name="first_name" placeholder="First Name">

                    <input type="text" name="last_name" placeholder="Last Name">

                    <input type="email" name="email" id="signup-email" placeholder="Email">

                    <input type="password" name="password" id="signup-password" placeholder="Password">

                            <button type="submit" onclick="return $('#privacy-check')[0].checked;">SIGN UP</button>

                            <button type="button" id="login-switch">LOGIN</button>

        </form>

            {% for message in messages %}
                {{ message }}
            {% endfor %}

{% endblock %}

{% block additionalScripts %}

{% endblock %}


text:
<?php

namespace Pipeline\APIBundle\Tests\Controller;

use Pipeline\APIBundle\APITest,
    Pipeline\APIBundle\Constants,
    Pipeline\APIBundle\Tests\TestConstants;

use Symfony\Component\HttpFoundation\Response;

use Pipeline\APIBundle\Entity\Task;

class TasksControllerTest extends APITest
{
	/**
	 * Test for getTasksAction.
	 *
	 * @access public
	 * @return void
	 */
	public function testGetTasks()
    {
        $crawler = $this->client->request('GET', '/api/tasks');

        $this->assertTrue(in_array(
            $this->client->getResponse()->getStatusCode(),
            array(Response::HTTP_OK)),
            "There wasn't an OK get Tasks response!"
        );
    }

    /**
     * Test for getTaskAction.
     *
     * @access public
     * @return void
     */
    public function testGetTask()
    {
        $crawler = $this->client->request('GET', '/api/tasks/'.TestConstants::TEST_TASK_ID);

        $this->assertTrue(in_array(
            $this->client->getResponse()->getStatusCode(),
            array(Response::HTTP_OK)),
            "There wasn't an OK get Task ".TestConstants::TEST_TASK_ID.", which should have been preloaded!"
        );
    }

    /**
     * Test for postTasksAction.
     *
     * @access public
     * @return void
     */
    public function testPostTasks()
    {
        /* We to set a timezone for this text (more of a fallback for my PHP config). */
        date_default_timezone_set('America/Chicago');

        $task_skeleton = array();
        $task_skeleton['name'] = "Test Task 2";
        $task_skeleton['status'] = Constants::STATUS_ACTIVE;
        $task_skeleton['description'] = "This is a test task meant to stimulate the post API";

        $crawler = $this->client->request('POST', '/api/tasks', $task_skeleton);

        $this->assertTrue(in_array(
            $this->client->getResponse()->getStatusCode(),
            array(Response::HTTP_CREATED)),
            "There wasn't a CREATED Task - ".$this->client->getResponse()->getContent()." returned."
        );
    }

}


text:
cask "spideroakone" do
  version "7.5.0"
  sha256 :no_check

  if MacOS.version == :high_sierra
    url "https://spideroak.com/release/spideroak/osx_hs"
  else
    url "https://spideroak.com/release/spideroak/osx"
  end

  name "SpiderOak One Backup"
  desc "Cloud backup and storage"
  homepage "https://spideroak.com/"

  livecheck do
    url :url
    strategy :header_match
  end

  pkg "SpiderOakONE.pkg"

  uninstall signal:  [
              ["TERM", "com.spideroak.orange.client"],
            ],
            pkgutil: "org.python.python"

  zap trash: "~/Library/Application Support/SpiderOakONE"
end


text:
<?php

/* GsbBundle:Visiteur:saisie.html.twig */
class __TwigTemplate_98873b3014517ab6cc58f9b4c398d9fa7ba4852ec0a4f476c0ca7578e957a786 extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        // line 1
        try {
            $this->parent = $this->env->loadTemplate("GsbBundle::base.html.twig");
        } catch (Twig_Error_Loader $e) {
            $e->setTemplateFile($this->getTemplateName());
            $e->setTemplateLine(1);

            throw $e;
        }

        $this->blocks = array(
            'title' => array($this, 'block_title'),
            'content' => array($this, 'block_content'),
            'custom_javascript' => array($this, 'block_custom_javascript'),
        );
    }

    protected function doGetParent(array $context)
    {
        return "GsbBundle::base.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }

    // line 3
    public function block_title($context, array $blocks = array())
    {
        echo "Saisie d'une fiche ";
    }

    // line 5
    public function block_content($context, array $blocks = array())
    {
        // line 6
        echo "\t
\t";
        // line 7
        echo         $this->env->getExtension('form')->renderer->renderBlock((isset($context["form"]) ? $context["form"] : null), 'form_start');
        echo "
\t    ";
        // line 8
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock((isset($context["form"]) ? $context["form"] : null), 'errors');
        echo "
\t\t";
        // line 9
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["form"]) ? $context["form"] : null), "forfaits", array()), 'row');
        echo "
\t\t

\t\t";
        // line 11
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["form"]) ? $context["form"] : null), "horsForfait", array()), 'row');
        echo "
\t\t";
        // line 12
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["form"]) ? $context["form"] : null), "moteur", array()), 'row');
        echo "
\t
\t\t

\t\t\tAjouter un hors-forfait

\t\t\tSupprimer le dernier hors-forfait

\t\t\t<input type=\"submit\" value=\"Modifier\" class=\"btn btn-primary\" >
\t\t

\t";
        // line 19
        echo         $this->env->getExtension('form')->renderer->renderBlock((isset($context["form"]) ? $context["form"] : null), 'form_end');
        echo "
";
    }

    // line 22
    public function block_custom_javascript($context, array $blocks = array())
    {
        // line 23
        echo "\t
";
    }

    public function getTemplateName()
    {
        return "GsbBundle:Visiteur:saisie.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  86 => 23,  83 => 22,  77 => 19,  67 => 12,  63 => 11,  58 => 9,  54 => 8,  50 => 7,  47 => 6,  44 => 5,  38 => 3,  11 => 1,);
    }
}