text:
package org.mifos.application.importexport.struts.action;

import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.commons.io.IOUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.upload.FormFile;
import org.mifos.application.importexport.struts.actionforms.ImportTransactionsActionForm;
import org.mifos.application.servicefacade.ListItem;
import org.mifos.dto.domain.ParseResultDto;
import org.mifos.framework.business.AbstractBusinessObject;
import org.mifos.framework.business.service.BusinessService;
import org.mifos.framework.exceptions.ServiceException;
import org.mifos.framework.struts.action.BaseAction;
import org.mifos.framework.util.helpers.Money;
import org.mifos.security.util.UserContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * This class takes the {@link ImportTransactionsActionForm} and retrieves file
 * with details transactions received from a third party (mostly a bank) and
 * import the details to collection sheet entry module
 */

public class ImportTransactionsAction extends BaseAction {
    private static final Logger logger = LoggerFactory.getLogger(ImportTransactionsAction.class);

    private static final String IMPORT_TEMPORARY_FILENAME = "importTemporaryFilename";
    private static final String IMPORT_PLUGIN_CLASSNAME = "importPluginClassname";

    public static final String SESSION_ATTRIBUTE_LOG = "importTransactionLog";
    public static final String SESSION_ATTRIBUTE_LOG_FILENAME = "importTransactionLogFilename";

    public ActionForward load(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
        final ImportTransactionsActionForm importTransactionsForm = (ImportTransactionsActionForm) form;
        importTransactionsForm.clear();
        clearOurSessionVariables(request.getSession());

        final List<ListItem<String>> importPlugins = this.importTransactionsServiceFacade.retrieveImportPlugins();

        request.setAttribute("importPlugins", importPlugins);
        return mapping.findForward("import_load");
    }

    public ActionForward upload(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
        final ImportTransactionsActionForm importTransactionsForm = (ImportTransactionsActionForm) form;

        final FormFile importTransactionsFile = importTransactionsForm.getImportTransactionsFile();
        final String importPluginClassname = importTransactionsForm.getImportPluginName();
        request.getSession().setAttribute(IMPORT_PLUGIN_CLASSNAME, importPluginClassname);

        final InputStream stream = importTransactionsFile.getInputStream();
        final String tempFilename = saveImportAsTemporaryFile(importTransactionsFile.getInputStream());
        request.getSession().setAttribute(IMPORT_TEMPORARY_FILENAME, tempFilename);

        final ParseResultDto importResult = this.importTransactionsServiceFacade.parseImportTransactions(importPluginClassname, importTransactionsFile.getInputStream());

        final List<String> errorsForDisplay = new ArrayList<String>();
        if (!importResult.getParseErrors().isEmpty()) {
            errorsForDisplay.addAll(importResult.getParseErrors());
        }

        int numberRowSuccessfullyParsed = importResult.getNumberRowSuccessfullyParsed();
        if(numberRowSuccessfullyParsed == -1) {
            numberRowSuccessfullyParsed = importResult.getSuccessfullyParsedPayments().size();
        }

        boolean submitButtonDisabled = false;
        if (numberRowSuccessfullyParsed == 0) {
            submitButtonDisabled = true;
        }

        if (importResult.isAmountInformationFilled() && importResult.isExtraRowInformationFilled()) {
            request.setAttribute("isExtraInformationFilled", true);
            request.setAttribute("numberOfErrorRows", importResult.getNumberOfErrorRows());
            request.setAttribute("numberOfIgnoredRows", importResult.getNumberOfIgnoredRows());
            request.setAttribute("numberOfReadRows", importResult.getNumberOfReadRows());
            request.setAttribute("totalAmountOfTransactionsImported", new Money(Money.getDefaultCurrency(),
                importResult.getTotalAmountOfTransactionsImported()).toString());
            request.setAttribute("totalAmountOfTransactionsWithError", new Money(Money.getDefaultCurrency(),
                importResult.getTotalAmountOfTransactionsWithError()).toString());
                        request.setAttribute("totalAmountOfDisbursementsTransactionsImported", new Money(Money.getDefaultCurrency(), importResult.getTotalAmountOfDisbursementsImported().toString()));
            request.getSession().setAttribute(SESSION_ATTRIBUTE_LOG, importResult.getStatusLogFile().getBytes());
            request.getSession().setAttribute(SESSION_ATTRIBUTE_LOG_FILENAME, statusLogfileName(importTransactionsFile.getFileName()));
        } else {
            request.setAttribute("isExtraInformationFilled", false);
        }

        request.setAttribute("importTransactionsErrors", errorsForDisplay);
        request.setAttribute("numSuccessfulRows", numberRowSuccessfullyParsed);
        request.setAttribute("submitButtonDisabled", submitButtonDisabled);
        request.setAttribute("numberOfOverpayments", importResult.getNumberOfOverpayments());

        stream.close();

        importTransactionsFile.destroy();

        return mapping.findForward("import_results");
    }

    /**
     * This will fail if we ever cluster Mifos dynamic Web requests.
     */
    private String saveImportAsTemporaryFile(InputStream input) throws IOException {
        File tempFile = File.createTempFile(this.getClass().getSimpleName(), null);
        FileOutputStream out = new FileOutputStream(tempFile);
        BufferedInputStream in = new BufferedInputStream(input);
        byte[] buf = new byte[1024];
        int len;
        while ((len = in.read(buf)) > 0) {
            out.write(buf, 0, len);
        }
        in.close();
        out.close();
        return tempFile.getCanonicalPath();
    }

    public ActionForward confirm(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
        final String tempFilename = (String) request.getSession().getAttribute(IMPORT_TEMPORARY_FILENAME);
        final String importPluginClassname = (String) request.getSession().getAttribute(IMPORT_PLUGIN_CLASSNAME);

        final ImportTransactionsActionForm importTransactionsForm = (ImportTransactionsActionForm) form;
        final String importTransactionsFileName = importTransactionsForm.getImportTransactionsFile().getFileName();

        final ParseResultDto importResult = this.importTransactionsServiceFacade.confirmImport(importPluginClassname, tempFilename);

        if (null != importResult.getParseErrors() && !importResult.getParseErrors().isEmpty()) {
            for (String error : importResult.getParseErrors()) {
                logger.warn(importTransactionsFileName + ": " + error);
            }
        }

        this.importTransactionsServiceFacade.saveImportedFileName(importTransactionsFileName, importPluginClassname, importResult.getTrxIdsToUndo());

        logger.info(importResult.getNumberRowSuccessfullyParsed() + " transaction(s) imported from "+ importTransactionsFileName + ".");

        return mapping.findForward("import_confirm");
    }

    public ActionForward downloadLog(@SuppressWarnings("unused") ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
        byte[] fileContents = (byte[]) request.getSession().getAttribute(ImportTransactionsAction.SESSION_ATTRIBUTE_LOG);
        String fileName = (String) request.getSession().getAttribute(ImportTransactionsAction.SESSION_ATTRIBUTE_LOG_FILENAME);
        response.setHeader("Content-disposition",
                "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8"));
        response.setContentType("text/plain");
        IOUtils.copy(new ByteArrayInputStream(fileContents), response.getOutputStream());
        return null;
    }

    private String statusLogfileName(String uploadedFilename) {
        if (uploadedFilename.contains(".")) {
            return uploadedFilename.split("\\.")[0] + "-log.txt";
        }
        return uploadedFilename + "-log.txt";
    }

    /**
     * Used to remove our (this action's) temporaries after use to keep them
     * from accumulating in the session. This probably breaks the "back" button.
     * Using hidden form fields to persist temporaries might be more
     * user-friendly.
     */
    private void clearOurSessionVariables(HttpSession session) {
        session.removeAttribute(IMPORT_TEMPORARY_FILENAME);
        session.removeAttribute(IMPORT_PLUGIN_CLASSNAME);
        session.removeAttribute(SESSION_ATTRIBUTE_LOG);
        session.removeAttribute(SESSION_ATTRIBUTE_LOG_FILENAME);
    }

    @Override
    protected BusinessService getService() throws ServiceException {
        return new DummyImportTransactionService();
    }

    class DummyImportTransactionService implements BusinessService {
        @Override
        public AbstractBusinessObject getBusinessObject(@SuppressWarnings("unused") final UserContext userContext) {
            return null;
        }
    }
}


text:
package org.artifactory.webapp.wicket.page.build.tabs;

import com.google.common.collect.Sets;
import org.apache.wicket.MarkupContainer;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.IAjaxCallDecorator;
import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.repeater.RepeatingView;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.spring.injection.annot.SpringBean;
import org.artifactory.addon.AddonType;
import org.artifactory.api.build.BuildService;
import org.artifactory.common.wicket.WicketProperty;
import org.artifactory.common.wicket.ajax.NoAjaxIndicatorDecorator;
import org.artifactory.common.wicket.behavior.CssClass;
import org.artifactory.common.wicket.behavior.NopFormComponentUpdatingBehavior;
import org.artifactory.common.wicket.component.checkbox.styled.StyledCheckbox;
import org.artifactory.common.wicket.component.help.HelpBubble;
import org.artifactory.common.wicket.model.SelectedItemModel;
import org.artifactory.webapp.wicket.page.search.SaveSearchResultsPanel;
import org.jfrog.build.api.Build;

import java.util.Set;

/**
 * Implementation of the results management panel for build info
 *
 * @author Noam Y. Tenne
 */
public class BuildSearchResultsPanel extends SaveSearchResultsPanel {

    @SpringBean
    protected BuildService buildService;

    @WicketProperty
    protected boolean artifacts = true;

    @WicketProperty
    protected boolean dependencies = true;

    protected Build build;

    protected Set<String> scopes;
    protected Set<String> selectedScopes;

    public BuildSearchResultsPanel(AddonType requestingAddon, Build build) {
        super("saveSearchResultsPanel", new Model(), requestingAddon);
        this.build = build;

        scopes = buildService.findScopes(build);
        selectedScopes = Sets.newHashSet(scopes);

        add(new CssClass("build-save-results"));
    }

    @Override
    public String getTitle() {
        return "Save to Search Results";
    }

    @Override
    protected void addAdditionalFields(Form form) {
        final MarkupContainer scopesContainer = createScopesContainer();
        form.add(scopesContainer);

        final StyledCheckbox artifactsCheckbox = addCheckBox(form, "artifacts",
                "If marked, published module artifacts are saved as search results.", true);
        artifactsCheckbox.add(new NopFormComponentUpdatingBehavior("onclick"));

        final StyledCheckbox dependenciesCheckbox = addCheckBox(form, "dependencies",
                "If marked, published module dependencies are saved as search results.\nYou can optionally select the dependency scopes to include.",
                false);
        if (scopes.isEmpty()) {
            dependenciesCheckbox.add(new NopFormComponentUpdatingBehavior("onclick"));
        } else {
            dependenciesCheckbox.setLabel(Model.of("Include Dependencies of the following scopes:"));
            dependenciesCheckbox.add(new AjaxFormComponentUpdatingBehavior("onclick") {
                @Override
                protected void onUpdate(AjaxRequestTarget target) {
                    target.add(scopesContainer);
                }

                @Override
                protected IAjaxCallDecorator getAjaxCallDecorator() {
                    return new NoAjaxIndicatorDecorator();
                }
            });
        }
    }

    private MarkupContainer createScopesContainer() {
        WebMarkupContainer scopesContainer = new WebMarkupContainer("scopesContainer");
        scopesContainer.setOutputMarkupId(true);
        if (scopes.isEmpty()) {
            scopesContainer.setVisible(false);
            return scopesContainer;
        }

        RepeatingView scopesView = new RepeatingView("scopeCheckbox");
        scopesContainer.add(scopesView);

        for (String scope : scopes) {
            StyledCheckbox checkbox =
                    new StyledCheckbox(scopesView.newChildId(), new SelectedItemModel<>(selectedScopes, scope)) {
                        @Override
                        public boolean isEnabled() {
                            return dependencies && super.isEnabled();
                        }
                    };
            checkbox.setLabel(Model.of(scope));
            scopesView.add(checkbox);
        }
        return scopesContainer;
    }

    /**
     * Adds a checkbox to the given form
     *
     * @param form           Form to add the checkbox to
     * @param id             ID to assign to the checkbox
     * @param helpMessage    Help message to display for the checkbox
     * @param checkByDefault Should the checkbox be checked by default
     */
    private StyledCheckbox addCheckBox(Form form, String id, String helpMessage, boolean checkByDefault) {
        StyledCheckbox checkbox = new StyledCheckbox(id, new PropertyModel<Boolean>(this, id));
        checkbox.setDefaultModelObject(checkByDefault);
        checkbox.setOutputMarkupId(true);
        form.add(checkbox);
        form.add(new HelpBubble(id + ".help", helpMessage));
        return checkbox;
    }
}

redpajama_set_name: RedPajamaGithub


text:
<ng-container *ngIf="password != null; else notSet">
  <input
    [type]="visible ? 'text' : 'password'"
    [value]="password"
    [size]="password.length"
    readonly
  />

  <button mat-icon-button (click)="toggleVisibility()">
    <mat-icon
      [ngClass]="{
        'mdi-eye': !visible,
        'mdi-eye-off': visible
      }"
    ></mat-icon>
  </button>
</ng-container>

<ng-template #notSet>{{ 'VM_POST_ACTION.NOT_SET' | translate }}</ng-template>


text:
module AVCodecs
  include(joinpath(Pkg.dir("VideoIO"),"src","init.jl"))
  w(f) = joinpath(avcodec_dir, f)

  using AVUtil

  include(w("LIBAVCODEC.jl"))

  AVPacket() = AVPacket([T<:Ptr ? C_NULL : zero(T) for T in AVPacket.types]...)

end


text:
<readable><title>3614542901_29877fc342</title><content>
A group of women are standing in front of a building .
A woman in a white gown stands with other girls dressed up , one points across the street .
Five women in dresses , one holding a child , stand outside .
Four women and a bride stand on a street while one of them points at something in the distance .
Old lady with black dress and hat points out something to bride .
</content></readable>


text:
package java.nio.channels;

import java.io.IOException;
import java.net.ServerSocket;
import java.nio.channels.spi.AbstractSelectableChannel;
import java.nio.channels.spi.SelectorProvider;

/**
 * A ServerSocketChannel is a partly abstracted stream-oriented listening socket
 * which is selectable. Binding and manipulation of socket options can only be done
 * through the associated ServerSocket object, returned by calling
 * socket method. ServerSocketChannels can not be constructed for a pre-existing
 * server socket, nor can it be assigned a SocketImpl.
 *

 * A Server-Socket channel is open but not bound when created by
 * open method. (Calling accept before bound will cause a
 * NotYetBoundException). It can be bound by calling the bind method
 * of a related ServerSocket instance.

 */
public abstract class ServerSocketChannel extends AbstractSelectableChannel {

	/**
	 * Construct a new instance for ServerSocketChannel
	 * @param selectorProvider
	 *            An instance of SelectorProvider
	 */

	protected ServerSocketChannel(SelectorProvider selectorProvider) {
		super(selectorProvider);
	}

	/**
	 * Create an open and unbound server-socket channel.
	 *

	 * This channel is got by calling openServerSocketChannel
	 * method of the default SelectorProvider  instance.
	 *

	 *
	 * @return The new created channel which is open but unbound.
	 * @throws IOException
	 *             If some IO problem occurs.
	 */
	public static ServerSocketChannel open() throws IOException {
		return SelectorProvider.provider().openServerSocketChannel();
	}

	/**
	 * Get the valid operations of this channel. Server-socket channels support
	 * accepting operation.Currently the only supported operation is OP_ACCEPT.
	 * It always returns SelectionKey.OP_ACCEPT.
	 *
	 * @see java.nio.channels.SelectableChannel#validOps()
	 * @return Valid operations in bit-set.
	 */
	public final int validOps() {
		return SelectionKey.OP_ACCEPT;
	}

	/**
	 * Return the related server-socket of this channel.
	 * All public methods declared in returned object should be declared in ServerSocket.
	 *
	 * @return The related ServerSocket instance.
	 */
	public abstract ServerSocket socket();

	/**
	 * Accepts a connection to this socket.
	 *

	 * It returns null when the channel is non-blocking and no connections available, otherwise it
	 * blocks indefinitely until a new connection is available or an I/O error occurs.
	 * The returned channel will be in blocking mode any way.
	 *

	 *
	 *

	 * This method just execute the same security checks as the accept method of
	 * the ServerSocket class.
	 *

	 *
	 * @return The accepted SocketChannel instance, or null as the channel is
	 *         non-blocking and no connections available.
	 * @throws ClosedChannelException
	 *             If the channel is already closed.
	 * @throws AsynchronousCloseException
	 *             If the channel is closed by another thread while this method
	 *             is in operation.
	 * @throws ClosedByInterruptException
	 *             If another thread interrupts the calling thread while the
	 *             operation is in progress. The calling thread will have the
	 *             interrupt state set, and the channel will be closed.
	 * @throws NotYetBoundException
	 *             If the socket has not yet been bound.
	 * @throws SecurityException
	 *             If there is a security manager, and the new connection is not
	 *             permitted to access.
	 * @throws IOException
	 *             Some other IO error occurred.
	 *
	 */
	public abstract SocketChannel accept() throws IOException;

}


text:
@interface NSArray (OVInitialize)
+ (instancetype)arrayWithRangeFrom:(NSInteger)from to:(NSInteger)to;
+ (instancetype)arrayWithRangeFrom:(NSInteger)from to:(NSInteger)to step:(NSUInteger)step;
@end


text:
<?php
/**
 * Created by PhpStorm.
 * User: Asus
 * Date: 11/10/2016
 * Time: 1:04 AM
 */

class Posts extends CI_Controller{
    public function __construct(){
        parent::__construct();
        $this->load->library('pagination');
        $this->load->library('session');
    }

    public function index($offset = 0){

        /* $config['base_url'] = base_url().'posts/index';
        $config['total_rows'] = $this->db->count_all('posts');
        $config['per_page'] = 3;
        $config['uri_segment'] = 3;
        $this->pagination->initialize($config); */
        $data['title']= "Latest Posts";
        /* $data['posts']=$this->post_model->get_post(FALSE,$config['per_page'],$offset); */

        $assets['assets']=[
            "js"=>[
                base_url()."assets/js/posts/index.js"
            ],
            "css"=>[
                base_url()."assets/css/posts/index.css"
            ]
        ];

        $this->load->view('templates/header',$assets);
        $this->load->view('posts/index',$data);
        $this->load->view('templates/footer',$assets);
    }

    public function apiloadPosts(){
        $response["success"] = 0;

        $data = $this->post_model->loadPosts($this->input->post('from'));
        if (count($data)) {
            $response["success"] = 1;
        }
        $response["data"] = $data;

        echo json_encode($response);
    }

    public function view($slug= NULL){
        $data['post']= $this->post_model->get_post($slug);
        $post_id = $data['post']['id'];
        //$data['comments']=$this->comment_model->get_comments($post_id);
        if(empty($data['post'])){
            show_404();
        }

        $data['title']=$data['post']['title'];
        $data['comments']=[];
        $assets['assets']=[
            "js"=>[
            ],
            "css"=>[
                base_url()."assets/css/posts/view.css"
            ]
        ];

        $this->load->view('templates/header',$assets);
        $this->load->view('posts/view',$data);
        $this->load->view('templates/footer',$assets);
    }

    function create(){
        if($this->session->userdata('logged_id') == 0){
            //redirect('users/login');
        }
        //echo "
";print_r($_FILES);echo "
";exit();
        $data['title']="Create Post";
        $data['categories']=$this->post_model->get_categories();

        $this->form_validation->set_rules('title','Title','required');
        $this->form_validation->set_rules('body','Body','required');

        $data['assets']=[
            "js"=>[

            ],
            "css"=>[

            ]
        ];
        if($this->form_validation->run() === FALSE){
            $this->load->view('templates/header',$data);
            $this->load->view('posts/create',$data);
            $this->load->view('templates/footer');

        }else{
		$fileName = $_FILES['userfiles']['name'];
		$postsImg = getcwd()."/assets/images/posts/";
		if($_FILES['userfiles']['tmp_name'] != NULL || $_FILES['userfiles']['tmp_name'] !=""){
			//sudo chmod -R 0777 /opt/lampp/htdocs/Blog_PhpCodeigniter/assets/images/posts
			move_uploaded_file($_FILES['userfiles']['tmp_name'],$postsImg.$fileName);
			$post_image = $_FILES['userfiles']['name'];
		}else{
			$post_image = 'noimage.jpg';
		}
		$this->post_model->create_post($post_image);
                $flash_message = "
Success! Your post has been created.
";
                $this->session->set_flashdata('flash_message',$flash_message);
		redirect('posts/index');
        }
    }

    public function delete($id){
        if(!$this->session->userdata('logged_id')){
            redirect('users/login');
        }
        $this->post_model->delete_post($id);
        redirect('posts/index');
    }

    public function edit($slug){
        $data['post']= $this->post_model->get_post($slug);

        if($this->session->userdata('user_id') != $this->post_model->get_post($slug)['user_id']){
            redirect('posts');
        }
        $data['categories']=$this->post_model->get_categories();

        if(empty($data['post'])){
            show_404();
        }

        $data['title']="Edit Post";
        $this->load->view('templates/header');
        $this->load->view('posts/edit',$data);
        $this->load->view('templates/footer');
    }

    public function update_post(){
        //echo '
';print_r($_SESSION); echo $this->session->userdata('logged_id');exit();
        if($this->session->userdata('logged_id') === 0){
            redirect('users/login');
        }
       $this->post_model->update_post();
       $flash_message = "
Success! Your post has been Updated.
";
        $this->session->set_flashdata('flash_message',$flash_message);
        redirect('posts/index');
    }
}


text:
README
======

What is x-plane-data-tools-php?
-------------------------------
x-plane-data-tools-php is a toolkit designed to parse and convert free airport and navigation data provided by Laminar Research under the Free Software Foundation General Public License (GPL) into a variety of formats that could be useful in flight simulation or virtual air traffic control on various networks.

More information on X-Plane is available at http://www.x-plane.com.
If you would like to download a copy of the AIRAC (about 90MB uncompressed), it can be found at http://data.x-plane.com.

Current functionality is limited to:
- splitting the large apt.dat file into one file per airport to ease processing/conversion requirements
- generating a .sct2 compatible sector file component for VRC terminal client including runways, taxiways, parking areas, aprons, etc.

It is very much an early work in progress.  and there are lots of improvements that I can think of but just don't have the time for at the moment, including:
- Conversions to .es format for EuroScope
- Inclusion of runway numbers, taxiway names and centerlines, terminal building markers on VRC export
- Some smoothing to limit size of the resultant file / discarding data not critical to the diagrams

If you have questions, feel free to ask!

Mike Burke <mburke@dmwtechnology.com>

Licensing
------------
Check the LICENSE file included with this package.

Requirements
------------
- PHP 5.0 and up. More requirements will be documented as they're figured out.
- X-Plane apt.dat airport data file available at http://data.x-plane.com.

Installation
------------
This program is currently designed to be run from the command line (CLI).  Download the toolkit and place a copy of apt.dat from the x-plane data site in the root directory (see above).

Documentation
-------------
Check the docs folder.

Contributing
------------
This is a completely open-source community project.  Contribute if you'd like!


text:
<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" package="edu.hood.boost" xmlns:android="http://schemas.android.com/apk/res/android">
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
    <uses-permission android:name="android.permission.INTERNET" />
    <application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="CordovaApp" android:theme="@android:style/Theme.Black.NoTitleBar" android:windowSoftInputMode="adjustResize">
            <intent-filter android:label="@string/launcher_name">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
    <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />
    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    <uses-sdk android:minSdkVersion="18" android:targetSdkVersion="19" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
</manifest>


text:
package com.google.j2cl.transpiler.ast;

import static com.google.common.base.Preconditions.checkNotNull;

import com.google.j2cl.common.visitor.Processor;
import com.google.j2cl.common.visitor.Visitable;

/** Class for Await expression. */
@Visitable
public class AwaitExpression extends Expression {
  @Visitable Expression expression;
  private final TypeDescriptor typeDescriptor;

  private AwaitExpression(Expression expression, TypeDescriptor typeDescriptor) {
    this.expression = checkNotNull(expression);
    this.typeDescriptor = checkNotNull(typeDescriptor);
  }

  public Expression getExpression() {
    return expression;
  }

  @Override
  public TypeDescriptor getTypeDescriptor() {
    return typeDescriptor;
  }

  @Override
  public Precedence getPrecedence() {
    // Await is considered exactly like a prefix operator w.r.t. precedence.
    return Precedence.PREFIX;
  }

  @Override
  public AwaitExpression clone() {
    return new AwaitExpression(expression.clone(), typeDescriptor);
  }

  public static Builder newBuilder() {
    return new Builder();
  }

  @Override
  public Node accept(Processor processor) {
    return Visitor_AwaitExpression.visit(processor, this);
  }

  /** A builder for AwaitExpressions. */
  public static class Builder {
    private Expression expression;
    private TypeDescriptor typeDescriptor;

    public static Builder from(AwaitExpression awaitExpression) {
      return new Builder()
          .setExpression(awaitExpression.getExpression())
          .setTypeDescriptor(awaitExpression.getTypeDescriptor());
    }

    public Builder setExpression(Expression expression) {
      this.expression = expression;
      return this;
    }

    public Builder setTypeDescriptor(TypeDescriptor typeDescriptor) {
      this.typeDescriptor = typeDescriptor;
      return this;
    }

    public AwaitExpression build() {
      return new AwaitExpression(expression, typeDescriptor);
    }
  }
}


text:
//
// Created by Martin Riedel on 17.09.17.
//

#ifndef LIBHTSP_HTSPCONNECTION_H
#define LIBHTSP_HTSPCONNECTION_H

#include <thread>
#include <boost/asio.hpp>
#include <future>
#include "HTSMessage.h"

/*
 * Configuration defines
 */
#define HTSP_MIN_SERVER_VERSION       (19) // Server must support at least this htsp version
#define HTSP_CLIENT_VERSION           (28) // Client uses HTSP features up to this version. If the respective
// addon feature requires htsp features introduced after
// HTSP_MIN_SERVER_VERSION this feature will only be available if the
// actual server HTSP version matches (runtime htsp version check).

using boost::asio::ip::tcp;

class HTSPConnection {
private:
    boost::asio::io_service &io_service_;
    boost::asio::io_service::work io_service_work_;
    tcp::resolver resolver_;
    tcp::socket tcp_socket_;

    boost::asio::streambuf response_;

//    void ResolveHandler(const boost::system::error_code& err,
//                        tcp::resolver::iterator endpoint_iterator,
//                        std::shared_ptr<std::promise<bool>> connectPromisePtr);

    void ConnectHandler(const boost::system::error_code& err,
                        tcp::resolver::iterator endpoint_iterator,
                        std::shared_ptr<std::promise<bool>> connectPromise);

    void WriteHandler(const boost::system::error_code& err);

public:
    HTSPConnection(boost::asio::io_service &io_service);
    HTSPConnection(boost::asio::io_service &io_service,
                   const std::string &server,
                   const std::string &service);

    ~HTSPConnection();

    std::future<bool> Connect(const std::string& server, const std::string& service);
    std::future<bool> Connect(tcp::resolver::iterator endpoint_iterator);

    bool IsOpen();

    bool WriteHtsMessage(const HtsMessage &msg);

    bool SendHello();

    bool SendAuth(const std::string &user, const std::string &pass);
};

#endif //LIBHTSP_HTSPCONNECTION_H


text:
package com.google.devtools.moe.client.project;

import java.util.List;

/**
 * Configuration for the scrubber usernames.
 */
public class UsernamesConfig {

  private List<String> scrubbableUsernames;
  private List<String> publishableUsernames;

  private UsernamesConfig() {}

  public List<String> getScrubbableUsernames() {
    return scrubbableUsernames;
  }

  public List<String> getPublishableUsernames() {
    return publishableUsernames;
  }
}


text:
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// 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.

package com.google.api.ads.adwords.jaxws.v201809.mcm;

import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for AccessRole.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *

 *

 * <simpleType name="AccessRole">
 *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *     <enumeration value="ADMINISTRATIVE"/>
 *     <enumeration value="STANDARD"/>
 *     <enumeration value="READ_ONLY"/>
 *   </restriction>
 * </simpleType>
 *

 *
 */
@XmlType(name = "AccessRole")
@XmlEnum
public enum AccessRole {

    ADMINISTRATIVE,
    STANDARD,
    READ_ONLY;

    public String value() {
        return name();
    }

    public static AccessRole fromValue(String v) {
        return valueOf(v);
    }

}


text:
require 'kumogata/template/helper'

name = _resource_name(args[:name], "eip")
instance = _ref_string("instance", args, "instance")
domain = args[:domain] || ""

_(name) do
  Type "AWS::EC2::EIP"
  Properties do
    InstanceId instance unless instance.empty?
    Domain domain unless domain.empty?
  end
end


text:
@interface SubTestObject : NSObject

@property (nonatomic, strong) NSString *name;
@property (nonatomic, assign) NSUInteger identifier;

@end

@interface MFSTestObject : NSObject

@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSArray *array;
@property (nonatomic, strong) NSDictionary *dictionary;
@property (nonatomic, strong) NSData *data;
@property (nonatomic, strong) NSNumber *number;
@property (nonatomic, strong) NSNull *nul;
@property (nonatomic, strong) SubTestObject *subObject;

@end


text:
package energy.usef.brp.workflow.settlement.initiate;

/**
 * Contains the parameters for the BRPRequestPenaltyData step.
 */
public final class RequestPenaltyDataParameter {
    private RequestPenaltyDataParameter() {

    }

    /**
     * The input parameters for this step.
     */
    public enum IN {
        SETTLEMENT_DTO, PTU_DURATION
    }

    /**
     * The output parameters for this step.
     */
    public enum OUT {
        UPDATED_SETTLEMENT_DTO
    }
}


text:
%-------------------------------------------------------------------------------
%	SECTION TITLE
%-------------------------------------------------------------------------------
\cvsection{Education}

%-------------------------------------------------------------------------------
%	CONTENT
%-------------------------------------------------------------------------------
\begin{cventries}

	%---------------------------------------------------------
	\cventry
		{BEngg in Software Engineering} % Degree
		{University of Southampton} % Institution
		{Southampton, United Kingdom} % Location
		{Sept. 2013 - June 2016} % Date(s)
		{
		\begin{cvitems} % Description(s) bullet points
			\item {Graduated with 1st class honours.}
			\item {Final Year Project: Hybrid Image Classification Architecture using deep neural nets and SVMs.}
			\item {Final year modules are Machine learning, Cyber security, Cloud app. Development, Graphics and Game Design \& Development.}
		\end{cvitems}
		}
	%---------------------------------------------------------

	%---------------------------------------------------------
	\cventry
	{Foundation of Software Engineering} % Degree
	{Institute of Engineering and Technology} % Institution
	{Indore, India} % Location
	{August. 2012 - July 2013} % Date(s)
	{
		\begin{cvitems} % Description(s) bullet points
			\item {Passed my 1st year (Foundation year) from there with 1st class equivalent result (then moved to University of Southampton).}
		\end{cvitems}
	}
	%---------------------------------------------------------

	%---------------------------------------------------------
	\cventry
	{AISSCE - CBSE 12th Boards (A-Levels equivalent)} % Degree
	{Delhi Public School} % Institution
	{Indore, India} % Location
	{2010 - 2012} % Date(s)
	{
		\begin{cvitems} % Description(s) bullet points
			\item {Computer (89\%), Maths (87\%), Chemistry (95\%), Physics (93\%), English (83\%).}
		\end{cvitems}
	}

	%---------------------------------------------------------
\end{cventries}


text:
namespace tzw
{

	ProjectileBullet::ProjectileBullet(PhysicsRigidBody * rigidBody)
	:m_rigidBody(rigidBody),m_hitSfx(nullptr)
	{
		m_isFirstTimeHit = true;
		m_rigidBody->m_onHitCallBack = std::bind(&ProjectileBullet::onHitCallBack, this,std::placeholders::_1);
		m_duration = 0.0;
	}

	ProjectileBullet::~ProjectileBullet()
	{
		if(m_rigidBody)
		{
			tlog("remove");
			PhysicsMgr::shared()->removeRigidBody(m_rigidBody);
			auto node = m_rigidBody->parent();
			node->removeFromParent();
			delete m_rigidBody;
			delete node;
			//if(m_hitSfx)
			//{
			//	m_hitSfx->removeFromParent();
			//	delete m_hitSfx;
			//}
		}
	}

	void ProjectileBullet::update(float dt)
	{

	}

	void ProjectileBullet::onHitCallBack(vec3 p)
	{
		if(m_isFirstTimeHit)
		{
			auto emitter = new ParticleEmitter(1);

			emitter->setIsLocalPos(true);
			emitter->setTex("ParticleTex/smoke_04.png");
			emitter->setSpawnRate(0.3);
			emitter->addInitModule(new ParticleInitSizeModule(0.5, 0.7));
			emitter->addInitModule(new ParticleInitLifeSpanModule(0.3, 0.3));
			emitter->addInitModule(new ParticleInitAlphaModule(0.6, 0.6));
			emitter->addUpdateModule(new ParticleUpdateColorModule(vec4(1.0, 1.0, 1.0, 1.0), vec4(0.8, 0.8, 1.0, 0.0)));
	        emitter->addUpdateModule(new ParticleUpdateSizeModule(1.0, 1.5));
			emitter->setIsState(ParticleEmitter::State::Playing);
			emitter->setDepthBias(0.05);
			emitter->setPos(m_rigidBody->parent()->getWorldPos());
			emitter->setIsInfinite(false);
	        emitter->setBlendState(1);
			auto particle  = new ParticleSystem();
			particle->addEmitter(emitter);

	        g_GetCurrScene()->addNode(particle);
			m_isFirstTimeHit = false;
		}
	}
}


text:
package com.github.deltaspikedbunit.assertion;

import org.dbunit.DatabaseUnitException;
import org.dbunit.dataset.IDataSet;
import org.dbunit.dataset.ITable;

/**
 * Database assertion strategy interface.
 *
 * @author Luigi Bitonti
 * @author Mario Zagar
 * @author Sunitha Rajarathnam
 */
public interface DatabaseAssertion {

	/**
	 * Asserts that the specified {@link IDataSet dataSets} are conceptually equal.
	 *
	 * @param expectedDataSet the expected dataset
	 * @param actualDataSet the actual dataset
	 * @throws DatabaseUnitException if the datasets are not equal
	 */
	void assertEquals(IDataSet expectedDataSet, IDataSet actualDataSet) throws DatabaseUnitException;

	/**
	 * Asserts that the specified {@link IDataSet dataSets} are conceptually equal.
     *
	 * @param expectedTable the expected table
	 * @param actualTable the actual table
	 * @throws DatabaseUnitException if the tables are not equal
	 */
	void assertEquals(ITable expectedTable, ITable actualTable) throws DatabaseUnitException;

}


text:
<?php

namespace Laelaps\GearmanBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Laelaps\GearmanBundle\DependencyInjection\Compiler\AddWorkerHandlerCompilerPass;

/**
 * @author Mateusz Charytoniuk <mateusz.charytoniuk@absolvent.pl>
 */
class LaelapsGearmanBundle extends Bundle {
    /**
     * {@inheritdoc}
     */
    public function build(ContainerBuilder $container)
    {
        parent::build($container);

        $container->addCompilerPass(new AddWorkerHandlerCompilerPass());
    }
}


text:
MosaicImageControls
===================
This is a set of controls for WinRT (Windows 8.1 and Windows Phone 8.1) for displaying photos in mosaic layout.
There are two controls based on different algorithms:
- MosaicImage control saves the order and aspect ratio of images and fills the whole width provided to control.
- SquarifiedTreeMapPanel is a panel based on Treemap algorithm so it can contain any control, not only Image. It fills whole space by width and height but it can crop images.

The result of this controls:
![Screenshot](http://imgborder.ru/images/2014/08/31/screenshot08312014165403Js2wz.png)


text:
import { TemplateRef, ViewContainerRef, NgZone } from '@angular/core';
import { DxTemplateHost } from './template-host';
export declare const DX_TEMPLATE_WRAPPER_CLASS: string;
export declare class RenderData {
    model: any;
    itemIndex: number;
    container: any;
}
export declare class DxTemplateDirective {
    private templateRef;
    private viewContainerRef;
    private ngZone;
    dxTemplateOf: any;
    name: string;
    constructor(templateRef: TemplateRef<any>, viewContainerRef: ViewContainerRef, templateHost: DxTemplateHost, ngZone: NgZone);
    render(renderData: RenderData): any;
}
export declare class DxTemplateModule {
}


text:
package example.repo;

import example.model.Customer1462;

import java.util.List;

import org.springframework.data.repository.CrudRepository;

public interface Customer1462Repository extends CrudRepository<Customer1462, Long> {

	List<Customer1462> findByLastName(String lastName);
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace CommercialOfferings.MissionData
{
    public class MissionResource
    {
        [XmlElement]
        public string Name = "";
        [XmlElement]
        public double Amount = 0.0;

        public static List<MissionResource> GetMissionResourceList(Vessel vessel)
        {
            return GetMissionResourceList(vessel.parts);
        }

        public static List<MissionResource> GetMissionResourceList(List<Part> parts)
        {
            List<MissionResource> missionResources = new List<MissionResource>();

            List<string> resources = RmmUtil.DetermineResourceArray(parts);

            foreach (String resource in resources)
            {
                var amount = RmmUtil.ReadResource(parts, resource);
                if (amount != 0)
                {
                    MissionResource missionResource = new MissionResource
                    {
                        Name = resource,
                        Amount = amount,
                    };
                    missionResources.Add(missionResource);
                }
            }

            return missionResources;
        }
    }
}


text:
'use strict';

// MODULES //

var nans = require( './nans.js' );

// APPLY //

/**
* FUNCTION: apply( types )
*	Creates an apply function based on the input types.
*
* @private
* @param {String[]} types - argument types
* @returns {Function} apply function
*/
function apply( types ) {
	/**
	* FUNCTION: apply()
	*
	*/
	return function apply() {
		var nargs = arguments.length,
			out,
			x,
			M, N,
			i;

		x = arguments[ 0 ];
		M = x.shape[ 0 ];
		N = x.shape[ 1 ];
		for ( i = 1; i < nargs; i++ ) {
			if ( types[ i-1 ] === 'matrix' ) {
				x = arguments[ i ];
				if (
					x.shape[ 0 ] !== M ||
					x.shape[ 1 ] !== N
				) {
					throw new Error( 'invalid input argument. All input matrices must have the same dimensions.' );
				}
			}
			// TODO: check dims of typed arrays
		}
		out.data = nans( out.data );
		return out;
	};
} // end FUNCTION apply()

// RULE //

/**
* FUNCTION: rule( types, fcn )
*	If all input arguments are only matrices and typed arrays, return a NaN-filled matrix.
*
* @param {String[]} types - argument types
* @param {Function} fcn - function to apply
* @returns {Function|Boolean} function or false
*/
function rule( types, fcn ) {
	var len = types.length,
		i;

	for ( i = 0; i < len; i++ ) {
		if ( types[ i ] !== 'matrix' && types[ i ] !== 'typedarray' ) {
			return false;
		}
	}
	return matrixfun.create( fcn, types );
} // end FUNCTION rule()

// EXPORTS //

module.exports = rule;


text:
html, body { margin:0; padding:0; background:#FFFFFF; }
body, td, th, pre, code, select, option, input, textarea { font-family:"lucida grande",tahoma,verdana,arial,sans-serif; font-size:10pt; }
#dhead { margin:0 0 0 -10px; padding:0; line-height:80px; font-size:18pt; font-family:Georgia; /*text-shadow:1px 1px 2px gray;*/ border-bottom:10px solid #73796B; margin-bottom:0.5em; text-align:center; width:820px; background:black; color:white; -moz-border-radius:5px 5px 0 0; border-radius:5px 5px 0 0; -webkit-border-radius:5px 5px 0 0; text-indent:-2000px; background:black url("logo.png") center center no-repeat; }
h1 { margin:0 0 0 0px; padding:0; font-size:14pt; font-family:Georgia; /*text-shadow:1px 1px 2px gray;*/ margin-bottom:1em; text-align:center; text-transform:uppercase;}
h2 { margin:0.5em 0 0.5em 0; padding:0.5em 0 0.5em 20px; font-size:12pt; font-family:Georgia; color:white; background:silver; text-shadow:1px 1px 2px gray; clear:both; -moz-border-radius:5px; border-radius:5px; -webkit-border-radius:5px; }
h3 { margin:0; padding:0.5em 0 0.5em 0; font-size:11.5pt; font-family:Georgia; color:gray; clear:both; }
p { padding:0em 0 0.5em 0; margin:0; line-height:1.8em; }
p.meta { font-size:9pt; color:gray; margin-top:-5px; }
.arguments .tp, p code { color:green; padding:0 4px; font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size:13px; }
#description, .panel { margin:0 20px; }
#container { width:800px; margin:10px auto; overflow:hidden; background:white; padding:0 10px 10px 10px; -moz-border-radius:5px; border-radius:5px; -webkit-border-radius:5px; -moz-box-shadow: 0px 0px 10px #000; }
.demo { width:300px; float:left; margin:0; border:1px solid gray; background:white; overflow:auto; }
.code { width:490px; float:right; margin:0 0 10px 0; border:1px solid gray; font-size:12px; }
pre { display:block; }
.code_f { border:1px solid gray; margin-bottom:1em; }
.syntaxhighlighter { margin:0 0 0 0 !important; padding:0 !important; line-height:18px; }

.log { padding:4px; border:1px solid gray; margin-bottom:1em; }
.button { display:block; margin-bottom:0.5em; }
.arguments { margin:0em 1em; padding:0; list-style-type:none; }
.arguments .tp { padding:0 0 0 0; float:left; width:70px;  }
.arguments strong { display:block; }

.api h3 { margin-left:-10px; color:black; font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-size:14px; margin-top:2em; border-top:1px solid; width:780px; }
.api .arguments li strong {  color:black; font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-size:13px; }

.configuration h3 { margin-left:-10px; color:black; font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-weight: normal !important; font-size:14px; margin-top:2em; border-top:1px solid; width:780px; }
.note { background:#ffffee; padding:10px 20px; border:1px solid #333; -moz-border-radius:5px; border-radius:5px; -webkit-border-radius:5px; margin-bottom:15px; text-align:center; font-weight:bold; }

.plugins, .demos { margin:0 auto 20px auto; }

ul.columns { list-style-type:none; width:700px; margin:0px auto 15px auto; padding:0; overflow:hidden; }
ul.columns li { float:left; margin:0; padding:0 0 0 0px; line-height:18px; width:345px; }
ul.demos li, ul.plugins li { width:220px; text-align:left; padding:5px 0; }
ul.demos li a, ul.plugins li a { text-decoration:none; color:#3B5998; }
ul.demos li a:hover, ul.plugins li a:hover { text-decoration:underline; }
ul.plugins li p { text-align:left; font-size:9px; color:#333; margin:0 5px 0 0; }

ul.demos li { width:auto; }

.demo, .demo input, .jstree-dnd-helper, #vakata-contextmenu { font-size:12px; font-family:Verdana; }

#demo_body .demo, #demo_body .code { width:auto; float:none; clear:both; margin:10px auto; }
#demo_body .code { margin-bottom:20px; }

ul.jstree { width:700px; margin:0px auto 15px auto; padding:0; }
ul.jstree li { margin:0; padding:2px 0; }
ul.jstree li a { color:#3B5998; text-decoration:underline; }


text:
import { NodePath } from 'babel__core'
import { ExportDeclaration, ImportDeclaration } from 'babel-types'

export function getFileName(
  path: NodePath<ExportDeclaration> | NodePath<ImportDeclaration>
) {
  const {
    parserOpts: { sourceFileName } = { sourceFileName: '' },
    generatorOpts: { filename } = { filename: '' }
  } = path.hub.file.opts
  return sourceFileName ?? filename
}


text:
layout: page
title: Yu Family Reunion
date: 2016-05-24
author: Mark Kelley
tags: weekly links, java
status: published
summary: Vivamus at sodales metus. Suspendisse iaculis nisl condimentum.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 01/29/2018
  endDate: 02/03/2018
  ctyhocn: ONTNCHX
  groupCode: YFR
published: true
---
Mauris vitae nisi scelerisque, blandit mauris sit amet, iaculis lacus. In vel suscipit justo. In at orci facilisis nulla tincidunt consectetur in at orci. Sed vel aliquet diam. Donec metus nisl, viverra a eros vitae, interdum convallis ante. Donec dictum nulla arcu, nec ultrices risus cursus vitae. Nam feugiat fringilla vulputate. Vivamus aliquet tristique lectus, sed commodo nisi egestas in. Aliquam erat volutpat. Nunc suscipit euismod erat vel bibendum. Ut nec nunc eu arcu egestas aliquam eu sed leo. Morbi mattis felis non orci mollis suscipit. Nam eget leo rutrum, pellentesque mauris ac, bibendum turpis. Donec orci felis, ultricies ac sagittis in, egestas pretium dui.

* Nam scelerisque tellus eu ex vehicula, quis semper enim ornare
* Morbi sed erat ac nisl ullamcorper varius in id augue
* Donec dictum magna malesuada neque euismod pellentesque.

Maecenas rhoncus aliquam euismod. In hac habitasse platea dictumst. Sed lectus enim, dapibus eget feugiat at, facilisis ut leo. Nullam sollicitudin pellentesque arcu nec lobortis. Nulla at fringilla lorem. Sed nec augue egestas, lacinia augue quis, porttitor lacus. Phasellus pharetra eget neque non vestibulum. Maecenas vulputate, lectus vitae dictum hendrerit, turpis sapien posuere odio, at consequat urna felis vel lorem. Curabitur congue et eros id suscipit. Vivamus non auctor ipsum, sed ultrices nulla. Morbi id magna ut sem eleifend tincidunt. Aenean congue varius justo quis ultrices. Etiam elementum maximus metus, in bibendum ex suscipit eget. Aenean facilisis erat convallis facilisis ornare.


text:
"""Variable utilities for JAX."""

from concurrent import futures
import datetime
import time
from typing import List, NamedTuple, Optional, Sequence, Union

from acme import core
from acme.jax import networks as network_types
import jax

class VariableReference(NamedTuple):
  variable_name: str

class ReferenceVariableSource(core.VariableSource):
  """Variable source which returns references instead of values.

  This is passed to each actor when using a centralized inference server. The
  actor uses this special variable source to get references rather than values.
  These references are then passed to calls to the inference server, which will
  dereference them to obtain the value of the corresponding variables at
  inference time. This avoids passing around copies of variables from each
  actor to the inference server.
  """

  def get_variables(self, names: Sequence[str]) -> List[VariableReference]:
    return [VariableReference(name) for name in names]

class VariableClient:
  """A variable client for updating variables from a remote source."""

  def __init__(self,
               client: core.VariableSource,
               key: Union[str, Sequence[str]],
               update_period: Union[int, datetime.timedelta] = 1,
               device: Optional[Union[str, jax.xla.Device]] = None):
    """Initializes the variable client.

    Args:
      client: A variable source from which we fetch variables.
      key: Which variables to request. When multiple keys are used, params
        property will return a list of params.
      update_period: Interval between fetches, specified as either (int) a
        number of calls to update() between actual fetches or (timedelta) a time
        interval that has to pass since the last fetch.
      device: The name of a JAX device to put variables on. If None (default),
        VariableClient won't put params on any device.
    """
    self._update_period = update_period
    self._call_counter = 0
    self._last_call = time.time()
    self._client = client
    self._params: Sequence[network_types.Params] = None

    self._device = device
    if isinstance(self._device, str):
      self._device = jax.devices(device)[0]

    self._executor = futures.ThreadPoolExecutor(max_workers=1)

    if isinstance(key, str):
      key = [key]

    self._key = key
    self._request = lambda k=key: client.get_variables(k)
    self._future: Optional[futures.Future] = None  # pylint: disable=g-bare-generic
    self._async_request = lambda: self._executor.submit(self._request)

  def update(self, wait: bool = False) -> None:
    """Periodically updates the variables with the latest copy from the source.

    If wait is True, a blocking request is executed. Any active request will be
    cancelled.
    If wait is False, this method makes an asynchronous request for variables.

    Args:
      wait: Whether to execute asynchronous (False) or blocking updates (True).
        Defaults to False.
    """
    # Track calls (we only update periodically).
    self._call_counter += 1

    # Return if it's not time to fetch another update.
    if isinstance(self._update_period, datetime.timedelta):
      if self._update_period.total_seconds() + self._last_call > time.time():
        return
    else:
      if self._call_counter < self._update_period:
        return

    if wait:
      if self._future is not None:
        if self._future.running():
          self._future.cancel()
        self._future = None
      self._call_counter = 0
      self._last_call = time.time()
      self.update_and_wait()
      return

    # Return early if we are still waiting for a previous request to come back.
    if self._future and not self._future.done():
      return

    # Get a future and add the copy function as a callback.
    self._call_counter = 0
    self._last_call = time.time()
    self._future = self._async_request()
    self._future.add_done_callback(lambda f: self._callback(f.result()))

  def update_and_wait(self):
    """Immediately update and block until we get the result."""
    self._callback(self._request())

  def _callback(self, params_list: List[network_types.Params]):
    if self._device and not isinstance(self._client, ReferenceVariableSource):
      # Move variables to a proper device.
      self._params = jax.device_put(params_list, self._device)
    else:
      self._params = params_list

  @property
  def device(self) -> Optional[jax.xla.Device]:
    return self._device

  @property
  def params(self) -> Union[network_types.Params, List[network_types.Params]]:
    """Returns the first params for one key, otherwise the whole params list."""
    if self._params is None:
      self.update_and_wait()

    if len(self._params) == 1:
      return self._params[0]
    else:
      return self._params


text:
package livelance.app.web.resource;

import java.util.Date;

import org.springframework.hateoas.ResourceSupport;

import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;

import livelance.app.model.Rating;

@JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="rid")
public class RatingResource extends ResourceSupport {

	private Long rid;
	private String customerName;
	private int rating;
	private String comment;
	private Date timeOfRating;

	public Long getRid() {
		return rid;
	}

	public void setRid(Long rid) {
		this.rid = rid;
	}

	public String getCustomerName() {
		return customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}

	public int getRating() {
		return rating;
	}

	public void setRating(int rating) {
		this.rating = rating;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public Date getTimeOfRating() {
		return timeOfRating;
	}

	public void setTimeOfRating(Date timeOfRating) {
		this.timeOfRating = timeOfRating;
	}

	public Rating toRating() {
		Rating rating = new Rating();
		rating.setComment(comment);
		rating.setCustomerName(customerName);
		rating.setRating(this.rating);
		return rating;
	}
}