text:
package com.apple.eawt;

import java.util.EventListener;

/**
 * ApplicationEvents are deprecated. Use individual AppEvent listeners or handlers instead.
 *
 * @see Application#addAppEventListener(AppEventListener)
 *
 * @see AboutHandler
 * @see PreferencesHandler
 * @see OpenURIHandler
 * @see OpenFilesHandler
 * @see PrintFilesHandler
 * @see QuitHandler
 *
 * @see AppReOpenedListener
 * @see AppForegroundListener
 * @see AppHiddenListener
 * @see UserSessionListener
 * @see ScreenSleepListener
 * @see SystemSleepListener
 *
 * @since 1.4
 * @deprecated replaced by {@link AboutHandler}, {@link PreferencesHandler}, {@link AppReOpenedListener}, {@link OpenFilesHandler}, {@link PrintFilesHandler}, {@link QuitHandler}, {@link QuitResponse}
 */
@SuppressWarnings("deprecation")
@Deprecated
public interface ApplicationListener extends EventListener {
    /**
     * Called when the user selects the About item in the application menu. If event is not handled by
     * setting isHandled(true), a default About window consisting of the application's name and icon is
     * displayed. To display a custom About window, designate the event as being handled and display the
     * appropriate About window.
     *
     * @param event an ApplicationEvent initiated by the user choosing About in the application menu
     * @deprecated use {@link AboutHandler}
     */
    @Deprecated
    public void handleAbout(ApplicationEvent event);

    /**
     * Called when the application receives an Open Application event from the Finder or another application. Usually
     * this will come from the Finder when a user double-clicks your application icon. If there is any special code
     * that you want to run when you user launches your application from the Finder or by sending an Open Application
     * event from another application, include that code as part of this handler. The Open Application event is sent
     * after AWT has been loaded.
     *
     * @param event the Open Application event
     * @deprecated no replacement
     */
    @Deprecated
    public void handleOpenApplication(ApplicationEvent event);

    /**
     * Called when the application receives an Open Document event from the Finder or another application. This event
     * is generated when a user double-clicks a document in the Finder. If the document is registered as belonging
     * to your application, this event is sent to your application. Documents are bound to a particular application based
     * primarily on their suffix. In the Finder, a user selects a document and then from the File Menu chooses Get Info.
     * The Info window allows users to bind a document to a particular application.
     *
     * These events are sent only if the bound application has file types listed in the Info.plist entries Document Types
     * or CFBundleDocumentTypes.
     *
     * The ApplicationEvent sent to this handler holds a reference to the file being opened.
     *
     * @param event an Open Document event with reference to the file to be opened
     * @deprecated use {@link OpenFilesHandler}
     */
    @Deprecated
    public void handleOpenFile(ApplicationEvent event);

    /**
     * Called when the Preference item in the application menu is selected. Native Mac OS X applications make their
     * Preferences window available through the application menu. Java applications are automatically given an application
     * menu in Mac OS X. By default, the Preferences item is disabled in that menu. If you are deploying an application
     * on Mac OS X, you should enable the preferences item with setEnabledPreferencesMenu(true) in the
     * Application object and then display your Preferences window in this handler.
     *
     * @param event triggered when the user selects Preferences from the application menu
     * @deprecated use {@link PreferencesHandler}
     */
    @Deprecated
    public void handlePreferences(ApplicationEvent event);

    /**
     * Called when the application is sent a request to print a particular file or files. You can allow other applications to
     * print files with your application by implementing this handler. If another application sends a Print Event along
     * with the name of a file that your application knows how to process, you can use this handler to determine what to
     * do with that request. You might open your entire application, or just invoke your printing classes.
     *
     * These events are sent only if the bound application has file types listed in the Info.plist entries Document Types
     * or CFBundleDocumentTypes.
     *
     * The ApplicationEvent sent to this handler holds a reference to the file being opened.
     *
     * @param event a Print Document event with a reference to the file(s) to be printed
     * @deprecated use {@link PrintFilesHandler}
     */
    @Deprecated
    public void handlePrintFile(ApplicationEvent event);

    /**
     * Called when the application is sent the Quit event. This event is generated when the user selects Quit from the
     * application menu, when the user types Command-Q, or when the user control clicks on your application icon in the
     * Dock and chooses Quit. You can either accept or reject the request to quit. You might want to reject the request
     * to quit if the user has unsaved work. Reject the request, move into your code to save changes, then quit your
     * application. To accept the request to quit, and terminate the application, set isHandled(true) for the
     * event. To reject the quit, set isHandled(false).
     *
     * @param event a Quit Application event
     * @deprecated use {@link QuitHandler} and {@link QuitResponse}
     */
    @Deprecated
    public void handleQuit(ApplicationEvent event);

    /**
     * Called when the application receives a Reopen Application event from the Finder or another application. Usually
     * this will come when a user clicks on your application icon in the Dock. If there is any special code
     * that needs to run when your user clicks on your application icon in the Dock or when a Reopen Application
     * event is sent from another application, include that code as part of this handler.
     *
     * @param event the Reopen Application event
     * @deprecated use {@link AppReOpenedListener}
     */
    @Deprecated
    public void handleReOpenApplication(ApplicationEvent event);
}

redpajama_set_name: RedPajamaGithub


text:
package org.hamcrest.core;

import org.hamcrest.Description;
import org.hamcrest.DiagnosingMatcher;
import org.hamcrest.Matcher;

import java.util.Arrays;

/**
 * Calculates the logical conjunction of multiple matchers. Evaluation is shortcut, so
 * subsequent matchers are not called if an earlier matcher returns false.
 */
public class AllOf<T> extends DiagnosingMatcher<T> {

    private final Iterable<Matcher<? super T>> matchers;

    public AllOf(Iterable<Matcher<? super T>> matchers) {
        this.matchers = matchers;
    }

    @Override
    public boolean matches(Object o, Description mismatch) {
        for (Matcher<? super T> matcher : matchers) {
            if (!matcher.matches(o)) {
                mismatch.appendDescriptionOf(matcher).appendText(" ");
                matcher.describeMismatch(o, mismatch);
              return false;
            }
        }
        return true;
    }

    @Override
    public void describeTo(Description description) {
        description.appendList("(", " " + "and" + " ", ")", matchers);
    }

    /**
     * Creates a matcher that matches if the examined object matches ALL of the specified matchers.
     * For example:
     *
assertThat("myValue", allOf(startsWith("my"), containsString("Val")))

     */
    public static <T> Matcher<T> allOf(Iterable<Matcher<? super T>> matchers) {
        return new AllOf<>(matchers);
    }

    /**
     * Creates a matcher that matches if the examined object matches ALL of the specified matchers.
     * For example:
     *
assertThat("myValue", allOf(startsWith("my"), containsString("Val")))

     */
    @SafeVarargs
    public static <T> Matcher<T> allOf(Matcher<? super T>... matchers) {
        return allOf(Arrays.asList(matchers));
    }
}


text:
- Ensures `console.log` doesn't cause errors in browsers with no console
- Lets you enable/disable console logging (using `console.enabled = boolean`)
- Supports all console methods [documented by Mozilla](https://developer.mozilla.org/en-US/docs/Web/API/console)
- If any console method was overlooked, it will be delegated to the original console object (bypassing the `enabled` check)

Tested and works in Chrome, Firefox and Safari. Chrome gives the nicest stack traces.

## Giant Caveat

This whole thing is a herculean effort to make things work nicely even if you leave `console.log` statements in your code and ship it to production.

**But probably you just shouldn't do that.**

(It was fun to write, though.)

## Try it out

Open the included `demo.html` in a browser, **or** after including `consolation.js` in your own page, paste in the following:

```javascript
console.enabled = true;

function go_beedogs_go() {
  console.log('I heart beedogs', 42, {we: 'rock you', yes: function(){ return 'we do';}});
}

go_beedogs_go();

console.log('here we are in the top level...');
```

Then paste the following in your browser's JS console.

```javascript
console.warn('hi there', {number: 9});
```

That's pretty much it. If you're hungry for **still more** excitement, read the source code, you crazy adrenaline junky.

## If you hate it

Try Ben Alman's better-known [Javascript Debug](http://benalman.com/projects/javascript-debug-console-log).


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2015 AppTik Project
  ~
  ~ 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.
  -->

<io.apptik.multiview.view.TouchImageView
    android:id="@+id/img1"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="140dp"
    android:orientation="vertical">

</io.apptik.multiview.view.TouchImageView>


text:
/* $Xorg: imLcSIc.c,v 1.3 2000/08/17 19:45:14 cpqbld Exp $ */
/******************************************************************

          Copyright 1990, 1991, 1992, 1993, 1994 by FUJITSU LIMITED

Permission to use, copy, modify, distribute, and sell this software
and its documentation for any purpose is hereby granted without fee,
provided that the above copyright notice appear in all copies and
that both that copyright notice and this permission notice appear
in supporting documentation, and that the name of FUJITSU LIMITED
not be used in advertising or publicity pertaining to distribution
of the software without specific, written prior permission.
FUJITSU LIMITED makes no representations about the suitability of
this software for any purpose.
It is provided "as is" without express or implied warranty.

FUJITSU LIMITED DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
EVENT SHALL FUJITSU LIMITED BE LIABLE FOR ANY SPECIAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

  Author: Takashi Fujiwara     FUJITSU LIMITED
                               fujiwara@a80.tech.yk.fujitsu.co.jp

******************************************************************/

#include <stdio.h>
#include <X11/Xlib.h>
#include <X11/Xmd.h>
#include <X11/Xutil.h>
#include "Xlibint.h"
#include "Xlcint.h"
#include "Ximint.h"

Public char *
_XimLocalSetICValues(xic, values)
    XIC			 xic;
    XIMArg		*values;
{
    XimDefICValues	 ic_values;
    Xic			 ic = (Xic)xic;
    char		*name;

    _XimGetCurrentICValues(ic, &ic_values);
    name = _XimSetICValueData(ic, (XPointer)&ic_values,
				ic->private.local.ic_resources,
				ic->private.local.ic_num_resources,
				values, XIM_SETICVALUES, True);
    _XimSetCurrentICValues(ic, &ic_values);
    return(name);
}


text:
        <title>BDOdonto</title>
        <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
        <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
        <link rel='stylesheet prefetch' href='http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css'>
		<link rel="stylesheet" href="/static/css/login.css">

        <meta charset="UTF-8">

		{% if err == True %}

Usuário ou senha inválidos!

		{% endif %}

			<form action="{% url 'sistema_fichas:login' %}" method="post" enctype="multipart/form-data">
			{% csrf_token %}
			    <input type="text" name="username" placeholder="Nome de usuário">
			    <input type="password" name="password" placeholder="Senha">
			    <input type="submit" name="login" class="login login-submit" value="Login">
			    <input type="hidden" name="next" value="{% url 'sistema_fichas:buscar_paciente' %}"/>
			</form>

Developed by &nbsp&nbsp


text:
// TODO:
// [ ] Contracts
// [ ] Documentation
// [O] Property accessors should not throw, but return default value if the underlying field is undefined (?)
// [X] Property accessors should throw InvalidOperationException when this ServerInfo.Record is null.

namespace Splunk.Client
{
    using System;
    using System.Collections.Generic;

    public sealed class ServerInfo : Entity<ServerInfo>
    {
        #region Constructors

        public ServerInfo(Context context, Namespace @namespace)
            : base(context, @namespace, ClassResourceName)
        { }

        /// <summary>
        /// Infrastructure. Initializes a new instance of the <see cref=
        /// "ServerInfo"/> class.
        /// </summary>
        /// <remarks>
        /// This API supports the Splunk client infrastructure and is not
        /// intended to be used directly from your code.
        /// </remarks>
        public ServerInfo()
        { }

        #endregion

        #region Properties

        public int Build
        {
            get { return this.GetValue("Build", Int32Converter.Instance); }
        }

        /// <summary>
        /// Gets the access control lists for the current <see cref=
        /// "ServerInfo"/>.
        /// </summary>
        public Eai Eai
        {
            get { return this.GetValue("Eai", Eai.Converter.Instance); }
        }

        /// <summary>
        /// Gets the <see cref="Guid"/> identifying the current Splunk server instance.
        /// </summary>
        public Guid Guid
        {
            get { return this.GetValue("Guid", GuidConverter.Instance); }
        }

        public bool IsFree
        {
            get { return this.GetValue("IsFree", BooleanConverter.Instance); }
        }

        public bool IsRealtimeSearchEnabled
        {
            get { return this.GetValue("RtsearchEnabled", BooleanConverter.Instance); }
        }

        public bool IsTrial
        {
            get { return this.GetValue("IsTrial", BooleanConverter.Instance); }
        }

        public IReadOnlyList<string> LicenseKeys
        {
            get { return this.GetValue("LicenseKeys", CollectionConverter<string, List<string>, StringConverter>.Instance); }
        }

        public IReadOnlyList<string> LicenseLabels
        {
            get { return this.GetValue("LicenseLabels", CollectionConverter<string, List<string>, StringConverter>.Instance); }
        }

        public string LicenseSignature
        {
            get { return this.GetValue("LicenseSignature", StringConverter.Instance); }
        }

        public LicenseState LicenseState
        {
            get { return this.GetValue("LicenseState", EnumConverter<LicenseState>.Instance); }
        }

        /// <summary>
        /// Gets the <see cref="Guid"/> identifying the license master for the
        /// current Splunk server instance.
        /// </summary>
        public Guid MasterGuid
        {
            get { return this.GetValue("MasterGuid", GuidConverter.Instance); }
        }

        public ServerMode Mode
        {
            get { return this.GetValue("Mode", EnumConverter<ServerMode>.Instance); }
        }

        public string OSBuild
        {
            get { return this.GetValue("OsBuild", StringConverter.Instance); }
        }

        public string OSName
        {
            get { return this.GetValue("OsName", StringConverter.Instance); }
        }

        public string OSVersion
        {
            get { return this.GetValue("OsVersion", StringConverter.Instance); }
        }

        public string CpuArchitecture
        {
            get { return this.GetValue("CpuArch", StringConverter.Instance); }
        }

        public string ServerName
        {
            get { return this.GetValue("ServerName", StringConverter.Instance); }
        }

        public Version Version
        {
            get { return this.GetValue("Version", VersionConverter.Instance); }
        }

        #endregion

        #region Privates/internals

        internal static readonly ResourceName ClassResourceName = new ResourceName("server", "info");

        #endregion
    }
}


text:
using namespace ONNX_NAMESPACE;
using namespace onnxruntime;

namespace onnxruntime {
namespace test {

void LoadSaveAndCompareModel(const std::string& input_onnx,
                             const std::string& output_onnx,
                             const std::string& external_init_file,
                             size_t initializer_size_threshold) {
  std::shared_ptr<Model> model;
  ASSERT_STATUS_OK(Model::Load(ToPathString(input_onnx), model, nullptr, DefaultLoggingManager().DefaultLogger()));
  std::remove(output_onnx.c_str());
  std::remove(external_init_file.c_str());
  ASSERT_STATUS_OK(Model::SaveWithExternalInitializers(*model, ToPathString(output_onnx), external_init_file, initializer_size_threshold));

  std::shared_ptr<Model> model_from_external;
  ASSERT_STATUS_OK(Model::Load(ToPathString(output_onnx), model_from_external, nullptr, DefaultLoggingManager().DefaultLogger()));

  Graph& graph = model->MainGraph();
  // Perform shape inference on the graph, if this succeeds then it means that we could correctly read the
  // integer initializers used by reshape and transpose.
  ASSERT_STATUS_OK(graph.Resolve());
  Graph& graph_from_external = model_from_external->MainGraph();

  InitializedTensorSet initializers = graph.GetAllInitializedTensors();
  InitializedTensorSet initializers_from_external = graph_from_external.GetAllInitializedTensors();

  ASSERT_EQ(initializers.size(), initializers_from_external.size());

  // Compare the initializers of the two versions.
  for (auto i : initializers) {
    const std::string kInitName = i.first;
    const ONNX_NAMESPACE::TensorProto* tensor_proto = i.second;
    const ONNX_NAMESPACE::TensorProto* from_external_tensor_proto = initializers_from_external[kInitName];

    std::vector<uint8_t> tensor_proto_data;
    ORT_THROW_IF_ERROR(utils::UnpackInitializerData(*tensor_proto, Path(), tensor_proto_data));
    size_t tensor_proto_size = tensor_proto_data.size();

    std::vector<uint8_t> from_external_tensor_proto_data;
    ORT_THROW_IF_ERROR(utils::UnpackInitializerData(*from_external_tensor_proto, Path(), from_external_tensor_proto_data));
    size_t from_external_tensor_proto_size = from_external_tensor_proto_data.size();

    if (from_external_tensor_proto_size < initializer_size_threshold) {
      // 'Small' tensors should be embedded in the onnx file.
      EXPECT_EQ(from_external_tensor_proto->data_location(), ONNX_NAMESPACE::TensorProto_DataLocation::TensorProto_DataLocation_DEFAULT);
    } else {
      // 'Large' tensors should be added to the external binary file.
      EXPECT_EQ(from_external_tensor_proto->data_location(), ONNX_NAMESPACE::TensorProto_DataLocation::TensorProto_DataLocation_EXTERNAL);
    }

    ASSERT_EQ(tensor_proto_size, from_external_tensor_proto_size);
    EXPECT_EQ(memcmp(tensor_proto_data.data(), from_external_tensor_proto_data.data(), tensor_proto_size), 0);
  }
  // Cleanup.
  ASSERT_EQ(std::remove(output_onnx.c_str()), 0);
  ASSERT_EQ(std::remove(external_init_file.c_str()), 0);
}

TEST(SaveWithExternalInitializers, Mnist) {
  LoadSaveAndCompareModel("testdata/mnist.onnx", "testdata/mnist_with_external_initializers.onnx", "mnist_external_initializers.bin", 100);
}

}  // namespace test
}  // namespace onnxruntime


text:
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.ide.actions.searcheverywhere;

import com.intellij.ide.IdeBundle;
import com.intellij.ide.util.gotoByName.FilteringGotoByModel;
import com.intellij.ide.util.gotoByName.GotoSymbolModel2;
import com.intellij.lang.Language;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.project.Project;
import com.intellij.ui.IdeUICustomization;
import org.jetbrains.annotations.NotNull;

import java.util.List;

/**
 * @author Konstantin Bulenkov
 */
public class SymbolSearchEverywhereContributor extends AbstractGotoSEContributor {

  private final PersistentSearchEverywhereContributorFilter<Language> myFilter;

  public SymbolSearchEverywhereContributor(@NotNull AnActionEvent event) {
    super(event);
    myFilter = ClassSearchEverywhereContributor.createLanguageFilter(event.getRequiredData(CommonDataKeys.PROJECT));
  }

  @NotNull
  @Override
  public String getGroupName() {
    return IdeBundle.message("search.everywhere.group.name.symbols");
  }

  @NotNull
  public String includeNonProjectItemsText() {
    return IdeBundle.message("checkbox.include.non.project.symbols", IdeUICustomization.getInstance().getProjectConceptName());
  }

  @Override
  public int getSortWeight() {
    return 300;
  }

  @NotNull
  @Override
  protected FilteringGotoByModel<Language> createModel(@NotNull Project project) {
    GotoSymbolModel2 model = new GotoSymbolModel2(project);
    if (myFilter != null) {
      model.setFilterItems(myFilter.getSelectedElements());
    }
    return model;
  }

  @NotNull
  @Override
  public List<AnAction> getActions(@NotNull Runnable onChanged) {
    return doGetActions(includeNonProjectItemsText(), myFilter, onChanged);
  }

  public static class Factory implements SearchEverywhereContributorFactory<Object> {
    @NotNull
    @Override
    public SearchEverywhereContributor<Object> createContributor(@NotNull AnActionEvent initEvent) {
      return new SymbolSearchEverywhereContributor(initEvent);
    }
  }
}


text:
{-# LANGUAGE TemplateHaskell, DeriveDataTypeable, MultiParamTypeClasses, TypeFamilies, FlexibleContexts #-}
module Main where

import Happstack.Server
import Happstack.State

import Data.Typeable
import Control.Monad.State
import Control.Monad.Reader

data MyState = MyState Int deriving (Typeable)

instance Version MyState
$(deriveSerialize ''MyState)

succVal :: Update MyState ()
succVal = modify (\(MyState n) -> MyState (succ n))
predVal :: Update MyState ()
predVal = modify (\(MyState n) -> MyState (pred n))

getVal :: Query MyState Int
getVal = do MyState n <- ask
            return n

$(mkMethods ''MyState [ 'succVal
                      , 'predVal
                      , 'getVal])

instance Component MyState where
    type Dependencies MyState = End
    initialValue = MyState 0

rootState :: Proxy MyState
rootState = Proxy

main :: IO ()
main = do ctl <- startSystemStateMultimaster rootState
          simpleHTTP nullConf{port=8000} $ msum
              [ dir "succ" $ do update SuccVal
                                seeOther "/" ""
              , dir "pred" $ do update PredVal
                                seeOther "/" ""
              , do val <- query GetVal
                   ok $ "Value is: " ++ show val ]


text:
stigame
=======

[![Build Status](https://travis-ci.org/jordsti/stigame.svg?branch=master)](https://travis-ci.org/jordsti/stigame)

StiGame is a C++ 2D game library using SDL2.
You can fork this repository if you want to bootstrap your new game with this library and modify the library for the need of your game
or you can use the pre-compiled binary and use this library for your project.

### What is included ?
At the moment, these features are already implemented into StiGame.

- Basic State
  - BaseGameState
  - GuiState
- Viewport
  - Window Size
  - Window Mode
  - FPS Handling
- Action Binding
  - Key Action
  - Mouse Action
  - Binding Configuration File
- User Interface
  - Gui Elements
    - Button
	- Label
	- Combo Box
	- Check Box and Radio Button
	- Selection List
	- Tab Panel
	- Layout *on the way...*
		- Vertical Box Layout **vertical align todo**
		- Horizontal Box Layout **test and horizontal align todo**
		- Form Layout **todo**
		- Spacer Item for Layout **to test**
- Game Sprite
  - Directional Sprite
  - General Sprite
  - Sprite Library for texture management

- Tool(s)
  - [Sprite Editor](tools/sprite-editor)
  - [Gui Editor](tools/gui-editor)

### Purpose
This library will be used for StiCode game development and this library will be development for the need of StiCode Games.
But we will try to keep the library "general", so no game specific thing will be implemented in this library.

### Compile and Test

#### Windows

At the moment the only test is to run the Sample coming with the library. This sample only show gui elements at the moment.

We currently compile StiGame using mingw32-TDM-GCC-4.8.1 (Coming with Code::Blocks).

Windows 7 and Linux are the only tested Operating System at the moment.

You need to first retrieve the extern files like SDL2 header and libraries.

A Python script is included for this. (Windows Only)

After you can compile using Code::Blocks IDE.

__Windows build is broken at the moment because of SDL_Thread (need a windows pc to fix this)__

#### Linux

Tested on Linux (Ubuntu 14.04-64bit) with g++ and SDL2, SDL2-image, SDL2-ttf and SDL2-gfx

You just need to fetch the depencies
- SDL2
- SDL2-image
- SDL2-ttf
- SDL2-net
- SDL2-gfx

### TO DO

- Gui Test Project, to test all Gui Element
	- Table -> to be tested and finished
	- Decorated Button *Python wrapper w/ (M)Style*
		- Highlight button, graphics are there
	- Progress Bar test
	- TextBox working, but need to handle unicode or transfert char into ascii.
	- Need to add a BaseClass for Font Rendering Gui Item, to generalize setCaption and getCaption method.
	- Layout Item
		- Form Layout
		- ~~Item Minimum Size and MaxSize ?~~
	- Normalize all *.setCaption method ; std::string text or const char* , to be determined! __High Priority__
	- Gui Item Appereance effect and dispearring effects __Working at the moment__
- Viewport
  - Save resolution information, to persist configuration
  - Viewport Settings ?

- Controller Support
  - Map Controller and handle event
  - Persitant configuration of the default controller

- SPhysic *recode*

- GameUnit review *will be deleted*

- Sprite tick rework, not static anymore

- float matrix for point transformation

- Network Code
    - Udp Socket -> Working with UdpPacket and PacketStream to read content of a packet, still need to implement more data type (Only Int32 and UInt32 are handled)
    - Need to test between two different environment (Big Endian vs Little Endian)
    - Tcp Socket seems to work, but still need to do many things, still need to encapsulate all the data into a packet to use PacketStream class
    - MessageQueue System Base Class with multi-thread (one sending, one receiving)

- FrameFile ( equation evaluation (+, -) with vars (state_width, state_height,etc... )

and things that don't come to my mind at the moment...

### Nigthly Builds

Nightly builds are currently available at : http://ci.sticode.org/

Current API documention can be found at : http://ci.sticode.org/stigamedoc/


text:
package org.apache.hadoop.metrics.spi;

import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.util.ArrayList;
import java.util.List;

/**
 * Static utility methods
 */
public class Util {

    /**
     * Not intended to be instantiated
     */
    private Util() {}

    /**
     * Parses a space and/or comma separated sequence of server specifications
     * of the form hostname or hostname:port.
     *
     * @return a list of SocketAddress objects.
     */
    //public static List<SocketAddress> parse(String specs, int defaultPort) {
    public static List parse(String specs, int defaultPort) {
        String[] specStrings = specs.split("[ ,]+");
        //List<SocketAddress> result = new ArrayList<SocketAddress>();
        List result = new ArrayList();

        //for (String specString : specStrings) {
        for (int i = 0; i < specStrings.length; i++) {
            String specString = specStrings[i];
            int colon = specString.indexOf(':');
            if (colon < 0 || colon == specString.length() - 1) {
                result.add(new InetSocketAddress(specString, defaultPort));
            } else {
                String hostname = specString.substring(0, colon);
                int port = Integer.parseInt(specString.substring(colon+1));
                result.add(new InetSocketAddress(hostname, port));
            }
        }
        return result;
    }

}


text:
//
// $Id: cpp_cli_utilities.hpp 10827 2017-05-11 21:01:58Z chambm $
//
//
// Original author: Matt Chambers <matt.chambers .@. vanderbilt.edu>
//
// Copyright 2010 Vanderbilt University - Nashville, TN 37232
//
// 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.
//

#ifndef _CPP_CLI_UTILITIES_HPP_
#define _CPP_CLI_UTILITIES_HPP_

#include <gcroot.h>
#include <vcclr.h>
#include <comdef.h> // _com_error
#include <vector>
#include <string>
#include <stdexcept>
#include <boost/algorithm/string/split.hpp>
#include <boost/range/algorithm/copy.hpp>
#include "automation_vector.h"

namespace pwiz {
namespace util {

inline std::string ToStdString(System::String^ source)
{
    if (System::String::IsNullOrEmpty(source))
        return std::string();

    System::Text::Encoding^ encoding = System::Text::Encoding::UTF8;
    array<System::Byte>^ encodedBytes = encoding->GetBytes(source);

    std::string target("", encodedBytes->Length);
    char* buffer = &target[0];
    unsigned char* unsignedBuffer = reinterpret_cast<unsigned char*>(buffer);
    System::Runtime::InteropServices::Marshal::Copy(encodedBytes, 0, (System::IntPtr) unsignedBuffer, encodedBytes->Length);
	return target;
}

inline System::String^ ToSystemString(const std::string& source, bool utf8=true)
{
    if (utf8)
    {
        System::Text::Encoding^ encoding = System::Text::Encoding::UTF8;
        int length = source.length();
        array<System::Byte>^ buffer = gcnew array<System::Byte>(length);
        System::Runtime::InteropServices::Marshal::Copy((System::IntPtr) const_cast<char*>(source.c_str()), buffer, 0, length);
        return encoding->GetString(buffer);
    }
    else
        return gcnew System::String(source.c_str());
}

template<typename managed_value_type, typename native_value_type>
void ToStdVector(cli::array<managed_value_type>^ managedArray, std::vector<native_value_type>& stdVector)
{
    stdVector.clear();
    if (managedArray->Length > 0)
    {
        cli::pin_ptr<managed_value_type> pin = &managedArray[0];
        native_value_type* begin = (native_value_type*) pin;
        stdVector.assign(begin, begin + managedArray->Length);
    }
}

template<typename managed_value_type, typename native_value_type>
void ToStdVector(System::Collections::Generic::IList<managed_value_type>^ managedList, std::vector<native_value_type>& stdVector)
{
    stdVector.clear();
    if (managedList->Count > 0)
    {
        stdVector.reserve(managedList->Count);
        for (size_t i = 0, end = managedList->Count; i < end; ++i)
            stdVector.push_back((native_value_type) managedList[i]);
    }
}

/// wraps a managed array in an automation_vector to enable direct access from unmanaged code
template<typename managed_value_type, typename native_value_type>
void ToAutomationVector(cli::array<managed_value_type>^ managedArray, automation_vector<native_value_type>& automationArray)
{
    VARIANT v;
    ::VariantInit(&v);
    System::IntPtr vPtr = (System::IntPtr) &v;
    System::Runtime::InteropServices::Marshal::GetNativeVariantForObject((System::Object^) managedArray, vPtr);
    automationArray.attach(v);
}

} // namespace util
} // namespace pwiz

namespace {

/// prepends function with a single level of scope,
/// e.g. "Reader::read()" instead of "pwiz::data::msdata::Reader::read()"
template <typename T>
std::string trimFunctionMacro(const char* function, const T& param)
{
    std::vector<boost::iterator_range<std::string::const_iterator> > tokens;
    std::string functionStr(function);
    boost::algorithm::split(tokens, functionStr, boost::is_any_of(":"), boost::algorithm::token_compress_on);
    std::string what("[");
    if (tokens.size() > 1)
    {
        boost::range::copy(*(tokens.rbegin() + 1), std::back_inserter(what));
        what += "::";
        if (boost::range::equal(*(tokens.rbegin() + 1), *tokens.rbegin()))
            what += "ctor";
        else if (tokens.rbegin()->front() == '~')
            what += "dtor";
        else
            boost::range::copy(*tokens.rbegin(), std::back_inserter(what));
    }
    else if (tokens.size() > 0)
        boost::range::copy(*tokens.rbegin(), std::back_inserter(what));
    what += "(" + lexical_cast<std::string>(param) + ")] ";
    return what;
}

} // namespace

/// forwards managed exception to unmanaged code;
/// prepends function with a single level of scope,
/// e.g. "Reader::read()" instead of "pwiz::data::msdata::Reader::read()"
#define CATCH_AND_FORWARD_EX(param) \
    catch (std::exception&) {throw;} \
    catch (_com_error& e) {throw std::runtime_error(string("COM error: ") + e.ErrorMessage());} \
    /*catch (CException* e) {std::auto_ptr<CException> exceptionDeleter(e); char message[1024]; e->GetErrorMessage(message, 1024); throw std::runtime_error(string("MFC error: ") + message);}*/ \
    catch (System::AggregateException^ e) { throw std::runtime_error(trimFunctionMacro(__FUNCTION__, (param)) + pwiz::util::ToStdString(e->ToString())); } \
    catch (System::Exception^ e) { throw std::runtime_error(trimFunctionMacro(__FUNCTION__, (param)) + pwiz::util::ToStdString(e->Message)); }

#define CATCH_AND_FORWARD CATCH_AND_FORWARD_EX("")

#endif // _CPP_CLI_UTILITIES_HPP_


text:
const { fork } = require('child_process');
const { join, dirname } = require('path');

const DEV_SCRIPT = join(__dirname, '../packages/plutarch/bin/plutarch.js');

function startDevServer(opts = {}) {
  const { port = 3001, cwd } = opts;
  return new Promise(resolve => {
    console.log(`Start dev server for ${cwd}`);
    const child = fork(DEV_SCRIPT, ['build', '--cwd', cwd], {
      env: {
        ...process.env,
        BROWSER: 'none',
        PROGRESS: 'none'
      },
    });
    child.on('message', args => {
      if (args.type === 'DONE') {
        resolve(child);
      }
    });
  });
}

function start() {
  const devServers = [
    [12341, '../packages/plutarch/tpls/mobx-project']
  ];

  return Promise.all(
    devServers.map(([port, cwd]) => {
      return startDevServer({ port, cwd: join(__dirname, cwd) });
    }),
  );
}

start();


text:
#include "FLAME.h"

FLA_Error FLA_Tridiag_UT_internal_check( FLA_Uplo uplo, FLA_Obj A, FLA_Obj T, fla_tridiagut_t* cntl )
{
	FLA_Error e_val;

	// Abort if the control structure is NULL.
	e_val = FLA_Check_null_pointer( ( void* ) cntl );
	FLA_Check_error_code( e_val );

	// Verify that the object element types are identical.
	e_val = FLA_Check_identical_object_elemtype( A, T );
	FLA_Check_error_code( e_val );

	return FLA_SUCCESS;
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;

namespace King_of_Thieves
{
    static class CMasterControl
    {
        public static Actors.HUD.health.CHealthController healthController;
        public static Sound.CAudioPlayer audioPlayer;
        public static Map.CMapManager mapManager = new Map.CMapManager();
        public static GameTime gameTime;
        public static Dictionary<int, List<Actors.CActorPacket>> commNet = new Dictionary<int, List<Actors.CActorPacket>>();
        public static ContentManager glblContent;
        public static Input.CInput glblInput;
        public static Graphics.CCamera camera = new Graphics.CCamera();

    }
}


text:
First Page

	go to the second page

Second Page

	go to the first page


text:
namespace Microsoft.AspNetCore.Server.Kestrel.Core.WebTransport;

/// <summary>
/// Represents the different types of WebTransport streams.
/// </summary>
internal enum WebTransportStreamType
{
    /// <summary>
    /// Represents a bidirectional WebTransport stream.
    /// </summary>
    Bidirectional,
    /// <summary>
    /// Represents a unidirectional inbound WebTransport stream.
    /// </summary>
    Input,
    /// <summary>
    /// Represents a unidirectional outbound WebTransport stream.
    /// </summary>
    Output,
}


text:
module Ducalis
  VERSION = '0.12.0'.freeze
end


text:
jQuery( function ( $ ) {
	'use strict';

	function rwmb_update_slider() {
		var $input = $( this ),
			$slider = $input.siblings( '.rwmb-slider' ),
			$valueLabel = $slider.siblings( '.rwmb-slider-value-label' ).find( 'span' ),
			value = $input.val(),
			options = $slider.data( 'options' );

		$slider.html( '' );

		if ( ! value ) {
			value = 0;
			$input.val( 0 );
			$valueLabel.text( '0' );
		}
		else {
			$valueLabel.text( value );
		}

		// Assign field value and callback function when slide
		options.value = value;
		options.slide = function ( event, ui ) {
			$input.val( ui.value );
			$valueLabel.text( ui.value );
		};

		$slider.slider( options );
	}

	$( ':input.rwmb-slider-value' ).each( rwmb_update_slider );
	$( '.rwmb-input' ).on( 'clone', ':input.rwmb-slider-value', rwmb_update_slider );
} );


text:
package com.amee.domain;

import com.amee.domain.auth.AccessSpecification;

/**
 * Defines an interface exposing the properties required to identify (refer-to) an AMEEEntity.
 */
public interface IAMEEEntityReference {

    /**
     * Fetches the ID of the referenced entity.
     *
     * @return the entity id
     */
    Long getEntityId();

    /**
     * Fetches the UID of the referenced entity.
     *
     * @return entity UID
     */
    String getEntityUid();

    /**
     * Fetches the ObjectTyoe of the referenced entity.
     *
     * @return the ObjectType
     */
    ObjectType getObjectType();

    /**
     * Returns the transient AccessSpecification for this entity. This will only be present if
     * an AccessSpecification for this entity has been created in the current thread.
     *
     * @return the AccessSpecification for this entity in the current thread
     */
    AccessSpecification getAccessSpecification();

    /**
     * Sets the AccessSpecification for this entity.
     *
     * @param accessSpecification for this entity
     */
    void setAccessSpecification(AccessSpecification accessSpecification);

    IAMEEEntity getEntity();

    void setEntity(IAMEEEntity entity);
}


text:
package org.apache.cassandra.stress.operations;

import java.io.IOException;
import java.nio.ByteBuffer;

import org.apache.cassandra.db.ColumnFamilyType;
import org.apache.cassandra.stress.Session;
import org.apache.cassandra.stress.util.Operation;
import org.apache.cassandra.thrift.Cassandra;
import org.apache.cassandra.thrift.Compression;
import org.apache.cassandra.thrift.CqlResult;
import org.apache.cassandra.thrift.CqlResultType;

public class CqlReader extends Operation
{
    public CqlReader(Session client, int idx)
    {
        super(client, idx);
    }

    public void run(Cassandra.Client client) throws IOException
    {
        if (session.getColumnFamilyType() == ColumnFamilyType.Super)
            throw new RuntimeException("Super columns are not implemented for CQL");

        StringBuilder query = new StringBuilder("SELECT ");

        if (session.columnNames == null)
        {
            query.append("FIRST ").append(session.getColumnsPerKey()).append(" ''..''");
        }
        else
        {
            for (int i = 0; i < session.columnNames.size(); i++)
            {
                if (i > 0)
                    query.append(",");
                query.append('\'').append(new String(session.columnNames.get(i).array())).append('\'');
            }
        }

        byte[] key = generateKey();

        query.append(" FROM Standard1 USING CONSISTENCY ").append(session.getConsistencyLevel().toString());
        query.append(" WHERE KEY=").append(getQuotedCqlBlob(key));

        long start = System.currentTimeMillis();

        boolean success = false;
        String exceptionMessage = null;

        for (int t = 0; t < session.getRetryTimes(); t++)
        {
            if (success)
                break;

            try
            {
                CqlResult result = client.execute_cql_query(ByteBuffer.wrap(query.toString().getBytes()),
                                                            Compression.NONE);
                success = (result.rows.get(0).columns.size() != 0);
            }
            catch (Exception e)
            {
                exceptionMessage = getExceptionMessage(e);
                success = false;
            }
        }

        if (!success)
        {
            error(String.format("Operation [%d] retried %d times - error reading key %s %s%n",
                                index,
                                session.getRetryTimes(),
                                new String(key),
                                (exceptionMessage == null) ? "" : "(" + exceptionMessage + ")"));
        }

        session.operations.getAndIncrement();
        session.keys.getAndIncrement();
        session.latency.getAndAdd(System.currentTimeMillis() - start);
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BadgesSharp.Builders
{
    /// <summary>
    /// BadgeBuilder extension methods.
    /// </summary>
    public static class BadgeBuilderExtensions
    {
        /// <summary>
        /// Sets the status by percent.
        /// </summary>
        /// <param name="builder">The badge builder.</param>
        /// <param name="percent">The percent.</param>
        public static void SetStatusByPercent(this BadgeBuilderBase builder, float percent)
        {
            if (percent < 50)
            {
                builder.Status = BadgeStatus.Failed;
            }
            else if (percent < 90)
            {
                builder.Status = BadgeStatus.Warning;
            }
            else
            {
                builder.Status = BadgeStatus.Success;
            }
        }
    }
}


text:
<?php

/**
 * @package Configuration
 * @subpackage Tests
 */
class ezcConfigurationArrayWriterTest extends ezcTestCase
{
    private $tempDir;

    protected function setUp()
    {
        if ( !ezcBaseFeatures::hasExtensionSupport( 'posix' ) )
        {
            $this->markTestSkipped( 'ext/posix is required for this test.' );
        }
        $this->tempDir = $this->createTempDir( 'ezcConfigurationArrayWriterTest' );
    }

    protected function tearDown()
    {
        $this->removeTempDir();
    }

    public function testConfigSettingUseComments()
    {
        $backend = new ezcConfigurationArrayWriter();
        $backend->setOptions( array ( 'useComments' => true ) );
        $backend->setOptions( array ( 'useComments' => false ) );
    }

    public function testConfigSettingUseCommentsWrongType()
    {
        $backend = new ezcConfigurationArrayWriter();
        try
        {
            $backend->setOptions( array ( 'useComments' => 'tests/translations' ) );
            $this->fail( 'Expected exception was not thrown' );
        }
        catch ( ezcBaseSettingValueException $e )
        {
            self::assertEquals( "The value 'tests/translations' that you were trying to assign to setting 'useComments' is invalid. Allowed values are: bool", $e->getMessage() );
        }
    }

    public function testConfigSettingPermissions()
    {
        $backend = new ezcConfigurationArrayWriter();
        $backend->setOptions( array ( 'permissions' => 0660 ) );
    }

    public function testConfigSettingPermissionsWrongType()
    {
        $backend = new ezcConfigurationArrayWriter();
        try
        {
            $backend->setOptions( array ( 'permissions' => 'tests/translations' ) );
            $this->fail( 'Expected exception was not thrown' );
        }
        catch ( ezcBaseSettingValueException $e )
        {
            self::assertEquals( "The value 'tests/translations' that you were trying to assign to setting 'permissions' is invalid. Allowed values are: int, 0 - 0777", $e->getMessage() );
        }
    }

    public function testConfigSettingPermissionsOutOfRange1()
    {
        $backend = new ezcConfigurationArrayWriter();
        try
        {
            $backend->setOptions( array ( 'permissions' => -1 ) );
            $this->fail( 'Expected exception was not thrown' );
        }
        catch ( ezcBaseSettingValueException $e )
        {
            self::assertEquals( "The value '-1' that you were trying to assign to setting 'permissions' is invalid. Allowed values are: int, 0 - 0777", $e->getMessage() );
        }
    }

    public function testConfigSettingPermissionsOutOfRange2()
    {
        $backend = new ezcConfigurationArrayWriter();
        try
        {
            $backend->setOptions( array ( 'permissions' => 01000 ) );
            $this->fail( 'Expected exception was not thrown' );
        }
        catch ( ezcBaseSettingValueException $e )
        {
            self::assertEquals( "The value '512' that you were trying to assign to setting 'permissions' is invalid. Allowed values are: int, 0 - 0777", $e->getMessage() );
        }
    }

    public function testGetOptions()
    {
        $backend = new ezcConfigurationArrayWriter();
        $backend->setOptions( array ( 'useComments' => true, 'permissions' => 0600 ) );
        $this->assertEquals( array ( 'useComments' => true, 'permissions' => 0600 ), $backend->getOptions() );
    }

    public function testConfigSettingBroken()
    {
        $backend = new ezcConfigurationArrayWriter();
        try
        {
            $backend->setOptions( array ( 'lOcAtIOn' => 'tests/translations' ) );
            $this->fail( 'Expected exception was not thrown' );
        }
        catch ( ezcBaseSettingNotFoundException $e )
        {
            self::assertEquals( "The setting 'lOcAtIOn' is not a valid configuration setting.", $e->getMessage() );
        }
    }

    public function testInitCtor1()
    {
        $backend = new ezcConfigurationArrayWriter( 'files/write_basic.php', new ezcConfiguration() );
        $this->assertEquals( 'files', $backend->getLocation() );
        $this->assertEquals( 'write_basic', $backend->getName() );
        $this->assertSame( 0666, $this->readAttribute( $backend, 'permissions' ) );
    }

    public function testInitCtor2()
    {
        $backend = new ezcConfigurationArrayWriter( 'files.foo/write_basic.php', new ezcConfiguration(), 0660 );
        $this->assertEquals( 'files.foo', $backend->getLocation() );
        $this->assertEquals( 'write_basic', $backend->getName() );
        $this->assertSame( 0660, $this->readAttribute( $backend, 'permissions' ) );
    }

    public function testInitCtor3()
    {
        try
        {
            $backend = new ezcConfigurationArrayWriter( 'files.foo/basic.f', new ezcConfiguration() );
            $this->fail( 'Expected exception not thrown' );
        }
        catch ( ezcConfigurationInvalidSuffixException $e )
        {
            $this->assertEquals( "The path 'files.foo/basic.f' has an invalid suffix (should be '.php').", $e->getMessage() );
        }
    }

    public function testInitMethod1()
    {
        $backend = new ezcConfigurationArrayWriter();
        $backend->init( 'files', 'write_basic', new ezcConfiguration() );
        $this->assertEquals( 'files', $backend->getLocation() );
        $this->assertEquals( 'write_basic', $backend->getName() );
    }

    public function testNoConfigObjectToSafe()
    {
        try
        {
            $backend = new ezcConfigurationArrayWriter();
            $backend->save();
            $this->fail( 'Expected exception not thrown' );
        }
        catch ( ezcConfigurationNoConfigObjectException $e )
        {
            $this->assertEquals( 'There is no config object to save.', $e->getMessage() );
        }
    }

    public function testEmptyFile()
    {
        $test = new ezcConfiguration();

        $backend = new ezcConfigurationArrayWriter( $this->tempDir . '/empty.php', $test );
        $backend->save();

        $backend = new ezcConfigurationArrayReader( $this->tempDir . '/empty.php' );
        $return = $backend->load();
        $this->assertEquals( $test, $return );
    }

    public function testOneGroup()
    {
        $settings = array(
            'TheOnlyGroup' => array(
                'Setting1' => true,
                'SettingNoComment' => 42,
                'MultiRow' => false,
            )
        );
        $comments = array(
            'TheOnlyGroup' => array(
                '#' => "Just one group",
                'Setting1' => " This setting sucks",
                'MultiRow' => " Multi\n row\n comment",
            )
        );
        $test = new ezcConfiguration( $settings, $comments );

        $backend = new ezcConfigurationArrayWriter( $this->tempDir . '/one-group.php', $test );
        $backend->save();

        $backend = new ezcConfigurationArrayReader( $this->tempDir . '/one-group.php' );
        $return = $backend->load();
        $this->assertEquals( $test, $return );
    }

    public function testOneGroupWithSetConfig()
    {
        $settings = array(
            'TheOnlyGroup' => array(
                'Setting1' => true,
                'SettingNoComment' => 42,
                'MultiRow' => false,
            )
        );
        $comments = array(
            'TheOnlyGroup' => array(
                '#' => "Just one group",
                'Setting1' => " This setting sucks",
                'MultiRow' => " Multi\n row\n comment",
            )
        );
        $test = new ezcConfiguration( $settings, $comments );

        $backend = new ezcConfigurationArrayWriter( $this->tempDir . '/one-group.php', new ezcConfiguration() );
        $backend->setConfig( $test );
        $backend->save();

        $backend = new ezcConfigurationArrayReader( $this->tempDir . '/one-group.php' );
        $return = $backend->load();
        $this->assertEquals( $test, $return );
    }

    public function testOneGroupNoComments()
    {
        $settings = array(
            'TheOnlyGroup' => array(
                'Setting1' => true,
                'SettingNoComment' => 42,
                'MultiRow' => false,
            )
        );
        $comments = array(
            'TheOnlyGroup' => array(
                '#' => "Just one group",
                'Setting1' => " This setting sucks",
                'MultiRow' => " Multi\n row\n comment",
            )
        );
        $test = new ezcConfiguration( $settings, $comments );
        $expected = new ezcConfiguration( $settings, array() );

        $backend = new ezcConfigurationArrayWriter( $this->tempDir . '/one-group-no-comments.php', $test );
        $backend->setOptions( array ( 'useComments' => false ) );
        $backend->save();

        $backend = new ezcConfigurationArrayReader( $this->tempDir . '/one-group-no-comments.php' );
        $return = $backend->load();
        $this->assertEquals( $expected, $return );
    }

    public function testTwoGroups()
    {
        $settings = array(
            'NotTheOnlyGroup' => array(
                'Setting1' => true,
            ),
            'TheSecond' => array(
                'Setting1' => false,
            ),
        );
        $comments = array(
            'NotTheOnlyGroup' => array(
                '#' => " Not just one group",
            ),
            'TheSecond' => array(
                '#' => " The second group",
            ),
        );
        $test = new ezcConfiguration( $settings, $comments );

        $backend = new ezcConfigurationArrayWriter( $this->tempDir . '/two-groups.php', $test );
        $backend->save();

        $backend = new ezcConfigurationArrayReader( $this->tempDir . '/two-groups.php' );
        $return = $backend->load();
        $this->assertEquals( $test, $return );
    }

    public function testFormats()
    {
        $settings = array(
            'FormatTest' => array(
                'Decimal1' => 42,
                'Decimal2' => 0,
                'MaxSize' => 400,
                'MinSize' => 0,
                'Hex1' => 11189196,
                'Hex2' => 11189196,
                'Hex3' => 11189196,
                'Hex4' => 11189196,
                'TextColor' => 66302,
                'Octal1' => 1,
                'Octal2' => 458,
                'Permission' => 438,
                'Float1' => 0.2,
                'Float2' => .8123,
                'Float3' => 314e-2,
                'Float4' => 3.141592654e1,
                'Price' => 10.4,
                'Seed' => 10e5,
                'String1' => 'Blah blah blah',
                'String2' => 'Derick "Tiger" Rethans',
                'String3' => 'Foo \\ Bar',
                'String4' => 'Foo \\',
            )
        );
        $comments = array(
        );
        $test = new ezcConfiguration( $settings, $comments );

        $backend = new ezcConfigurationArrayWriter( $this->tempDir . '/formats.php', $test );
        $backend->save();

        $backend = new ezcConfigurationArrayReader( $this->tempDir . '/formats.php' );
        $return = $backend->load();
        $this->assertEquals( $test, $return );
    }

    public function test2D()
    {
        $settings = array(
            '2D-numbered' => array(
                'Decimal' => array( 42, 0 ),
                'Mixed' => array( 42, 0.812, false, "Derick \"Tiger\" Rethans" ),
            ),
            '2D-associative' => array(
                'Decimal' => array( 'a' => 42, 'b' => 0 ),
                'Mixed' => array( 'a' => 42, 1 => 0.812, 'b' => false, 2 => "Derick \"Tiger\" Rethans" ),
            ),
        );
        $comments = array(
        );
        $test = new ezcConfiguration( $settings, $comments );

        $backend = new ezcConfigurationArrayWriter( $this->tempDir . '/multi-dim.php', $test );
        $backend->save();

        $backend = new ezcConfigurationArrayReader( $this->tempDir . '/multi-dim.php' );
        $return = $backend->load();
        $this->assertEquals( $test, $return );
    }

    public function test3D()
    {
        $settings = array(
            '3D' => array(
                'Decimal' => array( 42, 0 ),
                'Array' =>  array(
                    'Decimal' => array( 'a' => 42, 'b' => 0 ),
                    'Mixed' => array( 'b' => false, 2 => "Derick \"Tiger\" Rethans" ),
                ),
            ),
        );
        $comments = array(
            '3D' => array(
                'Decimal' => array( " One with a comment", " Second one with a comment" ),
                'Array' => array(
                    'Mixed' => array( 2 => " One with a comment" ),
                ),
            ),
        );
        $test = new ezcConfiguration( $settings, $comments );

        $backend = new ezcConfigurationArrayWriter( $this->tempDir . '/multi-dim2.php', $test );
        $backend->save();

        $backend = new ezcConfigurationArrayReader( $this->tempDir . '/multi-dim2.php' );
        $return = $backend->load();
        $this->assertEquals( $test, $return );
    }

    public function testFilePermissionsDefault()
    {
        $backend = new ezcConfigurationArrayWriter( $this->tempDir . '/empty.php', new ezcConfiguration() );
        $oldUmask = umask( 0 );
        $backend->save();
        umask( $oldUmask );
        $stat = stat( $this->tempDir . '/empty.php' );
        $this->assertEquals( POSIX_S_IFREG | 0666, $stat['mode'] );
    }

    public function testFilePermissions1()
    {
        $backend = new ezcConfigurationArrayWriter( $this->tempDir . '/empty.php', new ezcConfiguration() );
        $oldUmask = umask( 0 );
        $backend->setOptions( array ( 'permissions' => 0660 ) );
        $backend->save();
        umask( $oldUmask );
        $stat = stat( $this->tempDir . '/empty.php' );
        $this->assertEquals( POSIX_S_IFREG | 0660, $stat['mode'] );
    }

    public function testFilePermissions2()
    {
        $backend = new ezcConfigurationArrayWriter( $this->tempDir . '/empty.php', new ezcConfiguration() );
        $oldUmask = umask( 0 );
        $backend->setOptions( array ( 'permissions' => 0640 ) );
        $backend->save();
        umask( $oldUmask );
        $stat = stat( $this->tempDir . '/empty.php' );
        $this->assertEquals( POSIX_S_IFREG | 0640, $stat['mode'] );
    }

    public function testValidationNonStrict()
    {
        $settings = array(
            '3D' => array(
                'Decimal' => array( 42, 0 ),
                'Array' =>  array(
                    'Decimal' => array( 'a' => 42, 'b' => 0 ),
                    'Mixed' => array( 'b' => false, 2 => "Derick \"Tiger\" Rethans" ),
                ),
            ),
        );
        $comments = array(
            '3D' => array(
                'Decimal' => array( " One with a comment", " Second one with a comment" ),
                'Array' => array(
                    'Mixed' => array( 2 => " One with a comment" ),
                ),
            ),
        );
        $test = new ezcConfiguration( $settings, $comments );

        $path = $this->tempDir . '/multi-dim2.php';
        $backend = new ezcConfigurationArrayWriter( $path, $test );
        $backend->save();

        $backend = new ezcConfigurationArrayReader( $path );
        $return = $backend->validate( false );

        $expected = new ezcConfigurationValidationResult( $backend->getLocation(), $backend->getName(), $path );
        $expected->isValid = true;

        $this->assertEquals( $expected, $return );
    }

/*
    public function testWriteFailure()
    {
    }
*/

    public static function suite()
    {
         return new PHPUnit_Framework_TestSuite( 'ezcConfigurationArrayWriterTest' );
    }

}

?>


text:
<?php
namespace TYPO3\Flow\Security\Cryptography;

use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Cache\Frontend\StringFrontend;
use TYPO3\Flow\Object\ObjectManagerInterface;
use TYPO3\Flow\Security\Exception\InvalidArgumentForHashGenerationException;
use TYPO3\Flow\Security\Exception\InvalidHashException;
use TYPO3\Flow\Security\Exception\MissingConfigurationException;
use TYPO3\Flow\Utility;

/**
 * A hash service which should be used to generate and validate hashes.
 *
 * @Flow\Scope("singleton")
 */
class HashService
{
    /**
     * A private, unique key used for encryption tasks
     * @var string
     */
    protected $encryptionKey = null;

    /**
     * @var array
     */
    protected $passwordHashingStrategies = [];

    /**
     * @var array
     */
    protected $strategySettings;

    /**
     * @var ObjectManagerInterface
     * @Flow\Inject
     */
    protected $objectManager;

    /**
     * @var StringFrontend
     * @Flow\Inject
     */
    protected $cache;

    /**
     * Injects the settings of the package this controller belongs to.
     *
     * @param array $settings Settings container of the current package
     * @return void
     */
    public function injectSettings(array $settings)
    {
        $this->strategySettings = $settings['security']['cryptography']['hashingStrategies'];
    }

    /**
     * Generate a hash (HMAC) for a given string
     *
     * @param string $string The string for which a hash should be generated
     * @return string The hash of the string
     * @throws InvalidArgumentForHashGenerationException if something else than a string was given as parameter
     */
    public function generateHmac($string)
    {
        if (!is_string($string)) {
            throw new InvalidArgumentForHashGenerationException('A hash can only be generated for a string, but "' . gettype($string) . '" was given.', 1255069587);
        }

        return hash_hmac('sha1', $string, $this->getEncryptionKey());
    }

    /**
     * Appends a hash (HMAC) to a given string and returns the result
     *
     * @param string $string The string for which a hash should be generated
     * @return string The original string with HMAC of the string appended
     * @see generateHmac()
     * @todo Mark as API once it is more stable
     */
    public function appendHmac($string)
    {
        $hmac = $this->generateHmac($string);
        return $string . $hmac;
    }

    /**
     * Tests if a string $string matches the HMAC given by $hash.
     *
     * @param string $string The string which should be validated
     * @param string $hmac The hash of the string
     * @return boolean TRUE if string and hash fit together, FALSE otherwise.
     */
    public function validateHmac($string, $hmac)
    {
        return ($this->generateHmac($string) === $hmac);
    }

    /**
     * Tests if the last 40 characters of a given string $string
     * matches the HMAC of the rest of the string and, if true,
     * returns the string without the HMAC. In case of a HMAC
     * validation error, an exception is thrown.
     *
     * @param string $string The string with the HMAC appended (in the format 'string<HMAC>')
     * @return string the original string without the HMAC, if validation was successful
     * @see validateHmac()
     * @throws InvalidArgumentForHashGenerationException if the given string is not well-formatted
     * @throws InvalidHashException if the hash did not fit to the data.
     * @todo Mark as API once it is more stable
     */
    public function validateAndStripHmac($string)
    {
        if (!is_string($string)) {
            throw new InvalidArgumentForHashGenerationException('A hash can only be validated for a string, but "' . gettype($string) . '" was given.', 1320829762);
        }
        if (strlen($string) < 40) {
            throw new InvalidArgumentForHashGenerationException('A hashed string must contain at least 40 characters, the given string was only ' . strlen($string) . ' characters long.', 1320830276);
        }
        $stringWithoutHmac = substr($string, 0, -40);
        if ($this->validateHmac($stringWithoutHmac, substr($string, -40)) !== true) {
            throw new InvalidHashException('The given string was not appended with a valid HMAC.', 1320830018);
        }
        return $stringWithoutHmac;
    }
    /**
     * Hash a password using the configured password hashing strategy
     *
     * @param string $password The cleartext password
     * @param string $strategyIdentifier An identifier for a configured strategy, uses default strategy if not specified
     * @return string A hashed password with salt (if used)
     * @api
     */
    public function hashPassword($password, $strategyIdentifier = 'default')
    {
        /** @var $passwordHashingStrategy PasswordHashingStrategyInterface */
        list($passwordHashingStrategy, $strategyIdentifier) = $this->getPasswordHashingStrategyAndIdentifier($strategyIdentifier, false);
        $hashedPasswordAndSalt = $passwordHashingStrategy->hashPassword($password, $this->getEncryptionKey());
        return $strategyIdentifier . '=>' . $hashedPasswordAndSalt;
    }

    /**
     * Validate a hashed password using the configured password hashing strategy
     *
     * @param string $password The cleartext password
     * @param string $hashedPasswordAndSalt The hashed password with salt (if used) and an optional strategy identifier
     * @return boolean TRUE if the given password matches the hashed password
     * @api
     */
    public function validatePassword($password, $hashedPasswordAndSalt)
    {
        $strategyIdentifier = 'default';
        if (strpos($hashedPasswordAndSalt, '=>') !== false) {
            list($strategyIdentifier, $hashedPasswordAndSalt) = explode('=>', $hashedPasswordAndSalt, 2);
        }

        /** @var $passwordHashingStrategy PasswordHashingStrategyInterface */
        list($passwordHashingStrategy, ) = $this->getPasswordHashingStrategyAndIdentifier($strategyIdentifier, true);
        return $passwordHashingStrategy->validatePassword($password, $hashedPasswordAndSalt, $this->getEncryptionKey());
    }

    /**
     * Get a password hashing strategy
     *
     * @param string $strategyIdentifier
     * @param boolean $validating TRUE if the password is validated, FALSE if the password is hashed
     * @return array<PasswordHashingStrategyInterface> and string
     * @throws MissingConfigurationException
     */
    protected function getPasswordHashingStrategyAndIdentifier($strategyIdentifier = 'default', $validating)
    {
        if (isset($this->passwordHashingStrategies[$strategyIdentifier])) {
            return [$this->passwordHashingStrategies[$strategyIdentifier], $strategyIdentifier];
        }

        if ($strategyIdentifier === 'default') {
            if ($validating && isset($this->strategySettings['fallback'])) {
                $strategyIdentifier = $this->strategySettings['fallback'];
            } else {
                if (!isset($this->strategySettings['default'])) {
                    throw new MissingConfigurationException('No default hashing strategy configured', 1320758427);
                }
                $strategyIdentifier = $this->strategySettings['default'];
            }
        }

        if (!isset($this->strategySettings[$strategyIdentifier])) {
            throw new MissingConfigurationException('No hashing strategy with identifier "' . $strategyIdentifier . '" configured', 1320758776);
        }
        $strategyObjectName = $this->strategySettings[$strategyIdentifier];
        $this->passwordHashingStrategies[$strategyIdentifier] = $this->objectManager->get($strategyObjectName);
        return [$this->passwordHashingStrategies[$strategyIdentifier], $strategyIdentifier];
    }

    /**
     * Returns the encryption key from the persistent cache or Data/Persistent directory. If none exists, a new
     * encryption key will be generated and stored in the cache.
     *
     * @return string The configured encryption key stored in Data/Persistent/EncryptionKey
     */
    protected function getEncryptionKey()
    {
        if ($this->encryptionKey === null) {
            $this->encryptionKey = $this->cache->get('encryptionKey');
        }
        if ($this->encryptionKey === false && file_exists(FLOW_PATH_DATA . 'Persistent/EncryptionKey')) {
            $this->encryptionKey = file_get_contents(FLOW_PATH_DATA . 'Persistent/EncryptionKey');
        }
        if ($this->encryptionKey === false) {
            $this->encryptionKey = bin2hex(Utility\Algorithms::generateRandomBytes(48));
            $this->cache->set('encryptionKey', $this->encryptionKey);
        }
        return $this->encryptionKey;
    }
}


text:
// Copyright (c) 2014 Arista Networks, Inc.  All rights reserved.
// Arista Networks, Inc. Confidential and Proprietary.

#include "eos/acl.h"
#include "eos/agent.h"
#include "eos/bfd.h"
#include "eos/bgp_path.h"
#include "eos/class_map.h"
#include "eos/decap_group.h"
#include "eos/directflow.h"
#include "eos/eth_intf.h"
#include "eos/eth_lag_intf.h"
#include "eos/eth_phy_intf.h"
#include "eos/fib.h"
#include "eos/fpga.h"
#include "eos/hardware_table.h"
#include "eos/intf.h"
#include "eos/ip_route.h"
#include "eos/iterator.h"
#include "eos/l1_source.h"
#include "eos/macsec.h"
#include "eos/mac_table.h"
#include "eos/mpls_route.h"
#include "eos/mpls_vrf_label.h"
#include "eos/neighbor_table.h"
#include "eos/nexthop_group.h"
#include "eos/nexthop_group_tunnel.h"
#include "eos/policy_map.h"
#include "eos/subintf.h"
#include "eos/vrf.h"
#include "eos/lldp.h"

namespace eos {

template <typename T, typename Impl>
inline iter_base<T, Impl>::iter_base(Impl * const impl)
   : impl(impl) {
}

template <typename T, typename Impl>
inline iter_base<T, Impl>::iter_base(iter_base<T, Impl> const & other)
   : impl(0) {
}

template <typename T, typename Impl>
inline iter_base<T, Impl>::~iter_base() {
}

template <typename T, typename Impl>
inline iter_base<T, Impl>&
iter_base<T, Impl>::operator=(const iter_base<T, Impl> & other) {
   if (this != &other) {
      delete impl;
      impl = new Impl(*other.impl);
   }
   return *this;
}

template <typename T, typename Impl>
inline iter_base<T, Impl>&
iter_base<T, Impl>::operator++() {
   return *this;
}

template <typename T, typename Impl>
inline bool
iter_base<T, Impl>::operator==(const iter_base<T, Impl> & rhs) const {
   return impl == rhs.impl;
}

template <typename T, typename Impl>
inline T
iter_base<T, Impl>::operator*() const {
   return T();
}

template <typename T, typename Impl>
inline T const *
iter_base<T, Impl>::operator->() const {
   return 0;
}

template <typename T, typename Impl>
inline T *
iter_base<T, Impl>::operator->() {
   return 0;
}

template <typename T, typename Impl>
inline iter_base<T, Impl>::operator bool() const {
   return false;
}

/**
 * Helper macro to define iterator classes that wrap our internal iterators.
 * @param SdkIter Tke name of the SDK iterator (e.g. foo_iter_t).
 * @param IterClassImpl The name of the SDK wrapper class (e.g. foo_iter_impl).
 * TODO: Right now in the stubs the impl class is empty because iter_base does
 * not delegate anything to it yet.  We need to make iter_base delegate calls
 * to the impl class, and provide a stub implementation.
 * NOTE: The impl class needs to be marked with EOS_SDK_PUBLIC because as of
 * GCC 4.6, if a template parameter has hidden visibility, it contaminates the
 * template class, even if that class was marked as having default visibility.
 */
#define INSTANTIATE_ITERATOR(SdkIter, IterClassImpl)    \
  struct EOS_SDK_PUBLIC IterClassImpl {                 \
     virtual ~IterClassImpl() EOS_SDK_PRIVATE;          \
  };                                                    \
  IterClassImpl::~IterClassImpl() {}                    \
  template class iter_base<SdkIter, IterClassImpl>

INSTANTIATE_ITERATOR(acl_key_t, acl_iter_impl);
INSTANTIATE_ITERATOR(acl_rule_eth_entry_t, acl_rule_eth_iter_impl);
INSTANTIATE_ITERATOR(acl_rule_ip_entry_t, acl_rule_ip_iter_impl);
INSTANTIATE_ITERATOR(std::string, agent_option_iter_impl);
INSTANTIATE_ITERATOR(std::string, agent_status_iter_impl);
INSTANTIATE_ITERATOR(bfd_session_key_t, bfd_session_iter_impl);
INSTANTIATE_ITERATOR(bgp_path_t, bgp_path_iter_impl);
INSTANTIATE_ITERATOR(class_map_key_t, class_map_iter_impl);
INSTANTIATE_ITERATOR(decap_group_t, decap_group_iter_impl);
INSTANTIATE_ITERATOR(fib_fec_t, fib_fec_iter_impl);
INSTANTIATE_ITERATOR(fib_route_t, fib_route_iter_impl);
INSTANTIATE_ITERATOR(flow_entry_t, flow_entry_iter_impl);
INSTANTIATE_ITERATOR(fpga_t, fpga_iter_impl);
INSTANTIATE_ITERATOR(fpga_reservation_t, fpga_reservation_iter_impl);
INSTANTIATE_ITERATOR(fpga_reservation_status_t, fpga_reservation_status_iter_impl);
INSTANTIATE_ITERATOR(hardware_table_key_t, hardware_table_iter_impl);
INSTANTIATE_ITERATOR(intf_id_t, intf_iter_impl);
INSTANTIATE_ITERATOR(intf_id_t, eth_intf_iter_impl);
INSTANTIATE_ITERATOR(intf_id_t, eth_lag_intf_iter_impl);
INSTANTIATE_ITERATOR(intf_id_t, eth_lag_intf_member_iter_impl);
INSTANTIATE_ITERATOR(intf_id_t, eth_phy_intf_iter_impl);
INSTANTIATE_ITERATOR(ip_route_t, ip_route_iter_impl);
INSTANTIATE_ITERATOR(ip_route_via_t, ip_route_via_iter_impl);
INSTANTIATE_ITERATOR(intf_id_t, l1_source_iter_impl);
INSTANTIATE_ITERATOR(mac_key_t, mac_table_iter_impl);
INSTANTIATE_ITERATOR(mac_key_t, mac_table_status_iter_impl);
INSTANTIATE_ITERATOR(mpls_route_t, mpls_route_iter_impl);
INSTANTIATE_ITERATOR(mpls_route_key_t, mpls_route_status_iter_impl);
INSTANTIATE_ITERATOR(mpls_route_via_t, mpls_route_via_iter_impl);
INSTANTIATE_ITERATOR(mpls_route_via_t, mpls_route_via_status_iter_impl);
INSTANTIATE_ITERATOR(mpls_vrf_label_t, mpls_vrf_label_iter_impl);
INSTANTIATE_ITERATOR(neighbor_key_t, neighbor_table_iter_impl);
INSTANTIATE_ITERATOR(neighbor_key_t, neighbor_table_status_iter_impl);
INSTANTIATE_ITERATOR(nexthop_group_t, nexthop_group_iter_impl);
INSTANTIATE_ITERATOR(policy_map_key_t, policy_map_iter_impl);
INSTANTIATE_ITERATOR(intf_id_t, subintf_iter_impl);
INSTANTIATE_ITERATOR(std::string, vrf_iter_impl);
INSTANTIATE_ITERATOR(lldp_remote_system_t, lldp_remote_system_iter_impl);
INSTANTIATE_ITERATOR(intf_id_t, lldp_intf_iter_impl);
INSTANTIATE_ITERATOR(lldp_neighbor_t, lldp_neighbor_iter_impl);
INSTANTIATE_ITERATOR(nexthop_group_tunnel_t, nexthop_group_tunnel_iter_impl);
INSTANTIATE_ITERATOR(std::string, programmed_nexthop_group_iter_impl);
INSTANTIATE_ITERATOR(macsec_profile_name_t, macsec_profile_iter_impl);
INSTANTIATE_ITERATOR(intf_id_t, macsec_intf_status_iter_impl);
INSTANTIATE_ITERATOR(sbfd_echo_session_key_t, sbfd_echo_session_iter_impl);
INSTANTIATE_ITERATOR(policy_map_key_t, policy_map_hw_status_iter_impl);
}


text:
assoc-android
=============

Remember things. Never forget.


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>com.mps.deepviolet.suite.json Class Hierarchy (com.github.spoofzu:DeepViolet 1.0.10-SNAPSHOT API)</title>
<meta name="date" content="2017-05-17">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Hierarchy For Package com.mps.deepviolet.suite.json

Package Hierarchies:

All Packages

Class Hierarchy

java.lang.Object

java.util.AbstractMap<K,V> (implements java.util.Map<K,V>)

java.util.HashMap<K,V> (implements java.lang.Cloneable, java.util.Map<K,V>, java.io.Serializable)

com.mps.deepviolet.suite.json.CipherMap

com.mps.deepviolet.suite.json.CipherSuite

com.mps.deepviolet.suite.json.Classifications

com.mps.deepviolet.suite.json.Configuration

com.mps.deepviolet.suite.json.MozillaCerts

Enum Hierarchy

java.lang.Object

java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)

com.mps.deepviolet.suite.json.TLSVersion

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2017. All rights reserved.


text:
#include <QtCore/qatomic.h>

#include <limits.h>
#include <sched.h>

extern "C" {

int q_atomic_trylock_int(volatile int *addr);
int q_atomic_trylock_ptr(volatile void *addr);

Q_CORE_EXPORT int q_atomic_lock_int(volatile int *addr)
{
    int returnValue = q_atomic_trylock_int(addr);

    if (returnValue == INT_MIN) {
        do {
            // spin until we think we can succeed
            do {
                sched_yield();
                returnValue = *addr;
            } while (returnValue == INT_MIN);

            // try again
            returnValue = q_atomic_trylock_int(addr);
        } while (returnValue == INT_MIN);
    }

    return returnValue;
}

Q_CORE_EXPORT int q_atomic_lock_ptr(volatile void *addr)
{
    int returnValue = q_atomic_trylock_ptr(addr);

    if (returnValue == -1) {
        do {
            // spin until we think we can succeed
            do {
                sched_yield();
                returnValue = *reinterpret_cast<volatile int *>(addr);
            } while (returnValue == -1);

            // try again
            returnValue = q_atomic_trylock_ptr(addr);
        } while (returnValue == -1);
    }

    return returnValue;
}

} // extern "C"


text:
package com.linkedin.pinot.core.operator.filter.predicate;

import com.linkedin.pinot.core.common.predicate.NEqPredicate;
import com.linkedin.pinot.core.segment.index.readers.Dictionary;

public class NotEqualsPredicateEvaluator implements PredicateEvaluator {

  private int neqDictValue;
  private int[] matchingDictIds;
  private Dictionary dictionary;
  private int[] nonMatchingDictIds;

  public NotEqualsPredicateEvaluator(NEqPredicate predicate, Dictionary dictionary) {
    this.dictionary = dictionary;
    neqDictValue = dictionary.indexOf(predicate.getNotEqualsValue());
    if (neqDictValue > -1) {
      nonMatchingDictIds = new int[] { neqDictValue };
    } else {
      nonMatchingDictIds = new int[0];
    }
  }

  @Override
  public boolean apply(int dictionaryId) {
    return neqDictValue != dictionaryId;
  }

  @Override
  public boolean apply(int[] dictionaryIds) {
    if (neqDictValue < 0) {
      return true;
    }
    //we cannot do binary search since the multivalue columns are not sorted in the raw segment
    for (int dictId : dictionaryIds) {
      if (dictId == neqDictValue) {
        return false;
      }
    }

    return true;
  }

  @Override
  public int[] getMatchingDictionaryIds() {
    //This is expensive for NOT EQ predicate, some operators need this for now. Eventually we should remove the need for exposing matching dict ids
    if (matchingDictIds == null) {
      int size;
      if (neqDictValue >= 0) {
        size = dictionary.length() - 1;
      } else {
        size = dictionary.length();
      }
      matchingDictIds = new int[size];
      int count = 0;
      for (int i = 0; i < dictionary.length(); i++) {
        if (i != neqDictValue) {
          matchingDictIds[count] = i;
          count = count + 1;
        }
      }
    }
    return matchingDictIds;

  }

  @Override
  public int[] getNonMatchingDictionaryIds() {
    return nonMatchingDictIds;
  }

  @Override
  public boolean apply(int[] dictionaryIds, int length) {
    if (neqDictValue < 0) {
      return true;
    }
    for (int i = 0; i < length; i++) {
      int dictId = dictionaryIds[i];
      if (dictId == neqDictValue) {
        return false;
      }
    }
    return true;
  }

  @Override
  public boolean alwaysFalse() {
    return nonMatchingDictIds.length == dictionary.length();
  }
}


text:
using System;
using NUnit.Framework;

namespace Optionally.Tests.ResultTests
{
    [TestFixture]
    class WhenConstructingSuccess
    {
        [Test]
        public void AndTheValueIsNullThenSuccessIsReturned()
        {
            Assert.Throws<ArgumentNullException>(() => Result.Success<int, string>(null));
        }

        [Test]
        public void AndTheValueIsNotNullThenSuccessIsReturned()
        {
            var observed = Result.Success<int, string>("Success");

            var expected = Result.Success<int, string>("Success");
            Assert.AreEqual(expected, observed);
        }
    }
}


text:
<?php

namespace Reusables;

$is_smart = Data::getValue( $viewoptions, "is_smart" );

if( $is_smart == "" ) {
	$is_smart = true;
} else if( $is_smart == "0" ) {
	$is_smart = false;
}

if( !isset($viewdict['field_conditions'] ) ){
	$viewdict['field_conditions'] = [];
}else if( $viewdict['field_conditions'] == "" ){
	$viewdict['field_conditions'] = [];
}else if( sizeof($viewdict['field_conditions']) == 1 ) {
	if( sizeof($viewdict['field_conditions'][0]) == 0 ) {
		$viewdict['field_conditions'] = [];
	}
}

$size = Data::getValue( $viewdict, "size" );

if( $size == "" ) {
	$size = "large";
}
$sizeclass = "size_" . $size;

$help_modal = Data::getValue( $viewoptions, "help_modal" );
if( $help_modal != "" ) {
	$help_modal = $help_modal["modalclass"];
}

$labeltext = Data::getValue( $viewdict, "labeltext" );
if( $labeltext == "" ) {
	$labeltext = Data::getValue( $viewoptions, "labeltext" );
}

$is_multiple = Data::getValue( $viewdict, "multiple" );
if( $is_multiple == "" ) {
	$is_multiple = Data::getValue( $viewoptions, "multiple" );
}
if( in_array($is_multiple, ["1", 1, "true", true, "yes"]) ) {
	$is_multiple = true;
}
// exit(json_encode($identifier));

// $field_name = "fieldarray[" . Data::getValue( $viewdict, 'field_index') . "][field_value]";
$field_name = "fieldimage[" . Data::getValue( $viewdict, 'field_index') . "][field_value]";
if( !$is_smart ) {
	if( Data::getValue( $viewdict, 'field_name' ) != "" || Data::getValue( $viewoptions, 'field_name' ) ) {
		$field_name = Data::getValue( $viewdict, 'field_name' );
		if( $field_name == "" ) {
			$field_name = Data::getValue( $viewoptions, 'field_name' );
			if( $field_name == "" ) {
				$field_name = $identifier;
			}
		}
	}
}
$field_name_multiple = "fieldimage_multiple[" . Data::getValue( $viewdict, 'field_index') . "][field_value]";

$js_var = str_replace(".", "_", $identifier);

?>

<div class="viewtype_input <?php echo $identifier ?> file_image <?php echo $sizeclass ?>">
	<?php
		Data::add( ["title" => $labeltext], $identifier . "_label" );
		Options::add( $help_modal, "help_modal", $identifier . "_label" );
		echo Header::make( "basic_label", $identifier . "_label" );
	?>
	<div id="<?php echo $identifier ?>_file_image_image_container">
		<?php if($is_multiple) { ?>
			<label class="<?php echo $identifier ?>_add_button file_image_add_image_button file_image_look" for='<?php echo $identifier ?>_input_to_add' id='<?php echo $identifier ?>_imglabel'>+
		<?php } ?>
		<label class="file_image file_image_look" id='imglabel' for='<?php echo $identifier ?>_field_value' style="background-image: url('<?php echo Data::getValue( $viewdict,'background-image') ?>');">

	<div id="<?php echo $identifier ?>_file_image_image_inputs_container" class="file_image_image_inputs_container">
		<input type="file" class="field_value <?php echo $js_var ?>_file_image_input" id="<?php echo $identifier ?>_field_value" value="<?php echo Data::getValue( $viewdict,'field_value') ?>" name="<?php echo $field_name ?>" style="visibility: hidden; z-index: -1;">

		<input type="file" class="field_value <?php echo $js_var ?>_file_image_input" id="<?php echo $identifier ?>_input_to_add" name="<?php echo $field_name_multiple ?>[0]" style="visibility: hidden; z-index: -1;">

	<input type="hidden" class="field_type" name="fieldimage[<?php echo Data::getValue( $viewdict,'field_index') ?>][field_type]" value="image_<?php echo Data::getValue( $viewdict,'field_index') ?>" style="visibility: hidden; z-index: -1;">
	<input type="hidden" class="tablename" value="<?php echo Data::getValue( $viewdict,'field_table') ?>" name="fieldimage[<?php echo Data::getValue( $viewdict,'field_index') ?>][tablename]">
	<input type="hidden" class="col_name" value="<?php echo Data::getValue( $viewdict,'field_colname') ?>" name="fieldimage[<?php echo Data::getValue( $viewdict,'field_index') ?>][col_name]">
	<?php $i=0; ?>
	<?php foreach ($viewdict['field_conditions'] as $c) { ?>
		<input type="hidden" class="conditionkey_<?php echo $i ?>" value="<?php echo $c['key'] ?>" name="fieldimage[<?php echo Data::getValue( $viewdict,'field_index') ?>][field_conditions][<?php echo $i ?>][key]">
		<input type="hidden" class="conditionvalue_<?php echo $i ?>" value="<?php echo $c['value'] ?>" name="fieldimage[<?php echo Data::getValue( $viewdict,'field_index') ?>][field_conditions][<?php echo $i ?>][value]">
		<?php $i++; ?>
	<?php } ?>