text:
<?xml version="1.0" encoding="UTF-8"?>
<billStatus>
  <bill>
    <relatedBills />
    <sponsors>
      <item>
        <bioguideId>T000475</bioguideId>
        <state>MI</state>
        <fullName>Rep. Trott, David A. [R-MI-11]</fullName>
        <identifiers>
          <gpoId />
          <bioguideId>T000475</bioguideId>
          <lisID>2250</lisID>
        </identifiers>
        <party>R</party>
        <district>11</district>
        <byRequestType />
        <middleName>A.</middleName>
        <lastName>Trott</lastName>
        <firstName>David</firstName>
      </item>
    </sponsors>
    <updateDate>2017-06-19T20:30:10Z</updateDate>
    <recordedVotes />
    <notes />
    <introducedDate>2017-01-11</introducedDate>
    <calendarNumbers />
    <laws />
    <version>1.0.0</version>
    <committeeReports />
    <originChamber>House</originChamber>
    <summaries>
      <billSummaries>
        <item>
          <versionCode>00</versionCode>
          <text><![CDATA[
Preserve Our Lakes and Keep Our Environment Safe Act

This bill directs the Department of Transportation (DOT) to conduct a study to determine the economic and environmental risks of oil or hazardous liquids spills or leaks in the Straits of Mackinac that a failure of onshore, underwater pipeline facilities within the straits would pose to the Great Lakes.

In addition, DOT must evaluate the condition and structural integrity of the facilities.

DOT shall terminate operations of a facility upon a determination, based on such studies, that risk of hazard to life, property, or the environment warrants termination.
]]></text>
          <lastSummaryUpdateDate>2017-01-26T14:55:09Z</lastSummaryUpdateDate>
          <name>Introduced in House</name>
          <actionDate>2017-01-11</actionDate>
          <actionDesc>Introduced in House</actionDesc>
          <updateDate>2017-01-11T05:00:00Z</updateDate>
        </item>
      </billSummaries>
    </summaries>
    <titles>
      <item>
        <titleType>(Extracted from GPO) Short Titles as Introduced</titleType>
        <chamberName />
        <parentTitleType />
        <title>Preserve Our Lakes and Keep Our Environment Safe Act</title>
        <chamberCode />
      </item>
      <item>
        <titleType>Short Titles as Introduced</titleType>
        <chamberName />
        <parentTitleType />
        <title>Preserve Our Lakes and Keep Our Environment Safe Act</title>
        <chamberCode />
      </item>
      <item>
        <titleType>Official Title as Introduced</titleType>
        <chamberName />
        <parentTitleType />
        <title>To require the Secretary of Transportation to conduct a study on the economic and environmental risks to the Great Lakes of spills or leaks of oil, and for other purposes.</title>
        <chamberCode />
      </item>
      <item>
        <titleType>Display Title</titleType>
        <chamberName />
        <parentTitleType />
        <title>Preserve Our Lakes and Keep Our Environment Safe Act</title>
        <chamberCode />
      </item>
    </titles>
    <billType>HR</billType>
    <amendments />
    <actions>
      <actionTypeCounts>
        <placeholderTextForH>4</placeholderTextForH>
        <billReferrals>2</billReferrals>
        <billReferralsAggregate>1</billReferralsAggregate>
        <introducedInTheHouse>1</introducedInTheHouse>
        <introducedInHouse>1</introducedInHouse>
      </actionTypeCounts>
      <item>
        <actionDate>2017-01-25</actionDate>
        <committee>
          <name>Environment and the Economy Subcommittee</name>
          <systemCode>hsif18</systemCode>
        </committee>
        <links />
        <sourceSystem>
          1
          <name>House committee actions</name>
        </sourceSystem>
        <text>Referred to the Subcommittee on Environment.</text>
        <type>Committee</type>
      </item>
      <item>
        <actionDate>2017-01-12</actionDate>
        <committee>
          <name>Water Resources and Environment Subcommittee</name>
          <systemCode>hspw02</systemCode>
        </committee>
        <links />
        <sourceSystem>
          1
          <name>House committee actions</name>
        </sourceSystem>
        <text>Referred to the Subcommittee on Water Resources and Environment.</text>
        <type>Committee</type>
      </item>
      <item>
        <actionDate>2017-01-12</actionDate>
        <committee>
          <name>Railroads, Pipelines, and Hazardous Materials Subcommittee</name>
          <systemCode>hspw14</systemCode>
        </committee>
        <links />
        <sourceSystem>
          1
          <name>House committee actions</name>
        </sourceSystem>
        <text>Referred to the Subcommittee on Railroads, Pipelines, and Hazardous Materials.</text>
        <type>Committee</type>
      </item>
      <item>
        <actionDate>2017-01-12</actionDate>
        <committee>
          <name>Coast Guard and Maritime Transportation Subcommittee</name>
          <systemCode>hspw07</systemCode>
        </committee>
        <links />
        <sourceSystem>
          1
          <name>House committee actions</name>
        </sourceSystem>
        <text>Referred to the Subcommittee on Coast Guard and Maritime Transportation.</text>
        <type>Committee</type>
      </item>
      <item>
        <links />
        <actionCode>H11100</actionCode>
        <type>IntroReferral</type>
        <committee>
          <name>Energy and Commerce Committee</name>
          <systemCode>hsif00</systemCode>
        </committee>
        <actionDate>2017-01-11</actionDate>
        <text>Referred to House Energy and Commerce</text>
        <sourceSystem>
          2
          <name>House floor actions</name>
        </sourceSystem>
      </item>
      <item>
        <links />
        <actionCode>H11100</actionCode>
        <type>IntroReferral</type>
        <committee>
          <name>Transportation and Infrastructure Committee</name>
          <systemCode>hspw00</systemCode>
        </committee>
        <actionDate>2017-01-11</actionDate>
        <text>Referred to House Transportation and Infrastructure</text>
        <sourceSystem>
          2
          <name>House floor actions</name>
        </sourceSystem>
      </item>
      <item>
        <links />
        <actionCode>H11100-A</actionCode>
        <type>IntroReferral</type>
        <committee />
        <actionDate>2017-01-11</actionDate>
        <text>Referred to the Committee on Transportation and Infrastructure, and in addition to the Committee on Energy and Commerce, for a period to be subsequently determined by the Speaker, in each case for consideration of such provisions as fall within the jurisdiction of the committee concerned.</text>
        <sourceSystem>
          9
          <name>Library of Congress</name>
        </sourceSystem>
      </item>
      <item>
        <links />
        <actionCode>Intro-H</actionCode>
        <type>IntroReferral</type>
        <committee />
        <actionDate>2017-01-11</actionDate>
        <text>Introduced in House</text>
        <sourceSystem>
          9
          <name>Library of Congress</name>
        </sourceSystem>
      </item>
      <item>
        <links />
        <actionCode>1000</actionCode>
        <type>IntroReferral</type>
        <committee />
        <actionDate>2017-01-11</actionDate>
        <text>Introduced in House</text>
        <sourceSystem>
          9
          <name>Library of Congress</name>
        </sourceSystem>
      </item>
      <actionByCounts>
        <houseOfRepresentatives>9</houseOfRepresentatives>
      </actionByCounts>
    </actions>
    <latestAction>
      <actionDate>2017-01-25</actionDate>
      <links />
      <text>Referred to the Subcommittee on Environment.</text>
    </latestAction>
    <billNumber>458</billNumber>
    <congress>115</congress>
    <title>Preserve Our Lakes and Keep Our Environment Safe Act</title>
    <policyArea>
      <name>Transportation and Public Works</name>
    </policyArea>
    <subjects>
      <billSubjects>
        <policyArea>
          <name>Transportation and Public Works</name>
        </policyArea>
        <legislativeSubjects>
          <item>
            <name>Aquatic ecology</name>
          </item>
          <item>
            <name>Environmental assessment, monitoring, research</name>
          </item>
          <item>
            <name>Government studies and investigations</name>
          </item>
          <item>
            <name>Great Lakes</name>
          </item>
          <item>
            <name>Hazardous wastes and toxic substances</name>
          </item>
          <item>
            <name>Marine pollution</name>
          </item>
          <item>
            <name>Michigan</name>
          </item>
          <item>
            <name>Oil and gas</name>
          </item>
          <item>
            <name>Pipelines</name>
          </item>
          <item>
            <name>Seashores and lakeshores</name>
          </item>
          <item>
            <name>Transportation safety and security</name>
          </item>
          <item>
            <name>Water quality</name>
          </item>
          <item>
            <name>Wildlife conservation and habitat protection</name>
          </item>
        </legislativeSubjects>
      </billSubjects>
    </subjects>
    <cboCostEstimates />
    <cosponsors>
      <item>
        <identifiers>
          <bioguideId>D000624</bioguideId>
          <lisID>2251</lisID>
          <gpoId />
        </identifiers>
        <middleName />
        <fullName>Rep. Dingell, Debbie [D-MI-12]</fullName>
        <bioguideId>D000624</bioguideId>
        <sponsorshipWithdrawnDate />
        <party>D</party>
        <sponsorshipDate>2017-01-11</sponsorshipDate>
        <lastName>Dingell</lastName>
        <district>12</district>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <firstName>Debbie</firstName>
        <state>MI</state>
      </item>
      <item>
        <identifiers>
          <bioguideId>B001301</bioguideId>
          <lisID>2333</lisID>
          <gpoId />
        </identifiers>
        <middleName />
        <fullName>Rep. Bergman, Jack [R-MI-1]</fullName>
        <bioguideId>B001301</bioguideId>
        <sponsorshipWithdrawnDate />
        <party>R</party>
        <sponsorshipDate>2017-01-23</sponsorshipDate>
        <lastName>Bergman</lastName>
        <district>1</district>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <firstName>Jack</firstName>
        <state>MI</state>
      </item>
    </cosponsors>
    <committees>
      <billCommittees>
        <item>
          <subcommittees>
            <item>
              <systemCode>hsif18</systemCode>
              <name>Environment and the Economy Subcommittee</name>
              <activities>
                <item>
                  <date>2017-01-25T14:39:14Z</date>
                  <name>Referred to</name>
                </item>
              </activities>
            </item>
          </subcommittees>
          <type>Standing</type>
          <activities>
            <item>
              <date>2017-01-11T15:03:15Z</date>
              <name>Referred to</name>
            </item>
          </activities>
          <systemCode>hsif00</systemCode>
          <name>Energy and Commerce Committee</name>
          <chamber>House</chamber>
        </item>
        <item>
          <subcommittees>
            <item>
              <systemCode>hspw02</systemCode>
              <name>Water Resources and Environment Subcommittee</name>
              <activities>
                <item>
                  <date>2017-01-12T14:56:23Z</date>
                  <name>Referred to</name>
                </item>
              </activities>
            </item>
            <item>
              <systemCode>hspw14</systemCode>
              <name>Railroads, Pipelines, and Hazardous Materials Subcommittee</name>
              <activities>
                <item>
                  <date>2017-01-12T14:55:18Z</date>
                  <name>Referred to</name>
                </item>
              </activities>
            </item>
            <item>
              <systemCode>hspw07</systemCode>
              <name>Coast Guard and Maritime Transportation Subcommittee</name>
              <activities>
                <item>
                  <date>2017-01-12T14:38:59Z</date>
                  <name>Referred to</name>
                </item>
              </activities>
            </item>
          </subcommittees>
          <type>Standing</type>
          <activities>
            <item>
              <date>2017-01-11T15:03:10Z</date>
              <name>Referred to</name>
            </item>
          </activities>
          <systemCode>hspw00</systemCode>
          <name>Transportation and Infrastructure Committee</name>
          <chamber>House</chamber>
        </item>
      </billCommittees>
    </committees>
    <constitutionalAuthorityStatementText><![CDATA[
From the Congressional Record Online through the Government Publishing Office [www.gpo.gov]By Mr. TROTT:H.R. 458.Congress has the power to enact this legislation pursuantto the following:Article I, Section 8[Page H392]
]]></constitutionalAuthorityStatementText>
    <createDate>2017-01-12T04:45:50Z</createDate>
  </bill>
  <dublinCore xmlns:dc="http://purl.org/dc/elements/1.1/">
    <dc:format>text/xml</dc:format>
    <dc:language>EN</dc:language>
    <dc:rights>Pursuant to Title 17 Section 105 of the United States Code, this file is not subject to copyright protection and is in the public domain.</dc:rights>
    <dc:contributor>Congressional Research Service, Library of Congress</dc:contributor>
    <dc:description>This file contains bill summaries and statuses for federal legislation. A bill summary describes the most significant provisions of a piece of legislation and details the effects the legislative text may have on current law and federal programs. Bill summaries are authored by the Congressional Research Service (CRS) of the Library of Congress. As stated in Public Law 91-510 (2 USC 166 (d)(6)), one of the duties of CRS is "to prepare summaries and digests of bills and resolutions of a public general nature introduced in the Senate or House of Representatives". For more information, refer to the User Guide that accompanies this file.</dc:description>
  </dublinCore>
</billStatus>


text:
from message_plugin import MessagePlugin

from urllib2 import urlopen, HTTPError
from urlparse import urlparse, parse_qs
import datetime
import re
import xml.etree.ElementTree as ET

class YoutubeHelper(MessagePlugin):

    def get_video_id(self, url):
        if url.find("youtube.com") > -1:
            qps = parse_qs(urlparse(url).query, keep_blank_values=True)
            if 'v' in qps.keys():
                return qps['v'][0]
            else:
                return None
        elif url.find("youtu.be") > -1:
            path_elements = filter(None, urlparse(url).path.split("/"))
            if len(path_elements) > 0:
                return path_elements[0]
            else:
                return None
        else:
            return None

    def get_video_info(self, video_id):
        try:
            fh = urlopen("http://gdata.youtube.com/feeds/api/videos/%s" % (video_id))
            xml_data = fh.read()
            root = ET.fromstring(xml_data)
            video_title = ""
            video_duration = ""
            for k in range(0, len(root) - 1):
                if root[k].tag.endswith("title"):
                    video_title = root[k].text
                if root[k].tag.endswith("group"):
                    for child in root[k].getchildren():
                        if child.tag.endswith("duration"):
                            video_duration = child.attrib['seconds']
            fh.close()
            return video_title, video_duration
        except HTTPError:
            return None, None

    def message_received(self, msg, nick=""):
        if msg['type'] == 'groupchat':
            urls = re.findall(r'(https?://[^\s]+)', msg['body'])

            for url in urls:
                video_id = self.get_video_id(url)
                if video_id:
                    title, duration = self.get_video_info(video_id)
                    if title:
                        new_msg = "Video: %s (%s)" % (title, str(datetime.timedelta(seconds=int(duration))))
                        msg.reply(new_msg).send()

redpajama_set_name: RedPajamaGithub


text:
namespace {

const wchar_t kChromeGuid[] = L"{5B73C40A-84CA-406C-B1FD-5863DA4A41EE}";
const wchar_t kBrowserAppId[] = L"BitPop";

}  // namespace

BitpopDistribution::BitpopDistribution()
    : BrowserDistribution(CHROME_BROWSER),
      product_guid_(kChromeGuid) {
}

std::wstring BitpopDistribution::GetAppGuid() {
  return product_guid();
}

std::wstring BitpopDistribution::GetBaseAppName() {
  return L"BitPop";
}

std::wstring BitpopDistribution::GetAlternateApplicationName() {
  return L"The Internet";
}

std::wstring BitpopDistribution::GetBaseAppId() {
  return kBrowserAppId;
}

std::wstring BitpopDistribution::GetInstallSubDir() {
  return L"BitPop";
}

std::wstring BitpopDistribution::GetPublisherName() {
  return L"House of Life";
}

std::wstring BitpopDistribution::GetAppDescription() {
  return L"Browse the web";
}

std::string BitpopDistribution::GetSafeBrowsingName() {
  return "bitpop";
}

std::wstring BitpopDistribution::GetStateKey() {
  std::wstring key(google_update::kRegPathClientState);
  key.append(L"\\");
  key.append(product_guid());
  return key;
}

std::wstring BitpopDistribution::GetStateMediumKey() {
  std::wstring key(google_update::kRegPathClientStateMedium);
  key.append(L"\\");
  key.append(product_guid());
  return key;
}

std::wstring BitpopDistribution::GetStatsServerURL() {
  return L"";
}

//std::string BitpopDistribution::GetNetworkStatsServer() const {
//  return "";
//}

std::wstring BitpopDistribution::GetDistributionData(HKEY root_key) {
  return L"";
}

std::wstring BitpopDistribution::GetUninstallLinkName() {
  return L"Uninstall BitPop";
}

std::wstring BitpopDistribution::GetUninstallRegPath() {
  return L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\"
         L"BitPop";
}

std::wstring BitpopDistribution::GetVersionKey() {
  std::wstring key(google_update::kRegPathClients);
  key.append(L"\\");
  key.append(product_guid());
  return key;
}

// This method checks if we need to change "ap" key in Google Update to try
// full installer as fall back method in case incremental installer fails.
// - If incremental installer fails we append a magic string ("-full"), if
// it is not present already, so that Google Update server next time will send
// full installer to update Chrome on the local machine
// - If we are currently running full installer, we remove this magic
// string (if it is present) regardless of whether installer failed or not.
// There is no fall-back for full installer :)
void BitpopDistribution::UpdateInstallStatus(bool system_install,
    installer::ArchiveType archive_type,
    installer::InstallStatus install_status) {
  GoogleUpdateSettings::UpdateInstallStatus(system_install,
      archive_type, InstallUtil::GetInstallReturnCode(install_status),
      product_guid());
}


text:
layout: post
title: big boobs housekeeper suck your little dick 11
titleinfo: pornvd
desc: Watch big boobs housekeeper suck your little dick 11. Pornhub is the ultimate xxx porn and sex site.
---

big boobs housekeeper suck your little dick 11

Watch big boobs housekeeper suck your little dick 11. Pornhub is the ultimate xxx porn and sex site.


text:
import React from 'react';

export default class Iframe extends React.Component {

  getIframeRef() {
    return document.getElementById('iframe');
  }

  render() {
    return (
      <iframe id="iframe" src={this.props.iframeSrc} width="100%" height="100%"></iframe>
    );
  }

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EnvDTE;

namespace CodeNavigator
{
    class CodeItemCppHeader : CodeItemCpp
    {
        internal CodeItemCppHeader(ProjectItem item)
            :base(item)
        {}

        static String[] headerExtensions = { ".h", ".hpp", ".hh" };

        //lookup by class name
        internal static CodeItemCppHeader Lookup(ProjectItems items, String className)
        {
            //lookup .h
            ProjectItem header = GetProjectItem(items, className, headerExtensions);

            return (header != null ? new CodeItemCppHeader(header) : null);
        }

        internal override bool IsCppHeader() { return true; }

        internal void SetCppImpl(CodeItemCppImpl cpp)
        {
            _cpp = cpp;
        }

        internal override CodeItemCppImpl GetCppImpl()
        {
            if (_cpp == null)
            {
                _cpp = CodeItemCpp.GetCppItem(_projectItem);
                _cpp.SetCppHeader(this);
            }

            return _cpp;
        }

        internal override CodeItemCppHeader GetCppHeader()
        {
            return this;
        }

        internal override CodeItemCpp GetCorrespondingItem()
        {
            return GetCppImpl();
        }

        //get the declarations for the given method impl
        internal List<MethodDecl> GetMethodDeclarations(List<MethodImpl> methods)
        {
            List<MethodDecl> decls = new List<MethodDecl>();
            foreach (MethodImpl impl in methods)
            {
                MethodDecl decl = GetMethodDecl(impl);
                /*if (decl == null)
                    decl = impl;*/

                decls.Add(decl);
            }

            //TODO: lookup the corresponding declarations in header
            return decls;
        }

        //get the declarations for the given method impl
        internal string GetMethodDeclarationsAsString(List<MethodImpl> methods, bool bExtract)
        {
            List<MethodDecl> decls = GetMethodDeclarations(methods);
            return GetAsString(decls, bExtract);
        }

        /// <summary>
        /// Get the decl from code, which corresponds to the given impl.
        /// </summary>
        /// <param name="impl"></param>
        /// <returns></returns>
        private MethodDecl GetMethodDecl(MethodImpl impl)
        {
            Dictionary<String, MethodDecl> decls = GetMethodDecls();

            MethodDecl decl = null;
            decls.TryGetValue(impl.GetSignature(), out decl);
            return decl;
        }

        private Dictionary<String, MethodDecl> GetMethodDecls()
        {
            if (_decls == null)
            {
                _decls = new Dictionary<String, MethodDecl>();
                List<MethodDecl> declList = CodeAnalyzerCpp.GetMethodDeclarations(GetClassName(), GetContent());
                foreach (MethodDecl decl in declList)
                    _decls.Add(decl.GetSignature(), decl);
            }

            return _decls;
        }

        CodeItemCppImpl _cpp = null;

        Dictionary<String, MethodDecl> _decls = null;
    }
}


text:
var init = function() {

	geoLocation();
	//getWeather();
	$.index.open();

};

	// this is the event listener for the button

var getWeather = function(coords) {
	var args = arguments[0] || {};

	//getting data
	var apiCall = Ti.Network.createHTTPClient();
	apiCall.open("GET", "http://api.wunderground.com/api/0686a531a29abea6/conditions/q/"+coords.latitude +","+coords.longitude+".json");

	//on a successful load of data
	apiCall.onload = function() {
		try {
			//this takes the data from weather.com and makes it useable
			var json = JSON.parse(this.responseText);
			//this is were we are selecting the certain information from weather.com
			Ti.API.info('Full Location' + json.current_observation.display_location.full);
			Ti.API.info('temp_f= ' + json.current_observation.temp_f);
			Ti.API.info('weather=' + json.current_observation.weather);
			Ti.API.info('Feels Like=' + json.current_observation.feelslike_f);
			Ti.API.info('icon' + json.current_observation.icon_url);
			Ti.API.info('humidity =' + json.current_observation.relative_humidity);
			//wind data
			Ti.API.info('Wind direction =' + json.current_observation.wind_dir );
			Ti.API.info('humidity =' + json.current_observation.wind_mph);
			Ti.API.info('humidity =' + json.current_observation.windchill_f);
			//pushes the data onto the index xml labels/views
			$.city.text = json.current_observation.display_location.full;
			$.temp.text =  json.current_observation.temp_f + 'º';
			$.feelsLike.text = "Feels Like " + json.current_observation.feelslike_f+ 'º';
			$.windMPH.text = json.current_observation.wind_mph+ 'mph';
			$.windDir.text =  json.current_observation.wind_dir;
			$.windChill.text = 'Wind Chill ' + json.current_observation.windchill_f + 'º';
			$.humidity.text = "Humidity " + json.current_observation.relative_humidity;
			$.skys.text = json.current_observation.weather;
			$.weatherIcon.image = json.current_observation.icon_url;
			wear(json.current_observation);
			colorChange(json.current_observation);
		} catch(e) {
			Ti.API.info(e);
		}

	};

	//executes send for data
	apiCall.send();

};
//grabbing the current location
var geoLocation = function(){
if (Ti.Geolocation.locationServicesEnabled) {
    Titanium.Geolocation.purpose = 'Get Current Location';
    Titanium.Geolocation.getCurrentPosition(function(e) {
        if (e.error) {
            Ti.API.error('Error: ' + e.error);
        } else {
            Ti.API.info(e.coords);
            getWeather(e.coords);
            Ti.API.info('lat'+e.coords.latitude);
            Ti.API.info('long'+e.coords.longitude);
        }
    });
} else {
    alert('Please enable location services');
}
};

//this is the wear function that takes the current temp and spits out what to wear

var wear = function(data) {
	if (data.temp_f > 16 && data.temp_f < 34.9) {
		$.toWear.text = "Wear a winter jacket and pants plus socks, winter hat. Heavy gloves";
	}
	else if (data.temp_f > -15 && data.temp_f < 15.9) {
		$.toWear.text = "Heavy winter jacket, sweatshirt underneath, wool socks, heavy gloves, and heavy winter hat.";
	}
	else if ( data.temp_f > 41.01 && data.temp_f < 51.9) {
		$.toWear.text = "Light jacket and pants. Long-sleeved shirt undernieth if you'll be outside for awhile ";
	}
	else if ( data.temp_f > 52.01 && data.temp_f < 60.9) {
		$.toWear.text = "Sweatshirt or fleece and pants. Longsleeve shirt if you're feeling brave";

	}
	else if ( data.temp_f > 35. && data.temp_f < 40.999) {
		$.toWear.text = "Medium weight jacket and pants. Maybe a light knit hat and lighter gloves";
	}
	else if (data.temp_f > 61 && data.temp_f < 74.9) {
		$.toWear.text = "T-shirt and jeans. If you're staying out past sundown, probably bring a sweater";
	}
	else if (data.temp_f > 75 && data.temp_f < 89.9) {
		$.toWear.text = "Shorts and T-shirt. Sandals if you're not working";
	}
	else if (data.temp_f > 90 && data.temp_f < 110) {
		$.toWear.text = "Light shirt in both material and color, light shorts, and probably sunscreen";
	}
	else {
		$.toWear.text = "Stay indoors as often as possible";
	}
};

$.Warm.addEventListener('click',function(data){
		if (data.temp_f > 16 && data.temp_f < 34.9) {
		$.toWear.text = "Wear a winter jacket and pants plus socks, winter hat. Heavy gloves";
	}
	else if (data.temp_f > -15 && data.temp_f < 15.9) {
		$.toWear.text = "Heavy winter jacket, sweatshirt underneath, wool socks, heavy gloves, and heavy winter hat.";
	}
	else if ( data.temp_f > 41.01 && data.temp_f < 51.9) {
		$.toWear.text = "blah ";
	}
	else if ( data.temp_f > 52.01 && data.temp_f < 60.9) {
		$.toWear.text = "Sweatshirt or fleece and pants. Longsleeve shirt if you're feeling brave";

	}
	else if ( data.temp_f > 35. && data.temp_f < 40.999) {
		$.toWear.text = "Medium weight jacket and pants. Maybe a light knit hat and lighter gloves";
	}
	else if (data.temp_f > 61 && data.temp_f < 74.9) {
		$.toWear.text = "T-shirt and jeans. If you're staying out past sundown, probably bring a sweater";
	}
	else if (data.temp_f > 75 && data.temp_f < 89.9) {
		$.toWear.text = "Shorts and T-shirt. Sandals if you're not working";
	}
	else if (data.temp_f > 90 && data.temp_f < 110) {
		$.toWear.text = "Light shirt in both material and color, light shorts, and probably sunscreen";
	}
	else {
		$.toWear.text = "Stay indoors as often as possible";
	}

});

/*var colorChange = function(data){
	if(data.weather = 'Overcast')
	{
		$.Weather.backgroundColor ='#9FEE00';
	}
	else if (data.weather = 'Rain')
	{
		$.Weather.backgroundColor ="#2D3C82";
	}
	else if (data.weather = 'Sunny')
	{
		$.Weather.backgroundColor ='#FFC600';
	}
	else if (data.weather = 'Clear')
	{
		$.Weather.backgroundColor ='#FFC600';
	}
	else if (data.weather = 'Snow')
	{
		$.Weather.backgroundColor ='#FFFFFF';
	}
	else if (data.weather = 'Mostly Cloudy')
	{
		$.Weather.backgroundColor = '#78E700';
	}
	else if (data.weather = 'Partly Cloudy')
	{
		$.Weather.backgroundColor ='#FFC600';
	}
	else if (data.weather = 'Fog')
	{
		$.Weather.backgroundColor = "#64AAD0";
	}
};
*/
init();


text:
<?php
/**
 * @author h.woltersdorf
 */

namespace Fortuneglobe\IceHawk\Tests\Unit\Fixtures;

use Fortuneglobe\IceHawk\Constants\Http;
use Fortuneglobe\IceHawk\Interfaces\ServesRequestInfo;
use Fortuneglobe\IceHawk\UriRewriter;

/**
 * Class TestUriRewriterWithValidMap
 *
 * @package Fortuneglobe\IceHawk\Tests\Unit\Fixtures
 */
class TestUriRewriterWithValidMap extends UriRewriter
{

	private static $simpleMap = [
		"#/non/regex/rewrite#"      => [ '/non_regex_rewrite', Http::MOVED_PERMANENTLY ],
		"#/non/regex/no/code#"      => [ '/non_regex_no_code' ],
		"#^/regex/rewrite/?#"       => [ '/regex_rewrite', Http::MOVED_TEMPORARILY ],
		"#^/regex/param/([^/]+)/?#" => [ '/regex_param_$1', Http::MOVED_TEMPORARILY ],
	];

	public function rewrite( ServesRequestInfo $requestInfo )
	{
		return $this->rewriteUriBySimpleMap( $requestInfo->getUri(), self::$simpleMap );
	}
}


text:
import json
import os
import httplib
import urllib
from urlparse import urlparse
from exceptions import PydasException
import zipfile

class Communicator(object):
    """
    Class for exchanging data with a midas server.
    """

    def __init__(self, url=""):
        """
        Constructor
        """
        self.apiSuffix = '/api/json?method='
        self.serverUrl = url

    def encodeFileRequest (self, file_path, fields=[]):
        BOUNDARY = '----------bundary------'
        CRLF = '\r\n'
        body = []
        # Add the metadata about the upload first
        for key in fields.keys():
            value = fields[key]
            body.extend(
              ['--' + BOUNDARY,
               'Content-Disposition: form-data; name="%s"' % key,
               '',
               value,
               ])
        # Now add the file itself
        file_name = os.path.basename(file_path)
        f = open(file_path, 'rb')
        file_content = f.read()
        f.close()
        body.extend(
          ['--' + BOUNDARY,
           'Content-Disposition: form-data; name="file"; filename="%s"'
           % file_name,
           # The upload server determines the mime-type, no need to set it.
           'Content-Type: application/octet-stream',
           '',
           file_content,
           ])
        # Finalize the form body
        body.extend(['--' + BOUNDARY + '--', ''])
        return 'multipart/form-data; boundary=%s' % BOUNDARY, CRLF.join(body)

    def makeRequest(self, method, parameters=None, file=None):
        """
        Do the generic processing of a request to the server
        """
        url = self.serverUrl + self.apiSuffix + method
        request = None
        headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"}

        if parameters:
            data = urllib.urlencode(parameters)

        else:
            parameters = dict()
            data = urllib.urlencode({})

        if file and os.path.exists(file):
            content_type, data = self.encodeFileRequest(file, parameters)
            headers = { 'Content-Type': content_type }

        h = httplib.HTTPConnection(urlparse(url)[1])
        h.request('POST', urlparse(url)[2]+'?'+urlparse(url)[4], data, headers)
        respnseRequest = h.getresponse()
        code = respnseRequest.status
        message = respnseRequest.reason
        content = respnseRequest.read()

        if code != 200:
            raise PydasException("Request failed with HTTP error code "
                                 "%d" % code)

        try: response = json.loads(content)
        except Exception, e:
          print e
          print content
          return False

        if response['stat'] != 'ok':
            raise PydasException("Request failed with Midas error code "
                                 "%s: %s" % (response['code'],
                                             response['message']))
        return response['data']

    def getServerVersion(self):
        """
        Get the version from the server
        """
        response = self.makeRequest('midas.version')
        return response['version']

    def getServerInfo(self):
        """
        Get info from the server (this is an alias to getVersion on most
        platforms, but it returns the whole dictionary).
        """
        response = self.makeRequest('midas.info')
        return response

    def getItem(self, itemId, token = None):
        """
        Get item Info
        """
        parameters = dict()
        if token:
          parameters['token'] = token
        parameters['id'] = itemId

        response = self.makeRequest('midas.item.get', parameters)
        return response

    def downloadItem(self, itemId, destination, token = None):
        """
        Download an item
        """
        parameters = dict()
        if token:
          parameters['token'] = token
        parameters['id'] = itemId

        itemInfo = self.getItem(itemId, token)
        revision = False
        for value in itemInfo['revisions']:
          revision = value

        for value in revision['bitstreams']:
          self.downloadBitstream(value['bitstream_id'], destination, token)

        return

    def getBitstream(self, bitstreamId, token = None):
        """
        Get bitstream Info
        """
        parameters = dict()
        if token:
          parameters['token'] = token
        parameters['id'] = bitstreamId

        response = self.makeRequest('midas.bitstream.get', parameters)
        return response

    def downloadBitstream(self, bitstreamId, destination, token = None):
        """
        Download a bitstream
        """
        parameters = dict()
        if token:
          parameters['token'] = token
        parameters['id'] = bitstreamId

        data = urllib.urlencode(parameters)
        headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"}
        url = self.serverUrl + self.apiSuffix + 'midas.bitstream.download'
        h = httplib.HTTPConnection(urlparse(url)[1])
        h.request('POST', urlparse(url)[2]+'?'+urlparse(url)[4], data, headers)
        respnseRequest = h.getresponse()
        code = respnseRequest.status

        message = respnseRequest.reason
        data = respnseRequest.read()

        if os.path.isdir(destination) == False:
          destination = os.path.dirname(path)

        bitstreamInfo = self.getBitstream(bitstreamId, token)
        destination = destination+'/'+bitstreamInfo['name']

        with open(destination, 'wb') as f:
            f.write(data)

        return

    def getDefaultApiKey(self, email, password):
        """
        Gets the default api key given an email and password
        """
        parameters = dict()
        parameters['email'] = email
        parameters['password'] = password
        response = self.makeRequest('midas.user.apikey.default', parameters)
        return response['apikey']

    def loginWithApiKey(self, email, apikey, application='Default'):
        """
        Login and get a token using an email and apikey. If you do not specify
        a specific application, 'default' will be used
        """
        parameters = dict()
        parameters['email'] = email
        parameters['apikey'] = apikey
        parameters['appname'] = application
        response = self.makeRequest('midas.login', parameters)
        return response['token']

    def listUserFolders(self, token):
        """
        Use a users token to list the curent folders.
        """
        parameters = dict()
        parameters['token'] = token
        response = self.makeRequest('midas.user.folders', parameters)
        return response

    def generateUploadToken(self, token, itemid, filename, checksum=None):
        """
        Generate a token to use for upload.
        """
        parameters = dict()
        parameters['token'] = token
        parameters['itemid'] = itemid
        parameters['filename'] = filename
        if not checksum == None:
            parameters['checksum'] = checksum
        response = self.makeRequest('midas.upload.generatetoken', parameters)
        return response

    def createItem(self, token, name, parentid, description=None, uuid=None,
                   privacy='Public'):
        """
        BROKEN HACK TODO FIXME
        """
        parameters = dict()
        parameters['token'] = token
        parameters['name'] = name
        parameters['parentid'] = parentid
        parameters['privacy'] = privacy
        if not description == None:
            parameters['description'] = description
        if not uuid == None:
            parameters['uuid'] = uuid
        response = self.makeRequest('midas.item.create', parameters)
        return response

    def performUpload(self, uploadtoken, filename, length, mode=None,
                      folderid=None, itemid=None, revision=None):
        """
        BROKEN HACK TODO FIXME
        """
        parameters = dict()
        parameters['uploadtoken'] = uploadtoken
        parameters['filename'] = filename
        parameters['length'] = length
        if not mode == None:
            parameters['mode'] = mode
        if not folderid == None:
            parameters['folderid'] = folderid
        if not itemid == None:
            parameters['itemid'] = itemid
        if not revision == None:
            parameters['revision'] = revision
        response = self.makeRequest('midas.upload.perform', parameters)
        return response


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Web.Compilation;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using OpenRiaServices.DomainServices.Tools.Validation;

namespace OpenRiaServices.DomainServices.Tools
{
    /// <summary>
    /// Task that validates the integrity of the <see cref="OpenRiaServices.DomainServices.Server.DomainService"/>s exposed by the target Web Application
    /// </summary>
    public class ValidateDomainServicesTask : Task
    {
        #region Member Fields

        private readonly ILoggingService _loggingService;
        private string _projectDirectory;

        #endregion

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="ValidateDomainServicesTask"/>
        /// </summary>
        public ValidateDomainServicesTask()
        {
            this._loggingService = new TaskLoggingHelperLoggingService(this.Log);
        }

        #endregion

        #region Properties

        /// <summary>
        /// Gets or sets the path to the project file
        /// </summary>
        [Required]
        public string ProjectPath { get; set; }

        /// <summary>
        /// Gets or sets the assembly containing <see cref="OpenRiaServices.DomainServices.Server.DomainService"/> types
        /// </summary>
        [Required]
        public ITaskItem Assembly { get; set; }

        /// <summary>
        /// Gets or sets the list of reference assemblies that may contains <see cref="OpenRiaServices.DomainServices.Server.DomainService"/> types
        /// </summary>
        [Required]
        public ITaskItem[] ReferenceAssemblies { get; set; }

        /// <summary>
        /// Gets the absolute path to the project directory
        /// </summary>
        private string ProjectDirectory
        {
            get
            {
                if (this._projectDirectory == null)
                {
                    this._projectDirectory = Path.GetDirectoryName(this.ProjectPath);
                }
                return this._projectDirectory;
            }
        }

        /// <summary>
        /// Gets the <see cref="ILoggingService"/> for this task
        /// </summary>
        private ILoggingService LoggingService
        {
            get { return this._loggingService; }
        }

        #endregion

        #region Methods

        /// <summary>
        /// Returns the absolute filename of the <see cref="ITaskItem"/>
        /// </summary>
        /// <param name="taskItem">The item to get the name for</param>
        /// <returns>The absolute filename</returns>
        private string GetFileName(ITaskItem taskItem)
        {
            string fileName = taskItem.ItemSpec;
            if (!Path.IsPathRooted(fileName))
            {
                fileName = Path.GetFullPath(Path.Combine(this.ProjectDirectory, fileName));
            }
            return fileName;
        }

        /// <summary>
        /// Invoked by MSBuild to run this task
        /// </summary>
        /// <returns><c>true</c> if task succeeds</returns>
        public override bool Execute()
        {
            this._projectDirectory = null;

            this.LoggingService.LogMessage(string.Format(CultureInfo.CurrentCulture, "DomainService Validation starting for project {0}", Path.GetFileName(this.ProjectPath)));
            Stopwatch stopWatch = new Stopwatch();
            stopWatch.Start();

            this.ValidateDomainServices();

            stopWatch.Stop();
            double secondsAsDouble = stopWatch.ElapsedMilliseconds / 1000.0;
            this.LoggingService.LogMessage(string.Format(CultureInfo.CurrentCulture, "DomainService Validation finished in {0} seconds", secondsAsDouble));

            // Any error sent to the log constitutes failure
            return !this.LoggingService.HasLoggedErrors;
        }

        /// <summary>
        /// Validates the integrity of the <see cref="OpenRiaServices.DomainServices.Server.DomainService"/>s exposed by the target Web Application
        /// in a separate <see cref="AppDomain"/>
        /// </summary>
        private void ValidateDomainServices()
        {
            IEnumerable<string> assemblies =
                new[] { this.GetFileName(this.Assembly) } .Concat(
                this.ReferenceAssemblies.Select(i => this.GetFileName(i)));

            this.WarnIfAssembliesDontExist(assemblies);

            using (ClientBuildManager cbm = new ClientBuildManager(/* appVirtualDir */ "/", this.ProjectDirectory))
            {
                // Surface a HttpRuntime initialization error that would otherwise manifest as a NullReferenceException
                // This can occur when the build environment is configured incorrectly
                if (System.Web.Hosting.HostingEnvironment.InitializationException != null)
                {
                    throw new InvalidOperationException(
                        Resource.HttpRuntimeInitializationError,
                        System.Web.Hosting.HostingEnvironment.InitializationException);
                }

                using (DomainServiceValidator validator = (DomainServiceValidator)cbm.CreateObject(typeof(DomainServiceValidator), false))
                {
                    // Transfer control to Web Application AppDomain to invoke the validator
                    validator.Validate(assemblies.ToArray(), this.LoggingService);
                }
            }
        }

        /// <summary>
        /// Checks the existence of files and logs a warning message for each that does not exist
        /// </summary>
        /// <param name="assemblies">The set of assembly names to test</param>
        private void WarnIfAssembliesDontExist(IEnumerable<string> assemblies)
        {
            foreach (string assembly in assemblies)
            {
                if (!File.Exists(assembly))
                {
                    this.LoggingService.LogWarning(string.Format(CultureInfo.CurrentCulture, Resource.ClientCodeGen_Input_Assembly_Not_Found, assembly));
                }
            }
        }

        #endregion

        #region Nested Classes

        /// <summary>
        /// <see cref="ILoggingService"/> implementation that writes to a <see cref="TaskLoggingHelper"/> and
        /// handles cross-appdomain logging requests
        /// </summary>
        private class TaskLoggingHelperLoggingService : MarshalByRefObject, ILoggingService
        {
            private bool _hasLoggedErrors;
            private TaskLoggingHelper _log;

            public TaskLoggingHelperLoggingService(TaskLoggingHelper log)
            {
                if (log == null)
                {
                    throw new ArgumentNullException("log");
                }

                this._log = log;
            }

            public TaskLoggingHelper Log
            {
                get { return this._log; }
            }

            public void LogError(string message, string subcategory, string errorCode, string helpKeyword, string file, int lineNumber, int columnNumber, int endLineNumber, int endColumnNumber)
            {
                this._hasLoggedErrors = true;
                this.Log.LogError(subcategory, errorCode, helpKeyword, file, lineNumber, columnNumber, endLineNumber, endColumnNumber, message);
            }

            public void LogWarning(string message, string subcategory, string errorCode, string helpKeyword, string file, int lineNumber, int columnNumber, int endLineNumber, int endColumnNumber)
            {
                this.Log.LogWarning(subcategory, errorCode, helpKeyword, file, lineNumber, columnNumber, endLineNumber, endColumnNumber, message);
            }

            public bool HasLoggedErrors
            {
                get { return this._hasLoggedErrors; }
            }

            public void LogError(string message)
            {
                this._hasLoggedErrors = true;
                this.Log.LogError(message);
            }

            public void LogException(Exception ex)
            {
                this._hasLoggedErrors = true;
                this.Log.LogError("Exception: " + ex.Message);
                if (ex.InnerException != null)
                    LogException(ex.InnerException);
            }

            public void LogWarning(string message)
            {
                this.Log.LogWarning(message);
            }

            public void LogMessage(string message)
            {
                this.Log.LogMessage(message);
            }
        }

        #endregion
    }
}


text:
<title>Invocation - The C Preprocessor</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="The C Preprocessor">
<meta name="generator" content="makeinfo 4.11">
<link title="Top" rel="start" href="index.html#Top">
<link rel="prev" href="Implementation-Details.html#Implementation-Details" title="Implementation Details">
<link rel="next" href="Environment-Variables.html#Environment-Variables" title="Environment Variables">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">

<meta http-equiv="Content-Style-Type" content="text/css">

Next: Environment Variables,
Previous: Implementation Details,
Up: Top

12 Invocation

Most often when you use the C preprocessor you will not have to invoke it
explicitly: the C compiler will do so automatically.  However, the
preprocessor is sometimes useful on its own.  All the options listed
here are also acceptable to the C compiler and have the same meaning,
except that the C compiler has different rules for specifying the output
file.

Note: Whether you use the preprocessor by way of <samp>gcc</samp>
or <samp>cpp</samp>, the <dfn>compiler driver</dfn> is run first.  This
program's purpose is to translate your command into invocations of the
programs that do the actual work.  Their command line interfaces are
similar but not identical to the documented interface, and may change
without notice.

The C preprocessor expects two file names as arguments, <var>infile</var> and
<var>outfile</var>.  The preprocessor reads <var>infile</var> together with any
other files it specifies with ‘<samp>#include</samp>’.  All the output generated
by the combined input files is written in <var>outfile</var>.

Either <var>infile</var> or <var>outfile</var> may be <samp>-</samp>, which as
<var>infile</var> means to read from standard input and as <var>outfile</var>
means to write to standard output.  Also, if either file is omitted, it
means the same as if <samp>-</samp> had been specified for that file.

Unless otherwise noted, or the option ends in ‘<samp>=</samp>’, all options
which take an argument may have that argument appear either immediately
after the option, or with a space between option and argument:
<samp>-Ifoo</samp> and <samp>-I foo</samp> have the same effect.

Many options have multi-letter names; therefore multiple single-letter
options may not be grouped: <samp>-dM</samp> is very different from
‘<samp>-d -M</samp>’.

-D <var>name</var>
Predefine <var>name</var> as a macro, with definition 1.

-D <var>name</var>=<var>definition</var>
The contents of <var>definition</var> are tokenized and processed as if
they appeared during translation phase three in a ‘<samp>#define</samp>’
directive.  In particular, the definition will be truncated by
embedded newline characters.

If you are invoking the preprocessor from a shell or shell-like
program you may need to use the shell's quoting syntax to protect
characters such as spaces that have a meaning in the shell syntax.

If you wish to define a function-like macro on the command line, write
its argument list with surrounding parentheses before the equals sign
(if any).  Parentheses are meaningful to most shells, so you will need
to quote the option.  With <samp>sh</samp> and <samp>csh</samp>,
<samp>-D'<var>name</var>(<var>args...</var>)=<var>definition</var>'</samp> works.

<samp>-D</samp> and <samp>-U</samp> options are processed in the order they
are given on the command line.  All <samp>-imacros <var>file</var></samp> and
<samp>-include <var>file</var></samp> options are processed after all
<samp>-D</samp> and <samp>-U</samp> options.

-U <var>name</var>
Cancel any previous definition of <var>name</var>, either built in or
provided with a <samp>-D</samp> option.

-undef
Do not predefine any system-specific or GCC-specific macros.  The
standard predefined macros remain defined.
See Standard Predefined Macros.

-I <var>dir</var>
Add the directory <var>dir</var> to the list of directories to be searched
for header files.
See Search Path.
Directories named by <samp>-I</samp> are searched before the standard
system include directories.  If the directory <var>dir</var> is a standard
system include directory, the option is ignored to ensure that the
default search order for system directories and the special treatment
of system headers are not defeated
(see System Headers)
.
If <var>dir</var> begins with =, then the = will be replaced
by the sysroot prefix; see <samp>--sysroot</samp> and <samp>-isysroot</samp>.

-o <var>file</var>
Write output to <var>file</var>.  This is the same as specifying <var>file</var>
as the second non-option argument to <samp>cpp</samp>.  <samp>gcc</samp> has a
different interpretation of a second non-option argument, so you must
use <samp>-o</samp> to specify the output file.

-Wall
Turns on all optional warnings which are desirable for normal code.
At present this is <samp>-Wcomment</samp>, <samp>-Wtrigraphs</samp>,
<samp>-Wmultichar</samp> and a warning about integer promotion causing a
change of sign in #if expressions.  Note that many of the
preprocessor's warnings are on by default and have no options to
control them.

-Wcomment
-Wcomments
Warn whenever a comment-start sequence ‘<samp>/*</samp>’ appears in a ‘<samp>/*</samp>’
comment, or whenever a backslash-newline appears in a ‘<samp>//</samp>’ comment.
(Both forms have the same effect.)

-Wtrigraphs
Most trigraphs in comments cannot affect the meaning of the program.
However, a trigraph that would form an escaped newline (‘<samp>??/</samp>’ at
the end of a line) can, by changing where the comment begins or ends.
Therefore, only trigraphs that would form escaped newlines produce
warnings inside a comment.

This option is implied by <samp>-Wall</samp>.  If <samp>-Wall</samp> is not
given, this option is still enabled unless trigraphs are enabled.  To
get trigraph conversion without warnings, but get the other
<samp>-Wall</samp> warnings, use ‘<samp>-trigraphs -Wall -Wno-trigraphs</samp>’.

-Wtraditional
Warn about certain constructs that behave differently in traditional and
ISO C.  Also warn about ISO C constructs that have no traditional C
equivalent, and problematic constructs which should be avoided.
See Traditional Mode.

-Wundef
Warn whenever an identifier which is not a macro is encountered in an
‘<samp>#if</samp>’ directive, outside of ‘<samp>defined</samp>’.  Such identifiers are
replaced with zero.

-Wunused-macros
Warn about macros defined in the main file that are unused.  A macro
is <dfn>used</dfn> if it is expanded or tested for existence at least once.
The preprocessor will also warn if the macro has not been used at the
time it is redefined or undefined.

Built-in macros, macros defined on the command line, and macros
defined in include files are not warned about.

Note: If a macro is actually used, but only used in skipped
conditional blocks, then CPP will report it as unused.  To avoid the
warning in such a case, you might improve the scope of the macro's
definition by, for example, moving it into the first skipped block.
Alternatively, you could provide a dummy use with something like:

          #if defined the_macro_causing_the_warning
          #endif

-Wendif-labels
Warn whenever an ‘<samp>#else</samp>’ or an ‘<samp>#endif</samp>’ are followed by text.
This usually happens in code of the form

          #if FOO
          ...
          #else FOO
          ...
          #endif FOO

The second and third FOO should be in comments, but often are not
in older programs.  This warning is on by default.

-Werror
Make all warnings into hard errors.  Source code which triggers warnings
will be rejected.

-Wsystem-headers
Issue warnings for code in system headers.  These are normally unhelpful
in finding bugs in your own code, therefore suppressed.  If you are
responsible for the system library, you may want to see them.

-w
Suppress all warnings, including those which GNU CPP issues by default.

-pedantic
Issue all the mandatory diagnostics listed in the C standard.  Some of
them are left out by default, since they trigger frequently on harmless
code.

-pedantic-errors
Issue all the mandatory diagnostics, and make all mandatory diagnostics
into errors.  This includes mandatory diagnostics that GCC issues
without ‘<samp>-pedantic</samp>’ but treats as warnings.

-M
Instead of outputting the result of preprocessing, output a rule
suitable for <samp>make</samp> describing the dependencies of the main
source file.  The preprocessor outputs one <samp>make</samp> rule containing
the object file name for that source file, a colon, and the names of all
the included files, including those coming from <samp>-include</samp> or
<samp>-imacros</samp> command line options.

Unless specified explicitly (with <samp>-MT</samp> or <samp>-MQ</samp>), the
object file name consists of the name of the source file with any
suffix replaced with object file suffix and with any leading directory
parts removed.  If there are many included files then the rule is
split into several lines using ‘<samp>\</samp>’-newline.  The rule has no
commands.

This option does not suppress the preprocessor's debug output, such as
<samp>-dM</samp>.  To avoid mixing such debug output with the dependency
rules you should explicitly specify the dependency output file with
<samp>-MF</samp>, or use an environment variable like
<samp>DEPENDENCIES_OUTPUT</samp> (see Environment Variables).  Debug output
will still be sent to the regular output stream as normal.

Passing <samp>-M</samp> to the driver implies <samp>-E</samp>, and suppresses
warnings with an implicit <samp>-w</samp>.

-MM
Like <samp>-M</samp> but do not mention header files that are found in
system header directories, nor header files that are included,
directly or indirectly, from such a header.

This implies that the choice of angle brackets or double quotes in an
‘<samp>#include</samp>’ directive does not in itself determine whether that
header will appear in <samp>-MM</samp> dependency output.  This is a
slight change in semantics from GCC versions 3.0 and earlier.

-MF <var>file</var>
When used with <samp>-M</samp> or <samp>-MM</samp>, specifies a
file to write the dependencies to.  If no <samp>-MF</samp> switch is given
the preprocessor sends the rules to the same place it would have sent
preprocessed output.

When used with the driver options <samp>-MD</samp> or <samp>-MMD</samp>,
<samp>-MF</samp> overrides the default dependency output file.

-MG
In conjunction with an option such as <samp>-M</samp> requesting
dependency generation, <samp>-MG</samp> assumes missing header files are
generated files and adds them to the dependency list without raising
an error.  The dependency filename is taken directly from the
#include directive without prepending any path.  <samp>-MG</samp>
also suppresses preprocessed output, as a missing header file renders
this useless.

This feature is used in automatic updating of makefiles.

-MP
This option instructs CPP to add a phony target for each dependency
other than the main file, causing each to depend on nothing.  These
dummy rules work around errors <samp>make</samp> gives if you remove header
files without updating the <samp>Makefile</samp> to match.

This is typical output:

          test.o: test.c test.h

          test.h:

-MT <var>target</var>

Change the target of the rule emitted by dependency generation.  By
default CPP takes the name of the main input file, deletes any
directory components and any file suffix such as ‘<samp>.c</samp>’, and
appends the platform's usual object suffix.  The result is the target.

An <samp>-MT</samp> option will set the target to be exactly the string you
specify.  If you want multiple targets, you can specify them as a single
argument to <samp>-MT</samp>, or use multiple <samp>-MT</samp> options.

For example, <samp>-MT '$(objpfx)foo.o'</samp> might give

          $(objpfx)foo.o: foo.c

-MQ <var>target</var>

Same as <samp>-MT</samp>, but it quotes any characters which are special to
Make.  <samp>-MQ '$(objpfx)foo.o'</samp> gives

          $$(objpfx)foo.o: foo.c

The default target is automatically quoted, as if it were given with
<samp>-MQ</samp>.

-MD
<samp>-MD</samp> is equivalent to <samp>-M -MF <var>file</var></samp>, except that
<samp>-E</samp> is not implied.  The driver determines <var>file</var> based on
whether an <samp>-o</samp> option is given.  If it is, the driver uses its
argument but with a suffix of <samp>.d</samp>, otherwise it takes the name
of the input file, removes any directory components and suffix, and
applies a <samp>.d</samp> suffix.

If <samp>-MD</samp> is used in conjunction with <samp>-E</samp>, any
<samp>-o</samp> switch is understood to specify the dependency output file
(see -MF), but if used without <samp>-E</samp>, each <samp>-o</samp>
is understood to specify a target object file.

Since <samp>-E</samp> is not implied, <samp>-MD</samp> can be used to generate
a dependency output file as a side-effect of the compilation process.

-MMD
Like <samp>-MD</samp> except mention only user header files, not system
header files.

-x c
-x c++
-x objective-c
-x assembler-with-cpp
Specify the source language: C, C++, Objective-C, or assembly.  This has
nothing to do with standards conformance or extensions; it merely
selects which base syntax to expect.  If you give none of these options,
cpp will deduce the language from the extension of the source file:
‘<samp>.c</samp>’, ‘<samp>.cc</samp>’, ‘<samp>.m</samp>’, or ‘<samp>.S</samp>’.  Some other common
extensions for C++ and assembly are also recognized.  If cpp does not
recognize the extension, it will treat the file as C; this is the most
generic mode.

Note: Previous versions of cpp accepted a <samp>-lang</samp> option
which selected both the language and the standards conformance level.
This option has been removed, because it conflicts with the <samp>-l</samp>
option.

-std=<var>standard</var>
-ansi
Specify the standard to which the code should conform.  Currently CPP
knows about C and C++ standards; others may be added in the future.

<var>standard</var>
may be one of:

c90
c89
iso9899:1990
The ISO C standard from 1990.  ‘<samp>c90</samp>’ is the customary shorthand for
this version of the standard.

The <samp>-ansi</samp> option is equivalent to <samp>-std=c90</samp>.

iso9899:199409
The 1990 C standard, as amended in 1994.

iso9899:1999
c99
iso9899:199x
c9x
The revised ISO C standard, published in December 1999.  Before
publication, this was known as C9X.

c1x
The next version of the ISO C standard, still under development.

gnu90
gnu89
The 1990 C standard plus GNU extensions.  This is the default.

gnu99
gnu9x
The 1999 C standard plus GNU extensions.

gnu1x
The next version of the ISO C standard, still under development, plus
GNU extensions.

c++98
The 1998 ISO C++ standard plus amendments.

gnu++98
The same as <samp>-std=c++98</samp> plus GNU extensions.  This is the
default for C++ code.

-I-
Split the include path.  Any directories specified with <samp>-I</samp>
options before <samp>-I-</samp> are searched only for headers requested with
#include "<var>file</var>"; they are not searched for
#include <<var>file</var>>.  If additional directories are
specified with <samp>-I</samp> options after the <samp>-I-</samp>, those
directories are searched for all ‘<samp>#include</samp>’ directives.

In addition, <samp>-I-</samp> inhibits the use of the directory of the current
file directory as the first search directory for #include "<var>file</var>".
See Search Path.
This option has been deprecated.

-nostdinc
Do not search the standard system directories for header files.
Only the directories you have specified with <samp>-I</samp> options
(and the directory of the current file, if appropriate) are searched.

-nostdinc++
Do not search for header files in the C++-specific standard directories,
but do still search the other standard directories.  (This option is
used when building the C++ library.)

-include <var>file</var>
Process <var>file</var> as if #include "file" appeared as the first
line of the primary source file.  However, the first directory searched
for <var>file</var> is the preprocessor's working directory instead of
the directory containing the main source file.  If not found there, it
is searched for in the remainder of the #include "..." search
chain as normal.

If multiple <samp>-include</samp> options are given, the files are included
in the order they appear on the command line.

-imacros <var>file</var>
Exactly like <samp>-include</samp>, except that any output produced by
scanning <var>file</var> is thrown away.  Macros it defines remain defined.
This allows you to acquire all the macros from a header without also
processing its declarations.

All files specified by <samp>-imacros</samp> are processed before all files
specified by <samp>-include</samp>.

-idirafter <var>dir</var>
Search <var>dir</var> for header files, but do it after all
directories specified with <samp>-I</samp> and the standard system directories
have been exhausted.  <var>dir</var> is treated as a system include directory.
If <var>dir</var> begins with =, then the = will be replaced
by the sysroot prefix; see <samp>--sysroot</samp> and <samp>-isysroot</samp>.

-iprefix <var>prefix</var>
Specify <var>prefix</var> as the prefix for subsequent <samp>-iwithprefix</samp>
options.  If the prefix represents a directory, you should include the
final ‘<samp>/</samp>’.

-iwithprefix <var>dir</var>
-iwithprefixbefore <var>dir</var>
Append <var>dir</var> to the prefix specified previously with
<samp>-iprefix</samp>, and add the resulting directory to the include search
path.  <samp>-iwithprefixbefore</samp> puts it in the same place <samp>-I</samp>
would; <samp>-iwithprefix</samp> puts it where <samp>-idirafter</samp> would.

-isysroot <var>dir</var>
This option is like the <samp>--sysroot</samp> option, but applies only to
header files (except for Darwin targets, where it applies to both header
files and libraries).  See the <samp>--sysroot</samp> option for more
information.

-imultilib <var>dir</var>
Use <var>dir</var> as a subdirectory of the directory containing
target-specific C++ headers.

-isystem <var>dir</var>
Search <var>dir</var> for header files, after all directories specified by
<samp>-I</samp> but before the standard system directories.  Mark it
as a system directory, so that it gets the same special treatment as
is applied to the standard system directories.
See System Headers.
If <var>dir</var> begins with =, then the = will be replaced
by the sysroot prefix; see <samp>--sysroot</samp> and <samp>-isysroot</samp>.

-iquote <var>dir</var>
Search <var>dir</var> only for header files requested with
#include "<var>file</var>"; they are not searched for
#include <<var>file</var>>, before all directories specified by
<samp>-I</samp> and before the standard system directories.
See Search Path.
If <var>dir</var> begins with =, then the = will be replaced
by the sysroot prefix; see <samp>--sysroot</samp> and <samp>-isysroot</samp>.

-fdirectives-only
When preprocessing, handle directives, but do not expand macros.

The option's behavior depends on the <samp>-E</samp> and <samp>-fpreprocessed</samp>
options.

With <samp>-E</samp>, preprocessing is limited to the handling of directives
such as #define, #ifdef, and #error.  Other
preprocessor operations, such as macro expansion and trigraph
conversion are not performed.  In addition, the <samp>-dD</samp> option is
implicitly enabled.

With <samp>-fpreprocessed</samp>, predefinition of command line and most
builtin macros is disabled.  Macros such as __LINE__, which are
contextually dependent, are handled normally.  This enables compilation of
files previously preprocessed with -E -fdirectives-only.

With both <samp>-E</samp> and <samp>-fpreprocessed</samp>, the rules for
<samp>-fpreprocessed</samp> take precedence.  This enables full preprocessing of
files previously preprocessed with -E -fdirectives-only.

-fdollars-in-identifiers
Accept ‘<samp>$</samp>’ in identifiers.
See Identifier characters.

-fextended-identifiers
Accept universal character names in identifiers.  This option is
experimental; in a future version of GCC, it will be enabled by
default for C99 and C++.

-fpreprocessed
Indicate to the preprocessor that the input file has already been
preprocessed.  This suppresses things like macro expansion, trigraph
conversion, escaped newline splicing, and processing of most directives.
The preprocessor still recognizes and removes comments, so that you can
pass a file preprocessed with <samp>-C</samp> to the compiler without
problems.  In this mode the integrated preprocessor is little more than
a tokenizer for the front ends.

<samp>-fpreprocessed</samp> is implicit if the input file has one of the
extensions ‘<samp>.i</samp>’, ‘<samp>.ii</samp>’ or ‘<samp>.mi</samp>’.  These are the
extensions that GCC uses for preprocessed files created by
<samp>-save-temps</samp>.

-ftabstop=<var>width</var>
Set the distance between tab stops.  This helps the preprocessor report
correct column numbers in warnings or errors, even if tabs appear on the
line.  If the value is less than 1 or greater than 100, the option is
ignored.  The default is 8.

-fexec-charset=<var>charset</var>
Set the execution character set, used for string and character
constants.  The default is UTF-8.  <var>charset</var> can be any encoding
supported by the system's iconv library routine.

-fwide-exec-charset=<var>charset</var>
Set the wide execution character set, used for wide string and
character constants.  The default is UTF-32 or UTF-16, whichever
corresponds to the width of wchar_t.  As with
<samp>-fexec-charset</samp>, <var>charset</var> can be any encoding supported
by the system's iconv library routine; however, you will have
problems with encodings that do not fit exactly in wchar_t.

-finput-charset=<var>charset</var>
Set the input character set, used for translation from the character
set of the input file to the source character set used by GCC.  If the
locale does not specify, or GCC cannot get this information from the
locale, the default is UTF-8.  This can be overridden by either the locale
or this command line option.  Currently the command line option takes
precedence if there's a conflict.  <var>charset</var> can be any encoding
supported by the system's iconv library routine.

-fworking-directory
Enable generation of linemarkers in the preprocessor output that will
let the compiler know the current working directory at the time of
preprocessing.  When this option is enabled, the preprocessor will
emit, after the initial linemarker, a second linemarker with the
current working directory followed by two slashes.  GCC will use this
directory, when it's present in the preprocessed input, as the
directory emitted as the current working directory in some debugging
information formats.  This option is implicitly enabled if debugging
information is enabled, but this can be inhibited with the negated
form <samp>-fno-working-directory</samp>.  If the <samp>-P</samp> flag is
present in the command line, this option has no effect, since no
#line directives are emitted whatsoever.

-fno-show-column
Do not print column numbers in diagnostics.  This may be necessary if
diagnostics are being scanned by a program that does not understand the
column numbers, such as <samp>dejagnu</samp>.

-A <var>predicate</var>=<var>answer</var>
Make an assertion with the predicate <var>predicate</var> and answer
<var>answer</var>.  This form is preferred to the older form <samp>-A
<var>predicate</var>(<var>answer</var>)</samp>, which is still supported, because
it does not use shell special characters.
See Obsolete Features.

-A -<var>predicate</var>=<var>answer</var>
Cancel an assertion with the predicate <var>predicate</var> and answer
<var>answer</var>.

-dCHARS
<var>CHARS</var> is a sequence of one or more of the following characters,
and must not be preceded by a space.  Other characters are interpreted
by the compiler proper, or reserved for future versions of GCC, and so
are silently ignored.  If you specify characters whose behavior
conflicts, the result is undefined.

‘<samp>M</samp>’
Instead of the normal output, generate a list of ‘<samp>#define</samp>’
directives for all the macros defined during the execution of the
preprocessor, including predefined macros.  This gives you a way of
finding out what is predefined in your version of the preprocessor.
Assuming you have no file <samp>foo.h</samp>, the command

               touch foo.h; cpp -dM foo.h

will show all the predefined macros.

If you use <samp>-dM</samp> without the <samp>-E</samp> option, <samp>-dM</samp> is
interpreted as a synonym for <samp>-fdump-rtl-mach</samp>.
See Debugging Options.

‘<samp>D</samp>’
Like ‘<samp>M</samp>’ except in two respects: it does not include the
predefined macros, and it outputs both the ‘<samp>#define</samp>’
directives and the result of preprocessing.  Both kinds of output go to
the standard output file.

‘<samp>N</samp>’
Like ‘<samp>D</samp>’, but emit only the macro names, not their expansions.

‘<samp>I</samp>’
Output ‘<samp>#include</samp>’ directives in addition to the result of
preprocessing.

‘<samp>U</samp>’
Like ‘<samp>D</samp>’ except that only macros that are expanded, or whose
definedness is tested in preprocessor directives, are output; the
output is delayed until the use or test of the macro; and
‘<samp>#undef</samp>’ directives are also output for macros tested but
undefined at the time.

-P
Inhibit generation of linemarkers in the output from the preprocessor.
This might be useful when running the preprocessor on something that is
not C code, and will be sent to a program which might be confused by the
linemarkers.
See Preprocessor Output.

-C
Do not discard comments.  All comments are passed through to the output
file, except for comments in processed directives, which are deleted
along with the directive.

You should be prepared for side effects when using <samp>-C</samp>; it
causes the preprocessor to treat comments as tokens in their own right.
For example, comments appearing at the start of what would be a
directive line have the effect of turning that line into an ordinary
source line, since the first token on the line is no longer a ‘<samp>#</samp>’.

-CC
Do not discard comments, including during macro expansion.  This is
like <samp>-C</samp>, except that comments contained within macros are
also passed through to the output file where the macro is expanded.

In addition to the side-effects of the <samp>-C</samp> option, the
<samp>-CC</samp> option causes all C++-style comments inside a macro
to be converted to C-style comments.  This is to prevent later use
of that macro from inadvertently commenting out the remainder of
the source line.

The <samp>-CC</samp> option is generally used to support lint comments.

-traditional-cpp
Try to imitate the behavior of old-fashioned C preprocessors, as
opposed to ISO C preprocessors.
See Traditional Mode.

-trigraphs
Process trigraph sequences.
See Initial processing.

-remap
Enable special code to work around file systems which only permit very
short file names, such as MS-DOS.

--help
--target-help
Print text describing all the command line options instead of
preprocessing anything.

-v
Verbose mode.  Print out GNU CPP's version number at the beginning of
execution, and report the final form of the include path.

-H
Print the name of each header file used, in addition to other normal
activities.  Each name is indented to show how deep in the
‘<samp>#include</samp>’ stack it is.  Precompiled header files are also
printed, even if they are found to be invalid; an invalid precompiled
header file is printed with ‘<samp>...x</samp>’ and a valid one with ‘<samp>...!</samp>’ .

-version
--version
Print out GNU CPP's version number.  With one dash, proceed to
preprocess as normal.  With two dashes, exit immediately.


text:
import logging
import sys
import traceback
# From Logging Python Documentation :  This function should be called from the main thread before
# other threads are started. In versions of Python prior to 2.7.1 and 3.2, if this function is called from multiple threads,
# it is possible (in rare circumstances) that a handler will be added to the root logger more than once,
# leading to unexpected results such as messages being duplicated in the log.

# logging is threadsafe, concurrency is managed between threads

class LoggerHelper:

    def __init__(self, settings):
        self.logFilePath = settings.getLogFile()
        self.verbosity = settings.isVerbose()

        # this function setups stdout logger and file logger, it's needed!
        self.logger = self.setupLogger()

    def setupLogger(self):

        # get a logger
        logger = logging.getLogger()

        # level of the getter, DEBUG is (almost) the lowest, to filter messages use ERROR
        logger.setLevel(logging.DEBUG)

        # format of log lines
        formatter = logging.Formatter('%(asctime)s %(threadName)s %(processName)s %(levelname)s: %(message)s')

        # build log handler for logFile
        fl = logging.FileHandler(self.logFilePath)
        fl.setLevel(logging.DEBUG)
        fl.setFormatter(formatter)

        # install handler
        logger.addHandler(fl)

        # build stderr handler if desired
        ch = logging.StreamHandler(sys.stderr)
        ch.setLevel(logging.DEBUG)
        ch.setFormatter(formatter)
        logger.addHandler(ch)

        # Configure logger to write to an Uncaught throwable...
        def my_handler(type, value, tb):
            logger.exception("Uncaught " + str(type) + " : " +str(value)+ " @ " + str(traceback.format_tb(tb) ) )
        # Install exception handler
        sys.excepthook = my_handler

        return logger

def getAllLog(settings):
    file = open(settings.getLogFile(), "r")
    log = file.read()
    file.close()
    return log


text:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>nlp | Kevin Tan</title>
    <link>/categories/nlp/</link>
      <atom:link href="/categories/nlp/index.xml" rel="self" type="application/rss+xml" />
    <description>nlp</description>
    <generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator><language>en-us</language><lastBuildDate>Fri, 05 Apr 2019 00:00:00 +0000</lastBuildDate>
    <image>
      <url>/img/icon-192.png</url>
      <title>nlp</title>
      <link>/categories/nlp/</link>
    </image>

    <item>
      <title>Gricean Theory and the RSA model</title>
      <link>/post/grice/</link>
      <pubDate>Fri, 05 Apr 2019 00:00:00 +0000</pubDate>
      <guid>/post/grice/</guid>
      <description>
What's an implicature?

Definition: An implicature is something the speaker suggests or implies with an utterance, even though it is not literally expressed.

Example 1:

A: Are you going to Paul's party?

B: I have to work

Here, B typically means that she is not going to Paul's party. But the sentence B uttered, &quot;I have to work&quot;, does not literally mean that she is not going to Paul's party -- instead, she implied it.

Example 2:

A: (to the passer by): I am out of gas.

B: There is a gas station around the corner.

Here, B implies, but does not explicitly say, that the gas station is open, because otherwise his utterance would not be relevant in the context.

How speakers and listeners act cooperatively to communicate effectively

Gricean Theory defines an explanatory framework for predicting conversational implicatures. By the Cooperative Principle, Grice asserted that it is common knowledge that people generally follow these rules for effective and efficient communication:

Maxim of Quality: Make your contribution true; do not convey what you believe to be false.

Maxim of Quantity: Be as informative as required, and no more.

Maxim of Relation: Be relevant.

Maxim of Manner: Be perspicuous.

Rational Speech Act (RSA): a probabilistic approach

The core idea behind the RSA model [1] is that speakers are assumed to be utility-maximizing agents that produce utterances to be helpful yet parsimonious (benefit for communicating information, cost for producing language), relative to some particular goal. Listeners then understand those utterances by inferring what the speaker must have meant, given what they literally said.

The listener performs an inference on the state of the world \(w\) given the observation of the speaker's utterance \(u\):

\[P_L(w|u) \propto P_S(u|w)P(w)\]

But how does the speaker choose her utterance? She chooses \(u\) from a set of alternative utterances, with the parameter \(\alpha\) denoting the extent to which the speaker maximizes her utility. A larger \(\alpha\) represents a more rational speaker.

\[P_S(u|w) \propto exp(\alpha U(u;w))\]

Here, \(U(u;w)\) measures how certain the listener becomes about the intended world after hearing the utterance, where the listener is assumed to be a literal listener.

\[U(u;w) = log P_{Lit}(w|u)\]

The literal listener updates her beliefs via Bayesian inference, assuming that the meaning of the utterance is true.

\(P_{Lit}(w|u) \propto \delta_{[u](w)}P(w)\), where \([u]\) is a semantic denotation for each sentence. Each sentence can either be true or false given the state of affairs of the world \(w\).

Example: hats and glasses

Consider the above figure, where listener \(L\) and speaker \(S\) share a world given by three faces:

hat and glasses \(HG\)

glasses only \(G\)

neither hat nor glasses \(N\)

One of these is the &quot;friend&quot;. Only the speaker knows who the &quot;friend&quot; is.

The speaker says &quot;my friend has glasses&quot;, invoking the presupposition that there is only one friend.

Under RSA, listener \(L\) first reasons that speaker \(S\) reasons about \(Lit\) that \(P_{Lit}(w|"glasses")\) places equal probability mass on both \(G\) and \(HG\) with equal probability, and \(P_{Lit}(w|"hat")\) places all probability mass on the friend being \(HG\).

So if the speaker \(S\) wishes to convey that \(HG\) is the friend, she will choose the more informative &quot;hat&quot;, but if she wishes to convey that \(G\) is the friend, she will choose &quot;glasses&quot;, knowing that the listener knows that if the speaker meant to refer to \(HG\), she would've chosed &quot;hat&quot;.

Conclusion

In sum, the RSA model is a recursive model to capture Gricean maxims with a single utility function defined by \(U(u;w)\).

Of course, the RSA model isn't meant to capture all the complexities of social interactions in the real world, but it's a starting point for building computational models of natural language dialogue.

Implications for NLP?

Since the focus of RSA is on the key assumption that the speaker is a rational, utility-maximizing agent, an initial area of inquiry might be to explore the set of utility functions that make for good conversation, or dialogue.

Recently, controllable dialogue has been shown to be a good idea in building and training end-to-end neural sequence generation dialogue systems [2].

By controlling for particular utility functions \(U(u;w)\), is it possible to meta-learn a particular (or subset of) utility functions that allow for more efficient training with less samples?

Can searching among a space of utility functions be cast as an instance of neural architecture search (NAS)? If so, how fine-grained will they have to be in order to be compatible with NAS?

How to build an end-to-end system that allows listeners \(L\) to probe and ask questions to the speaker in an active learning manner?

References

[1] https://cocolab.stanford.edu/papers/GoodmanFrank2016-TICS.pdf

[2] http://ai.stanford.edu/blog/controllable-dialogue/

</description>
    </item>

    <item>
      <title>Radical Enhanced Seq2seq for Chinese-English Neural Machine Translation</title>
      <link>/post/radical_nmt/</link>
      <pubDate>Sat, 12 Jan 2019 00:00:00 +0000</pubDate>
      <guid>/post/radical_nmt/</guid>
      <description>
During the fall quarter of 2018 I took LIGN167: Deep Learning for Natural Language Understanding led by Leon Bergen. It was the first time the class was offered and the teaching staff did a wonderful job at putting together a course on deep learning and applications in NLP from scratch.

[ paper | code ]

Introduction

Let's tackle the problem of neural machine translation (NMT), which can be described as the task of converting a sequence of words in the source language to a sequence of words in the target language. We focus on sequence to sequence models which operate in an encoder-decoder framework. At a high level, the encoder takes the model's input sequence and encodes it into a fixed-size hidden vector, and the decoder takes that context vector and unravels it word by word to generate an output sequence.

Specifically, we improve the performance of Chinese machine translation by using Chinese radicals as the basic semantic unit for embedding. In Chinese linguistics, an individual Chinese character can be decomposed into its radical subparts, each of which is often a semantic indicator that contributes to the overall meaning of the character [1].

Here's an example:

In the above figure, the highlighted segment of each character refers to a radical which means &quot;wood&quot;, and all three characters mean &quot;forest&quot;, &quot;tree&quot;, and &quot;bridge&quot;, respectively.

The most interesting fact about Chinese radicals is their pictographic nature, which means the literal shape of a radical is indicative of its possible meanings. Thus, radicals that have similar pictographic shape are more likely to have similar meanings; in addition, they will be closer in the vector embedding space of which they are mapped into. So compared to character embeddings, radical embeddings can break down the surrounding characters and provide more meaningful semantic information.

Approach using Sequence to Sequence Model Architecture

We implemented a simple sequence-to-sequence model with global attention, which utilizes two recurrent neural networks working together to transform one sequence to another. The encoder network transforms a sequence of symbols into a list of vectors with one vector per until symbol, condenses an input sentence in Chinese into a final hidden state vector. Given this hidden vector state, the decoder network unfolds it into the corresponding translated English sentence, one symbol at a time until the end of sentence (EOS) symbol is produced. The encoder and decoder module are connected via an attention network which allows the decoder to focus on different time steps of the source sentence during the course of decoding.

Formally, let \( X \), \( Y \) be the source and target sentence pair, \( X = x_1, x_2, ...x_M \) be the sequence of \( M \) Chinese words, and \( Y = y_1 , y_2 , ...y_N \) be the sequence of \(N \) English words. The encoder repeatedly generates the hidden vectors \( h = (h_1, h_2, ...h_M) \) over the source sentence.  Each hidden state is defined as \( h_j = GRU(h_{j−1},x_j) \), where \( h_{j−1} \) is the hidden state at the previous time step and \( x_j \) is the input word to be transformed into a vector as input to the Gated Recurrent Unit (GRU) [2]. Loosely speaking, the GRU is characterized by a unique gating mechanism consisting of an update gate and reset gate that influences the output hidden state.

Attention Decoder

To implement attention mechanism [3], we take input from each time step of the encoder, but give a particular weightage to the timesteps. The basic idea behind attention is that instead of attempting to learn a single vector representation for each sentence, we instead maintain vectors for each word in the input sentence, and reference these vectors at each decoding step.

Formally, the decoder is also an RNN that predicts the next word \( y_t \) given the context vector \( c_t \), the hidden state of the decoder \( s_t \) and the previous predicted word \( y_{t−1} \), which is computed by:

\[ p(y_t \mid y_{1,...,t},x) = softmax(GRU(s_t, y_{t-1}, c_t)) \]

The attention context vectors \( c_t \) can be obtained and calculated as follows:

\[ s_t = GRU(s_{t−1},h_j) \]

\[ α_j = \frac{exp(s_t)}{\sum_{k=1}^{M}exp(s_t)} \]

\[ c_t = \sum_{j=1}^{M}α_jh_j \]

Radical-Enhanced Embedding Strategy

Given an input sentence in Chinese, we need to form the radical-enhanced vector embedding for each word. We simultaneously learn vector embeddings for word-level, character- level, and radical-level. Each word \( w_j \) can be split into characters \( c_j = (c_{j1}, c_{j2}, ...c_{jm}) \) which are obtained by tokenizing on white space. Then, each character \( c_j \) can be further split into radicals \( r_j = (r_{j1}, r_{j2}, ...r_{jn}) \) which can be obtained by a radical lookup table [4]. Then, the net character and radical representations are computed as:

\[  z_j = \sum_{k=1}^{m}z_{jk} \]

\[  r_j = \sum_{k=1}^{n}r_{jk} \]

and the final embedding vector is

\[  x_j = [w_j;z_j;r_j] \]

where ';' is the concatenate operation.

See the full paper for details on experiments and results.

Acknowledgements

Thanks to Xinwen Wang for working together on this project. Also, many thanks to Leon Bergen and the rest of the teaching staff for an amazing quarter. If you're a UCSD undergraduate reading this, I highly recommend taking LIGN167.

References

[1] Zhang, J., Matsumoto, T.: Improving character-level japanese-chinese neural machine translation with radicals as an additional input feature. In: 2017 International Conference on Asian Language Processing (IALP). pp. 172–175 (Dec 2017). https://doi.org/10.1109/IALP.2017.8300572

[2] Chung, J., Gulcehre, C., Cho, K., Bengio, Y.: Empirical evaluation of gated recurrent neural networks on sequence modeling. Presented in NIPS 2014 Deep Learning and Representation Learning Workshop (2014)

[3] Luong, M., Pham, H., Manning, C.D.: Effective approaches to attention-based neural machine translation. CoRR abs/1508.04025 (2015), http://arxiv.org/abs/1508. 04025

[4] https://en.wikipedia.org/wiki/Xinhua_Zidian

[5] Cho, K., van Merrienboer, B., Bahdanau, D., Bengio, Y.: On the properties of neural machine translation: Encoder-decoder approaches. CoRR abs/1409.1259 (2014), http://arxiv. org/abs/1409.1259

[6] Shi, X., Zhai, J., Yang, X., Xie, Z., Liu, C.: Radical embedding: Delving deeper to chinese radicals. In: Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 2: Short Papers). pp. 594–598. Association for Computational Linguistics (2015). https://doi.org/10.3115/v1/P15-2098, http://aclanthology.coli. uni-saarland.de/pdf/P/P15/P15-2098.pdf

</description>
    </item>

  </channel>
</rss>


text:
import testMatrix from './_matrix'
// @ts-ignore
import type { Prisma as PrismaNamespace, PrismaClient } from './node_modules/@prisma/client'

declare let prisma: PrismaClient
declare let Prisma: typeof PrismaNamespace

testMatrix.setupTestSuite(
  (_suiteConfig, _suiteMeta, clientMeta) => {
    describe('nullableJsonField', () => {
      test('JsonNull', async () => {
        const data = await prisma.nullableJsonField.create({
          data: {
            json: Prisma.JsonNull,
          },
        })
        expect(data.json).toBe(null)
      })

      test('DbNull', async () => {
        const data = await prisma.nullableJsonField.create({
          data: {
            json: Prisma.DbNull,
          },
        })
        expect(data.json).toBe(null)
      })
    })

    describe('requiredJsonField', () => {
      test('JsonNull', async () => {
        const data = await prisma.requiredJsonField.create({
          data: {
            json: Prisma.JsonNull,
          },
        })
        expect(data.json).toBe(null)
      })

      // TODO: Edge: skipped because of the error snapshot
      testIf(clientMeta.runtime !== 'edge')('DbNull', async () => {
        await expect(
          prisma.requiredJsonField.create({
            data: {
              // @ts-expect-error
              json: Prisma.DbNull,
            },
          }),
        ).rejects.toMatchPrismaErrorInlineSnapshot(`

          Invalid \`prisma.requiredJsonField.create()\` invocation in
          /client/tests/functional/json-null-types/tests.ts:0:0

            XX // TODO: Edge: skipped because of the error snapshot
            XX testIf(clientMeta.runtime !== 'edge')('DbNull', async () => {
            XX   await expect(
          → XX     prisma.requiredJsonField.create({
                     data: {
                       json: Prisma.DbNull
                             ~~~~~~~~~~~~~
                     }
                   })

          Argument json: Provided value Prisma.DbNull of type DbNull on prisma.createOneRequiredJsonField is not a JsonNullValueInput.
          → Possible values: JsonNullValueInput.JsonNull

        `)
      })
    })

    describe('properties of DbNull/JsonNull/AnyNull', () => {
      test('instanceof checks pass', () => {
        expect(Prisma.DbNull).toBeInstanceOf(Prisma.NullTypes.DbNull)
        expect(Prisma.JsonNull).toBeInstanceOf(Prisma.NullTypes.JsonNull)
        expect(Prisma.AnyNull).toBeInstanceOf(Prisma.NullTypes.AnyNull)
      })

      // TODO: Edge: skipped because of the error snapshot
      testIf(clientMeta.runtime !== 'edge')('custom instances are not allowed', async () => {
        await expect(
          prisma.requiredJsonField.create({
            data: {
              // @ts-expect-error
              json: new Prisma.NullTypes.JsonNull(),
            },
          }),
        ).rejects.toMatchPrismaErrorInlineSnapshot(`

          Invalid \`prisma.requiredJsonField.create()\` invocation in
          /client/tests/functional/json-null-types/tests.ts:0:0

            XX // TODO: Edge: skipped because of the error snapshot
            XX testIf(clientMeta.runtime !== 'edge')('custom instances are not allowed', async () => {
            XX   await expect(
          → XX     prisma.requiredJsonField.create({
                     data: {
                       json: new Prisma.NullTypes.JsonNull()
                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                     }
                   })

          Argument json: Provided value new Prisma.NullTypes.JsonNull() of type JsonNull on prisma.createOneRequiredJsonField is not a JsonNullValueInput.
          → Possible values: JsonNullValueInput.JsonNull

        `)
      })
    })
  },
  {
    optOut: {
      from: ['sqlite', 'sqlserver', 'mongodb'],
      reason: `
        sqlite - connector does not support Json type
        sqlserver - connector does not support Json type
        mongodb - doesn't use DbNull/JsonNull
      `,
    },
  },
)


text:
module Blog::Filters
  # A modular text filter that is applied to blog text before markdown
  # processing.
  class Base
    # Override this method to transform +text+, using any supplied
    # +arguments+.
    def process(text, arguments)
      raise "Please override #{self.class.name}#process"
    end

    class << self
      def register_filter(name)
        Blog::Filters.register_filter(name, self)
      end
    end
  end
end