text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
<context>
    <name></name>
    <message id="components-la-tap-to-cancel">
        <source>Tap to cancel</source>
        <translation>Tap to Cancel</translation>
    </message>
    <message id="lists-edit-accept">
        <source>Edit List</source>
        <translation>Edit List</translation>
    </message>
    <message id="lists-create-accept">
        <source>Create List</source>
        <translation>Create List</translation>
    </message>
    <message id="lists-create-name">
        <source>List name</source>
        <oldsource>List Name</oldsource>
        <translation>List Name</translation>
    </message>
    <message id="lists-create-description">
        <source>List description</source>
        <translation>List Description</translation>
    </message>
    <message id="venue-add-accept">
        <source>Create</source>
        <translation>Create</translation>
    </message>
    <message id="venue-add-name">
        <source>Name</source>
        <translation>Venue Name</translation>
    </message>
    <message id="venue-add-choose-category">
        <source>Choose category</source>
        <translation>Choose Category</translation>
    </message>
    <message id="venue-add-address">
        <source>Address</source>
        <translation>Address</translation>
    </message>
    <message id="venue-add-cross-street">
        <source>Cross street</source>
        <translation>Cross street</translation>
    </message>
    <message id="venue-add-city">
        <source>City</source>
        <translation>City</translation>
    </message>
    <message id="venue-add-state">
        <source>State</source>
        <translation>State</translation>
    </message>
    <message id="venue-add-zip">
        <source>ZIP</source>
        <translation>ZIP</translation>
    </message>
    <message id="venue-add-phone">
        <source>Phone</source>
        <translation>Phone</translation>
    </message>
    <message id="venue-add-twitter">
        <source>Twitter</source>
        <translation>Twitter</translation>
    </message>
    <message id="venue-add-description">
        <source>Description</source>
        <translation>Description</translation>
    </message>
    <message id="venue-add-set-position">
        <source>Set position</source>
        <translation>Set position</translation>
    </message>
    <message id="badges-title">
        <source>Badges</source>
        <translation>Badges</translation>
    </message>
    <message id="badges-empty">
        <source>List of badges is empty</source>
        <translation>List of badges is empty</translation>
    </message>
    <message id="categories-title">
        <source>Categories</source>
        <translation>Categories</translation>
    </message>
    <message id="checkin-photos-menu">
        <source>Photos</source>
        <translation>Photos</translation>
    </message>
    <message id="checkin-tips-menu">
        <source>Tips</source>
        <translation>Tips</translation>
    </message>
    <message id="checkin-listed-menu">
        <source>Listed</source>
        <translation>Listed</translation>
    </message>
    <message id="checkin-specials">
        <source>Specials</source>
        <translation>Specials</translation>
    </message>
    <message id="checkin-dislike-venue-menu">
        <source>Dislike</source>
        <translation>Dislike</translation>
    </message>
    <message id="checkin-like-venue-menu">
        <source>Like</source>
        <translation>Like</translation>
    </message>
    <message id="venue-checkin-accept">
        <source>Checkin</source>
        <translation>Check-in</translation>
    </message>
    <message id="venue-checkin-comment">
        <source>Write your comment here.</source>
        <oldsource>Comment</oldsource>
        <translation>Write your comment here.</translation>
    </message>
    <message id="venue-checkin-share-to-facebook-button">
        <source>Share to Facebook</source>
        <oldsource>Share to facebook</oldsource>
        <translation>Share to Facebook</translation>
    </message>
    <message id="venue-checkin-share-to-twitter-button">
        <source>Share to Twitter</source>
        <oldsource>Share to twitter</oldsource>
        <translation>Share to Twitter</translation>
    </message>
    <message id="venue-checkin-show-on-map-button">
        <source>Show on Map</source>
        <translation>Show on Map</translation>
    </message>
    <message id="cover-loading">
        <source>Loading ...</source>
        <translation>Loading ...</translation>
    </message>
    <message id="cover-no-checkins">
        <source>Nobody of your friends checked in yet</source>
        <oldsource>FIXME</oldsource>
        <translation>None of your friends have checked in yet</translation>
    </message>
    <message id="n-notifications" numerus="yes">
        <source>%n Notifications</source>
        <oldsource>%n Notification(s)</oldsource>
        <translation>
            <numerusform>%n Notification</numerusform>
            <numerusform>%n Notifications</numerusform>
        </translation>
    </message>
    <message id="error-not-authorized">
        <source>Unauthorized</source>
        <oldsource>Not authorized</oldsource>
        <translation>Unauthorized</translation>
    </message>
    <message id="error-connection-problem">
        <source>Connection problem</source>
        <translation>Connection Problem</translation>
    </message>
    <message id="friends-title">
        <source>Friends</source>
        <translation>Friends</translation>
    </message>
    <message id="friends-empty">
        <source>List of friends is empty</source>
        <translation>List of friends is empty</translation>
    </message>
    <message id="friends-removing">
        <source>Removing friend</source>
        <translation>Removing Friend</translation>
    </message>
    <message id="friends-remove">
        <source>Remove</source>
        <translation>Remove</translation>
    </message>
    <message id="friends-add">
        <source>Add</source>
        <translation>Add</translation>
    </message>
    <message id="leaderboard-title">
        <source>Leaderboard</source>
        <translation>Leaderboard</translation>
    </message>
    <message id="leaderboard-empty">
        <source>Leaderboard is empty</source>
        <translation>Leaderboard is empty</translation>
    </message>
    <message id="leaderboard-n-checkins" numerus="yes">
        <source>%n checkins</source>
        <oldsource>%n checkin(s)</oldsource>
        <translation>
            <numerusform>%n check-in</numerusform>
            <numerusform>%n check-ins</numerusform>
        </translation>
    </message>
    <message id="list-detail-empty">
        <source>List contains no venues</source>
        <translation>List contains no venues</translation>
    </message>
    <message id="lists-title">
        <source>Lists</source>
        <translation>Lists</translation>
    </message>
    <message id="lists-empty">
        <source>No lists are available</source>
        <translation>No lists are available</translation>
    </message>
    <message id="lists-new">
        <source>New</source>
        <translation>New</translation>
    </message>
    <message id="lists-edit">
        <source>Edit</source>
        <translation>Edit</translation>
    </message>
    <message id="lists-follow">
        <source>Follow</source>
        <translation>Follow</translation>
    </message>
    <message id="lists-unfollow">
        <source>Unfollow</source>
        <translation>Unfollow</translation>
    </message>
    <message id="map-title">
        <source>Map</source>
        <translation>Map</translation>
    </message>
    <message id="mayorships-title">
        <source>Mayorships</source>
        <translation>Mayorships</translation>
    </message>
    <message id="mayorships-empty">
        <source>User hasn't got any mayorships yet</source>
        <oldsource>User hasn't got any mayorships yet!</oldsource>
        <translation>No mayorships yet</translation>
    </message>
    <message id="nearby-venues-title">
        <source>Nearby Venues</source>
        <translation>Nearby Venues</translation>
    </message>
    <message id="search-results-title">
        <source>Search results</source>
        <translation>Search results</translation>
    </message>
    <message id="nearby-venues-my-profile-menu">
        <source>My Profile</source>
        <translation>My Profile</translation>
    </message>
    <message id="nearby-venues-recent-checkins-menu">
        <source>Recent Checkins</source>
        <translation>Recent Checkins</translation>
    </message>
    <message id="nearby-venues-refresh-menu">
        <source>Refresh</source>
        <translation>Refresh</translation>
    </message>
    <message id="nearby-venues-nearby-venues-menu">
        <source>Nearby Venues</source>
        <translation>Nearby Venues</translation>
    </message>
    <message id="nearby-venues-search-menu">
        <source>Search</source>
        <translation>Search</translation>
    </message>
    <message id="nearby-venues-add">
        <source>Add</source>
        <translation>Add</translation>
    </message>
    <message id="nearby-venues-empty">
        <source>There is no venue in nearby</source>
        <translation>There is no venue nearby</translation>
    </message>
    <message id="notifications-title">
        <source>Notifications</source>
        <translation>Notifications</translation>
    </message>
    <message id="notifications-empty">
        <source>You have no notifications</source>
        <translation>You have no notifications</translation>
    </message>
    <message id="photos-title">
        <source>Photos</source>
        <translation>Photos</translation>
    </message>
    <message id="photos-empty">
        <source>List of photos is empty</source>
        <translation>No Photos yet</translation>
    </message>
    <message id="image-status-ready">
        <source>Ready</source>
        <translation>Ready</translation>
    </message>
    <message id="image-status-not-set">
        <source>Not Set</source>
        <translation>Not Set</translation>
    </message>
    <message id="image-status-error">
        <source>Error</source>
        <translation>Error</translation>
    </message>
    <message id="image-status-loading">
        <source>Loading ...</source>
        <translation>Loading ...</translation>
    </message>
    <message id="image-status-unknown">
        <source>Unknown</source>
        <translation>Unknown Error</translation>
    </message>
    <message id="profile-my-profile-menu">
        <source>My Profile</source>
        <translation>My Profile</translation>
    </message>
    <message id="profile-recent-checkins-menu">
        <source>Recent Checkins</source>
        <translation>Recent Check-ins</translation>
    </message>
    <message id="profile-nearby-venues-menu">
        <source>Nearby Venues</source>
        <translation>Nearby Venues</translation>
    </message>
    <message id="profile-checkins">
        <source>Checkins</source>
        <translation>Check-ins</translation>
    </message>
    <message id="profile-notifications">
        <source>Notifications</source>
        <translation>Notifications</translation>
    </message>
    <message id="profile-badges">
        <source>Badges</source>
        <translation>Badges</translation>
    </message>
    <message id="profile-mayorships">
        <source>Mayorships</source>
        <translation>Mayorships</translation>
    </message>
    <message id="profile-tips">
        <source>Tips</source>
        <translation>Tips</translation>
    </message>
    <message id="profile-friends">
        <source>Friends</source>
        <translation>Friends</translation>
    </message>
    <message id="profile-lists">
        <source>Lists</source>
        <translation>Lists</translation>
    </message>
    <message id="profile-photos">
        <source>Photos</source>
        <translation>Photos</translation>
    </message>
    <message id="tap-to-show">
        <source>Tap to show</source>
        <translation>Tap to show</translation>
    </message>
    <message id="recent-checkins-title">
        <source>Recent Checkins</source>
        <translation>Recent Check-ins</translation>
    </message>
    <message id="recent-checkins-empty">
        <source>None of your friends checked in yet</source>
        <translation>None of your friends have checked in yet</translation>
    </message>
    <message id="recent-checkins-my-profile-menu">
        <source>My Profile</source>
        <translation>My Profile</translation>
    </message>
    <message id="recent-checkins-nearby-venues-menu">
        <source>Nearby Venues</source>
        <translation>Nearby Venues</translation>
    </message>
    <message id="recent-checkins-refresh-menu">
        <source>Refresh</source>
        <translation>Refresh</translation>
    </message>
    <message id="recent-checkins-like">
        <source>Like checkin</source>
        <oldsource>Like</oldsource>
        <translation>Like</translation>
    </message>
    <message id="recent-checkins-friend-profile">
        <source>Profile</source>
        <translation>Profile</translation>
    </message>
    <message id="recent-checkins-venue-detail">
        <source>Venue</source>
        <oldsource>Venue detail</oldsource>
        <translation>Venue</translation>
    </message>
    <message id="recent-checkins-dislike">
        <source>Dislike checkin</source>
        <oldsource>Dislike</oldsource>
        <translation>Dislike</translation>
    </message>
    <message id="search-title">
        <source>Search</source>
        <translation>Search</translation>
    </message>
    <message id="search-venue-name">
        <source>Venue name</source>
        <translation>Venue Name</translation>
    </message>
    <message id="history-title">
        <source>History</source>
        <translation>History</translation>
    </message>
    <message id="history-empty">
        <source>User didn't make check in yet</source>
        <translation>You haven't made any check-in yet</translation>
    </message>
    <message id="tips-title">
        <source>Tips</source>
        <translation>Tips</translation>
    </message>
    <message id="tips-empty">
        <source>List of tips is empty</source>
        <translation>List of tips is empty</translation>
    </message>
    <message id="tips-dislike">
        <source>Dislike tip</source>
        <translation>Dislike</translation>
    </message>
    <message id="tips-like">
        <source>Like tip</source>
        <translation>Like</translation>
    </message>
    <message id="checkin-result-title">
        <source>Checkin</source>
        <translation>Check-in</translation>
    </message>
    <message id="checkin-result-section-header-specials">
        <source>Specials</source>
        <translation type="unfinished">Specials</translation>
    </message>
    <message id="checkin-result-section-header-badges">
        <source>Badges</source>
        <translation>Badges</translation>
    </message>
    <message id="checkin-result-section-header-score">
        <source>Score</source>
        <translation>Score</translation>
    </message>
    <message id="checkin-result-section-header-leaderboard">
        <source>Leaderboard</source>
        <translation>Leaderboard</translation>
    </message>
</context>
</TS>


text:
def pad!(array, min_size, value = nil) #destructive - return modified version of the original object
  return array if array.length >= min_size
  i = array.length
  while i <= min_size - 1 #while i < min_size
    array << value
    i += 1
  end
  array
end
p pad!([1,2,3], 5, "duck")

def pad(array, min_size, value = nil) #non-destructive - return new object
  pad_array = []
  array.each do |item|
    pad_array.push(item)
  end
  while pad_array.length < min_size
    pad_array.push(value)
  end
  pad_array
end

p pad([1,2,3], 5, "goose")

# 3. Refactored Solution
def pad!(array, min_size, value = nil)
  while array.length < min_size
    array.push(value)
  end
  array
end

p pad!([1,2,3], 5, "duck")

def pad(array, min_size, value = nil)
  pad_array = array.clone
  while pad_array.length < min_size
    pad_array.push(value)
  end
  pad_array
end

p pad([1,2,3], 5, "goose")
# 4. Reflection
=begin
Were you successful in breaking the problem down into small steps?
We were, though it was tempting to include code snippets within the pseudocode.

Once you had written your pseudocode, were you able to easily translate it into code? What difficulties and successes did you have?
Yes, except our original methods were a bit more complicated than our refactored solutions,

Was your initial solution successful at passing the tests? If so, why do you think that is? If not, what were the errors you encountered and what did you do to resolve them?
Yes - we were able to push correct values into new/old arrays.

When you refactored, did you find any existing methods in Ruby to clean up your code?
For the non-destructive method, .clone allowed us to set new array variable to the old array without having to push each old array item into the new array.

How readable is your solution? Did you and your pair choose descriptive variable names?
Short and sweet. Our variables seem sufficiently descriptive.

What is the difference between destructive and non-destructive methods in your own words?
Destructive methods permanently change an object, whereas non-destructive methods temporarily alter them
=end

redpajama_set_name: RedPajamaGithub


text:
package de.mineformers.visum.bean.value

import de.mineformers.visum.bean._
import de.mineformers.visum.bean.binding.{Binding, SimpleBinding}

import scala.language.implicitConversions

/**
 * Value
 *
 * @author PaleoCrafter
 */
case class Value[@specialized A](value: A) extends ObservableValue[A]

case class MutableValue[@specialized A](private var _value: A) extends MutableObservableValue[A] {
  override def value: A = _value

  override def value_=(newValue: A): Unit = {
    _value = newValue
    fireChangeEvent()
  }
}

trait PrimitiveValueIncludes {
  implicit def value2binding[@specialized A](observable: ObservableValue[A]): Binding[A] =
    SimpleBinding(observable)

  implicit def boolean2ops(observable: ObservableValue[Boolean]): ObservableValue[Boolean] with BooleanOps =
    new SimpleBinding(observable) with BooleanOps

  implicit def byte2ops(observable: ObservableValue[Byte]): ObservableValue[Byte] with ByteOps =
    new SimpleBinding(observable) with ByteOps

  implicit def short2ops(observable: ObservableValue[Short]): ObservableValue[Short] with ShortOps =
    new SimpleBinding(observable) with ShortOps

  implicit def int2ops(observable: ObservableValue[Int]): ObservableValue[Int] with IntOps =
    new SimpleBinding(observable) with IntOps

  implicit def long2ops(observable: ObservableValue[Long]): ObservableValue[Long] with LongOps =
    new SimpleBinding(observable) with LongOps

  implicit def float2ops(observable: ObservableValue[Float]): ObservableValue[Float] with FloatOps =
    new SimpleBinding(observable) with FloatOps

  implicit def double2ops(observable: ObservableValue[Double]): ObservableValue[Double] with DoubleOps =
    new SimpleBinding(observable) with DoubleOps
}


text:
<?php
namespace LN\FrontBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use LN\FrontBundle\Entity\Status;
use LN\FrontBundle\Entity\Comment;
/**
* @ORM\Entity
* @ORM\Table(name="user")
*/
class User
{
    /**
    *
    * @ORM\Id
    * @ORM\Column(type="integer")
    * @ORM\GeneratedValue(strategy="AUTO")
    */
    protected $id;
    /**
    *
    * @var String
    *
    * @ORM\Column(name="username", type="string", length=255)
    */
    private $username;
    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }
    /**
     * Set username
     *
     * @param string $username
     * @return User
     */
    public function setUsername($username)
    {
        $this->username = $username;
        return $this;
    }
    /**
     * Get username
     *
     * @return string
     */
    public function getUsername()
    {
        return $this->username;
    }
    /**
    *
    * @ORM\OneToMany(targetEntity="Status", mappedBy="User")
    */
    protected $statuses;
    /**
     * Add statuses
     *
     * @param \LN\FrontBundle\Entity\Status $statuses
     * @return User
     */
    public function addStatus(\LN\FrontBundle\Entity\Status $statuses)
    {
        $this->statuses[] = $statuses;
        return $this;
    }
    /**
     * Remove statuses
     *
     * @param \LN\FrontBundle\Entity\Status $statuses
     */
    public function removeStatus(\LN\FrontBundle\Entity\Status $statuses)
    {
        $this->statuses->removeElement($statuses);
    }
    /**
     * Get statuses
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getStatuses()
    {
        return $this->statuses;
    }
    /**
    *
    * @ORM\ManyToMany(targetEntity="User", inversedBy="friendsWithMe")
    * @ORM\JoinTable(
    *    name="friends",
    *    joinColumns={@ORM\JoinColumn(name="user_id", referencedColumnName="id")},
    *    inverseJoinColumns={
    *        @ORM\JoinColumn(name="friend_user_id", referencedColumnName="id")
    *     }
    *  )
    */
    private $friends;
    /**
    * @ORM\ManyToMany(targetEntity="User", mappedBy="friends")
    */
    private $friendsWithMe;
    /**
     * Add friends
     *
     * @param \LN\FrontBundle\Entity\User $friends
     * @return User
     */
    public function addFriend(\LN\FrontBundle\Entity\User $friends)
    {
        $this->friends[] = $friends;
        return $this;
    }
    /**
     * Remove friends
     *
     * @param \LN\FrontBundle\Entity\User $friends
     */
    public function removeFriend(\LN\FrontBundle\Entity\User $friends)
    {
        $this->friends->removeElement($friends);
    }
    /**
     * Get friends
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getFriends()
    {
        return $this->friends;
    }
    /**
     * Add friendsWithMe
     *
     * @param \LN\FrontBundle\Entity\User $friendsWithMe
     * @return User
     */
    public function addFriendsWithMe(\LN\FrontBundle\Entity\User $friendsWithMe)
    {
        $this->friendsWithMe[] = $friendsWithMe;
        return $this;
    }
    /**
     * Remove friendsWithMe
     *
     * @param \LN\FrontBundle\Entity\User $friendsWithMe
     */
    public function removeFriendsWithMe(\LN\FrontBundle\Entity\User $friendsWithMe)
    {
        $this->friendsWithMe->removeElement($friendsWithMe);
    }
    /**
     * Get friendsWithMe
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getFriendsWithMe()
    {
        return $this->friendsWithMe;
    }
    /**
     * hasFriend friend
     * @param \LN\FrontBundle\Entity\User $friend
     * @return boolean
     */
    public function hasFriend($friend)
    {
        return $this->friends->contains($friend);
    }
    /**
     * canAddFriend friend
     * @param \LN\FrontBundle\Entity\User $friend
     * @return boolean
     */
    public function canAddFriend($friend)
    {
        return $this!=$friend && !$this->hasFriend($friend);
    }
    /**
     * @ORM\OneToMany(targetEntity="Comment", mappedBy="user")
     */
    protected $comments;
    public function _construct()
    {
        parent::_construct;
        $this->statuses = new ArrayCollection();
        $this->friends = new ArrayCollection();
        $this->friendsWithMe = new ArrayCollection();
        $this->comments = new ArrayCollection();
    }

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->statuses = new \Doctrine\Common\Collections\ArrayCollection();
        $this->friends = new \Doctrine\Common\Collections\ArrayCollection();
        $this->friendsWithMe = new \Doctrine\Common\Collections\ArrayCollection();
        $this->comments = new \Doctrine\Common\Collections\ArrayCollection();
    }
    /**
     * Add comments
     *
     * @param \LN\FrontBundle\Entity\Comment $comments
     * @return User
     */
    public function addComment(\LN\FrontBundle\Entity\Comment $comments)
    {
        $this->comments[] = $comments;
        return $this;
    }
    /**
     * Remove comments
     *
     * @param \LN\FrontBundle\Entity\Comment $comments
     */
    public function removeComment(\LN\FrontBundle\Entity\Comment $comments)
    {
        $this->comments->removeElement($comments);
    }
    /**
     * Get comments
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getComments()
    {
        return $this->comments;
    }
}


text:
import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-aplicacao-main',
  templateUrl: './aplicacao-main.component.html',
  styleUrls: ['./aplicacao-main.component.scss']
})
export class AplicacaoMainComponent implements OnInit {

  constructor() {  }

  ngOnInit() {

  }
}


text:
// Headset Collision Fade|Scripts|0110
namespace VRTK
{
    using UnityEngine;

    /// <summary>
    /// The purpose of the Headset Collision Fade is to detect when the user's VR headset collides with another game object and fades the screen to a solid colour. This is to deal with a user putting their head into a game object and seeing the inside of the object clipping, which is an undesired effect. The reasoning behind this is if the user puts their head where it shouldn't be, then fading to a colour (e.g. black) will make the user realise they've done something wrong and they'll probably naturally step backwards.
    /// </summary>
    /// <remarks>
    /// The Headset Collision Fade uses a composition of the Headset Collision and Headset Fade scripts to derive the desired behaviour.
    ///
    ///   > **Unity Version Information**
    ///   > * If using `Unity 5.3` or older then the Headset Collision Fade script is attached to the `Camera(head)` object within the `[CameraRig]` prefab.
    ///   > * If using `Unity 5.4` or newer then the Headset Collision Fade script is attached to the `Camera(eye)` object within the `[CameraRig]->Camera(head)` prefab.
    /// </remarks>
    /// <example>
    /// `VRTK/Examples/011_Camera_HeadSetCollisionFading` has collidable walls around the play area and if the user puts their head into any of the walls then the headset will fade to black.
    /// </example>
    public class VRTK_HeadsetCollisionFade : MonoBehaviour
    {
        [Tooltip("The fade blink speed on collision.")]
        public float blinkTransitionSpeed = 0.1f;
        [Tooltip("The colour to fade the headset to on collision.")]
        public Color fadeColor = Color.black;
        [Tooltip("A string that specifies an object Tag or the name of a Script attached to an object and will prevent the object from fading the headset view on collision.")]
        public string ignoreTargetWithTagOrClass;
        [Tooltip("A specified VRTK_TagOrScriptPolicyList to use to determine whether any objects will be acted upon by the Headset Collision Fade. If a list is provided then the 'Ignore Target With Tag Or Class' parameter will be ignored.")]
        public VRTK_TagOrScriptPolicyList targetTagOrScriptListPolicy;

        private VRTK_HeadsetCollision headsetCollision;
        private VRTK_HeadsetFade headsetFade;

        private void OnEnable()
        {
            headsetCollision = gameObject.AddComponent<VRTK_HeadsetCollision>();
            headsetCollision.ignoreTargetWithTagOrClass = ignoreTargetWithTagOrClass;
            headsetCollision.targetTagOrScriptListPolicy = targetTagOrScriptListPolicy;

            headsetFade = gameObject.AddComponent<VRTK_HeadsetFade>();

            headsetCollision.HeadsetCollisionDetect += new HeadsetCollisionEventHandler(OnHeadsetCollisionDetect);
            headsetCollision.HeadsetCollisionEnded += new HeadsetCollisionEventHandler(OnHeadsetCollisionEnded);
        }

        private void OnHeadsetCollisionDetect(object sender, HeadsetCollisionEventArgs e)
        {
            headsetFade.Fade(fadeColor, blinkTransitionSpeed);
        }

        private void OnHeadsetCollisionEnded(object sender, HeadsetCollisionEventArgs e)
        {
            headsetFade.Unfade(blinkTransitionSpeed);
        }

        private void OnDisable()
        {
            headsetCollision.HeadsetCollisionDetect -= new HeadsetCollisionEventHandler(OnHeadsetCollisionDetect);
            headsetCollision.HeadsetCollisionEnded -= new HeadsetCollisionEventHandler(OnHeadsetCollisionEnded);

            Destroy(headsetCollision);
            Destroy(headsetFade);
        }
    }
}


text:
[ ![Codeship Status for partner-it/b2-php](https://codeship.com/projects/47347300-705f-0133-dfe5-0204a723cae7/status?branch=master)](https://codeship.com/projects/116533) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/partner-it/b2-php/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/partner-it/b2-php/?branch=master) [![Code Coverage](https://scrutinizer-ci.com/g/partner-it/b2-php/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/partner-it/b2-php/?branch=master)

# Backblaze B2 PHP wrapper

## Installation

```
composer require partner-it/b2-php
```

## Setup

Instantiate a new client and get a token:

```php

$client = new \B2\B2Client('accountid', 'applicationKey');
$client->requestToken();

```

### Upload a file

```php

$client->Files->uploadFile('bucketId', '/my/local/path/image.jpg', 'image.jpg', 'image/jpeg');

```

### Dowload a file

Download a file by name:

```php

$data = $b2Client->Files->downloadFileByName('bucketname', 'image.jpg');

```


text:
package com.mredrock.cyxbs.presenter.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import com.mredrock.cyxbs.view.impl.AbsItemVuHolder;

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

/**
 * 高度抽象的Adapter,当然是用于ListView的,包含了数据的增删改功能,已经将getView()方法简单化
 * Created by David on 15/4/24.
 */
public abstract class BasePresenterAdapter<T, V extends AbsItemVuHolder> extends BaseAdapter {
    protected V vu;
    private Context mContext;//万一要用呢
    private int          page   = 0;
    private ArrayList<T> mDatas = new ArrayList<>();

    public BasePresenterAdapter(Context mContext, ArrayList<T> datas) {
        this.mContext = mContext;
        this.mDatas = datas;
    }

    public void add(T elem) {
        mDatas.add(elem);
        notifyDataSetChanged();
    }

    public void addAll(List<T> elements) {
        mDatas.addAll(elements);
        notifyDataSetChanged();
    }

    public void set(T oldElem, T newElem) {
        set(mDatas.indexOf(oldElem), newElem);
    }

    public void set(int index, T elem) {
        mDatas.set(index, elem);
        notifyDataSetChanged();
    }

    public void remove(T elem) {
        mDatas.remove(elem);
        notifyDataSetChanged();
    }

    public void remove(int index) {
        mDatas.remove(index);
        notifyDataSetChanged();
    }

    public void refresh(ArrayList<T> datas) {
        if (datas == null) {
            datas = new ArrayList<T>(0);
        }
        this.mDatas = datas;
        notifyDataSetChanged();
    }

    public void replaceAll(ArrayList<T> elements) {
        mDatas.clear();
        mDatas.addAll(elements);
        notifyDataSetChanged();
    }

    public boolean contains(T elem) {
        return mDatas.contains(elem);
    }

    public void clear() {
        mDatas.clear();
        notifyDataSetChanged();
    }

    public int getPage() {
        return page;
    }

    public void addPage() {
        this.page += 1;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public void resetPage() {
        this.page = 0;
    }

    @Override
    public final View getView(int position, View convertView, ViewGroup parent) {
        if (convertView == null) {
            LayoutInflater inflater = (LayoutInflater) parent.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            try {
                vu = getVuClass().newInstance();
                vu.init(inflater, parent, position);//这一步是必须的,为了初始化
                convertView = vu.getView();
            } catch (InstantiationException e) {
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
        } else {
            //noinspection unchecked
            vu = (V) convertView.getTag();
        }
        if (convertView != null) {
            onBindListItemVu(position, convertView, parent);
        }
        return convertView;
    }

    protected abstract void onBindListItemVu(int position, View convertView, ViewGroup parent);

    @Override
    public int getCount() {
        return mDatas.size();
    }

    @Override
    public T getItem(int position) {
        return mDatas.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    protected abstract Class<V> getVuClass();
}


text:
// Copyright 2019 Google LLC
//
// Licensed 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
//
//     https://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.

#include <stdio.h>
#include <stdint.h>
#include <array>
#include "emu8051.h"

int main() {
  // NOTE: there is no srand set yet.

  while (true) {
    emu8051 emu;
    uint8_t pmem_image[0x100];
    for (size_t i = 0; i < sizeof(pmem_image); i++) {
      pmem_image[i] = rand();
    }

    emu.mem_write(emu8051::mem_type_t::PMEM, /*addr=*/0, pmem_image, sizeof(pmem_image));
    emu.execute(1000);
    putchar('.');
  }

  return 0;
}


text:
int ShutterInstance::SetOpen(bool open) { return GetImpl()->SetOpen(open); }
int ShutterInstance::GetOpen(bool& open) { return GetImpl()->GetOpen(open); }
int ShutterInstance::Fire(double deltaT) { return GetImpl()->Fire(deltaT); }


text:
<ion-header>
  <ion-navbar color="primary">
    <ion-title *ngIf="!edit">{{'accounts.title.new' | translate}}</ion-title>
    <ion-title *ngIf="edit">{{'accounts.title.edit' | translate}}</ion-title>
    <ion-buttons end>
      <button *ngIf="edit" (click)="showDeleteConfirm()" ion-button icon-only>
        <ion-icon name="trash"></ion-icon>
      </button>
      <button (click)="save()" ion-button icon-only>
        <ion-icon name="checkmark"></ion-icon>
      </button>
      <button (click)="cancel()" ion-button icon-only>
        <ion-icon name="close"></ion-icon>
      </button>
    </ion-buttons>
  </ion-navbar>
</ion-header>

<ion-content>
   <ion-item>
    <ion-label stacked color="primary">{{'accounts.field.name' | translate}}</ion-label>
    <ion-input [(ngModel)]="account.name"></ion-input>
  </ion-item>
  <ion-item  tappable (tap)="selectCurrency()">
    <ion-label stacked color="primary">{{'accounts.field.currency' | translate}}</ion-label>
    <ion-input readonly="true" [value]="selectedCurrency?.name"></ion-input>
  </ion-item>
  <ion-item>
    <ion-label stacked color="primary">{{'accounts.field.initBalance' | translate}}</ion-label>
    <ion-input [(ngModel)]="account.initBalance"></ion-input>
  </ion-item>
</ion-content>


text:
'use strict';

/* eslint-disable max-params */

var trim = require('trim');
var repeat = require('repeat-string');
var decimal = require('is-decimal');
var getIndent = require('../util/get-indentation');
var removeIndent = require('../util/remove-indentation');
var interrupt = require('../util/interrupt');

module.exports = list;

var C_ASTERISK = '*';
var C_UNDERSCORE = '_';
var C_PLUS = '+';
var C_DASH = '-';
var C_DOT = '.';
var C_SPACE = ' ';
var C_NEWLINE = '\n';
var C_TAB = '\t';
var C_PAREN_CLOSE = ')';
var C_X_LOWER = 'x';

var TAB_SIZE = 4;
var EXPRESSION_LOOSE_LIST_ITEM = /\n\n(?!\s*$)/;
var EXPRESSION_TASK_ITEM = /^\[([ \t]|x|X)][ \t]/;
var EXPRESSION_BULLET = /^([ \t]*)([*+-]|\d+[.)])( {1,4}(?! )| |\t|$|(?=\n))([^\n]*)/;
var EXPRESSION_PEDANTIC_BULLET = /^([ \t]*)([*+-]|\d+[.)])([ \t]+)/;
var EXPRESSION_INITIAL_INDENT = /^( {1,4}|\t)?/gm;

/* Map of characters which can be used to mark
 * list-items. */
var LIST_UNORDERED_MARKERS = {};

LIST_UNORDERED_MARKERS[C_ASTERISK] = true;
LIST_UNORDERED_MARKERS[C_PLUS] = true;
LIST_UNORDERED_MARKERS[C_DASH] = true;

/* Map of characters which can be used to mark
 * list-items after a digit. */
var LIST_ORDERED_MARKERS = {};

LIST_ORDERED_MARKERS[C_DOT] = true;

/* Map of characters which can be used to mark
 * list-items after a digit. */
var LIST_ORDERED_COMMONMARK_MARKERS = {};

LIST_ORDERED_COMMONMARK_MARKERS[C_DOT] = true;
LIST_ORDERED_COMMONMARK_MARKERS[C_PAREN_CLOSE] = true;

function list(eat, value, silent) {
  var self = this;
  var commonmark = self.options.commonmark;
  var pedantic = self.options.pedantic;
  var tokenizers = self.blockTokenizers;
  var interuptors = self.interruptList;
  var markers;
  var index = 0;
  var length = value.length;
  var start = null;
  var size = 0;
  var queue;
  var ordered;
  var character;
  var marker;
  var nextIndex;
  var startIndex;
  var prefixed;
  var currentMarker;
  var content;
  var line;
  var prevEmpty;
  var empty;
  var items;
  var allLines;
  var emptyLines;
  var item;
  var enterTop;
  var exitBlockquote;
  var isLoose;
  var node;
  var now;
  var end;
  var indented;

  while (index < length) {
    character = value.charAt(index);

    if (character === C_TAB) {
      size += TAB_SIZE - (size % TAB_SIZE);
    } else if (character === C_SPACE) {
      size++;
    } else {
      break;
    }

    index++;
  }

  if (size >= TAB_SIZE) {
    return;
  }

  character = value.charAt(index);

  markers = commonmark ?
    LIST_ORDERED_COMMONMARK_MARKERS :
    LIST_ORDERED_MARKERS;

  if (LIST_UNORDERED_MARKERS[character] === true) {
    marker = character;
    ordered = false;
  } else {
    ordered = true;
    queue = '';

    while (index < length) {
      character = value.charAt(index);

      if (!decimal(character)) {
        break;
      }

      queue += character;
      index++;
    }

    character = value.charAt(index);

    if (!queue || markers[character] !== true) {
      return;
    }

    start = parseInt(queue, 10);
    marker = character;
  }

  character = value.charAt(++index);

  if (character !== C_SPACE && character !== C_TAB) {
    return;
  }

  if (silent) {
    return true;
  }

  index = 0;
  items = [];
  allLines = [];
  emptyLines = [];

  while (index < length) {
    nextIndex = value.indexOf(C_NEWLINE, index);
    startIndex = index;
    prefixed = false;
    indented = false;

    if (nextIndex === -1) {
      nextIndex = length;
    }

    end = index + TAB_SIZE;
    size = 0;

    while (index < length) {
      character = value.charAt(index);

      if (character === C_TAB) {
        size += TAB_SIZE - (size % TAB_SIZE);
      } else if (character === C_SPACE) {
        size++;
      } else {
        break;
      }

      index++;
    }

    if (size >= TAB_SIZE) {
      indented = true;
    }

    if (item && size >= item.indent) {
      indented = true;
    }

    character = value.charAt(index);
    currentMarker = null;

    if (!indented) {
      if (LIST_UNORDERED_MARKERS[character] === true) {
        currentMarker = character;
        index++;
        size++;
      } else {
        queue = '';

        while (index < length) {
          character = value.charAt(index);

          if (!decimal(character)) {
            break;
          }

          queue += character;
          index++;
        }

        character = value.charAt(index);
        index++;

        if (queue && markers[character] === true) {
          currentMarker = character;
          size += queue.length + 1;
        }
      }

      if (currentMarker) {
        character = value.charAt(index);

        if (character === C_TAB) {
          size += TAB_SIZE - (size % TAB_SIZE);
          index++;
        } else if (character === C_SPACE) {
          end = index + TAB_SIZE;

          while (index < end) {
            if (value.charAt(index) !== C_SPACE) {
              break;
            }

            index++;
            size++;
          }

          if (index === end && value.charAt(index) === C_SPACE) {
            index -= TAB_SIZE - 1;
            size -= TAB_SIZE - 1;
          }
        } else if (character !== C_NEWLINE && character !== '') {
          currentMarker = null;
        }
      }
    }

    if (currentMarker) {
      if (!pedantic && marker !== currentMarker) {
        break;
      }

      prefixed = true;
    } else {
      if (!commonmark && !indented && value.charAt(startIndex) === C_SPACE) {
        indented = true;
      } else if (commonmark && item) {
        indented = size >= item.indent || size > TAB_SIZE;
      }

      prefixed = false;
      index = startIndex;
    }

    line = value.slice(startIndex, nextIndex);
    content = startIndex === index ? line : value.slice(index, nextIndex);

    if (
      currentMarker === C_ASTERISK ||
      currentMarker === C_UNDERSCORE ||
      currentMarker === C_DASH
    ) {
      if (tokenizers.thematicBreak.call(self, eat, line, true)) {
        break;
      }
    }

    prevEmpty = empty;
    empty = !trim(content).length;

    if (indented && item) {
      item.value = item.value.concat(emptyLines, line);
      allLines = allLines.concat(emptyLines, line);
      emptyLines = [];
    } else if (prefixed) {
      if (emptyLines.length !== 0) {
        item.value.push('');
        item.trail = emptyLines.concat();
      }

      item = {
        value: [line],
        indent: size,
        trail: []
      };

      items.push(item);
      allLines = allLines.concat(emptyLines, line);
      emptyLines = [];
    } else if (empty) {
      if (prevEmpty) {
        break;
      }

      emptyLines.push(line);
    } else {
      if (prevEmpty) {
        break;
      }

      if (interrupt(interuptors, tokenizers, self, [eat, line, true])) {
        break;
      }

      item.value = item.value.concat(emptyLines, line);
      allLines = allLines.concat(emptyLines, line);
      emptyLines = [];
    }

    index = nextIndex + 1;
  }

  node = eat(allLines.join(C_NEWLINE)).reset({
    type: 'list',
    ordered: ordered,
    start: start,
    loose: null,
    children: []
  });

  enterTop = self.enterList();
  exitBlockquote = self.enterBlock();
  isLoose = false;
  index = -1;
  length = items.length;

  while (++index < length) {
    item = items[index].value.join(C_NEWLINE);
    now = eat.now();

    item = eat(item)(listItem(self, item, now), node);

    if (item.loose) {
      isLoose = true;
    }

    item = items[index].trail.join(C_NEWLINE);

    if (index !== length - 1) {
      item += C_NEWLINE;
    }

    eat(item);
  }

  enterTop();
  exitBlockquote();

  node.loose = isLoose;

  return node;
}

function listItem(ctx, value, position) {
  var offsets = ctx.offset;
  var fn = ctx.options.pedantic ? pedanticListItem : normalListItem;
  var checked = null;
  var task;
  var indent;

  value = fn.apply(null, arguments);

  if (ctx.options.gfm) {
    task = value.match(EXPRESSION_TASK_ITEM);

    if (task) {
      indent = task[0].length;
      checked = task[1].toLowerCase() === C_X_LOWER;
      offsets[position.line] += indent;
      value = value.slice(indent);
    }
  }

  return {
    type: 'listItem',
    loose: EXPRESSION_LOOSE_LIST_ITEM.test(value) ||
      value.charAt(value.length - 1) === C_NEWLINE,
    checked: checked,
    children: ctx.tokenizeBlock(value, position)
  };
}

/* Create a list-item using overly simple mechanics. */
function pedanticListItem(ctx, value, position) {
  var offsets = ctx.offset;
  var line = position.line;

  /* Remove the list-item's bullet. */
  value = value.replace(EXPRESSION_PEDANTIC_BULLET, replacer);

  /* The initial line was also matched by the below, so
   * we reset the `line`. */
  line = position.line;

  return value.replace(EXPRESSION_INITIAL_INDENT, replacer);

  /* A simple replacer which removed all matches,
   * and adds their length to `offset`. */
  function replacer($0) {
    offsets[line] = (offsets[line] || 0) + $0.length;
    line++;

    return '';
  }
}

/* Create a list-item using sane mechanics. */
function normalListItem(ctx, value, position) {
  var offsets = ctx.offset;
  var line = position.line;
  var max;
  var bullet;
  var rest;
  var lines;
  var trimmedLines;
  var index;
  var length;

  /* Remove the list-item's bullet. */
  value = value.replace(EXPRESSION_BULLET, replacer);

  lines = value.split(C_NEWLINE);

  trimmedLines = removeIndent(value, getIndent(max).indent).split(C_NEWLINE);

  /* We replaced the initial bullet with something
   * else above, which was used to trick
   * `removeIndentation` into removing some more
   * characters when possible.  However, that could
   * result in the initial line to be stripped more
   * than it should be. */
  trimmedLines[0] = rest;

  offsets[line] = (offsets[line] || 0) + bullet.length;
  line++;

  index = 0;
  length = lines.length;

  while (++index < length) {
    offsets[line] = (offsets[line] || 0) +
      lines[index].length - trimmedLines[index].length;
    line++;
  }

  return trimmedLines.join(C_NEWLINE);

  function replacer($0, $1, $2, $3, $4) {
    bullet = $1 + $2 + $3;
    rest = $4;

    /* Make sure that the first nine numbered list items
     * can indent with an extra space.  That is, when
     * the bullet did not receive an extra final space. */
    if (Number($2) < 10 && bullet.length % 2 === 1) {
      $2 = C_SPACE + $2;
    }

    max = $1 + repeat(C_SPACE, $2.length) + $3;

    return max + rest;
  }
}


text:
class ModuleDocFragment(object):
    DOCUMENTATION = """
    requirements:
        - "python >= 2.7"
        -  Python SDK for Oracle Cloud Infrastructure U(https://oracle-cloud-infrastructure-python-sdk.readthedocs.io)
    notes:
        - For OCI python sdk configuration, please refer to
          U(https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/configuration.html)
    options:
        config_file_location:
            description:
                - Path to configuration file. If not set then the value of the OCI_CONFIG_FILE environment variable,
                  if any, is used. Otherwise, defaults to ~/.oci/config.
            type: str
        config_profile_name:
            description:
                - The profile to load from the config file referenced by C(config_file_location). If not set, then the
                  value of the OCI_CONFIG_PROFILE environment variable, if any, is used. Otherwise, defaults to the
                  "DEFAULT" profile in C(config_file_location).
            default: "DEFAULT"
            type: str
        api_user:
            description:
                - The OCID of the user, on whose behalf, OCI APIs are invoked. If not set, then the
                  value of the OCI_USER_OCID environment variable, if any, is used. This option is required if the user
                  is not specified through a configuration file (See C(config_file_location)). To get the user's OCID,
                  please refer U(https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm).
            type: str
        api_user_fingerprint:
            description:
                - Fingerprint for the key pair being used. If not set, then the value of the OCI_USER_FINGERPRINT
                  environment variable, if any, is used. This option is required if the key fingerprint is not
                  specified through a configuration file (See C(config_file_location)). To get the key pair's
                  fingerprint value please refer
                  U(https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm).
            type: str
        api_user_key_file:
            description:
                - Full path and filename of the private key (in PEM format). If not set, then the value of the
                  OCI_USER_KEY_FILE variable, if any, is used. This option is required if the private key is
                  not specified through a configuration file (See C(config_file_location)). If the key is encrypted
                  with a pass-phrase, the C(api_user_key_pass_phrase) option must also be provided.
            type: str
        api_user_key_pass_phrase:
            description:
                - Passphrase used by the key referenced in C(api_user_key_file), if it is encrypted. If not set, then
                  the value of the OCI_USER_KEY_PASS_PHRASE variable, if any, is used. This option is required if the
                  key passphrase is not specified through a configuration file (See C(config_file_location)).
            type: str
        auth_type:
            description:
                - The type of authentication to use for making API requests. By default C(auth_type="api_key") based
                  authentication is performed and the API key (see I(api_user_key_file)) in your config file will be
                  used. If this 'auth_type' module option is not specified, the value of the OCI_ANSIBLE_AUTH_TYPE,
                  if any, is used. Use C(auth_type="instance_principal") to use instance principal based authentication
                  when running ansible playbooks within an OCI compute instance.
            choices: ['api_key', 'instance_principal']
            default: 'api_key'
            type: str
        tenancy:
            description:
                - OCID of your tenancy. If not set, then the value of the OCI_TENANCY variable, if any, is
                  used. This option is required if the tenancy OCID is not specified through a configuration file
                  (See C(config_file_location)). To get the tenancy OCID, please refer
                  U(https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm)
            type: str
        region:
            description:
                - The Oracle Cloud Infrastructure region to use for all OCI API requests. If not set, then the
                  value of the OCI_REGION variable, if any, is used. This option is required if the region is
                  not specified through a configuration file (See C(config_file_location)). Please refer to
                  U(https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm) for more information
                  on OCI regions.
            type: str
    """


text:
<?php
/**
*
*/
class blog_model extends CI_model
{
	//nama table dan primary key
	private $table ='blog';
	private $tablecontactus ='contactus';
	private $pk='link';
	private $id='id_blog';
	private $categoryblog='categoryblog';
	private $author='author';
	private $judulblog='judulblog';
	private $viewer='viewer';
	private $tablekomentar='komentar';
	private $pkkomentar='id_komentar';

	//sitemap

  public function getURLS(){

  $query=$this->db->order_by($this->pk,"DESC")->get($this->table);
  return $query->result_array();
  }

//tampilkan 3 berita di halaman home
	public function tampilkantiga(){
		$sql="select * from blog WHERE (gambar <> '--noimage.png') and (gambar <> '') order by id_blog desc limit 3 ";
		$query = $this->db->query($sql);
		return $query;
	}

	//tampilkan semua data
	public function tampilkansemua(){
		$query = $this->db->order_by($this->id,'DESC');
		$query = $this->db->get($this->table);
		return $query;
	}

	//tambah data
	public function tambah($data){
		$this->db->insert($this->table,$data);
	}

	//tambah pesan
	public function tambahpesan($data){
		$this->db->insert($this->tablecontactus,$data);
	}

	public function tampilkansatu($link){
		$q=$this->db->where($this->pk,$link);
		$q=$this->db->get($this->table);
		return $q;
	}

//untuk ubahhhhhhh

	public function getbyid($id){
		$q=$this->db->where($this->id,$id);
		$q=$this->db->get($this->table);
		return $q;
	}

	public function ubah($id,$data){
		$this->db->where($this->id,$id);
		$this->db->update($this->table,$data);
	}

	//untuk hapus
	public function hapus($id) {
        $this->db->where($this->id, $id);
        $this->db->delete($this->table);
    }

    //komentar
//tambah data
	public function tambahkomentar($data){
		$this->db->insert($this->tablekomentar,$data);
	}

	public function tampilkansatukomentar($link){
		$sql="select * from komentar where (link='$link') and (publish='yes') ORDER BY tanggal DESC";
		$query = $this->db->query($sql);
		return $query;
	}

	//untuk hapus komentar
	public function hapuskomentar($id_komentar) {
        $this->db->where($this->pkkomentar, $id_komentar);
        $this->db->delete($this->tablekomentar);
    }

    //tampilkan semua data komentar
	public function tampilkansemuakomentar(){
		$sql="select * from komentar where publish='no' ORDER BY tanggal DESC";
		$query = $this->db->query($sql);
		return $query;
	}

	public function updatekomentar($id_komentar,$data){
		$this->db->where($this->pkkomentar,$id_komentar);
		$this->db->update($this->tablekomentar,$data);
	}

	  //untuk pagination
    //hitung jumlah total data
    public function total_record(){
    	$this->db->from($this->table);
    	return $this->db->count_all_results();
    }

    //tampilkan table dengan limit
    public function blog_limit($limit,$start=0){
    	$this->db->order_by($this->id,'DESC');
    	$this->db->limit($limit,$start);
    	return $this->db->get($this->table);
    }

    //tampilkan category sebagai menu
	public function menucategory(){
		$sql="select * from blog group by categoryblog";
		$query = $this->db->query($sql);
		return $query;
	}

	  //untuk pagination percategory
    //hitung jumlah total data
    public function total_record_category($categoryblog){
    	$sql="select * from blog where categoryblog=$categoryblog";
		//$query = $this->db->query($sql);
		return $this->db->count_all_results();
    }

    //tampilkan table dengan limit
    public function blog_limit_category($categoryblog,$limit,$start=0){

    	$this->db->where($this->categoryblog,$categoryblog);
    	$this->db->order_by($this->pk,'DESC');
    	$this->db->limit($limit,$start);
    	return $this->db->get($this->table);
    }

      //tampilkan table dengan limit
    public function blog_templates(){

    	$this->db->where($this->categoryblog,'templates');
    	$this->db->order_by($this->pk,'DESC');
    	return $this->db->get($this->table);
    }

    public function blog_clients(){

    	$this->db->where($this->categoryblog,'clients');
    	$this->db->order_by($this->pk,'DESC');
    	return $this->db->get($this->table);
    }

    public function hapusgambar($id){
    		$sql="select * from blog where id_blog='$id'";
			$query = $this->db->query($sql);
			return $query;

	}

	 public function total_record_cari($caritext){
    	$sql="select * from blog where judulblog like '%$caritext%'";
		//$query = $this->db->query($sql);
		return $this->db->count_all_results();
    }

      public function blog_limit_cari($caritext,$limit,$start=0){
    	$this->db->like($this->judulblog,$caritext);
    	$this->db->order_by($this->pk,'DESC');
    	$this->db->limit($limit,$start);
    	return $this->db->get($this->table);
    }

    //tampilkan post popular
	public function popularpost(){
		$sql="Select b.link,b.judulblog,b.gambar,b.isiblog, count(k.link) as jml from blog b join komentar k on b.link=k.link where k.publish='yes' group by k.link limit 10";
		$query = $this->db->query($sql);
		return $query;
	}

//viewer counter
	  		public function viewer($id){
    		$sql="update blog set viewer=viewer+1 where id_blog='$id' ";
			$query = $this->db->query($sql);
			return $query;
			}

			 //hitung jumlah total data saat cari author
    public function total_record_author($author){
    	$sql="select * from blog where author=$author";
		//$query = $this->db->query($sql);
		return $this->db->count_all_results();
    }

    //tampilkan table dengan limit
    public function blog_limit_author($author,$limit,$start=0){

    	$this->db->where($this->author,$author);
    	$this->db->order_by($this->pk,'DESC');
    	$this->db->limit($limit,$start);
    	return $this->db->get($this->table);
    }

 function totalpost(){
		$sql="select id_blog from blog where publish='yes' ";
		$query = $this->db->query($sql);
		return $query;
 }

function totalkomentarpending(){
		$sql="select id_komentar from komentar where publish='no' ";
		$query = $this->db->query($sql);
		return $query;
 }

 function totaltestipending(){
		$sql="select id_testimonal from testimonal where publish='no' ";
		$query = $this->db->query($sql);
		return $query;
 }

  function totaluser(){
		$sql="select id_user from userujian";
		$query = $this->db->query($sql);
		return $query;
 }

}


text:
package taskrun

import (
	"fmt"

	"github.com/tektoncd/cli/pkg/actions"
	"github.com/tektoncd/cli/pkg/cli"
	"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
)

// Get will fetch the taskrun resource based on the taskrun name
func Get(c *cli.Clients, trname string, opts metav1.GetOptions, ns string) (*v1beta1.TaskRun, error) {
	unstructuredTR, err := actions.Get(trGroupResource, c.Dynamic, c.Tekton.Discovery(), trname, ns, opts)
	if err != nil {
		return nil, err
	}

	var taskrun *v1beta1.TaskRun
	if err := runtime.DefaultUnstructuredConverter.FromUnstructured(unstructuredTR.UnstructuredContent(), &taskrun); err != nil {
		return nil, fmt.Errorf("failed to get TaskRun from namespace %s", ns)
	}
	return taskrun, nil
}


text:
package br.com.fiap.cloud.dogcare.service.exception;

import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;

@ResponseStatus(HttpStatus.CONFLICT)
public class DocumentConflictException extends APIException {

	public DocumentConflictException() {
		super("Documento jã utilizado anteriormente");
	}

	public DocumentConflictException(String message) {
		super(message);
	}

	private static final long serialVersionUID = 1L;

}


text:
import React, { Component } from 'react';
import PropTypes from 'prop-types';

class ExpandableList extends Component {
  state = {
    toggled: false,
  };

  static propTypes = {
    children: PropTypes.array.isRequired,
    onToggle: PropTypes.func,
    // how many lines to show in the compressed state
    showLines: PropTypes.number,
  };

  static defaultProps = {
    showLines: 1,
  };

  handleToggle = () => {
    this.setState((prevState) => ({
      toggled: !prevState.toggled,
    }));
    if (this.props.onToggle) {
      this.props.onToggle();
    }
  };

  render() {
    if (this.props.children.length <= this.props.showLines) {
      return (

          {this.props.children.map((item, index) => (

              {item}

          ))}

      );
    } else {
      const expandedElems = this.props.children.slice(this.props.showLines).map((item, index) => (

          {item}

      ));
      const expandedContent = (

          {expandedElems}

            Less

      );
      const showMore = (

          +{this.props.children.length - this.props.showLines} more

      );
      return (

          {this.props.children.slice(0, this.props.showLines).map((item, index) => (

              {item}

          ))}
          {this.state.toggled ? expandedContent : showMore}

      );
    }
  }
}

const expandableListClassName = {
  '.expander-text': {
    textDecoration: 'underline',
    cursor: 'pointer',
  },
};

export default ExpandableList;


text:
// This file was automatically generated by lister-gen

package v1beta1

// MutatingWebhookConfigurationListerExpansion allows custom methods to be added to
// MutatingWebhookConfigurationLister.
type MutatingWebhookConfigurationListerExpansion interface{}

// ValidatingWebhookConfigurationListerExpansion allows custom methods to be added to
// ValidatingWebhookConfigurationLister.
type ValidatingWebhookConfigurationListerExpansion interface{}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace Modules.FastReflectionLib
{
    public class MethodInvokerCache : FastReflectionCache<MethodInfo, IMethodInvoker>
    {
        protected override IMethodInvoker Create(MethodInfo key)
        {
            return FastReflectionFactories.MethodInvokerFactory.Create(key);
        }
    }
}


text:
package org.osgi.service.cm;

import org.osgi.annotation.versioning.ConsumerType;

/**
 * Synchronous Listener for Configuration Events. When a
 * {@code ConfigurationEvent} is fired, it is synchronously delivered to all
 * {@code SynchronousConfigurationListener}s.
 *
 *

 * {@code SynchronousConfigurationListener} objects are registered with the
 * Framework service registry and are synchronously notified with a
 * {@code ConfigurationEvent} object when an event is fired.
 *

 * {@code SynchronousConfigurationListener} objects can inspect the received
 * {@code ConfigurationEvent} object to determine its type, the PID of the
 * {@code Configuration} object with which it is associated, and the
 * Configuration Admin service that fired the event.
 *
 *

 * Security Considerations. Bundles wishing to synchronously monitor
 * configuration events will require
 * {@code ServicePermission[SynchronousConfigurationListener,REGISTER]} to
 * register a {@code SynchronousConfigurationListener} service.
 *
 * @author $Id: 6eb8494c350a23abd9ae448970a27e14c1922f63 $
 * @since 1.5
 * @ThreadSafe
 */
@ConsumerType
public interface SynchronousConfigurationListener extends ConfigurationListener {
	// Marker interface
}


text:
u"""
:Copyright:

 Copyright 2013 - 2017
 Andr\xe9 Malo or his licensors, as applicable

:License:

 Licensed 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.

====================
 Text Input Decoder
====================

Text Input Decoder.
"""
__author__ = u"Andr\xe9 Malo"
__docformat__ = "restructuredtext en"

import functools as _ft
import re as _re

from ... import c as _c
from ... import _util
from .. import abstract as _abstract

#: Backslash-escape Substituter
#:
#: :Type: callable
_SLASHSUB = _ft.partial(
    _re.compile(_util.ur(r'\\(.)'), _re.S).sub, _util.ur(r'\1')
)

@_abstract.impl('Decoder')
@_c.impl
class TextDecoder(object):
    """
    Decoder for text input

    :IVariables:
      `encoding` : ``str``
        Character encoding
    """

    def __init__(self, encoding):
        """
        Initialization

        :Parameters:
          `encoding` : ``str``
            Character encoding
        """
        self.encoding = encoding

    def normalize(self, name):  # pylint: disable = no-self-use
        """ :See: `abstract.Decoder` """
        return name

    def decode(self, value, errors='strict'):
        """ :See: `abstract.Decoder` """
        return value.decode(self.encoding, errors)

    def attribute(self, value, errors='strict'):
        """ :See: `abstract.Decoder` """
        value = value.decode(self.encoding, errors)
        if value.startswith(u'"') or value.startswith(u"'"):
            value = value[1:-1]
        return _SLASHSUB(value)


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/ic_stop" android:state_selected="true"/>
    <item android:drawable="@drawable/ic_play"/>
</selector>


text:
<!DOCTYPE html>

<title>Composited images correctly display under large scale transform changes</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1">
<link rel="match" href="image-compositing-large-scale-change-ref.html"/>
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-img-element">


text:
.mm-keyboardfocus a:focus{outline:0}
.mm-menu.mm-keyboardfocus a:focus{background:rgba(255,255,255,.5)}


text:
.root {
	display: block;
	height: 100%;
	overflow: visible;
	word-wrap: break-word;
}


text:
package com.kylantraynor.civilizations.economy;

import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class PhysicalMoney implements Comparable<PhysicalMoney>{

    private final Currency currency;
    private final ItemStack is;

    public PhysicalMoney(Currency currency, Material type){
        this.currency = currency;
        this.is = new ItemStack(type);
        refreshItemMeta();
    }

    public PhysicalMoney(Currency currency, Material type, int amount){
        this(currency,type);
        this.is.setAmount(amount);
    }

    public PhysicalMoney(Currency currency, ItemStack is){
        this.currency = currency;
        this.is = is;
        refreshItemMeta();
    }

    private void refreshItemMeta(){
        ItemMeta im = this.is.getItemMeta();
        im.setDisplayName(getName());
        im.setLore(new ArrayList<>(Arrays.asList("Currency: " + currency.getShortName())));
        this.is.setItemMeta(im);
    }

    public Currency getCurrency(){
        return currency;
    }

    public String getName(){
        switch(this.is.getType()){
            case GOLD_NUGGET:
                return ChatColor.RESET + "Golden " + currency.getName();
            case IRON_NUGGET:
                return ChatColor.RESET + "Iron " + currency.getName();
        }
        return this.is.getItemMeta().getDisplayName();
    }

    /**
     * Gets the value of one element of that kind.
     * @return The value of one element in cents.
     */
    public int getValue(){
        return getCurrency().getValue(this.is.getType());
    }

    /**
     * Gets the value of the full stack.
     * @return The value of the stack in cents.
     */
    public int getTotalValue(){
        return getCurrency().getValue(this.is.getType()) * this.is.getAmount();
    }

    public static PhysicalMoney get(ItemStack is){
        Currency currency = null;
        List<String> lore = is.getItemMeta().getLore();
        Pattern rg = Pattern.compile("Currency:\\s+([A-Z]+)");
        for(String s : lore){
            Matcher m = rg.matcher(s);
            if(m.matches()){
                currency = Currency.get(m.group(1));
                break;
            }
        }
        if(currency != null){
            return new PhysicalMoney(currency, is);
        } else {
            return null;
        }
    }

    /**
     * Compares this object with the specified object for order.  Returns a
     * negative integer, zero, or a positive integer as this object is less
     * than, equal to, or greater than the specified object.
     *

     *
The implementor must ensure <tt>sgn(x.compareTo(y)) ==
     * -sgn(y.compareTo(x))</tt> for all <tt>x</tt> and <tt>y</tt>.  (This
     * implies that <tt>x.compareTo(y)</tt> must throw an exception iff
     * <tt>y.compareTo(x)</tt> throws an exception.)
     *

     *
The implementor must also ensure that the relation is transitive:
     * <tt>(x.compareTo(y)>0 && y.compareTo(z)>0)</tt> implies
     * <tt>x.compareTo(z)>0</tt>.
     *

     *
Finally, the implementor must ensure that <tt>x.compareTo(y)==0</tt>
     * implies that <tt>sgn(x.compareTo(z)) == sgn(y.compareTo(z))</tt>, for
     * all <tt>z</tt>.
     *

     *
It is strongly recommended, but not strictly required that
     * <tt>(x.compareTo(y)==0) == (x.equals(y))</tt>.  Generally speaking, any
     * class that implements the <tt>Comparable</tt> interface and violates
     * this condition should clearly indicate this fact.  The recommended
     * language is "Note: this class has a natural ordering that is
     * inconsistent with equals."
     *

     *
In the foregoing description, the notation
     * <tt>sgn(</tt>expression<tt>)</tt> designates the mathematical
     * signum function, which is defined to return one of <tt>-1</tt>,
     * <tt>0</tt>, or <tt>1</tt> according to whether the value of
     * expression is negative, zero or positive.
     *
     * @param o the object to be compared.
     * @return a negative integer, zero, or a positive integer as this object
     * is less than, equal to, or greater than the specified object.
     * @throws NullPointerException if the specified object is null
     * @throws ClassCastException   if the specified object's type prevents it
     *                              from being compared to this object.
     */
    @Override
    public int compareTo(PhysicalMoney o) {
        if(o == null) throw new NullPointerException();
        int result = Integer.compare(this.getValue(), o.getValue());
        return result == 0 ? Integer.compare(this.is.getAmount(), o.is.getAmount()) : result;
    }
}


text: note to self: bashrc function to go between wiki and its repo if both local under same directory


text:
package com.planet_ink.coffee_mud.Commands;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.ListingLibrary;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;

import java.util.*;

public class Commands extends StdCommand
{
	public Commands()
	{
	}

	private final String[] access=I(new String[]{"COMMANDS"});
	@Override
	public String[] getAccessWords()
	{
		return access;
	}

	@Override
	public boolean execute(final MOB mob, final List<String> commands, final int metaFlags)
		throws java.io.IOException
	{
		if(!mob.isMonster())
		{
			if ((commands!=null)
			&& (commands.size()>1)
			&& ("CLEAR".startsWith(commands.get(1).toString().toUpperCase())))
			{
				mob.clearCommandQueue();
				mob.tell(L("Command queue cleared."));
				return false;
			}
			final StringBuffer commandList=new StringBuffer("");
			final List<String> commandSet=new ArrayList<String>();
			int col=0;
			final Set<String> done=new HashSet<String>();
			for(final Enumeration<Command> e=CMClass.commands();e.hasMoreElements();)
			{
				final Command C=e.nextElement();
				if(C.putInCommandlist())
				{
					final String[] access=C.getAccessWords();
					if((access!=null)
					&&(access.length>0)
					&&(access[0].length()>0)
					&&(!done.contains(access[0]))
					&&(C.securityCheck(mob)))
					{
						done.add(access[0]);
						commandSet.add(access[0]);
					}
				}
			}
			for(final Enumeration<Ability> a=mob.allAbilities();a.hasMoreElements();)
			{
				final Ability A=a.nextElement();
				if((A!=null)
				&&(A.triggerStrings()!=null)
				&&(A.triggerStrings().length>0)
				&&(A.putInCommandlist())
				&&(!done.contains(A.triggerStrings()[0])))
				{
					done.add(A.triggerStrings()[0]);
					commandSet.add(A.triggerStrings()[0]);
				}
			}
			Collections.sort(commandSet);
			final int COL_LEN=CMLib.lister().fixColWidth(19.0,mob);
			col-=1;
			for(final Iterator<String> i=commandSet.iterator();i.hasNext();)
			{
				final String s=i.next();
				if(++col>3)
				{
					commandList.append("\n\r");
					col=0;
				}
				commandList.append(CMStrings.padRight("^<HELP^>"+s+"^</HELP^>",COL_LEN));
			}
			commandList.append("\n\r\n\rEnter HELP 'COMMAND' for more information on these commands.\n\r");
			mob.session().colorOnlyPrintln(L("^HComplete commands list:^?\n\r@x1",commandList.toString()),false);
		}
		return false;
	}

	@Override
	public boolean canBeOrdered()
	{
		return true;
	}
}


text:
package main

import (
	"fmt"
	"log"
	"strconv"
	"strings"
	"unicode"
)

func (self *Param) GetGoName() string {
	goName := self.Name
	if isGoReservedWord(goName) {
		goName += "_"
	}
	return goName
}

func (self *Param) CollectInfo(isReturn bool, fn *Function) {
	// name
	self.GoName = self.GetGoName()
	if isReturn {
		self.GoName = "return__"
	}

	// type info
	if self.Array != nil { // array type
		self.IsArray = true
		self.CType = self.Array.CType
		self.CTypeName = self.Array.Name // for spec only
		self.ElementCType = self.Array.Type.CType
		self.ElementCTypeName = self.Array.Type.Name // for spec only
		self.ElementGoType = cTypeToGoType(self.ElementCType)
		if self.Array.Length != "" { // length param
			n, err := strconv.Atoi(self.Array.Length)
			checkError(err)
			self.LenParamName = fn.Params[n].GetGoName()
		}
		if self.Array.ZeroTerminated == "1" {
			self.IsZeroTerminated = true
		}
	} else if self.Type != nil { // non-array type
		self.CType = self.Type.CType
		self.CTypeName = self.Type.Name // for spec only
	}
	self.GoType = cTypeToGoType(self.CType) // go type in function signature
	if self.GoType == "" {
		log.Fatal("ctype is not converted to gotype " + self.CType)
	}

	// skip void type
	if self.CTypeName == "none" || self.CType == "void" || self.GoType == "C.void" {
		self.IsVoid = true
		return
	}

	// check direction
	if self.Direction == "out" { // out param
		if !strings.HasSuffix(self.CType, "*") || !strings.HasPrefix(self.GoType, "*") {
			log.Fatal("non-pointer out param " + self.CType)
		}
		// convert to non-pointer type
		self.CType = self.CType[:len(self.CType)-1]
		self.GoType = self.GoType[1:]
	} else if self.Direction == "" { // in param
		self.Direction = "in"
	}
	if isReturn {
		self.Direction = "out"
	}

	// type spec, for type mapping
	spec := self.Direction
	if self.GoType != "" {
		spec += " GoType " + self.GoType
	}
	if self.CTypeName != "" {
		spec += " TypeName " + self.CTypeName
	}
	if self.IsArray {
		spec += " IsArray"
	}
	if self.ElementGoType != "" {
		spec += " ElemType " + self.ElementGoType
	}
	if self.ElementCTypeName != "" {
		spec += " ElemName " + self.ElementCTypeName
	}
	if self.LenParamName != "" {
		spec += " HasLenParam"
	}
	if self.IsZeroTerminated {
		spec += " ZeroTerminated"
	}
	self.TypeSpec = spec

	// type mapping
	self.MappedType = self.MapType()

	// cgo
	if self.Direction == "in" {
		self.InParamMarshal() // convert go value to c value
	} else if self.Direction == "out" {
		self.OutParamMarshal() // convert c value to go value
	}
}

var TypeMapping = make(map[string]string)

func (self *Param) MapType() (ret string) {
	// query type mapping dict
	var ok bool
	if ret, ok = TypeMapping[self.TypeSpec]; ok {
		return
	}

	// skip complex types
	t := self.GoType
	for t[0] == '*' {
		t = t[1:]
	}
	if strings.HasPrefix(t, "C.") && unicode.IsUpper(rune(t[2])) {
		ret = self.GoType
		return
	}

	switch self.TypeSpec {

	// bool
	case "in GoType C.gboolean TypeName gboolean",
		"out GoType C.gboolean TypeName gboolean":
		ret = "bool"

	// numeric
	case "in GoType C.gchar TypeName gchar",
		"out GoType C.gchar TypeName gchar":
		ret = "byte"
	case "in GoType C.gint TypeName gint",
		"in GoType C.int TypeName gint",
		"out GoType C.int TypeName gint",
		"out GoType C.pid_t TypeName gint",
		"out GoType C.gint TypeName gint":
		ret = "int"
	case "in GoType C.guint TypeName guint",
		"in GoType C.uid_t TypeName guint",
		"out GoType C.uid_t TypeName guint",
		"out GoType C.guint TypeName guint":
		ret = "uint"
	case "out GoType C.gunichar TypeName gunichar",
		"in GoType C.gunichar TypeName gunichar":
		ret = "rune"
	case "in GoType C.gint8 TypeName gint8":
		ret = "int8"
	case "in GoType C.guint8 TypeName guint8",
		"out GoType C.guchar TypeName guint8",
		"in GoType C.guchar TypeName guint8",
		"out GoType C.guint8 TypeName guint8":
		ret = "uint8"
	case "in GoType C.gint16 TypeName gint16",
		"out GoType C.gint16 TypeName gint16":
		ret = "int16"
	case "out GoType C.guint16 TypeName guint16",
		"in GoType C.guint16 TypeName guint16":
		ret = "uint16"
	case "out GoType C.gint32 TypeName gint32",
		"in GoType C.gint32 TypeName gint32":
		ret = "int32"
	case "in GoType C.guint32 TypeName guint32",
		"out GoType C.guint32 TypeName guint32":
		ret = "uint32"
	case "in GoType C.glong TypeName glong",
		"out GoType C.glong TypeName glong",
		"in GoType C.gsize TypeName gsize",
		"in GoType C.gssize TypeName gssize",
		"in GoType C.gint64 TypeName gint64",
		"out GoType C.gint64 TypeName gint64",
		"out GoType C.gssize TypeName gssize",
		"in GoType C.goffset TypeName gint64",
		"out GoType C.goffset TypeName gint64",
		"out GoType C.gsize TypeName gsize":
		ret = "int64"
	case "in GoType C.gulong TypeName gulong",
		"out GoType C.gulong TypeName gulong",
		"out GoType C.guint64 TypeName guint64",
		"in GoType C.guint64 TypeName guint64":
		ret = "uint64"
	case "in GoType C.gfloat TypeName gfloat",
		"out GoType C.gfloat TypeName gfloat":
		ret = "float32"
	case "in GoType C.gdouble TypeName gdouble",
		"in GoType C.double TypeName gdouble",
		"out GoType C.double TypeName gdouble",
		"in GoType C.double TypeName long double",
		"out GoType C.gdouble TypeName gdouble":
		ret = "float64"

	// string
	case "in GoType *C.gchar TypeName utf8",
		"in GoType *C.char TypeName utf8",
		"in GoType *C.gchar TypeName filename",
		"out GoType *C.char TypeName utf8",
		"out GoType *C.gchar TypeName filename",
		"in GoType *C.char TypeName filename",
		"out GoType *C.guchar IsArray ElemType *C.guchar ElemName guint8 HasLenParam",
		"in GoType *C.gchar IsArray ElemName gchar HasLenParam",
		"out GoType *C.gchar TypeName utf8":
		ret = "string"

	// untyped pointer
	case "in GoType C.gpointer TypeName gpointer",
		"in GoType C.gconstpointer TypeName gpointer",
		"in GoType unsafe.Pointer TypeName gpointer",
		"out GoType C.gpointer TypeName gpointer":
		ret = "unsafe.Pointer"

	// string slice
	case "in GoType **C.gchar IsArray ElemType *C.gchar ElemName utf8",
		"in GoType **C.gchar IsArray ElemName utf8",
		"out GoType **C.gchar IsArray ElemType **C.gchar ElemName utf8 HasLenParam ZeroTerminated",
		"in GoType **C.guchar TypeName guint8",
		"in GoType **C.char IsArray ElemType *C.char ElemName utf8",
		"in GoType **C.char IsArray ElemName utf8",
		"out GoType **C.gchar IsArray ElemName utf8 HasLenParam",
		"in GoType **C.char IsArray ElemType *C.char ElemName utf8 HasLenParam",
		"in GoType **C.gchar TypeName utf8":
		ret = "[]string"

	// numeric slice
	case "in GoType *C.gint IsArray ElemType C.gint ElemName gint",
		"out GoType *C.gint IsArray ElemType *C.gint ElemName gint HasLenParam",
		"out GoType *C.gint IsArray ElemType C.gint ElemName gint HasLenParam",
		"in GoType *C.gint IsArray ElemType C.gint ElemName gint HasLenParam":
		ret = "[]int"
	case "out GoType *C.guint IsArray ElemType C.guint ElemName guint HasLenParam":
		ret = "[]uint"
	case "in GoType *C.guint8 IsArray ElemName guint8":
		ret = "[]uint8"

	// bytes
	case "out GoType *C.guint8 IsArray ElemType C.guint8 ElemName guint8 HasLenParam",
		"in GoType *C.guint8 IsArray ElemType C.guint8 ElemName guint8 HasLenParam",
		"out GoType *C.guchar IsArray ElemType C.guchar ElemName guint8 HasLenParam",
		"in GoType *C.gchar IsArray ElemType C.gchar ElemName utf8 HasLenParam",
		"out GoType *C.gchar IsArray ElemName guint8 HasLenParam",
		"in GoType *C.guchar IsArray ElemName guint8 HasLenParam",
		"out GoType *C.guchar IsArray ElemName guint8 HasLenParam",
		"in GoType *C.guchar IsArray ElemType C.guchar ElemName guint8 HasLenParam",
		"out GoType unsafe.Pointer IsArray ElemName guint8 HasLenParam",
		"in GoType *C.guchar IsArray ElemType C.guchar ElemName guint8",
		"in GoType unsafe.Pointer IsArray ElemName guint8 HasLenParam",
		"in GoType *C.gchar IsArray ElemName guint8 HasLenParam":
		ret = "[]byte"

	// pointer to fundamental types
	case "in GoType *C.gint TypeName gint",
		"in GoType *C.guint16 TypeName guint16",
		"in GoType *C.gsize TypeName gsize",
		"in GoType *C.int TypeName gint":
		ret = self.GoType

	// not enough info FIXME patch it. in param may be easy
	case "out GoType *C.gint IsArray ElemType C.gint ElemName gint",
		"out GoType **C.gchar IsArray ElemName utf8",
		"out GoType *C.gchar* const IsArray ElemName utf8",
		"out GoType *C.guint8 TypeName guint8",
		"out GoType *C.guint IsArray ElemType *C.guint ElemName guint",
		"out GoType *C.gunichar2 TypeName guint16",
		"out GoType *C.gunichar TypeName gunichar",
		"in GoType *C.gunichar2 TypeName guint16",
		"in GoType *C.gunichar TypeName gunichar",
		"out GoType *C.char* const IsArray ElemName utf8",
		"in GoType *C.guchar TypeName guint8",
		"out GoType **C.gchar IsArray ElemType **C.gchar ElemName utf8",
		"out GoType *C.gchar IsArray ElemName guint8",
		"in GoType *C.gpointer TypeName gpointer",
		"out GoType *C.char IsArray ElemName guint8",
		"out GoType **C.char IsArray ElemName utf8",
		"in GoType **C.char TypeName utf8",
		"out GoType *C.guchar TypeName guint8",
		"out GoType *C.guchar IsArray ElemType C.guchar ElemName guint8",
		"in GoType ***C.gchar TypeName utf8",
		"in GoType *C.glong TypeName glong":
		ret = self.GoType

	// inout to in param
	case "in GoType ***C.char IsArray ElemType **C.char ElemName utf8 HasLenParam",
		"in GoType ***C.gchar IsArray ElemType **C.gchar ElemName utf8 HasLenParam":
		ret = self.GoType

	// cairo TODO
	case "in GoType *C.cairo_surface_t TypeName cairo.Surface",
		"out GoType *C.cairo_region_t TypeName cairo.Region",
		"in GoType *C.cairo_t TypeName cairo.Context",
		"out GoType *C.cairo_surface_t TypeName cairo.Surface",
		"out GoType *C.cairo_t TypeName cairo.Context",
		"in GoType *C.cairo_region_t TypeName cairo.Region":
		ret = self.GoType

	default:
		p("FIXME type mapping %s @ %s -> %s\n", self.Name, self.Function.CIdentifier, self.TypeSpec)
		ret = self.GoType

	}
	return
}

var InParamMapping = make(map[string]func(*Param))

func (self *Param) InParamMarshal() {
	if self.GoType == self.MappedType { // not mapped
		self.CgoParam = self.GoName
	} else { // do type cast
		spec := fmt.Sprintf("%s -> %s", self.MappedType, self.GoType)

		// query mapping
		if f, ok := InParamMapping[spec]; ok {
			f(self)
			return
		}

		ff := func(s string) string {
			return replace(s, map[string]string{
				"name": self.GoName,
			})
		}

		// check xml defined
		if e, ok := self.Generator.InParamMarshals[spec]; ok {
			if e.Param != "" {
				self.CgoParam = ff(e.Param)
			}
			if e.Before != "" {
				self.CgoBeforeStmt += ff(e.Before)
			}
			if e.After != "" {
				self.CgoAfterStmt += ff(e.After)
			}
			return
		}

		// helpers
		sliceToPointer := func(p string) {
			self.CgoBeforeStmt = ff("__header__$$name := (*reflect.SliceHeader)(unsafe.Pointer(&$$name))")
			self.CgoParam = fs("(%s)(unsafe.Pointer(__header__%s.Data))", p, self.GoName)
		}

		switch spec {
		// bool
		case "bool -> C.gboolean":
			self.CgoBeforeStmt = ff("__cgo__$$name := C.gboolean(0); if $$name { __cgo__$$name = C.gboolean(1)};")
			self.CgoParam = ff("__cgo__$$name")

		// char
		case "byte -> C.char":
			self.CgoParam = ff("C.char($$name)")
		case "byte -> C.gchar":
			self.CgoParam = ff("C.gchar($$name)")
		case "rune -> C.gunichar":
			self.CgoParam = ff("C.gunichar($$name)")

		// string
		case "string -> *C.char":
			self.CgoBeforeStmt = ff("__cgo__$$name := C.CString($$name);")
			self.CgoParam = ff("__cgo__$$name")
			self.CgoAfterStmt += ff("C.free(unsafe.Pointer(__cgo__$$name));")
		case "string -> *C.gchar":
			self.CgoBeforeStmt = ff("__cgo__$$name := (*C.gchar)(unsafe.Pointer(C.CString($$name)));")
			self.CgoParam = ff("__cgo__$$name")
			self.CgoAfterStmt += ff("C.free(unsafe.Pointer(__cgo__$$name));")

		// int
		case "int -> C.gint":
			self.CgoParam = ff("C.gint($$name)")
		case "int -> C.int":
			self.CgoParam = ff("C.int($$name)")
		case "uint -> C.guint":
			self.CgoParam = ff("C.guint($$name)")
		case "uint -> C.uid_t":
			self.CgoParam = ff("C.uid_t($$name)")
		case "int8 -> C.gint8":
			self.CgoParam = ff("C.gint8($$name)")
		case "uint8 -> C.guint8":
			self.CgoParam = ff("C.guint8($$name)")
		case "uint8 -> C.guchar":
			self.CgoParam = ff("C.guchar($$name)")
		case "int16 -> C.gint16":
			self.CgoParam = ff("C.gint16($$name)")
		case "uint16 -> C.guint16":
			self.CgoParam = ff("C.guint16($$name)")
		case "int32 -> C.gint32":
			self.CgoParam = ff("C.gint32($$name)")
		case "uint32 -> C.guint32":
			self.CgoParam = ff("C.guint32($$name)")
		case "int64 -> C.gint64":
			self.CgoParam = ff("C.gint64($$name)")
		case "uint64 -> C.guint64":
			self.CgoParam = ff("C.guint64($$name)")
		case "uint64 -> C.gulong":
			self.CgoParam = ff("C.gulong($$name)")
		case "int64 -> C.glong":
			self.CgoParam = ff("C.glong($$name)")
		case "int64 -> C.gsize":
			self.CgoParam = ff("C.gsize($$name)")
		case "int64 -> C.gssize":
			self.CgoParam = ff("C.gssize($$name)")
		case "int64 -> C.gulong":
			self.CgoParam = ff("C.gulong($$name)")
		case "int64 -> C.goffset":
			self.CgoParam = ff("C.goffset($$name)")

		// float
		case "float32 -> C.gfloat":
			self.CgoParam = ff("C.gfloat($$name)")
		case "float64 -> C.double":
			self.CgoParam = ff("C.double($$name)")
		case "float64 -> C.gdouble":
			self.CgoParam = ff("C.gdouble($$name)")

		// slice FIXME convert go string to c string first
		case "[]byte -> *C.gchar":
			sliceToPointer("*C.gchar")
		case "[]byte -> *C.guchar":
			sliceToPointer("*C.guchar")
		case "[]byte -> *C.guint8":
			sliceToPointer("*C.guint8")
		case "[]string -> **C.gchar":
			sliceToPointer("**C.gchar")
		case "[]string -> **C.guchar":
			sliceToPointer("**C.guchar")
		case "[]string -> **C.char":
			sliceToPointer("**C.char")
		case "[]int -> *C.gint":
			sliceToPointer("*C.gint")
		case "[]uint8 -> *C.guint8":
			sliceToPointer("*C.guint8")
		case "[]byte -> unsafe.Pointer":
			sliceToPointer("unsafe.Pointer")

		// untyped pointer
		case "unsafe.Pointer -> C.gpointer":
			self.CgoParam = ff("(C.gpointer)($$name)")
		case "unsafe.Pointer -> C.gconstpointer":
			self.CgoParam = ff("(C.gconstpointer)($$name)")

		default:
			p("FIXME in param -> %s\n", spec)
		}
	}
}

var OutParamMapping = make(map[string]func(*Param))

func (self *Param) OutParamMarshal() {
	if self.GoType == self.MappedType { // not mapped
		self.CgoParam = "&" + self.GoName
	} else { // mapped
		self.CgoBeforeStmt = fs("var __cgo__%s %s", self.GoName, self.GoType)
		self.CgoParam = "&__cgo__" + self.GoName

		spec := fs("%s -> %s", self.GoType, self.MappedType)

		if f, ok := OutParamMapping[spec]; ok {
			f(self)
			return
		}

		ff := func(s string) string {
			return replace(s, map[string]string{
				"name": self.GoName,
				"len":  self.LenParamName,
			})
		}

		// check xml defined
		if e, ok := self.Generator.OutParamMarshals[spec]; ok {
			if e.Param != "" {
				self.CgoParam = ff(e.Param)
			}
			if e.Before != "" {
				self.CgoBeforeStmt += ff(e.Before)
			}
			if e.After != "" {
				self.CgoAfterStmt += ff(e.After)
			}
			return
		}

		// helpers
		pointerAndLenToSlice := `defer func() {
				__header__$$name := (*reflect.SliceHeader)(unsafe.Pointer(&$$name))
				__header__$$name.Len = int($$len)
				__header__$$name.Cap = int($$len)
				__header__$$name.Data = uintptr(unsafe.Pointer(__cgo__$$name))
			}();`

		switch spec {

		// bool
		case "C.gboolean -> bool":
			self.CgoAfterStmt += ff("$$name = __cgo__$$name == C.gboolean(1);")

		// byte
		case "C.gchar -> byte":
			self.CgoAfterStmt += ff("$$name = byte(__cgo__$$name);")
		case "C.gunichar -> rune":
			self.CgoAfterStmt += ff("$$name = rune(__cgo__$$name);")

		// string
		case "*C.gchar -> string",
			"*C.guchar -> string":
			self.CgoAfterStmt += ff("$$name = C.GoString((*C.char)(unsafe.Pointer(__cgo__$$name)));")
		case "*C.char -> string":
			self.CgoAfterStmt += ff("$$name = C.GoString(__cgo__$$name);")

		// numeric
		case "C.gint -> int",
			"C.pid_t -> int",
			"C.int -> int":
			self.CgoAfterStmt += ff("$$name = int(__cgo__$$name);")
		case "C.guint -> uint",
			"C.uid_t -> uint":
			self.CgoAfterStmt += ff("$$name = uint(__cgo__$$name);")
		case "C.guint8 -> uint8",
			"C.guchar -> uint8":
			self.CgoAfterStmt += ff("$$name = uint8(__cgo__$$name);")
		case "C.gint16 -> int16":
			self.CgoAfterStmt += ff("$$name = int16(__cgo__$$name);")
		case "C.guint16 -> uint16":
			self.CgoAfterStmt += ff("$$name = uint16(__cgo__$$name);")
		case "C.gint32 -> int32":
			self.CgoAfterStmt += ff("$$name = int32(__cgo__$$name);")
		case "C.guint32 -> uint32":
			self.CgoAfterStmt += ff("$$name = uint32(__cgo__$$name);")
		case "C.gsize -> int64",
			"C.gint64 -> int64",
			"C.gssize -> int64",
			"C.goffset -> int64",
			"C.glong -> int64":
			self.CgoAfterStmt += ff("$$name = int64(__cgo__$$name);")
		case "C.guint64 -> uint64",
			"C.gulong -> uint64":
			self.CgoAfterStmt += ff("$$name = uint64(__cgo__$$name);")
		case "C.gfloat -> float32":
			self.CgoAfterStmt += ff("$$name = float32(__cgo__$$name);")
		case "C.double -> float64",
			"C.gdouble -> float64":
			self.CgoAfterStmt += ff("$$name = float64(__cgo__$$name);")

		// bytes
		case "*C.gchar -> []byte",
			"*C.guchar -> []byte",
			"*C.guint8 -> []byte",
			"unsafe.Pointer -> []byte":
			if self.LenParamName != "" { // len param
				// defer is needed because length param may be later.
				self.CgoAfterStmt += ff(`defer func() { $$name = C.GoBytes(unsafe.Pointer(__cgo__$$name), C.int($$len)) }();`)
			} else {
				p("no len param\n")
			}

		// string slice
		case "**C.gchar -> []string":
			self.CgoAfterStmt += ff(`var __slice__$$name []*C.gchar
				__header__$$name := (*reflect.SliceHeader)(unsafe.Pointer(&__slice__$$name))
				__header__$$name.Len = 4294967296
				__header__$$name.Cap = 4294967296
				__header__$$name.Data = uintptr(unsafe.Pointer(__cgo__$$name))
				for _, p := range __slice__$$name {
					if p == nil { break }
					$$name = append($$name, C.GoString((*C.char)(unsafe.Pointer(p))))
				};`)

		// uint slice
		case "*C.guint -> []uint",
			"*C.gint -> []int":
			self.CgoAfterStmt += ff(pointerAndLenToSlice)

		// untyped pointer
		case "C.gpointer -> unsafe.Pointer":
			self.CgoAfterStmt += ff("$$name = unsafe.Pointer(__cgo__$$name);")

		default:
			p("FIXME out param -> %s\n", spec)
		}
	}
}


text:
namespace PPSystem.Web.ViewModels.CV
{
    using PPSystem.Models.CV;
    using PPSystem.Web.Infrastructure.Mapping;

    public class LanguageViewModel : IMapFrom<Language>
    {
        public string Name { get; set; }
    }
}


text:
from PyQt4.Qt import *
from numpy import *
import Avogadro
import sys
import unittest

from util import *

class TestCamera(unittest.TestCase):
  def setUp(self):
    # create the GLWidget and load the default engines
    self.glwidget = Avogadro.GLWidget()
    self.glwidget.loadDefaultEngines()

    self.molecule = Avogadro.molecules.addMolecule()
    self.molecule.addAtom()
    self.glwidget.molecule = self.molecule
    self.assertNotEqual(self.glwidget.camera, None)

  def tearDown(self):
    # create the GLWidget and load the default engines
    None

  def test_parent(self):
    self.assertNotEqual(self.glwidget.camera.parent, None)

  def test_angleOfViewY(self):
    self.assert_(self.glwidget.camera.angleOfViewY)
    testReadWriteProperty(self, self.glwidget.camera.angleOfViewY, 40.0, 60.0)

  def test_modelview(self):
    self.glwidget.camera.modelview
    m = self.glwidget.camera.modelview
    self.glwidget.camera.modelview = m

  def test_various(self):
    self.glwidget.camera.applyPerspective()
    self.glwidget.camera.applyModelview()
    self.glwidget.camera.initializeViewPoint()
    dist = self.glwidget.camera.distance(array([0., 0., 0.]))
    self.glwidget.camera.translate(array([0., 0., 0.]))
    self.glwidget.camera.pretranslate(array([0., 0., 0.]))
    self.glwidget.camera.rotate(3.14, array([0., 0., 0.]))
    self.glwidget.camera.prerotate(3.14, array([0., 0., 0.]))
    self.glwidget.camera.normalize()

  def test_axes(self):
    self.glwidget.camera.transformedXAxis
    self.glwidget.camera.transformedYAxis
    self.glwidget.camera.transformedZAxis
    self.glwidget.camera.backTransformedXAxis
    self.glwidget.camera.backTransformedYAxis
    self.glwidget.camera.backTransformedZAxis

  def test_project(self):

    point = QPoint(10,20)
    self.assertEqual(len(self.glwidget.camera.unProject(point)), 3)
    self.assertEqual(len(self.glwidget.camera.unProject(point, array([1., 0., 0.]))), 3)
    # added to fix name conflict WithZ
    self.assertEqual(len(self.glwidget.camera.unProjectWithZ(array([1., 2., 0.]))), 3)

    self.assertEqual(len(self.glwidget.camera.project(array([1., 2., 3.]))), 3)

if __name__ == "__main__":
  # create a new application
  # (must be done before creating a GLWidget)
  app = QApplication(sys.argv)
  unittest.main()
  sys.exit(app.exec_())


text:
layout: page
title: About
permalink: /about/
weight: 3
---

# **Hello!**

<img src="../assets/nuno_pixel.png" align="left" alt="skew" width="120"/>

I'm skew!

Reach out through the icons at the bottom of the page.


text:
import * as React from "react";
import { DEFAULT_ICON } from "../open_farm/icons";
import { push } from "../history";
import { TaggedPlant, Mode } from "../farm_designer/map/interfaces";
import { unpackUUID } from "../util";
import { t } from "../i18next_wrapper";
import { maybeGetCachedPlantIcon } from "../open_farm/cached_crop";
import {
  selectPoint, setHoveredPlant, mapPointClickAction,
} from "../farm_designer/map/actions";
import { plantAge } from "./map_state_to_props";
import { getMode } from "../farm_designer/map/util";

export interface PlantInventoryItemProps {
  plant: TaggedPlant;
  dispatch: Function;
  hovered: boolean;
}

interface PlantInventoryItemState {
  icon: string;
}

// The individual plants that show up in the farm designer sub nav.
export class PlantInventoryItem extends
  React.Component<PlantInventoryItemProps, PlantInventoryItemState> {
  state: PlantInventoryItemState = { icon: "" };

  updateStateIcon = (i: string) => this.setState({ icon: i });

  render() {
    const { plant, dispatch } = this.props;
    const plantId = (plant.body.id || "ERR_NO_PLANT_ID").toString();

    const toggle = (action: "enter" | "leave") => {
      const isEnter = action === "enter";
      const plantUUID = isEnter ? plant.uuid : undefined;
      const icon = isEnter ? this.state.icon : "";
      dispatch(setHoveredPlant(plantUUID, icon));
    };

    const click = () => {
      if (getMode() == Mode.boxSelect) {
        mapPointClickAction(dispatch, plant.uuid)();
        toggle("leave");
      } else {
        const plantCategory =
          unpackUUID(plant.uuid).kind === "PlantTemplate"
            ? "gardens/templates"
            : "plants";
        push(`/app/designer/${plantCategory}/${plantId}`);
        dispatch(selectPoint([plant.uuid]));
      }
    };

    const onLoad = (e: React.SyntheticEvent<HTMLImageElement>) =>
      maybeGetCachedPlantIcon(slug, e.currentTarget, this.updateStateIcon);

    // Name given from OpenFarm's API.
    const label = plant.body.name || "Unknown plant";
    const slug = plant.body.openfarm_slug;

    return <div
      className={`plant-search-item ${this.props.hovered ? "hovered" : ""}`}
      key={plantId}
      onMouseEnter={() => toggle("enter")}
      onMouseLeave={() => toggle("leave")}
      onClick={click}>
      <img
        className="plant-search-item-image"
        src={DEFAULT_ICON}
        onLoad={onLoad} />
      <span className="plant-search-item-name">
        {label}
      </span>
      <i className="plant-search-item-age">
        {plantAge(plant)} {t("days old")}
      </i>
    </div>;
  }
}


text:
set -e -o pipefail

cd "$CURR_DIR"/describe-project

temp_file=$(mktemp $(basename $0).XXXXXX)

function cleanup {
    rm $temp_file
}

trap cleanup EXIT

if ! $DUB describe --compiler=$DC --import-paths > "$temp_file"; then
    die 'Printing import paths failed!'
fi

# Create the expected output path file to compare against.
echo "$CURR_DIR/describe-project/src/" > "$CURR_DIR/expected-import-path-output"
echo "$CURR_DIR/describe-dependency-1/source/" >> "$CURR_DIR/expected-import-path-output"
echo "$CURR_DIR/describe-dependency-2/some-path/" >> "$CURR_DIR/expected-import-path-output"
echo "$CURR_DIR/describe-dependency-3/dep3-source/" >> "$CURR_DIR/expected-import-path-output"

if ! diff "$CURR_DIR"/expected-import-path-output "$temp_file"; then
    die 'The import paths did not match the expected output!'
fi