text:
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Colin S. McCaleb</title>
    <description>Chicago-based web developer and designer.
</description>
    <link>http://localhost:4000/</link>
    <atom:link href="http://localhost:4000/feed/" rel="self" type="application/rss+xml"/>
    <pubDate>Mon, 11 Sep 2017 20:51:10 -0500</pubDate>
    <lastBuildDate>Mon, 11 Sep 2017 20:51:10 -0500</lastBuildDate>
    <generator>Jekyll v3.5.2</generator>

      <item>
        <title>Designing in Shifting Sands</title>
        <description>
We feel we are capable of creating perfect things. Many of us chase this idea our entire lives. Chasing this gives us a sense of satisfaction and lets us create long term goals for ourselves. Gauging ourself against the goal of creating the "perfect thing" shapes who we are.

Despite being the pursuit of perfection, we'll never be able to meet this goal. None of us will ever be able to identify all imperfections.

As we design, we take into account evolving ideas and theories. We take into account shifting time and shifting spaces. We're never able to truly identify what perfection is, but we come close. In digital spaces, I find this especially clear.

Read more at Medium

</description>
        <pubDate>Mon, 04 Sep 2017 05:16:22 -0500</pubDate>
        <link>http://localhost:4000/2017/09/04/shifting-sands.html</link>
        <guid isPermaLink="true">http://localhost:4000/2017/09/04/shifting-sands.html</guid>

      </item>

      <item>
        <title>Future Storefronts and Digital Interfaces</title>
        <description>
Online spaces are changing at rapid paces. We're beginning to design web experiences that keep people engaged for hours each day. Interfaces react to user interactions and from these interactions we receive digital identities. Corporations based entirely on the web have spread across the globe. To keep up, it's time to shift to new ways of thinking about how we do digital design.

More at Medium Post

</description>
        <pubDate>Tue, 29 Aug 2017 05:16:22 -0500</pubDate>
        <link>http://localhost:4000/2017/08/29/future-storefronts.html</link>
        <guid isPermaLink="true">http://localhost:4000/2017/08/29/future-storefronts.html</guid>

      </item>

      <item>
        <title>Aggregating JSON Feeds From Multiple Systems</title>
        <description>
Last month I solved a problem World Bicycle Relief was struggling with for a long time – integrating all of our international donation feeds into one single feed to show the impact with a campaign.

Generally when we launch a campaign, it starts as a US initiative and gradually changes into an international initiative that accepts currencies throughout Europe. We'd had now way to show that until now.

The landing page is here: https://worldbicyclerelief.org/en/cyclofemme/
The technologies used on the page are:

Javascript &amp; JQuery

HTML

CSS

PHP

JSON

Feeds from Various Platforms (Causevox + Altruja)

The code looks like this. When it runs, it loops into each individual JSON endpoint and pulls the funds raised. We then divide this number by the amount of bikes this produces for each currency. This number is populated on the page. The final step is taking this number and running it up to a grand total.

$(function () {
    $.when(
      //this is for US microsite
        $.ajax({
            dataType: "jsonp",
            url: "https://cyclofemme.causevox.com/api_endpoint/info",
            success: function (data) {
              console.log(data);
                var campaignfirst =Math.round(data.funds_raised);
                $(".campaignfirst").html(campaignfirst);
            }
        }),
  //this is for UK team within UK microsite
        $.ajax({
            dataType: "jsonp",
            url: "https://worldbicyclereliefuk.causevox.com/api_endpoint/teams",
            success: function (data) {
              console.log(data);
                var campaignsecond = Math.round(data[6].funds_raised);
                $(".campaignsecond").html(campaignsecond);
            }

        }),
  //this is for Altruja Team within Altruja page
         $.ajax({
            dataType: "jsonp",
            url: "https://www.altruja.de/api/page/YG1A?details=1&amp;num=10&amp;ort=1&amp;callback",
            success: function (data) {

              console.log(data);
		var altrujaFundraiser = data.page.collected.replace(/\./g,'').slice(0,-2);
                //var altrujaFundraiser = data.page.collected.replace(/\./g,'').slice(0, -3);
                $(".altrujaFundraiser").html(altrujaFundraiser);
            }
        }),
//this is for Canada team within Canada microsite
           $.ajax({
            dataType: "jsonp",
            url: "https://fundraisecanada.causevox.com/api_endpoint/teams",
            success: function (data) {

              console.log(data);

                var teamCanada = parseInt(data[8].funds_raised);
                $(".teamCanada").html(teamCanada);
            }
        }),
//this is for Australia team within Australia microsite
          $.ajax({
            dataType: "jsonp",
            url: "https://fundraiseau.causevox.com/api_endpoint/teams",
            success: function (data) {

              console.log(data);

                var teamAustralia = parseInt(data[0].funds_raised);
                $(".teamAustralia").html(teamAustralia);
            }
        })

//assign the above three functions as a, b, and c. from there, they are referenced in the
    ).done(function (a, b, c, d, e) {
        var total = +Math.round(a[0].funds_raised / 147) + +Math.round(b[0][6].funds_raised / 95)  + +Math.round(c[0].page.collected.replace(/\./g,'').slice(0, -2) / 100) + +Math.round(d[0][8].funds_raised / 147) +Math.round(e[0][0].funds_raised / 195)
        $('.ticker').append(total);
    });
});

</description>
        <pubDate>Thu, 15 Jun 2017 00:00:00 -0500</pubDate>
        <link>http://localhost:4000/2017/06/15/integrating-systems.html</link>
        <guid isPermaLink="true">http://localhost:4000/2017/06/15/integrating-systems.html</guid>

      </item>

      <item>
        <title>The Web is an Impossible Place</title>
        <description>
One of the biggest causes of fear in web developers is our perceived lack of knowledge. Taking a brief look at the web, it's easy to see a lot of what we don't know, and not a lot of what we do know.

We don't know what we don't know and we can't get any knowledge not knowing it.

More at Medium Post

</description>
        <pubDate>Tue, 20 Dec 2016 00:00:00 -0600</pubDate>
        <link>http://localhost:4000/2016/12/20/web-is-an-impossible-place.html</link>
        <guid isPermaLink="true">http://localhost:4000/2016/12/20/web-is-an-impossible-place.html</guid>

      </item>

      <item>
        <title>Project: World Bicycle Relief's Year End Appeal Landing Page Build</title>
        <description>
December of each year, World Bicycle Relief puts together a year end campaign to collect the final funds to set up bicycling infrastructure in rural Africa.
After we shot a series of videos and photos on the spot and edited them down, I was tasked with building the landing page.

More at Medium Post

</description>
        <pubDate>Fri, 09 Dec 2016 00:00:00 -0600</pubDate>
        <link>http://localhost:4000/2016/12/09/year-end-appeal.html</link>
        <guid isPermaLink="true">http://localhost:4000/2016/12/09/year-end-appeal.html</guid>

      </item>

  </channel>
</rss>


text:
filename: 2017-07-22-Esperanto-7---Plurals.md
layout: post
title: Esperanto 7 - Plurals
tags: Esperanto
date: 2017-07-22
comments: true
thumbnail: "20170722-1.jpeg"
---

![]({{ site.baseurl }}/images/20170722-1.jpeg)
這課是關於名詞是眾數時要怎麼做。

## > 文法規則
* 眾數名詞後要加 `j` ,如果這也是 [accusative]({{ site.baseurl }}/Esperanto-4-Accusative/) ,後面就變成了 `jn` 。
* 留意形容該名詞的形容詞亦要加 `j` 和 `n` 。
* 這課多了一點 affix ,即是一些放在字根前面/中間/後面的字母而衍生出來的生字,詳細可以看看生字表中的說明。

## > Section 1/3

|Esperanto|English|Comment|
|---|---|---|
|viro|man||
|bela|beautiful||
|longan|long||
|letero|letter||
|tagon|day||
|patro|father||
|bonan|good||
|knaboj|boys||
|persono|person||

### 例句

|Esperanto|English|Comment|
|---|---|---|
|Ĉu vi vidas la belajn virojn?|Do you see the handsome men?||
|La leteroj estas longaj.|The letters are long.||
|Adamo kaj Sofia estas bonaj personaj.|Adam and Sofia are good people.||
|La knaboj bone skribas.|The boys write well.||
|Ni estas viroj kaj patroj.|We are men and fathers.||
|Bonon tagon, knaboj!|Good day, boys!||
|Ĉu la persono estas malbona?|Is the person bad?||
|Vi skribas belajn leterojn.|You write beautiful letters.||
|La viro legas longajn librojn.|The man reads long books.||
|La patro legas la longajn leterojn.|The father reads the long letters.||
|La tagoj estas tre longaj, ĉu ne?|The days are very long, aren't they?||
|La belaj floroj estas rozkoloraj.|The beautiful flowers are pink.||
|La knaboj legas leteron.|The boys read a letter.||

## > Section 2/3

|Esperanto|English|Comment|
|---|---|---|
|granda|large||
|ĉar|because||
|pomo|apple||
|knabino|girl|knabo(boy) + -in-(female)|
|virino|woman|viro(man) + -in-(female)|
|kafejoj|cafes|kafo(coffee) + -ej-(location)|
|grava|important||
|vortaro|dictionary|vorto(words) + -ar- (collection)|
|esperantisto|esperanto speaker|esperanto + -ist- (profession / hobby)|

### 例句

|Esperanto|English|Comment|
|---|---|---|
|Vortaroj estas gravaj.|Dictionaries are important.||
|Ili manĝas grandajn pomojn.|They eat big apples.||
|La virinoj kisas la viron, ĉar li estas bela|The women kiss the man because he is handsome||
|Belaj knabino kantas en kafejoj.|Beautiful girls sing in cafes.||
|Sofia kaj Adamo estas esperantistoj.|Sofia and Adamo are Esperanto speakers.||
|Estas grava tago en la parko.|It is an important day in the park.||
|Pomoj estas bonaj.|Apples are good.||
|La virinoj ŝatas grandajn kafejojn.|The women like large cafes.||
|Mi legas gravajn leterojn.|I am reading important letters.||
|Kafejoj estas grandaj, ĉar virinoj trinkas kafon.|Cafes are large because women drink coffee.||
|Bona esperantisto havas grandajn vortarojn.|A good Esperanto speaker has large dictionaries.||
|Ni estas knabinoj.|We are girls.||
|La pomoj estas bonaj.|The apples are good.||

## > Section 3/3

|Esperanto|English|Comment|
|---|---|---|
|unu|one||
|du|two||
|tri|three||
|kvar|four||
|patrino|mother|patro(father) + -in-(female)|
|avojn|grandfather||
|sed|but||
|homo|people||
|gepatroj|parents|patro(father) + ge-(both sexes)|

### 例句

|Esperanto|English|Comment|
|---|---|---|
|Avoj estas homoj.|Grandfathers are people.||
|La gepatroj havas tri knabinojn.||
|La du gepatroj estas la patro kaj la patrino.|The two parents are the father and the mother.||
|La blua flago havas unu koloron.|The blue flag has one color.||
|Li estas komencanto, sed li rapide lernas.|He is a beginner, but he learns quickly.||
|Kvar virino trinkas kafon en la kafejo.|Four women are drinking coffee in the cafe.||
|Li estas bona homo.|He is a good person.||
|Mi havas du avojn.|I have two grandfathers.||
|Li ne havas patron, sed li havas du patrinojn.|He does not have a father, but he has two mothers.||
|Mi estas patro kaj avo.|I am a father and a grandfather.||
|Li estas bona homo. / Li estas bona persono.|He is a good person.||
|Gepatroj ludas.|Parents play.||
|Estas tri homoj en la domo.|There are three people in the house.||
|Ĉu vi estas patrino?|Are you a mother?||

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>

<!--
-->

<plugin>

   <extension point="org.eclipse.emf.ecore.generated_package">
      <!-- @generated Modificationmarks -->
      <package
            uri="http://sdq.ipd.kit.edu/Modificationmarks/1.0"
            class="edu.kit.ipd.sdq.kamp.model.modificationmarks.ModificationmarksPackage"
            genModel="model/Modificationmarks.genmodel"/>
   </extension>

</plugin>


text:
namespace _04.Concatenate_Data
{
    using System;

    public class StartUp
    {
        public static void Main()
        {
            var firstName = Console.ReadLine();
            var lastName = Console.ReadLine();
            var age = Console.ReadLine();
            var town = Console.ReadLine();

            Console.WriteLine($"You are {firstName} {lastName}, a {age}-years old person from {town}.");
        }
    }
}


text:
define(function(require, exports, module) {

module.exports = require("./async")
require("./utils")

})


text:
class CreatePostedDatas < ActiveRecord::Migration
  def self.up
    create_table :posted_datas do |t|
    	t.text :para
    	t.timestamps
    end
  end

  def self.down
    drop_table :posted_datas
  end
end


text:
<!DOCTYPE HTML>

<title>Source code</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="source: package: com.restfb, interface: FacebookClient, class: GranularScope">
<meta name="generator" content="javadoc/SourceToHTMLConverter">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

001
022package com.restfb;
023
024import static com.restfb.util.UrlUtils.extractParametersFromQueryString;
025import static java.lang.String.format;
026import static java.util.Collections.unmodifiableList;
027
028import java.util.*;
029
030import com.restfb.batch.BatchRequest;
031import com.restfb.batch.BatchResponse;
032import com.restfb.exception.FacebookException;
033import com.restfb.exception.FacebookOAuthException;
034import com.restfb.exception.FacebookSignedRequestParsingException;
035import com.restfb.exception.FacebookSignedRequestVerificationException;
036import com.restfb.exception.devicetoken.FacebookDeviceTokenCodeExpiredException;
037import com.restfb.exception.devicetoken.FacebookDeviceTokenDeclinedException;
038import com.restfb.exception.devicetoken.FacebookDeviceTokenPendingException;
039import com.restfb.exception.devicetoken.FacebookDeviceTokenSlowdownException;
040import com.restfb.json.JsonObject;
041import com.restfb.scope.ScopeBuilder;
042import com.restfb.types.AbstractFacebookType;
043import com.restfb.types.DeviceCode;
044import com.restfb.util.ReflectionUtils;
045
046/**
047 * Specifies how a <a href="http://developers.facebook.com/docs/api">Facebook Graph API</a> client must operate.
048 * <p>
049 * If you'd like to...
050 *
051 * <ul>
052 * <li>Fetch an object: use {@link #fetchObject(String, Class, Parameter...)} or
053 * {@link #fetchObjects(List, Class, Parameter...)}</li>
054 * <li>Fetch a connection: use {@link #fetchConnection(String, Class, Parameter...)}</li>
055 * <li>Execute operations in batch: use {@link #executeBatch(BatchRequest...)} or {@link #executeBatch(List, List)}</li>
056 * <li>Publish data: use {@link #publish(String, Class, Parameter...)} or
057 * {@link #publish(String, Class, BinaryAttachment, Parameter...)}</li>
058 * <li>Delete an object: use {@link #deleteObject(String, Parameter...)}</li>
059 * </ul>
060 *
061 * <p>
062 * You may also perform some common access token operations. If you'd like to...
063 *
064 * <ul>
065 * <li>Extend the life of an access token: use {@link #obtainExtendedAccessToken(String, String, String)}</li>
066 * <li>Obtain an access token for use on behalf of an application instead of a user, use
067 * {@link #obtainAppAccessToken(String, String)}.</li>
068 * <li>Convert old-style session keys to OAuth access tokens: use
069 * {@link #convertSessionKeysToAccessTokens(String, String, String...)}</li>
070 * <li>Verify and extract data from a signed request: use {@link #parseSignedRequest(String, String, Class)}</li>
071 * </ul>
072 *
073 * @author <a href="http://restfb.com">Mark Allen</a>
074 * @author Scott Hernandez
075 * @author Mattia Tommasone
076 * @author <a href="http://ex-nerd.com">Chris Petersen</a>
077 * @author Josef Gierbl
078 * @author Broc Seib
079 */
080public interface FacebookClient {
081  /**
082   * Fetches a single <a href="http://developers.facebook.com/docs/reference/api/">Graph API object</a>, mapping the
083   * result to an instance of {@code objectType}.
084   *
085   * @param <T>
086   *          Java type to map to.
087   * @param object
088   *          ID of the object to fetch, e.g. {@code "me"}.
089   * @param objectType
090   *          Object type token.
091   * @param parameters
092   *          URL parameters to include in the API call (optional).
093   * @return An instance of type {@code objectType} which contains the requested object's data.
094   * @throws FacebookException
095   *           If an error occurs while performing the API call.
096   */
097  <T> T fetchObject(String object, Class<T> objectType, Parameter... parameters);
098
099  /**
100   * creates a new <code>FacebookClient</code> from a old one.
101   *
102   * App secret and and api version are taken from the original client.
103   *
104   * @param accessToken
105   *          this accesstoken is used for the new client
106   * @return a new Facebookclient
107   */
108  FacebookClient createClientWithAccessToken(String accessToken);
109
110  /**
111   * Fetches multiple <a href="http://developers.facebook.com/docs/reference/api/">Graph API objects</a> in a single
112   * call, mapping the results to an instance of {@code objectType}.
113   * <p>
114   * You'll need to write your own container type ({@code objectType}) to hold the results. See
115   * <a href="http://restfb.com">http://restfb.com</a> for an example of how to do this.
116   *
117   * @param <T>
118   *          Java type to map to.
119   * @param ids
120   *          IDs of the objects to fetch, e.g. {@code "me", "arjun"}.
121   * @param objectType
122   *          Object type token.
123   * @param parameters
124   *          URL parameters to include in the API call (optional).
125   * @return An instance of type {@code objectType} which contains the requested objects' data.
126   * @throws FacebookException
127   *           If an error occurs while performing the API call.
128   */
129  <T> T fetchObjects(List<String> ids, Class<T> objectType, Parameter... parameters);
130
131  /**
132   * Fetches a Graph API {@code Connection} type, mapping the result to an instance of {@code connectionType}.
133   *
134   * @param <T>
135   *          Java type to map to.
136   * @param connection
137   *          The name of the connection, e.g. {@code "me/feed"}.
138   * @param connectionType
139   *          Connection type token.
140   * @param parameters
141   *          URL parameters to include in the API call (optional).
142   * @return An instance of type {@code connectionType} which contains the requested Connection's data.
143   * @throws FacebookException
144   *           If an error occurs while performing the API call.
145   */
146  <T> Connection<T> fetchConnection(String connection, Class<T> connectionType, Parameter... parameters);
147
148  /**
149   * Fetches a previous/next page of a Graph API {@code Connection} type, mapping the result to an instance of
150   * {@code connectionType}.
151   *
152   * @param <T>
153   *          Java type to map to.
154   * @param connectionPageUrl
155   *          The URL of the connection page to fetch, usually retrieved via {@link Connection#getPreviousPageUrl()} or
156   *          {@link Connection#getNextPageUrl()}.
157   * @param connectionType
158   *          Connection type token.
159   * @return An instance of type {@code connectionType} which contains the requested Connection's data.
160   * @throws FacebookException
161   *           If an error occurs while performing the API call.
162   */
163  <T> Connection<T> fetchConnectionPage(String connectionPageUrl, Class<T> connectionType);
164
165  /**
166   * Executes operations as a batch using the <a href="https://developers.facebook.com/docs/reference/api/batch/">Batch
167   * API</a>.
168   *
169   * @param batchRequests
170   *          The operations to execute.
171   * @return The execution results in the order in which the requests were specified.
172   */
173  List<BatchResponse> executeBatch(BatchRequest... batchRequests);
174
175  /**
176   * Executes operations as a batch using the <a href="https://developers.facebook.com/docs/reference/api/batch/">Batch
177   * API</a>.
178   *
179   * @param batchRequests
180   *          The operations to execute.
181   * @return The execution results in the order in which the requests were specified.
182   */
183  List<BatchResponse> executeBatch(List<BatchRequest> batchRequests);
184
185  /**
186   * Executes operations as a batch with binary attachments using the
187   * <a href="https://developers.facebook.com/docs/reference/api/batch/">Batch API</a>.
188   *
189   * @param batchRequests
190   *          The operations to execute.
191   * @param binaryAttachments
192   *          Binary attachments referenced by the batch requests.
193   * @return The execution results in the order in which the requests were specified.
194   * @since 1.6.5
195   */
196  List<BatchResponse> executeBatch(List<BatchRequest> batchRequests, List<BinaryAttachment> binaryAttachments);
197
198  /**
199   * Performs a <a href="http://developers.facebook.com/docs/api#publishing">Graph API publish</a> operation on the
200   * given {@code connection}, mapping the result to an instance of {@code objectType}.
201   *
202   * @param <T>
203   *          Java type to map to.
204   * @param connection
205   *          The Connection to publish to.
206   * @param objectType
207   *          Object type token.
208   * @param parameters
209   *          URL parameters to include in the API call.
210   * @return An instance of type {@code objectType} which contains the Facebook response to your publish request.
211   * @throws FacebookException
212   *           If an error occurs while performing the API call.
213   */
214  <T> T publish(String connection, Class<T> objectType, Parameter... parameters);
215
216  /**
217   * Performs a <a href="http://developers.facebook.com/docs/api#publishing">Graph API publish</a> operation on the
218   * given {@code connection} and includes some files - photos, for example - in the publish request, and mapping the
219   * result to an instance of {@code objectType}.
220   *
221   * @param <T>
222   *          Java type to map to.
223   * @param connection
224   *          The Connection to publish to.
225   * @param objectType
226   *          Object type token.
227   * @param binaryAttachments
228   *          The files to include in the publish request.
229   * @param parameters
230   *          URL parameters to include in the API call.
231   * @return An instance of type {@code objectType} which contains the Facebook response to your publish request.
232   * @throws FacebookException
233   *           If an error occurs while performing the API call.
234   */
235  <T> T publish(String connection, Class<T> objectType, List<BinaryAttachment> binaryAttachments,
236      Parameter... parameters);
237
238  /**
239   * Performs a <a href="http://developers.facebook.com/docs/api#publishing">Graph API publish</a> operation on the
240   * given {@code connection} and includes a file - a photo, for example - in the publish request, and mapping the
241   * result to an instance of {@code objectType}.
242   *
243   * @param <T>
244   *          Java type to map to.
245   * @param connection
246   *          The Connection to publish to.
247   * @param objectType
248   *          Object type token.
249   * @param binaryAttachment
250   *          The file to include in the publish request.
251   * @param parameters
252   *          URL parameters to include in the API call.
253   * @return An instance of type {@code objectType} which contains the Facebook response to your publish request.
254   * @throws FacebookException
255   *           If an error occurs while performing the API call.
256   */
257  <T> T publish(String connection, Class<T> objectType, BinaryAttachment binaryAttachment, Parameter... parameters);
258
259  /**
260   * Performs a <a href="http://developers.facebook.com/docs/api#publishing">Graph API publish</a> operation on the
261   * given {@code connection} and includes special body in the publish request, and mapping the
262   * result to an instance of {@code objectType}.
263   *
264   * @param <T>
265   *          Java type to map to.
266   * @param connection
267   *          The Connection to publish to.
268   * @param objectType
269   *          Object type token.
270   * @param body
271   *          The body used in the POST request.
272   * @param parameters
273   *          URL parameters to include in the API call.
274   * @return An instance of type {@code objectType} which contains the Facebook response to your publish request.
275   * @throws FacebookException
276   *           If an error occurs while performing the API call.
277   */
278  <T> T publish(String connection, Class<T> objectType, Body body, Parameter... parameters);
279
280  /**
281   * Performs a <a href="http://developers.facebook.com/docs/api#deleting">Graph API delete</a> operation on the given
282   * {@code object}.
283   *
284   * @param object
285   *          The ID of the object to delete.
286   * @param parameters
287   *          URL parameters to include in the API call.
288   * @return {@code true} if Facebook indicated that the object was successfully deleted, {@code false} otherwise.
289   * @throws FacebookException
290   *           If an error occurred while attempting to delete the object.
291   */
292  boolean deleteObject(String object, Parameter... parameters);
293
294  /**
295   * Converts an arbitrary number of {@code sessionKeys} to OAuth access tokens.
296   * <p>
297   * See the <a href="http://developers.facebook.com/docs/guides/upgrade">Facebook Platform Upgrade Guide</a> for
298   * details on how this process works and why you should convert your application's session keys if you haven't
299   * already.
300   *
301   * @param appId
302   *          A Facebook application ID.
303   * @param secretKey
304   *          A Facebook application secret key.
305   * @param sessionKeys
306   *          The Old REST API session keys to be converted to OAuth access tokens.
307   * @return A list of access tokens ordered to correspond to the {@code sessionKeys} argument list.
308   * @throws FacebookException
309   *           If an error occurs while attempting to convert the session keys to API keys.
310   * @since 1.6
311   */
312  List<AccessToken> convertSessionKeysToAccessTokens(String appId, String secretKey, String... sessionKeys);
313
314  /**
315   * Obtains an access token which can be used to perform Graph API operations on behalf of a user.
316   * <p>
317   * See <a href="https://developers.facebook.com/docs/facebook-login/access-tokens">Access Tokens</a>.
318   *
319   * @param appId
320   *          The ID of the app for which you'd like to obtain an access token.
321   * @param appSecret
322   *          The secret for the app for which you'd like to obtain an access token.
323   * @param redirectUri
324   *          The redirect URI which was used to obtain the {@code verificationCode}.
325   * @param verificationCode
326   *          The verification code in the Graph API callback to the redirect URI.
327   * @return The access token for the user identified by {@code appId}, {@code appSecret}, {@code redirectUri} and
328   *         {@code verificationCode}.
329   * @throws FacebookException
330   *           If an error occurs while attempting to obtain an access token.
331   * @since 1.8.0
332   */
333  AccessToken obtainUserAccessToken(String appId, String appSecret, String redirectUri, String verificationCode);
334
335  /**
336   * Obtains an access token which can be used to perform Graph API operations on behalf of an application instead of a
337   * user.
338   * <p>
339   * See <a href="https://developers.facebook.com/docs/authentication/applications/" >Facebook's authenticating as an
340   * app documentation</a>.
341   *
342   * @param appId
343   *          The ID of the app for which you'd like to obtain an access token.
344   * @param appSecret
345   *          The secret for the app for which you'd like to obtain an access token.
346   * @return The access token for the application identified by {@code appId} and {@code appSecret}.
347   * @throws FacebookException
348   *           If an error occurs while attempting to obtain an access token.
349   * @since 1.6.10
350   */
351  AccessToken obtainAppAccessToken(String appId, String appSecret);
352
353  /**
354   * Obtains an extended access token for the given existing, non-expired, short-lived access_token.
355   * <p>
356   * See <a href="https://developers.facebook.com/roadmap/offline-access-removal/#extend_token">Facebook's extend access
357   * token documentation</a>.
358   *
359   * @param appId
360   *          The ID of the app for which you'd like to obtain an extended access token.
361   * @param appSecret
362   *          The secret for the app for which you'd like to obtain an extended access token.
363   * @param accessToken
364   *          The non-expired, short-lived access token to extend.
365   * @return An extended access token for the given {@code accessToken}.
366   * @throws FacebookException
367   *           If an error occurs while attempting to obtain an extended access token.
368   * @since 1.6.10
369   */
370  AccessToken obtainExtendedAccessToken(String appId, String appSecret, String accessToken);
371
372  /**
373   * Generates an {@code appsecret_proof} value.
374   * <p>
375   * See <a href="https://developers.facebook.com/docs/graph-api/securing-requests">Facebook's 'securing requests'
376   * documentation</a> for more info.
377   *
378   * @param accessToken
379   *          The access token required to generate the {@code appsecret_proof} value.
380   * @param appSecret
381   *          The secret for the app for which you'd like to generate the {@code appsecret_proof} value.
382   * @return A hex-encoded SHA256 hash as a {@code String}.
383   * @throws IllegalStateException
384   *           If creating the {@code appsecret_proof} fails.
385   * @since 1.6.13
386   */
387  String obtainAppSecretProof(String accessToken, String appSecret);
388
389  /**
390   * Convenience method which invokes {@link #obtainExtendedAccessToken(String, String, String)} with the current access
391   * token.
392   *
393   * @param appId
394   *          The ID of the app for which you'd like to obtain an extended access token.
395   * @param appSecret
396   *          The secret for the app for which you'd like to obtain an extended access token.
397   * @return An extended access token for the given {@code accessToken}.
398   * @throws FacebookException
399   *           If an error occurs while attempting to obtain an extended access token.
400   * @throws IllegalStateException
401   *           If this instance was not constructed with an access token.
402   * @since 1.6.10
403   */
404  AccessToken obtainExtendedAccessToken(String appId, String appSecret);
405
406  /**
407   * Parses a signed request and verifies it against your App Secret.
408   * <p>
409   * See <a href="http://developers.facebook.com/docs/howtos/login/signed-request/">Facebook's signed request
410   * documentation</a>.
411   *
412   * @param signedRequest
413   *          The signed request to parse.
414   * @param appSecret
415   *          The secret for the app that can read this signed request.
416   * @param objectType
417   *          Object type token.
418   * @param <T>
419   *          class of objectType
420   * @return An instance of type {@code objectType} which contains the decoded object embedded within
421   *         {@code signedRequest}.
422   * @throws FacebookSignedRequestParsingException
423   *           If an error occurs while trying to process {@code signedRequest}.
424   * @throws FacebookSignedRequestVerificationException
425   *           If {@code signedRequest} fails verification against {@code appSecret}.
426   * @since 1.6.13
427   */
428  <T> T parseSignedRequest(String signedRequest, String appSecret, Class<T> objectType);
429
430  /**
431   * Method to initialize the device access token generation.
432   *
433   * You receive a {@link DeviceCode} instance and have to show the user the {@link DeviceCode#getVerificationUri()} and
434   * the {@link DeviceCode#getUserCode()}. The user have to enter the user code at the verification url.
435   *
436   * Save the {@link DeviceCode#getCode()} to use it later, when polling Facebook with the
437   * {@link #obtainDeviceAccessToken(java.lang.String)} method.
438   *
439   * @param scope
440   *          List of Permissions to request from the person using your app.
441   * @return Instance of {@code DeviceCode} including the information to obtain the Device access token
442   */
443  DeviceCode fetchDeviceCode(ScopeBuilder scope);
444
445  /**
446   * Method to poll Facebook and fetch the Device Access Token.
447   *
448   * You have to use this method to check if the user confirms the authorization.
449   *
450   * {@link FacebookOAuthException} can be thrown if the authorization is declined or still pending.
451   *
452   * @param code
453   *          The device
454   * @return An extended access token for the given {@link AccessToken}.
455   * @throws com.restfb.exception.devicetoken.FacebookDeviceTokenCodeExpiredException
456   *           the {@link DeviceCode#getCode()} is expired, please fetch a new {@link DeviceCode}.
457   * @throws com.restfb.exception.devicetoken.FacebookDeviceTokenPendingException
458   *           the user has not finished the authorisation process, yet. Please poll again later.
459   * @throws com.restfb.exception.devicetoken.FacebookDeviceTokenDeclinedException
460   *           the user declined the authorisation. You have to handle this problem.
461   * @throws com.restfb.exception.devicetoken.FacebookDeviceTokenSlowdownException
462   *           you tried too often to fetch the device access token. You have to use a larger interval
463   * @since 1.12.0
464   */
465  AccessToken obtainDeviceAccessToken(String code) throws FacebookDeviceTokenCodeExpiredException,
466      FacebookDeviceTokenPendingException, FacebookDeviceTokenDeclinedException, FacebookDeviceTokenSlowdownException;
467
468  /**
469   * <p>
470   * When working with access tokens, you may need to check what information is associated with them, such as its user
471   * or expiry. To get this information you can use the debug tool in the developer site, or you can use this function.
472   * </p>
473   *
474   * <p>
475   * You must instantiate your FacebookClient using your App Access Token, or a valid User Access Token from a developer
476   * of the app.
477   * </p>
478   *
479   * <p>
480   * Note that if your app is set to Native/Desktop in the Advanced settings of your App Dashboard, the underlying
481   * GraphAPI endpoint will not work with your app token unless you change the "App Secret in Client" setting to NO. If
482   * you do not see this setting, make sure your "App Type" is set to Native/Desktop and then press the save button at
483   * the bottom of the page. This will not affect apps set to Web.
484   * </p>
485   *
486   * <p>
487   * The response of the API call is a JSON array containing data and a map of fields. For example:
488   * </p>
489   *
490   * <pre>
491   * {@code
492   * {
493   *     "data": {
494   *         "app_id": 138483919580948,
495   *         "application": "Social Cafe",
496   *         "expires_at": 1352419328,
497   *         "is_valid": true,
498   *         "issued_at": 1347235328,
499   *         "metadata": {
500   *             "sso": "iphone-safari"
501   *         },
502   *         "scopes": [
503   *             "email",
504   *             "publish_actions"
505   *         ],
506   *         "user_id": 1207059
507   *     }
508   * }
509   * }
510   * </pre>
511   *
512   * <p>
513   * Note that the {@code issued_at} field is not returned for short-lived access tokens.
514   * </p>
515   *
516   * <p>
517   * See <a href="https://developers.facebook.com/docs/howtos/login/debugging-access-tokens/"> Debugging an Access
518   * Token</a>
519   * </p>
520   *
521   * @param inputToken
522   *          The Access Token to debug.
523   *
524   * @return A JsonObject containing the debug information for the accessToken.
525   * @since 1.6.13
526   */
527  DebugTokenInfo debugToken(String inputToken);
528
529  /**
530   * Gets the {@code JsonMapper} used to convert Facebook JSON to Java objects.
531   *
532   * @return The {@code JsonMapper} used to convert Facebook JSON to Java objects.
533   * @since 1.6.7
534   */
535  JsonMapper getJsonMapper();
536
537  /**
538   * Gets the {@code WebRequestor} used to talk to the Facebook API endpoints.
539   *
540   * @return The {@code WebRequestor} used to talk to the Facebook API endpoints.
541   * @since 1.6.7
542   */
543  WebRequestor getWebRequestor();
544
545  /**
546   * generates an logout url
547   *
548   * @param next
549   *          may be null, url the webpage should redirect after logout
550   * @return the logout url
551   * @since 1.9.0
552   */
553  String getLogoutUrl(String next);
554
555  /**
556   * generates the login dialog url
557   *
558   * @param appId
559   *          The ID of your app, found in your app's dashboard.
560   * @param redirectUri
561   *          The URL that you want to redirect the person logging in back to. This URL will capture the response from
562   *          the Login Dialog. If you are using this in a webview within a desktop app, this must be set to
563   *          <code>https://www.facebook.com/connect/login_success.html</code>.
564   * @param scope
565   *          List of Permissions to request from the person using your app.
566   * @param additionalParameters
567   *          List of additional parameters
568   * @since 1.9.0
569   * @return the login dialog url
570   */
571  String getLoginDialogUrl(String appId, String redirectUri, ScopeBuilder scope, Parameter... additionalParameters);
572
573  /**
574   * Represents an access token/expiration date pair.
575   * <p>
576   * Facebook returns these types when performing access token-related operations - see
577   * {@link com.restfb.FacebookClient#convertSessionKeysToAccessTokens(String, String, String...)},
578   * {@link com.restfb.FacebookClient#obtainAppAccessToken(String, String)}, and
579   * {@link com.restfb.FacebookClient#obtainExtendedAccessToken(String, String, String)} for details.
580   *
581   * @author <a href="http://restfb.com">Mark Allen</a>
582   */
583  class AccessToken {
584    @Facebook("access_token")
585    private String accessToken;
586
587    @Facebook("expires_in")
588    private Long rawExpires;
589
590    private Long expires;
591
592    @Facebook("token_type")
593    private String tokenType;
594
595    private FacebookClient client;
596
597    public void setClient(FacebookClient client) {
598      this.client = client;
599    }
600
601    public FacebookClient getClient() {
602      return Optional.ofNullable(client).orElse(null);
603    }
604
605    /**
606     * Given a query string of the form {@code access_token=XXX} or {@code access_token=XXX&expires=YYY}, return an
607     * {@code AccessToken} instance.
608     * <p>
609     * The {@code queryString} is required to contain an {@code access_token} parameter with a non-{@code null} value.
610     * The {@code expires} value is optional and should be the number of seconds since the epoch. If the {@code expires}
611     * value cannot be parsed, the returned {@code AccessToken} will have a {@code null} {@code expires} value.
612     *
613     * @param queryString
614     *          The Facebook query string out of which to parse an {@code AccessToken} instance.
615     * @return An {@code AccessToken} instance which corresponds to the given {@code queryString}.
616     * @throws IllegalArgumentException
617     *           If no {@code access_token} parameter is present in the query string.
618     * @since 1.6.10
619     */
620    public static AccessToken fromQueryString(String queryString) {
621      // Query string can be of the form 'access_token=XXX' or
622      // 'access_token=XXX&expires=YYY'
623      Map<String, List<String>> urlParameters = extractParametersFromQueryString(queryString);
624
625      String extendedAccessToken = null;
626      String tokenType = null;
627
628      if (urlParameters.containsKey("access_token")) {
629        extendedAccessToken = urlParameters.get("access_token").get(0);
630      }
631
632      if (urlParameters.containsKey("token_type")) {
633        tokenType = urlParameters.get("token_type").get(0);
634      }
635
636      if (extendedAccessToken == null) {
637        throw new IllegalArgumentException(format(
638          "Was expecting a query string of the form 'access_token=XXX' or 'access_token=XXX&expires=YYY'. Instead, the query string was '%s'",
639          queryString));
640      }
641
642      Long expires = null;
643
644      // If an expires or expires_in value was provided and it's a valid long, great - use it.
645      // Otherwise ignore it.
646      String rawExpires = null;
647
648      if (urlParameters.containsKey("expires")) {
649        rawExpires = urlParameters.get("expires").get(0);
650      }
651
652      if (urlParameters.containsKey("expires_in")) {
653        rawExpires = urlParameters.get("expires_in").get(0);
654      }
655
656      if (rawExpires != null && rawExpires.trim().matches("\\d+")) {
657        expires = new Date().getTime() + Long.parseLong(rawExpires) * 1000L;
658      }
659
660      AccessToken accessToken = new AccessToken();
661      accessToken.accessToken = extendedAccessToken;
662      accessToken.expires = expires;
663      accessToken.tokenType = tokenType;
664      return accessToken;
665    }
666
667    @Override
668    public int hashCode() {
669      return ReflectionUtils.hashCode(this);
670    }
671
672    @Override
673    public boolean equals(Object that) {
674      return ReflectionUtils.equals(this, that);
675    }
676
677    @Override
678    public String toString() {
679      return ReflectionUtils.toString(this);
680    }
681
682    /**
683     * The access token's value.
684     *
685     * @return The access token's value.
686     */
687    public String getAccessToken() {
688      return accessToken;
689    }
690
691    /**
692     * The date on which the access token expires.
693     *
694     * @return The date on which the access token expires.
695     */
696    public Date getExpires() {
697      return expires == null ? null : new Date(expires);
698    }
699
700    /**
701     * The token type of this access token provided by Facebook
702     *
703     * @return the access token type
704     */
705    public String getTokenType() {
706      return tokenType;
707    }
708
709    @JsonMapper.JsonMappingCompleted
710    void convertExpires() {
711      if (rawExpires != null) {
712        expires = new Date().getTime() + 1000L * rawExpires;
713      }
714    }
715
716  }
717
718  /**
719   * <p>
720   * Represents the result of a {@link FacebookClient#debugToken(String)} inquiry.
721   * </p>
722   *
723   * FIXME does this class belong here?
724   *
725   * <p>
726   * See <a href="https://developers.facebook.com/docs/howtos/login/debugging-access-tokens/">Debug access tokens</a>
727   *
728   * @author Broc Seib
729   */
730  class DebugTokenInfo extends AbstractFacebookType {
731
732    private static final long serialVersionUID = 1L;
733
734    /**
735     * The ID of the application this access token is for.
736     */
737    @Facebook("app_id")
738    private String appId;
739
740    /**
741     * Name of the application this access token is for.
742     */
743    @Facebook
744    private String application;
745
746    /**
747     * Timestamp when this access token expires.
748     */
749    @Facebook("expires_at")
750    private Date expiresAt;
751
752    /**
753     * Timestamp when app's access to user data expires.
754     */
755    @Facebook("data_access_expires_at")
756    private Date dataAccessExpiresAt;
757
758    /**
759     * Timestamp when this access token was issued.
760     */
761    @Facebook("issued_at")
762    private Date issuedAt;
763
764    /**
765     * Whether the access token is still valid or not.
766     */
767    @Facebook("is_valid")
768    private Boolean isValid;
769
770    /**
771     * The ID of the user this access token is for.
772     */
773    @Facebook("user_id")
774    private String userId;
775
776    /**
777     * For impersonated access tokens, the ID of the page this token contains.
778     */
779    @Facebook("profile_id")
780    private String profileId;
781
782    /**
783     * General metadata associated with the access token. Can contain data like 'sso', 'auth_type', 'auth_nonce'
784     */
785    @Facebook
786    private JsonObject metadata;
787
788    /**
789     * Any error that a request to the graph api would return due to the access token.
790     */
791    @Facebook
792    private DebugTokenError error;
793
794    /**
795     * List of permissions that the user has granted for the app in this access token.
796     */
797    @Facebook
798    private List<String> scopes = new ArrayList<>();
799
800    /**
801     * List of granular permissions that the user has granted for this app in this access token.
802     */
803    @Facebook("granular_scopes")
804    private List<GranularScope> granularScopes = new ArrayList<>();
805
806    @Facebook
807    private String type;
808
809    /**
810     * The application id.
811     *
812     * @return The id of the application.
813     */
814    public String getAppId() {
815      return appId;
816    }
817
818    /**
819     * The application name.
820     *
821     * @return The name of the application.
822     */
823    public String getApplication() {
824      return application;
825    }
826
827    /**
828     * The date on which the access token expires.
829     *
830     * @return The date on which the access token expires.
831     */
832    public Date getExpiresAt() {
833      return expiresAt;
834    }
835
836    /**
837     * Timestamp when app's access to user data expires.
838     *
839     * @return The date when app's access to user data expires.
840     */
841    public Date getDataAccessExpiresAt() {
842      return dataAccessExpiresAt;
843    }
844
845    /**
846     * The date on which the access token was issued.
847     *
848     * @return The date on which the access token was issued.
849     */
850    public Date getIssuedAt() {
851      return issuedAt;
852    }
853
854    /**
855     * Whether or not the token is valid.
856     *
857     * @return Whether or not the token is valid.
858     */
859    public Boolean isValid() {
860      return isValid;
861    }
862
863    /**
864     * The user id.
865     *
866     * @return The user id.
867     */
868    public String getUserId() {
869      return userId;
870    }
871
872    /**
873     * List of scopes the access token 'contains'
874     *
875     * @return list of scopes
876     */
877    public List<String> getScopes() {
878      return unmodifiableList(scopes);
879    }
880
881    /**
882     * List of granular scopes the access token 'contains'
883     *
884     * @return list of granular scopes
885     */
886    public List<GranularScope> getGranularScopes() {
887      return unmodifiableList(granularScopes);
888    }
889
890    /**
891     * General metadata associated with the access token. Can contain data like 'sso', 'auth_type', 'auth_nonce'
892     *
893     * @return General metadata associated with the access token
894     */
895    public JsonObject getMetaData() {
896      return metadata;
897    }
898
899    /**
900     * All Error data associated with access token debug.
901     *
902     * @return debug token error
903     */
904    public DebugTokenError getDebugTokenError() {
905      return error;
906    }
907
908    public String getType() {
909      return type;
910    }
911  }
912
913  class GranularScope extends AbstractFacebookType {
914
915    private static final long serialVersionUID = 1L;
916
917    /**
918     * The permission granted by the user.
919     */
920    @Facebook
921    private String scope;
922
923    /**
924     * The target ids of Pages, Groups, or business assets the user granted the above permission for.
925     */
926    @Facebook("target_ids")
927    private List<String> targetIds = new ArrayList<>();
928
929    /**
930     * The permission granted by the user.
931     *
932     * @return The permission granted by the user.
933     */
934    public String getScope() {
935      return scope;
936    }
937
938    /**
939     * The target ids of Pages, Groups, or business assets the user granted the above permission for.
940     *
941     * @return The target ids of Pages, Groups, or business assets the user granted the above permission for.
942     */
943    public List<String> getTargetIds() {
944      return unmodifiableList(targetIds);
945    }
946  }
947
948  class DebugTokenError extends AbstractFacebookType {
949
950    private static final long serialVersionUID = 1L;
951
952    /**
953     * The error code for the error.
954     */
955    @Facebook
956    private Integer code;
957
958    /**
959     * The error message for the error.
960     */
961    @Facebook
962    private String message;
963
964    /**
965     * The error subcode for the error.
966     */
967    @Facebook
968    private Integer subcode;
969
970    /**
971     * The error code for the error.
972     *
973     * @return The error code for the error.
974     */
975    public Integer getCode() {
976      return code;
977    }
978
979    /**
980     * The error message for the error.
981     *
982     * @return The error message for the error.
983     */
984    public String getMessage() {
985      return message;
986    }
987
988    /**
989     * The error subcode for the error.
990     *
991     * @return The error subcode for the error.
992     */
993    public Integer getSubcode() {
994      return subcode;
995    }
996
997  }
998}


text:
#include <GL/glew.h>

#include "Graphics/GeometryPass.h"
#include "Graphics/Camera.h"
#include "Graphics/Light.h"
#include "Graphics/RenderSet.h"
#include "Graphics/Renderable.h"
#include "Assets/AssetSystem.h"
#include "Assets/Asset.h"
#include "Toolbox/Logger.h"

namespace alpha
{
    GeometryPass::GeometryPass()
        : m_shaderProgram(0)
        , m_gBuffer(0)
    {
        for (int i = 0; i < GBUFFER_TEXTURE_COUNT; ++i)
        {
            m_gBufferTextures[i] = 0;
        }
    }
    GeometryPass::~GeometryPass() { }

    bool GeometryPass::VInitialize(AssetSystem * const pAssetSystem, int windowWidth, int windowHeight)
    {
        m_vsShader = pAssetSystem->GetAsset("Shaders/gl_deferred_vs.glsl");
        m_psShader = pAssetSystem->GetAsset("Shaders/gl_deferred_ps.glsl");

        m_shaderProgram = CreateShaderProgram(m_vsShader, m_psShader);

        // create gbuffer textures
        glGenFramebuffers(1, &m_gBuffer);
        glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_gBuffer);

        glGenTextures(GBUFFER_TEXTURE_COUNT, m_gBufferTextures);

        for (unsigned int i = 0; i < GBUFFER_TEXTURE_COUNT; ++i)
        {
            glBindTexture(GL_TEXTURE_2D, m_gBufferTextures[i]);
            glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F, windowWidth, windowHeight, 0, GL_RGBA, GL_FLOAT, NULL);
            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
            glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + i, GL_TEXTURE_2D, m_gBufferTextures[i], 0);
        }

        GLuint attachments[3] = { GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2 };
        glDrawBuffers(3, attachments);

        // create and attach depth buffer
        glGenRenderbuffers(1, &m_rboDepth);
        glBindRenderbuffer(GL_RENDERBUFFER, m_rboDepth);
        glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT, windowWidth, windowHeight);
        glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, m_rboDepth);

        if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
        {
            LOG_ERR("GeometryPass - Framebuffer not complete!");
            return false;
        }
        glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);

        return true;
    }

    bool GeometryPass::VShutdown()
    {
        return true;
    }

    void GeometryPass::VRender(std::shared_ptr<Camera> pCamera, std::vector<RenderSet *> render_sets, std::vector<Light *> /*lights*/)
    {
        // bind gBuffer textures to be rendered to
        glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_gBuffer);

        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

        // set shader program
        glUseProgram(m_shaderProgram);

        // get/make view and projection matrix
        Matrix view = pCamera->GetView();
        Matrix proj = pCamera->GetProjection();

        glUniformMatrix4fv(glGetUniformLocation(m_shaderProgram, "view"), 1, GL_FALSE, &view.m_11);
        glUniformMatrix4fv(glGetUniformLocation(m_shaderProgram, "projection"), 1, GL_FALSE, &proj.m_11);

        for (auto rs : render_sets)
        {
            auto material = rs->material.lock();
            auto diffuse = material->GetDiffuse();
            auto specular = material->GetSpecularCoefficient();

            // attach object matrix values
            glUniformMatrix4fv(glGetUniformLocation(m_shaderProgram, "world"), 1, GL_FALSE, &rs->worldTransform.m_11);

            // set object color information
            glUniform3f(glGetUniformLocation(m_shaderProgram, "diffuse"), diffuse.x, diffuse.y, diffuse.z);
            glUniform1f(glGetUniformLocation(m_shaderProgram, "specular"), specular);

            for (Renderable * renderable : rs->GetRenderables())
            {
                // bind vertices to array object
                glBindVertexArray(renderable->m_vertexAttribute);

                // draw the triangles
                glDrawElements(GL_TRIANGLES, renderable->indices.size(), GL_UNSIGNED_INT, (void*)0);

                // unbind array object
                glBindVertexArray(0);
            }
        }

        // un-bind gbuffer textures.
        glBindFramebuffer(GL_FRAMEBUFFER, 0);
    }

    GLuint GeometryPass::GetGBufferTexture(GBUFFER_TYPE texture_type)
    {
        return m_gBufferTextures[texture_type];
    }
}


text:
typedef enum {
    COMP_InvertingInput_IO0           = COMP_CSR_INM_0,                       ///< INM0 as COMP inverting input
    COMP_InvertingInput_IO1           = COMP_CSR_INM_1,                       ///< INM1 as COMP inverting input
    COMP_InvertingInput_IO2           = COMP_CSR_INM_2,                       ///< INM2 as COMP inverting input
    COMP_InvertingInput_CRV           = COMP_CSR_INM_3,                       ///< INM3 as COMP inverting input
    COMP_InvertingInput_IO3           = COMP_CSR_INM_3,                       ///< INM3 as COMP inverting input
} EM_COMP_InvertingInput;

////////////////////////////////////////////////////////////////////////////////
/// @brief COMP_NonInvertingInput
////////////////////////////////////////////////////////////////////////////////
typedef enum {
    COMP_NonInvertingInput_IO0        = COMP_CSR_INP_INP0,                    ///< INP0 as COMP non-inverting input
    COMP_NonInvertingInput_IO1        = COMP_CSR_INP_INP1,                    ///< INP1 as COMP non-inverting input
    COMP_NonInvertingInput_IO2        = COMP_CSR_INP_INP2,                    ///< INP2 as COMP non-inverting input
    COMP_NonInvertingInput_IO3        = COMP_CSR_INP_INP3,                    ///< INP3 as COMP non-inverting input
} EM_COMP_NonInvertingInput;

////////////////////////////////////////////////////////////////////////////////
/// @brief COMP_Output
////////////////////////////////////////////////////////////////////////////////
typedef enum {
    COMP_Output_None                  = 0x00000000,                             ///< No output
    COMP_Output_TIM1BKIN              = COMP_CSR_OUT_TIM1_BRAKE,                ///< Timer1 brake input
    COMP_Output_TIM1OCREFCLR          = COMP_CSR_OUT_TIM1_OCREFCLR,             ///< Timer1 ocrefclear input
    COMP_Output_TIM1IC1               = COMP_CSR_OUT_TIM1_CAPTURE1,             ///< Timer1 input capture 1
    COMP_Output_TIM2IC4               = COMP_CSR_OUT_TIM2_CAPTURE4,             ///< Timer2 input capture 4
    COMP_Output_TIM2OCREFCLR          = COMP_CSR_OUT_TIM2_OCREFCLR,             ///< Timer2 ocrefclear input
    COMP_Output_TIM3IC1               = COMP_CSR_OUT_TIM3_CAPTURE1,             ///< Timer3 input capture 1
    COMP_Output_TIM3OCREFCLR          = COMP_CSR_OUT_TIM3_OCREFCLR              ///< Timer3 ocrefclear input
} EM_COMP_Output;

////////////////////////////////////////////////////////////////////////////////
/// @brief COMP_OutputPoloarity
////////////////////////////////////////////////////////////////////////////////
typedef enum {
    COMP_NonInverted                  = 0x00000000,                             ///< COMP non-inverting output
    COMP_OutputPol_NonInverted        = 0x00000000,
    COMP_Inverted                     = 0x00008000,                             ///< COMP inverting output
    COMP_OutputPol_Inverted           = 0x00008000
} EM_COMP_OutputPol;

////////////////////////////////////////////////////////////////////////////////
/// @brief COMP_Hysteresis
////////////////////////////////////////////////////////////////////////////////
typedef enum {
    COMP_Hysteresis_No                = COMP_CSR_HYST_0,                      ///< Hysteresis Voltage: 0mV
    COMP_Hysteresis_Low               = COMP_CSR_HYST_15,                     ///< Hysteresis Voltage: 15mV
    COMP_Hysteresis_Medium            = COMP_CSR_HYST_30,                     ///< Hysteresis Voltage: 30mV
    COMP_Hysteresis_High              = COMP_CSR_HYST_90                      ///< Hysteresis Voltage: 90mV
} EM_COMP_Hysteresis;
typedef enum {
    COMP_Filter_0_Period                = COMP_CSR_OFLT_0,                      ///< filter is ((u32)0x00000000)
    COMP_Filter_2_Period                = COMP_CSR_OFLT_1,                      ///< filter is ((u32)0x00040000)
    COMP_Filter_4_Period                = COMP_CSR_OFLT_2,                      ///< filter is ((u32)0x00080000)
    COMP_Filter_8_Period                = COMP_CSR_OFLT_3,                      ///< filter is ((u32)0x000C0000)
    COMP_Filter_16_Period               = COMP_CSR_OFLT_4,                      ///< filter is ((u32)0x00100000)
    COMP_Filter_32_Period               = COMP_CSR_OFLT_5,                      ///< filter is ((u32)0x00140000)
    COMP_Filter_64_Period               = COMP_CSR_OFLT_6,                      ///< filter is ((u32)0x00180000)
    COMP_Filter_128_Period              = COMP_CSR_OFLT_7,                      ///< filter is ((u32)0x001C0000)
} EM_COMP_FILT;
////////////////////////////////////////////////////////////////////////////////
/// @brief COMP_Mode
////////////////////////////////////////////////////////////////////////////////
typedef enum {
    COMP_Mode_HighSpeed               = COMP_CSR_MODE_HIGHRATE,               ///< Comparator high rate mode
    COMP_Mode_MediumSpeed             = COMP_CSR_MODE_MEDIUMRATE,             ///< Comparator medium rate mode
    COMP_Mode_LowPower                = COMP_CSR_MODE_LOWPOWER,               ///< Comparator low power mode
    COMP_Mode_UltraLowPower           = COMP_CSR_MODE_LOWESTPOWER             ///< Comparator lowest power mode
} EM_COMP_Mode;

////////////////////////////////////////////////////////////////////////////////
/// @brief COMP_OutputLevel
////////////////////////////////////////////////////////////////////////////////
typedef enum {
    COMP_OutputLevel_High             = COMP_CSR_OUT,                         ///<  High output
    COMP_OutputLevel_Low              = 0x00000000                            ///<  Low output
} EM_COMP_OutputLevel;

////////////////////////////////////////////////////////////////////////////////
/// @brief  COMP Init structure definition
////////////////////////////////////////////////////////////////////////////////
typedef struct {
    union {
        u32 COMP_InvertingInput;
        u32 Invert;                                                             ///< Selects the inverting input of the comparator.
    };
    union {
        u32 COMP_NonInvertingInput;
        u32 NonInvert;                                                          ///< Selects the non inverting input of the comparator.
    };
    union {
        u32 COMP_Output;
        u32 Output;                                                             ///< Selects the output redirection of the comparator.
        u32 BlankingSrce;                                                       ///< Selects the output blanking source of the comparator.
    };
    union {
        u32 COMP_OutputPol;
        u32 OutputPol;                                                          ///< Selects the output polarity of the comparator.
    };
    union {
        u32 COMP_Hysteresis;
        u32 Hysteresis;                                                         ///< Selects the hysteresis voltage of the comparator.
    };
    union {
        u32 COMP_Mode;
        u32 Mode;                                                               ///< Selects the operating mode of the comparator and allows
    };
    union {
        u32 COMP_Filter;
        u32 OFLT;                                                               ///< to adjust the speed/consumption.
    };
} COMP_InitTypeDef;

typedef struct {

    FunctionalState COMP_Poll_En;                                                ///< Selects the inverting input of the comparator.

    u32 COMP_Poll_Ch;                                                            ///< Selects the non inverting input of the comparator.
    u32 COMP_Poll_Fixn;                                                          ///< Selects the output redirection of the comparator.
    u32 COMP_Poll_Period;                                                        ///< Selects the output polarity of the comparator.
    u32 COMP_Poll_Pout;                                                          ///< Selects the hysteresis voltage of the comparator.

} COMP_POLL_InitTypeDef;
/// @}

////////////////////////////////////////////////////////////////////////////////
/// @defgroup COMP_Exported_Constants
/// @{
////////////////////////////////////////////////////////////////////////////////
/// @brief  COMP Init structure definition
////////////////////////////////////////////////////////////////////////////////
typedef enum {
    COMP1                       =   (0x00000C),                               ///< Select comparator 1
    COMP2                       =   (0x000010),                               ///< Select comparator 2
} COMP_Selection_TypeDef;

#define COMP_BlankingSrce_None  ((u32)0x00000000)
#define COMP_CSR_CLEAR_MASK     ((u32)0x00000003)

#define COMP_CSR_COMPSW1        ((u32)0x00000002)

/// @}

////////////////////////////////////////////////////////////////////////////////
///@defgroup COMP_Exported_Variables
/// @{
#ifdef _HAL_COMP_C_

#define GLOBAL
#else
#define GLOBAL extern
#endif

#undef GLOBAL
/// @}

////////////////////////////////////////////////////////////////////////////////
/// @defgroup COMP_Exported_Functions
/// @{

void COMP_DeInit(COMP_Selection_TypeDef selection);
void COMP_Init(COMP_Selection_TypeDef selection, COMP_InitTypeDef* init_struct);
void COMP_StructInit(COMP_InitTypeDef* init_struct);
void COMP_Cmd(COMP_Selection_TypeDef selection, FunctionalState state);
void COMP_SwitchCmd(COMP_Selection_TypeDef selection, FunctionalState state);
void COMP_LockConfig(COMP_Selection_TypeDef selection);

u32 COMP_GetOutputLevel(COMP_Selection_TypeDef selection);

void COMP_SetCrv(u8 crv_select, u8 crv_level);
#define  SET_COMP_CRV COMP_SetCrv

/// @}

/// @}

/// @}

////////////////////////////////////////////////////////////////////////////////
#endif //__HAL_COMP_H
////////////////////////////////////////////////////////////////////////////////


text:
require 'spec_helper'

describe NewsReleasesController do

  describe "GET 'index'" do
    it "returns http success" do
      get 'index'
      response.should be_success
    end
  end

  describe "GET 'show'" do
    it "returns http success" do
      get 'show'
      response.should be_success
    end
  end

  describe "GET 'new'" do
    it "returns http success" do
      get 'new'
      response.should be_success
    end
  end

  describe "GET 'create'" do
    it "returns http success" do
      get 'create'
      response.should be_success
    end
  end

end


text:
"use strict";

var UnknownSignalError = require('./errors/UnknownSignal');

module.exports = function Signals(db) {

    var signals = db.collection("signals");

    return {
        addSignal: function(zone, direction, kind, username, description, done) {
            var today = new Date(),
                dd = today.getDate(),
                mm = today.getMonth()+1, //Janvier vaut 0!
                yyyy = today.getFullYear(),
                epoch = new Date().getTime(),
                voters = new Array();

                voters.push(username);

            if(dd<10)
                dd='0'+dd;
            if(mm<10)
                mm='0'+mm;

                today = dd+'/'+mm+'/'+yyyy;

            var entry = {
                '_id': epoch,
                'dateAdded': today,
                'zone': zone,
                'direction': direction,
                'kind': kind,
                'rating': 1,
                'description': description,
                'author': username,
                'voters': voters
            };
            signals.insert(entry, function (error, result) {
                if(error) return done(error, null);
                console.log("DB: inserted signal "+ zone);
                return done(error, epoch);
            });
        },
        getSignals: function(count, done) {
            signals.find({}).sort({'_id': -1}).limit(count).toArray(function(error, items) {
                if(error) return done(error, null);
                console.log("Found " + items.length + " signals");
                return done(error, items);
            });
        },
        getSignalById: function(id, done) {
            signals.findOne({'_id': id}, function(error, item) {
                if(error) return done(error, null);
                if(!item) return done(new UnknownSignalError(id), null);
                console.log("Showing more of "+ id);
                return done(error, item);
            });
        },
        // getSignalsByZone: function(zone, count, done) {
        //     signals.find({ zone : zone }).sort('dateAdded',-1).limit(count).toArray(function(error, items) {
        //         if (error) return done(error, null);
        //         console.log("Found " + items.length + " signals");
        //         return done(error, items);
        //     });
        // },
        incrementRating: function(id, username, done) {
            signals.update({'_id': id}, { $inc: {'rating': 1}}, function(error, items) {
                if(error) return done(error, null);
                signals.update({'_id': id}, {$push: {'voters': username}}, function(error, items) {
                    if (error) return done(error, null);
                    console.log("incremented signal " + id);
                    return done(error, items);
                });
            });
        },
        decrementRating: function(id, username, done) {
            signals.update({'_id': id}, { $inc: {'rating': -1}}, function(error, items) {
                if(error) return done(error, null);
                signals.update({'_id': id}, {$push: {'voters': username}}, function(error, items) {
                    if (error) return done(error, null);
                    console.log("decremented signal " + id);
                    return done(error, items);
                });
            });
        }
    };
};


text:
<?php

namespace Liip\RMT\Tests\Unit\Changelog;

use Liip\RMT\Changelog\ChangelogManager;
use Liip\RMT\Exception;
use PHPUnit\Framework\TestCase;

class ChangelogManagerTest extends TestCase
{
    protected $dir;

    public function testAutoFileCreationWhenNoFound(): void
    {
        $file = tempnam(sys_get_temp_dir(), 'CHANGELOG');
        new ChangelogManager($file, 'semantic');
        self::assertFileExists($file);
        unlink($file);
    }

    public function testExceptionWhenNotAbleToCreate(): void
    {
        $this->expectException(Exception::class);

        $this->dir = sys_get_temp_dir() . '/' . md5(time());
        mkdir($this->dir);
        new ChangelogManager($this->dir, 'semantic');
    }

    protected function tearDown(): void
    {
        exec('rm -rf ' . $this->dir);
    }
}


text:
#import <SAObjects/SADomainCommand.h>

@interface SATimerPause : SADomainCommand
{
}

+ (id)pauseWithDictionary:(id)arg1 context:(id)arg2;
+ (id)pause;
- (_Bool)requiresResponse;
- (id)encodedClassName;
- (id)groupIdentifier;

@end


text:
package com.nextdoor.bender.operation.substitution.field;

import com.nextdoor.bender.config.AbstractConfig;
import com.nextdoor.bender.operation.substitution.Substitution;
import com.nextdoor.bender.operation.substitution.SubstitutionFactory;

public class FieldSubstitutionFactory implements SubstitutionFactory {
  public FieldSubstitutionConfig conf;

  @Override
  public void setConf(AbstractConfig config) {
    this.conf = (FieldSubstitutionConfig) config;
  }

  @Override
  public Class<FieldSubstitution> getChildClass() {
    return FieldSubstitution.class;
  }

  @Override
  public Substitution newInstance() {
    return new FieldSubstitution(this.conf.getKey(), this.conf.getSrcFields(),
        this.conf.getRemoveSrcField(), this.conf.getFailSrcNotFound(),
        this.conf.getFailDstNotFound());
  }
}


text:
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('flash');

var TinyMCE_FlashPlugin = {
	getInfo : function() {
		return {
			longname : 'Flash',
			author : 'Moxiecode Systems AB',
			authorurl : 'http://tinymce.moxiecode.com',
			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/flash',
			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
		};
	},

	initInstance : function(inst) {
		if (!tinyMCE.settings['flash_skip_plugin_css'])
			tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/plugins/flash/css/content.css");
	},

	getControlHTML : function(cn) {
		switch (cn) {
			case "flash":
				return tinyMCE.getButtonHTML(cn, 'lang_flash_desc', '{$pluginurl}/images/flash.gif', 'mceFlash');
		}

		return "";
	},

	execCommand : function(editor_id, element, command, user_interface, value) {
		// Handle commands
		switch (command) {
			case "mceFlash":
				var name = "", swffile = "", swfwidth = "", swfheight = "", action = "insert";
				var template = new Array();
				var inst = tinyMCE.getInstanceById(editor_id);
				var focusElm = inst.getFocusElement();

				template['file']   = '../../plugins/flash/flash.htm'; // Relative to theme
				template['width']  = 430;
				template['height'] = 175;

				template['width'] += tinyMCE.getLang('lang_flash_delta_width', 0);
				template['height'] += tinyMCE.getLang('lang_flash_delta_height', 0);

				// Is selection a image
				if (focusElm != null && focusElm.nodeName.toLowerCase() == "img") {
					name = tinyMCE.getAttrib(focusElm, 'class');

					if (name.indexOf('mceItemFlash') == -1) // Not a Flash
						return true;

					// Get rest of Flash items
					swffile = tinyMCE.getAttrib(focusElm, 'alt');

					if (tinyMCE.getParam('convert_urls'))
						swffile = eval(tinyMCE.settings['urlconverter_callback'] + "(swffile, null, true);");

					swfwidth = tinyMCE.getAttrib(focusElm, 'width');
					swfheight = tinyMCE.getAttrib(focusElm, 'height');
					action = "update";
				}

				tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", swffile : swffile, swfwidth : swfwidth, swfheight : swfheight, action : action});
			return true;
	   }

	   // Pass to next handler in chain
	   return false;
	},

	cleanup : function(type, content) {
		switch (type) {
			case "insert_to_editor_dom":
				// Force relative/absolute
				if (tinyMCE.getParam('convert_urls')) {
					var imgs = content.getElementsByTagName("img");
					for (var i=0; i<imgs.length; i++) {
						if (tinyMCE.getAttrib(imgs[i], "class") == "mceItemFlash") {
							var src = tinyMCE.getAttrib(imgs[i], "alt");

							if (tinyMCE.getParam('convert_urls'))
								src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, null, true);");

							imgs[i].setAttribute('alt', src);
							imgs[i].setAttribute('title', src);
						}
					}
				}
				break;

			case "get_from_editor_dom":
				var imgs = content.getElementsByTagName("img");
				for (var i=0; i<imgs.length; i++) {
					if (tinyMCE.getAttrib(imgs[i], "class") == "mceItemFlash") {
						var src = tinyMCE.getAttrib(imgs[i], "alt");

						if (tinyMCE.getParam('convert_urls'))
							src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, null, true);");

						imgs[i].setAttribute('alt', src);
						imgs[i].setAttribute('title', src);
					}
				}
				break;

			case "insert_to_editor":
				var startPos = 0;
				var embedList = new Array();

				// Fix the embed and object elements
				content = content.replace(new RegExp('<[ ]*embed','gi'),'<embed');
				content = content.replace(new RegExp('<[ ]*/embed[ ]*>','gi'),'</embed>');
				content = content.replace(new RegExp('<[ ]*object','gi'),'<object');
				content = content.replace(new RegExp('<[ ]*/object[ ]*>','gi'),'</object>');

				// Parse all embed tags
				while ((startPos = content.indexOf('<embed', startPos+1)) != -1) {
					var endPos = content.indexOf('>', startPos);
					var attribs = TinyMCE_FlashPlugin._parseAttributes(content.substring(startPos + 6, endPos));
					embedList[embedList.length] = attribs;
				}

				// Parse all object tags and replace them with images from the embed data
				var index = 0;
				while ((startPos = content.indexOf('<object', startPos)) != -1) {
					if (index >= embedList.length)
						break;

					var attribs = embedList[index];

					// Find end of object
					endPos = content.indexOf('</object>', startPos);
					endPos += 9;

					// Insert image
					var contentAfter = content.substring(endPos);
					content = content.substring(0, startPos);
					content += '' + content.substring(endPos);
					content += contentAfter;
					index++;

					startPos++;
				}

				// Parse all embed tags and replace them with images from the embed data
				var index = 0;
				while ((startPos = content.indexOf('<embed', startPos)) != -1) {
					if (index >= embedList.length)
						break;

					var attribs = embedList[index];

					// Find end of embed
					endPos = content.indexOf('>', startPos);
					endPos += 9;

					// Insert image
					var contentAfter = content.substring(endPos);
					content = content.substring(0, startPos);
					content += '' + content.substring(endPos);
					content += contentAfter;
					index++;

					startPos++;
				}

				break;

			case "get_from_editor":
				// Parse all img tags and replace them with object+embed
				var startPos = -1;

				while ((startPos = content.indexOf('', startPos);
					var attribs = TinyMCE_FlashPlugin._parseAttributes(content.substring(startPos + 4, endPos));

					// Is not flash, skip it
					if (attribs['class'] != "mceItemFlash")
						continue;

					endPos += 2;

					var embedHTML = '';
					var wmode = tinyMCE.getParam("flash_wmode", "");
					var quality = tinyMCE.getParam("flash_quality", "high");
					var menu = tinyMCE.getParam("flash_menu", "false");

					// Insert object + embed
					embedHTML += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
					embedHTML += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"';
					embedHTML += ' width="' + attribs["width"] + '" height="' + attribs["height"] + '">';
					embedHTML += '<param name="movie" value="' + attribs["title"] + '" />';
					embedHTML += '<param name="quality" value="' + quality + '" />';
					embedHTML += '<param name="menu" value="' + menu + '" />';
					embedHTML += '<param name="wmode" value="' + wmode + '" />';
					embedHTML += '<embed src="' + attribs["title"] + '" wmode="' + wmode + '" quality="' + quality + '" menu="' + menu + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + attribs["width"] + '" height="' + attribs["height"] + '"></embed></object>';

					// Insert embed/object chunk
					chunkBefore = content.substring(0, startPos);
					chunkAfter = content.substring(endPos);
					content = chunkBefore + embedHTML + chunkAfter;
				}
				break;
		}

		// Pass through to next handler in chain
		return content;
	},

	handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
		if (node == null)
			return;

		do {
			if (node.nodeName == "IMG" && tinyMCE.getAttrib(node, 'class').indexOf('mceItemFlash') == 0) {
				tinyMCE.switchClass(editor_id + '_flash', 'mceButtonSelected');
				return true;
			}
		} while ((node = node.parentNode));

		tinyMCE.switchClass(editor_id + '_flash', 'mceButtonNormal');

		return true;
	},

	// Private plugin internal functions

	_parseAttributes : function(attribute_string) {
		var attributeName = "";
		var attributeValue = "";
		var withInName;
		var withInValue;
		var attributes = new Array();
		var whiteSpaceRegExp = new RegExp('^[ \n\r\t]+', 'g');

		if (attribute_string == null || attribute_string.length < 2)
			return null;

		withInName = withInValue = false;

		for (var i=0; i<attribute_string.length; i++) {
			var chr = attribute_string.charAt(i);

			if ((chr == '"' || chr == "'") && !withInValue)
				withInValue = true;
			else if ((chr == '"' || chr == "'") && withInValue) {
				withInValue = false;

				var pos = attributeName.lastIndexOf(' ');
				if (pos != -1)
					attributeName = attributeName.substring(pos+1);

				attributes[attributeName.toLowerCase()] = attributeValue.substring(1);

				attributeName = "";
				attributeValue = "";
			} else if (!whiteSpaceRegExp.test(chr) && !withInName && !withInValue)
				withInName = true;

			if (chr == '=' && withInName)
				withInName = false;

			if (withInName)
				attributeName += chr;

			if (withInValue)
				attributeValue += chr;
		}

		return attributes;
	}
};

tinyMCE.addPlugin("flash", TinyMCE_FlashPlugin);


text:
namespace ConsoleWebServer.Application
{
    public static class Startup
    {
        public static void Main()
        {
            var webSever = new WebServerConsole();
            webSever.Start();
        }
    }
}


text:
git-bug(1) -- Create bug branch
===============================

## SYNOPSIS

`git-bug` [-r|--remote [remote_name]] [finish] <name>

## DESCRIPTION

  Create the given bug branch

## OPTIONS

  <-r|--remote [remote_name]>

  Setup a remote tracking branch using `remote_name`. If `remote_name` is not supplied, use `origin` by default.

  <finish>

  Merge and delete the bug branch.

  <-r

  <name>

  The name of the bug branch.

## EXAMPLES

    $ git bug bug-123456
    ...
    $ git commit -m "Some changes"
    ...
    $ git checkout master
    $ git bug finish bug-123456

	$ git bug -r 12345

## AUTHOR

Written by Jesús Espino <<jespinog@gmail.com>>
Modified by Mark Pitman <<mark.pitman@gmail.com>>

## REPORTING BUGS

<<https://github.com/tj/git-extras/issues>>

## SEE ALSO

<<https://github.com/tj/git-extras>>


text:
package me.chrisswr1.parroute.io;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import org.openstreetmap.osmosis.core.domain.v0_6.Entity;
import org.openstreetmap.osmosis.core.domain.v0_6.EntityType;
import org.openstreetmap.osmosis.core.domain.v0_6.Node;
import org.openstreetmap.osmosis.core.domain.v0_6.Relation;
import org.openstreetmap.osmosis.core.domain.v0_6.Tag;
import org.openstreetmap.osmosis.core.domain.v0_6.Way;

/**
 * defines test cases of the {@link OsmReceiver} {@link Class}
 *
 * @version 0.0.1
 * @author ChrissW-R1
 * @since 0.0.1
 */
public class OsmHandler06Test
{
	/**
	 * the test object
	 *
	 * @since 0.0.1
	 */
	@SuppressWarnings("deprecation")
	private OsmReceiver receiver;

	/**
	 * initialize the test object
	 *
	 * @since 0.0.1
	 *
	 * @throws MalformedURLException if the test object couldn't initialized
	 */
	@SuppressWarnings("deprecation")
	@Before
	public void setUp()
	throws MalformedURLException
	{
		this.receiver = new OsmReceiver(new URL("https://api.openstreetmap.org/api/0.6/"));
	}

	/**
	 * Test method for {@link OsmReceiver#getEntity(long, EntityType)}.
	 */
	@Test
	public void testRequestEntity()
	{
		try
		{
			@SuppressWarnings("deprecation")
			Entity entity = this.receiver.getEntity(269636333, EntityType.Way);
			Assert.assertEquals(269636333, entity.getId());
			Assert.assertEquals(EntityType.Way, entity.getType());

			boolean foundHighway = false;
			String name = "";
			Collection<Tag> tags = entity.getTags();
			for (Tag tag : tags)
			{
				if (tag.getKey().equals("highway"))
				{
					foundHighway = true;
				}

				if (tag.getKey().equals("name"))
				{
					name = tag.getValue();
				}
			}

			Assert.assertTrue(foundHighway);
			Assert.assertEquals("\u00DCberwasserstra\u00DFe", name);
		}
		catch (IOException e)
		{
			Assert.fail("Request of way 269636333 failed: " + e.getMessage());
		}
	}

	/**
	 * Test method for {@link OsmReceiver#getEntities(Collection, EntityType)} .
	 */
	@Test
	public void testRequestEntities()
	{
		Long[] ids =
		{
				269636333L,
				5881250L,
				5738250L,
				5881251L
		};

		try
		{
			@SuppressWarnings("deprecation")
			Set<Entity> entities = this.receiver.getEntities(new HashSet<>(Arrays.asList(ids)), EntityType.Way);

			Set<Long> idSet = new HashSet<>();
			for (Entity entity : entities)
			{
				idSet.add(entity.getId());
			}

			Assert.assertTrue(idSet.containsAll(Arrays.asList(ids)));
		}
		catch (IOException e)
		{
			Assert.fail("Request of multiple ways failed: " + e.getMessage());
		}
	}

	/**
	 * Test method for {@link OsmReceiver#getWaysOf(Node)}.
	 */
	@Test
	public void testRequestWaysOf()
	{
		long nodeId = 42907315;
		Node node = Mockito.mock(Node.class);
		Mockito.when(node.getId()).thenReturn(nodeId);

		Long[] wayIds =
		{
				269636333L,
				5881250L,
				5738250L,
				5881251L
		};

		try
		{
			@SuppressWarnings("deprecation")
			Set<Way> ways = this.receiver.getWaysOf(node);
			Assert.assertTrue(ways.size() >= 2);

			Set<Long> idSet = new HashSet<>();
			for (Way way : ways)
			{
				idSet.add(way.getId());
			}

			Assert.assertTrue(idSet.containsAll(Arrays.asList(wayIds)));
		}
		catch (IOException e)
		{
			Assert.fail("Request of ways from node " + nodeId + " failed: " + e.getMessage());
		}
	}

	/**
	 * Test method for {@link OsmReceiver#getRelsOf(Entity)}.
	 */
	@Test
	public void testRequestRelationsOf()
	{
		long wayId = 16307424;
		Way way = Mockito.mock(Way.class);
		Mockito.when(way.getType()).thenReturn(EntityType.Way);
		Mockito.when(way.getId()).thenReturn(wayId);

		Long[] relIds =
		{
				5633210L,
				5633244L,
				5634106L,
				5634231L,
				5634288L,
				5634287L,
				5634107L,
				5634230L,
				5634955L,
				5634956L,
				5635160L,
				5635161L,
				5635481L,
				5635482L,
				5635027L,
				5635028L,
				5635546L,
				5635547L,
				5633686L,
				5639688L
		};

		try
		{
			@SuppressWarnings("deprecation")
			Set<Relation> rels = this.receiver.getRelsOf(way);

			Set<Long> idSet = new HashSet<>();
			for (Relation rel : rels)
			{
				idSet.add(rel.getId());
			}

			Assert.assertTrue(idSet.containsAll(Arrays.asList(relIds)));
		}
		catch (IOException e)
		{
			Assert.fail("Request of ways from node " + wayId + " failed: " + e.getMessage());
		}
	}
}


text:
ROOT = ../../../../..
DIR = Pegasus/Repository/tests/CompareRepositories

include $(ROOT)/mak/config.mak
include ../libraries.mak

LOCAL_DEFINES = -DPEGASUS_INTERNALONLY
LOCAL_CLEAN_TARGET=local-clean

PROGRAM = CompareRepositories
SOURCES = CompareRepositories.cpp

include $(ROOT)/mak/program.mak

.PHONY: FORCE local-clean tests poststarttests

FORCE:

local-clean:

tests:

poststarttests:


text:
import os
import sys
import ConfigParser
from fabric.colors import red, green
from fabric.api import sudo, get, task
from fabric.context_managers import settings

config = ConfigParser.ConfigParser()
if os.path.exists('config.ini'):
    config.read('config.ini')
else:
    print(red('Error: config file not found!'))
    sys.exit(1)

@task
def wordpress_backup():
    for website in config.sections():
        ssh_server = config.get(website, 'ssh_server')
        ssh_user = config.get(website, 'ssh_user')
        ssh_key = config.get(website, 'ssh_key')
        database = config.get(website, 'database')
        mysql_root_password = config.get(website, 'mysql_root_password')
        wordpress_remote_folder = config.get(website, 'wordpress_remote_folder')
        backup_folder = config.get(website, 'backup_folder')

        website_folder = os.path.join(backup_folder, website)
        if not os.path.exists(website_folder):
            os.mkdir(website_folder)
            print("Directory {} created".format(website_folder))
        else:
            print("Warning: directory {} is not empty, I will save in it".format(website_folder))

        with settings(host_string=ssh_user + '@' + ssh_server, user=ssh_user, key_filename=ssh_key, warn_only=True):
            sudo('mysqldump -u root --password=' + mysql_root_password + ' ' + database + ' | gzip > /root/wp.db.gz')
            sudo('tar -zcvf /root/wp.tar.gz ' + wordpress_remote_folder)
            get(remote_path='/root/wp.db.gz', local_path=website_folder)
            get(remote_path='/root/wp.tar.gz', local_path=website_folder)
            sudo('rm -rf /root/wp.db.gz')
            sudo('rm -rf /root/wp.tar.gz')
            print(green('Ok: webiste {} backup complete!'.format(website)))