text:
classdef telescope < telescopeAbstract
    % Create a telescope object
    %
    % sys = telescope(D) creates a telescope object from the telescope diameter D
    %
    % sys = telescope(D,...) creates a telescope object from the
    % above parameter and from optionnal parameter-value pair arguments. The
    % optionnal parameters are those of the telescopeAbstract class.
    %
    % Example:
    % tel = telescope(8); An 8m diameter telescope
    %
    % tel = telescope(8,'obstructionRatio',0.14,'fieldOfViewInArcmin',2,'resolution',64);
    % An 8m diameter telescope with an 14% central obstruction, a 2 arcmin
    % fov and a pupil sampled with 64x64 pixels
    % Displaying the pupil:
    % imagesc(tel.pupil)
    % The pupil logical mask is given by
    % tel.pupilLogical
    %
    % A telescope object can be combined with an atmosphere object to
    % define a volume of turbulence above the telescope within its
    % field-of--view:
    % atm = atmosphere(photometry.V,0.15,30,...
    %     'altitude',4e3,...
    %     'fractionnalR0',1,...
    %     'windSpeed',15,...
    %     'windDirection',0);
    % tel = telescope(8,'fieldOfViewInArcmin',2,'resolution',64,'samplingTime',1/500);
    % The telescope-atmosphere object is built by adding the atmosphere to
    % the telescope:
    % tel = tel + atm;
    % figure, imagesc(tel)
    % The frozen-flow or Taylor motion of the phase screen is created by
    % updating the telescope object:
    % +tel;
    % The phase screen(s) are moved of an amount depending on the
    % samplingTime and the wind vector parameters.
    % The geometric propagation of a star through the atmosphere to the
    % telescope pupil is done as followed
    % ngs = source;
    % ngs = ngs.*tel;
    % figure, imagesc(ngs.phase), axis square xy, colorbar
    % At anytime the atmosphere can be removed from the telescope:
    % tel = tel - atm;
    %
    % See also telescopeAbstract, atmosphere and source

    properties
        % telescope tag
        tag = 'TELESCOPE';
    end

    properties (Dependent)% , SetAccess = private)
        % telescope pupil mask
        pupil;
    end

%     properties (Access=private)
%         atm;
%         innerMask;
%         outerMask;
%         A;
%         B;
%         windVx;
%         windVy;
%         count;
%         mapShift;
%         nShift;
%         x;
%         y;
%         imageHandle;
%         layerSampling;
%         sampler;
%         log;
%         p_pupil;
%     end

    methods

        %% Constructor
        function obj = telescope(D,varargin)
%             p = inputParser;
%             p.addRequired('D', @isnumeric);
%             p.addParamValue('obstructionRatio', 0, @isnumeric);
%             p.addParamValue('fieldOfViewInArcsec', [], @isnumeric);
%             p.addParamValue('fieldOfViewInArcmin', [], @isnumeric);
%             p.addParamValue('resolution', [], @isnumeric);
%             p.addParamValue('samplingTime', [], @isnumeric);
%             p.addParamValue('opticalAberration', [], @(x) isa(x,'atmosphere'));
%             p.parse(D,varargin{:});
            obj = obj@telescopeAbstract(D,varargin{:});
            display(obj)
        end

        %% Destructor
        function delete(obj)
            if isa(obj.opticalAberration,'atmosphere')
                add(obj.log,obj,'Deleting atmosphere layer slabs!')
%                 for kLayer=1:obj.atm.nLayer
%                     obj.atm.layer(kLayer).phase = [];
%                 end
            end
            checkOut(obj.log,obj)
        end

        function obj = saveobj(obj)
            obj.phaseListener = [];
        end

        function embed(obj,nPts)
            %% EMBED the telescope on a nPts computational domain and update tel.D
            if nPts > obj.resolution
                nExt = (nPts-obj.resolution)/2;
                if iseven(nExt)
                    obj.pupil = padarray(obj.pupil,[nExt nExt],0,'both');
                    obj.D = nPts/obj.resolution*obj.D;
                    obj.resolution = nPts;
                else
                    'CANNOT EMBED DUE TO FRACTIONAL NUMBER OF PIXELS'
                end
            end
        end
        function display(obj)
            %% DISPLAY Display object information
            %
            % display(obj) prints information about the atmosphere+telescope object

            display(obj.atm)
            fprintf('___ %s ___\n',obj.tag)
            if obj.obstructionRatio==0
                fprintf(' %4.2fm diameter full aperture',obj.D)
            else
                fprintf(' %4.2fm diameter with a %4.2f%% central obstruction',...
                    obj.D,obj.obstructionRatio*100)
            end
            fprintf(' with %5.2fm^2 of light collecting area;\n',obj.area)
            if obj.fieldOfView~=0
                fprintf(' the field-of-view is %4.2farcmin;',...
                    obj.fieldOfView*constants.radian2arcmin)
            end
            if ~isempty(obj.resolution)
                fprintf(' the pupil is sampled with %dX%d pixels',...
                    obj.resolution,obj.resolution)
            end
            if obj.fieldOfView~=0 || ~isempty(obj.resolution)
                fprintf('\n')
            end
            fprintf('----------------------------------------------------\n')

        end

        %% Get and Set the pupil
        function pupil = get.pupil(obj)
            pupil = obj.p_pupil;
            if isempty(pupil) && ~isempty(obj.resolution)
                pupil = utilities.piston(obj.resolution,'shape',obj.shape);
                if obj.obstructionRatio>0
                    pupil = pupil - ...
                        utilities.piston(...
                        round(obj.resolution.*obj.obstructionRatio),...
                        obj.resolution);
                end
                obj.p_pupil = pupil;
            end
        end
        function obj = set.pupil(obj,val)
            obj.p_pupil = val;
        end

        function out = otf(obj, r)
            %% OTF Telescope optical transfert function
            %
            % out = otf(obj, r) Computes the telescope optical transfert function

            if ~all(isreal(r(:))) % Check if r is complex!
                r = abs(r);
            end
%             out = zeros(size(r));
            if obj.obstructionRatio ~= 0
                out = pupAutoCorr(obj.D) + pupAutoCorr(obj.obstructionRatio*obj.D) - ...
                    2.*pupCrossCorr(obj.D./2,obj.obstructionRatio*obj.D./2);
            else
                out = pupAutoCorr(obj.D);
            end
            out = out./(pi*obj.D*obj.D.*(1-obj.obstructionRatio*obj.obstructionRatio)./4);

            if isa(obj.opticalAberration,'atmosphere')
                out = out.*phaseStats.otf(r,obj.opticalAberration);
            end

            function out1 = pupAutoCorr(D)

                index       = r <= D;
                red         = r(index)./D;
                out1        = zeros(size(r));
                out1(index) = D.*D.*(acos(red)-red.*sqrt((1-red.*red)))./2;

            end

            function out2 = pupCrossCorr(R1,R2)

                out2 = zeros(size(r));

                index       = r <= abs(R1-R2);
                out2(index) = pi*min([R1,R2]).^2;

                index       = (r > abs(R1-R2)) & (r < (R1+R2));
                rho         = r(index);
                red         = (R1*R1-R2*R2+rho.*rho)./(2.*rho)/(R1);
                out2(index) = out2(index) + R1.*R1.*(acos(red)-red.*sqrt((1-red.*red)));
                red         = (R2*R2-R1*R1+rho.*rho)./(2.*rho)/(R2);
                out2(index) = out2(index) + R2.*R2.*(acos(red)-red.*sqrt((1-red.*red)));

            end

        end

        function out = psf(obj,f,~)
            %% PSF Telescope point spread function
            %
            % out = psf(obj, f) computes the telescope point spread function

            if isa(obj.opticalAberration,'atmosphere')
                fun = @(u) 2.*pi.*quadgk(@(v) psfHankelIntegrandNested(v,u),0,obj.D);
                out = zeros(size(f));
                parfor k = 1:numel(f)
                    out(k) = fun(f(k));
                end
%                 out = arrayfun( fun, f);
            else
                out   = ones(size(f)).*pi.*obj.D.^2.*(1-obj.obstructionRatio.^2)./4;
                index = f~=0;
                u = pi.*obj.D.*f(index);
                surface = pi.*obj.D.^2./4;
                out(index) = surface.*2.*besselj(1,u)./u;
                if obj.obstructionRatio>0
                    u = pi.*obj.D.*obj.obstructionRatio.*f(index);
                    surface = surface.*obj.obstructionRatio.^2;
                    out(index) = out(index) - surface.*2.*besselj(1,u)./u;
                end
                out = abs(out).^2./(pi.*obj.D.^2.*(1-obj.obstructionRatio.^2)./4);

            end
            function y = psfHankelIntegrandNested(x,freq)
                y = x.*besselj(0,2.*pi.*x.*freq).*otf(obj,x);
            end
        end

        function out = image(obj,resolution,pixelScaleInSpFreq)
            %% IMAGE 2D Point Spread Function
            %
            % psf = image(tel,resolution,pixelScaleInSpFreq)

            n = resolution;
            u = pixelScaleInSpFreq*linspace(-1,1,n)*n/2;
            [fx,fy] = meshgrid(u);
            out = psf(obj,hypot(fx,fy))/obj.area;%/psf(obj,0);

        end

        function out = fullWidthHalfMax(obj)
            %% FULLWIDTHHALFMAX Full Width at Half the Maximum evaluation
            %
            % out = fullWidthHalfMax(a) computes the FWHM of a telescope
            % object. Units are m^{-1}. To convert it in arcsecond,
            % multiply by the wavelength then by radian2arcsec.

            if isa(obj.opticalAberration,'atmosphere')
                x0 = [0,2/min(obj.D,obj.opticalAberration.r0)];
            else
                x0 = [0,2/obj.D];
            end
            [out,fval,exitflag] = fzero(@(x) psf(obj,abs(x)./2) - psf(obj,0)./2,x0,optimset('TolX',1e-9));
            if exitflag<0
                warning('cougar:telescope:fullWidthHalfMax',...
                    'No interval was found with a sign change, or a NaN or Inf function value was encountered during search for an interval containing a sign change, or a complex function value was encountered during the search for an interval containing a sign change.')
            end
            out = abs(out);
        end

        function varargout = footprintProjection(obj,zernModeMax,src)
            nSource = length(src);
            P = cell(obj.atm.nLayer,nSource);
            obj.log.verbose = false;
            for kSource = 1:nSource
                fprintf(' @(telescope) > Source #%2d - Layer #00',kSource)
                for kLayer = 1:obj.atm.nLayer
                    fprintf('\b\b%2d',kLayer)
                    obj.atm.layer(kLayer).zern = ...
                        zernike(1:zernModeMax,'resolution',obj.atm.layer(kLayer).nPixel);
                    conjD = obj.atm.layer(kLayer).D;
                    delta = obj.atm.layer(kLayer).altitude.*...
                        tan(src(kSource).zenith).*...
                        [cos(src(kSource).azimuth),sin(src(kSource).azimuth)];
                    delta = delta*2/conjD;
                    alpha = conjD./obj.D;
                    P{kLayer,kSource} = smallFootprintExpansion(obj.atm.layer(kLayer).zern,delta,alpha);
                    varargout{1} = P;
                end
                fprintf('\n')
            end
            obj.log.verbose = true;
%             if nargout>1
%                 o = linspace(0,2*pi,101);
%                 varargout{2} = cos(o)./alpha + delta(1);
%                 varargout{3} = sin(o)./alpha + delta(2);
%             end
        end

        function out = index(obj,z)
            %% INDEX

            out = abs(z)<obj.R & abs(z)>obj.R*obj.obstructionRatio;
        end

    end

    methods (Static)
        function sys = demo(action)
            sys = telescope(2.2e-6,0.8,30,25,...
                'altitude',[0,10,15].*1e3,...
                'fractionnalR0',[0.7,0.2,0.1],...
                'windSpeed',[10,5,15],...
                'windDirection',[0,pi/4,pi/2],...
                'fieldOfViewInArcMin',2,...
                'resolution',60*15,...
                'samplingTime',1/500);
            %             sys = telescope(2.2e-6,0.8,10,25,...
            %                 'altitude',10.*1e3,...
            %                 'fractionnalR0',1,...
            %                 'windSpeed',10,...
            %                 'windDirection',0,...
            %                 'fieldOfViewInArcMin',1,...
            %                 'resolution',60,...
            %                 'samplingTime',1e-3);
            if nargin>0
                update(sys);
                sys.phaseListener.Enabled = true;
                imagesc(sys)
                while true
                    update(sys);
                    drawnow
                end
            end
        end

        function sys = demoSingleLayer
            sys = telescope(2.2e-6,0.8,10,25,...
                'altitude',10e3,...
                'fractionnalR0',1,...
                'windSpeed',10,...
                'windDirection',0,...
                'fieldOfViewInArcMin',2,...
                'resolution',256,...
                'samplingTime',1/500);
        end
    end

end


text:
#ifndef HTMLParserIdioms_h
#define HTMLParserIdioms_h

#include "core/CoreExport.h"
#include "core/dom/QualifiedName.h"
#include "platform/Decimal.h"
#include "wtf/Forward.h"
#include "wtf/text/WTFString.h"

namespace WTF {
class TextEncoding;
}

namespace blink {

// Strip leading and trailing whitespace as defined by the HTML specification.
String stripLeadingAndTrailingHTMLSpaces(const String&);

// An implementation of the HTML specification's algorithm to convert a number
// to a string for number and range types.
String serializeForNumberType(const Decimal&);
String serializeForNumberType(double);

// Convert the specified string to a decimal/double. If the conversion fails,
// the return value is fallback value or NaN if not specified. Leading or
// trailing illegal characters cause failure, as does passing an empty string.
// The double* parameter may be 0 to check if the string can be parsed without
// getting the result.
Decimal parseToDecimalForNumberType(
    const String&,
    const Decimal& fallbackValue = Decimal::nan());
double parseToDoubleForNumberType(
    const String&,
    double fallbackValue = std::numeric_limits<double>::quiet_NaN());

// http://www.whatwg.org/specs/web-apps/current-work/#rules-for-parsing-integers
CORE_EXPORT bool parseHTMLInteger(const String&, int&);

// http://www.whatwg.org/specs/web-apps/current-work/#rules-for-parsing-non-negative-integers
CORE_EXPORT bool parseHTMLNonNegativeInteger(const String&, unsigned&);

// https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-a-list-of-floating-point-numbers
CORE_EXPORT Vector<double> parseHTMLListOfFloatingPointNumbers(const String&);

typedef Vector<std::pair<String, String>> HTMLAttributeList;
// The returned encoding might not be valid.
WTF::TextEncoding encodingFromMetaAttributes(const HTMLAttributeList&);

// Space characters as defined by the HTML specification.
template <typename CharType>
inline bool isHTMLSpace(CharType character) {
  // Histogram from Apple's page load test combined with some ad hoc browsing
  // some other test suites.
  //
  //     82%: 216330 non-space characters, all > U+0020
  //     11%:  30017 plain space characters, U+0020
  //      5%:  12099 newline characters, U+000A
  //      2%:   5346 tab characters, U+0009
  //
  // No other characters seen. No U+000C or U+000D, and no other control
  // characters. Accordingly, we check for non-spaces first, then space, then
  // newline, then tab, then the other characters.

  return character <= ' ' &&
         (character == ' ' || character == '\n' || character == '\t' ||
          character == '\r' || character == '\f');
}

template <typename CharType>
inline bool isComma(CharType character) {
  return character == ',';
}

template <typename CharType>
inline bool isHTMLSpaceOrComma(CharType character) {
  return isComma(character) || isHTMLSpace(character);
}

inline bool isHTMLLineBreak(UChar character) {
  return character <= '\r' && (character == '\n' || character == '\r');
}

template <typename CharType>
inline bool isNotHTMLSpace(CharType character) {
  return !isHTMLSpace<CharType>(character);
}

bool threadSafeMatch(const QualifiedName&, const QualifiedName&);
bool threadSafeMatch(const String&, const QualifiedName&);

enum CharacterWidth { Likely8Bit, Force8Bit, Force16Bit };

String attemptStaticStringCreation(const LChar*, size_t);

String attemptStaticStringCreation(const UChar*, size_t, CharacterWidth);

template <size_t inlineCapacity>
inline static String attemptStaticStringCreation(
    const Vector<UChar, inlineCapacity>& vector,
    CharacterWidth width) {
  return attemptStaticStringCreation(vector.data(), vector.size(), width);
}

inline static String attemptStaticStringCreation(const String str) {
  if (!str.is8Bit())
    return attemptStaticStringCreation(str.characters16(), str.length(),
                                       Force16Bit);
  return attemptStaticStringCreation(str.characters8(), str.length());
}

}  // namespace blink

#endif  // HTMLParserIdioms_h

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<page visibility="1">
    <component_list>
        <component visibility="1" type="Html" order="1">
            <title localize="false">Installation Instructions</title>
            <filename>InstructionsSnippet.html</filename>
        </component>
    </component_list>
</page>


text:
var messageSelectedUsers;
var allUsers;
var messageCollection;

var timerPopup;
var messagePopupTime = 1000*20; //20sec
var timerMessage;
var messageTime = 1000*60*5 //5min

$('.sidebar').on('click', '#askToLeave', askToLeave);
$('.sidebar').on('click', '.btnSubmitMessage', submitMessagePopup);

function loadMessagePopup(event) {
  activeColor = colors["black"];
  switchButtonColor();
  strokeSize = 1;
  setSidebarStrokeButtonClass("minStroke");
  messageSelectedUsers = new Array();
  allUsers = new Array();
  showPopup();
  startMessagePopupTimer();
  $("#popup").append("
Create Message");
  $("#popup").append("
");
  $("#popup").append("
Select the users to compose a message for.");
  $("#popup").append("
");

  $.ajax({
    url:"/functions/getUsersForRoom",
    type:"GET",
    data:{"roomID":roomID},
    success:function(res) {
      res.forEach(function(key) {
        allUsers.push(key.userID);
      });
      $("#popup").append("
");
      if(res.length == 0) {
        $("#usersInRoom").append("There are currently no users in this room.");
      }
      else {
        res.forEach(function(key) {
          var profilePicURL = key.userProfilePic;
          if(!profilePicURL || profilePicURL == null) {
            profilePicURL = "images/no_user.jpg";
          }
          $("#usersInRoom").append("

"+
            "");
          $("#usersInRoom").children().last().append("
"+key.userName);
        });
      }
    },
    error:function(err) {
      console.log("couldn't get users for room");
      showFloaty("no connection");
    },
    complete:function() {
      $("#popup").append("
");
      $(".popupConfirm").append("<button onclick='composeTo(\"selected\")'>Compose");
      $(".popupConfirm").append("<button onclick='composeTo(\"all\")'>Compose to all");
      //$(".popupConfirm").append("<button onclick=''>generate QR code");
      $(".popupConfirm").append("<button onclick='removePopup()'>Cancel");
      $(".popupConfirm button:last").focus();
      // just a small hack to display the scrollbar on the tablet
      //showUser(selectedUser);
    },
    timeout: ajaxTimeout
  });
}

function composeTo(type) {
  messageCollection = new Array();
  if(type == "selected") {
    messageCollection = messageSelectedUsers.slice();
  }
  else {
    messageCollection = allUsers.slice();
  }
  if(messageCollection.length > 0) {
    stopSwitchUserTimer();
    removePopup();
    undo_undoStack = FixedQueue(undo_stackLength);
    undo_redoStack = FixedQueue(undo_stackLength);
    paper.setup('EditorCanvas');
    activeColor = colors["black"];
    showSidebar('sidebarCreateMessage');
    openSidebar();
    addImageDropLayer();
    show_gifs();
    removeAllGifs();
    updateTimer();
    activatePenTool();
    project.clear();
    view.update();
    startMessageTimer();
    $('#tabletSizePreview').css('visibility','visible');
    showUsersInHeader();
    switchButtonColor();
  }
  else {
    showFloaty("Select a user!");
  }
}

function showUsersInHeader() {
  $("#header").empty();
  $("#header").append("
");
  $("#userInfo").append("
Compose Message to");
  $("#userInfo").append("
");
  var count = 0;
  if(usercollection.length == messageCollection.length) {
    $("#userDescription").append("All users in room");
  }
  else {
    usercollection.forEach(function(key) {
      if($.inArray(key.userID,messageCollection) != -1) {
        if(count == 4) {
          $("#userDescription").append("... and more");
          return;
        }
        count += 1;
        $("#userDescription").append(key.userName+"
");
      }
    });
  }
  $("#header").append("
");
  $("#userImage").append("");
  showIcon("pen");
}

function handleSelection(userID) {
  var tiles = $("#usersInRoom .userTile");
  tiles.each(function() {
    var imgInTile = $(this).find("div img");
    if(imgInTile.attr("value") == userID) {
      if($.inArray(userID,messageSelectedUsers) == -1) {
        messageSelectedUsers.push(userID);
        imgInTile.css("border","solid 2px red");
        return;
      }
      else {
        messageSelectedUsers.pop(userID);
        imgInTile.removeAttr("style");
        return;
      }
    }
  });
}

function askToLeave(event) {
  if(JSON.parse(project.exportJSON()).length > 0) {
    showPopup();
    startMessagePopupTimer();
    $("#popup").append("
Cancel Message");
    $("#popup").append("
");
    $("#popup").append("
Do you want to discard this message?");
    $("#popup").append("
");
    $("#popup").append("
");
    $(".popupConfirm").append("<button onclick='{removePopup(); loadMain(); stopMessageTimer(); stopMessagePopupTimer(); closeSidebar();}'>Discard");
    $(".popupConfirm").append("<button onclick='{removePopup(); stopMessagePopupTimer();}'>Cancel");
    $(".popupConfirm button:last").focus();
  }
  else {
    loadMain();
    stopMessageTimer();
    closeSidebar();
  }
}

function submitMessagePopup() {
  showPopup();
  startMessagePopupTimer();
  $("#popup").append("
Send Message");
  $("#popup").append("
");
  $("#popup").append("
Do you want to send this message?");
  $("#popup").append("
");
  $("#popup").append("
");
  $(".popupConfirm").append("<button onclick='submitMessage()'>Send");
  $(".popupConfirm").append("<button onclick='{removePopup(); stopMessagePopupTimer();}'>Cancel");
  $(".popupConfirm button:last").focus();
}

function submitMessage() {
  removePopup();
  project.deselectAll();
  removeBoundingBox();
  removeSelectionPopup();
  var message = project.exportJSON();

  if(JSON.parse(message).length > 0) {
    $.ajax({
      url:"functions/createMessage",
      type:"POST",
      data:{"messageContent":message,"roomID":roomID,"receivers":JSON.stringify(messageCollection)},
      success:function(res) {
        showFloaty("Message sent!");
        closeSidebar();
        loadMain();
      },
      error:function(err) {
        console.log(err);
        showFloaty("no connection");
      },
      complete:function() {
        stopMessageTimer();
        stopMessagePopupTimer();
      },
    timeout: ajaxTimeout
    });
  }
  else {
    showFloaty("Message is empty!");
  }
}

function startMessagePopupTimer() {
  stopMessagePopupTimer();
  timerPopup = setTimeout(removePopup,messagePopupTime);
}

function stopMessagePopupTimer() {
  clearTimeout(timerPopup);
}

function startMessageTimer() {
  stopMessageTimer();
  timerMessage = setTimeout(function() {
    removePopup();
    closeSidebar();
    loadMain();
  },messageTime);
}

function stopMessageTimer() {
  clearTimeout(timerMessage);
}


text:
package org.apache.felix.deploymentadmin.spi;

import java.io.IOException;
import java.io.InputStream;

import org.apache.felix.deploymentadmin.AbstractDeploymentPackage;
import org.apache.felix.deploymentadmin.BundleInfoImpl;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
import org.osgi.service.deploymentadmin.DeploymentException;
import org.osgi.service.log.LogService;

/**
 * Command that uninstalls bundles, if rolled back the bundles are restored.
 */
public class DropBundleCommand extends Command {

    public void execute(DeploymentSessionImpl session) throws DeploymentException {
        AbstractDeploymentPackage target = session.getTargetAbstractDeploymentPackage();
        AbstractDeploymentPackage source = session.getSourceAbstractDeploymentPackage();
        LogService log = session.getLog();

        BundleInfoImpl[] orderedTargetBundles = target.getOrderedBundleInfos();
        for (int i = orderedTargetBundles.length - 1; i >= 0; i--) {
            BundleInfoImpl bundleInfo = orderedTargetBundles[i];
            if (!bundleInfo.isCustomizer() && source.getBundleInfoByName(bundleInfo.getSymbolicName()) == null) {
                // stale bundle, save a copy for rolling back and uninstall it
                String symbolicName = bundleInfo.getSymbolicName();
                try {
                    Bundle bundle = target.getBundle(symbolicName);
                    bundle.uninstall();
                    addRollback(new InstallBundleRunnable(bundle, target.getBundleStream(symbolicName), log));
                }
                catch (BundleException be) {
                    log.log(LogService.LOG_WARNING, "Bundle '" + symbolicName + "' could not be uninstalled", be);
                }
                catch (IOException e) {
                    log.log(LogService.LOG_WARNING, "Could not get bundle data stream for bundle '" + symbolicName + "'", e);
                    throw new DeploymentException(DeploymentException.CODE_OTHER_ERROR, "Could not prepare rollback for uninstalling bundle '" + symbolicName + "'");
                }
            }
        }
    }

    private static class InstallBundleRunnable implements Runnable {

        private final InputStream m_bundleStream;
        private final Bundle m_bundle;
        private final LogService m_log;

        public InstallBundleRunnable(Bundle bundle, InputStream bundleStream, LogService log) {
            m_bundle = bundle;
            m_bundleStream = bundleStream;
            m_log = log;
        }

        public void run() {
            try {
                m_bundle.update(m_bundleStream);
            }
            catch (BundleException e) {
                m_log.log(LogService.LOG_WARNING, "Could not rollback uninstallation of bundle '" + m_bundle.getSymbolicName() + "'", e);
            }
        }
    }
}


text:
using WebsiteRipper.Downloaders;

namespace WebsiteRipper.Tests.Fixtures
{
    [Downloader(WebTest.Scheme)]
    sealed class WebTestDownloader : Downloader
    {
        public WebTestDownloader(DownloaderArgs downloaderArgs) : base(downloaderArgs) { }
    }
}


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

{% block title %}
  Minimail · Email Marketing for Developers | Account
{% endblock %}

{% block content %}

      <form method="post" action="{% url 'user_account' %}">
        <legend>Account</legend>
        {% csrf_token %}

          {{form_user.full_name.label}}
          <input id="{{form_user.full_name.auto_id}}" name="{{form_user.full_name.name}}" class='form-control' autofocus tabindex=1 value ="{{form_user.full_name.value | default_if_none:""}}"/>
          {% for error in form_user.full_name.errors %}
            {{error}}
          {% endfor %}

          {{form_user.email.label}}
          <input id="" name="" class='form-control' autofocus tabindex=2 value ="{{form_user.email.value}}" readonly="true"/>

        <button type="submit" class="btn btn-default">Submit</button>
      </form>

      <form method="post" action="{% url 'user_change_password' %}">
        <legend>Change password</legend>
        {% csrf_token %}

          {{form_password.old_password.label}}
          <input type="password" id="{{form_password.old_password.auto_id}}" name="{{form_password.old_password.name}}" class='form-control' autofocus tabindex=3 value =""/>
          {% for error in form_password.old_password.errors %}
            {{error}}
          {% endfor %}

          {{form_password.password1.label}}
          <input type="password" id="{{form_password.password1.auto_id}}" name="{{form_password.password1.name}}" class='form-control' autofocus tabindex=4 value =""/>
          {% for error in form_password.password1.errors %}
            {{error}}
          {% endfor %}

          {{form_password.password2.label}}
          <input type="password" id="{{form_password.password2.auto_id}}" name="{{form_password.password2.name}}" class='form-control' autofocus tabindex=5 value =""/>
          {% for error in form_password.password2.errors %}
            {{error}}
          {% endfor %}

        <button type="submit" class="btn btn-default">Submit</button>
      </form>

{% endblock %}


text:
require 'rexml/document'
require File.expand_path('../../../../spec_helper', __FILE__)

describe "REXML::Element#text" do
  before :each do
    @e = REXML::Element.new "name"
    @e.text = "John"
  end

  it "returns the text node of element" do
    @e.text.should == "John"
  end

  it "returns the text node value" do
    t = REXML::Text.new "Joe"
    @e.text = t
    @e.text.should == "Joe"
    @e.text.should_not == t
  end

  it "returns nil if no text is attached" do
    elem = REXML::Element.new "name"
    elem.text.should == nil
  end
end

describe "REXML::Element#text=" do
  before :each do
    @e = REXML::Element.new "name"
    @e.text = "John"
  end

  it "sets the text node" do
    @e.to_s.should == "<name>John</name>"
  end

  it "replaces existing text" do
    @e.text = "Joe"
    @e.to_s.should == "<name>Joe</name>"
  end

  it "receives nil as an argument" do
    @e.text = nil
    @e.to_s.should == "<name/>"
  end
end


text:
<form ng-submit="getAdminProject(adminProjectId)">
  MapProject Id: <input type="text" id="mapadminProjectId"
    ng-model="adminProjectId">
  <button type="submit" class="btn btn-xs btn-primary">Retrieve</button>

</form>

{{errorMsg}}

  <button class="btn btn-xs btn-primary" ng-click="copyAdminProject()">Copy</button>
  <button ng-show="editingPerformed == true" class="btn btn-xs btn-primary"
    ng-click="updateAdminProject()">Update</button>

Unsaved Changes

{{successMsg}}

  <button class="btn btn-xs btn-danger pull-right"
    ng-click="deleteAdminProject()">Delete Project {{adminProject.id}}</button>

            Name

          <textarea style="width: 33%" ng-change="setEditingPerformed()"
            ng-model="adminProject.name"></textarea>

            Source Terminology666

          <textarea style="width: 33%" ng-change="setEditingPerformed()"
            ng-model="adminProject.sourceTerminology"></textarea>
          ,
          <textarea style="width: 33%"
            ng-model="adminProject.sourceTerminologyVersion"></textarea>

            Destination Terminology

          <textarea style="width: 33%" ng-change="setEditingPerformed()"
            ng-model="adminProject.destinationTerminology"></textarea>
          ,
          <textarea style="width: 33%" ng-change="setEditingPerformed()"
            ng-model="adminProject.destinationTerminologyVersion"></textarea>

            Ref Set

          <textarea style="width: 33%" ng-change="setEditingPerformed()"
            ng-model="adminProject.refSetName"></textarea>
          ,
          <textarea style="width: 33%"
            ng-change="checkRefSetId();setEditingPerformed()"
            ng-model="adminProject.refSetId"></textarea>

Duplicate Ref Set Id!

You
            must specify a Ref Set Id

            Published

          <select ng-model="adminProject.published"
            ng-change="setEditingPerformed()"
            ng-options="item for item in [true, false]">
          </select>

            Group Structure

          <select ng-model="adminProject.groupStructure"
            ng-change="setEditingPerformed()"
            ng-options="item for item in [true, false]"></select>

            Rule Based

          <select ng-model="adminProject.ruleBased"
            ng-change="setEditingPerformed()"
            ng-options="item for item in [true, false]">
          </select>

            Relation Style

          <textarea ng-change="setEditingPerformed()" style="width: 33%"
            ng-model="adminProject.mapRelationStyle"></textarea>

            Map Type

          <textarea ng-change="setEditingPerformed()" style="width: 33%"
            ng-model="adminProject.mapRefsetPattern"></textarea>

            Workflow Type

          <textarea ng-change="setEditingPerformed()" style="width: 33%"
            ng-model="adminProject.workflowType"></textarea>

{{adminProject}}


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

   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 name="common-standard" xmlns:s="antlib:org.springframework.build">

	<import file="../common/common.xml"/>

<!-- Macros -->
	<macrodef name="do-compile">
		<attribute name="classpath.id"/>
		<attribute name="input.dir"/>
		<attribute name="output.dir"/>
		<attribute name="resources.dir"/>
		<sequential>
			<s:javac destdir="@{output.dir}" source="${source.version}" target="${target.version}"
					debug="${compile.debug}" debugLevel="${compile.debug.level}">
				<compilerarg line="${compiler.args}"/>
				<src path="@{input.dir}"/>
				<include name="**/*.java"/>
				<include name="*.java"/>
				<classpath refid="@{classpath.id}"/>
			</s:javac>
			<copy todir="@{output.dir}">
				<fileset dir="@{input.dir}" erroronmissingdir="false">
					<exclude name="**/*.java"/>
					<exclude name="*.java"/>
				</fileset>
			</copy>
			<copy todir="@{output.dir}">
				<fileset dir="@{resources.dir}" erroronmissingdir="false"/>
			</copy>
		</sequential>
	</macrodef>

</project>