text:
module EmuCtl
  class Ctl
    @@EMU_TIMEOUT = 180

    def self.start(emu)
      raise 'invalid name: nil' if emu.name.nil?
      puts "starting emulator: #{emu}"
      cmd = "emulator -no-boot-anim -avd #{emu.name} -no-snapshot-load -no-snapshot-save -no-audio -no-window -verbose &"
      puts "#{cmd}"
      system "#{cmd}"
      starting_up = true

      start = Time.now

      until ADB.boot_complete?
        sleep 2
        ellapsed = Time.now - start
        print "\r"
        print "Waiting for emulator " + "."*(ellapsed/2).to_i
        STDOUT.flush
        abort "unable to start emulator for #{@@EMU_TIMEOUT/60} minutes" if Time.now - start > @@EMU_TIMEOUT
      end

      puts ''
      puts 'emulator up and running'
      puts ADB.devices

      puts 'unlocking screen'
      ADB.unlock_emulator
      puts 'emulator ready'
    end

    def self.list
      _, stdout, _ = Open3.popen3('android list avd')
      lines = []
      stdout.each_line { |l| lines.push(l) }
      lines.join.split('---------').map { |desc| Avd.new(desc) }
    end

    def self.list_targets(filter = true)
      _, stdout, _ = Open3.popen3('android list targets')
      lines = []
      stdout.each_line { |l| lines.push(l) }
      target_descs = lines.join.split('----------').select { |t| t.include?('id: ') }
      target_descs.map { |desc| Target.new(desc) }.select{|t| t.abi.nil? == false && filter}
    end

    def self.create(target, skin)
      escaped_id = target.id.gsub(/(\s|:)/,'-')
      cmd = "android create avd -n emu_#{escaped_id}_#{skin} -t \"#{target.id}\" -s #{skin}"
      puts cmd
      system cmd
    end

    def self.delete(emu)
      system "android delete avd -n #{emu.name}"
    end

    def self.running_pids
      warn 'deprecated: controlling emulators via pids is a bad idea'
      _, stdout, _ = Open3.popen3("pgrep 'emulator'")
      pids = []
      stdout.each_line { |l| pids.push(l.strip) }
      pids
    end

    def self.kill_pids(pids)
      warn 'deprecated: controlling emulators via pids is a bad idea'
      pids.each { |pid| system "kill -9 #{pid}" }
    end
  end
end


text:
using ::testing::Return;

namespace ipmi_flash
{

class VersionCloseExpireBlobTest : public ::testing::Test
{
  protected:
    void SetUp() override
    {
        h = std::make_unique<VersionBlobHandler>(
            createMockVersionConfigs(blobNames, &im, &tm));
    }

    std::unique_ptr<blobs::GenericBlobInterface> h;
    std::vector<std::string> blobNames{"blob0", "blob1", "blob2", "blob3"};
    std::unordered_map<std::string, TriggerMock*> tm;
    std::unordered_map<std::string, ImageHandlerMock*> im;
};

TEST_F(VersionCloseExpireBlobTest, VerifyOpenThenClose)
{
    EXPECT_CALL(*tm.at("blob0"), trigger()).WillOnce(Return(true));
    EXPECT_TRUE(h->open(0, blobs::read, "blob0"));
    EXPECT_CALL(*tm.at("blob0"), abort()).Times(1);
    EXPECT_TRUE(h->close(0));
}

TEST_F(VersionCloseExpireBlobTest, VerifySingleAbort)
{
    EXPECT_CALL(*tm.at("blob0"), trigger()).WillOnce(Return(true));
    EXPECT_TRUE(h->open(0, blobs::read, "blob0"));
    EXPECT_TRUE(h->open(1, blobs::read, "blob0"));
    EXPECT_TRUE(h->close(0));
    EXPECT_CALL(*tm.at("blob0"), abort()).Times(1);
    EXPECT_TRUE(h->close(1));
}

TEST_F(VersionCloseExpireBlobTest, VerifyUnopenedBlobCloseFails)
{
    EXPECT_FALSE(h->close(0));
}

TEST_F(VersionCloseExpireBlobTest, VerifyDoubleCloseFails)
{
    EXPECT_CALL(*tm.at("blob0"), trigger()).WillOnce(Return(true));
    EXPECT_TRUE(h->open(0, blobs::read, "blob0"));
    EXPECT_CALL(*tm.at("blob0"), abort()).Times(1);
    EXPECT_TRUE(h->close(0));
    EXPECT_FALSE(h->close(0));
}

TEST_F(VersionCloseExpireBlobTest, VerifyBadSessionNumberCloseFails)
{
    EXPECT_CALL(*tm.at("blob0"), trigger()).WillOnce(Return(true));
    EXPECT_TRUE(h->open(0, blobs::read, "blob0"));
    EXPECT_FALSE(h->close(1));
    EXPECT_CALL(*tm.at("blob0"), abort()).Times(1);
    EXPECT_TRUE(h->close(0));
}

TEST_F(VersionCloseExpireBlobTest, VerifyRunningActionIsAborted)
{
    EXPECT_CALL(*tm.at("blob0"), trigger()).WillOnce(Return(true));
    EXPECT_TRUE(h->open(0, blobs::read, "blob0"));
    EXPECT_CALL(*tm.at("blob0"), abort()).Times(1);
    EXPECT_TRUE(h->close(0));
}

} // namespace ipmi_flash

redpajama_set_name: RedPajamaGithub


text:
document.write('

');

$(document).ready(function () {
function path() {
    var args = arguments, result = [];
    for (var i = 0; i < args.length; i++)
        result.push(args[i].replace('@', '../site/sh/scripts/'));
    return result
};

SyntaxHighlighter.autoloader.apply(null, path(
            'applescript            @shBrushAppleScript.js',
            'actionscript3 as3      @shBrushAS3.js',
            'bash shell             @shBrushBash.js',
            'coldfusion cf          @shBrushColdFusion.js',
            'cpp c                  @shBrushCpp.js',
            'c# c-sharp csharp      @shBrushCSharp.js',
            'css                    @shBrushCss.js',
            'delphi pascal          @shBrushDelphi.js',
            'diff patch pas         @shBrushDiff.js',
            'erl erlang             @shBrushErlang.js',
            'groovy                 @shBrushGroovy.js',
            'java                   @shBrushJava.js',
            'jfx javafx             @shBrushJavaFX.js',
            'js jscript javascript  @shBrushJScript.js',
            'perl pl                @shBrushPerl.js',
            'php                    @shBrushPhp.js',
            'text plain             @shBrushPlain.js',
            'py python              @shBrushPython.js',
            'lua                    @shBrushLua.js',
            'ruby rails ror rb      @shBrushRuby.js',
            'sass scss              @shBrushSass.js',
            'scala                  @shBrushScala.js',
            'sql                    @shBrushSql.js',
            'vb vbnet               @shBrushVb.js',
            'xml xhtml xslt html    @shBrushXml.js')
            );

            SyntaxHighlighter.defaults['gutter'] = false;
            SyntaxHighlighter.all();
            });


text:
using System;
using System.IO;
using Gtk;
using Pinta.Resources;

namespace Pinta
{
	public interface IResourceService
	{
		Gdk.Pixbuf GetIcon (string name, StyleContext? context = null);
		Gdk.Pixbuf GetIcon (string name, int size, StyleContext? context = null);
		Stream? GetResourceIconStream (string name);
	}

	public class ResourceManager : IResourceService
	{
		public Gdk.Pixbuf GetIcon (string name, StyleContext? context = null)
		{
			return GetIcon (name, 16, context);
		}

		public Gdk.Pixbuf GetIcon (string name, int size, StyleContext? context = null)
		{
			return ResourceLoader.GetIcon (name, size, context);
		}

		public Stream? GetResourceIconStream (string name)
		{
			return ResourceLoader.GetResourceIconStream (name);
		}
	}
}


text:
title: Twitter
---

# Twitter

The only known working URL for this source is:
* <https://api.twitter.com>

**⚠ Twitter results are post-filtered to remove tweets without images. As such, when searching for an account with lots of tweets without media, you might get less results than expected, sometimes even an empty page. In that case, just go to the next page. It is also recommended to increase the images per page setting to see more results at once. ⚠**

## Search syntax

* `Username`: get all media for a given user handle
* `user_id:ID`: get all media for a given user ID
* `list_id:ID`: get all media for a given list ID
* `retweets:{yes,no}`: whether to also get media from retweets (default: `yes`)
* `replies:{yes,no}`: whether to also get media from replies (default: `yes`)


text:
<?php

namespace LaravelFlare\Media\Http\Controllers;

use Illuminate\Http\Request;
use LaravelFlare\Media\Media;
use LaravelFlare\Flare\Admin\AdminManager;
use Intervention\Image\ImageManagerStatic as Image;
use LaravelFlare\Media\Http\Requests\MediaCreateRequest;
use LaravelFlare\Flare\Admin\Modules\ModuleAdminController;

class MediaAdminController extends ModuleAdminController
{
    /**
     * Admin Instance.
     *
     * @var
     */
    protected $admin;

    /**
     * __construct.
     *
     * @param AdminManager $adminManager
     */
    public function __construct(AdminManager $adminManager)
    {
        // Must call parent __construct otherwise
        // we need to redeclare checkpermissions
        // middleware for authentication check
        parent::__construct($adminManager);

        $this->admin = $this->adminManager->getAdminInstance();
    }

    /**
     * Index Media for Media Module.
     *
     * Lists the current media in the system.
     *
     * @return \Illuminate\Http\Response
     */
    public function getIndex()
    {
        return view('flare::admin.media.index', [
                                                    'media' => Media::orderBy('id', 'desc')->paginate(),
                                                    'totals' => [
                                                        'all' => Media::get()->count(),
                                                    ],
                                                ]);
    }

    /**
     * Create a new Media.
     *
     * @return \Illuminate\Http\Response
     */
    public function getCreate()
    {
        return view('flare::admin.media.create', ['media' => new Media()]);
    }

    /**
     * Processes a new Media Request.
     *
     * @return \Illuminate\Http\RedirectResponse
     */
    public function postCreate(MediaCreateRequest $request)
    {
        $media = Media::create($request->all());

        return redirect($this->admin->currentUrl('view/'.$media->id))->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'Your Media was successfully added.', 'dismissable' => false]]);
    }

    /**
     * This is not used.
     *
     * @return \Illuminate\Http\Response
     */
    public function getUpload()
    {
        return [];
    }

    /**
     * Process a File Upload from the Jquery File Uploader.
     *
     * @param Request $request
     *
     * @return string
     */
    public function postUpload(Request $request)
    {
        if (!$request->file('file')) {
            return [];
        }

        $filename = time().'-'.$request->file('file')->getClientOriginalName();
        $request->file('file')->move('uploads/media', $filename);

        foreach (\Config::get('flare-config.media.resize') as $sizeArray) {
            $newfilename = $sizeArray[0].'-'.(array_key_exists(1, $sizeArray) ? $sizeArray[1] : $sizeArray[0]).'-'.$filename;
            Image::make('uploads/media/'.$filename)->fit($sizeArray[0], (array_key_exists(1, $sizeArray) ? $sizeArray[1] : $sizeArray[0]))->save('uploads/media/'.$newfilename);
        }

        $media = Media::create([
                            'name' => $request->file('file')->getClientOriginalName(),
                            'path' => $filename,
                            'extension' => $request->file('file')->getClientOriginalExtension(),
                            'mimetype' => $request->file('file')->getClientMimeType(),
                            'size' => $request->file('file')->getClientSize(),
            ]);

        $file = new \stdClass();
        $file->name = $media->name;
        $file->url = url('uploads/media/'.$media->path);
        $file->thumbnailUrl = url('uploads/media/100-100-'.$media->path);
        $file->type = $media->mimetype;
        $file->size = $media->size;

        $object = new \stdClass();
        $object->files = [$file];

        return json_encode($object);
    }

    /**
     * Delete Media.
     *
     * @param int $mediaId
     *
     * @return \Illuminate\Http\Response
     */
    public function getDelete($mediaId)
    {
        return view('flare::admin.media.delete', ['Media' => Media::findOrFail($mediaId)]);
    }

    /**
     * Process Delete Media Request.
     *
     * @param int $mediaId
     *
     * @return \Illuminate\Http\RedirectResponse
     */
    public function postDelete($mediaId)
    {
        $media = Media::findOrFail($mediaId);
        $media->delete();

        return redirect($this->admin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The Media was successfully deleted.', 'dismissable' => false]]);
    }

    /**
     * Method is called when the appropriate controller
     * method is unable to be found or called.
     *
     * @param array $parameters
     *
     * @return
     */
    public function missingMethod($parameters = array())
    {
        parent::missingMethod();
    }
}


text:
package com.google.gdata.client.authn.oauth;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Map;
import java.util.Map.Entry;

/**
 * A simple client for making http requests and returning the response body.
 * Uses {@link java.net.HttpURLConnection} to make http requests.
 *
 *
 */
public class OAuthHttpClient {

  /**
   * Makes an http request to the input URL, and returns the response body as a
   * string.
   *
   * @param url the url to make the request to
   * @return the response body of the request
   * @throws OAuthException if there was an error making the request
   */
  public String getResponse(URL url) throws OAuthException {
    return getResponse(url, null);
  }

  /**
   * Makes an http request to the input URL, and returns the response body as a
   * string.
   *
   * @param url the url to make the request to
   * @param headers any headers to add to the request
   * @return the response body of the request
   * @throws OAuthException if there was an error making the request
   */
  public String getResponse(URL url, Map<String, String> headers)
      throws OAuthException {
      try {
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        if (headers != null) {
          for (Entry<String, String> entry : headers.entrySet()) {
            connection.addRequestProperty(entry.getKey(), entry.getValue());
          }
        }
        connection.connect();
        BufferedReader in = new BufferedReader(new InputStreamReader(
            connection.getInputStream()));
        String inputLine;
        StringBuilder response = new StringBuilder();
        while ((inputLine = in.readLine()) != null) {
          response.append(inputLine);
        }
        in.close();
        return response.toString();
      } catch (IOException e) {
        throw new OAuthException("Error getting HTTP response", e);
      }
  }
}


text:
package org.zstack.core.debug;

import org.springframework.beans.factory.annotation.Autowired;
import org.zstack.core.cloudbus.CloudBus;
import org.zstack.core.cloudbus.MessageSafe;
import org.zstack.header.AbstractService;
import org.zstack.header.message.Message;

import java.util.List;

/**
 * Created by xing5 on 2016/7/25.
 */
public class DebugManagerImpl extends AbstractService implements DebugManager {
    @Autowired
    private CloudBus bus;

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

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

    @Override
    @MessageSafe
    public void handleMessage(Message msg) {
        if (msg instanceof APIDebugSignalMsg) {
            handle((APIDebugSignalMsg)msg);
        }
    }

    private void handle(APIDebugSignalMsg msg) {
        APIDebugSignalEvent evt = new APIDebugSignalEvent(msg.getId());
        for (String sig : msg.getSignals()) {
            DebugSignal dsig = DebugSignal.valueOf(sig);
            List<DebugSignalHandler> hs = sigHandlers.get(dsig);
            if (hs == null) {
                continue;
            }

            for (DebugSignalHandler h : hs) {
                h.handleDebugSignal(dsig);
            }
        }

        bus.publish(evt);
    }

    @Override
    public String getId() {
        return bus.makeLocalServiceId(DebugConstant.SERVICE_ID);
    }
}


text:
#pragma once
#include <aws/eventbridge/EventBridge_EXPORTS.h>
#include <aws/eventbridge/EventBridgeRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/eventbridge/model/ReplayState.h>
#include <utility>

namespace Aws
{
namespace EventBridge
{
namespace Model
{

  /**
   */
  class AWS_EVENTBRIDGE_API ListReplaysRequest : public EventBridgeRequest
  {
  public:
    ListReplaysRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "ListReplays"; }

    Aws::String SerializePayload() const override;

    Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;

    /**
     *
A name prefix to filter the replays returned. Only replays with name that
     * match the prefix are returned.

     */
    inline const Aws::String& GetNamePrefix() const{ return m_namePrefix; }

    /**
     *
A name prefix to filter the replays returned. Only replays with name that
     * match the prefix are returned.

     */
    inline bool NamePrefixHasBeenSet() const { return m_namePrefixHasBeenSet; }

    /**
     *
A name prefix to filter the replays returned. Only replays with name that
     * match the prefix are returned.

     */
    inline void SetNamePrefix(const Aws::String& value) { m_namePrefixHasBeenSet = true; m_namePrefix = value; }

    /**
     *
A name prefix to filter the replays returned. Only replays with name that
     * match the prefix are returned.

     */
    inline void SetNamePrefix(Aws::String&& value) { m_namePrefixHasBeenSet = true; m_namePrefix = std::move(value); }

    /**
     *
A name prefix to filter the replays returned. Only replays with name that
     * match the prefix are returned.

     */
    inline void SetNamePrefix(const char* value) { m_namePrefixHasBeenSet = true; m_namePrefix.assign(value); }

    /**
     *
A name prefix to filter the replays returned. Only replays with name that
     * match the prefix are returned.

     */
    inline ListReplaysRequest& WithNamePrefix(const Aws::String& value) { SetNamePrefix(value); return *this;}

    /**
     *
A name prefix to filter the replays returned. Only replays with name that
     * match the prefix are returned.

     */
    inline ListReplaysRequest& WithNamePrefix(Aws::String&& value) { SetNamePrefix(std::move(value)); return *this;}

    /**
     *
A name prefix to filter the replays returned. Only replays with name that
     * match the prefix are returned.

     */
    inline ListReplaysRequest& WithNamePrefix(const char* value) { SetNamePrefix(value); return *this;}

    /**
     *
The state of the replay.

     */
    inline const ReplayState& GetState() const{ return m_state; }

    /**
     *
The state of the replay.

     */
    inline bool StateHasBeenSet() const { return m_stateHasBeenSet; }

    /**
     *
The state of the replay.

     */
    inline void SetState(const ReplayState& value) { m_stateHasBeenSet = true; m_state = value; }

    /**
     *
The state of the replay.

     */
    inline void SetState(ReplayState&& value) { m_stateHasBeenSet = true; m_state = std::move(value); }

    /**
     *
The state of the replay.

     */
    inline ListReplaysRequest& WithState(const ReplayState& value) { SetState(value); return *this;}

    /**
     *
The state of the replay.

     */
    inline ListReplaysRequest& WithState(ReplayState&& value) { SetState(std::move(value)); return *this;}

    /**
     *
The ARN of the archive from which the events are replayed.

     */
    inline const Aws::String& GetEventSourceArn() const{ return m_eventSourceArn; }

    /**
     *
The ARN of the archive from which the events are replayed.

     */
    inline bool EventSourceArnHasBeenSet() const { return m_eventSourceArnHasBeenSet; }

    /**
     *
The ARN of the archive from which the events are replayed.

     */
    inline void SetEventSourceArn(const Aws::String& value) { m_eventSourceArnHasBeenSet = true; m_eventSourceArn = value; }

    /**
     *
The ARN of the archive from which the events are replayed.

     */
    inline void SetEventSourceArn(Aws::String&& value) { m_eventSourceArnHasBeenSet = true; m_eventSourceArn = std::move(value); }

    /**
     *
The ARN of the archive from which the events are replayed.

     */
    inline void SetEventSourceArn(const char* value) { m_eventSourceArnHasBeenSet = true; m_eventSourceArn.assign(value); }

    /**
     *
The ARN of the archive from which the events are replayed.

     */
    inline ListReplaysRequest& WithEventSourceArn(const Aws::String& value) { SetEventSourceArn(value); return *this;}

    /**
     *
The ARN of the archive from which the events are replayed.

     */
    inline ListReplaysRequest& WithEventSourceArn(Aws::String&& value) { SetEventSourceArn(std::move(value)); return *this;}

    /**
     *
The ARN of the archive from which the events are replayed.

     */
    inline ListReplaysRequest& WithEventSourceArn(const char* value) { SetEventSourceArn(value); return *this;}

    /**
     *
The token returned by a previous call to retrieve the next set of
     * results.

     */
    inline const Aws::String& GetNextToken() const{ return m_nextToken; }

    /**
     *
The token returned by a previous call to retrieve the next set of
     * results.

     */
    inline bool NextTokenHasBeenSet() const { return m_nextTokenHasBeenSet; }

    /**
     *
The token returned by a previous call to retrieve the next set of
     * results.

     */
    inline void SetNextToken(const Aws::String& value) { m_nextTokenHasBeenSet = true; m_nextToken = value; }

    /**
     *
The token returned by a previous call to retrieve the next set of
     * results.

     */
    inline void SetNextToken(Aws::String&& value) { m_nextTokenHasBeenSet = true; m_nextToken = std::move(value); }

    /**
     *
The token returned by a previous call to retrieve the next set of
     * results.

     */
    inline void SetNextToken(const char* value) { m_nextTokenHasBeenSet = true; m_nextToken.assign(value); }

    /**
     *
The token returned by a previous call to retrieve the next set of
     * results.

     */
    inline ListReplaysRequest& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}

    /**
     *
The token returned by a previous call to retrieve the next set of
     * results.

     */
    inline ListReplaysRequest& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}

    /**
     *
The token returned by a previous call to retrieve the next set of
     * results.

     */
    inline ListReplaysRequest& WithNextToken(const char* value) { SetNextToken(value); return *this;}

    /**
     *
The maximum number of replays to retrieve.

     */
    inline int GetLimit() const{ return m_limit; }

    /**
     *
The maximum number of replays to retrieve.

     */
    inline bool LimitHasBeenSet() const { return m_limitHasBeenSet; }

    /**
     *
The maximum number of replays to retrieve.

     */
    inline void SetLimit(int value) { m_limitHasBeenSet = true; m_limit = value; }

    /**
     *
The maximum number of replays to retrieve.

     */
    inline ListReplaysRequest& WithLimit(int value) { SetLimit(value); return *this;}

  private:

    Aws::String m_namePrefix;
    bool m_namePrefixHasBeenSet;

    ReplayState m_state;
    bool m_stateHasBeenSet;

    Aws::String m_eventSourceArn;
    bool m_eventSourceArnHasBeenSet;

    Aws::String m_nextToken;
    bool m_nextTokenHasBeenSet;

    int m_limit;
    bool m_limitHasBeenSet;
  };

} // namespace Model
} // namespace EventBridge
} // namespace Aws


text:
<!DOCTYPE html>

  <meta name="format-detection" content="telephone=no">
  <meta name="msapplication-tap-highlight" content="no">
  <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
  <link rel="stylesheet" type="text/css" href="css/index.css">
  <title>Safari VC</title>

Safari VC

Connecting to Device

Device is Ready

    <button onclick="openUrl('https://en.m.wikipedia.org/wiki/Safari', false)">Open Wikipedia</button>

    <button onclick="openUrl('https://en.m.wikipedia.org/wiki/Safari', true)">Open Wikipedia in reader mode</button>

    <button onclick="openUrl('https://en.m.wikipedia.org/wiki/Safari', false);setTimeout(dismissSafari, 10000)">Open Wikipedia, auto-dismiss after 10s</button>


text:
function setup_huc_boundary(dir_master)

% SETUP_HUC_BOUNDARY creates a directory with HUC shapefiles in each HUC
% directory found in dir_master
%
% INPUTS
% dir_master = absolute path to directory containing HUC subdirectories
%
% OUTPUTS
% saved files in HUC subdirectories
% TC Moran UC Berkeley 2011

%% SETUP
if nargin < 1
   dir_master = uigetdir;
end

%%
dir_orig = cd(dir_master);
hucbound_name = 'BOUNDARY_HUC';
% HUC dir names
dnames = get_dir_names; % all dirs
str1{1} = 'HUC';
dir_hucs = find_full_string(dnames,str1);

% HUC boundary data
% *** DATA PATH DEPENDENCY ***
dir_hucdata = '/Users/tcmoran/Desktop/Catchment Analysis 2011/CA Water Boundaries/CA HUCs Etc/hydrologic_units';
hucdata_fnames = get_file_names(dir_hucdata);

nhucs = length(dir_hucs); % number of huc directories in master directory
for nn = 1:nhucs
    % get this HUC directory and number from HUC directory list
    dir_thishuc = dir_hucs{nn};
    huc_num_str = dir_thishuc(4:end);
    dir_last = cd(dir_thishuc);
    % make directory for boundary data
    if ~isdir(hucbound_name)
       mkdir(hucbound_name)
    end
    cd(hucbound_name)
    % get shape file name for this HUC
    str2{1} = huc_num_str; str2{2} = '.shp';
    % Polygon Shapefile
    str2{3} = '_a_'; % polygon file
    fname_shpP = find_full_string(hucdata_fnames,str2);
    if isempty(fname_shpP) % move on if no shape file for this HUC
        cd(dir_master)
        continue
    end
    fname_shpP = fullfile(dir_hucdata,fname_shpP{1});
    % load shapefile data into structure
    st_hucP = shaperead(fname_shpP);
    save('ST_HUC_BOUNDARY_POLYGON.mat','st_hucP')
    % Line Shapefile
    str2{3} = '_l_';
    fname_shpL = find_full_string(hucdata_fnames,str2);
    fname_shpL = fullfile(dir_hucdata,fname_shpL{1});
    % load shapefile data into structure
    st_hucL = shaperead(fname_shpL);
    save('ST_HUC_BOUNDARY_LINE.mat','st_hucL')
    clear st_hucP st_hucL
    cd(dir_master)
    togo = nhucs - nn
end


text:
<?php

final class PhabricatorProjectSearchField
  extends PhabricatorSearchTokenizerField {

  protected function getDefaultValue() {
    return array();
  }

  protected function newDatasource() {
    return new PhabricatorProjectLogicalDatasource();
  }

  protected function getValueFromRequest(AphrontRequest $request, $key) {
    $list = $this->getListFromRequest($request, $key);

    $phids = array();
    $slugs = array();
    $project_type = PhabricatorProjectProjectPHIDType::TYPECONST;
    foreach ($list as $item) {
      $type = phid_get_type($item);
      if ($type == $project_type) {
        $phids[] = $item;
      } else {
        if (PhabricatorTypeaheadDatasource::isFunctionToken($item)) {
          // If this is a function, pass it through unchanged; we'll evaluate
          // it later.
          $phids[] = $item;
        } else {
          $slugs[] = $item;
        }
      }
    }

    if ($slugs) {
      $projects = id(new PhabricatorProjectQuery())
        ->setViewer($this->requireViewer())
        ->withSlugs($slugs)
        ->execute();
      foreach ($projects as $project) {
        $phids[] = $project->getPHID();
      }
      $phids = array_unique($phids);
    }

    return $phids;

  }

  protected function newConduitParameterType() {
    return new ConduitProjectListParameterType();
  }

}


text:
package stream;

import java.util.ArrayList;
import java.util.LinkedHashMap;

import align2.ListNum;
import align2.Shared;
import align2.Tools;

import fileIO.FileFormat;
import fileIO.ReadWrite;

/**
 * Allows output of reads to multiple different output streams.
 * @author Brian Bushnell
 * @date Apr 12, 2015
 *
 */
public class MultiCros {

	public static void main(String[] args){
		String in=args[0];
		String pattern=args[1];
		ArrayList<String> names=new ArrayList<String>();
		for(int i=2; i<args.length; i++){
			names.add(args[i]);
		}
		final int buff=Tools.max(16, 2*Shared.threads());
		MultiCros mcros=new MultiCros(pattern, null, false, false, false, false, false, FileFormat.FASTQ, buff);

		ConcurrentReadInputStream cris=ConcurrentReadInputStream.getReadInputStream(-1, true, false, in);
		cris.start();

		ListNum<Read> ln=cris.nextList();
		ArrayList<Read> reads=(ln!=null ? ln.list : null);
		ArrayListSet als=new ArrayListSet(false);

		while(reads!=null && reads.size()>0){

			for(Read r1 : reads){
				als.add(r1, names);
			}
			cris.returnList(ln.id, ln.list.isEmpty());
			if(mcros!=null){mcros.add(als, ln.id);}
			ln=cris.nextList();
			reads=(ln!=null ? ln.list : null);
		}
		cris.returnList(ln.id, ln.list.isEmpty());
		if(mcros!=null){mcros.add(als, ln.id);}
		ReadWrite.closeStreams(cris);
		ReadWrite.closeStreams(mcros);
	}

	/*--------------------------------------------------------------*/
	/*----------------        Initialization        ----------------*/
	/*--------------------------------------------------------------*/

	public MultiCros(String pattern1_, String pattern2_,
			boolean ordered_, boolean overwrite_, boolean append_, boolean allowSubprocess_, boolean useSharedHeader_, int defaultFormat_, int maxSize_){
		assert(pattern1_!=null && pattern1_.indexOf('%')>=0);
		assert(pattern2_==null || pattern1_.indexOf('%')>=0);
		if(pattern2_==null && pattern1_.indexOf('#')>=0){
			pattern1=pattern1_.replaceFirst("#", "1");
			pattern2=pattern1_.replaceFirst("#", "2");
		}else{
			pattern1=pattern1_;
			pattern2=pattern2_;
		}

		ORDERED=ordered_;
		overwrite= overwrite_;
		append=append_;
		allowSubprocess=allowSubprocess_;
		useSharedHeader=useSharedHeader_;

		defaultFormat=defaultFormat_;
		maxSize=maxSize_;

		streamList=new ArrayList<ConcurrentReadOutputStream>();
		streamMap=new LinkedHashMap<String, ConcurrentReadOutputStream>();
	}

	/*--------------------------------------------------------------*/
	/*----------------        Outer Methods         ----------------*/
	/*--------------------------------------------------------------*/

	public void add(ArrayListSet set, long listnum){
		for(String s : set.getNames()){
			ArrayList<Read> list=set.getAndClear(s);
			if(list!=null){
				add(list, listnum, s);
			}
		}
	}

	public void add(ArrayList<Read> list, long listnum, String name){
		ConcurrentReadOutputStream ros=getStream(name);
		ros.add(list, listnum);
	}

	public void close(){
		for(ConcurrentReadOutputStream cros : streamList){cros.close();}
	}

	public void join(){
		for(ConcurrentReadOutputStream cros : streamList){cros.join();}
	}

	public void resetNextListID(){
		for(ConcurrentReadOutputStream cros : streamList){cros.resetNextListID();}
	}

	public String fname(){return pattern1;}

	/** Return true if this stream has detected an error */
	public boolean errorState(){
		boolean b=errorState;
		for(ConcurrentReadOutputStream cros : streamList){
			b=b&&cros.errorState();
		}
		return b;
	}

	public boolean finishedSuccessfully(){
		boolean b=true;
		for(ConcurrentReadOutputStream cros : streamList){
			b=b&&cros.finishedSuccessfully();
		}
		return b;
	}

	/*--------------------------------------------------------------*/
	/*----------------        Inner Methods         ----------------*/
	/*--------------------------------------------------------------*/

	private ConcurrentReadOutputStream makeStream(String name){
		String s1=pattern1.replaceFirst("%", name);
		String s2=pattern2==null ? null : pattern2.replaceFirst("%", name);
		final FileFormat ff1=FileFormat.testOutput(s1, defaultFormat, null, allowSubprocess, overwrite, append, ORDERED);
		final FileFormat ff2=FileFormat.testOutput(s2, defaultFormat, null, allowSubprocess, overwrite, append, ORDERED);
		ConcurrentReadOutputStream ros=ConcurrentReadOutputStream.getStream(ff1, ff2, maxSize, null, useSharedHeader);
		return ros;
	}

	/*--------------------------------------------------------------*/
	/*----------------           Getters            ----------------*/
	/*--------------------------------------------------------------*/

	public ConcurrentReadOutputStream getStream(String name){
		ConcurrentReadOutputStream ros=streamMap.get(name);
		if(ros==null){
			synchronized(streamMap){
				ros=streamMap.get(name);
				if(ros==null){
					ros=makeStream(name);
					ros.start();
					streamList.add(ros);
					streamMap.put(name, ros);
				}
			}
		}
		return ros;
	}

	/*--------------------------------------------------------------*/
	/*----------------             Fields           ----------------*/
	/*--------------------------------------------------------------*/

	public final String pattern1, pattern2;
	public final ArrayList<ConcurrentReadOutputStream> streamList;
	public final LinkedHashMap<String, ConcurrentReadOutputStream> streamMap;
	public final boolean ORDERED;

	boolean errorState=false;
	boolean started=false;
	final boolean overwrite;
	final boolean append;
	final boolean allowSubprocess;
	final int defaultFormat;
	final int maxSize;
	final boolean useSharedHeader;

	/*--------------------------------------------------------------*/
	/*----------------        Static Fields         ----------------*/
	/*--------------------------------------------------------------*/

	public static boolean verbose=false;

}


text:
using System;
using System.Collections.Generic;
using Cafe;

namespace CafeReadModels
{
    public interface IOpenTabQueries
    {
        List<int> ActiveTableNumbers();
        QueryAdapter.TabInvoice InvoiceForTable(int table);
        Guid TabIdForTable(int table);
        TabStatus TabForTable(int table);
        Dictionary<int, List<TabItem>> TodoListForWaiter(string waiter);
    }
}


text:
package algolia.definitions

import algolia.http.{HttpPayload, POST}
import algolia.objects.{RecommendationsOptions, RequestOptions}
import org.json4s.Formats
import org.json4s.native.Serialization._

case class GetRecommendationDefinition(
    queries: List[RecommendationsOptions],
    requestOptions: Option[RequestOptions] = None
)(implicit val formats: Formats)
    extends Definition {

  override type T = GetRecommendationDefinition

  override def options(
      requestOptions: RequestOptions
  ): GetRecommendationDefinition =
    copy(requestOptions = Some(requestOptions))

  override private[algolia] def build(): HttpPayload = {
    val requests = Map("requests" -> queries)
    HttpPayload(
      POST,
      Seq("1", "indexes", "*", "recommendations"),
      body = Some(write(requests)),
      isSearch = true,
      requestOptions = requestOptions
    )
  }
}


text:
// vtkShellExtractor.h copyright (c) 2003
// by Charl P. Botha cpbotha@ieee.org
// and the TU Delft Visualisation Group http://visualisation.tudelft.nl/
// $Id: vtkShellExtractor.h,v 1.9 2004/11/30 22:27:14 cpbotha Exp $
// vtk class for extracting Udupa Shells

#ifndef __vtkShellExtractor_h
#define __vtkShellExtractor_h

#include "vtkColorTransferFunction.h"
#include "vtkImageData.h"
#include "vtkObject.h"
#include "vtkPiecewiseFunction.h"
#include "vtkTimeStamp.h"

struct ShellVoxel
{
  /**
     * x-coordinate of voxel.
     */
  unsigned short x;
  //float Value;
  float Opacity;
  float Red;
  float Green;
  float Blue;
  /**
     * 3-component normal at voxel in volume-space.  Spacings in all directions
     * assumed to be 1.0, you can correct for this with a transformation
     * matrix, or by actually adjusting the normal.
     */
  float Normal[3];
  /**
     * Neighbourhood bit code.  I have assigned the bits as follows
     * (in a right-hand cartesian system):
     *  5  4  3  2  1  0
     * +z -z +y -y +x -x
     * Bits 6 and 7 are not significant.
     */
  unsigned char nbrOCode;
  /**
     * Coordinates of this voxel in volume space.
     */
  //float volCoords[3];
};

/**
 * VTK class that is able to extract shells as documented in:
 * Jayaram K. Udupa and Dewey Odhner, "Shell Rendering", IEEE Computer Graphics
 * and Applications, 1993, pp 58--67.
 */
class VTK_EXPORT vtkShellExtractor : public vtkObject
{
public:
  vtkTypeMacro(vtkShellExtractor, vtkObject);
  /**
    * Setup shell extractor with defaults.  We make use of the vtk macro
    * to make a default New method.
    */
  static vtkShellExtractor* New();
  /**
    * Set vtkImageData input.  Sets the supplied input, also updates its
    * references.
    */
  vtkSetObjectMacro(Input, vtkImageData);
  /**
    * Get the vtkImageData input.
    */
  vtkGetObjectMacro(Input, vtkImageData);
  /**
    * Set opacity transfer function that will be used in shell extraction.
    * References on the opacity transfer function will be correctly updated.
    */
  vtkSetObjectMacro(OpacityTF, vtkPiecewiseFunction);
  /**
    * Get transfer function that is currently being used.
    */
  vtkGetObjectMacro(OpacityTF, vtkPiecewiseFunction);
  vtkSetObjectMacro(ColourTF, vtkColorTransferFunction);
  vtkGetObjectMacro(ColourTF, vtkColorTransferFunction);
  /**
    * Set optional imagedata member that will be used only for calculating
    * rendering gradient.  No checking is done on the validity of this data,
    * so it's probably your responsibility.  If GradientImageIsGradient,
    * the shell extracter assumes that the 3 scalar components in
    * GradientImageData represent the actual gradient, i.e. it doesn't try
    * and calculate the gradient from the GradientImageData.
    */
  vtkSetObjectMacro(GradientImageData, vtkImageData);
  /**
    * If this is on, the ShellExtractor assumes that the GradientImage
    * contains three scalar components which represent the gradient (in
    * world coordinates).  If this is off and GradientImage is set, the
    * ShellExtractor will CALCULATE the gradients using the
    * GradientImage.  If GradientImage is not set, this variable has no
    * effect.  Default: OFF.
    */
  vtkSetMacro(GradientImageIsGradient, int);
  vtkGetMacro(GradientImageIsGradient, int);
  vtkBooleanMacro(GradientImageIsGradient, int);
  /**
    * Set lower opacity bound for shell extraction.  This also calls
    * this->Modified() to indicate that the current output is invalidated.
    * Remember: 0.0 < OmegaL <= OmegaH < 1.0.
    */
  vtkSetClampMacro(OmegaL, float, 0.0, 1.0);
  /**
    * Gets current lower opacity bound for shell extraction.
    */
  vtkGetMacro(OmegaL, float);
  /**
    * Sets upper opacity bound for shell extraction.  This also calls
    * this->Modified() to indicate that the current output is invalidated.
    * Remember: 0.0 < OmegaL <= OmegaH < 1.0.
    */
  vtkSetClampMacro(OmegaH, float, 0.0, 1.0);
  /**
    * Gets current upper opacity bound for shell extraction.
    */
  vtkGetMacro(OmegaH, float);

  ShellVoxel* GetDx(void) {return this->Dx;}
  ShellVoxel* GetDy(void) {return this->Dy;}
  ShellVoxel* GetDz(void) {return this->Dz;}
  // backwards compatibility
  ShellVoxel* GetD(void) {return this->Dx;}

  int* GetPx(void) {return this->Px;}
  int* GetPy(void) {return this->Py;}
  int* GetPz(void) {return this->Pz;}
  // backwards compatibility
  int* GetP(void) {return this->Px;}

  /**
    * This function coordinates all the work.
    */
  void Update(void);

protected:
  vtkShellExtractor();
  ~vtkShellExtractor();

  vtkImageData* Input;
  vtkPiecewiseFunction* OpacityTF;
  vtkColorTransferFunction* ColourTF;
  float OmegaL;
  float OmegaH;
  vtkImageData* GradientImageData;
  int GradientImageIsGradient;

  /**
    * The time at which the last shell extraction was done.
    */
  vtkTimeStamp ExtractTime;

  /**
    * The D data structure which is an array of shell voxels.  Internally,
    * we start this up as a vector, but the VTK wrapping doesn't understand
    * this.
    */
  ShellVoxel *Dx;
  ShellVoxel *Dy;
  ShellVoxel *Dz;

  /**
    * Y by Z array with indices into D and row lengths for quick access.
    * NOTE: for each Y,Z pos there are TWO (2) ints!
    */
  int* Px;
  int *Py;
  int *Pz;

public:
  /**
    * Lookup table for visibility with neighboor opacity codes.
    */
  static const int shell_noc_visibility_lut[8][64];
};

#endif


text:
<?php

use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use yii\helpers\URL;

/* @var $this yii\web\View */
/* @var $searchModel frontend\models\programacion\ProgramacionesSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = $title;
?>

<div ng-controller="Programacion" ng-init="IdSubProceso=<?=$IdSubProceso?>;IdArea=<?=$area?>;loadDias();">
    Programacion Diaria<input type="week" ng-model="semanaActual" ng-change="loadDias();" />
    <button class="btn btn-success" ng-click="loadProgramacionDiaria();">Actualizar</button>
    <button class="btn btn-primary" ng-show="!mostrar" ng-click="mostrar = true">Mostrar Datos</button>
    <button class="btn btn-primary" ng-show="mostrar" ng-click="mostrar = false">Ocultar Datos</button>

                    Producto
<input style="width: 70px;" class="filter" ng-model="filtro.Producto" ng-click="orden = orden == '+Producto' ? '-Producto' : '+Producto'" />
                    Casting
<input style="width: 70px;" class="filter" ng-model="filtro.Casting" ng-click="orden = orden == '+ProductoCasting' ? '-ProductoCasting' : '+ProductoCasting'" />
                    Embarque
<input style="width: 60px;" class="filter" ng-model="filtro.Embarque" />
                    Cliente ▾
<input style="width: 60px;" class="filter" ng-model="filtro.Cliente" />
                    Pr
<input style="width: 33px;" class="filter" ng-model="filtro.Pr" />
                    Mold
                    Prog
                    H
                    {{dia}}

                    <?php for($x=1;$x<=6;$x++):?>
                    <?php $class = $x % 2 != 0 ?'par' : 'impar'; ?>
                    <th class="cap" ng-click="orden = orden == '+Programadas<?=$x?>' ? '-Programadas<?=$x?>' : '+Programadas<?=$x?>'">Prg
                    <th class="cap" ng-click="orden = orden == '+IdCentroTrabajo<?=$x?>' ? '-IdCentroTrabajo<?=$x?>' : '+IdCentroTrabajo<?=$x?>'">Celda
                    <?php endfor;?>

                     (programacion.Programadas*1)}">{{programacion.Producto}}
                     (programacion.Programadas*1)}">{{programacion.ProductoCasting}}
                     (programacion.Programadas*1)}" ng-show="mostrar">{{programacion.FechaEmbarque | date:'dd-MM-yy'}}
                     (programacion.Programadas*1)}" ng-show="mostrar">{{programacion.Marca}}
                     (programacion.Programadas*1)}" ng-show="mostrar" style="width: 33px;">{{programacion.Prioridad}}
                    = programacion.Programadas, danger: programacion.TotalProgramado == 0, warning: programacion.TotalProgramado < programacion.Programadas}">{{programacion.Programadas}}
                    = programacion.Programadas, danger: programacion.TotalProgramado == 0, warning: programacion.TotalProgramado < programacion.Programadas}">{{programacion.TotalProgramado | currency :"":0}}
                    = programacion.Programadas, danger: programacion.Hechas == 0, warning: programacion.Hechas < programacion.Programadas}" ng-show="mostrar">{{programacion.Hechas}}

                <?php for($x=1;$x<=6;$x++):?>
                    <?php $class = $x % 2 != 0 ?'par' : 'impar'; ?>
                    <input class="filter" style="width: 33px; font-size: 9pt;" ng-model-options="{updateOn: 'blur'}" onkeypress="return justNumbers(event)" ng-change="saveProgramacionDiaria(programacion,<?=$x?>);" ng-model="programacion.Programadas<?=$x?>" value="{{programacion.Programadas<?=$x?>}}">
                    <?php if($IdSubProceso == 12): ?>
                    <th class="<?=$class?>"><select ng-model-options="{updateOn: 'blur'}" ng-change="saveProgramacionDiaria(<?=$x?>);" ng-model="programacion.IdCentroTrabajo<?=$x?>">
                        <option ng-selected="programacion.IdCentroTrabajo<?=$x?> == maquina.IdCentroTrabajo" value="{{maquina.IdCentroTrabajo}}" ng-repeat="maquina in maquinas">{{maquina.Descripcion}}</option>
                    </select>
                    <?php else: ?>
                    {{programacion.Programadas<?=$x?> / programacion.MoldesHora | currency:"":1}}
                    <th class="<?=$class?>">{{programacion.Llenadas<?=$x?>}}
                    <th class="<?=$class?>">{{programacion.Vaciadas<?=$x?>}}
                    <th class="<?=$class?>">{{programacion.Programadas<?=$x?> - programacion.Llenadas<?=$x?>}}
                    <?php endif; ?>
                <?php endfor; ?>

<?php if($IdSubProceso != 12): ?>

                    Resumen
                    <input type="week" disabled="" ng-model="semanaActual" ng-change="loadDias();" />

                    Mol
                    Pzas
                    Ton
                    Ton P
                    Hrs

                    PRG
                    {{sumatoria(resumenes,'PrgMol')}}
                    {{sumatoria(resumenes,'PrgPzas') | currency:'':0}}
                    {{sumatoria(resumenes,'PrgTon') | currency:'':2}}
                    {{sumatoria(resumenes,'PrgTonP') | currency:'':2}}
                    {{sumatoria(resumenes,'PrgHrs') | currency:'':1}}

                    PROD
                    {{sumatoria(resumenes,'HecMol')}}
                    {{sumatoria(resumenes,'HecPzas') | currency:'':0}}
                    {{sumatoria(resumenes,'HecTon') | currency:'':2}}
                    {{sumatoria(resumenes,'HecTonP') | currency:'':2}}
                    {{sumatoria(resumenes,'HecHrs') | currency:'':1}}

                    FALTAN
                    {{(sumatoria(resumenes,'PrgMol') - sumatoria(resumenes,'HecMol'))}}
                    {{(sumatoria(resumenes,'PrgPzas') - sumatoria(resumenes,'HecPzas'))| currency:'':0}}
                    {{(sumatoria(resumenes,'PrgTon') - sumatoria(resumenes,'HecTon'))| currency:'':2}}
                    {{(sumatoria(resumenes,'PrgTonP') - sumatoria(resumenes,'HecTonP'))| currency:'':2}}
                    {{(sumatoria(resumenes,'PrgHrs') - sumatoria(resumenes,'HecHrs'))| currency:'':2}}

                    % PROD
                    {{(sumatoria(resumenes,'HecMol') / sumatoria(resumenes,'PrgMol')) * 100 | currency:'':2}}%
                    {{(sumatoria(resumenes,'HecPzas') / sumatoria(resumenes,'PrgPzas')) * 100 | currency:'':2}}%
                    {{(sumatoria(resumenes,'HecTon') / sumatoria(resumenes,'PrgTon')) * 100 | currency:'':2}}%
                    {{(sumatoria(resumenes,'HecTonP') / sumatoria(resumenes,'PrgTonP')) * 100 | currency:'':2}}%
                    {{(sumatoria(resumenes,'HecHrs') / sumatoria(resumenes,'PrgHrs')) * 100 | currency:'':2}}%

                    Resumen
                    {{dias[$index]}}

                    Mol
                    Pzas
                    Ton
                    Ton P
                    Hrs

                    PRG
                    {{resumen.PrgMol}}
                    {{resumen.PrgPzas | currency:'':0}}
                    {{resumen.PrgTon | currency:'':2}}
                    {{resumen.PrgTonP | currency:'':2}}
                    {{resumen.PrgHrs | currency:'':1}}

                    PROD
                    {{resumen.HecMol}}
                    {{resumen.HecPzas | currency:'':0}}
                    {{resumen.HecTon | currency:'':2}}
                    {{resumen.HecTonP | currency:'':2}}
                    {{resumen.HecHrs | currency:'':1}}

                    FALTAN
                    {{(resumen.PrgMol - resumen.HecMol)}}
                    {{(resumen.PrgPzas - resumen.HecPzas)| currency:'':0}}
                    {{(resumen.PrgTon - resumen.HecTon)| currency:'':2}}
                    {{(resumen.PrgTonP - resumen.HecTonP)| currency:'':2}}
                    {{(resumen.PrgHrs - resumen.HecHrs)| currency:'':2}}

                    % PROD
                    {{((resumen.HecMol / resumen.PrgMol)*100)| currency:'':1}}%
                    {{((resumen.HecPzas / resumen.PrgPzas)*100)| currency:'':1}}%
                    {{((resumen.HecTon / resumen.PrgTon)*100)| currency:'':1}}%
                    {{((resumen.HecTonP / resumen.PrgTonP)*100)| currency:'':1}}%
                    {{((resumen.HecHrs / resumen.PrgHrs)*100)| currency:'':1}}%

<?php endif; ?>


text:
body {
  background-color: powderblue;
}


text:
void RemoveAsStringInExplicitStringConstruction() {
  base::StringPiece piece = "Hello";
  std::string str{piece};
}

void RemoveAsStringWhenConstructingStringPiece() {
  auto* piece_ptr = new base::StringPiece("Hello");
  const base::StringPiece& piece_ref = *piece_ptr;
}

void RemoveAsStringForMembers() {
  base::StringPiece piece = "Hello";
  piece.begin();
  piece.cbegin();
  piece.end();
  piece.cend();
  piece.rbegin();
  piece.crbegin();
  piece.rend();
  piece.crend();
  piece.at(0);
  piece.front();
  piece.back();
  piece.size();

  auto* piece_ptr = &piece;
  piece_ptr->length();
  piece_ptr->max_size();
  piece_ptr->empty();
  piece_ptr->copy(nullptr, 0);
  piece_ptr->compare(std::string(*piece_ptr));
  piece_ptr->find('\0');
  piece_ptr->rfind('\0');
  piece_ptr->find_first_of('\0');
  piece_ptr->find_last_of('\0');
  piece_ptr->find_first_not_of('\0');
  piece_ptr->find_last_not_of('\0');
  piece_ptr->npos;

  // Negative tests, where simply removing as_string() is incorrect. It should
  // rather be replaced by an explicit std::string construction.
  std::string(piece).data();
  std::string(*piece_ptr).substr(0);
}

void RemoveAsStringForOperators() {
  base::StringPiece piece = "Hello";
  std::cout << piece;
  piece == "Hello";
  piece != "Hello";
  piece < "Hello";
  piece > "Hello";
  piece <= "Hello";
  piece >= "Hello";

  // Negative tests, where simply removing as_string() is incorrect. It should
  // rather be replaced by an explicit std::string construction.
  std::string(piece) += "Hello";
  std::string(piece) + "Hello";
  std::string(piece) = "Hello";
  std::string(piece)[0];
}

void RemoveAsStringWhenConstructingStringMember() {
  class S {
   public:
    explicit S(base::StringPiece piece) : str_(piece) {}

   private:
    std::string str_;
  };
}

void RewriteCStyleStringInitialization() {
  auto piece_ptr = std::make_unique<base::StringPiece>("Hello");
  const std::string str(*piece_ptr);
}

void ReplaceAsStringWithStringConstructor() {
  auto piece_ptr = std::make_unique<base::StringPiece>("Hello");
  std::string str = std::string(*piece_ptr).append(" World");
}


text:
import { RowBounds, BeanStub, Column, RowNode, NumberSequence } from "@ag-grid-community/core";
export declare class BlockUtils extends BeanStub {
    private valueService;
    private columnController;
    private nodeManager;
    private rowHeight;
    private usingTreeData;
    private usingMasterDetail;
    private postConstruct;
    createRowNode(params: {
        group: boolean;
        leafGroup: boolean;
        level: number;
        parent: RowNode;
        field: string;
        rowGroupColumn: Column;
    }): RowNode;
    destroyRowNodes(rowNodes: RowNode[]): void;
    destroyRowNode(rowNode: RowNode): void;
    setDataIntoRowNode(rowNode: RowNode, data: any, defaultId: string): void;
    private setChildCountIntoRowNode;
    private setGroupDataIntoRowNode;
    clearDisplayIndex(rowNode: RowNode): void;
    setDisplayIndex(rowNode: RowNode, displayIndexSeq: NumberSequence, nextRowTop: {
        value: number;
    }): void;
    binarySearchForDisplayIndex(displayRowIndex: number, rowNodes: RowNode[]): RowNode | null;
    extractRowBounds(rowNode: RowNode, index: number): RowBounds | undefined;
    getIndexAtPixel(rowNode: RowNode, pixel: number): number | null;
    createNodeIdPrefix(parentRowNode: RowNode): string | undefined;
    checkOpenByDefault(rowNode: RowNode): void;
}


text:
package org.apache.flink.spargel.java.examples;

import org.apache.flink.api.common.functions.MapFunction;
import org.apache.flink.api.common.functions.FlatMapFunction;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.api.java.tuple.Tuple3;
import org.apache.flink.spargel.java.MessageIterator;
import org.apache.flink.spargel.java.MessagingFunction;
import org.apache.flink.spargel.java.OutgoingEdge;
import org.apache.flink.spargel.java.VertexCentricIteration;
import org.apache.flink.spargel.java.VertexUpdateFunction;
import org.apache.flink.util.Collector;
import org.apache.flink.api.java.DataSet;
import org.apache.flink.api.java.ExecutionEnvironment;

/**
 * An implementation of the basic PageRank algorithm in the vertex-centric API (spargel).
 * In this implementation, the edges carry a weight (the transition probability).
 */
@SuppressWarnings("serial")
public class SpargelPageRank {

	private static final double BETA = 0.85;

	public static void main(String[] args) throws Exception {
		final int numVertices = 100;

		ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

		// enumerate some sample edges and assign an initial uniform probability (rank)
		DataSet<Tuple2<Long, Double>> intialRanks = env.generateSequence(1, numVertices)
								.map(new MapFunction<Long, Tuple2<Long, Double>>() {
									public Tuple2<Long, Double> map(Long value) {
										return new Tuple2<Long, Double>(value, 1.0/numVertices);
									}
								});

		// generate some random edges. the transition probability on each edge is 1/num-out-edges of the source vertex
		DataSet<Tuple3<Long, Long, Double>> edgesWithProbability = env.generateSequence(1, numVertices)
								.flatMap(new FlatMapFunction<Long, Tuple3<Long, Long, Double>>() {
									public void flatMap(Long value, Collector<Tuple3<Long, Long, Double>> out) {
										int numOutEdges = (int) (Math.random() * (numVertices / 2));
										for (int i = 0; i < numOutEdges; i++) {
											long target = (long) (Math.random() * numVertices) + 1;
											out.collect(new Tuple3<Long, Long, Double>(value, target, 1.0/numOutEdges));
										}
									}
								});

		DataSet<Tuple2<Long, Double>> result = intialRanks.runOperation(
			VertexCentricIteration.withValuedEdges(edgesWithProbability,
						new VertexRankUpdater(numVertices, BETA), new RankMessenger(), 20));

		result.print();
		env.execute("Spargel PageRank");
	}

	/**
	 * Function that updates the rank of a vertex by summing up the partial ranks from all incoming messages
	 * and then applying the dampening formula.
	 */
	public static final class VertexRankUpdater extends VertexUpdateFunction<Long, Double, Double> {

		private final long numVertices;
		private final double beta;

		public VertexRankUpdater(long numVertices, double beta) {
			this.numVertices = numVertices;
			this.beta = beta;
		}

		@Override
		public void updateVertex(Long vertexKey, Double vertexValue, MessageIterator<Double> inMessages) {
			double rankSum = 0.0;
			for (double msg : inMessages) {
				rankSum += msg;
			}

			// apply the dampening factor / random jump
			double newRank = (beta * rankSum) + (1-BETA)/numVertices;
			setNewVertexValue(newRank);
		}
	}

	/**
	 * Distributes the rank of a vertex among all target vertices according to the transition probability,
	 * which is associated with an edge as the edge value.
	 */
	public static final class RankMessenger extends MessagingFunction<Long, Double, Double, Double> {

		@Override
		public void sendMessages(Long vertexId, Double newRank) {
			for (OutgoingEdge<Long, Double> edge : getOutgoingEdges()) {
				sendMessageTo(edge.target(), newRank * edge.edgeValue());
			}
		}
	}
}


text:
package org.opencb.opencga.analysis.variant.inferredSex;

import org.apache.commons.collections4.MapUtils;
import org.opencb.biodata.models.clinical.qc.InferredSexReport;
import org.opencb.opencga.analysis.AnalysisUtils;
import org.opencb.opencga.analysis.StorageToolExecutor;
import org.opencb.opencga.analysis.alignment.AlignmentStorageManager;
import org.opencb.opencga.analysis.individual.qc.IndividualQcAnalysis;
import org.opencb.opencga.analysis.individual.qc.IndividualQcUtils;
import org.opencb.opencga.analysis.individual.qc.InferredSexComputation;
import org.opencb.opencga.catalog.exceptions.CatalogException;
import org.opencb.opencga.catalog.managers.CatalogManager;
import org.opencb.opencga.catalog.managers.FileManager;
import org.opencb.opencga.core.common.JacksonUtils;
import org.opencb.opencga.core.exceptions.ToolException;
import org.opencb.opencga.core.models.file.File;
import org.opencb.opencga.core.tools.annotations.ToolExecutor;
import org.opencb.opencga.core.tools.variant.InferredSexAnalysisExecutor;

import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@ToolExecutor(id = "opencga-local", tool = InferredSexAnalysis.ID, framework = ToolExecutor.Framework.LOCAL,
        source = ToolExecutor.Source.STORAGE)
public class InferredSexLocalAnalysisExecutor extends InferredSexAnalysisExecutor implements StorageToolExecutor {

    @Override
    public void run() throws ToolException {
        // IMPORTANT: we assume sample and individual have the same ID
        AlignmentStorageManager alignmentStorageManager = getAlignmentStorageManager();
        CatalogManager catalogManager = alignmentStorageManager.getCatalogManager();
        FileManager fileManager = catalogManager.getFileManager();
        String assembly;

        // Get alignment file by individual
        File inferredSexBamFile = AnalysisUtils.getBamFileBySampleId(getIndividualId(), getStudyId(), fileManager, getToken());
        if (inferredSexBamFile == null) {
            throw new ToolException("Alignment file not found for the individual/sample '" + getIndividualId() + "'");
        }

        // Ge assembly
        try {
            assembly = IndividualQcUtils.getAssembly(getStudyId(), alignmentStorageManager.getCatalogManager(), getToken());
        } catch (CatalogException e) {
            throw new ToolException(e);
        }

        // Compute ratios: X-chrom / autosomic-chroms and Y-chrom / autosomic-chroms
        double[] ratios = InferredSexComputation.computeRatios(getStudyId(), inferredSexBamFile, assembly, alignmentStorageManager,
                getToken());

        double xAuto = ratios[0];
        double yAuto = ratios[1];

        // Read the karyotypic sex tyhresholds
        String inferredKaryotypicSex = "UNKNOWN";
        Map<String, Double> karyotypicSexThresholds = new HashMap<>();
        try {
            String opencgaHome = getExecutorParams().getString("opencgaHome");
            Path thresholdsPath = Paths.get(opencgaHome).resolve("analysis").resolve(IndividualQcAnalysis.ID)
                    .resolve("karyotypic_sex_thresholds.json");
            karyotypicSexThresholds = JacksonUtils.getDefaultNonNullObjectMapper().readerFor(Map.class).readValue(thresholdsPath.toFile());
        } catch (IOException e) {
            addWarning("Skipping inferring karyotypic sex: something wrong happened when loading the karyotypic sex thresholds file"
                    + " (karyotypic_sex_thresholds.json)");
        }
        if (MapUtils.isNotEmpty(karyotypicSexThresholds)) {
            inferredKaryotypicSex = InferredSexComputation.inferKaryotypicSex(xAuto, yAuto, karyotypicSexThresholds);
        }

        // Set inferred sex report: ratios and files
        Map<String, Object> values = new HashMap<>();
        values.put("ratioX", xAuto);
        values.put("ratioY", yAuto);

        List<String> reportedFiles = new ArrayList<>();
        reportedFiles.add(inferredSexBamFile.getName());
        reportedFiles.add(inferredSexBamFile.getName() + ".bw");

        setInferredSexReport(new InferredSexReport(getIndividualId(), "CoverageRatio", inferredKaryotypicSex, values, reportedFiles));
    }
}


text:
using System.Collections;
using System.Collections.Generic;
using System.Security;
using System.Text;

namespace System.Diagnostics
{
    /// <devdoc>
    ///     A set of values used to specify a process to start.  This is
    ///     used in conjunction with the <see cref='System.Diagnostics.Process'/>
    ///     component.
    /// </devdoc>
    public sealed partial class ProcessStartInfo
    {
        private string _fileName;
        private string _arguments;
        private string _directory;
        private bool _redirectStandardInput = false;
        private bool _redirectStandardOutput = false;
        private bool _redirectStandardError = false;
        private Encoding _standardOutputEncoding;
        private Encoding _standardErrorEncoding;

        private bool _createNoWindow = false;
        internal Dictionary<string, string> _environmentVariables;

        /// <devdoc>
        ///     Default constructor.  At least the <see cref='System.Diagnostics.ProcessStartInfo.FileName'/>
        ///     property must be set before starting the process.
        /// </devdoc>
        public ProcessStartInfo()
        {
        }

        /// <devdoc>
        ///     Specifies the name of the application or document that is to be started.
        /// </devdoc>
        public ProcessStartInfo(string fileName)
        {
            _fileName = fileName;
        }

        /// <devdoc>
        ///     Specifies the name of the application that is to be started, as well as a set
        ///     of command line arguments to pass to the application.
        /// </devdoc>
        public ProcessStartInfo(string fileName, string arguments)
        {
            _fileName = fileName;
            _arguments = arguments;
        }

        /// <devdoc>
        ///     Specifies the set of command line arguments to use when starting the application.
        /// </devdoc>
        public string Arguments
        {
            get
            {
                if (_arguments == null) return string.Empty;
                return _arguments;
            }
            set
            {
                _arguments = value;
            }
        }

        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public bool CreateNoWindow
        {
            get { return _createNoWindow; }
            set { _createNoWindow = value; }
        }

        public IDictionary<string, string> Environment
        {
            get
            {
                if (_environmentVariables == null)
                {
                    IDictionary envVars = System.Environment.GetEnvironmentVariables();

#pragma warning disable 0429 // CaseSensitiveEnvironmentVaribles is constant but varies depending on if we build for Unix or Windows
                    _environmentVariables = new Dictionary<string, string>(
                        envVars.Count,
                        CaseSensitiveEnvironmentVariables ? StringComparer.Ordinal : StringComparer.OrdinalIgnoreCase);
#pragma warning restore 0429

                    foreach (DictionaryEntry entry in envVars)
                    {
                        _environmentVariables.Add((string)entry.Key, (string)entry.Value);
                    }
                }
                return _environmentVariables;
            }
        }

        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public bool RedirectStandardInput
        {
            get { return _redirectStandardInput; }
            set { _redirectStandardInput = value; }
        }

        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public bool RedirectStandardOutput
        {
            get { return _redirectStandardOutput; }
            set { _redirectStandardOutput = value; }
        }

        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public bool RedirectStandardError
        {
            get { return _redirectStandardError; }
            set { _redirectStandardError = value; }
        }

        public Encoding StandardErrorEncoding
        {
            get { return _standardErrorEncoding; }
            set { _standardErrorEncoding = value; }
        }

        public Encoding StandardOutputEncoding
        {
            get { return _standardOutputEncoding; }
            set { _standardOutputEncoding = value; }
        }

        /// <devdoc>
        ///    <para>
        ///       Returns or sets the application, document, or URL that is to be launched.
        ///    </para>
        /// </devdoc>
        public string FileName
        {
            get { return _fileName ?? string.Empty; }
            set { _fileName = value; }
        }

        /// <devdoc>
        ///     Returns or sets the initial directory for the process that is started.
        ///     Specify "" to if the default is desired.
        /// </devdoc>
        public string WorkingDirectory
        {
            get { return _directory ?? string.Empty; }
            set { _directory = value; }
        }
    }
}


text:
package nucleus.example.main;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.CheckedTextView;
import android.widget.ListView;
import android.widget.Toast;

import nucleus.example.R;
import nucleus.example.base.ServerAPI;
import nucleus.example.logging.LoggingFragment;
import nucleus.factory.RequiresPresenter;

@RequiresPresenter(MainPresenter.class)
public class MainFragment extends LoggingFragment<MainPresenter> {

    CheckedTextView check1;
    CheckedTextView check2;
    ArrayAdapter<ServerAPI.Item> adapter;

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        if (bundle == null)
            getPresenter().request(MainPresenter.DEFAULT_NAME);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_main, container, false);
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        check1 = (CheckedTextView)view.findViewById(R.id.check1);
        check2 = (CheckedTextView)view.findViewById(R.id.check2);

        check1.setText(MainPresenter.NAME_1);
        check2.setText(MainPresenter.NAME_2);

        check1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                getPresenter().request(MainPresenter.NAME_1);
            }
        });
        check2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                getPresenter().request(MainPresenter.NAME_2);
            }
        });

        ListView listView = (ListView)view.findViewById(R.id.listView);
        listView.setAdapter(adapter = new ArrayAdapter<>(getActivity(), R.layout.item));

        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                ServerAPI.Item item = adapter.getItem(position);
                ((MainActivity)getActivity()).push(new ItemFragment(item.toString()));
            }
        });
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        check1 = null;
        check2 = null;
        adapter = null;
        ((ListView)getView().findViewById(R.id.listView)).setOnItemClickListener(null);
    }

    public void onItems(ServerAPI.Item[] items, String user) {
        check1.setChecked(user.equals(MainPresenter.NAME_1));
        check2.setChecked(user.equals(MainPresenter.NAME_2));

        adapter.clear();
        adapter.addAll(items);
    }

    public void onNetworkError(Throwable throwable) {
        Toast.makeText(getActivity(), throwable.getMessage(), Toast.LENGTH_LONG).show();
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
        <title>fax4j 0.45.0 Reference Package org.fax4j.bridge</title>
        <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="style" />

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

fax4j 0.45.0 Reference

Prev

Next

Frames

No Frames

All Classes

Package org.fax4j.bridge

Class Summary

                                Class

                                    AbstractContextFaxBridge

                                    AbstractFax4JBridge

                                    AbstractFaxBridge

                                    AbstractRequestParser

                                    AbstractVendorPolicy

                                    ContextFaxBridge

                                    EmptyVendorPolicy

                                    FaxBridge

                                    FaxBridgeFlowHelper

                                    FaxBridgeFlowHelper.FlowResponse

                                    FaxBridgeImpl

                                    FileInfo

                                    RequestParser

                                    VendorPolicy

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

fax4j 0.45.0 Reference

Prev

Next

Frames

No Frames

All Classes

            Copyright © 2009–2020 fax4j. All rights reserved.


text:
class ExtracurricularActivityAssignment < ApplicationRecord
  belongs_to :member
  belongs_to :extracurricular_activity
  belongs_to :user
end


text:
from .generic_view import GenericView

from django.shortcuts import render
from django.core.exceptions import ObjectDoesNotExist
from django.core.mail import EmailMessage
from django.core.paginator import Paginator, InvalidPage, EmptyPage
from django.core.validators import email_re
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.db.models import Q

from .forms import ContactForm

from apresentacao.models import (
    Mensagem,
    Destinatario,
)
from criacao.models import (
    InformacoesMuseu,
    Coletanea,
    Noticia,
    Link,
)
from gerenciamento.models import (
    Peca,
    InformacoesIPHAN,
)

class View(GenericView):

    def home(self, request):
        data = None
        contact_form = ContactForm()
        links = Link.objects.all()

        try:
            informations = InformacoesMuseu.objects.all()[0]
        except Exception, e:
            informations = None

        try:
            news = Noticia.objects.order_by('data_de_criacao')[:4]
        except:
            news = None

        try:
            main_collectanea = Coletanea.objects.filter(nivel=0)[0]
            main_parts = main_collectanea.pecas.all().order_by('?')[:5]
        except Exception, e:
            main_collectanea = None

        try:
            collectaneas = Coletanea.objects.filter(nivel=1)[:5]
        except:
            collectaneas = None

        data = {
            'template': {
                'links': links,
                'informations': informations,
                'news': news,
                'main_collectanea': main_collectanea,
                'main_parts': main_parts,
                'collectaneas': collectaneas,
            }
        }

        return data

    def collectaneas(self, request):
        data = None
        links = Link.objects.all()

        try:
            informations = InformacoesMuseu.objects.all()[0]
        except Exception, e:
            informations = None

        try:
            keywords = request.GET['keywords'].split()
            collectaneas = Coletanea.objects.filter(reduce(lambda x, y: x | y, [Q(nome__icontains=unicode(keyword)) for keyword in keywords])).order_by('-data_criacao')
        except Exception, e:
            # logger.info(str(e))

            collectaneas = Coletanea.objects.all().order_by('-data_criacao')

        data = {
            'template': {
                'links': links,
                'informations': informations,
                'collectaneas': collectaneas,
            }
        }

        return data

    def collectanea(self, request):
        data = None
        links = Link.objects.all()

        try:
            informations = InformacoesMuseu.objects.all()[0]
        except Exception, e:
            informations = None

        try:
            pk = self.kwargs['pk']
            collectanea = Coletanea.objects.get(pk=pk)
        except Exception, e:
            # logger.info(str(e))

            collectanea = Coletanea.objects.all()[0]

        try:
            keywords = request.GET['keywords'].split()
            parts = collectanea.pecas.filter(reduce(lambda x, y: x | y, [Q(titulo__icontains=unicode(keyword)) for keyword in keywords])).order_by('-data_criacao')
        except Exception, e:
            parts = collectanea.pecas.all()

        data = {
            'template': {
                'links': links,
                'informations': informations,
                'collectanea': collectanea,
                'parts': parts,
            }
        }

        return data

    def part(self, request):
        data = None
        sections = ['photos', 'videos', 'audios', 'documents', 'iphan-informations']
        links = Link.objects.all()

        try:
            informations = InformacoesMuseu.objects.all()[0]
        except Exception, e:
            informations = None

        try:
            section = self.kwargs['section']
        except Exception, e:
            # logger.info(str(e))

            section = 'photos'
        else:
            if not section in sections:
                section = 'photos'

        try:
            pk = self.kwargs['pk']
            part = Peca.objects.get(pk=pk)
        except Exception, e:
            # logger.info(str(e))

            part = None
        else:
            part.iphan_informations = InformacoesIPHAN.objects.filter(peca=part)

        try:
            pk2 = self.kwargs['pk2']
            collectanea = Coletanea.objects.get(pk=pk2)
        except Exception, e:
            # logger.info(str(e))

            collectanea = Coletanea.objects.all()[0]

        data = {
            'template': {
                'links': links,
                'informations': informations,
                'section': section,
                'collectanea': collectanea,
                'part': part,
            }
        }

        return data

    def institutional(self, request):
        data = None
        sections = ['who-we-are', 'conception', 'mission', 'goals', 'technical-description', 'acquis-characteristics']
        links = Link.objects.all()

        try:
            informations = InformacoesMuseu.objects.all()[0]
        except Exception, e:
            informations = None

        try:
            section = self.kwargs['section']
        except Exception, e:
            # logger.info(str(e))

            section = 'who-we-are'
        else:
            if not section in sections:
                section = 'who-we-are'

        data = {
            'template': {
                'links': links,
                'informations': informations,
                'section': section,
            }
        }

        return data

    def news(self, request):
        data = None
        links = Link.objects.all()

        try:
            informations = InformacoesMuseu.objects.all()[0]
        except Exception, e:
            informations = None

        try:
            news = Noticia.objects.order_by('-data_de_criacao')
        except:
            news = None

        data = {
            'template': {
                'links': links,
                'informations': informations,
                'news': news,
            }
        }

        return data

    def new(self, request):
        data = None
        links = Link.objects.all()

        try:
            informations = InformacoesMuseu.objects.all()[0]
        except Exception, e:
            informations = None

        try:
            pk = self.kwargs['pk']
            new = Noticia.objects.get(pk=pk)
        except Exception, e:
            # logger.info(str(e))

            new = Noticia.objects.all()[0]

        data = {
            'template': {
                'links': links,
                'informations': informations,
                'new': new,
            }
        }

        return data

    def contact(self, request):
        data = None
        links = Link.objects.all()
        contact_form = ContactForm()

        try:
            informations = InformacoesMuseu.objects.all()[0]
        except Exception, e:
            informations = None

        data = {
            'template': {
                'links': links,
                'informations': informations,
                'contact_form': contact_form,
            }
        }

        return data

    def mail(self, request):
        data = None

        try:
            name = request.POST['name']
            email = request.POST['email']
            message = request.POST['message']
        except Exception, e:
            # logger.error(str(e))

            response = 'Todos os campos são obrigatórios, por favor, preencha-os.'
        else:
            if not (name or email or message):
                response = 'Todos os campos são obrigatórios, por favor, preencha-os.'
            elif not (email_re.match(email)):
                response = 'O email não está no formato correto.'
            else:
                receivers = []

                for receiver in Destinatario.objects.all():
                    receivers.append(receiver.funcionario.email)

                if receivers:
                    email = EmailMessage(
                        subject='Contato MuseuVirtual [%s]' % (email),
                        from_email=email,
                        to=receivers,
                        body=message
                    )
                    email.send()
                    response = 'Mensagem enviada com sucesso!'
                else:
                    response = 'Mensagem enviada com sucesso!'
        finally:
            data = {
                'leftover': {
                    'alert-success': response,
                }
            }

            return data


text:
package com.dmdirc.ui.messages;

import com.dmdirc.events.DisplayableEvent;

import java.util.Optional;

/**
 * Provides formats to be used for displayable events.
 */
public interface EventFormatProvider {

    /**
     * Gets the format to be used, if any, for the given event type.
     *
     * @param eventType The type of event to retrieve a format for.
     * @return The format to use, or an absent optional if no format is defined.
     */
    Optional<EventFormat> getFormat(final Class<? extends DisplayableEvent> eventType);

    /**
     * Reload the formats for this provider.
     */
    void reload();
}


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

<title>Uses of Interface com.example.baard.HabitEvents.CreateNewHabitEventFragment.OnFragmentInteractionListener</title>
<meta name="date" content="2017-11-13">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Interface
com.example.baard.HabitEvents.CreateNewHabitEventFragment.OnFragmentInteractionListener

Uses of CreateNewHabitEventFragment.OnFragmentInteractionListener in com.example.baard

Classes in com.example.baard that implement CreateNewHabitEventFragment.OnFragmentInteractionListener

Modifier and Type
Class and Description

class
MainActivity

Skip navigation links

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
import React, {Component} from 'react';
import {render} from 'react-dom';
import debug from 'debug';
import 'babel-polyfill';
import App from './app';
import {AppContainer} from 'react-hot-loader';

import '../styles/css/toastr.min.css';
import '../styles/css/font-awesome.min.css';
import '../styles/css/bootstrap.css';
import 'animate.css/animate.css';
import 'react-select/dist/react-select.css';
import '../styles/css/style.css';

render(
  <AppContainer>
    <App/>
  </AppContainer>, document.getElementById('app_container'));

if (module.hot) {
  module.hot.accept('./app', () => {
    const NextApp = require('./app').default;
    render(
      <AppContainer>
        <NextApp/>
      </AppContainer>, document.getElementById('app_container'));
  });
}


text:
import type { ActionList } from './list';
import type { FundQuotes, HistoryOptions } from '~client/types';
import type { Fund, FundHistory, FundInput, TargetDelta } from '~client/types/gql';
import { PageNonStandard } from '~shared/constants';
import type { GQL } from '~shared/types';

export const enum ActionTypeFunds {
  QueryUpdated = '@@funds/QUERY_UPDATED',
  PricesUpdated = '@@funds/PRICES_UPDATED',
  ViewSoldToggled = '@@funds/VIEW_SOLD_TOGGLED',
  CashTargetUpdated = '@@funds/CASH_TARGET_UPDATED',
  AllocationTargetsUpdated = '@@funds/ALLOCATIONS_UPDATED',
  TodayPricesFetched = '@@funds/TODAY_PRICES_FETCHED',
}

export type FundQueryUpdated = {
  type: ActionTypeFunds.QueryUpdated;
  historyOptions: HistoryOptions;
};

export const fundQueryUpdated = (historyOptions: HistoryOptions): FundQueryUpdated => ({
  type: ActionTypeFunds.QueryUpdated,
  historyOptions,
});

export type FundPricesUpdated = {
  type: ActionTypeFunds.PricesUpdated;
  res: GQL<Omit<FundHistory, 'latestValue'>>;
};

export const fundPricesUpdated = (
  res: GQL<Omit<FundHistory, 'latestValue'>>,
): FundPricesUpdated => ({
  type: ActionTypeFunds.PricesUpdated,
  res,
});

type ViewSoldToggled = {
  type: ActionTypeFunds.ViewSoldToggled;
};

export const fundsViewSoldToggled = (): ViewSoldToggled => ({
  type: ActionTypeFunds.ViewSoldToggled,
});

export type CashTargetUpdated = {
  type: ActionTypeFunds.CashTargetUpdated;
  cashTarget: number;
};

export const cashTargetUpdated = (cashTarget: number): CashTargetUpdated => ({
  type: ActionTypeFunds.CashTargetUpdated,
  cashTarget,
});

export type AllocationTargetsUpdated = {
  type: ActionTypeFunds.AllocationTargetsUpdated;
  deltas: TargetDelta[];
};

export const allocationTargetsUpdated = (deltas: TargetDelta[]): AllocationTargetsUpdated => ({
  type: ActionTypeFunds.AllocationTargetsUpdated,
  deltas,
});

export type TodayPricesFetched = {
  type: ActionTypeFunds.TodayPricesFetched;
  quotes: FundQuotes;
  refreshTime: string | null;
};

export const todayPricesFetched = (
  quotes: FundQuotes,
  refreshTime: string | null = null,
): TodayPricesFetched => ({
  type: ActionTypeFunds.TodayPricesFetched,
  quotes,
  refreshTime,
});

export type ActionFunds =
  | FundQueryUpdated
  | FundPricesUpdated
  | ViewSoldToggled
  | CashTargetUpdated
  | AllocationTargetsUpdated
  | TodayPricesFetched
  | ActionList<GQL<FundInput>, GQL<Fund>, PageNonStandard.Funds>;


text:
layout: page
title: Contacto
date: 2009-12-11 20:16:17.000000000 -05:00
categories: []
tags: []
status: publish
type: page
published: true
meta:
  syntaxhighlighter_encoded: '1'
  _edit_last: '1'
  _wp_page_template: default
  _aioseop_keywords: Contacto
  _aioseop_description: Formulario de contacto
  _aioseop_title: Contacto
  _aioseop_titleatr: Contacto
  _aioseop_menulabel: Contacto
  podPressPostSpecific: a:6:{s:15:"itunes:subtitle";s:15:"##PostExcerpt##";s:14:"itunes:summary";s:15:"##PostExcerpt##";s:15:"itunes:keywords";s:17:"##WordPressCats##";s:13:"itunes:author";s:10:"##Global##";s:15:"itunes:explicit";s:2:"No";s:12:"itunes:block";s:2:"No";}
  dsq_thread_id: '101887983'
---
<p>[contact-form-7 id="299" title="Contact form 1"]</p>