text:
NSString *const ALPHAScreenshotDataIdentifier = @"com.unifiedsense.alpha.data.screenshot";

@interface ALPHAScreenshotSource ()

@property (nonatomic, copy) NSArray *screenshots;

@property (nonatomic, strong) NSDateFormatter* dateFormatter;

@end

@implementation ALPHAScreenshotSource

- (NSDateFormatter *)dateFormatter
{
    if (!_dateFormatter)
    {
        _dateFormatter = [[NSDateFormatter alloc] init];
        _dateFormatter.dateStyle = NSDateFormatterFullStyle;
        _dateFormatter.timeStyle = NSDateFormatterMediumStyle;
    }

    return _dateFormatter;
}

- (instancetype)init
{
    self = [super init];

    if (self)
    {
        [self addDataIdentifier:ALPHAScreenshotDataIdentifier];
    }

    return self;
}

- (void)loadScreenshots
{
    NSError* error;

    NSString *directory = [NSString stringWithFormat:@"%@Alpha/Screenshots", [[ALPHAFileManager sharedManager] documentsDirectory].absoluteString];
    self.screenshots = [[NSFileManager defaultManager] contentsOfDirectoryAtURL:[NSURL URLWithString:directory] includingPropertiesForKeys:@[] options:0 error:&error];
}

- (ALPHAModel *)modelForRequest:(ALPHARequest *)request
{
    [self loadScreenshots];

    ALPHATableScreenModel* screenModel = [[ALPHATableScreenModel alloc] initWithIdentifier:ALPHAScreenshotDataIdentifier];
    screenModel.title = @"Screenshots";

    ALPHAScreenSection* section = [[ALPHAScreenSection alloc] init];

    NSMutableArray* items = [NSMutableArray array];

    for (NSURL* screenshot in self.screenshots)
    {
        ALPHAScreenItem* item = [[ALPHAScreenItem alloc] init];
        item.title = [self titleForScreenshot:screenshot];
        item.object = [ALPHARequest requestForFile:screenshot.absoluteString];

        [items addObject:item];
    }

    section.items = items;

    screenModel.sections = @[ section ];

    return screenModel;
}

- (NSString *)titleForScreenshot:(NSURL *)screenshot
{
    NSString* filename = [screenshot.pathComponents lastObject];

    filename = [filename stringByReplacingOccurrencesOfString:@"ALPHA_SS_" withString:@""];
    filename = [filename stringByReplacingOccurrencesOfString:@".png" withString:@""];

    NSDate *date = [[ALPHAFileManager sharedManager].fileDateFormatter dateFromString:filename];

    NSString *text = [self.dateFormatter stringFromDate:date];

    if (!text.length)
    {
        text = [screenshot.pathComponents lastObject];
    }

    return text;
}

@end


text:
@interface SmartMultiSelectionListView (PrivateMethods)

-(void)saveCheckBoxInfoForTag:(int)tag;
-(int)getCheckBoxClickCountForTag:(int)tag;
-(NSString*)prepareMultiSelectionListString;
@end

@implementation SmartMultiSelectionListView
@synthesize messagesArray;
@synthesize message;
@synthesize delegate;

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        self.smartList.delegate=self;
    }
    return self;
}

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return messagesArray.count;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 56;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath
{
    UITableViewCell *mCell=[self.smartList cellForRowAtIndexPath:indexPath];
    if(![cellInfo containsObject:indexPath])
    {
        [mCell setAccessoryType:UITableViewCellAccessoryCheckmark];
        [cellInfo addObject:indexPath];
    }
    else
    {
        if(mCell.accessoryType==UITableViewCellAccessoryCheckmark)
            [mCell setAccessoryType:UITableViewCellAccessoryNone];
        else
            [mCell setAccessoryType:UITableViewCellAccessoryCheckmark];
        [cellInfo removeObject:indexPath];
    }
}

-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *mCell;
    if(!cellInfo)
        cellInfo=[[NSMutableSet alloc]init];
        mCell=[[UITableViewCell alloc]init] ;
        mCell.textLabel.text=[self.messagesArray objectAtIndex:indexPath.row];
        mCell.selectionStyle = UITableViewCellSelectionStyleNone;
        mCell.backgroundColor=[UIColor clearColor];
    if([cellInfo containsObject:indexPath])
    {
        mCell.accessoryType=UITableViewCellAccessoryCheckmark;
    }
    return mCell;
}

- (IBAction)doneButtonAction:(id)sender {

    NSString *selectionInfo=[self prepareMultiSelectionListString];
    [[SmartUIUtility sharedInstance] hideMultiSelector];
    if(delegate && [delegate respondsToSelector:@selector(processUsersSelectedIndex:)])
        [delegate processUsersSelectedIndex:selectionInfo];
}

- (IBAction)cancelButtonAction:(id)sender {

    [[SmartUIUtility sharedInstance] hideMultiSelector];
    if(delegate && [delegate respondsToSelector:@selector(processUsersSelectedIndex:)])
        [delegate processUsersSelectedIndex:@"-1"];
}

-(void)processSelectionListItems:(NSString*)listInfo{

    self.messagesArray=[NSMutableArray arrayWithObject:listInfo];
    NSDictionary *listInfoObj=[self.messagesArray objectAtIndex:0];
    self.messagesArray=[listInfoObj valueForKey:MMI_REQUEST_PROP_ITEM];
}

-(NSString*)prepareMultiSelectionListString
{
    NSInteger totalItems=messagesArray.count;
    NSMutableSet *selectedIndicesSet=[[NSMutableSet alloc]init];
    NSArray *selectedIndicesArray;

    for (int i=0; i<totalItems; i++)
    {
        if([cellInfo containsObject:[NSIndexPath indexPathForRow:i inSection:0]])
        {
            [selectedIndicesSet addObject:[NSNumber numberWithInt:i]];
        }
    }
    selectedIndicesArray=selectedIndicesSet.allObjects;
    NSString *selectedIndicesString=[AppUtils getJsonFromDictionary:(NSDictionary*)selectedIndicesArray];
    return selectedIndicesString;
}
@end

redpajama_set_name: RedPajamaGithub


text:
package com.github.vertxlet.core.impl;

import com.github.vertxlet.core.DatabaseConnection;
import com.github.vertxlet.core.Server;
import io.vertx.core.CompositeFuture;
import io.vertx.core.Future;
import io.vertx.core.Handler;
import io.vertx.core.logging.Logger;
import io.vertx.core.logging.LoggerFactory;
import io.vertx.ext.web.RoutingContext;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class FailureHandlerImpl implements Handler<RoutingContext> {

    private static final Logger logger = LoggerFactory.getLogger(FailureHandlerImpl.class);

    @SuppressWarnings("rawtypes")
    @Override
    public void handle(RoutingContext rc) {
        logger.error("Unexpected error occur", rc.failure());
        Map<String, DatabaseConnection<?>> connectionMap = rc.get(Server.DB_KEY);

        rc.response().putHeader("Content-Type", "text/html")
                .setStatusCode(500)
                .end("
Server internal error
");

        List<Future> futures = connectionMap.entrySet().stream()
                .map(entry -> {
                    logger.info("Close database connection " + entry.getKey());
                    return entry.getValue().close();
                })
                .collect(Collectors.toList());
        CompositeFuture.all(futures).onComplete(ar -> logger.info("All database resources cleaned"));
    }
}


text:
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

module StyleHelper
  def selector(selector_text)
    CssParserMaster::Selector.new('pdf_rule', selector_text, 99999)
  end

  def create_css_style css_declarations, &block
    selector_text = "#{css_declarations}"
    selector = selector(selector_text, 99999)
    StyleConverter::Css.parse(selector.declarations, &block)
  end
end

describe StyleConverter::Css do
  let(:css_style)         { StyleConverter::Css.new }
  let(:css_declarations)  { 'color: red; font-size: 10; background_color: #0000ff; font_family: helvetica'}

  include StyleHelper

  describe "self#parse" do
    it "should create a new css style" do
      create_css_style(css_declarations) do
        font_size.should == 10
        font_family.should == 'helvetica'
        color.should == 'red'
        background_color.should == '#0000ff'
      end
    end
  end

  describe "#new" do
    it "should create a new css style" do
      css_style.in_context do
        font_size.should == 10
        font_family.should be_a_kind_of String
        color.should be_a_kind_of String
      end
    end
  end

  describe "#color=" do
    RED_COLOR = '#ff0000'
    BLUE_COLOR = 'blue'

    it "should set color by hex code #{RED_COLOR}" do
      css_style.in_context do
        color = RED_COLOR
        color.should == RED_COLOR
      end
    end

    it "should set color by name #{BLUE_COLOR}" do
      css_style.in_context do
        color = BLUE_COLOR
        color.should == BLUE_COLOR
      end
    end
  end

  describe "#background_color=" do
    RED_COLOR = '#ff0000'
    BLUE_COLOR = 'blue'

    it "should set background_color by hex code #{RED_COLOR}" do
      css_style.in_context do
        background_color = RED_COLOR
        background_color.should == RED_COLOR
      end
    end

    it "should set background_color by name #{BLUE_COLOR}" do
      css_style.in_context do
        background_color = BLUE_COLOR
        background_color.should == BLUE_COLOR
      end
    end
  end

  describe "#font_size=" do
    FONT_SIZE = 12

    it "should set font_size to #{FONT_SIZE}" do
      css_style.in_context do
        font_size = FONT_SIZE
        font_size.should == FONT_SIZE
      end
    end
  end
end


text:
import tensorflow as tf
import numpy as np

# we will create a set of states, the agent get a reward for getting to the 5th one(4 in zero based array).
# the agent can go forward or backward by one state with wrapping(so if you go back from the 1st state you go to the
# end).
states = [0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0]
NUM_STATES = len(states)
NUM_ACTIONS = 2
FUTURE_REWARD_DISCOUNT = 0.5

def hot_one_state(index):
    array = np.zeros(NUM_STATES)
    array[index] = 1.
    return array

# The None here is for batch training
session = tf.Session()
state = tf.placeholder("float", [None, NUM_STATES])
targets = tf.placeholder("float", [None, NUM_ACTIONS])

hidden_weights = tf.Variable(tf.constant(0., shape=[NUM_STATES, NUM_ACTIONS]))

output = tf.matmul(state, hidden_weights)

loss = tf.reduce_mean(tf.square(output - targets))
train_operation = tf.train.AdamOptimizer(0.1).minimize(loss)

session.run(tf.initialize_all_variables())

for i in range(50):
    state_batch = []
    rewards_batch = []

    # create a batch of states
    for state_index in range(NUM_STATES):
        state_batch.append(hot_one_state(state_index))

        minus_action_index = (state_index - 1) % NUM_STATES
        plus_action_index = (state_index + 1) % NUM_STATES

        minus_action_state_reward = session.run(output, feed_dict={state: [hot_one_state(minus_action_index)]})
        plus_action_state_reward = session.run(output, feed_dict={state: [hot_one_state(plus_action_index)]})

        # these action rewards are the results of the Q function for this state and the actions minus or plus
        action_rewards = [states[minus_action_index] + FUTURE_REWARD_DISCOUNT * np.max(minus_action_state_reward),
                          states[plus_action_index] + FUTURE_REWARD_DISCOUNT * np.max(plus_action_state_reward)]
        rewards_batch.append(action_rewards)

    session.run(train_operation, feed_dict={
        state: state_batch,
        targets: rewards_batch})

    print([states[x] + np.max(session.run(output, feed_dict={state: [hot_one_state(x)]}))
           for x in range(NUM_STATES)])


text:
#pragma once
#include "GLPredictor.h"
#include "caffe2/core/predictor.h"

namespace caffe2 {
bool tryConvertToOpenGL(const NetDef& initNet,
                        const NetDef& predictNet,
                        NetDef* glPredictNet,
                        bool useTextureInput = false,
                        bool useTiling       = false,
                        bool runFusion       = true);

// Exposed for testing
NetDef rewritePredictNetForOpenGL(const NetDef& predictNet,
                                  bool useTextureInput = false,
                                  bool useTiling       = false,
                                  bool runFusion       = true);
void dumpDefForOpenGL(const NetDef& net);
} // namespace caffe2


text:
package org.appformer.maven.integration;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.apache.maven.project.MavenProject;
import org.eclipse.aether.artifact.Artifact;
import org.appformer.maven.integration.embedder.EmbeddedPomParser;
import org.appformer.maven.support.DependencyFilter;
import org.appformer.maven.support.MinimalPomParser;
import org.appformer.maven.support.PomModel;
import org.appformer.maven.support.AFReleaseId;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static org.appformer.maven.integration.embedder.MavenProjectLoader.parseMavenPom;

public class ArtifactResolver {

    private static final Logger log = LoggerFactory.getLogger(ArtifactResolver.class);

    private final PomParser pomParser;

    private final MavenRepository mavenRepository;

    public ArtifactResolver() {
        mavenRepository = MavenRepository.getMavenRepository();
        pomParser = new EmbeddedPomParser();
    }

    private ArtifactResolver(MavenProject mavenProject) {
        mavenRepository = MavenRepository.getMavenRepository(mavenProject);
        pomParser = new EmbeddedPomParser(mavenProject);
    }

    private ArtifactResolver(PomParser pomParser) {
        mavenRepository = MavenRepository.getMavenRepository();
        this.pomParser = pomParser;
    }

    public Artifact resolveArtifact(AFReleaseId releaseId ) {
        return mavenRepository.resolveArtifact(releaseId);
    }

    public List<DependencyDescriptor> getArtifactDependecies( String artifactName ) {
        return mavenRepository.getArtifactDependecies(artifactName);
    }

    public List<DependencyDescriptor> getPomDirectDependencies( DependencyFilter dependencyFilter ) {
        return pomParser.getPomDirectDependencies(dependencyFilter);
    }

    public Collection<DependencyDescriptor> getAllDependecies() {
        return getAllDependecies( (releaseId, scope) -> true );
    }

    public Collection<DependencyDescriptor> getAllDependecies( DependencyFilter dependencyFilter ) {
        Set<DependencyDescriptor> dependencies = new HashSet<DependencyDescriptor>();
        for (DependencyDescriptor dep : getPomDirectDependencies(dependencyFilter)) {
            dependencies.add( dep );
            for (DependencyDescriptor transitiveDep : getArtifactDependecies( dep.toString() )) {
                if (dependencyFilter.accept( dep.getReleaseId(), dep.getScope() )) {
                    dependencies.add( transitiveDep );
                }
            }
        }
        return dependencies;
    }

    public static ArtifactResolver getResolverFor(AFReleaseId releaseId, boolean allowDefaultPom) {
        File pomFile = getPomFileForGAV( releaseId, allowDefaultPom );
        if (pomFile != null) {
            ArtifactResolver artifactResolver = getResolverFor(pomFile);
            if (artifactResolver != null) {
                return artifactResolver;
            }
        }
        return allowDefaultPom ? new ArtifactResolver() : null;
    }

    public static ArtifactResolver getResolverFor(URI uri) {
        return getResolverFor(new File(uri));
    }

    public static ArtifactResolver getResolverFor(File pomFile) {
        try {
            return new ArtifactResolver(parseMavenPom(pomFile));
        } catch (RuntimeException e) {
            log.warn("Cannot use native maven pom parser, fall back to the internal one", e);
            PomParser pomParser = createInternalPomParser(pomFile);
            if (pomParser != null) {
                return new ArtifactResolver(pomParser);
            }
        }
        return null;
    }

    public static ArtifactResolver getResolverFor(InputStream pomStream) {
        MavenProject mavenProject = parseMavenPom(pomStream);
        return new ArtifactResolver(mavenProject);
    }

    private static File getPomFileForGAV(AFReleaseId releaseId, boolean allowDefaultPom) {
        String artifactName = releaseId.getGroupId() + ":" + releaseId.getArtifactId() + ":pom:" + releaseId.getVersion();
        Artifact artifact = MavenRepository.getMavenRepository().resolveArtifact(artifactName, !allowDefaultPom);
        return artifact != null ? artifact.getFile() : null;
    }

    public static ArtifactResolver getResolverFor(InputStream pomStream, AFReleaseId releaseId, boolean allowDefaultPom ) {
        if (pomStream != null) {
            ArtifactResolver artifactResolver = getResolverFor(pomStream);
            if (artifactResolver != null) {
                return artifactResolver;
            }
        }
        return getResolverFor(releaseId, allowDefaultPom);
    }

    public static ArtifactResolver getResolverFor(PomModel pomModel ) {
        return pomModel instanceof MavenPomModelGenerator.MavenModel ?
               new ArtifactResolver( ( (MavenPomModelGenerator.MavenModel) pomModel ).getMavenProject() ) :
               new ArtifactResolver();
    }

    private static InternalPomParser createInternalPomParser(File pomFile ) {
        FileInputStream fis = null;
        try {
            fis = new FileInputStream(pomFile);
            return new InternalPomParser( MinimalPomParser.parse( pomFile.getAbsolutePath(), fis ));
        } catch (FileNotFoundException e) {
        } finally {
            if (fis != null) {
                try {
                    fis.close();
                } catch (IOException e) { }
            }
        }
        return null;
    }

    private static class InternalPomParser implements PomParser {
        private final PomModel pomModel;

        private InternalPomParser(PomModel pomModel) {
            this.pomModel = pomModel;
        }

        @Override
        public List<DependencyDescriptor> getPomDirectDependencies( DependencyFilter filter ) {
            List<DependencyDescriptor> deps = new ArrayList<DependencyDescriptor>();
            for (AFReleaseId rId : pomModel.getDependencies(filter )) {
                deps.add(new DependencyDescriptor(rId));
            }
            return deps;
        }
    }
}


text:
#include "CppUTest/TestHarness.h"
#include "CppUTest/TestPlugin.h"

TestPlugin::TestPlugin(const SimpleString& name) :
    next_(NullTestPlugin::instance()), name_(name), enabled_(true)
{
}

TestPlugin::TestPlugin(TestPlugin* next) :
    next_(next), name_("null"), enabled_(true)
{
}

TestPlugin::~TestPlugin()
{
}

TestPlugin* TestPlugin::addPlugin(TestPlugin* plugin)
{
    next_ = plugin;
    return this;
}

void TestPlugin::runAllPreTestAction(UtestShell& test, TestResult& result)
{
    if (enabled_) preTestAction(test, result);
    next_->runAllPreTestAction(test, result);
}

void TestPlugin::runAllPostTestAction(UtestShell& test, TestResult& result)
{
    next_ ->runAllPostTestAction(test, result);
    if (enabled_) postTestAction(test, result);
}

bool TestPlugin::parseAllArguments(int ac, char** av, int index)
{
    return parseAllArguments(ac, const_cast<const char**> (av), index);
}

bool TestPlugin::parseAllArguments(int ac, const char** av, int index)
{
    if (parseArguments(ac, av, index)) return true;
    if (next_) return next_->parseAllArguments(ac, av, index);
    return false;
}

const SimpleString& TestPlugin::getName()
{
    return name_;
}

TestPlugin* TestPlugin::getPluginByName(const SimpleString& name)
{
    if (name == name_) return this;
    if (next_) return next_->getPluginByName(name);
    return (next_);
}

TestPlugin* TestPlugin::getNext()
{
    return next_;
}
TestPlugin* TestPlugin::removePluginByName(const SimpleString& name)
{
    TestPlugin* removed = 0;
    if (next_ && next_->getName() == name) {
        removed = next_;
        next_ = next_->next_;
    }
    return removed;
}

void TestPlugin::disable()
{
    enabled_ = false;
}

void TestPlugin::enable()
{
    enabled_ = true;
}

bool TestPlugin::isEnabled()
{
    return enabled_;
}

struct cpputest_pair
{
    void **orig;
    void *orig_value;
};

//////// SetPlugin

static int pointerTableIndex;
static cpputest_pair setlist[SetPointerPlugin::MAX_SET];

SetPointerPlugin::SetPointerPlugin(const SimpleString& name) :
    TestPlugin(name)
{
    pointerTableIndex = 0;
}

void CppUTestStore(void**function)
{
    if (pointerTableIndex >= SetPointerPlugin::MAX_SET) {
        FAIL("Maximum number of function pointers installed!");
    }
    setlist[pointerTableIndex].orig_value = *function;
    setlist[pointerTableIndex].orig = function;
    pointerTableIndex++;
}

void SetPointerPlugin::postTestAction(UtestShell& /*test*/, TestResult& /*result*/)
{
    for (int i = pointerTableIndex - 1; i >= 0; i--)
        *((void**) setlist[i].orig) = setlist[i].orig_value;
    pointerTableIndex = 0;
}

//////// NullPlugin

NullTestPlugin::NullTestPlugin() :
    TestPlugin(0)
{
}

NullTestPlugin* NullTestPlugin::instance()
{
    static NullTestPlugin _instance;
    return &_instance;
}

void NullTestPlugin::runAllPreTestAction(UtestShell&, TestResult&)
{
}

void NullTestPlugin::runAllPostTestAction(UtestShell&, TestResult&)
{
}


text:
package com.here.account.util;

import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * A jackson-based JSON serializer and deserializer.
 *
 * @author kmccrack
 *
 */
public class JsonSerializer {

    /**
     * The name of the UTF-8 {@link #CHARSET}.
     */
    public static final String CHARSET_STRING = "UTF-8";

    /**
     * Constant for the loaded UTF-8 Charset.
     */
    public static final Charset CHARSET = Charset.forName(CHARSET_STRING);

    private static ObjectMapper objectMapper = new ObjectMapper();

    static {
        objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
    }

    /**
     * Converts the input JSON InputStream, to a Map<String, Object>.
     *
     * @param jsonInputStream the input stream to the JSON object
     * @return its Map representation
     * @throws IOException if trouble deserializing
     */
    public static Map<String, Object> toMap(InputStream jsonInputStream) throws IOException {
        return (HashMap<String, Object>) objectMapper.readValue(jsonInputStream, HashMap.class);
    }

    /**
     * Converts the input JSON InputStream, to a POJO of the class specified as pojoClass.
     *
     * @param <T> the type of the POJO
     * @param jsonInputStream the input stream to the JSON object
     * @param pojoClass the class to deserialize into
     * @return the instance of the pojoClass with member variables populated
     * @throws JsonParseException if trouble parsing
     * @throws JsonMappingException if trouble mapping
     * @throws IOException if trouble deserializing
     */
    public static <T> T toPojo (InputStream jsonInputStream, Class<T> pojoClass) throws JsonParseException, JsonMappingException, IOException {
        return objectMapper.readValue(jsonInputStream, pojoClass);
    }

    /**
     * Converts the input mapObject to its JSON String representation.
     *
     * @param mapObject the json's Map representation
     * @return the JSON String representation of the input.
     * @throws JsonProcessingException if an exception from the jackson serializer
     */
    public static String toJson(Map<String, Object> mapObject) throws JsonProcessingException {
        return objectMapper.writeValueAsString(mapObject);
    }

}


text:
ComfortableMexicanSofa.configure do |config|
  config.admin_auth = 'Cms::Fortress::Auth'
  config.cms_title = 'CMS Fortress (Powered by ComfortableMexicanSofa)'
end

ComfortableMexicanSofa::ViewHooks.add(:header, 'cms/fortress/shared/admin_topnav')
#   ComfortableMexicanSofa::ViewHooks.add(:navigation, '/layouts/admin/navigation')
#   ComfortableMexicanSofa::ViewHooks.add(:html_head, '/layouts/admin/html_head')
#   ComfortableMexicanSofa::ViewHooks.add(:page_form, '/layouts/admin/page_form')


text:
<?php

namespace EmanueleMinotto\HwiOauthBridge\Traits\Entity;

use Doctrine\ORM\Mapping as ORM;

trait YandexTrait
{
    /**
     * Yandex username.
     *
     * @var string|null
     *
     * @ORM\Column(nullable = true)
     */
    private $yandexUsername;

    /**
     * Yandex nickname.
     *
     * @var string|null
     *
     * @ORM\Column(nullable = true)
     */
    private $yandexNickname;

    /**
     * Yandex first name.
     *
     * @var string|null
     *
     * @ORM\Column(nullable = true)
     */
    private $yandexFirstName;

    /**
     * Yandex last name.
     *
     * @var string|null
     *
     * @ORM\Column(nullable = true)
     */
    private $yandexLastName;

    /**
     * Yandex real name.
     *
     * @var string|null
     *
     * @ORM\Column(nullable = true)
     */
    private $yandexRealName;

    /**
     * Yandex profilePicture.
     *
     * @var string|null
     *
     * @ORM\Column(nullable = true)
     */
    private $yandexEmail;

    /**
     * Yandex profile picture.
     *
     * @var string|null
     *
     * @ORM\Column(nullable = true)
     */
    private $yandexProfilePicture;

    /**
     * Yandex access token.
     *
     * @var string|null
     *
     * @ORM\Column(nullable = true)
     */
    private $yandexAccessToken;

    /**
     * Yandex refresh token.
     *
     * @var string|null
     *
     * @ORM\Column(nullable = true)
     */
    private $yandexRefreshToken;

    /**
     * Yandex expires in.
     *
     * @var string|null
     *
     * @ORM\Column(nullable = true)
     */
    private $yandexExpiresIn;

    /**
     * Yandex data.
     *
     * @var array|null
     *
     * @ORM\Column(type = "json_array", nullable = true)
     */
    private $yandexData;

    /**
     * Get Yandex access token.
     *
     * @return string|null
     */
    public function getYandexAccessToken()
    {
        return $this->yandexAccessToken;
    }

    /**
     * Gets the Yandex data.
     *
     * @return array|null
     */
    public function getYandexData()
    {
        return $this->yandexData;
    }

    /**
     * Get Yandex email.
     *
     * @return string|null
     */
    public function getYandexEmail()
    {
        return $this->yandexEmail;
    }

    /**
     * Get Yandex expires in.
     *
     * @return string|null
     */
    public function getYandexExpiresIn()
    {
        return $this->yandexExpiresIn;
    }

    /**
     * Get Yandex first name.
     *
     * @return string|null
     */
    public function getYandexFirstName()
    {
        return $this->yandexFirstName;
    }

    /**
     * Get Yandex last name.
     *
     * @return string|null
     */
    public function getYandexLastName()
    {
        return $this->yandexLastName;
    }

    /**
     * Get Yandex nickname.
     *
     * @return string|null
     */
    public function getYandexNickname()
    {
        return $this->yandexNickname;
    }

    /**
     * Get Yandex profile picture.
     *
     * @return string|null
     */
    public function getYandexProfilePicture()
    {
        return $this->yandexProfilePicture;
    }

    /**
     * Get Yandex real name.
     *
     * @return string|null
     */
    public function getYandexRealName()
    {
        return $this->yandexRealName;
    }

    /**
     * Get Yandex refresh token.
     *
     * @return string|null
     */
    public function getYandexRefreshToken()
    {
        return $this->yandexRefreshToken;
    }

    /**
     * Get Yandex username.
     *
     * @return string|null
     */
    public function getYandexUsername()
    {
        return $this->yandexUsername;
    }

    /**
     * Set Yandex access token.
     *
     * @param string|null $accessToken
     *
     * @return self
     */
    public function setYandexAccessToken($accessToken)
    {
        $this->yandexAccessToken = $accessToken;

        return $this;
    }

    /**
     * Sets the Yandex data.
     *
     * @param array|null $data
     *
     * @return self
     */
    public function setYandexData(array $data = null)
    {
        $this->yandexData = $data;

        return $this;
    }

    /**
     * Set Yandex email.
     *
     * @param string|null $email
     *
     * @return self
     */
    public function setYandexEmail($email)
    {
        $this->yandexEmail = $email;

        return $this;
    }

    /**
     * Set Yandex expires in.
     *
     * @param string|null $expiresIn
     *
     * @return self
     */
    public function setYandexExpiresIn($expiresIn)
    {
        $this->yandexExpiresIn = $expiresIn;

        return $this;
    }

    /**
     * Set Yandex first name.
     *
     * @param string|null $firstName
     *
     * @return self
     */
    public function setYandexFirstName($firstName)
    {
        $this->yandexFirstName = $firstName;

        return $this;
    }

    /**
     * Set Yandex last name.
     *
     * @param string|null $lastName
     *
     * @return self
     */
    public function setYandexLastName($lastName)
    {
        $this->yandexLastName = $lastName;

        return $this;
    }

    /**
     * Set Yandex nickname.
     *
     * @param string|null $nickname
     *
     * @return self
     */
    public function setYandexNickname($nickname)
    {
        $this->yandexNickname = $nickname;

        return $this;
    }

    /**
     * Set Yandex profile picture.
     *
     * @param string|null $profilePicture
     *
     * @return self
     */
    public function setYandexProfilePicture($profilePicture)
    {
        $this->yandexProfilePicture = $profilePicture;

        return $this;
    }

    /**
     * Set Yandex real name.
     *
     * @param string|null $realName
     *
     * @return self
     */
    public function setYandexRealName($realName)
    {
        $this->yandexRealName = $realName;

        return $this;
    }

    /**
     * Set Yandex refresh token.
     *
     * @param string|null $refreshToken
     *
     * @return self
     */
    public function setYandexRefreshToken($refreshToken)
    {
        $this->yandexRefreshToken = $refreshToken;

        return $this;
    }

    /**
     * Set Yandex username.
     *
     * @param string|null $username
     *
     * @return self
     */
    public function setYandexUsername($username)
    {
        $this->yandexUsername = $username;

        return $this;
    }
}


text:
Pagos Realizados

                {{pago.alumnoNombreApellido}}
                {{pago.periodo}}
				{{pago.anio}}
				$ {{pago.importe | number : 2}}

    	Aún no hay ningun pago registrado, ¿Desea registrar uno?


text:
<?php
$type = 0;
$table = 'unity_article_sections';

$get = Dune_Filter_Get_Total::getInstance();
$post = Dune_Filter_Post_Total::getInstance();
$URL = Dune_Parsing_UrlSingleton::getInstance();

if ($get->com == 'delete')
{
    $texts = new Special_Vtor_Article_Text_ListSectionsCorr($type);
    $texts->setSection($get->id);
    if (!$texts->getCoutText())
    {
        $one = new Dune_Mysqli_Table($table);
        $one->useId($get->id);
        $one->delete();
    }
    throw new Dune_Exception_Control_Goto();
}
if ($post->com == 'add')
{
    $URL[4] = 'editsection';
    throw new Dune_Exception_Control_Goto($URL->getCommandString());
}
if ($get->com == 'edit' and $get->getDigit('id'))
{

    $URL[4] = 'editsection';
    throw new Dune_Exception_Control_Goto($URL->getCommandString() . '?id=' . $get->id);
}

$list_o = new Special_Vtor_Article_Sections_List($type);
$list = $list_o->getList();

$view = Dune_Zend_View::getInstance();
$view->data = $list;

echo $view->render('page/article/listsection');


text:
class DyldSharedCacheExtractor < Formula
  desc "Extract libraries from the dyld shared cache"
  homepage "https://github.com/keith/dyld-shared-cache-extractor"
  url "https://github.com/keith/dyld-shared-cache-extractor/archive/refs/tags/0.2.0.tar.gz"
  sha256 "b0cc3000cda32e6f879d44c0035822f9a002ca8b4fa281a7e9648bd511470acd"
  head "https://github.com/keith/dyld-shared-cache-extractor.git", branch: "main"

  depends_on "cmake" => :build

  def install
    system "cmake", "-S", ".", "-B", "build", *std_cmake_args
    system "cmake", "--build", "build"
    system "cmake", "--install", "build"
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0"
                xmlns="urn:schemas-microsoft-com:asm.v1"
                xmlns:asmv1="urn:schemas-microsoft-com:asm.v1"
                xmlns:asmv2="urn:schemas-microsoft-com:asm.v2"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <dependency>
    <dependentAssembly>
      <assemblyIdentity
        type="win32"
        name="Microsoft.Windows.Common-Controls"
        version="6.0.0.0"
        processorArchitecture="*"
        publicKeyToken="6595b64144ccf1df"
        language="*"
        />
    </dependentAssembly>
  </dependency>
</asmv1:assembly>


text:
package org.datavec.image.recordreader.objdetect.impl;

import lombok.NonNull;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.datavec.image.recordreader.objdetect.ImageObject;
import org.datavec.image.recordreader.objdetect.ImageObjectLabelProvider;

import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;

public class VocLabelProvider implements ImageObjectLabelProvider {

    private static final String OBJECT_START_TAG = "<object>";
    private static final String OBJECT_END_TAG = "</object>";
    private static final String NAME_TAG = "<name>";
    private static final String XMIN_TAG = "<xmin>";
    private static final String YMIN_TAG = "<ymin>";
    private static final String XMAX_TAG = "<xmax>";
    private static final String YMAX_TAG = "<ymax>";

    private String annotationsDir;

    public VocLabelProvider(@NonNull String baseDirectory){
        this.annotationsDir = FilenameUtils.concat(baseDirectory, "Annotations");

        if(!new File(annotationsDir).exists()){
            throw new IllegalStateException("Annotations directory does not exist. Annotation files should be " +
                    "present at baseDirectory/Annotations/nnnnnn.xml. Expected location: " + annotationsDir);
        }
    }

    @Override
    public List<ImageObject> getImageObjectsForPath(String path) {
        int idx = path.lastIndexOf('/');
        idx = Math.max(idx, path.lastIndexOf('\\'));

        String filename = path.substring(idx+1, path.length()-4);   //-4: ".jpg"
        String xmlPath = FilenameUtils.concat(annotationsDir, filename + ".xml");
        File xmlFile = new File(xmlPath);
        if(!xmlFile.exists()){
            throw new IllegalStateException("Could not find XML file for image " + path + "; expected at " + xmlPath);
        }

        String xmlContent;
        try{
            xmlContent = FileUtils.readFileToString(xmlFile);
        } catch (IOException e){
            throw new RuntimeException(e);
        }

        //Normally we'd use Jackson to parse XML, but Jackson has real trouble with multiple XML elements with
        //  the same name. However, the structure is simple and we can parse it manually (even though it's not
        // the most elegant thing to do :)
        String[] lines = xmlContent.split("\n");

        List<ImageObject> out = new ArrayList<>();
        for( int i=0; i<lines.length; i++ ){
            if(!lines[i].contains(OBJECT_START_TAG)){
                continue;
            }
            String name = null;
            int xmin = Integer.MIN_VALUE;
            int ymin = Integer.MIN_VALUE;
            int xmax = Integer.MIN_VALUE;
            int ymax = Integer.MIN_VALUE;
            while(!lines[i].contains(OBJECT_END_TAG)){
                if(name == null && lines[i].contains(NAME_TAG)){
                    int idxStartName = lines[i].indexOf('>') + 1;
                    int idxEndName = lines[i].lastIndexOf('<');
                    name = lines[i].substring(idxStartName, idxEndName);
                    i++;
                    continue;
                }
                if(xmin == Integer.MIN_VALUE && lines[i].contains(XMIN_TAG)){
                    xmin = extractAndParse(lines[i]);
                    i++;
                    continue;
                }
                if(ymin == Integer.MIN_VALUE && lines[i].contains(YMIN_TAG)){
                    ymin = extractAndParse(lines[i]);
                    i++;
                    continue;
                }
                if(xmax == Integer.MIN_VALUE && lines[i].contains(XMAX_TAG)){
                    xmax = extractAndParse(lines[i]);
                    i++;
                    continue;
                }
                if(ymax == Integer.MIN_VALUE && lines[i].contains(YMAX_TAG)){
                    ymax = extractAndParse(lines[i]);
                    i++;
                    continue;
                }

                i++;
            }

            if(name == null){
                throw new IllegalStateException("Invalid object format: no name tag found for object in file " + xmlPath);
            }
            if(xmin == Integer.MIN_VALUE || ymin == Integer.MIN_VALUE || xmax == Integer.MIN_VALUE || ymax == Integer.MIN_VALUE){
                throw new IllegalStateException("Invalid object format: did not find all of xmin/ymin/xmax/ymax tags in " + xmlPath);
            }

            out.add(new ImageObject(xmin, ymin, xmax, ymax, name));
        }

        return out;
    }

    private int extractAndParse(String line){
        int idxStartName = line.indexOf('>') + 1;
        int idxEndName = line.lastIndexOf('<');
        String substring = line.substring(idxStartName, idxEndName);
        return Integer.parseInt(substring);
    }

    @Override
    public List<ImageObject> getImageObjectsForPath(URI uri) {
        return getImageObjectsForPath(uri.toString());
    }

}


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Konsultasi extends Admin {

	public function __construct()
	{
		parent::__construct();

		$this->load->model('Mod_konsultasi');
		$this->load->model('Mod_kons_kategori','model');
		$this->load->model('user/Mod_user');

		$this->status = array(
            'open'   => 'Open',
            'close'  => 'Close',
        );
	}

	public function index()
	{
		$data['konsultasi'] = $this->Mod_konsultasi->readKonsultasi();
		$this->template->build('index', $data);
	}

	function status($open,$close)
	{
		if ($open == 'open') {
			$this->db->update('konsultasi', array('status'=>'close'), array('id'=> $close));
		} else {
			$this->db->update('konsultasi', array('status'=>'open'), array('id'=> $close));
		}

		redirect('konsultasi');
	}

	public function detail($id)
	{
		$detail['konsultasi'] 		= $this->Mod_konsultasi->getByIdKonsultasi($id);
		$detail['user_id']    		= $this->Mod_konsultasi->getUserKonsul($id);
		$detail['kategori']    		= $this->Mod_konsultasi->getByKategori($id);

		$this->template->build('detail_konsultasi', $detail);
	}

	public function kategori()
	{
		$data['kategori'] 		= $this->model->readKategori();
        $data['tenaga_ahli'] 	= $this->Mod_user->getAll();

		$this->template->build('kons_kategori_tampil', $data);
	}

	public function addKategori()
	{
		$this->form_validation->set_rules('name', 'Konsultasi Kategori', 'required');

		if ($this->form_validation->run() == FALSE) {
			$data['kategori'] = $this->model->readKategori();
			$this->template->build('kons_kategori_tampil', $data);

		} else {
			$konsKategori['name']				= set_value('name');
			$konsKategori['description']		= set_value('description');

			$id = $this->model->addKategori($konsKategori);

            set_message_success('Kategori Konsultasi berhasil ditambahkan.');

            redirect('konsultasi/kategori');
		}
	}

	public function updateKategori($id_kategori)
	{
		$this->form_validation->set_rules('name', 'Name', 'trim|required');

        if ($this->form_validation->run() == FALSE) {
            $param                  = $this->model->getByIdKategori($id_kategori);
            $data['kategori']       = $param->row();

            $this->template->build('kons_kategori_update',$data);
        } else {
            $konsKategori['name']           	  = $this->input->post('name');
            $konsKategori['description']    	  = $this->input->post('description');

            $res = $this->model->updateKategori($id_kategori, $konsKategori);

            if ($res==TRUE) {
                set_message_success('Kategori berhasil diperbarui.');

                redirect('konsultasi/kategori');
            } else {
                set_message_error('Kategori gagal diperbarui.');

                redirect('konsultas/updateKategori');
            }
        }
	}

	public function deleteKategori($id_kategori)
	{
		$data = $this->model->delete($id_kategori);

		set_message_success('Kategori Konsultasi berhasi dihapus');

		redirect('konsultasi/kategori');
	}

	public function pengampu()
	{
        $data['users']      	= sentinel()->findRoleBySlug('ta')->users->pluck('email', 'id')->toArray();
        $data['getKategori']    = $this->model->getAllGroupByUser();
        // $data['getUser']    	= $this->model->getByUser();
		$data['kategori_list'] 	= $this->model->getKategoriList();

		$this->template->build('pengampu', $data);
	}

	public function pengampu_tambah()
	{
		$this->form_validation->set_rules('user_id', 'Tenaga Ahli', 'trim|required');

		if ($this->form_validation->run() == FALSE) {
            keepValidationErrors();

        } else {

        	$users 			= $this->input->post('user_id');
        	$kategori_list 	= $this->input->post('id_kategori');

        	$data = array(
        		'user_id' 		=> $users,
        		'id_kategori'	=> $kategori_list,
        	);

            $save = $this->model->addPengampu($data);

            set_message_success('data berhasil ditambahkan.');

            redirect('konsultasi/pengampu', 'refresh');
        }
	}

	function deletePengampu($id)
	{
		$this->db->delete('konsultasi_user_has_kategori',array('id'=>$id));
		redirect('konsultasi/pengampu');
	}

}

/* End of file Konsultasi.php */
/* Location: ./application/modules/konsultasi/controllers/Konsultasi.php */


text:
<!DOCTYPE html>

	<title>

            GreyHat Information Security Consulting Inc. -

    Complete profile - Canadian Company Capabilities - Industries and Business - Industry Canada
  </title>

<meta charset="utf-8" />
<meta name="dcterms.language" title="ISO639-2" content="eng" />
<meta name="dcterms.title" content="" />
<meta name="description" content="" />
<meta name="dcterms.description" content="" />
<meta name="dcterms.type" content="report, data set" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.issued" title="W3CDTF" content="" />
<meta name="dcterms.modified" title="W3CDTF" content="" />
<meta name="keywords" content="" />

<meta name="dcterms.creator" content="" />
<meta name="author" content="" />
<meta name="dcterms.created" title="W3CDTF" content="" />
<meta name="dcterms.publisher" content="" />
<meta name="dcterms.audience" title="icaudience" content="" />
<meta name="dcterms.spatial" title="ISO3166-1" content="" />
<meta name="dcterms.spatial" title="gcgeonames" content="" />
<meta name="dcterms.format" content="HTML" />
<meta name="dcterms.identifier" title="ICsiteProduct" content="536" />

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta content="width=device-width,initial-scale=1" name="viewport">

<meta name = "format-detection" content = "telephone=no">

<meta name="robots" content="noarchive">

<link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="icon" type="image/x-icon">
<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/wet-boew.min.css">

<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/theme.min.css">

<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/noscript.min.css" />

<link rel="stylesheet" href="/eic/home.nsf/css/add_WET_4-0_Canada_Apps.css">

  	<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
  	<link href="/app/ccc/srch/css/print.css" media="print" rel="stylesheet" type="text/css" />

<meta property="legalName" content="Department_of_Industry">

Skip to main content

Skip to "About this site"

Language selection

Français

<object type="image/svg+xml" tabindex="-1" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/sig-blk-en.svg"></object> Government of Canada

Search and menus

Search and menus

Topics menu

Jobs

Immigration

Travel

Business

Benefits

Health

Taxes

More services

You are here:

Home

Industries and Business

Canadian Company Capabilities

<input id="showMore" type="hidden" value='more'/>
<input id="showLess" type="hidden" value='less'/>

 Company profile - Canadian Company Capabilities

New Search |

<form name="searchForm" method="post" action="/app/ccc/srch/bscSrch.do">

          <input type="hidden" name="lang" value="eng" />
          <input type="hidden" name="profileId" value="" />
          <input type="hidden" name="prtl" value="1" />
          <input type="hidden" name="searchPage" value="%2Fapp%2Fccc%2Fsrch%2FcccBscSrch.do%3Flang%3Deng%26amp%3Bprtl%3D1%26amp%3Btagid%3D"  />

          <input type="hidden" name="V_SEARCH.scopeCategory" value="CCC.Root" />

          <input type="hidden" name="V_SEARCH.depth" value="1" />
          <input type="hidden" name="V_SEARCH.showStricts" value="false" />
          <input id="repeatSearchBtn" class="btn btn-link" type="submit" value="Return to search results" />

  </form>

| Previous Company

| Next Company

      Third-Party Information Liability Disclaimer

Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.

      GreyHat Information Security Consulting Inc.

Legal/Operating Name:

GreyHat Information Security Consulting Inc.

greyhatconsulting@gmail.com

Mailing Address:

              	<address class="mrgn-bttm-md">

                   488 Cooper St

                    Ottawa,

                    Ontario

                  K1R 5H9

                </address>

Location Address:

              	         <address class="mrgn-bttm-md">

                   488 Cooper St

                    Ottawa,

                    Ontario

                  K1R 5H9

                         </address>

Tel.:
		      (613) 266-5933

Fax:

Company Profile

            GreyHat Information Security Consulting Inc. provides a wide range of information security services including the development of Privacy Risk Management Frameworks, and IT Security Policy and Governance Frameworks. GreyHat also performs Web Application Security Assessments, Oracle and Microsoft SQL Database Security  Assessments, Threat and Risk Assessments (TRA), Vulnerability Assessments (VA) and Penetration Tests, Privacy Impact Assessments (PIA), and IT security audits.

Our team of senior security consultants have many years of experience providing guidance and advice for senior managers in the Government of Canada, the Ontario government and private enterprise. We have performed risk assessments of a broad range of operating systems, applications, databases, platforms and networks, and have substantial background, expertise, and training in security architecture, web server infrastructure, and in Unix and Microsoft Windows client-server environments.

We also have extensive knowledge of the security policies and standards of the Treasury Board of Canada Secretariat, and the IT Security risk assessment methodologies of the lead agencies of the federal government- the RCMP and the CSE. We have extensive knowledge of the NIST standards, the ISO17799 standards, the Carnegie Mellon OCTAVE methodology, the CoBIT framework, and industry best practices.

Our primary areas of expertise in information risk management include I.T. Security expertise, security architecture, and security assessments in network infrastructure, web environments, and client-server environments. Our principal consultants possess the requisite skills for effective communication with business leaders and technical personnel,  relationship management, strategic planning, and thought leadership. In addition, we are able to combine analytical and writing skills to document and present our findings from a service delivery and business perspective.

				Full profile

				Full profile

				Contact information

                David
                O'Brien

	                  Title:

  						President - Principal Consultant

                  Telephone:

                (613) 266-5933

                    Email:

                  greyhatconsulting@gmail.com

  top of page

				Company description

            Country of Ownership:

              Canada

              Year Established:

            2003

            Exporting:

              No

                Primary Industry (NAICS):

				541690 - Other Scientific and Technical Consulting Services

            Alternate Industries (NAICS):

            541510 - Computer Systems Design and Related Services

            541611 - Administrative Management and General Management Consulting Services

            541619 - Other Management Consulting Services

            Primary Business Activity:

            Services

              Total Sales ($CDN):

            $200,000 to $499,999

              Number of Employees:

            2

				Product / Service / Licensing

                              Service Name:

                            IT Security Consulting

                            Provide guidance to senior managers, business owners, and technical staff on appropriate and cost-effective security controls for information security and IT security.

                              Service Name:

                            Vulnerability Assessments

                            Conduct a comprehensive vulnerability assessment of the organization's IT infrastructure, network, servers, applications, desktops, and databases.

Develop an Action Plan to make recommendations to improve ineffective or inadequate security controls.

Test the security perimeter from the Internet and ensure the appropriate security measures are in place.

                              Service Name:

                            Privacy Impact Assessments

                            Ensure that privacy implications for a new or modified program or activity are integrated into the privacy risk management of the organization.

Identify and categorize the sensitivity of personal information to unauthorized or inadvertent disclosure, modification or corruption, or destruction.

Assess the adequacy of security controls for the protection of personal information for administrative, operational, and technical issues.

Determine if there are any adverse impacts or risks to individuals or the organization, and

Make recommendations to reduce risks to privacy.

                              Service Name:

                            Threat & Risk Assessments

                            Performed over seventy five TRAs following the HTRA methodology for more than sixty departments and agencies of the Government of Canada, the Government of Ontario, and large private sector organizations including Carleton University.

An assessment of threats and risks to government programs and services is fundamental to risk management and the need to determine the adequacy of security safeguards to protect valuable information and assets. A Threat and Risk Assessment (TRA) is a means to provide senior management of an organization with the necessary information to make decisions on risk. Risk is derived from the value of information and assets, or sensitivity to compromise, the likelihood of a threat event and the gravity or impact if it occurs, the probability of compromise and the severity of outcome due to the vulnerabilities, and the potential adverse impact. Risk is defined as a situation in which a threat is able to take advantage of a vulnerability to compromise sensitive information and valuable assets. Program managers are obliged to follow the principles of risk management to minimize the potential risks to programs and services.

TRAs include enterprise TRA, network TRA, SharePoint 2010, Lync Server 2010, National Forest Information System, Knowledge Network, Avaya WLAN, Education Information System, GCDOCS, Oracle 10G, Lotus Domino 6.5, IBM WebSphere 6.1, IBM Maximo, SIMSI, National Import Service Centre, STG WebCIMS, Livelink Server, Public Accounts Production System, Citrix Presentation Server, and Microsoft dot NET application development.

                              Service Name:

                            Database Security Assessments

                            Oracle, SQL Server, Sybase

                              Service Name:

                            Web Application Security Assessments

                            Performed more than twenty assessments of web applications and the related infrastructure on behalf of clients in the Government of Canada.

                              Service Name:

                            IT Security Policy and Governance Framework

                            Development of Policy Framework and Policies, Procedures, and Standards.

                              Service Name:

                            Privacy Risk Management Framework

                            Align data use and data matching processes complies with relevant privacy legislation, regulations, and policies

Assist business managers in presenting PIA's to management oversight committees and the Office of the Privacy Commissioner

Propose strategies for mitigating the identified risks relating to organizations, processes, applications, and systems

                              Service Name:

                            Privacy Risk Management Plan

                            Develop an Action Plan to mitigate or accept risks to privacy and sensitive personal information, and ensure compliance with the established privacy principles, Government directives, and federal legislation.

              FSC Code:

              5810-Communications Security Equipment and Components

              B307-Security Studies (Physical and Personal)

              D310-ADP Backup and Security Services

  top of page

					Third-Party Information Liability Disclaimer

					Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.

				Contacts

				Contact information

                David
                O'Brien

	                  Title:

  						President - Principal Consultant

                  Telephone:

                (613) 266-5933

                    Email:

                  greyhatconsulting@gmail.com

				Description

				Company description

            Country of Ownership:

              Canada

              Year Established:

            2003

            Exporting:

              No

                Primary Industry (NAICS):

				541690 - Other Scientific and Technical Consulting Services

            Alternate Industries (NAICS):

            541510 - Computer Systems Design and Related Services

            541611 - Administrative Management and General Management Consulting Services

            541619 - Other Management Consulting Services

            Primary Business Activity:

            Services

              Total Sales ($CDN):

            $200,000 to $499,999

              Number of Employees:

            2

				Products, services and licensing

				Product / Service / Licensing

                              Service Name:

                            IT Security Consulting

                            Provide guidance to senior managers, business owners, and technical staff on appropriate and cost-effective security controls for information security and IT security.

                              Service Name:

                            Vulnerability Assessments

                            Conduct a comprehensive vulnerability assessment of the organization's IT infrastructure, network, servers, applications, desktops, and databases.

Develop an Action Plan to make recommendations to improve ineffective or inadequate security controls.

Test the security perimeter from the Internet and ensure the appropriate security measures are in place.

                              Service Name:

                            Privacy Impact Assessments

                            Ensure that privacy implications for a new or modified program or activity are integrated into the privacy risk management of the organization.

Identify and categorize the sensitivity of personal information to unauthorized or inadvertent disclosure, modification or corruption, or destruction.

Assess the adequacy of security controls for the protection of personal information for administrative, operational, and technical issues.

Determine if there are any adverse impacts or risks to individuals or the organization, and

Make recommendations to reduce risks to privacy.

                              Service Name:

                            Threat & Risk Assessments

                            Performed over seventy five TRAs following the HTRA methodology for more than sixty departments and agencies of the Government of Canada, the Government of Ontario, and large private sector organizations including Carleton University.

An assessment of threats and risks to government programs and services is fundamental to risk management and the need to determine the adequacy of security safeguards to protect valuable information and assets. A Threat and Risk Assessment (TRA) is a means to provide senior management of an organization with the necessary information to make decisions on risk. Risk is derived from the value of information and assets, or sensitivity to compromise, the likelihood of a threat event and the gravity or impact if it occurs, the probability of compromise and the severity of outcome due to the vulnerabilities, and the potential adverse impact. Risk is defined as a situation in which a threat is able to take advantage of a vulnerability to compromise sensitive information and valuable assets. Program managers are obliged to follow the principles of risk management to minimize the potential risks to programs and services.

TRAs include enterprise TRA, network TRA, SharePoint 2010, Lync Server 2010, National Forest Information System, Knowledge Network, Avaya WLAN, Education Information System, GCDOCS, Oracle 10G, Lotus Domino 6.5, IBM WebSphere 6.1, IBM Maximo, SIMSI, National Import Service Centre, STG WebCIMS, Livelink Server, Public Accounts Production System, Citrix Presentation Server, and Microsoft dot NET application development.

                              Service Name:

                            Database Security Assessments

                            Oracle, SQL Server, Sybase

                              Service Name:

                            Web Application Security Assessments

                            Performed more than twenty assessments of web applications and the related infrastructure on behalf of clients in the Government of Canada.

                              Service Name:

                            IT Security Policy and Governance Framework

                            Development of Policy Framework and Policies, Procedures, and Standards.

                              Service Name:

                            Privacy Risk Management Framework

                            Align data use and data matching processes complies with relevant privacy legislation, regulations, and policies

Assist business managers in presenting PIA's to management oversight committees and the Office of the Privacy Commissioner

Propose strategies for mitigating the identified risks relating to organizations, processes, applications, and systems

                              Service Name:

                            Privacy Risk Management Plan

                            Develop an Action Plan to mitigate or accept risks to privacy and sensitive personal information, and ensure compliance with the established privacy principles, Government directives, and federal legislation.

              FSC Code:

              5810-Communications Security Equipment and Components

              B307-Security Studies (Physical and Personal)

              D310-ADP Backup and Security Services

    Last Update Date 2016-10-18

Date Modified:

      <time>2017-03-02</time>

About government

Contact us

Departments and agencies

Public service and military

News

Treaties, laws and regulations

Government-wide reporting

Prime Minister

How government works

Open government

About this site

Social media

Mobile applications

About Canada.ca

Terms and conditions

Privacy

Top of Page

<object type="image/svg+xml" tabindex="-1" role="img" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/wmms-blk.svg" aria-label="Symbol of the Government of Canada"></object>


text:
Session.setDefault("sortby","online_status");
Session.setDefault("sortdir","-1");

//Inactivity highlighting
var br_cutoff = 50;
var day_cutoff_below_br = 30;
var day_cutoff_above_br = 60;

//Newbie
var newbie_rank = 5; //Detainee
var newbie_cutoff = 14; //When to mark as inactive
var newbie_promote = 30;  //When to mark for promotion (since outfit join)

/*
Takes the reqs array from the ItemSets collection.
Idea is that a number represents an index of an item a player needs to own and an array is a choice of items players can own
This excludes the "root" array
Examples
[1,2,3,4] 	= needs to own items 1,2,3 AND 4
[[1,2,3,4]] 	= needs to own items 1,2,3 OR 4
[1,2,[3,4]]	= needs to own items 1,2 and (3 or 4)

*/

function upcomingDay(day) {
	var dayMoment= moment().utc().day(day);
	var nextWeekDayMoment = moment().utc().day(day+7);
	return ((dayMoment < nextWeekDayMoment) ? nextWeekDayMoment.clone() : dayMoment.clone());
}

UI.registerHelper("timeTillDayHour",function(day,hour){
	return upcomingDay(day).utc().hours(hour).minutes(0).seconds(0).local();
});

UI.registerHelper("isOpsDay",function() {
	return ([0,2,3,5].indexOf((new Date()).getUTCDay())>=0);
});

UI.registerHelper("niceTimeTill", function(timestamp) {
	var dif = timestamp - Date.now();
	var difDate = new Date(dif);
	//return (dif/(1000*60*60)) + "hours"
	return  difDate.getUTCHours() + " hours " + difDate.getUTCMinutes() + " minutes " + difDate.getUTCSeconds() + " seconds";
});

UI.registerHelper("getOpsTime", function() {
	return (new Date()).setUTCHours(18,0,0,0);
}) ;

UI.registerHelper("opsMoment", function(day,hour) {
	return moment().utc().days(day+7).hours(hour).minutes(0).seconds(0).local();
});

function playerOwnsItemSet(player_items,itemset_reqs) {

	function playerHasItem(item) {
		return (player_items.indexOf(item+"") >= 0);
	}

	function recurse(item,justone) {
		if (Array.isArray(item)) {
			var succes = !justone;
			item.forEach(function(item) {
				//succes = (recurse(item,true) || (justone && succes)) //&& (!justone && !succes) // MAGIC
				if (justone!=succes) {
					succes = (recurse(item,true) && (justone!=succes));
				}//&& (!justone && !succes) // MAGIC
			});
			return succes;
		} else {
			return playerHasItem(item);
		}
	}

	if (player_items && itemset_reqs) {
		return recurse(itemset_reqs,false);
	} else {
		console.error("Invalid arguments for playerOwnsItemSet",player_items,itemset_reqs);
	}
}

function daysSince(utc) {
	return (Date.now()/1000 - utc) / (60*60*24);
}

function playerIsNewbie(player) {
	return (player.ranknum == newbie_rank);
}

function playerIsActive(player) {
	var days_since_join = daysSince(player.joindate);
	var days_since_login = daysSince(player.last_online);

	if (playerIsNewbie(player)) {
		return (days_since_login <= newbie_cutoff);
	} else {
		if (player.br >= br_cutoff) {
			return (days_since_login <= day_cutoff_above_br);
		} else {
			return (days_since_login <= day_cutoff_below_br);
		}
	}
}

function playerShouldBePromoted(player) {
	if (!playerIsNewbie(player)) {
		return false;
	}
	return (daysSince(player.joindate) >= newbie_promote);
}

Template.navbar.events({
	"click #logout_button" : function(e,tmp) {
		e.preventDefault();
		e.stopPropagation();
		console.log(Router.current().path);
		if(Router.current().path == "/settings") {
			Router.go("home");
		}
		Meteor.logout();
	}
});

//--------------------------------------------------------

Template.playertable.players = function() {
	var q = {};
	q[Session.get("sortby")]=Session.get("sortdir");

	//Dont double sort on br
	if (!Session.equals("sortby","br")) {
		q.br=-1;
	}
	return Players.find({},{sort: q});
};

Template.playertable.events({
	"click thead td, tap thead td" : function(e,tmp){
		console.log(e);
		var sortby = e.target.getAttribute("data-sortby") || e.target.parentNode.getAttribute("data-sortby");
		if (sortby) {
			Session.set("sortby", sortby);
			Session.set("sortdir", Session.get("sortdir") * -1);
		}
	}
});

Template.player.name_class = function() {
	return (this.online_status > 0) ? "player_online" : "player_offline";
};

Template.player.days_since_login = function() {
	return Math.floor(daysSince(this.last_online));
};

Template.player.days_since_join = function() {
	return Math.floor(daysSince(this.joindate));
};

Template.player.row_class = function() {
	if (!playerIsActive(this)) {
		return "danger";
	} else if (playerShouldBePromoted(this)) {
		return "succes";
	}
};

Template.player.indicator_class = function() {
	return (this.online_status > 0) ? "indicator_online" : "indicator_offline";
};

Template.player.account = function() {
	//console.log(this._id,Meteor.users.findOne({"profile.ps2_id":this._id}))
	//console.log(Meteor.users.findOne({"profile.ps2_id":this._id}) == true)
	return Meteor.users.findOne({"profile.ps2_id":this._id});
};

Template.player.account_days_since_ts_login = function() {
	var ts3_id = TSClients.findOne(this.profile.ts3_id);
	if (ts3_id) {
		return Math.floor(daysSince(ts3_id.login_date));
	}
};

//--------------------------------------------------------

Template.itemtable.itemset = function() {
	return ItemSets.find();
};

Template.itemtable.players = function() {
	return Players.find({},{sort: {br:-1}});
}	;

Template.player_items.itemset = function() {
	return ItemSets.find();
};

Template.itemset_cell.cell_class = function(player) {
	return (playerOwnsItemSet(player.items,this.reqs) ? "succes" : "danger");
};

//--------------------------------------------------------

Template.teamspeak.clients = function () {
	return TSClients.find({},{sort: {login_date:-1}});
};

Template.tsclient.days_since_login = function () {
	return Math.floor(daysSince(this.login_date));
};

//--------------------------------------------------------
Template.register_form.events({
	"click button" : function(e,tmp) {
		e.preventDefault();
		e.stopPropagation();
		Accounts.createUser({
			username: tmp.find("#username").value,
			//email: tmp.find("#email").value,
			password: tmp.find("#password").value,
			profile: {name: tmp.find("#username").value}
		},function(err) {console.log(err);});
	}
});

Template.login_form.events({
	"click #login_button" : function(e,tmp) {
		e.preventDefault();
		e.stopPropagation();
		Meteor.loginWithPassword(tmp.find("#username").value,tmp.find("#password").value,function(err){
			Session.set("errormsg",err.reason);
		});
	}
});

//--------------------------------------------------------

Template.text_update_field.fieldvalue = function() {
	if (!Meteor.user()) {return;}
	return Meteor.user().profile[this.id];
};

Template.text_update_field.events({
	"click .btn" : function(e,tmp) {
		if (!Meteor.user()) {return;}

		var value = tmp.find("input").value;
		if(this.isNumber){
			value = parseInt(value,10);
		}

		Meteor.call("updateUserProfileField",this.id,value);
	}
});

//--------------------------------------------------------
Template.hidden_modal.events({
	"click #remove_account_button" : function(e,tmp) {
		Meteor.call("removeUser");
		Meteor.logout();
		Router.go("home"); //You're drunk
	}
});
//--------------------------------------------------------
Template.settings.emails = function() {
	if (Meteor.user()) {
		return Meteor.user().emails;
	}
};

Template.settings.some_helper_name = function() {
	return Players.findOne();
};

//--------------------------------------------------------
Template.email_field.events({
	"click button" : function(e,tmp){
		e.preventDefault();
		e.stopPropagation();
		Meteor.call("sendVerificationMail",tmp.find("input").value);
	}
});

//--------------------------------------------------------
Template.update_checkbox.checked = function() {
	if (!Meteor.user()) {return;}
	if (typeof Meteor.user().profile[this.id] != "undefined") {
		return (Meteor.user().profile[this.id] && "true");
	} else {
		return "false" ;
	}
};

Template.update_checkbox.events({
	"change input" : function(e,tmp) {
		Meteor.call("updateUserProfileField",this.id,tmp.find("input").checked);
	}
});

//--------------------------------------------------------

Template.change_password_form.events({
	"click #change_password_button" : function(e,tmp) {
		e.preventDefault();
		e.stopPropagation();

		var pw_fields = tmp.findAll("input[type=\"password\"]");

		if (pw_fields[0].value===pw_fields[1].value) {
			Accounts.changePassword(tmp.find("#old_password").value,tmp.find("#new_password").value);
		} else {
			Session.set("errormsg","Passwords don't match");
		}
	}
});

Template.errormsg.msg = function() {
	return Session.get("errormsg");
};

Template.errormsg.events({
	"click button" : function(e,tmp) {
		Session.set("errormsg",null);
	}
});

Template.user_all_character_data.ps_char = function() {
	return Players.findOne(Meteor.user().profile.ps2_id);
};

Template.user_all_character_data.ts_id = function() {
	return Players.findOne(Meteor.user().profile.ts3_id);
};

Template.ps2_char_info.name = function() {
	var ps2_char = Players.findOne(Meteor.user().profile.ps2_id);
	if (ps2_char) {
		return ps2_char.name;
	}
};

Template.ts3_id_info.name = function() {
	if(Meteor.user() && Meteor.user.profile) {
		var ts_id = TSClients.findOne(Meteor.user().profile.ts3_id);
		if (ts_id) {
			return ts_id.name;
		}
	}
};

Template.user_array_as_labels.user_array =  function(){
	if (!this.user) {return;}
	if (!this.user.profile) {return;}
	if (!this.user.profile[this.arrayname]) {return;}
	return this.user.profile[this.arrayname];
};

Template.user_array_as_labels.events({
	"click i" : function(e,tmp) {
		Meteor.call("userPullProfileArray",tmp.data.arrayname,this.toString());
	}
});

//Adds to profile array
Template.user_array_append_button.events({
	"click button" : function(e,tmp) {
		e.preventDefault();
		e.stopPropagation();
		Meteor.call("userAppendProfileArray",this.arrayname,tmp.find("input").value);
	}
});

//Removes from profile array
Template.member_info_label.events({
	"click .btn" : function(e,tmp) {
		e.preventDefault();
		e.stopPropagation();
		Meteor.call("userAppendProfileArray","skills",tmp.find("input").value);
	}
});

Template.member_info_label.should_show_close = function(parent) {
	return parent.user._id == Meteor.userId();
};

Template.member_info.meteor_users = function (){
	return Meteor.users.find();
};


text:
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
info: String.prototype.toLowerCase()
es5id: 15.5.4.16_A1_T8
description: Call toLowerCase() function of Infinity
---*/

Number.prototype.toLowerCase = String.prototype.toLowerCase;

if (Infinity.toLowerCase()!== "infinity") {
  $ERROR('#1: Number.prototype.toLowerCase = String.prototype.toLowerCase; Infinity.toLowerCase()=== "infinity". Actual: '+Infinity.toLowerCase());
}


text:
'use strict'
import React from 'react'
import { View, Text, Modal, StyleSheet} from 'react-native'

var Button = require('./button')

class MyModal extends React.Component{
  constructor(props) {
    super(props)
    this.state = {
      animationType: 'fade',
      transparent: true,
    }
  }
  render() {
    var modalBackgroundStyle = {
      backgroundColor: this.state.transparent ? 'rgba(0, 0, 0, 0.5)' : '#f5fcff',
    };
    var innerContainerTransparentStyle = this.state.transparent
      ? {backgroundColor: '#fff', padding: 20}
      : null;
    var activeButtonStyle = {
      backgroundColor: '#ddd'
    }
    return(
      <Modal
        animationType={this.state.animationType}
        transparent={this.state.transparent}
        visible={true}
        onRequestClose={() => this.setState({modalVisible: !this.state.modalVisible})}
        >
        <View style={[styles.container, modalBackgroundStyle]}>
          <View style={[styles.innerContainer, innerContainerTransparentStyle]}>
            {this.props.children}
            <Button
              onPress={this.props.switchVisible}>
              Close
            </Button>
          </View>
        </View>
      </Modal>
    )
  }
}

var styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    padding: 20,
  },
  innerContainer: {
    borderRadius: 10,
  },
  row: {
    alignItems: 'center',
    flex: 1,
    flexDirection: 'row',
    marginBottom: 20,
  },
  rowTitle: {
    flex: 1,
    fontWeight: 'bold',
  },
  button: {
    borderRadius: 5,
    flex: 1,
    height: 44,
    alignSelf: 'stretch',
    justifyContent: 'center',
    overflow: 'hidden',
  },
  buttonText: {
    fontSize: 18,
    margin: 5,
    textAlign: 'center',
  },
  modalButton: {
    marginTop: 10,
    alignSelf: 'center'
  },
  pickerItem: {
    fontSize: 16,
  },
});

module.exports = MyModal


text:
import debug from 'debug';

function debugPouch(PouchDB) {
  PouchDB.debug = debug;
  var logs = {};
  /* istanbul ignore next */
  PouchDB.on('debug', function (args) {
    // first argument is log identifier
    var logId = args[0];
    // rest should be passed verbatim to debug module
    var logArgs = args.slice(1);
    if (!logs[logId]) {
      logs[logId] = debug('pouchdb:' + logId);
    }
    logs[logId].apply(null, logArgs);
  });
}

export default debugPouch;


text:
'use strict';

var _ = require('lodash');
var Validator = require('swagger-model-validator');
var serverUrl = require('./serverUrl');

var grameneSwaggerClient = (function() {
  var SwaggerClient = require('swagger-client');

  return new SwaggerClient({url: serverUrl(), usePromise: true})
    .then(function addValidator(client) {
    new Validator(client);
    return client;
  });
})();

module.exports = grameneSwaggerClient;