text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/testproject.iml" filepath="$PROJECT_DIR$/testproject.iml" />
      <module fileurl="file://$PROJECT_DIR$/untitled/untitled.iml" filepath="$PROJECT_DIR$/untitled/untitled.iml" />
    </modules>
  </component>
</project>


text:
module GitHooks
  module GitUtils
    def hook_type
      ENV['HOOK_TYPE']
    end

    def hook_name
      ENV['HOOK_NAME']
    end

    def git_statuses_and_files(*file_patterns)
      file_patterns_regexp = if !file_patterns.empty?
        /#{file_patterns.join('|')}/
      else
        /.+/
      end

      status = `git status --porcelain`
      statuses_and_files = status.scan(/^([AM]+)\s+(#{file_patterns_regexp})$/)

      [ statuses_and_files.collect(&:first), statuses_and_files.collect(&:last) ]
    end

    def git_diff(cached = false)
      if cached
        `git diff --cached`
      else
        `git diff`
      end
    end

    def git_config(key)
      `git config hooks.#{hook_type}.#{hook_name}.#{key}`.strip
    end

    def git_base_path
      `git rev-parse --show-toplevel`.strip
    end

    def git_current_branch
      `git rev-parse --abbrev-ref HEAD`.strip
    end

    extend self
  end
end

redpajama_set_name: RedPajamaGithub


text:
CorrectNumber
=============

This project have the single propose of creating a simple rest service to format telephone numbers


text:
<title>Zend Framework API Documentation</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta><link rel="stylesheet" href="css/black-tie/jquery-ui-1.8.2.custom.css" type="text/css"></link><link rel="stylesheet" href="css/jquery.treeview.css" type="text/css"></link><link rel="stylesheet" href="css/theme.css" type="text/css"></link>

API Documentation

Amf/Request.php

Global

                      Classes

\Zend_Amf_Request

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.

category

Zend

copyright

Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)

license

New BSD License

package

Zend_Amf

version

$Id: Request.php 23775 2011-03-01 17:25:24Z ralph $

\Zend_Amf_Request
jump to top

Handle the incoming AMF request by deserializing the data to php object
types and storing the data for Zend_Amf_Server to handle for processing.

copyright

Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)

license

New BSD License

package

Zend_Amf

todo

Currently not checking if the object needs to be Type Mapped to a server object.

Properties

array
                 $_bodies= 'array'

Message bodies

Default valuearrayDetails

Type

array

int
                 $_clientType= '0'

AMF client type (AMF0, AMF3)

Default value0Details

Type

int

\Zend_Amf_Parse_AMF0_Deserializer
                 $_deserializer= ''

Details

Type

\Zend_Amf_Parse_AMF0_Deserializer

array
                 $_headers= 'array'

Message headers

Default valuearrayDetails

Type

array

\Zend_Amf_Parse_InputStream
                 $_inputStream= ''

Details

Type

\Zend_Amf_Parse_InputStream

int
                 $_objectEncoding= '0'

Message encoding to use for objects in response

Default value0Details

Type

int

mixed
                 $_time= ''

Time of the request

Details

Type

mixed

Methods

addAmfBody(
          \Zend_Amf_Value_MessageBody $message
          )

        :
          \Zend_Amf_Request

Accessor to private array of message bodies.

Parameters

Name
Type
Description

$message
\Zend_Amf_Value_MessageBody

Returns

Type
Description

\Zend_Amf_Request

getAmfBodies(

          )

        :
          array

Return an array of the body objects that were found in the amf request.

Returns

Type
Description

array
{target, response, length, content}

getAmfHeaders(

          )

        :
          array

Return an array of headers that were found in the amf request.

Returns

Type
Description

array
{operation, mustUnderstand, length, param}

getObjectEncoding(

          )

        :
          int

Return the either 0 or 3 for respect AMF version

Returns

Type
Description

int

initialize(
          string $request
          )

        :
          \Zend_Amf_Request

Prepare the AMF InputStream for parsing.

Parameters

Name
Type
Description

$request
string

Returns

Type
Description

\Zend_Amf_Request

readBody(

          )

        :
          \Zend_Amf_Value_MessageBody

Deserialize a message body from the input stream

Returns

Type
Description

\Zend_Amf_Value_MessageBody

readHeader(

          )

        :
          \Zend_Amf_Value_MessageHeader

Deserialize a message header from the input stream.

A message header is structured as:
- NAME String
- MUST UNDERSTAND Boolean
- LENGTH Int
- DATA Object

Returns

Type
Description

\Zend_Amf_Value_MessageHeader

readMessage(
           $stream
          )

        :
          \Zend_Amf_Request

Takes the raw AMF input stream and converts it into valid PHP objects

Parameters

Name
Type
Description

$stream

Zend_Amf_Parse_InputStream

Returns

Type
Description

\Zend_Amf_Request

setObjectEncoding(
          mixed $int
          )

        :
          \Zend_Amf_Request

Set the object response encoding

Parameters

Name
Type
Description

$int
mixed

Returns

Type
Description

\Zend_Amf_Request

Documentation was generated by DocBlox 0.13.3.


text:
package com.getbase.floatingactionbutton;

import android.graphics.Color;

public final class ColorUtils {

    public static int opacityToAlpha(float opacity) {
        return (int) (255f * opacity);
    }

    public static int darkenColor(int argb) {
        return adjustColorBrightness(argb, 0.9f);
    }

    public static int lightenColor(int argb) {
        return adjustColorBrightness(argb, 1.1f);
    }

    public static int adjustColorBrightness(int argb, float factor) {
        float[] hsv = new float[3];
        Color.colorToHSV(argb, hsv);

        hsv[2] = Math.min(hsv[2] * factor, 1f);

        return Color.HSVToColor(Color.alpha(argb), hsv);
    }

    public static int halfTransparent(int argb) {
        return Color.argb(
                Color.alpha(argb) / 2,
                Color.red(argb),
                Color.green(argb),
                Color.blue(argb)
        );
    }

    public static int opaque(int argb) {
        return Color.rgb(
                Color.red(argb),
                Color.green(argb),
                Color.blue(argb)
        );
    }
}


text:
/* ch2/fork-and-exec.c */

#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <string.h>
void err_sys(char *msg);

/**
 * Builds google search url to be passed as argument when launching
 * google-chrome.
 */
char *buildQueryUrl(char *term)
{
	char *searchUrl= "https://www.google.com/search?q=";
	char *query = malloc(sizeof(char) * (strlen(searchUrl)+1 + strlen(term)+1));
	strcpy(query, searchUrl);
	strcat(query, term);
	return query;
}

int main(int argc, char *argv[])
{
	pid_t	pid;

	if ((pid = fork()) < 0)
	{
		err_sys("fork error");
	}
	else if (pid == 0)	/* child */
	{
		if(argc == 1) {
			execlp("./print-pid","print-pid",(char *) NULL);
		} else if(argc == 2) {
			char *url = buildQueryUrl(argv[1]);
			execlp("google-chrome","google-chrome", "--new-window", url, (char *) NULL);
			/* execlp("gvim","gvim", argv[1], (char *) NULL); */
		}
		err_sys("exec failed");
		exit(EXIT_FAILURE);
	}
	printf("Created child with pid %d\n",pid);

	/* parent continues concurrently with child */

	printf("Parent waiting for child to finish...\n");
	/* wait for normal termination of child process */
	if (waitpid(pid, NULL, 0) != pid)
	{
		err_sys("waitpid error");
	}
	printf("Parent exiting\n");
	exit(EXIT_SUCCESS);
}

void err_sys(char *msg)
{
	fprintf(stderr, msg);
	fflush(NULL); /* flush all output streams */
	exit(EXIT_FAILURE); /* exit abnormally */
}