text:
setfenv(1, pfUI:GetEnvironment())

--[[ libtipscan ]]--
-- A pfUI library that provides tooltip scanner.
--
--  libtipscan:GetScanner(name)
--    returns or resets a scanner for use with tooltip methods
--
--  libtipscan:List()
--    prints a list of all active scanners
--
--  The scanner tooltip returned by :GetScanner has all the Set____ GameTooltip methods with a built-in full clear
--  In addition the scanner has the following custom methods
--  <scanner>:Text()
--    return a table with all the left, right texts in {[line] = {left, right}} format
--  <scanner>:Find(text, [exact])
--    returns true (linenumber) and [the text found or the captures made if text is a pattern]
--    exact is optional flag making it look only for exact matches
--  <scanner>:Color(r,g,b)
--    returns true (linenumber) if the r,g,b color tuple is found as text color on the scanner
--    accepts color table as argument as well (eg. <scanner>:Color(RED_FONT_COLOR) )
--  <scanner>:Line(line_number)
--    returns left, right text from that tooltip line
--  <scanner>:List()
--    prints a list of all available scanner methods

-- return instantly when another libtipscan is already active
if pfUI.api.libtipscan then return end

local libtipscan = {}
local baseName = "pfUIScan"
local methods = {
  "SetBagItem", "SetAction", "SetAuctionItem", "SetAuctionSellItem", "SetBuybackItem",
  "SetCraftItem", "SetCraftSpell", "SetHyperlink", "SetInboxItem", "SetInventoryItem",
  "SetLootItem", "SetLootRollItem", "SetMerchantItem", "SetPetAction", "SetPlayerBuff",
  "SetQuestItem", "SetQuestLogItem", "SetQuestRewardSpell", "SetSendMailItem", "SetShapeshift",
  "SetSpell", "SetTalent", "SetTrackingSpell", "SetTradePlayerItem", "SetTradeSkillItem", "SetTradeTargetItem",
  "SetTrainerService", "SetUnit", "SetUnitBuff", "SetUnitDebuff",
}
local extra_methods = {
  "Find", "Line", "Text", "List",
}

local getFontString = function(obj)
  local name = obj:GetName()
  local r, g, b, color, a
  local text, segment

  for i=1, obj:NumLines() do
    local left = _G[string.format("%sTextLeft%d",name,i)]
    segment = left and left:IsVisible() and left:GetText()
    segment = segment and segment ~= "" and segment or nil
    if segment then
      r, g, b, a = left:GetTextColor()
      segment = rgbhex(r,g,b) .. segment .. "|r"
      text = text and text .. "\n" .. segment or segment
    end
  end
  return text
end

local getText = function(obj)
  local name = obj:GetName()
  local text = {}
  for i=1, obj:NumLines() do
    local left, right = _G[string.format("%sTextLeft%d",name,i)], _G[string.format("%sTextRight%d",name,i)]
    left = left and left:IsVisible() and left:GetText()
    right = right and right:IsVisible() and right:GetText()
    left = left and left ~= "" and left or nil
    right = right and right ~= "" and right or nil
    if left or right then
      text[i] = {left, right}
    end
  end
  return text
end

local findText = function(obj, text, exact)
  local name = obj:GetName()
  for i=1, obj:NumLines() do
    local left, right = _G[string.format("%sTextLeft%d",name,i)], _G[string.format("%sTextRight%d",name,i)]
    left = left and left:IsVisible() and left:GetText()
    right = right and right:IsVisible() and right:GetText()
    if exact then
      if (left and left == text) or (right and right == text) then
        return i, text
      end
    else
      if left then
        local found,_,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10 = string.find(left, text)
        if found then
          return i, a1,a2,a3,a4,a5,a6,a7,a8,a9,a10
        end
      end
      if right then
        local found,_,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10 = string.find(right, text)
        if found then
          return i, a1,a2,a3,a4,a5,a6,a7,a8,a9,a10
        end
      end
    end
  end
end

local lineText = function(obj, line)
  local name = obj:GetName()
  if line <= obj:NumLines() then
    local left, right = _G[string.format("%sTextLeft%d",name,line)], _G[string.format("%sTextRight%d",name,line)]
    left = left and left:IsVisible() and left:GetText()
    right = right and right:IsVisible() and right:GetText()

    if left or right then
      return left, right
    end
  end
end

local findColor = function(obj, r,g,b)
  local name = obj:GetName()
  if type(r) == "table" then
    r,g,b = r.r or r[1], r.g or r[2], r.b or r[3]
  end
  for i=1, obj:NumLines() do
    local tr, tg, tb
    local left, right = _G[string.format("%sTextLeft%d",name,i)], _G[string.format("%sTextRight%d",name,i)]
    if left and left:IsVisible() then
      tr, tg, tb = left:GetTextColor()
      tr, tg, tb = round(tr,1), round(tg,1), round(tb,1)
    end
    if tr and (tr == r and tg == g and tb == b) then
      return i
    end
    if right and right:IsVisible() then
      tr, tg, tb = right:GetTextColor()
      tr, tg, tb = round(tr,1), round(tg,1), round(tb,1)
    end
    if tr and (tr == r and tg == g and tb == b) then
      return i
    end
  end
end

libtipscan._registry = setmetatable({},{__index = function(t,k)
  local v = CreateFrame("GameTooltip", string.format("%s%s",baseName,k), nil, "GameTooltipTemplate")
  v:SetOwner(WorldFrame,"ANCHOR_NONE")
  v:SetScript("OnHide", function ()
    this:SetOwner(WorldFrame,"ANCHOR_NONE")
  end)
  function v:Text()
    return getText(self)
  end
  function v:FontString()
    return getFontString(self)
  end
  function v:Find(text, exact)
    return findText(self, text, exact)
  end
  function v:Color(r,g,b)
    return findColor(self,r,g,b)
  end
  function v:Line(line)
    return lineText(self, line)
  end
  for _,method in ipairs(methods) do
    local method = method
    local old = v[method]
    v[method] = function(v, a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
      v:ClearLines()
      return old(v, a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
    end
  end
  function v:List()
    table.sort(methods)
    for _,method in ipairs(methods) do
      print(method)
    end
    for _,method in ipairs(extra_methods) do
      print(method)
    end
  end
  rawset(t,k,v)
  return v
end})

function libtipscan:GetScanner(type)
  local scanner = self._registry[type]
  scanner:ClearLines()
  return scanner
end

function libtipscan:List()
  for name, scanner in pairs(self._registry) do
    print(name)
  end
end

-- add libtipscan to pfUI API
pfUI.api.libtipscan = libtipscan


text:
This is a small library of python scripts and modules that I use to start [Folding@home](http://folding.stanford.edu) simulations. All modeling is done with [PyRosetta](http://www.pyrosetta.org/) and [ParmEd](http://parmed.github.io/ParmEd/html/index.html), and all simulations are done with [OpenMM](http://openmm.org/).

Enjoy!

---

###recipes:

  + **seed_from_pdb**:

  Use a PDB file to solvate, minimize, and equilibrate a simulation.

  + **seed_mutant_from_wt**:

  Mutate a single amino acid in an existing PDB and start a round of
  equilibration.*

  + **seed_from_seq**:

  Solvate and equilibrate a protein simulation from a primary sequence.*

  + **seed_with_ligand**:

  Solvate and equilibrate a ligand binding simulation from separate protein and
  ligand structures.**

*requires PyRosetta and ParmEd

**requires MDTraj and NumPy

---

###dependecies:

  + OpenMM
  + ParmEd (optional)
  + PyRosetta (optional)
  + MDTraj (optional)
  + NumPy (optional)

redpajama_set_name: RedPajamaGithub


text:
require 'spec_helper'

describe AgentsController do
  def valid_attributes(options = {})
    {
        :type => "Agents::WebsiteAgent",
        :name => "Something",
        :options => agents(:bob_website_agent).options,
        :source_ids => [agents(:bob_weather_agent).id, ""]
    }.merge(options)
  end

  describe "GET index" do
    it "only returns Agents for the current user" do
      sign_in users(:bob)
      get :index
      expect(assigns(:agents).all? {|i| expect(i.user).to eq(users(:bob)) }).to be_truthy
    end
  end

  describe "POST handle_details_post" do
    it "passes control to handle_details_post on the agent" do
      sign_in users(:bob)
      post :handle_details_post, :id => agents(:bob_manual_event_agent).to_param, :payload => { :foo => "bar" }
      expect(JSON.parse(response.body)).to eq({ "success" => true })
      expect(agents(:bob_manual_event_agent).events.last.payload).to eq({ 'foo' => "bar" })
    end

    it "can only be accessed by the Agent's owner" do
      sign_in users(:jane)
      expect {
        post :handle_details_post, :id => agents(:bob_manual_event_agent).to_param, :payload => { :foo => :bar }
      }.to raise_error(ActiveRecord::RecordNotFound)
    end
  end

  describe "POST run" do
    it "triggers Agent.async_check with the Agent's ID" do
      sign_in users(:bob)
      mock(Agent).async_check(agents(:bob_manual_event_agent).id)
      post :run, :id => agents(:bob_manual_event_agent).to_param
    end

    it "can only be accessed by the Agent's owner" do
      sign_in users(:jane)
      expect {
        post :run, :id => agents(:bob_manual_event_agent).to_param
      }.to raise_error(ActiveRecord::RecordNotFound)
    end
  end

  describe "POST remove_events" do
    it "deletes all events created by the given Agent" do
      sign_in users(:bob)
      agent_event = events(:bob_website_agent_event).id
      other_event = events(:jane_website_agent_event).id
      post :remove_events, :id => agents(:bob_website_agent).to_param
      expect(Event.where(:id => agent_event).count).to eq(0)
      expect(Event.where(:id => other_event).count).to eq(1)
    end

    it "can only be accessed by the Agent's owner" do
      sign_in users(:jane)
      expect {
        post :remove_events, :id => agents(:bob_website_agent).to_param
      }.to raise_error(ActiveRecord::RecordNotFound)
    end
  end

  describe "POST propagate" do
    it "runs event propagation for all Agents" do
      sign_in users(:bob)
      mock.proxy(Agent).receive!
      post :propagate
    end
  end

  describe "GET show" do
    it "only shows Agents for the current user" do
      sign_in users(:bob)
      get :show, :id => agents(:bob_website_agent).to_param
      expect(assigns(:agent)).to eq(agents(:bob_website_agent))

      expect {
        get :show, :id => agents(:jane_website_agent).to_param
      }.to raise_error(ActiveRecord::RecordNotFound)
    end
  end

  describe "GET new with :id" do
    it "opens a clone of a given Agent" do
      sign_in users(:bob)
      get :new, :id => agents(:bob_website_agent).to_param
      expect(assigns(:agent).attributes).to eq(users(:bob).agents.build_clone(agents(:bob_website_agent)).attributes)
    end

    it "only allows the current user to clone his own Agent" do
      sign_in users(:bob)

      expect {
        get :new, :id => agents(:jane_website_agent).to_param
      }.to raise_error(ActiveRecord::RecordNotFound)
    end
  end

  describe "GET edit" do
    it "only shows Agents for the current user" do
      sign_in users(:bob)
      get :edit, :id => agents(:bob_website_agent).to_param
      expect(assigns(:agent)).to eq(agents(:bob_website_agent))

      expect {
        get :edit, :id => agents(:jane_website_agent).to_param
      }.to raise_error(ActiveRecord::RecordNotFound)
    end
  end

  describe "POST create" do
    it "errors on bad types" do
      sign_in users(:bob)
      expect {
        post :create, :agent => valid_attributes(:type => "Agents::ThisIsFake")
      }.not_to change { users(:bob).agents.count }
      expect(assigns(:agent)).to be_a(Agent)
      expect(assigns(:agent)).to have(1).error_on(:type)

      sign_in users(:bob)
      expect {
        post :create, :agent => valid_attributes(:type => "Object")
      }.not_to change { users(:bob).agents.count }
      expect(assigns(:agent)).to be_a(Agent)
      expect(assigns(:agent)).to have(1).error_on(:type)
      sign_in users(:bob)

      expect {
        post :create, :agent => valid_attributes(:type => "Agent")
      }.not_to change { users(:bob).agents.count }
      expect(assigns(:agent)).to be_a(Agent)
      expect(assigns(:agent)).to have(1).error_on(:type)

      expect {
        post :create, :agent => valid_attributes(:type => "User")
      }.not_to change { users(:bob).agents.count }
      expect(assigns(:agent)).to be_a(Agent)
      expect(assigns(:agent)).to have(1).error_on(:type)
    end

    it "creates Agents for the current user" do
      sign_in users(:bob)
      expect {
        expect {
          post :create, :agent => valid_attributes
        }.to change { users(:bob).agents.count }.by(1)
      }.to change { Link.count }.by(1)
      expect(assigns(:agent)).to be_a(Agents::WebsiteAgent)
    end

    it "shows errors" do
      sign_in users(:bob)
      expect {
        post :create, :agent => valid_attributes(:name => "")
      }.not_to change { users(:bob).agents.count }
      expect(assigns(:agent)).to have(1).errors_on(:name)
      expect(response).to render_template("new")
    end

    it "will not accept Agent sources owned by other users" do
      sign_in users(:bob)
      expect {
        expect {
          post :create, :agent => valid_attributes(:source_ids => [agents(:jane_weather_agent).id])
        }.not_to change { users(:bob).agents.count }
      }.not_to change { Link.count }
    end
  end

  describe "PUT update" do
    it "does not allow changing types" do
      sign_in users(:bob)
      post :update, :id => agents(:bob_website_agent).to_param, :agent => valid_attributes(:type => "Agents::WeatherAgent")
      expect(assigns(:agent)).to have(1).errors_on(:type)
      expect(response).to render_template("edit")
    end

    it "updates attributes on Agents for the current user" do
      sign_in users(:bob)
      post :update, :id => agents(:bob_website_agent).to_param, :agent => valid_attributes(:name => "New name")
      expect(response).to redirect_to(agents_path)
      expect(agents(:bob_website_agent).reload.name).to eq("New name")

      expect {
        post :update, :id => agents(:jane_website_agent).to_param, :agent => valid_attributes(:name => "New name")
      }.to raise_error(ActiveRecord::RecordNotFound)
    end

    it "accepts JSON requests" do
      sign_in users(:bob)
      post :update, :id => agents(:bob_website_agent).to_param, :agent => valid_attributes(:name => "New name"), :format => :json
      expect(agents(:bob_website_agent).reload.name).to eq("New name")
      expect(JSON.parse(response.body)['name']).to eq("New name")
      expect(response).to be_success
    end

    it "will not accept Agent sources owned by other users" do
      sign_in users(:bob)
      post :update, :id => agents(:bob_website_agent).to_param, :agent => valid_attributes(:source_ids => [agents(:jane_weather_agent).id])
      expect(assigns(:agent)).to have(1).errors_on(:sources)
    end

    it "will not accept Scenarios owned by other users" do
      sign_in users(:bob)
      post :update, :id => agents(:bob_website_agent).to_param, :agent => valid_attributes(:scenario_ids => [scenarios(:jane_weather).id])
      expect(assigns(:agent)).to have(1).errors_on(:scenarios)
    end

    it "shows errors" do
      sign_in users(:bob)
      post :update, :id => agents(:bob_website_agent).to_param, :agent => valid_attributes(:name => "")
      expect(assigns(:agent)).to have(1).errors_on(:name)
      expect(response).to render_template("edit")
    end

    describe "redirecting back" do
      before do
        sign_in users(:bob)
      end

      it "can redirect back to the show path" do
        post :update, :id => agents(:bob_website_agent).to_param, :agent => valid_attributes(:name => "New name"), :return => "show"
        expect(response).to redirect_to(agent_path(agents(:bob_website_agent)))
      end

      it "redirect back to the index path by default" do
        post :update, :id => agents(:bob_website_agent).to_param, :agent => valid_attributes(:name => "New name")
        expect(response).to redirect_to(agents_path)
      end

      it "accepts return paths to scenarios" do
        post :update, :id => agents(:bob_website_agent).to_param, :agent => valid_attributes(:name => "New name"), :return => "/scenarios/2"
        expect(response).to redirect_to("/scenarios/2")
      end

      it "sanitizes return paths" do
        post :update, :id => agents(:bob_website_agent).to_param, :agent => valid_attributes(:name => "New name"), :return => "/scenar"
        expect(response).to redirect_to(agents_path)

        post :update, :id => agents(:bob_website_agent).to_param, :agent => valid_attributes(:name => "New name"), :return => "http://google.com"
        expect(response).to redirect_to(agents_path)

        post :update, :id => agents(:bob_website_agent).to_param, :agent => valid_attributes(:name => "New name"), :return => "javascript:alert(1)"
        expect(response).to redirect_to(agents_path)
      end
    end

    it "updates last_checked_event_id when drop_pending_events is given" do
      sign_in users(:bob)
      agent = agents(:bob_website_agent)
      agent.disabled = true
      agent.last_checked_event_id = nil
      agent.save!
      post :update, id: agents(:bob_website_agent).to_param, agent: { disabled: 'false', drop_pending_events: 'true' }
      agent.reload
      expect(agent.disabled).to eq(false)
      expect(agent.last_checked_event_id).to eq(Event.maximum(:id))
    end
  end

  describe "PUT leave_scenario" do
    it "removes an Agent from the given Scenario for the current user" do
      sign_in users(:bob)

      expect(agents(:bob_weather_agent).scenarios).to include(scenarios(:bob_weather))
      put :leave_scenario, :id => agents(:bob_weather_agent).to_param, :scenario_id => scenarios(:bob_weather).to_param
      expect(agents(:bob_weather_agent).scenarios).not_to include(scenarios(:bob_weather))

      expect(Scenario.where(:id => scenarios(:bob_weather).id)).to exist

      expect {
        put :leave_scenario, :id => agents(:jane_weather_agent).to_param, :scenario_id => scenarios(:jane_weather).to_param
      }.to raise_error(ActiveRecord::RecordNotFound)
    end
  end

  describe "DELETE destroy" do
    it "destroys only Agents owned by the current user" do
      sign_in users(:bob)
      expect {
        delete :destroy, :id => agents(:bob_website_agent).to_param
      }.to change(Agent, :count).by(-1)

      expect {
        delete :destroy, :id => agents(:jane_website_agent).to_param
      }.to raise_error(ActiveRecord::RecordNotFound)
    end

    it "redirects correctly when the Agent is deleted from the Agent itself" do
      sign_in users(:bob)

      delete :destroy, :id => agents(:bob_website_agent).to_param
      expect(response).to redirect_to agents_path
    end

    it "redirects correctly when the Agent is deleted from a Scenario" do
      sign_in users(:bob)

      delete :destroy, :id => agents(:bob_weather_agent).to_param, :return => scenario_path(scenarios(:bob_weather)).to_param
      expect(response).to redirect_to scenario_path(scenarios(:bob_weather))
    end
  end

  describe "#form_configurable actions" do
    before(:each) do
      @params = {attribute: 'auth_token', agent: valid_attributes(:type => "Agents::HipchatAgent", options: {auth_token: '12345'})}
      sign_in users(:bob)
    end
    describe "POST validate" do

      it "returns with status 200 when called with a valid option" do
        any_instance_of(Agents::HipchatAgent) do |klass|
          stub(klass).validate_option { true }
        end

        post :validate, @params
        expect(response.status).to eq 200
      end

      it "returns with status 403 when called with an invalid option" do
        any_instance_of(Agents::HipchatAgent) do |klass|
          stub(klass).validate_option { false }
        end

        post :validate, @params
        expect(response.status).to eq 403
      end
    end

    describe "POST complete" do
      it "callsAgent#complete_option and renders json" do
        any_instance_of(Agents::HipchatAgent) do |klass|
          stub(klass).complete_option { [{name: 'test', value: 1}] }
        end

        post :complete, @params
        expect(response.status).to eq 200
        expect(response.header['Content-Type']).to include('application/json')

      end
    end
  end

  describe "POST dry_run" do
    before do
      stub_request(:any, /xkcd/).to_return(body: File.read(Rails.root.join("spec/data_fixtures/xkcd.html")), status: 200)
    end

    it "does not actually create any agent, event or log" do
      sign_in users(:bob)
      expect {
        post :dry_run, agent: valid_attributes()
      }.not_to change {
        [users(:bob).agents.count, users(:bob).events.count, users(:bob).logs.count]
      }
      json = JSON.parse(response.body)
      expect(json['log']).to be_a(String)
      expect(json['events']).to be_a(String)
      expect(JSON.parse(json['events']).map(&:class)).to eq([Hash])
      expect(json['memory']).to be_a(String)
      expect(JSON.parse(json['memory'])).to be_a(Hash)
    end

    it "does not actually update an agent" do
      sign_in users(:bob)
      agent = agents(:bob_weather_agent)
      expect {
        post :dry_run, id: agents(:bob_website_agent), agent: valid_attributes(name: 'New Name')
      }.not_to change {
        [users(:bob).agents.count, users(:bob).events.count, users(:bob).logs.count, agent.name, agent.updated_at]
      }
    end
  end

  describe "DELETE memory" do
    it "clears memory of the agent" do
      agent = agents(:bob_website_agent)
      agent.update!(memory: { "test" => 42 })
      sign_in users(:bob)
      delete :destroy_memory, id: agent.to_param
      expect(agent.reload.memory).to eq({})
    end

    it "does not clear memory of an agent not owned by the current user" do
      agent = agents(:jane_website_agent)
      agent.update!(memory: { "test" => 42 })
      sign_in users(:bob)
      expect {
        delete :destroy_memory, id: agent.to_param
      }.to raise_error(ActiveRecord::RecordNotFound)
      expect(agent.reload.memory).to eq({ "test" => 42})
    end
  end
end


text:
import filter from 'array-filter'

const Manager = class {
  constructor (data, count, fixedColumns) {
    if (process.env.NODE_ENV === 'development') {
      const notStringList = data.filter(item => {
        return (item.parent && item.parent !== 0 && item.parent !== '0') && (typeof item.parent === 'number' || typeof item.value === 'number')
      })
      if (notStringList.length) {
        console.warn(`[VUX] picker data's value and parent should be string:\n${JSON.stringify(notStringList, null, 2)}`)
      }
    }
    this.data = data
    this.count = count
    if (fixedColumns) {
      this.fixedColumns = fixedColumns
    }
  }

  getChildren (value) {
    return filter(this.data, one => {
      return one.parent === value
    })
  }

  getFirstColumn () {
    return filter(this.data, one => {
      return !one.parent || one.parent === 0 || one.parent === '0'
    })
  }

  getPure (obj) {
    return JSON.parse(JSON.stringify(obj))
  }

  getColumns (value) {
    // check is data contains the values
    if (value.length > 0) {
      const matchCount = this.getPure(this.data).filter((item) => {
        return this.getPure(value).indexOf(item.value) > -1
      }).length
      if (matchCount < this.getPure(value).length) {
        value = []
      }
    }
    var datas = []
    const max = this.fixedColumns || 8
    for (var i = 0; i < max; i++) {
      if (i === 0) {
        datas.push(this.getFirstColumn())
      } else {
        // 没有数据时,取得上一级的第一个
        if (!value[i]) {
          if (typeof datas[i - 1][0] === 'undefined') {
            break
          } else {
            const topValue = datas[i - 1][0].value
            datas.push(this.getChildren(topValue))
          }
        } else {
          datas.push(this.getChildren(value[i - 1]))
        }
      }
    }
    const list = datas.filter((item) => {
      return item.length > 0
    })
    // correct the column
    this.count = list.length
    return list
  }
}

export default Manager


text:
expr_name='expr_topo_uniform_'
for i in `seq 2 9 `;
do
    name=$expr_name$i
    numNodes=$(($i*$i))
    python test.py $numNodes uniform $name
done


text:
//----------------------------------------------------------------------------
//
// License:  LGPL
//
// See LICENSE.txt file in the top level directory for more details.
//
// Author:  David Burken
//
// Description: HDF5 Info class.
//
//----------------------------------------------------------------------------
// $Id$

#ifndef ossimH5Info_HEADER
#define ossimH5Info_HEADER 1

#include <ossim/base/ossimConstants.h>
#include <ossim/support_data/ossimInfoBase.h>
#include <ossim/base/ossimFilename.h>
#include <ossim/plugin/ossimPluginConstants.h>

class ossimEndian;

/**
 * @brief TIFF info class.
 *
 * Encapsulates the listgeo functionality.
 */
class OSSIM_PLUGINS_DLL ossimH5Info : public ossimInfoBase
{
public:

   /** default constructor */
   ossimH5Info();

   /** virtual destructor */
   virtual ~ossimH5Info();

   /**
    * @brief open method.
    *
    * @param file File name to open.
    *
    * @return true on success false on error.
    */
   virtual bool open(const ossimFilename& file);

   /**
    * Print method.
    *
    * @param out Stream to print to.
    *
    * @return std::ostream&
    */
   virtual std::ostream& print(std::ostream& out) const;

private:

   ossimFilename  m_file;
};

#endif /* End of "#ifndef ossimH5Info_HEADER" */


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) 2014 Thiago Moreira (tmoreira2020@gmail.com)

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>br.com.thiagomoreira.liferay.plugins.setup-brazilian-regions-app</groupId>
		<artifactId>setup-brazilian-regions-app-parent</artifactId>
		<version>1.0.1-SNAPSHOT</version>
	</parent>

	<artifactId>setup-brazilian-regions-app</artifactId>
	<packaging>pom</packaging>

	<name>Setup Brazilian Regions App</name>

	<build>
		<finalName>setup-brazilian-regions-app-${project.version}</finalName>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<executions>
					<execution>
						<id>distro-assembly</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<appendAssemblyId>false</appendAssemblyId>
							<tarLongFileMode>gnu</tarLongFileMode>
							<descriptors>
								<descriptor>src/main/assembly/bundle.xml</descriptor>
							</descriptors>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-instrumented-jar</id>
						<phase>package</phase>
						<goals>
							<goal>attach-artifact</goal>
						</goals>
						<configuration>
							<artifacts>
								<artifact>
									<file>${project.build.directory}/${project.build.finalName}.zip</file>
									<type>lpkg</type>
								</artifact>
							</artifacts>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>


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

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>kernel.core.message_cache — IPython v0.10.1 documentation</title>
    <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />

    <link rel="top" title="IPython v0.10.1 documentation" href="../../index.html" />
    <link rel="up" title="The IPython API" href="../index.html" />
    <link rel="next" title="kernel.core.notification" href="IPython.kernel.core.notification.html" />
    <link rel="prev" title="kernel.core.magic" href="IPython.kernel.core.magic.html" />

Navigation

          index

          modules |

          next |

          previous |

IPython v0.10.1 documentation »

The IPython API »

kernel.core.message_cache¶

Module: <tt class="xref py py-mod docutils literal">kernel.core.message_cache</tt>¶

Inheritance diagram for <tt class="docutils literal">IPython.kernel.core.message_cache</tt>:

<map id="inheritancefd542f036c" name="inheritancefd542f036c">
</map>

Storage for the responses from the interpreter.

Classes¶

<tt class="xref py py-class docutils literal">IMessageCache</tt>¶

class <tt class="descclassname">IPython.kernel.core.message_cache.</tt><tt class="descname">IMessageCache</tt>¶

Bases: <tt class="xref py py-class docutils literal">object</tt>

Storage for the response from the interpreter.

<tt class="descname">__init__</tt><big>(</big><big>)</big>¶

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

<tt class="descname">add_message</tt><big>(</big><big>)</big>¶

Add a message dictionary to the cache.

<col class="field-name" />
<col class="field-body" />

Parameters :
i : int

message : dict

<tt class="descname">get_message</tt><big>(</big><big>)</big>¶

Get the message from the cache.

<col class="field-name" />
<col class="field-body" />

Parameters :
i : int, optional

The number of the message. If not provided, return the
highest-numbered message.

Returns :
message : dict

Raises :
IndexError if the message does not exist in the cache. :

<tt class="xref py py-class docutils literal">SimpleMessageCache</tt>¶

class <tt class="descclassname">IPython.kernel.core.message_cache.</tt><tt class="descname">SimpleMessageCache</tt>¶

Bases: <tt class="xref py py-class docutils literal">object</tt>

Simple dictionary-based, in-memory storage of the responses from the
interpreter.

<tt class="descname">__init__</tt><big>(</big><big>)</big>¶

<tt class="descname">add_message</tt><big>(</big><big>)</big>¶

Add a message dictionary to the cache.

<col class="field-name" />
<col class="field-body" />

Parameters :
i : int

message : dict

<tt class="descname">get_message</tt><big>(</big><big>)</big>¶

Get the message from the cache.

<col class="field-name" />
<col class="field-body" />

Parameters :
i : int, optional

The number of the message. If not provided, return the
highest-numbered message.

Returns :
message : dict

Raises :
IndexError if the message does not exist in the cache. :

Table Of Contents

kernel.core.message_cache

Module: <tt class="docutils literal">kernel.core.message_cache</tt>

Classes

<tt class="docutils literal">IMessageCache</tt>

<tt class="docutils literal">SimpleMessageCache</tt>

Previous topic

kernel.core.magic

Next topic

kernel.core.notification

This Page

Show Source

Quick search

    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

    Enter search terms or a module, class or function name.

Navigation

          index

          modules |

          next |

          previous |

IPython v0.10.1 documentation »

The IPython API »

        © Copyright 2008, The IPython Development Team.
      Last updated on Oct 11, 2010.
      Created using Sphinx 1.0.1.


text:
/*-
 * This file is part of CXX Experiments.
 *
 * CXX Experiments is free software. See AUTHORS and LICENSE for more
 * information on the copying conditions.
 */

///
/// \file src/closure_slots.cpp
/// \brief Demonstrates manual correct way of doing closure.
///

#include "transport.hpp"

using namespace cxx_experiments;

int main() { closure_example<TransportManual>(); }


text:
layout: post
date: 2018-03-31
title: "Enzoani floro-D Sleeveless Sweep/Brush Train Aline/Princess"
category: Enzoani
tags: [Enzoani,Aline/Princess ,One shoulder,Sweep/Brush Train,Sleeveless]
---
### Enzoani floro-D
Just **$359.99**
###   Sleeveless Sweep/Brush Train Aline/Princess

BRANDS	Enzoani

Silhouette	Aline/Princess

Neckline	One shoulder

Hemline/Train	Sweep/Brush Train

Sleeve	Sleeveless

Buy it: [https://www.readybrides.com/en/enzoani/5370-enzoani-floro-d.html](https://www.readybrides.com/en/enzoani/5370-enzoani-floro-d.html)


text:
package gov.va.legoEdit.gui.legoListProperties;

import gov.va.isaac.AppContext;
import gov.va.isaac.gui.util.FxUtils;
import gov.va.legoEdit.gui.LegoGUIMasterModel;
import gov.va.legoEdit.model.LegoListByReference;
import gov.va.legoEdit.model.schemaModel.LegoList;
import gov.va.legoEdit.storage.BDBDataStoreImpl;
import gov.va.legoEdit.storage.WriteException;
import java.net.URL;
import java.util.ResourceBundle;
import java.util.UUID;
import javafx.beans.binding.BooleanBinding;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.control.TreeItem;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;

/**
 *
 * {@link LegoListPropertiesController}
 *
 * @author Dan Armbrust
 */
public class LegoListPropertiesController implements Initializable
{
	@FXML// fx:id="rootPane"
	private AnchorPane rootPane; // Value injected by FXMLLoader
	@FXML//  fx:id="cancelButton"
	private Button cancelButton; // Value injected by FXMLLoader
	@FXML//  fx:id="legoListDescription"
	private TextField legoListDescription; // Value injected by FXMLLoader
	@FXML//  fx:id="legoListName"
	private TextField legoListName; // Value injected by FXMLLoader
	@FXML//  fx:id="legoListUUID"
	private TextField legoListUUID; // Value injected by FXMLLoader
	@FXML//  fx:id="okButton"
	private Button okButton; // Value injected by FXMLLoader
	@FXML//  fx:id="legoListComments"
	private TextArea legoListComments; // Value injected by FXMLLoader

	private TreeItem<String> ti_;
	LegoListByReference llbr_ = null;

	BooleanProperty nameValid = new SimpleBooleanProperty(false);
	BooleanProperty descValid = new SimpleBooleanProperty(false);
	BooleanBinding formValid;

	@Override
	// This method is called by the FXMLLoader when initialization is complete
	public void initialize(URL fxmlFileLocation, ResourceBundle resources)
	{
		assert cancelButton != null : "fx:id=\"cancelButton\" was not injected: check your FXML file 'LegoListProperties.fxml'.";
		assert legoListDescription != null : "fx:id=\"legoListDescription\" was not injected: check your FXML file 'LegoListProperties.fxml'.";
		assert legoListName != null : "fx:id=\"legoListName\" was not injected: check your FXML file 'LegoListProperties.fxml'.";
		assert legoListUUID != null : "fx:id=\"legoListUUID\" was not injected: check your FXML file 'LegoListProperties.fxml'.";
		assert okButton != null : "fx:id=\"okButton\" was not injected: check your FXML file 'LegoListProperties.fxml'.";

		// initialize your logic here: all @FXML variables will have been injected

		legoListName.textProperty().addListener(new ChangeListener<String>()
		{
			@Override
			public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue)
			{
				//need to make sure it doesn't collide with something in the DB. Ok to collide with self.
				if (newValue.length() > 0
						&& ((llbr_ != null && llbr_.getGroupName().equals(newValue)) || BDBDataStoreImpl.getInstance().getLegoListByName(newValue) == null))
				{
					nameValid.set(true);
					legoListName.setEffect(null);
				}
				else
				{
					nameValid.set(false);
					legoListName.setEffect(FxUtils.redDropShadow);
				}
			}
		});

		legoListDescription.textProperty().addListener(new ChangeListener<String>()
		{
			@Override
			public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue)
			{
				if (newValue.length() > 0)
				{
					descValid.set(true);
					legoListDescription.setEffect(null);
				}
				else
				{
					descValid.set(false);
					legoListDescription.setEffect(FxUtils.redDropShadow);
				}
			}
		});

		formValid = new BooleanBinding()
		{
			{
				bind(nameValid, descValid);
			}

			@Override
			protected boolean computeValue()
			{
				return nameValid.get() && descValid.get();
			}
		};

		cancelButton.setOnAction(new EventHandler<ActionEvent>()
		{
			@Override
			public void handle(ActionEvent event)
			{
				((Stage) rootPane.getScene().getWindow()).close();
			}
		});

		okButton.setOnAction(new EventHandler<ActionEvent>()
		{
			@Override
			public void handle(ActionEvent event)
			{
				if (llbr_ == null)
				{
					LegoList ll = new LegoList();
					ll.setGroupDescription(legoListDescription.getText());
					ll.setGroupName(legoListName.getText());
					ll.setLegoListUUID(legoListUUID.getText());
					ll.setComment(legoListComments.getText());
					try
					{
						AppContext.getService(LegoGUIMasterModel.class).importLegoList(ll);
					}
					catch (WriteException e)
					{
						AppContext.getCommonDialogs().showErrorDialog("Unexpected Error", "Error creating Lego List", e.toString());
					}
				}
				else
				{
					try
					{
						AppContext.getService(LegoGUIMasterModel.class).updateLegoList(llbr_, ti_, legoListName.getText(), legoListDescription.getText(),
								legoListComments.getText());
					}
					catch (WriteException e)
					{
						AppContext.getCommonDialogs().showErrorDialog("Unexpected Error", "Error updating Lego List", e.toString());
					}
				}
				((Stage) rootPane.getScene().getWindow()).close();
			}
		});

		okButton.disableProperty().bind(formValid.not());
	}

	public void setVariables(LegoListByReference llbr, TreeItem<String> ti)
	{
		ti_ = ti;
		llbr_ = llbr;
		legoListDescription.setText(llbr == null ? "" : llbr.getGroupDescription());
		legoListName.setText(llbr == null ? "" : llbr.getGroupName());
		legoListUUID.setText(llbr == null ? UUID.randomUUID().toString() : llbr.getLegoListUUID());
		legoListComments.setText(llbr == null ? "" : llbr.getComments());
	}
}


text:
/**
 *  TrackConfigTransformer takes JBrowse track.config object and, if needed,
 *      modifies in place to use WebApollo-specific track types, etc.
 */
define( [ 'dojo/_base/declare' ],
        function( declare ) {

return declare( null, {

constructor: function( args )  {

    this.transformers=[];
    var browser=args.browser;
    this.overridePlugins=browser.config.overridePlugins;
    this.transformers["JBrowse/View/Track/HTMLFeatures"] = function(trackConfig) {
        trackConfig.type = "WebApollo/View/Track/DraggableHTMLFeatures";
    };

    this.transformers["JBrowse/View/Track/CanvasFeatures"] = function(trackConfig) {
        trackConfig.type = "WebApollo/View/Track/WebApolloCanvasFeatures";
    };

    this.transformers["JBrowse/View/Track/Sequence"] = function(trackConfig) {
        trackConfig.type = "WebApollo/View/Track/AnnotSequenceTrack";
        trackConfig.storeClass = "WebApollo/Store/SeqFeature/ScratchPad";
        trackConfig.style = { className: "{type}",
                              uniqueIdField : "id" };
        trackConfig.compress = 0;
        trackConfig.subfeatures = 1;
    };

    this.transformers["JBrowse/View/Track/Alignments"] = function(trackConfig) {
        if(!trackConfig.overrideDraggable&&!browser.config.overrideDraggable) {
            trackConfig.type = "WebApollo/View/Track/DraggableAlignments";
        }
    };

    this.transformers["JBrowse/View/Track/Alignments2"] = this.transformers["JBrowse/View/Track/Alignments"];

},

transform: function(trackConfig) {
    if (trackConfig.overridePlugins||this.overridePlugins) {
        return;
    }
    if (this.transformers[trackConfig.type]) {
        var transformer = this.transformers[trackConfig.type];
        transformer(trackConfig);
    }
}

});

});


text:
<?php

namespace Admin\Controller;

use Doctrine\ORM\EntityNotFoundException;
use Zend\View\Model\ViewModel;

class DashboardController extends BaseController
{
    public function indexAction()
    {
        $articles   = $this->getEntityManager()->getRepository('Blog\Entity\Article')->findAll();
        $comments   = $this->getEntityManager()->getRepository('Blog\Entity\Comment')->findAll();
        $categories = $this->getEntityManager()->getRepository('Blog\Entity\Category')->findAll();
        $logs       = $this->getEntityManager()->getRepository('Blog\Entity\Log')->findAll();

        $lastFiveComments = $this->getEntityManager()->getRepository('Blog\Entity\Comment')
            ->findBy([], ['date' => 'DESC'], 5);

        $lastFiveArticles = $this->getEntityManager()->getRepository('Blog\Entity\Article')
            ->findBy([], ['date' => 'DESC'], 5);

        $lastTenLogs = $this->getEntityManager()->getRepository('Blog\Entity\Log')
            ->findBy([], ['date' => 'DESC'], 10);

        return new ViewModel([
            'articles'         => $articles,
            'comments'         => $comments,
            'categories'       => $categories,
            'logs'             => $logs,
            'lastFiveComments' => $lastFiveComments,
            'lastFiveArticles' => $lastFiveArticles,
            'lastTenLogs'      => $lastTenLogs
        ]);
    }

    public function updateStateCommentAction()
    {
        $eventManager = $this->getEventManager();
        if ($this->getRequest()->isXmlHttpRequest()) {

            $em = $this->getEntityManager();

            $commentId = $this->getRequest()->getPost('commentId');
            $comment = $em->getRepository('Blog\Entity\Comment')->find($commentId);

            if (!$comment) {
                throw new EntityNotFoundException('Entity Comment not found');
            }

            if ($comment->isState()) {
                $comment->setState(false);
            } else{
                $comment->setState(true);
            }

            $em->persist($comment);
            $em->flush();

            $eventManager->trigger($comment->isState() ? 'comment.approve' : 'comment.reject', null, [
                'comment_id' => $comment->getId(),
                'article_id' => $comment->getArticle()->getId(),
                'article_title' => $comment->getArticle()->getTitle(),
                'user_id' => $this->zfcUserAuthentication()->getIdentity()->getId(),
                'user_email' => $this->zfcUserAuthentication()->getIdentity()->getEmail()
            ]);

            $view = new ViewModel(['comment' => $comment]);
            $view->setTemplate('admin/updateComment');
            $view->setTerminal(true); //turn off layout

            return $view;
        }

        return null;
    }

}


text:
{% macro buybtn(edition, info, licensedEdition, canTestEditions) %}
	{%- spaceless %}
		{# is it already installed? #}
		{% if edition == CraftEdition  %}

{{ "Installed"|t }}

		{% endif %}

			{# is it elligible to be purchased? #}
			{% if edition > licensedEdition %}

					{% if info.salePrice %}
						{{ info.formattedPrice }} {{ info.formattedSalePrice }}
					{% else %}
						{{ info.formattedPrice }}
					{% endif %}

			{% endif %}

			{# if the domain is allowed to test editions, show an uninstall/test button #}
			{% if canTestEditions %}
				{% if edition == CraftEdition %}

{{ "Uninstall"|t }}

				{% else %}

{{ "Test"|t }}

				{% endif %}
			{% endif %}

	{% endspaceless -%}
{% endmacro %}

{% from _self import buybtn %}
{% import "_includes/forms" as forms %}

Craft Client

Craft Pro

				{{ buybtn(CraftClient, editions[CraftClient], licensedEdition, canTestEditions) }}
				{{ buybtn(CraftPro, editions[CraftPro], licensedEdition, canTestEditions) }}

				{{ "Content Publishing"|t }}

				{{ "Unlimited Singles and Channels"|t }}

				{{ "Structure sections"|t }}

				{{ "Entry versioning"|t }}

				{{ "Entry drafts"|t }}

				{{ "User Accounts"|t }}

				{{ "Additional user accounts"|t }}
				{{ "One "Client" account"|t }}
				{{ "Unlimited"|t }}

				{{ "User groups"|t }}

				{{ "User permissions"|t }}

				{{ "Public user registration"|t }}

				{{ "System Branding"|t }}

				{{ "Custom login screen logo"|t }}

				{{ "Custom HTML email template"|t }}

				{{ "Custom email message wording"|t }}

				{{ "Assets"|t }}

				{{ "Amazon S3 support"|t }}

				{{ "Rackspace Cloud Files support"|t }}

				{{ "Google Cloud Storage support"|t }}

				{{ "Localization and Translation"|t }}

				{{ "Section and entry locale targeting"|t }}

				{{ "Content translations"|t }}

				{{ "Locale-specific user permissions"|t }}

				{{ buybtn(CraftClient, editions[CraftClient], licensedEdition, canTestEditions) }}
				{{ buybtn(CraftPro, editions[CraftPro], licensedEdition, canTestEditions) }}

	<form class="pane">

		{{ getCsrfInput() }}

		{{ forms.textField({
			label: "Name on the card"|t,
			id: 'cc-name'
		}) }}

		{{ forms.textField({
			label: "Credit card number"|t,
			id: 'cc-num',
			autocomplete: false
		}) }}

						{% set monthInput %}

								<select id="cc-month">
									{% set localeData = craft.i18n.getLocaleData() %}
									{% for month in 1..12 %}
										{% set month2 = "%02d"|format(month) %}
										<option value="{{ month2 }}">{{ month2 }} - {{ localeData.getMonthName(month) }}</option>
									{% endfor %}
								</select>

						{% endset %}

						{{ forms.field({
							label: "Expiration month"|t,
							id: 'cc-month'
						}, monthInput) }}

						{% set yearInput %}

								<select id="cc-year">
									{% for year in now.year .. now.year+10 %}
										<option value="{{ year }}">{{ year }}</option>
									{% endfor %}
								</select>

						{% endset %}

						{{ forms.field({
							label: "Exp. year"|t,
							id: 'cc-year'
						}, yearInput) }}

						{{ forms.textField({
							label: "CVC"|t,
							id: 'cc-cvc',
							size: 5,
							autocomplete: false
						}) }}

{{ "Cancel"|t }}

				<input type="submit" class="btn submit" value="{{ 'Purchase'|t }}">

	</form>

{{ "Your payment is safe and secure with {stripe}."|t({ stripe: 'Stripe' })|raw }}

{{ "Craft has been upgraded successfully!" }}

{{ "Reload"|t }}