text:
id: 71
title: Skype (Beta) per Windows Phone
date: 2012-02-27T03:35:08+00:00
author: Emanuele
layout: post
guid: https://nezwork.wordpress.com/?p=71
permalink: /2012/02/27/skype-beta-per-windows-phone/
geo_public:
  - "0"
categories:
  - announcement
tags:
  - Beta
  - Release
  - Skype
  - Windows Phone
---
Ebbene si, se ne vociferava da un pò in giro, in fondo era prevedibile dopo l'acquisto, su Windows Phone sbarca il cliente per Skype (per ora in versione beta) scaricabile da questo link per quanto riguarda il marketplace italiano. Su due piedi, la versione appare stabile (almeno a me non è morta ancora) anche se si sente la mancanza della gestione dei contatti, e si ricevono le chiamate solo se l'app è aperta (per ora va bene anche così,anche perchè chissà in quanto butterebbe giù la batteria)

ma mi piacerebbe sapere cosa ne pensano gli altri utilizzatori

E.


text:
/**
 * This package contains sample SQL tables that can be filled with data and then queried.
 */

@CheckReturnValue
@ParametersAreNonnullByDefault
package io.spine.server.storage.jdbc.given.table;

import com.google.errorprone.annotations.CheckReturnValue;

import javax.annotation.ParametersAreNonnullByDefault;

redpajama_set_name: RedPajamaGithub


text:
var express = require('express');
var router = express.Router();

var quizController = require('../controllers/quiz_controller');

/* GET home page. */
router.get('/', function(req, res) {
  res.render('index', { title: 'Quiz', errors: []});
});

router.get('/author', function(req, res) {
  res.render('author');
});

// Autoload de comandos con :quizId
router.param('quizId', quizController.load);  // autoload :quizId

// Definición de rutas de /quizes
router.get('/quizes',                      quizController.index);
router.get('/quizes/:quizId(\\d+)',        quizController.show);
router.get('/quizes/:quizId(\\d+)/answer', quizController.answer);
router.get('/quizes/new',                  quizController.new);
router.post('/quizes/create',              quizController.create);

module.exports = router;


text:
import os

import mock
import unittest2

import st2debug.utils.system_info
from st2debug.utils.system_info import get_cpu_info
from st2debug.utils.system_info import get_memory_info
from st2debug.utils.system_info import get_deb_package_list
from st2debug.utils.system_info import get_rpm_package_list

BASE_DIR = os.path.dirname(os.path.abspath(__file__))
FIXTURES_DIR = os.path.join(BASE_DIR, '../fixtures')

orig_cpu_info = st2debug.utils.system_info.CPU_INFO_PATH
orig_mem_info = st2debug.utils.system_info.MEMORY_INFO_PATH

class SystemInfoTestCase(unittest2.TestCase):
    def setUp(self):
        st2debug.utils.system_info.CPU_INFO_PATH = orig_cpu_info
        st2debug.utils.system_info.MEMORY_INFO_PATH = orig_mem_info

    def test_get_cpu_info_success(self):
        st2debug.utils.system_info.CPU_INFO_PATH = os.path.join(FIXTURES_DIR,
                                                                'proc_cpuinfo')

        cpu_info = get_cpu_info()
        self.assertEqual(len(cpu_info), 4)
        self.assertEqual(cpu_info[0]['model_name'], 'Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz')

    def test_get_cpu_info_no_procinfo_file(self):
        st2debug.utils.system_info.CPU_INFO_PATH = 'doesntexist'

        cpu_info = get_cpu_info()
        self.assertEqual(cpu_info, {})

    def test_get_memory_info_success(self):
        st2debug.utils.system_info.MEMORY_INFO_PATH = os.path.join(FIXTURES_DIR,
                                                                   'proc_meminfo')

        memory_info = get_memory_info()
        self.assertEqual(memory_info['MemTotal'], 16313772)
        self.assertEqual(memory_info['MemFree'], 8445896)
        self.assertEqual(memory_info['MemAvailable'], 10560460)

    def test_get_memory_info_no_meminfo_file(self):
        st2debug.utils.system_info.MEMORY_INFO_PATH = 'doesntexist'

        memory_info = get_memory_info()
        self.assertEqual(memory_info, {})

    @mock.patch('st2debug.utils.system_info.run_command')
    def test_get_deb_package_list(self, mock_run_command):
        file_path = os.path.join(FIXTURES_DIR, 'deb_pkg_list')
        with open(file_path, 'r') as fp:
            mock_stdout = fp.read()

        mock_run_command.return_value = (0, mock_stdout, '')

        package_list = get_deb_package_list(name_startswith='st2')
        self.assertEqual(len(package_list), 5)
        self.assertEqual(package_list[0]['name'], 'st2actions')
        self.assertEqual(package_list[0]['version'], '0.6.0-11')

    @mock.patch('st2debug.utils.system_info.run_command')
    def test_get_rpm_package_list(self, mock_run_command):
        file_path = os.path.join(FIXTURES_DIR, 'rpm_pkg_list')
        with open(file_path, 'r') as fp:
            mock_stdout = fp.read()

        mock_run_command.return_value = (0, mock_stdout, '')

        package_list = get_rpm_package_list(name_startswith='st2')
        self.assertEqual(len(package_list), 6)
        self.assertEqual(package_list[0]['name'], 'st2actions')
        self.assertEqual(package_list[0]['version'], '0.7-8')


text:
namespace blink {

OffscreenFontSelector::OffscreenFontSelector(WorkerGlobalScope* worker)
    : worker_(worker) {
  DCHECK(worker);
  font_face_cache_ = MakeGarbageCollected<FontFaceCache>();
  FontCache::Get().AddClient(this);
}

OffscreenFontSelector::~OffscreenFontSelector() = default;

UseCounter* OffscreenFontSelector::GetUseCounter() {
  return GetExecutionContext();
}

void OffscreenFontSelector::UpdateGenericFontFamilySettings(
    const GenericFontFamilySettings& settings) {
  generic_font_family_settings_ = settings;
}

void OffscreenFontSelector::RegisterForInvalidationCallbacks(
    FontSelectorClient* client) {}

void OffscreenFontSelector::UnregisterForInvalidationCallbacks(
    FontSelectorClient* client) {}

scoped_refptr<FontData> OffscreenFontSelector::GetFontData(
    const FontDescription& font_description,
    const FontFamily& font_family) {
  const auto& family_name = font_family.FamilyName();
  if (CSSSegmentedFontFace* face =
          font_face_cache_->Get(font_description, family_name)) {
    worker_->GetFontMatchingMetrics()->ReportWebFontFamily(family_name);
    return face->GetFontData(font_description);
  }

  worker_->GetFontMatchingMetrics()->ReportSystemFontFamily(family_name);

  // Try to return the correct font based off our settings, in case we were
  // handed the generic font family name.
  AtomicString settings_family_name =
      FamilyNameFromSettings(generic_font_family_settings_, font_description,
                             font_family, GetExecutionContext());
  if (settings_family_name.IsEmpty())
    return nullptr;

  worker_->GetFontMatchingMetrics()->ReportFontFamilyLookupByGenericFamily(
      family_name, font_description.GetScript(),
      font_description.GenericFamily(), settings_family_name);

  auto font_data =
      FontCache::Get().GetFontData(font_description, settings_family_name);

  worker_->GetFontMatchingMetrics()->ReportFontLookupByUniqueOrFamilyName(
      settings_family_name, font_description, font_data.get());

  return font_data;
}

void OffscreenFontSelector::ReportNotDefGlyph() const {}

void OffscreenFontSelector::ReportEmojiSegmentGlyphCoverage(
    unsigned num_clusters,
    unsigned num_broken_clusters) {
  DCHECK(worker_);
  worker_->GetFontMatchingMetrics()->ReportEmojiSegmentGlyphCoverage(
      num_clusters, num_broken_clusters);
}

void OffscreenFontSelector::ReportSuccessfulFontFamilyMatch(
    const AtomicString& font_family_name) {
  DCHECK(worker_);
  worker_->GetFontMatchingMetrics()->ReportSuccessfulFontFamilyMatch(
      font_family_name);
}

void OffscreenFontSelector::ReportFailedFontFamilyMatch(
    const AtomicString& font_family_name) {
  DCHECK(worker_);
  worker_->GetFontMatchingMetrics()->ReportFailedFontFamilyMatch(
      font_family_name);
}

void OffscreenFontSelector::ReportSuccessfulLocalFontMatch(
    const AtomicString& font_name) {
  DCHECK(worker_);
  worker_->GetFontMatchingMetrics()->ReportSuccessfulLocalFontMatch(font_name);
}

void OffscreenFontSelector::ReportFailedLocalFontMatch(
    const AtomicString& font_name) {
  DCHECK(worker_);
  worker_->GetFontMatchingMetrics()->ReportFailedLocalFontMatch(font_name);
}

void OffscreenFontSelector::ReportFontLookupByUniqueOrFamilyName(
    const AtomicString& name,
    const FontDescription& font_description,
    SimpleFontData* resulting_font_data) {
  DCHECK(worker_);
  worker_->GetFontMatchingMetrics()->ReportFontLookupByUniqueOrFamilyName(
      name, font_description, resulting_font_data);
}

void OffscreenFontSelector::ReportFontLookupByUniqueNameOnly(
    const AtomicString& name,
    const FontDescription& font_description,
    SimpleFontData* resulting_font_data,
    bool is_loading_fallback) {
  DCHECK(worker_);
  worker_->GetFontMatchingMetrics()->ReportFontLookupByUniqueNameOnly(
      name, font_description, resulting_font_data, is_loading_fallback);
}

void OffscreenFontSelector::ReportFontLookupByFallbackCharacter(
    UChar32 fallback_character,
    FontFallbackPriority fallback_priority,
    const FontDescription& font_description,
    SimpleFontData* resulting_font_data) {
  DCHECK(worker_);
  worker_->GetFontMatchingMetrics()->ReportFontLookupByFallbackCharacter(
      fallback_character, fallback_priority, font_description,
      resulting_font_data);
}

void OffscreenFontSelector::ReportLastResortFallbackFontLookup(
    const FontDescription& font_description,
    SimpleFontData* resulting_font_data) {
  DCHECK(worker_);
  worker_->GetFontMatchingMetrics()->ReportLastResortFallbackFontLookup(
      font_description, resulting_font_data);
}

void OffscreenFontSelector::FontCacheInvalidated() {
  font_face_cache_->IncrementVersion();
}

void OffscreenFontSelector::FontFaceInvalidated(FontInvalidationReason) {
  FontCacheInvalidated();
}

void OffscreenFontSelector::Trace(Visitor* visitor) const {
  visitor->Trace(worker_);
  CSSFontSelectorBase::Trace(visitor);
}

}  // namespace blink


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>com.google.code.play2.spm (Play! 2.x Source Position Mappers 1.0.0-beta6 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Package com.google.code.play2.spm

<map id="G" name="G">
<area shape="rect" id="c0" href="./AbstractPlay2SourcePositionMapper.html" title="com.google.code.play2.spm.AbstractPlay2SourcePositionMapper" alt="" coords="16,17,235,41"/>
<area shape="rect" id="node1" href="./AbstractPlay2SourcePositionMapper.html" title="<TABLE>" alt="" coords="5,5,245,53"/>
</map>

Class Summary

Class
Description

AbstractPlay2SourcePositionMapper

Abstract Play! Framework source position mapper

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Copyright © 2013–2017. All rights reserved.


text:
import styles from './App.less';
import withContext from '../../decorators/withContext';
import withStyles from '../../decorators/withStyles';
import AppActions from '../../actions/AppActions';
import AppStore from '../../stores/AppStore';
import Header from '../Header';
import ContentPage from '../ContentPage';
import ContactPage from '../ContactPage';
import NotFoundPage from '../NotFoundPage';
import HorizontalNav from '../HorizontalNav/HorizontalNav';
import Blog from '../Blog/Blog.js';

let React = require('react');

const pages = { ContentPage, ContactPage, NotFoundPage };

@withContext
@withStyles(styles)
class App {

  static propTypes = {
    path: React.PropTypes.string.isRequired
  };

  componentDidMount() {
    window.addEventListener('popstate', this.handlePopState);
  }

  componentWillUnmount() {
    window.removeEventListener('popstate', this.handlePopState);
  }

  shouldComponentUpdate(nextProps) {
    return this.props.path !== nextProps.path;
  }

  render() {
    let component;
    let jsx;

    switch (this.props.path) {

      case '/':
        let page = AppStore.getPage(this.props.path);
        component = React.createElement(pages[page.component], page);
        jsx =

            {component}

;
        break;

      case '/contact':
        component = <ContactPage />;
        jsx =

            <HorizontalNav selected='contact' />
            {component}

;
        break;

      case '/blog':
        component = <Blog />;
        jsx =

            <HorizontalNav selected='blog' />
            {component}

;
        break;

      default:
         jsx = <NotFoundPage />;
    }
    return jsx;
  }

  handlePopState(event) {
    AppActions.navigateTo(window.location.pathname, {replace: !!event.state});
  }

}

export default App;


text:
namespace nuserv.Models.Contracts
{
    public interface IRepository : IEntity<string>
    {
        #region Public Properties

        string Description { get; }

        string Name { get; }

        #endregion
    }
}


text:
    <textarea name="name" rows="8" cols="80"></textarea>

    <button type="button" name="confirm">提交</button>


text:
Nav

                                {% include nav.html classes="nav nav-pills nav-stacked" %}

Recent articles

                                {% include recent-articles.html %}

Meeting times

                                {% include meeting-times.html %}

Contact

Email us at:

washington.robotics.team@gmail.com

Or send us a
                                Facebook message.

        {% if page.math %}

        {% endif %}

        {% if page.gallery %}

        {% endif %}

        {% if page.carousel %}

        {% endif %}


text:
package org.kie.remote.services.rest;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.kie.remote.services.MockSetupTestHelper.FOR_INDEPENDENT_TASKS;
import static org.kie.remote.services.MockSetupTestHelper.FOR_PROCESS_TASKS;
import static org.kie.remote.services.MockSetupTestHelper.TASK_ID;
import static org.kie.remote.services.MockSetupTestHelper.setupTaskMocks;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;

import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.core.UriInfo;

import org.jboss.resteasy.specimpl.MultivaluedMapImpl;
import org.jbpm.process.audit.AuditLogService;
import org.jbpm.process.audit.command.ClearHistoryLogsCommand;
import org.jbpm.process.audit.command.FindProcessInstancesCommand;
import org.jbpm.services.api.ProcessService;
import org.jbpm.services.api.UserTaskService;
import org.jbpm.services.task.commands.ClaimTaskCommand;
import org.jbpm.services.task.commands.CompleteTaskCommand;
import org.jbpm.services.task.commands.TaskCommand;
import org.junit.Test;
import org.kie.remote.services.TaskDeploymentIdTest;
import org.kie.remote.services.cdi.ProcessRequestBean;
import org.kie.remote.services.jaxb.JaxbCommandsRequest;
import org.kie.remote.services.jaxb.JaxbCommandsResponse;
import org.kie.services.client.serialization.jaxb.impl.JaxbCommandResponse;
import org.kie.services.client.serialization.jaxb.rest.JaxbExceptionResponse;

@SuppressWarnings("unchecked")
public class ExecuteResourceTest extends ExecuteResourceImpl implements TaskDeploymentIdTest {

    private static final String USER = "user";

    private ProcessService processServiceMock;
    private UserTaskService userTaskServiceMock;

    private UriInfo uriInfoMock;
    private HttpServletRequest httpRequestMock;

    private AuditLogService auditLogService = mock(AuditLogService.class);

    @Override
    public void setProcessServiceMock(ProcessService processServiceMock) {
        this.processServiceMock = processServiceMock;
    }

    @Override
    public void setUserTaskServiceMock(UserTaskService userTaskServiceMock) {
        this.userTaskServiceMock = userTaskServiceMock;
    }

    public void setupTestMocks() {
        // REST
        uriInfoMock = mock(UriInfo.class);
        setUriInfo(uriInfoMock);
        doReturn(new MultivaluedMapImpl<String,String>()).when(uriInfoMock).getQueryParameters();
        httpRequestMock = mock(HttpServletRequest.class);
        setHttpServletRequest(httpRequestMock);

        this.processRequestBean = new ProcessRequestBean();
        this.processRequestBean.setProcessService(processServiceMock);
        this.processRequestBean.setUserTaskService(userTaskServiceMock);
    }

    /**
     * When doing operations with a non-process (independent) task,
     * the injected (non-runtime engine) taskService should be used.
     */
    @Test
    public void testRestExecuteCommandIndependentTaskProcessing() {
        setupTaskMocks(this, FOR_INDEPENDENT_TASKS);

        JaxbCommandsRequest
        cmdsRequest = new JaxbCommandsRequest(new ClaimTaskCommand(TASK_ID, USER));
        this.execute(cmdsRequest);
        cmdsRequest = new JaxbCommandsRequest(new CompleteTaskCommand(TASK_ID, USER, null));
        this.execute(cmdsRequest);

        // verify
        verify(userTaskServiceMock, times(2)).execute(any(String.class), any(TaskCommand.class));
    }

    @Test
    public void testRestExecuteCommandProcessTaskProcessing() {
        setupTaskMocks(this, FOR_PROCESS_TASKS);

        JaxbCommandsRequest cmdsRequest = new JaxbCommandsRequest(new ClaimTaskCommand(TASK_ID, USER));
        this.execute(cmdsRequest);
        cmdsRequest = new JaxbCommandsRequest(new CompleteTaskCommand(TASK_ID, USER, null));
        this.execute(cmdsRequest);

        // verify
        verify(userTaskServiceMock, times(2)).execute(any(String.class), any(TaskCommand.class));
    }

    @Test
    public void testRestAuditCommandWithoutDeploymentId() {
        // setup
        setupTaskMocks(this, FOR_PROCESS_TASKS);
        this.processRequestBean.setAuditLogService(auditLogService);

        // run cmd (no deploymentId set on JaxbConmandsRequest object
        JaxbCommandsRequest
        cmdsRequest = new JaxbCommandsRequest(new FindProcessInstancesCommand());
        JaxbCommandsResponse
        response = this.execute(cmdsRequest);

        // check result
        assertEquals( "Number of response objects", 1, response.getResponses().size() );
        JaxbCommandResponse<?>
        responseObj = response.getResponses().get(0);
        assertFalse( "Command did not complete successfully", responseObj instanceof JaxbExceptionResponse );

        // run cmd (no deploymentId set on JaxbConmandsRequest object
        cmdsRequest = new JaxbCommandsRequest(new ClearHistoryLogsCommand());
        response = this.execute(cmdsRequest);

        // check result
        assertEquals( "Number of response objects", 0, response.getResponses().size() );

        // verify
        verify(auditLogService, times(1)).findProcessInstances();
        verify(auditLogService, times(1)).clear();
    }

}


text:
package org.fogbeam.experimental.reasoning.abductive.queries;

import static org.fogbeam.experimental.reasoning.abductive.AbductionConstants1.RESOURCE_BASE;
import static org.fogbeam.experimental.reasoning.abductive.AbductionConstants1.TDB_DIR;

import java.io.File;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;

import org.apache.jena.query.Dataset;
import org.apache.jena.query.Query;
import org.apache.jena.query.QueryExecution;
import org.apache.jena.query.QueryExecutionFactory;
import org.apache.jena.query.QueryFactory;
import org.apache.jena.query.QuerySolution;
import org.apache.jena.query.ResultSet;
import org.apache.jena.rdf.model.InfModel;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.rdf.model.Property;
import org.apache.jena.rdf.model.ResIterator;
import org.apache.jena.rdf.model.Resource;
import org.apache.jena.reasoner.Reasoner;
import org.apache.jena.reasoner.ReasonerRegistry;
import org.apache.jena.tdb.TDBFactory;
import org.eclipse.collections.api.set.MutableSet;
import org.eclipse.collections.impl.set.mutable.SetAdapter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class QueryManifestationsStrategy
{

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

	private String dir;

	public QueryManifestationsStrategy( final String dir )
	{
		this.dir = dir;
	}

	public MutableSet<String> listAll()
	{
		LinkedHashSet<String> backingSet = new LinkedHashSet<String>();
		MutableSet<String> manifestations = SetAdapter.adapt( backingSet );

		logger.debug( "TBD_DIR: " + dir );
		File tdbDir = new File(dir);
		if( !tdbDir.exists())
		{
			tdbDir.mkdirs();
		}

		Dataset ds = TDBFactory.createDataset(dir);
		Model model = ds.getDefaultModel();

		Reasoner reasoner = ReasonerRegistry.getOWLReasoner();
		InfModel infmodel = ModelFactory.createInfModel(reasoner, model );

		Property pCauses = model.createProperty(RESOURCE_BASE + "#hasCause" );

		ResIterator resIter = infmodel.listResourcesWithProperty(pCauses);

		while( resIter.hasNext() )
		{
			Resource d = resIter.nextResource();
			String res = d.toString();
			manifestations.add(res);
		}

		infmodel.close();

		ds.close();

		return manifestations;
	}

	public Set<String> doQuery( final String disease )
	{

		Set<String> manifestations = new HashSet<String>();

		File tdbDir = new File(TDB_DIR);
		if( !tdbDir.exists())
		{
			tdbDir.mkdirs();
		}

		Dataset ds = TDBFactory.createDataset(TDB_DIR);
		Model model = ds.getDefaultModel();

		Reasoner reasoner = ReasonerRegistry.getOWLReasoner();
		InfModel infmodel = ModelFactory.createInfModel(reasoner, model );

		/* Do a SPARQL Query over the data in the model */
		String queryString = "SELECT ?manifestation WHERE { <" + RESOURCE_BASE + "/disease#" + disease + "> <" + RESOURCE_BASE + "#causes> ?manifestation }" ;

		/* Now create and execute the query using a Query object */
		Query query = QueryFactory.create(queryString) ;
		QueryExecution qexec = QueryExecutionFactory.create(query, infmodel) ;

		try
		{
		    ResultSet results = qexec.execSelect() ;
		    for ( ; results.hasNext() ; )
		    {
		    	QuerySolution soln = results.nextSolution() ;
		    	Resource m = soln.getResource("manifestation");

		    	String res = m.toString();
		    	// logger.debug( res );
		    	manifestations.add( res );
		    }
		}
		finally
		{
			qexec.close();
		}

		infmodel.close();

		ds.close();

		return manifestations;

	}
}


text:
export class HttpAppRequest {

    public constructor() {}

    private _http = new XMLHttpRequest();
    private _headers: Array<string> = [];

    public getResponse(url: string, method: string, data: any, callback: (responseObject) => void) {

        let finalUrl = url;

        // Convert data object into query string
        if (method.toUpperCase() === 'GET' && !url.includes('?')) {
            finalUrl += '?' + Object.keys(data).map(k => `${encodeURIComponent(k)}=${encodeURIComponent(data[k])}`).join('&');
        }

        this._http.open(method, finalUrl, true);

        for (let key in this._headers) {
            this._http.setRequestHeader(key, this._headers[key]);
        }

        this._http.onreadystatechange = () => {
            if (this._http.readyState === XMLHttpRequest.DONE) {

                try {

                    let jsonData = JSON.parse(this._http.responseText);

                    callback(jsonData);
                } catch (e) {

                    let errorMessage = {
                        success: false,
                        message: "The server did not return a valid JSON response",
                        data: null
                    };

                    console.error("The server did not return a valid JSON response for url: " + url);
                    console.error("Response: " + this._http.responseText);

                    callback(errorMessage);
                }
            }
        };

        this._http.setRequestHeader("Content-Type", "application/json");
        this._http.setRequestHeader("Accept", "application/json");
        this._http.send(JSON.stringify(data));
    }

    public setRequestHeader(header: string, value: string) {
        this._headers[header] = value;
    }
}


text:
module.exports = {
  description: "",
  ns: "react-material-ui",
  type: "ReactNode",
  dependencies: {
    npm: {
      "material-ui/svg-icons/notification/adb": require('material-ui/svg-icons/notification/adb')
    }
  },
  name: "NotificationAdb",
  ports: {
    input: {},
    output: {
      component: {
        title: "NotificationAdb",
        type: "Component"
      }
    }
  }
}


text:
	-- Dragoon Framework - A Framework for Lua/LOVE --
	-- Copyright (c) 2014-2015 TsT worldmaster.fr <tst2005@gmail.com> --
--]]--------------------------------------------------------------------------

local core = require "aio.core"
local print_no_nl = core.print_no_nl
local autoeol, extractshebang, cat = core.autoeol, core.extractshebang, core.cat

local deny_package_access = false --FIXME: aio.config ?

local integrity = require "aio.integrity"
local module_with_integrity_check_get = integrity.module_with_integrity_check_get
local integrity_modcount_incr = integrity.integrity_modcount_incr

-- TODO: embedding with rawdata (string) and eval the lua code at runtime with loadstring
local function rawpack_module(modname, modpath)
	assert(modname)
	assert(modpath)

-- quoting solution 1 : prefix all '[', ']' with '\'
	local quote       = function(s) return s:gsub('([%]%[])','\\%1') end
	local unquotecode = [[:gsub('\\([%]%[])','%1')]]

-- quoting solution 2 : prefix the pattern of '[===[', ']===]' with '\' ; FIXME: for now it quote ]===] or [===] or ]===[ or [===[
--	local quote       = function(s) return s:gsub('([%]%[]===[%]%[])','\\%1') end
--	local unquotecode = [[:gsub('\\([%]%[]===[%]%[])','%1')]]

	local b = [[do local loadstring=_G.loadstring or _G.load;(function(name, rawcode)require"package".preload[name]=function(...)return assert(loadstring(rawcode), "loadstring: "..name.." failed")(...)end;end)("]] .. modname .. [[", (]].."[["
	local e = "]])".. unquotecode .. ")end"

--	if deny_package_access then
--		b = [[do require("package").preload["]] .. modname .. [["] = (function() local package;return function(...)]]
--		e = [[end end)()end;]]
--	end

	if module_with_integrity_check_get() then
		e = e .. [[__ICHECK__[#__ICHECK__+1] = ]].."'"..modname.."'"..[[;__ICHECKCOUNT__=(__ICHECKCOUNT__+1);]]
	end

	-- TODO: improve: include in function code a comment with the name of original file (it will be shown in the trace error message) ?
	local d = "-- <pack "..modname.."> --" -- error message keep the first 45 chars max
	print_no_nl(
		b .. d .."\n"
		.. quote(autoeol(extractshebang(cat(modpath)))) --:gsub('([%]%[])','\\%1')
		.. e .."\n"
	)
	--integrity_modcount_incr() -- for integrity check
end

------------------------------------------------------------------------------

local M = {}

M.pack_mod	= assert(rawpack_module)
M.pack_finish	= nil

return M


text:
//
// Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Official repository: https://github.com/boostorg/beast
//

#ifndef BOOST_BEAST_HTTP_VECTOR_BODY_HPP
#define BOOST_BEAST_HTTP_VECTOR_BODY_HPP

#include <boost/beast/core/detail/config.hpp>
#include <boost/beast/core/buffer_traits.hpp>
#include <boost/beast/http/error.hpp>
#include <boost/beast/http/message.hpp>
#include <boost/beast/core/detail/clamp.hpp>
#include <boost/asio/buffer.hpp>
#include <boost/optional.hpp>
#include <cstdint>
#include <limits>
#include <memory>
#include <stdexcept>
#include <string>
#include <utility>

namespace boost {
namespace beast {
namespace http {

/** A Body using `std::vector`

    This body uses `std::vector` as a memory-based container
    for holding message payloads. Messages using this body type
    may be serialized and parsed.
*/
template<class T, class Allocator = std::allocator<T>>
struct vector_body
{
private:
    static_assert(sizeof(T) == 1,
        "T requirements not met");

public:
    /** The type of container used for the body

        This determines the type of @ref message::body
        when this body type is used with a message container.
    */
    using value_type = std::vector<T, Allocator>;

    /** Returns the payload size of the body

        When this body is used with @ref message::prepare_payload,
        the Content-Length will be set to the payload size, and
        any chunked Transfer-Encoding will be removed.
    */
    static
    std::uint64_t
    size(value_type const& body)
    {
        return body.size();
    }

    /** The algorithm for parsing the body

        Meets the requirements of BodyReader.
    */
#if BOOST_BEAST_DOXYGEN
    using reader = __implementation_defined__;
#else
    class reader
    {
        value_type& body_;

    public:
        template<bool isRequest, class Fields>
        explicit
        reader(header<isRequest, Fields>&, value_type& b)
            : body_(b)
        {
        }

        void
        init(boost::optional<
            std::uint64_t> const& length, error_code& ec)
        {
            if(length)
            {
                if(*length > body_.max_size())
                {
                    ec = error::buffer_overflow;
                    return;
                }
                body_.reserve(beast::detail::clamp(*length));
            }
            ec = {};
        }

        template<class ConstBufferSequence>
        std::size_t
        put(ConstBufferSequence const& buffers,
            error_code& ec)
        {
            auto const n = buffer_bytes(buffers);
            auto const len = body_.size();
            if (n > body_.max_size() - len)
            {
                ec = error::buffer_overflow;
                return 0;
            }

            body_.resize(len + n);
            ec = {};
            return net::buffer_copy(net::buffer(
                &body_[0] + len, n), buffers);
        }

        void
        finish(error_code& ec)
        {
            ec = {};
        }
    };
#endif

    /** The algorithm for serializing the body

        Meets the requirements of BodyWriter.
    */
#if BOOST_BEAST_DOXYGEN
    using writer = __implementation_defined__;
#else
    class writer
    {
        value_type const& body_;

    public:
        using const_buffers_type =
            net::const_buffer;

        template<bool isRequest, class Fields>
        explicit
        writer(header<isRequest, Fields> const&, value_type const& b)
            : body_(b)
        {
        }

        void
        init(error_code& ec)
        {
            ec = {};
        }

        boost::optional<std::pair<const_buffers_type, bool>>
        get(error_code& ec)
        {
            ec = {};
            return {{const_buffers_type{
                body_.data(), body_.size()}, false}};
        }
    };
#endif
};

} // http
} // beast
} // boost

#endif


text:
package fullcodes.session.outputs;

public class Main {

    public static void main(String[] args) {
	// write your code here
        System.out.println("Hello welcome to a remake of day one class \n");
        System.out.println("Hello welcome to a remake of day one class");
        //System.out.println();

    }
}


text:
package org.xcordion.ide.intellij.settings;

import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;

import java.util.HashMap;
import java.util.Map;

public class XcordionSettingsContext {
    private static final Map<String, XcordionSettings> PROJECT_SETTINGS = new HashMap<String, XcordionSettings>();
    private static final Map<String, XcordionSettings> MODULE_SETTINGS = new HashMap<String, XcordionSettings>();

    public static XcordionSettings getModuleSettings(Module module) {
        XcordionSettings settings = MODULE_SETTINGS.get(getModuleKey(module));
        if (settings==null || settings.getXcordionBackingClassName()==null) {
            settings = PROJECT_SETTINGS.get(module.getProject().getName());
        }
        return settings;
    }

    public static void setModuleSettings(Module module, XcordionSettings settings) {
        MODULE_SETTINGS.put(getModuleKey(module), settings);
    }

    private static String getModuleKey(Module module) {
        return module.getProject().getName() + "$" + module.getName();
    }

    public static XcordionSettings getProjectSettings(Project project) {
        return PROJECT_SETTINGS.get(project.getName());
    }

    public static void setProjectSettings(Project project, XcordionSettings settings) {
        PROJECT_SETTINGS.put(project.getName(), settings);
    }
}


text:
import { openDialog } from '../../features/base/dialog';

import {
    DIAL_OUT_CANCELED,
    DIAL_OUT_CODES_UPDATED,
    DIAL_OUT_SERVICE_FAILED,
    PHONE_NUMBER_CHECKED
} from './actionTypes';

import { DialOutDialog } from './components';

declare var $: Function;
declare var config: Object;

/**
 * Dials the given number.
 *
 * @returns {Function}
 */
export function cancel() {
    return {
        type: DIAL_OUT_CANCELED
    };
}

/**
 * Dials the given number.
 *
 * @param {string} dialNumber - The number to dial.
 * @returns {Function}
 */
export function dial(dialNumber) {
    return (dispatch, getState) => {
        const { conference } = getState()['features/base/conference'];

        conference.dial(dialNumber);
    };
}

/**
 * Sends an ajax request for dial-out country codes.
 *
 * @param {string} dialNumber - The dial number to check for validity.
 * @returns {Function}
 */
export function checkDialNumber(dialNumber) {
    return (dispatch, getState) => {
        const { dialOutAuthUrl } = getState()['features/base/config'];

        const fullUrl = `${dialOutAuthUrl}?phone=${dialNumber}`;

        $.getJSON(fullUrl)
            .success(response =>
                dispatch({
                    type: PHONE_NUMBER_CHECKED,
                    response
                }))
            .error(error =>
                dispatch({
                    type: DIAL_OUT_SERVICE_FAILED,
                    error
                }));
    };
}

/**
 * Opens the dial-out dialog.
 *
 * @returns {Function}
 */
export function openDialOutDialog() {
    return openDialog(DialOutDialog);
}

/**
 * Sends an ajax request for dial-out country codes.
 *
 * @returns {Function}
 */
export function updateDialOutCodes() {
    return (dispatch, getState) => {
        const { dialOutCodesUrl } = getState()['features/base/config'];

        $.getJSON(dialOutCodesUrl)
            .success(response =>
                dispatch({
                    type: DIAL_OUT_CODES_UPDATED,
                    response
                }))
            .error(error =>
                dispatch({
                    type: DIAL_OUT_SERVICE_FAILED,
                    error
                }));
    };
}


text:
import ast
import builtins
from collections.abc import Mapping
import os
import sys
import threading
import warnings

import yaml

no_default = "__no_default__"

paths = [
    os.getenv("DASK_ROOT_CONFIG", "/etc/dask"),
    os.path.join(sys.prefix, "etc", "dask"),
    os.path.join(os.path.expanduser("~"), ".config", "dask"),
    os.path.join(os.path.expanduser("~"), ".dask"),
]

if "DASK_CONFIG" in os.environ:
    PATH = os.environ["DASK_CONFIG"]
    paths.append(PATH)
else:
    PATH = os.path.join(os.path.expanduser("~"), ".config", "dask")

global_config = config = {}

config_lock = threading.Lock()

defaults = []

def canonical_name(k, config):
    """Return the canonical name for a key.

    Handles user choice of '-' or '_' conventions by standardizing on whichever
    version was set first. If a key already exists in either hyphen or
    underscore form, the existing version is the canonical name. If neither
    version exists the original key is used as is.
    """
    try:
        if k in config:
            return k
    except TypeError:
        # config is not a mapping, return the same name as provided
        return k

    altk = k.replace("_", "-") if "_" in k else k.replace("-", "_")

    if altk in config:
        return altk

    return k

def update(old, new, priority="new"):
    """ Update a nested dictionary with values from another

    This is like dict.update except that it smoothly merges nested values

    This operates in-place and modifies old

    Parameters
    ----------
    priority: string {'old', 'new'}
        If new (default) then the new dictionary has preference.
        Otherwise the old dictionary does.

    Examples
    --------
    >>> a = {'x': 1, 'y': {'a': 2}}
    >>> b = {'x': 2, 'y': {'b': 3}}
    >>> update(a, b)  # doctest: +SKIP
    {'x': 2, 'y': {'a': 2, 'b': 3}}

    >>> a = {'x': 1, 'y': {'a': 2}}
    >>> b = {'x': 2, 'y': {'b': 3}}
    >>> update(a, b, priority='old')  # doctest: +SKIP
    {'x': 1, 'y': {'a': 2, 'b': 3}}

    See Also
    --------
    dask.config.merge
    """
    for k, v in new.items():
        k = canonical_name(k, old)

        if isinstance(v, Mapping):
            if k not in old or old[k] is None:
                old[k] = {}
            update(old[k], v, priority=priority)
        else:
            if priority == "new" or k not in old:
                old[k] = v

    return old

def merge(*dicts):
    """ Update a sequence of nested dictionaries

    This prefers the values in the latter dictionaries to those in the former

    Examples
    --------
    >>> a = {'x': 1, 'y': {'a': 2}}
    >>> b = {'y': {'b': 3}}
    >>> merge(a, b)  # doctest: +SKIP
    {'x': 1, 'y': {'a': 2, 'b': 3}}

    See Also
    --------
    dask.config.update
    """
    result = {}
    for d in dicts:
        update(result, d)
    return result

def collect_yaml(paths=paths):
    """ Collect configuration from yaml files

    This searches through a list of paths, expands to find all yaml or json
    files, and then parses each file.
    """
    # Find all paths
    file_paths = []
    for path in paths:
        if os.path.exists(path):
            if os.path.isdir(path):
                try:
                    file_paths.extend(
                        sorted(
                            [
                                os.path.join(path, p)
                                for p in os.listdir(path)
                                if os.path.splitext(p)[1].lower()
                                in (".json", ".yaml", ".yml")
                            ]
                        )
                    )
                except OSError:
                    # Ignore permission errors
                    pass
            else:
                file_paths.append(path)

    configs = []

    # Parse yaml files
    for path in file_paths:
        try:
            with open(path) as f:
                data = yaml.safe_load(f.read()) or {}
                configs.append(data)
        except (OSError, IOError):
            # Ignore permission errors
            pass

    return configs

def collect_env(env=None):
    """ Collect config from environment variables

    This grabs environment variables of the form "DASK_FOO__BAR_BAZ=123" and
    turns these into config variables of the form ``{"foo": {"bar-baz": 123}}``
    It transforms the key and value in the following way:

    -  Lower-cases the key text
    -  Treats ``__`` (double-underscore) as nested access
    -  Calls ``ast.literal_eval`` on the value
    """
    if env is None:
        env = os.environ
    d = {}
    for name, value in env.items():
        if name.startswith("DASK_"):
            varname = name[5:].lower().replace("__", ".")
            try:
                d[varname] = ast.literal_eval(value)
            except (SyntaxError, ValueError):
                d[varname] = value

    result = {}
    set(d, config=result)

    return result

def ensure_file(source, destination=None, comment=True):
    """
    Copy file to default location if it does not already exist

    This tries to move a default configuration file to a default location if
    if does not already exist.  It also comments out that file by default.

    This is to be used by downstream modules (like dask.distributed) that may
    have default configuration files that they wish to include in the default
    configuration path.

    Parameters
    ----------
    source : string, filename
        Source configuration file, typically within a source directory.
    destination : string, directory
        Destination directory. Configurable by ``DASK_CONFIG`` environment
        variable, falling back to ~/.config/dask.
    comment : bool, True by default
        Whether or not to comment out the config file when copying.
    """
    if destination is None:
        destination = PATH

    # destination is a file and already exists, never overwrite
    if os.path.isfile(destination):
        return

    # If destination is not an existing file, interpret as a directory,
    # use the source basename as the filename
    directory = destination
    destination = os.path.join(directory, os.path.basename(source))

    try:
        if not os.path.exists(destination):
            os.makedirs(directory, exist_ok=True)

            # Atomically create destination.  Parallel testing discovered
            # a race condition where a process can be busy creating the
            # destination while another process reads an empty config file.
            tmp = "%s.tmp.%d" % (destination, os.getpid())
            with open(source) as f:
                lines = list(f)

            if comment:
                lines = [
                    "# " + line if line.strip() and not line.startswith("#") else line
                    for line in lines
                ]

            with open(tmp, "w") as f:
                f.write("".join(lines))

            try:
                os.rename(tmp, destination)
            except OSError:
                os.remove(tmp)
    except (IOError, OSError):
        pass

class set(object):
    """ Temporarily set configuration values within a context manager

    Parameters
    ----------
    arg : mapping or None, optional
        A mapping of configuration key-value pairs to set.
    **kwargs :
        Additional key-value pairs to set. If ``arg`` is provided, values set
        in ``arg`` will be applied before those in ``kwargs``.
        Double-underscores (``__``) in keyword arguments will be replaced with
        ``.``, allowing nested values to be easily set.

    Examples
    --------
    >>> import dask

    Set ``'foo.bar'`` in a context, by providing a mapping.

    >>> with dask.config.set({'foo.bar': 123}):
    ...     pass

    Set ``'foo.bar'`` in a context, by providing a keyword argument.

    >>> with dask.config.set(foo__bar=123):
    ...     pass

    Set ``'foo.bar'`` globally.

    >>> dask.config.set(foo__bar=123)  # doctest: +SKIP

    See Also
    --------
    dask.config.get
    """

    def __init__(self, arg=None, config=config, lock=config_lock, **kwargs):
        with lock:
            self.config = config
            self._record = []

            if arg is not None:
                for key, value in arg.items():
                    key = check_deprecations(key)
                    self._assign(key.split("."), value, config)
            if kwargs:
                for key, value in kwargs.items():
                    key = key.replace("__", ".")
                    key = check_deprecations(key)
                    self._assign(key.split("."), value, config)

    def __enter__(self):
        return self.config

    def __exit__(self, type, value, traceback):
        for op, path, value in reversed(self._record):
            d = self.config
            if op == "replace":
                for key in path[:-1]:
                    d = d.setdefault(key, {})
                d[path[-1]] = value
            else:  # insert
                for key in path[:-1]:
                    try:
                        d = d[key]
                    except KeyError:
                        break
                else:
                    d.pop(path[-1], None)

    def _assign(self, keys, value, d, path=(), record=True):
        """Assign value into a nested configuration dictionary

        Parameters
        ----------
        keys : Sequence[str]
            The nested path of keys to assign the value.
        value : object
        d : dict
            The part of the nested dictionary into which we want to assign the
            value
        path : Tuple[str], optional
            The path history up to this point.
        record : bool, optional
            Whether this operation needs to be recorded to allow for rollback.
        """
        key = canonical_name(keys[0], d)

        path = path + (key,)

        if len(keys) == 1:
            if record:
                if key in d:
                    self._record.append(("replace", path, d[key]))
                else:
                    self._record.append(("insert", path, None))
            d[key] = value
        else:
            if key not in d:
                if record:
                    self._record.append(("insert", path, None))
                d[key] = {}
                # No need to record subsequent operations after an insert
                record = False
            self._assign(keys[1:], value, d[key], path, record=record)

def collect(paths=paths, env=None):
    """
    Collect configuration from paths and environment variables

    Parameters
    ----------
    paths : List[str]
        A list of paths to search for yaml config files

    env : dict
        The system environment variables

    Returns
    -------
    config: dict

    See Also
    --------
    dask.config.refresh: collect configuration and update into primary config
    """
    if env is None:
        env = os.environ

    configs = collect_yaml(paths=paths)
    configs.append(collect_env(env=env))

    return merge(*configs)

def refresh(config=config, defaults=defaults, **kwargs):
    """
    Update configuration by re-reading yaml files and env variables

    This mutates the global dask.config.config, or the config parameter if
    passed in.

    This goes through the following stages:

    1.  Clearing out all old configuration
    2.  Updating from the stored defaults from downstream libraries
        (see update_defaults)
    3.  Updating from yaml files and environment variables

    Note that some functionality only checks configuration once at startup and
    may not change behavior, even if configuration changes.  It is recommended
    to restart your python process if convenient to ensure that new
    configuration changes take place.

    See Also
    --------
    dask.config.collect: for parameters
    dask.config.update_defaults
    """
    config.clear()

    for d in defaults:
        update(config, d, priority="old")

    update(config, collect(**kwargs))

def get(key, default=no_default, config=config):
    """
    Get elements from global config

    Use '.' for nested access

    Examples
    --------
    >>> from dask import config
    >>> config.get('foo')  # doctest: +SKIP
    {'x': 1, 'y': 2}

    >>> config.get('foo.x')  # doctest: +SKIP
    1

    >>> config.get('foo.x.y', default=123)  # doctest: +SKIP
    123

    See Also
    --------
    dask.config.set
    """
    keys = key.split(".")
    result = config
    for k in keys:
        k = canonical_name(k, result)
        try:
            result = result[k]
        except (TypeError, IndexError, KeyError):
            if default is not no_default:
                return default
            else:
                raise
    return result

def rename(aliases, config=config):
    """ Rename old keys to new keys

    This helps migrate older configuration versions over time
    """
    old = []
    new = {}
    for o, n in aliases.items():
        value = get(o, None, config=config)
        if value is not None:
            old.append(o)
            new[n] = value

    for k in old:
        del config[canonical_name(k, config)]  # TODO: support nested keys

    set(new, config=config)

def update_defaults(new, config=config, defaults=defaults):
    """ Add a new set of defaults to the configuration

    It does two things:

    1.  Add the defaults to a global collection to be used by refresh later
    2.  Updates the global config with the new configuration
        prioritizing older values over newer ones
    """
    defaults.append(new)
    update(config, new, priority="old")

def expand_environment_variables(config):
    """ Expand environment variables in a nested config dictionary

    This function will recursively search through any nested dictionaries
    and/or lists.

    Parameters
    ----------
    config : dict, iterable, or str
        Input object to search for environment variables

    Returns
    -------
    config : same type as input

    Examples
    --------
    >>> expand_environment_variables({'x': [1, 2, '$USER']})  # doctest: +SKIP
    {'x': [1, 2, 'my-username']}
    """
    if isinstance(config, Mapping):
        return {k: expand_environment_variables(v) for k, v in config.items()}
    elif isinstance(config, str):
        return os.path.expandvars(config)
    elif isinstance(config, (list, tuple, builtins.set)):
        return type(config)([expand_environment_variables(v) for v in config])
    else:
        return config

deprecations = {
    "fuse_ave_width": "optimization.fuse.ave-width",
    "fuse_max_height": "optimization.fuse.max-height",
    "fuse_max_width": "optimization.fuse.max-width",
    "fuse_subgraphs": "optimization.fuse.subgraphs",
    "fuse_rename_keys": "optimization.fuse.rename-keys",
    "fuse_max_depth_new_edges": "optimization.fuse.max-depth-new-edges",
}

def check_deprecations(key: str, deprecations: dict = deprecations):
    """ Check if the provided value has been renamed or removed

    Parameters
    ----------
    key : str
        The configuration key to check
    deprecations : Dict[str, str]
        The mapping of aliases

    Examples
    --------
    >>> deprecations = {"old_key": "new_key", "invalid": None}
    >>> check_deprecations("old_key", deprecations=deprecations)  # doctest: +SKIP
    UserWarning: Configuration key "old_key" has been deprecated. Please use "new_key" instead.

    >>> check_deprecations("invalid", deprecations=deprecations)
    Traceback (most recent call last):
        ...
    ValueError: Configuration value "invalid" has been removed

    >>> check_deprecations("another_key", deprecations=deprecations)
    'another_key'

    Returns
    -------
    new: str
        The proper key, whether the original (if no deprecation) or the aliased
        value
    """
    if key in deprecations:
        new = deprecations[key]
        if new:
            warnings.warn(
                'Configuration key "{}" has been deprecated. '
                'Please use "{}" instead'.format(key, new)
            )
            return new
        else:
            raise ValueError('Configuration value "{}" has been removed'.format(key))
    else:
        return key

def _initialize():
    fn = os.path.join(os.path.dirname(__file__), "dask.yaml")
    ensure_file(source=fn)

    with open(fn) as f:
        _defaults = yaml.safe_load(f)

    update_defaults(_defaults)

refresh()
_initialize()