text:
package org.wso2.carbon.automation.extensions.servers.webserver;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.nio.charset.Charset;

public class SimpleWebServer extends Thread {
    private volatile boolean running = true;
    private int port;
    private int expectedResponseCode;
    protected Log log = LogFactory.getLog(SimpleWebServer.class);

    public SimpleWebServer(int listenPort, int expectedResponseCode) {
        this.port = listenPort;
        this.expectedResponseCode = expectedResponseCode;
    }

    public void run() {
        ServerSocket serverSocket = null;
        Socket connectionSocket = null;
        try {
            log.info("Trying to bind to localhost on port " + Integer.toString(port) + "...");
            serverSocket = new ServerSocket(port);
            log.info("Running Simple WebServer!\n");
            connectionSocket = serverSocket.accept();
            connectionSocket.setSoTimeout(30000);
            //go in a infinite loop, wait for connections, process request, send response
            while (running) {
                log.info("\nReady, Waiting for requests...\n");
                try {
                    //this call waits/blocks until someone connects to the port we
                    BufferedReader input;
                    if (!connectionSocket.isClosed()) {
                        InetAddress client = connectionSocket.getInetAddress();
                        log.info(client.getHostName() + " connected to server.\n");
                        input = new BufferedReader(new InputStreamReader(connectionSocket.
                                getInputStream(), Charset.defaultCharset()));
                        if (input.ready()) {
                            DataOutputStream output =
                                    new DataOutputStream(connectionSocket.getOutputStream());
                            httpHandler(input, output);
                        }
                    }
                    //Prepare a outputStream. This will be used sending back our response
                    //(header + requested file) to the client.
                } catch (Exception e) { //catch any errors, and print them
                    log.info("\nError:" + e.getMessage());
                    running = false;
                }
            }
        } catch (Exception e) {
            log.error("\nFatal Error:" + e.getMessage());
            running = false;
        } finally {
            try {
                if (connectionSocket != null) {
                    connectionSocket.close();
                    serverSocket.close();
                }
            } catch (IOException e) {
                log.error("Error while shutting down server sockets", e);
            }
        }
    }

    private void httpHandler(BufferedReader input, DataOutputStream output)
            throws IOException, InterruptedException {
        String contentType;
        String tmp;
        try {
            tmp = input.readLine(); //read from the stream
            contentType = input.readLine();
            log.info(tmp);
            assert tmp != null;
            String sampleReturnResponse = "<testResponse>\n" +
                    "   <message>" + tmp.toUpperCase() + "Success</message>\n" +
                    " </testResponse>";
            output.writeBytes(constructHttpHeader(expectedResponseCode, contentType));
            output.write(sampleReturnResponse.getBytes(Charset.defaultCharset()));
        } catch (Exception e) {
            log.error("error" + e.getMessage());
        } finally {
            output.flush();
            Thread.sleep(1000);
            input.close();
            output.close();
        }
    }

    private String constructHttpHeader(int returnCode, String contentType) {
        String header = "HTTP/1.0 ";
        switch (returnCode) {
            case 200:
                header = header + "200 OK";
                break;
            case 400:
                header = header + "400 Bad Request";
                break;
            case 403:
                header = header + "403 Forbidden";
                break;
            case 404:
                header = header + "404 Not Found";
                break;
            case 500:
                header = header + "500 Internal Server Error";
                break;
            case 501:
                header = header + "501 Not Implemented";
                break;
            case 503:
                header = header + "503 Error";
                break;
            default:
                header = header + returnCode + " Testing response code";
        }
        header = header + "\r\n"; //other header fields,
        header = header + "Connection: close\r\n"; //can't handle persistent connections
        header = header + "Server: SimpleWebServer\r\n"; //server name
        header = header + contentType + "\r\n";
        header = header + "\r\n";
        return header;
    }

    public void terminate() throws IOException {
        running = false;
    }
}


text:
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class OauthClients extends Model{
    protected $table = 'oauth_clients';
}

redpajama_set_name: RedPajamaGithub


text:
#ifndef ISL_STREAM_H
#define ISL_STREAM_H

#include <stdio.h>
#include <isl/hash.h>
#include <isl/aff_type.h>
#include <isl/obj.h>
#include <isl/val.h>
#include <isl/schedule_type.h>

#if defined(__cplusplus)
extern "C" {
#endif

enum isl_token_type { ISL_TOKEN_ERROR = -1,
			ISL_TOKEN_UNKNOWN = 256, ISL_TOKEN_VALUE,
			ISL_TOKEN_IDENT, ISL_TOKEN_GE,
			ISL_TOKEN_LE, ISL_TOKEN_GT, ISL_TOKEN_LT,
			ISL_TOKEN_NE, ISL_TOKEN_EQ_EQ,
			ISL_TOKEN_LEX_GE, ISL_TOKEN_LEX_LE,
			ISL_TOKEN_LEX_GT, ISL_TOKEN_LEX_LT,
			ISL_TOKEN_TO, ISL_TOKEN_AND,
			ISL_TOKEN_OR, ISL_TOKEN_EXISTS, ISL_TOKEN_NOT,
			ISL_TOKEN_DEF, ISL_TOKEN_INFTY, ISL_TOKEN_NAN,
			ISL_TOKEN_MIN, ISL_TOKEN_MAX, ISL_TOKEN_RAT,
			ISL_TOKEN_TRUE, ISL_TOKEN_FALSE,
			ISL_TOKEN_CEILD, ISL_TOKEN_FLOORD, ISL_TOKEN_MOD,
			ISL_TOKEN_STRING,
			ISL_TOKEN_MAP, ISL_TOKEN_AFF,
			ISL_TOKEN_CEIL, ISL_TOKEN_FLOOR,
			ISL_TOKEN_IMPLIES,
			ISL_TOKEN_LAST };

struct isl_token;

__isl_give isl_val *isl_token_get_val(isl_ctx *ctx, struct isl_token *tok);
__isl_give char *isl_token_get_str(isl_ctx *ctx, struct isl_token *tok);
int isl_token_get_type(struct isl_token *tok);
void isl_token_free(struct isl_token *tok);

struct isl_stream;
typedef struct isl_stream isl_stream;

__isl_give isl_stream *isl_stream_new_file(isl_ctx *ctx, FILE *file);
__isl_give isl_stream *isl_stream_new_str(isl_ctx *ctx, const char *str);
void isl_stream_free(__isl_take isl_stream *s);

isl_ctx *isl_stream_get_ctx(__isl_keep isl_stream *s);

void isl_stream_error(__isl_keep isl_stream *s, struct isl_token *tok,
	char *msg);

struct isl_token *isl_stream_next_token(__isl_keep isl_stream *s);
struct isl_token *isl_stream_next_token_on_same_line(__isl_keep isl_stream *s);
int isl_stream_next_token_is(__isl_keep isl_stream *s, int type);
void isl_stream_push_token(__isl_keep isl_stream *s, struct isl_token *tok);
void isl_stream_flush_tokens(__isl_keep isl_stream *s);
int isl_stream_eat_if_available(__isl_keep isl_stream *s, int type);
char *isl_stream_read_ident_if_available(__isl_keep isl_stream *s);
int isl_stream_eat(__isl_keep isl_stream *s, int type);
int isl_stream_is_empty(__isl_keep isl_stream *s);
int isl_stream_skip_line(__isl_keep isl_stream *s);

enum isl_token_type isl_stream_register_keyword(__isl_keep isl_stream *s,
	const char *name);

struct isl_obj isl_stream_read_obj(__isl_keep isl_stream *s);
__isl_give isl_val *isl_stream_read_val(__isl_keep isl_stream *s);
__isl_give isl_multi_aff *isl_stream_read_multi_aff(__isl_keep isl_stream *s);
__isl_give isl_map *isl_stream_read_map(__isl_keep isl_stream *s);
__isl_give isl_set *isl_stream_read_set(__isl_keep isl_stream *s);
__isl_give isl_pw_qpolynomial *isl_stream_read_pw_qpolynomial(
	__isl_keep isl_stream *s);
__isl_give isl_union_set *isl_stream_read_union_set(__isl_keep isl_stream *s);
__isl_give isl_union_map *isl_stream_read_union_map(__isl_keep isl_stream *s);
__isl_give isl_schedule *isl_stream_read_schedule(isl_stream *s);

int isl_stream_yaml_read_start_mapping(__isl_keep isl_stream *s);
int isl_stream_yaml_read_end_mapping(__isl_keep isl_stream *s);
int isl_stream_yaml_read_start_sequence(__isl_keep isl_stream *s);
int isl_stream_yaml_read_end_sequence(__isl_keep isl_stream *s);
int isl_stream_yaml_next(__isl_keep isl_stream *s);

#if defined(__cplusplus)
}
#endif

#endif


text:
/**
 * IR transformations.
 */
package net.sandius.rembulan.compiler.tf;


text:
🥟 Dumpling
============

[![Build Status](https://travis-ci.org/pingcap/dumpling.svg?branch=master)](https://travis-ci.org/pingcap/dumpling)
[![codecov](https://codecov.io/gh/pingcap/dumpling/branch/master/graph/badge.svg)](https://codecov.io/gh/pingcap/dumpling)
[![API Docs](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white)](https://pkg.go.dev/github.com/pingcap/dumpling)
[![Go Report Card](https://goreportcard.com/badge/github.com/pingcap/dumpling)](https://goreportcard.com/report/github.com/pingcap/dumpling)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fpingcap%2Fdumpling.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fpingcap%2Fdumpling?ref=badge_shield)
[![Discuss in Slack](https://img.shields.io/badge/slack-sig--migrate-4A154B?logo=slack)](https://slack.tidb.io/invite?team=tidb-community&channel=sig-migrate&ref=github_sig)

**Dumpling** is a tool and a Go library for creating SQL dump from a MySQL-compatible database.
It is intended to replace `mysqldump` and `mydumper` when targeting TiDB.

You may read the [design document](https://github.com/pingcap/community/blob/master/rfc/2019-12-06-dumpling.md), [English user guide](docs/en/user-guide.md) and [中文使用手册](docs/cn/user-guide.md) for details.

Features
--------

> Dumpling is currently in early development stage, and most features are incomplete. Contributions are welcomed!

- [x] SQL dump is split into multiple files (like `mydumper`) for easy management.
- [x] Export multiple tables in parallel to speed up execution.
- [x] Multiple output formats: SQL, CSV, ...
- [ ] Write to cloud storage (S3, GCS) natively
- [x] Advanced table filtering

Any questions? Let's discuss in [#sig-migrate in Slack](https://slack.tidb.io/invite?team=tidb-community&channel=sig-migrate&ref=github_sig)!

Building
--------

0. Under directory `tidb`
1. Install Go 1.16 or above
2. Run `make build_dumpling` to compile. The output is in `bin/dumpling`.
3. Run `make dumpling_unit_test` to run the unit tests.
4. Run `make dumpling_integration_test` to run integration tests. For integration test:
  - The following executables must be copied or generated or linked into these locations:
    * `bin/sync_diff_inspector` (download from [tidb-enterprise-tools-latest-linux-amd64](http://download.pingcap.org/tidb-enterprise-tools-latest-linux-amd64.tar.gz))
    * `bin/tidb-server` (download from [tidb-master-linux-amd64](https://download.pingcap.org/tidb-master-linux-amd64.tar.gz))
    * `bin/tidb-lightning` (download from [tidb-toolkit-latest-linux-amd64](https://download.pingcap.org/tidb-toolkit-latest-linux-amd64.tar.gz))
    * `bin/minio` (download from <https://min.io/download>)
    * Now, you can run `sh ./dumpling/install.sh` to get the above binary files.
  - The following programs must be installed:
    * `mysql` (the CLI client)
  - There must be a local mysql server listening on `127.0.0.1:3306`, and an active user with no password that can be connected through this TCP address.

License
-------

Dumpling is under the Apache 2.0 license. See the [LICENSE](./LICENSE) file for details.

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fpingcap%2Fdumpling.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fpingcap%2Fdumpling?ref=badge_large)


text:
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import rootReducer from './reducer';

const configureStore = preloadedState => {
  const store = createStore(
    rootReducer,
    preloadedState,
    applyMiddleware(thunk)
  );
  return store;
};

export default configureStore;


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

<title>A-Index</title>
<meta name="date" content="2015-07-15">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

A B C D E F G H I J K L M N O P R S T U V W _

A

AALComponent - Class in models.sensors

AALComponent() - Constructor for class models.sensors.AALComponent

AbstractMonitor - Class in monitor

Created by Aleksander Skraastad (myth) on 7/7/15.

AbstractMonitor() - Constructor for class monitor.AbstractMonitor

actionMap - Variable in class core.MyWebSocketManager

activeJobs - Static variable in class models.sensors.ComponentReading.Generator

addEventListener(EventListener) - Method in class core.event.EventHandler

Register an object as an event listener

address - Variable in class models.Callee

address - Variable in class models.Patient

ADMINISTRATOR - Static variable in class controllers.auth.Authorization

ADMINISTRATOR - Static variable in class models.AlarmAttendant

age - Variable in class models.Patient

alarm - Variable in class core.event.Event

Alarm - Class in models

Alarm() - Constructor for class models.Alarm

ALARM_DISPATCHED - Static variable in class core.GoogleCloudMessaging

AlarmAttendant - Class in models

AlarmAttendant() - Constructor for class models.AlarmAttendant

alarmForm - Static variable in class controllers.Application

alarmId - Variable in class monitor.LocalMonitor.AssignmentReminderTask

alarmId - Variable in class monitor.LocalMonitor.ResolutionReminderTask

alarmListToJsonAlarmLog(List<Alarm>) - Static method in class controllers.Application

Convert a list of alarms into json alarm logs containing date and type of alarms

alarmsAssignedToMe() - Static method in class controllers.Application

Retrieves a list of alarms currently assigned to the logged in user

all() - Static method in class controllers.Location

Retrieve a JSON object with a list of all location entries in the database for all field operators

all() - Static method in class models.Alarm

all() - Static method in class models.AlarmAttendant

all() - Static method in class models.ApiKey

all() - Static method in class models.Assessment

all() - Static method in class models.Callee

all() - Static method in class models.FieldOperatorLocation

Get all location entries in the database.

all() - Static method in class models.NMI

all() - Static method in class models.Patient

allOpenAlarms() - Static method in class models.Alarm

allOpenAlarmsJson() - Static method in class controllers.Application

Retrieve all open alarms as JSON

API_BASIC - Static variable in class controllers.auth.Authorization

API_BASIC - Static variable in class models.AlarmAttendant

API_FULL - Static variable in class controllers.auth.Authorization

API_FULL - Static variable in class models.AlarmAttendant

API_MEDIUM - Static variable in class controllers.auth.Authorization

API_MEDIUM - Static variable in class models.AlarmAttendant

ApiKey - Class in models

Created by Aleksander Skraastad (myth) on 7/10/15.

ApiKey() - Constructor for class models.ApiKey

apiKeyForm - Static variable in class controllers.AttendantController

app - Static variable in class BaseModelTest

Application - Class in controllers

Application() - Constructor for class controllers.Application

ApplicationTest - Class in <Unnamed>

Simple (JUnit) tests that can call all parts of a play app.

ApplicationTest() - Constructor for class ApplicationTest

ApplicationTest - Class in controllers

Created by Aleksander Skraastad (myth) on 6/12/15.

ApplicationTest() - Constructor for class controllers.ApplicationTest

assessment - Variable in class models.Alarm

Assessment - Class in models

Created by Aleksander Skraastad (myth) on 6/19/15.

Assessment() - Constructor for class models.Assessment

assignAlarmFromJson() - Static method in class controllers.Application

Assign an attendant to an Alarm based on the POST request body and active user

assignAttendantToAlarm(Long, AlarmAttendant) - Static method in class models.Alarm

assigned - Variable in class monitor.external.ibm.IBMMonitor

assignedToUser(AlarmAttendant) - Static method in class models.Alarm

Retrieve all Alarms from the database that has been assigned to the provided AlarmAttendant object.

ASSIGNMENT_TIME_THRESHOLD - Static variable in class monitor.LocalMonitor

AssignmentReminderTask(LocalMonitor, Long) - Constructor for class monitor.LocalMonitor.AssignmentReminderTask

ATTENDANT - Static variable in class controllers.auth.Authorization

attendant - Variable in class core.event.Event

attendant - Variable in class models.Alarm

ATTENDANT - Static variable in class models.AlarmAttendant

AttendantController - Class in controllers

AttendantController() - Constructor for class controllers.AttendantController

attendantForm - Static variable in class controllers.AttendantController

attendants() - Static method in class controllers.AttendantController

Listing controller of the /attendants endpoint

authenticate() - Static method in class controllers.Application

Default authentication controller.

Authentication - Class in controllers.auth

Created by Aleksander Skraastad (myth) on 6/8/15.

Authentication() - Constructor for class controllers.auth.Authentication

Authentication.Login - Class in controllers.auth

AuthenticationTest - Class in controllers.auth

AuthenticationTest() - Constructor for class controllers.auth.AuthenticationTest

Authorization - Class in controllers.auth

Created by Aleksander Skraastad (myth) on 6/8/15.

Authorization() - Constructor for class controllers.auth.Authorization

Authorization.Authorized - Class in controllers.auth

The Authorized class is a Play Authenticator extension
 that allows decoration of actions.

Authorization.PrivilegeLevel - Annotation Type in controllers.auth

PrivilegeLevel annotation can be used on controller methods that should
 specify different access levels.

Authorization.PrivilegeLevelAction - Class in controllers.auth

Action performed when using the PrivilegeLevel annotation

Authorized() - Constructor for class controllers.auth.Authorization.Authorized

A B C D E F G H I J K L M N O P R S T U V W _

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes


text:
fashnoid.controller('ProfessionalCtl', function($scope, $location, UserService, $rootScope, $routeParams) {

	var profssType = $routeParams.professionalType;
	console.log("user type ---,", profssType);
	if(profssType != undefined && profssType != null) {
		var userType = 'FASHION_PHOTOGRAPHER';
		if(profssType == 'stylish') {
			userType = 'FASHION_STYLIST';
		} else if(profssType == 'designer') {
			userType = 'FASHION_DESIGNER';
		}else if(profssType == 'blogger') {
			userType = 'FASHION_BLOGGER';
		}
		$scope.professionals = UserService.getProfessionals(userType, 10, 0);
		$scope.professionals.then(function(response) {
			console.log( ' response ',response);
			if( response.status == 200 ) {

			} else {
				alert('Getting professionals detail error ...');
			}

	    });
	} else {
		var redirectPath = '/homhomepage';
		if($scope.user != null)
			redirectPath = '/';
		$location.path(redirectPath);

	}

});


text:
export default class SlideyController {
  constructor($scope, $element) {
    this.$scope = $scope;
    this.$element = $element;
  }

  $onInit() {
    this.contentWidth = this.contentWidth || '80%';
    this.opened = this.opened || false;
    this.$scope.$watch('$ctrl.opened', this._onOpenedChanged.bind(this));
  }

  $postLink() {
    this._wrapper = this.$element[0].querySelector('.slidey-content-wrapper');
    this._content = this.$element[0].querySelector('.slidey-content');
    this._overlay = this.$element[0].querySelector('.slidey-overlay');
    this._wrapper.addEventListener('transitionend', this._onTransitionEnd.bind(this), {
      passive: true
    });
    this.setNested(this._nested);
    this.adjustContainer();
  }

  $onChanges(changes) {
    if (changes.contentWidth) {
      this.setNested(this._nested);
    }

    if (changes.reflowContainer) {
      this._container = this.reflowContainer ? document.getElementById(this.reflowContainer) : null;
      this.adjustContainer();
    }
  }

  open() {
    this.opened = true;
  }

  close() {
    this.opened = false;
    if (this.onClose) {
      this.onClose();
    }
  }

  _onOpenedChanged() {
    if (this.opened) {
      this.$element.addClass('opened');
    } else {
      this.$element.removeClass('opened');
    }

    if (this.parentSlidey) {
      this._container = this._container || this.parentSlidey._container;
      this.parentSlidey.setNested(this.opened);
    }
    this.adjustContainer();
  }

  _onTransitionEnd(event) {
    // Bail if it wasn't the transform that changed
    if (event.propertyName !== 'transform') return;

    if (!this.opened && this.onCloseFinished) {
      this.$scope.$apply(() => {
        this.onCloseFinished();
      });
    }
  }

  setNested(nested) {
    this._nested = nested;
    if (!this._wrapper) {
      return;
    }

    if (this._nested) {
      this._contentObserver && this._contentObserver.disconnect();
      this._wrapper.style.width = '100%';
      this.$element.addClass('nested');
    } else {
      this._wrapper.style.width = this.contentWidth;
      this.$element.removeClass('nested');
      this.adjustContainer();
    }
  }

  adjustContainer() {
    if (!window.MutationObserver) {
      throw new Error('Unfortunately, this browser doesn\'t support the MutationObserver API!');
    }
    if (!this._container || !this._wrapper) {
      return;
    }
    this._containerObserver && this._containerObserver.disconnect();
    this._contentObserver && this._contentObserver.disconnect();
    if (this.opened) {
      // We need to watch the content for changes to cover instances
      // where we have async calls or are waiting for angular to bind
      this._contentObserver = new MutationObserver((mutations) => {
        if (!this.opened) return;

        this._container.style.height = this.contentHeight;
      });
      this._contentObserver.observe(this._wrapper, {
        childList: true,
        subtree: true,
        attributes: true,
        attributeFilter: ['class', 'style']
      });
      this._container.style.height = this.contentHeight;
    } else if (this.parentSlidey && this.parentSlidey.opened) {
      this._container.style.height = this.parentSlidey.contentHeight;
    } else if (!this.parentSlidey) {
      // We need to watch the container for changes to cover instances
      // where we have async calls or are waiting for angular to bind
      this._containerObserver = new MutationObserver((mutations) => {
        if (this.opened) return;

        this._containerHeight = this._container.scrollHeight;
      });
      this._containerObserver.observe(this._container, {
        childList: true,
        subtree: true,
        attributes: true,
        attributeFilter: ['class', 'style']
      });
      this._container.style.height = '';
    }
  }

  get containerHeight() {
    if (!this._containerHeight) {
      this._containerHeight = this.parentSlidey && this.parentSlidey._containerHeight || this._container.scrollHeight;
    }
    return this._containerHeight;
  }

  get contentHeight() {
    return this._content.scrollHeight < this.containerHeight ? `${this.containerHeight}px` : `${this._content.scrollHeight}px`;
  }
}

SlideyController.$inject = ['$scope', '$element'];


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>All Natural, Organic Self-Confidence</title>

  <link href='https://fonts.googleapis.com/css?family=Oswald|Lobster|Ubuntu:400,400italic,700,700italic' rel='stylesheet' type='text/css'>

  <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.css">
  <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.css">
  <link rel="stylesheet" type="text/css" href="../css/main.css">
  <link rel="stylesheet" type="text/css" href="../css/responsive.css">

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

Jock Dalby

Web Developer.

Home

Blogs

Contact

Search Inside Yourself
Chapter Four - All Natural, Organic Self-Confidence

        Chapter Four of 'Search Inside yourself' by Chade-Meng Tan writes about emotional awareness, accurate self-assessment and self-confidence. All three disciplines require you to pay close attention to your emotional state and in particular, reflect on oneself during and after experienceing high levels of emotions.

        One additional technique I have practiced this week is called 'Body Scan'. This is very similar to mindfulness mediation but instead of just focusing on breathing, you slowly move your attention around different areas of your body, and try to detect different sensations and emotions. I found body scan to be relaxing and easier to maintain concentration than when just focusing on breathing alone.

        Meng leaves us with a quick lesson on "your emotions are not you"; emotions are something we experience rather that something we become. Once we learn to recognise our emotions rising, we can then make a conscious decision weather or not we want to experience them, and to what degree. This makes clear sense to me as I am not someone who gets worked up easily, but I will be making a bigger effort over the next few weeks to recognise my emotions more and more.

        Cheers,

© Jock Dalby 2016


text:
package com.tle.core.fedsearch.impl;

import com.tle.beans.entity.BaseEntityLabel;
import com.tle.beans.entity.FederatedSearch;
import com.tle.common.institution.CurrentInstitution;
import com.tle.core.entity.dao.impl.AbstractEntityDaoImpl;
import com.tle.core.fedsearch.FederatedSearchDao;
import com.tle.core.guice.Bind;
import com.tle.core.remoting.RemoteFederatedSearchService;
import java.util.List;
import javax.inject.Singleton;
import org.hibernate.Query;
import org.hibernate.criterion.Restrictions;

@Bind(FederatedSearchDao.class)
@Singleton
public class FederatedSearchDaoImpl extends AbstractEntityDaoImpl<FederatedSearch>
    implements FederatedSearchDao {
  public FederatedSearchDaoImpl() {
    super(FederatedSearch.class);
  }

  @Override
  @SuppressWarnings({"unchecked", "nls"})
  public List<Long> findEngineNamesByType(String type) {
    return getHibernateTemplate()
        .findByNamedParam(
            "select id from FederatedSearch where institution = :i and type = :type",
            new String[] {"i", "type"},
            new Object[] {CurrentInstitution.get(), type});
  }

  @Override
  @SuppressWarnings("nls")
  public List<FederatedSearch> enumerateAllZ3950() {
    return findAllByCriteria(
        Restrictions.eq("institution", CurrentInstitution.get()),
        Restrictions.eq("type", "Z3950SearchEngine"));
  }

  @Override
  public List<BaseEntityLabel> listEnabled() {
    return listAll(
        RemoteFederatedSearchService.ENTITY_TYPE,
        new ListCallback() {

          @Override
          public String getAdditionalJoins() {
            return null;
          }

          @Override
          public String getAdditionalWhere() {
            return "be.disabled = false";
          }

          @Override
          public String getOrderBy() {
            return null;
          }

          @Override
          public void processQuery(Query query) {}

          @Override
          public boolean isDistinct() {
            return false;
          }
        });
  }
}


text:
module Stages
  # Place shared functionality between Stage mutations here to stay DRY.
  module StagesConcern

    def validate_actions
      actions && actions.each do |action|
        # Can this validation somehow be done by the action
        # mutation without having to also run the execute method?
        # A: It Can't, we need a valid stage to do so
        # And stage is nil at this point. There might be a way around this
        # using some mutation settings. If you're refactoring this
        # feel free to remove this comment!
        if !action[:name] || !action[:name].is_a?(String) || action[:name] == ''
          add_error :actions,
                    :invalid_name,
                    "'#{action[:name]}' is not a valid action name"
        end

        validate_images(action[:images])
      end
    end

    def set_actions
      actions && actions.each do |action|
        if action[:id]
          @outcome = StageActions::UpdateStageAction.run(user: user,
                                                         attributes: action,
                                                         images: action[:images],
                                                         stage_id: "#{@stage.id}",
                                                         id: action[:id])

        else
          @outcome = StageActions::CreateStageAction.run(user: user,
                                                         attributes: action,
                                                         images: action[:images],
                                                         id: "#{@stage.id}")
        end
      end
    end
  end
end


text:
#pragma once
#include <aws/cognito-idp/CognitoIdentityProvider_EXPORTS.h>
#include <aws/cognito-idp/model/NotifyConfigurationType.h>
#include <aws/cognito-idp/model/AccountTakeoverActionsType.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace CognitoIdentityProvider
{
namespace Model
{

  /**
   *
Configuration for mitigation actions and notification for different levels of
   * risk detected for a potential account takeover.

See Also:
   AWS
   * API Reference

   */
  class AWS_COGNITOIDENTITYPROVIDER_API AccountTakeoverRiskConfigurationType
  {
  public:
    AccountTakeoverRiskConfigurationType();
    AccountTakeoverRiskConfigurationType(Aws::Utils::Json::JsonView jsonValue);
    AccountTakeoverRiskConfigurationType& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
The notify configuration used to construct email notifications.

     */
    inline const NotifyConfigurationType& GetNotifyConfiguration() const{ return m_notifyConfiguration; }

    /**
     *
The notify configuration used to construct email notifications.

     */
    inline void SetNotifyConfiguration(const NotifyConfigurationType& value) { m_notifyConfigurationHasBeenSet = true; m_notifyConfiguration = value; }

    /**
     *
The notify configuration used to construct email notifications.

     */
    inline void SetNotifyConfiguration(NotifyConfigurationType&& value) { m_notifyConfigurationHasBeenSet = true; m_notifyConfiguration = std::move(value); }

    /**
     *
The notify configuration used to construct email notifications.

     */
    inline AccountTakeoverRiskConfigurationType& WithNotifyConfiguration(const NotifyConfigurationType& value) { SetNotifyConfiguration(value); return *this;}

    /**
     *
The notify configuration used to construct email notifications.

     */
    inline AccountTakeoverRiskConfigurationType& WithNotifyConfiguration(NotifyConfigurationType&& value) { SetNotifyConfiguration(std::move(value)); return *this;}

    /**
     *
Account takeover risk configuration actions

     */
    inline const AccountTakeoverActionsType& GetActions() const{ return m_actions; }

    /**
     *
Account takeover risk configuration actions

     */
    inline void SetActions(const AccountTakeoverActionsType& value) { m_actionsHasBeenSet = true; m_actions = value; }

    /**
     *
Account takeover risk configuration actions

     */
    inline void SetActions(AccountTakeoverActionsType&& value) { m_actionsHasBeenSet = true; m_actions = std::move(value); }

    /**
     *
Account takeover risk configuration actions

     */
    inline AccountTakeoverRiskConfigurationType& WithActions(const AccountTakeoverActionsType& value) { SetActions(value); return *this;}

    /**
     *
Account takeover risk configuration actions

     */
    inline AccountTakeoverRiskConfigurationType& WithActions(AccountTakeoverActionsType&& value) { SetActions(std::move(value)); return *this;}

  private:

    NotifyConfigurationType m_notifyConfiguration;
    bool m_notifyConfigurationHasBeenSet;

    AccountTakeoverActionsType m_actions;
    bool m_actionsHasBeenSet;
  };

} // namespace Model
} // namespace CognitoIdentityProvider
} // namespace Aws


text:
// Proxy and Server class to support legacy web socket implementation as well as newest version
// https://github.com/wcauchois/websocket-fallback

var util     = require("util")
  , events   = require('events')

try {
  WebSocketServer   = require('websocket-server');
  WebSocketRequest  = require('websocket').request;
  Mixin             = require('websocket-server/lib/lang/mixin');
  miksagoConnection = require('websocket-server/lib/ws/connection');
} catch(e) {
  console.log("You probably need to install the following modules: websocket-server, websocket, commander");
  console.log("Locally with `npm install websocket-server websocket commander` or globally with `sudo npm install -g websocket-server websocket commander`");
  process.exit(1);
}

function ConnectionProxy(conn, server) {

  events.EventEmitter.call(this);

  this._conn = conn;
  this._server = server;
  this.storage = {};
  this.remoteAddress = this._conn.remoteAddress;
  this.specs = this._conn.specs;

  this._conn.on('message', (function(msg) {
    if (typeof msg.type !== 'undefined') {
      if (msg.type !== 'utf8') {
        return;
      }
      msg = msg.utf8Data;
    }
    this.emit('message', msg);
  }).bind(this));

  this._conn.on('close', (function() {
    this.emit('close');
    this._server.emit('close', this);
  }).bind(this));
}

util.inherits(ConnectionProxy, events.EventEmitter);

ConnectionProxy.prototype.send = function(msg) {
  if (typeof this._conn.sendUTF == 'function') {
    this._conn.sendUTF(msg);
  } else {
    this._conn.send(msg);
  }
};

function ConnectionServer(options) {
  events.EventEmitter.call(this);
  options = options || {};

  this.httpServer = options.httpServer;
  this.miksagoServer = WebSocketServer.createServer();
  this.miksagoServer.server = this.httpServer;

  this._err = options.err || function(e) { };
  this.config = Mixin({
    maxReceivedFrameSize: 0x10000,
    maxReceivedMessageSize: 0x100000,
    fragmentOutgoingMessages: true,
    fragmentationThreshold: 0x4000,
    keepalive: true,
    keepaliveInterval: 20000,
    assembleFragments: true,
    disableNagleAlgorithm: true,
    closeTimeout: 5000
  }, options.config);

  this.miksagoServer.on('connection', (function(conn) {
    conn.remoteAddress = conn._socket.remoteAddress;
    conn.specs = 'legacy';
    this._handleConnection(conn);
  }).bind(this));

  this.httpServer.on('upgrade', (function(req, socket, head) {

    if (typeof req.headers['sec-websocket-version'] !== 'undefined') {
      var wsRequest = new WebSocketRequest(socket, req, this.config);
      try {
        wsRequest.readHandshake();
        var wsConnection = wsRequest.accept(wsRequest.requestedProtocols[0], wsRequest.origin);
        wsConnection.specs = 'current';
        this._handleConnection(wsConnection);
      } catch(e) {
        this._err(new Error('websocket request unsupported by WebSocket-Node: ' + e.toString()));
        return;
      }
    } else {
      this.specs = 'legacy';
      if (req.method == 'GET' &&
         (req.headers.upgrade && req.headers.connection) &&
         req.headers.upgrade.toLowerCase() === 'websocket' &&
         req.headers.connection.toLowerCase() === 'upgrade') {
        new miksagoConnection(this.miksagoServer.manager, this.miksagoServer.options, req, socket, head);
      }
    }

  }).bind(this));
}

util.inherits(ConnectionServer, events.EventEmitter);

ConnectionServer.prototype._handleConnection = function(conn) {
  this.emit('connection', new ConnectionProxy(conn, this));
}

ConnectionServer.prototype.listen = function(port, hostname, callback) {
  this.httpServer.listen(port, hostname, callback);
}

exports.ConnectionServer = ConnectionServer;

/*

  This is for when we'll be able to forget iOS < 6

  wsServer = new websocket.server({
    httpServer: httpServer,
    autoAcceptConnections: false
  });

  wsServer.on('request', function(request) {

    var connection = request.accept('conjole-protocol', request.origin);

    clients[connection.remoteAddress] = connection;

    connection.on('message', function(message) {

      currentClient = connection;

      if (message.type === 'utf8') {
        output(message.utf8Data, connection.remoteAddress);
      }

    });

    connection.on('close', function(reasonCode, description) {
      if (currentClient.remoteAddress == connection.remoteAddress) {
        currentClient = null;
      }
      delete clients[connection.remoteAddress];
    });
  });
*/


text:
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Test.Utilities;
using Roslyn.Test.Utilities.Parallel;
using Xunit;

namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Recommendations
{
    [ParallelFixture]
    public class ParamKeywordRecommenderTests : KeywordRecommenderTests
    {
        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        [WorkItem(529127)]
        public void TestNotOfferedInsideArgumentList()
        {
            VerifyAbsence("class C { void M([$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        [WorkItem(529127)]
        public void TestNotOfferedInsideArgumentList2()
        {
            VerifyAbsence("delegate void M([$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public void NotAtRoot_Interactive()
        {
            VerifyAbsence(SourceCodeKind.Script,
@"$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public void NotAfterClass_Interactive()
        {
            VerifyAbsence(SourceCodeKind.Script,
@"class C { }
$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public void NotAfterGlobalStatement_Interactive()
        {
            VerifyAbsence(SourceCodeKind.Script,
@"System.Console.WriteLine();
$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public void NotAfterGlobalVariableDeclaration_Interactive()
        {
            VerifyAbsence(SourceCodeKind.Script,
@"int i = 0;
$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public void NotInUsingAlias()
        {
            VerifyAbsence(
@"using Foo = $$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public void NotInEmptyStatement()
        {
            VerifyAbsence(AddInsideMethod(
@"$$"));
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public void NotInAttributeInsideClass()
        {
            VerifyAbsence(
@"class C {
    [$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public void NotInAttributeAfterAttributeInsideClass()
        {
            VerifyAbsence(
@"class C {
    [Foo]
    [$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public void NotInAttributeAfterMethod()
        {
            VerifyAbsence(
@"class C {
    void Foo() {
    }
    [$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public void NotInAttributeAfterProperty()
        {
            VerifyAbsence(
@"class C {
    int Foo {
        get;
    }
    [$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public void NotInAttributeAfterField()
        {
            VerifyAbsence(
@"class C {
    int Foo;
    [$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public void NotInAttributeAfterEvent()
        {
            VerifyAbsence(
@"class C {
    event Action<int> Foo;
    [$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public void NotInOuterAttribute()
        {
            VerifyAbsence(
@"[$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public void NotInParameterAttribute()
        {
            VerifyAbsence(
@"class C {
    void Foo([$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public void InPropertyAttribute1()
        {
            VerifyKeyword(
@"class C {
    int Foo { [$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public void InPropertyAttribute2()
        {
            VerifyKeyword(
@"class C {
    int Foo { get { } [$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public void InEventAttribute1()
        {
            VerifyKeyword(
@"class C {
    event Action<int> Foo { [$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public void InEventAttribute2()
        {
            VerifyKeyword(
@"class C {
    event Action<int> Foo { add { } [$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public void NotInTypeParameters()
        {
            VerifyAbsence(
@"class C<[$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public void NotInInterface()
        {
            VerifyAbsence(
@"interface I {
    [$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public void NotInStruct()
        {
            VerifyAbsence(
@"struct S {
    [$$");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
        public void NotInEnum()
        {
            VerifyAbsence(
@"enum E {
    [$$");
        }
    }
}


text:
{% extends "base.html" %}

{% block breadcrumbs %}
    {% if DISPLAY_BREADCRUMBS %}

            {% if MENUITEMS_2_AT %}

{{ MENUITEMS_2_AT }}

            {% endif %}

    {% endif %}
{% endblock %}

{% block content %}
    {% if articles %}
        {% for article in (articles_page.object_list if articles_page else articles) %}
            {% set DISPLAY_IMAGE = false %}

{{ article.title }}

                {% if article.image %}
                    {% set DISPLAY_IMAGE = true %}

                {% elif CATEGORY_IMAGES and article.category in CATEGORY_IMAGES %}
                    {% set DISPLAY_IMAGE = true %}

                {% else %}

                {% endif -%}

                    {{- article.summary -}}

                {% if DISPLAY_IMAGE == true %}

                {% else %}

                {% endif %}

                            <time datetime="{{ article.date.isoformat() }}"> {{ article.date | article_date }}</time>

                        {% if article.readtime_minutes -%}
                            •  ~{{ article.readtime_minutes }} min to read
                        {% elif article.stats -%}
                            •  ~{{ article.stats['read_mins'] }} min to read
                        {%- endif %}
                        {% if (DISQUS_SITENAME and DISQUS_DISPLAY_COUNTS) or (PELICAN_COMMENT_SYSTEM and PELICAN_COMMENT_SYSTEM_DISPLAY_COUNTS != false and article.comments_count > 0) %}
                            •
                            {% include 'includes/comment_count.html' %}
                        {% endif -%}
                        {# only display the 'read more' link if there is more to the article #}
                        {% if article.has_summary != false %}
                            •
                                read more

                        {% endif %}

        {% endfor %}
    {% endif %}

    {% include 'includes/pagination.html' %}
{% endblock content %}


text:
<?xml version='1.0' encoding='UTF-8'?>
<project xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd'
	xmlns='http://maven.apache.org/POM/4.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>com.example</groupId>
		<artifactId>spring-boot-sandbox-parent</artifactId>
		<version>0.0.1-SNAPSHOT</version>
		<relativePath>../</relativePath>
	</parent>
	<artifactId>test-with-database-example</artifactId>

	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-jdbc</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>

		<dependency>
			<groupId>org.postgresql</groupId>
			<artifactId>postgresql</artifactId>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-devtools</artifactId>
			<scope>runtime</scope>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.github.database-rider</groupId>
			<artifactId>rider-junit5</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.testcontainers</groupId>
			<artifactId>postgresql</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>

</project>


text:
import sys
import argparse

def arguments():
	"""
	parsing command line arguments
	"""
	parser = argparse.ArgumentParser(description="Scan through STDIN for periods where more than given amount of power has been consumed.")
	parser.add_argument("-v", "--verbose", action="store_true", dest="verbose", default=False, help="Print debug info.")
	parser.add_argument("-f", "--file", action="store", dest="filename", help="Path to file to read. Defaults to STDIN.")
	parser.add_argument("-s", "--separator", dest="separator", default=",", help="Specify the separation character. Defaults to comma (,).")
	parser.add_argument("-c", "--column", type=int, dest="dataCol", default=8, help="Specify the column of the input data that contains the data. Defaults to column 8.")
	parser.add_argument("-t", "--time", type=float, dest="pTime", default=20, help="Specify the time limit for counter in seconds. Defaults to 20 seconds.")
	parser.add_argument("-p", "--power", type=float, dest="pLimit", default=500, help="Specify the power limit for the counter to be triggered. Defaults to 500 W.")

	return parser.parse_args()

def main(args):
	"""
	scanning through given file (defaults to STDIN) for periods with specific power consumption
	required parameters (see arguments): separator, dataCol, pTime, pLimit
	"""
	if args.verbose:
		print(args)

	prevPower = 0.0
	risingTime = 0.0
	coffees = 0

	if args.filename:
		if args.verbose:
			print("Opening "+args.filename)
		sys.stdin = open(args.filename)

	for line in sys.stdin:
		items = line.split(args.separator)
		t_str = items[0]
		d_str = items[args.dataCol]
		if d_str == "NULL":
			pass
		try:
			time = float(t_str)
			power = float(d_str)

			if args.verbose:
				print("time: %f; power: %f" % (time, power))

			# rising edge:
			if prevPower < args.pLimit and power > args.pLimit:
				risingTime = time
			# falling edge:
			if prevPower > args.pLimit and power < args.pLimit:
				period = time - risingTime
				if args.verbose:
					print(risingTime, (period))
				if period > args.pTime:
					coffees += 1
			# update power
			prevPower = power

		except ValueError:
			pass

	sys.stdin.close()
	print(coffees)

if __name__ == '__main__':
	args = arguments()
	main(args)


text:
import { PolygonMaskDrawStroke } from "./PolygonMaskDrawStroke";
export class Draw {
    constructor() {
        this.enable = false;
        this.stroke = new PolygonMaskDrawStroke();
    }
    get lineWidth() {
        return 0;
    }
    set lineWidth(value) {
    }
    get lineColor() {
        return "";
    }
    set lineColor(value) {
    }
    load(data) {
        var _a;
        if (data !== undefined) {
            if (data.enable !== undefined) {
                this.enable = data.enable;
            }
            const stroke = (_a = data.stroke) !== null && _a !== void 0 ? _a : {
                color: data.lineColor,
                width: data.lineWidth
            };
            this.stroke.load(stroke);
        }
    }
}