text:
/* globals bufferpm, chrome, safari */

// Put together a query string for the iframe
var buildSrc = function(data, config) {

  var src = data.local ?
    config.overlay.localendpoint :
    config.overlay.endpoint;

  var qs = '';

  config.attributes.forEach(function(attr, i){
    if ( !data[ attr.name ] ) return;
    if ( qs.length ) qs += '&';
    qs += attr.name + '=' + attr.encode( data[attr.name] );
  });

  if (qs.length) src += '?' + qs;

  return src;
};

var openPopUp = function(src, port, doneCallback, isSmallPopup) {

  // Open popups from privileged code
  port.emit('buffer_open_popup', { src: src, isSmallPopup: isSmallPopup });

  // Bind close listener
  // Listen for when the overlay has closed itself
  bufferpm.bind("buffermessage", function(overlaydata) {
    bufferpm.unbind("buffermessage");
    setTimeout(function () {
      doneCallback(overlaydata);
    }, 0);
    window.focus();
  });
};

var shouldOpenSmallPopupForUrl = function(url) {
  var hostname = window.location.hostname;
  var pathname = window.location.pathname;

  var isTwitterIntent = /twitter.com$/.test(hostname) && /^\/intent/.test(pathname);

  if (isTwitterIntent) return true;
  else return false;
}

// Build that overlay!
// Triggered by code working from the button up
var bufferOverlay = function(data, config, port, doneCallback) {

  if( ! doneCallback ) doneCallback = function () {};
  if( ! config ) return;

  portCache.grabPort(port);

  var src = buildSrc(data, config);
  var domain = window.location.hostname;

  if (shouldOpenSmallPopupForUrl(window.location.href)) {
    openPopUp(src, port, doneCallback, true);
    return;
  }

  if (xt.options['buffer.op.tpc-disabled'] || xt.options['buffer.op.open-as'] === 'new-tab') {
    openPopUp(src, port, doneCallback);
    return;
  }

  var shouldContinue = ensureOnlyOneOverlayOpen(data, closePopup.bind(window, document, doneCallback));
  if (!shouldContinue) return;

  port.emit('buffer_overlay_open');

  // Create the iframe and add the footer:
  var iframe = document.createElement('iframe');

  iframe.allowtransparency = 'true';
  iframe.scrolling = 'no';
  iframe.id = 'buffer_overlay';
  iframe.name = 'buffer_overlay';
  iframe.style.cssText = config.overlay.getCSS();
  iframe.src = xt.data.get('data/shared/buffer-frame-container.html');

  iframe.addEventListener('load', function() {
    iframe.contentWindow.postMessage({
      src: src,
      css: config.overlay.getCSS(true),
    }, '*');
  });

  var rightCnt = createBtnContainer('right');
  var upgradeButton = createUpgradeButton();
  var helpButton = createHelpButton();
  var dashboardButton = createDashboardButton();

  rightCnt.appendChild(upgradeButton);
  rightCnt.appendChild(helpButton);
  rightCnt.appendChild(dashboardButton);

  getExtensionUserData(function(userData) {
    upgradeButton.classList.toggle('hidden', !userData.shouldDisplayAwesomeCTA);

    // That feature has evolved a bit since it was first named: it's not about
    // hiding the button anymore, but redirecting to the FAQ instead of opening
    // up a contact window.
    if (!userData.shouldDisplayHelpButton) {
      helpButton.setAttribute('href', helpButton.getAttribute('data-faq-href'));
    }
  });

  var leftCnt = createBtnContainer('left');
  var cancelButton = createCancelButton();

  leftCnt.appendChild(cancelButton);

  document.body.appendChild(iframe);
  document.body.appendChild(rightCnt);
  document.body.appendChild(leftCnt);

  $(document).on('click', '.buffer-btn-cancel', function() {
      closePopup(document, doneCallback);
  });

  // Bind close listener
  // Listen for when the overlay has closed itself
  bufferpm.bind('buffermessage', function(overlaydata) {
      closePopup(document, doneCallback, overlaydata);
  });

  /**
   * Listen to ESC key and close the popup when hit.
   */
  $(document).on('keyup.bufferOverlay', function(e) {
    if (e.keyCode == 27) {
      // When an overlay instance is hidden (but still open), don't let shortcuts close it
      if (!ensureOnlyOneOverlayOpen.isOverlayVisible()) return;

      closePopup(document, doneCallback);
    }
  });

  // Remove the loading image when we hear from the other side
  bufferpm.bind('buffer_loaded', function(data) {
    // Send user data to background script for caching
    if (data && data.userData) port.emit('buffer_user_data', data.userData);

    bufferpm.unbind('buffer_loaded');
    iframe.style.cssText += 'background-image: none !important';

    $(".buffer-btn-cancel").remove();
  });
};

// Returns true if a new overlay should be open, false if we've toggled the visibility of
// and existing overlay instead.
function ensureOnlyOneOverlayOpen(data, closePopup) {
  // State can't be saved in this script, since it gets re-executed multiple times by some browsers
  // (e.g. Firefox), so we rely on the DOM instead.
  var isOverlayOpen = function() { return !!$('#buffer_overlay').length };

  // If the open intent comes from the Buffer toolbar button or a keyboard shortcut, toggle the
  // visibility of the overlay if it's already open, otherwise allow a new one to be open.
  if (data.placement == 'toolbar' || data.placement == 'hotkey') {
    if (!isOverlayOpen()) return true;

    $('#buffer_overlay, .buffer-btn-container').toggle();
    return false;
  }

  // If the open intent comes from somewhere else, discard any hidden overlay and open a new one
  closePopup();

  return true;
};

ensureOnlyOneOverlayOpen.isOverlayVisible = function() { return $('#buffer_overlay').is(':visible') };

function closePopup(document, doneCallback, overlayData) {
    $('#buffer_overlay, .buffer-btn-container').remove();

    bufferpm.unbind('buffermessage');
    bufferpm.unbind('buffer_addbutton');

    $(document).off('keyup.bufferOverlay');

    setTimeout(function () {
      doneCallback(overlayData);
    }, 0);

    window.focus();
}

// position = 'left' || 'right'
var createBtnContainer = function(position) {
  var container = document.createElement('div');
  container.setAttribute('class', 'buffer-btn-container buffer-btn-container-' + position);

  return container;
};

var createHelpButton = function() {
  var contactHref = 'https://buffer.com/app#contact-from-extension';
  var faqHref = 'https://support.buffer.com/hc/en-us/articles/360039028273-Installing-and-using-the-Buffer-Browser-Extension';

  var button = document.createElement('a');
  button.href = contactHref;
  button.target = '_blank';
  button.setAttribute('data-faq-href', faqHref);
  button.setAttribute('class', 'buffer-btn-help');

  var icon = document.createElement('span');
  icon.classList.add('icon');
  var iconUrl = xt.data.get('data/shared/img/buffer-help-button-icon@2x.png');
  icon.style.cssText = 'background-image: url(' + iconUrl + ') !important;';
  button.appendChild(icon);

  var text = document.createTextNode('Help');
  button.appendChild(text);

  button.addEventListener('click', function() {
    _bmq.trackAction(['overlay', 'help_button'], {
      button_action: button.href === contactHref ? 'contact' : 'faq',
    });
  }, false);

  return button;
};

var createDashboardButton = function() {
  var button = document.createElement('a');
  button.href = 'https://buffer.com/app';
  button.target = '_blank';
  button.setAttribute('class', 'buffer-btn-dashboard');

  var text = document.createTextNode('Go to Buffer');
  button.appendChild(text);

  button.addEventListener('click', function() {
    _bmq.trackAction(['overlay', 'go_to_buffer_button']);
  }, false);

  return button;
};

var createCancelButton = function() {

  var button = document.createElement('button');
  button.setAttribute('class', 'buffer-btn-cancel');

  var text = document.createTextNode('Cancel');
  button.appendChild(text);

  return button;
};

var createUpgradeButton = function() {
  var button = document.createElement('a');
  button.href = 'https://buffer.com/awesome?utm_campaign=extensions_header&utm_medium=web';
  button.target = '_blank';
  button.setAttribute('class', 'buffer-btn-upgrade hidden');

  var icon = document.createElement('span');
  icon.classList.add('icon');
  var iconUrl = xt.data.get('data/shared/img/buffer-awesome-button-icon@2x.png');
  icon.style.cssText = 'background-image: url(' + iconUrl + ') !important;';
  button.appendChild(icon);

  var text = document.createTextNode('Upgrade to Awesome');
  button.appendChild(text);

  button.addEventListener('click', function() {
    _bmq.trackAction(['overlay', 'upgrade_to_awesome_button']);
  }, false);

  return button;
};

// getOverlayConfig returns the configuration object for use by bufferOverlay
var getOverlayConfig = function(postData){

  var config = {};

  // Set this to true for using a local server while testing
  config.local = false;

  var segments = window.location.pathname.split('/');

  config.pocketWeb = ( window.location.host.indexOf('getpocket') !== -1 && segments[2] === 'read' );
  config.isYoutubeVideo = ( window.location.host.indexOf('.youtube.com') !== -1 && segments[1] === 'watch' );
  config.isImgur = ( window.location.host.indexOf('imgur.com') !== -1 && segments[1] === 'gallery' );

  // Specification for gathering data for the overlay
  config.attributes = [
    {
      name: "url",
      get: function (cb) {
        if(config.pocketWeb){
          var li = document.getElementsByClassName('original')[0];
          var link = li.getElementsByTagName('a')[0].href;
          cb(link);
        }
        else{
          cb(window.location.href);
        }
      },
      encode: function (val) {
        return encodeURIComponent(val);
      }
    },
    {
      name: "text",
      get: function (cb) {
        var selectedText = document.getSelection().toString();
        var quoteChars;

        if (selectedText) {
          // If quotes surround the selected text, strip them away
          quoteChars = ['"', '"', '"', '\'', ''', ''', '«', '»'];
          if (quoteChars.indexOf(selectedText[0]) != -1 && quoteChars.indexOf(selectedText[selectedText.length - 1]) != -1) {
            selectedText = selectedText.slice(1, selectedText.length - 1);
          }

          return cb('"' + selectedText + '"');
        }

        if (config.pocketWeb){
          var headline = document.querySelectorAll('.reader_head h1')[0];
          var title = headline && headline.textContent;
          return cb(title);
        }

        // In some situations (e.g. YT's autoplay feature), the page is updated via xhr, the
        // title attribute too, but not the og:title meta tag: default to retrieving the title
        // of the page from the title attr for YouTube videos, and format it a bit
        if (config.isYoutubeVideo) {
          var title = document.title.replace('- YouTube', '');
          return cb(title);
        }

        // Similarly to YouTube above, in some situations (e.g. navigating from one picture to
        // another), the page is updated via xhr, the title attribute too, but not the
        // og:title meta tag: let's default to retrieving the title of the page from the title attr
        // for YouTube videos, and format it a bit
        if (config.isImgur) {
          var title = document.title.replace('- Imgur', '');
          return cb(title);
        }

        var ogTitle = document.head && document.head.querySelector('meta[property="og:title"]');
        if (ogTitle && ogTitle.content && ogTitle.content.length) {
          return cb(ogTitle.content);
        }

        cb(document.title);
      },
      encode: function (val) {
        return encodeURIComponent(val);
      }
    },
    {
      name: "retweeted_tweet_id",
      get: function (cb) {
        cb(postData.retweeted_tweet_id);
      },
      encode: function (val) {
        return encodeURIComponent(val);
      }
    },
    {
      name: "retweeted_user_id",
      get: function (cb) {
        cb(postData.retweeted_user_id);
      },
      encode: function (val) {
        return encodeURIComponent(val);
      }
    },
    {
      name: "retweeted_user_name",
      get: function (cb) {
        cb(postData.retweeted_user_name);
      },
      encode: function (val) {
        return encodeURIComponent(val);
      }
    },
    {
      name: "retweeted_user_display_name",
      get: function (cb) {
        cb(postData.retweeted_user_display_name);
      },
      encode: function (val) {
        return encodeURIComponent(val);
      }
    },
    {
      name: "retweet_comment",
      get: function (cb) {
        cb(postData.retweet_comment);
      },
      encode: function (val) {
        return encodeURIComponent(val);
      }
    },
    {
      name: "picture",
      get: function (cb) {
        cb(postData.image);
      },
      encode: function (val) {
        return encodeURIComponent(val);
      }
    },
    {
      name: "embed",
      get: function (cb) {
        cb(postData.embed);
      },
      encode: function (val) {
        return encodeURIComponent(val);
      }
    },
    {
      name: "local",
      get: function (cb) {
        cb(config.local);
      },
      encode: function (val) {
        return encodeURIComponent(val);
      }
    },
    {
      name: "version",
      get: function (cb) {
        cb(postData.version);
      },
      encode: function (val) {
        return encodeURIComponent(val);
      }
    },
    {
      name: "placement",
      get: function (cb) {
        if( postData.placement ) cb(postData.placement);
        else cb('general');
      },
      encode: function (val) {
        return encodeURIComponent(val);
      }
    },
    {
      name: "disable-telemetry",
      get: function (cb) {
        cb(postData['disable-telemetry']);
      },
      encode: function (val) {
        return encodeURIComponent(val);
      }
    }
  ];

  var loadingImg = xt.data.get('data/shared/img/black-loading-gif-small.gif');
  config.overlay = {
    endpoint: "https://buffer.com/add/",
    localendpoint: "https://local.buffer.com/add/",
    getCSS: function (forDeepestFrame) {
      return [
        'border: none !important;',
        'height: 100% !important;',
        'width: 100% !important;',
        forDeepestFrame ? '' : 'position: fixed !important;',
        'z-index: 999999999999 !important;',
        'top:0 !important;',
        'left:0 !important;',
        'display: block !important;',
        'max-width: 100% !important;',
        'max-height: 100% !important;',
        'padding: 0 !important;',
        forDeepestFrame ? '' : 'background: rgba(245, 245, 245, 0.74) url(' + loadingImg +') no-repeat center center !important;',
        forDeepestFrame ? '' : 'background-size: 40px !important;'
      ].join('');
    }
  };

  return config;
};

// Method for handling the async firing of the cb
var executeAfter = function(done, count, args, cb) {
  if(done === count) {
    setTimeout(function(){
      cb.apply( null, args );
    }, 0);
  }
};

// Asynchronously gather data about the page and from embedded sources,
// like Twitter or Facebook. Currently the async is a bit over the top,
// and not used, but if we need async down the line, it's there.
var getData = function (postData, cb) {
  var config = getOverlayConfig( postData );
  var count = config.attributes.length;
  var done = 0;
  var data = {};

  config.attributes.forEach(function(attr, i){
    attr.get(function(d){
      done += 1;
      data[ attr.name ] = d;
      executeAfter(done, count, [ data, config ], cb);
    });
  });
};

// bufferData is triggered by the buffer_click listener in
// the buffer-browser-embed file, where it's passed a port
// to communicate with the extension and data sent from the
// background page.
var bufferData = function (port, postData) {

  if (window.top !== window) return;

  // Transform the data somewhat, and then create an overlay.
  // When it's done, fire buffer_done back to the extension
  var createOverlay = function (data, config) {
    if( data.embed ) {
      if( typeof data.embed === "object" ) {
        for( var i in data.embed ) {
          if( data.embed.hasOwnProperty(i) ) {
            data[i] = data.embed[i];
          }
        }
        if( data.embed.text && !data.embed.url ) {
          data.url = null;
        }
        data.embed = null;
      } else {
        data.text = data.embed;
        data.url = null;
        data.embed = null;
      }
    }
    bufferOverlay(data, config, port, function (overlaydata) {
      port.emit("buffer_done", overlaydata);
    });
  };

  // It all starts here.
  // createOverlay is the callback that should fire after getData has
  // gathered all the necessaries
  getData(postData, createOverlay);
};

// Cache for the port to avoid passing it around in function calls
var portCache = (function() {
  var _port;

  var exposed = {
    // Executed at the very beginning of bufferOverlay()'s execution to
    // update the cached port
    grabPort: function(port) {
      _port = port;
    },

    getPort: function() { return _port }
  };

  return exposed;
})();

// _bmq exposes the same API here as it does in background scripts, but
// here it only takes care of passing this data to the background script's
// _bmq where it will be effectively taken care of.
var _bmq = (function() {
  var _availableMethods = ['push', 'trackAction'];

  var _passForward = function(methodName) {
    var payload = {
      methodName: methodName,
      args: Array.prototype.slice.call(arguments, 1)
    };

    portCache.getPort().emit('buffer_tracking', payload);
  };

  var exposed = {};

  // Expose all _availableMethods
  _availableMethods.forEach(function(methodName) {
    exposed[methodName] = _passForward.bind(null, methodName);
  });

  return exposed;
}());

// Get some user data asynchronously; the callback will be run once immediately if such data has already
// been cached by the background script, and once shortly after displaying the overlay when the cache
// has been refreshed from the user data in the iframe
getExtensionUserData = function(cb) {
  portCache.getPort().on('buffer_user_data', cb);
};

// On buffer.com/add, listen to messages coming from the page straight away: don't
// wait for the overlay being open, since we're already on the share dialog's new tab.
var isBufferShareTab = (
  document.location.href.indexOf('https://buffer.com/add') === 0 ||
  document.location.href.indexOf('https://local.buffer.com/add') === 0
);

if (isBufferShareTab) {
  bufferpm.bind('buffermessage', function() {
    // Close popup from privileged code
    if (window.chrome) chrome.runtime.sendMessage({ type: 'buffer_close_popup' });
  });
}


text:
package eu.ddmore.publish.service;

/**
 * Created by IntelliJ IDEA.
 *
 * @author Sarala Wimalaratne
 *         Date: 15/02/2016
 *         Time: 10:51
 */
public interface PublishValidator {
    Scenario validatePublish(PublishInfo publishInfo);
    PublishContext generatePublishContext(Scenario scenario);
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest package="org.softeg.slartus.forpdaplus.core">

</manifest>


text:
//
//  BarViewController.h
//  M13ProgressView
//

#import <UIKit/UIKit.h>

#import "M13ProgressViewBar.h"

@interface M13BarViewController : UIViewController

@property (nonatomic, retain) IBOutlet M13ProgressViewBar *progressViewVertical;
@property (nonatomic, retain) IBOutlet M13ProgressViewBar *progressViewHorizontal;
@property (nonatomic, retain) IBOutlet UISlider *progressSlider;
@property (nonatomic, retain) IBOutlet UIButton *animateButton;
@property (nonatomic, retain) IBOutlet UISegmentedControl *iconControl;
@property (nonatomic, retain) IBOutlet UISwitch *indeterminateSwitch;
@property (nonatomic, retain) IBOutlet UISwitch *showPercentageSwitch;
@property (nonatomic, retain) IBOutlet UISegmentedControl *positionControl;
@property (nonatomic, retain) IBOutlet UISegmentedControl *directionControl;

- (IBAction)animateProgress:(id)sender;
- (IBAction)progressChanged:(id)sender;
- (IBAction)iconChanged:(id)sender;
- (IBAction)indeterminateChanged:(id)sender;
- (IBAction)showPercentage:(id)sender;
- (IBAction)percentagePositionChangeed:(id)sender;
- (IBAction)directioChanged:(id)sender;
@end


text:
from django.contrib import admin

from .models import EvaluationModel3D, Model3D

# Register your models here.

class AdminMixin:

    def get_fields(self, request, obj=None):
        """
        Use to move 'is_active' field to last position
        :param request:
        :param obj:
        :return:
        """
        fields = super().get_fields(request, obj)
        fields = [field for field in fields if field != 'is_active']
        fields.append('is_active')
        return fields

class EvaluationModel3DInline(AdminMixin, admin.StackedInline):
    model = EvaluationModel3D
    extra = 1

@admin.register(Model3D)
class Model3DAdmin(AdminMixin, admin.ModelAdmin):
    list_display = ('name', 'view_counter', 'created', 'updated')
    list_filter = ('created', 'updated')
    inlines = [EvaluationModel3DInline]
    readonly_fields = ('view_counter', )


text:
package org.apache.derbyTesting.functionTests.tests.store;

import java.sql.*;
import java.io.*;
import java.util.*;

/**
 *  Test that the two new encryption properties
 *	DATA_ENCRYPT_ALGORITHM_VERSION="data_encrypt_algorithm_version"
 *  LOG_ENCRYPT_ALGORITHM_VERSION="log_encrypt_algorithm_version"
 *	exist and verify the version. Note, these values start off with 1.
 */
public class Beetle6038  {

	public static void main(String[] args)
		throws Exception
	{
		String driver = "org.apache.derby.jdbc.EmbeddedDriver";
        Class<?> clazz = Class.forName(driver);
        clazz.getConstructor().newInstance();
		String dburl = "jdbc:derby:Beetle6038Db;create=true;dataEncryption=true;bootPassword=Thursday;encryptionAlgorithm=DES/CBC/NoPadding";

		Connection conn = DriverManager.getConnection(dburl);
		conn.close();
		conn = DriverManager.getConnection(dburl);
		conn.close();

		// read in the properties in the service.properties file of the db
		Properties serviceProperties = new Properties();
		String systemhome =  System.getProperty("derby.system.home");
		File f = new File(systemhome + File.separatorChar + "Beetle6038Db" + File.separatorChar + "service.properties");
		serviceProperties.load(new FileInputStream(f.getCanonicalPath()));

		// check if the properties are set
		checkProperty("data_encrypt_algorithm_version",serviceProperties);
		checkProperty("log_encrypt_algorithm_version",serviceProperties);
	}

	public static void checkProperty(String name,Properties props)
	{
		String value = props.getProperty(name);

		if( value == null )
			System.out.println("Test failed!! - "+name + " not set in service.properties as expected");
		else
			System.out.println(name+"="+value);
	}

}


text:
echo 'Installing Oracle JDK'

#install Oracle jdk 1.7
bash -c 'echo "deb http://cran.rstudio.com/bin/linux/debian lenny-cran/" >> /etc/apt/sources.list'
apt-get update
apt-get install -y java-package
wget -q --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u71-b14/jdk-7u71-linux-x64.tar.gz
echo y | su ${SUDO_USER} -c 'make-jpkg jdk-7u71-linux-x64.tar.gz'
dpkg -i oracle-j2sdk1.7_1.7.0+update71_amd64.deb


text:
@interface MYTableViewLoadingItemCell : MYTableViewCell

@property (strong, readwrite, nonatomic) MYTableViewLoadingItem *tableViewItem;

@end


text:
:: Helpful tools
:: Chocolatey install

choco install -y 7zip
choco install -y atom
choco install -y docker
choco install -y f.lux
choco install -y filezilla
choco install -y keepass
choco install -y putty
choco install -y sysinternals
choco install -y sourcecodepro
choco install -y virtualbox
choco install -y virtualbox.extensionpack
choco install -y virtuawin :: virtual desktops
choco install -y vlc
choco install -y winmerge
choco install -y wox :: launcher
choco install -y wireshark

:: Command line tools
choco install -y cmder.portable :: better command prompt
choco install -y curl
choco install -y wincommandpaste :: bind crtl-v to paste in various command prompts


text:
<?php
class Kwc_Basic_DownloadTag_Trl_Component extends Kwc_Basic_LinkTag_Abstract_Trl_Component
    implements Kwf_Media_Output_IsValidInterface
{
    public static function getSettings($masterComponentClass = null)
    {
        $ret = parent::getSettings($masterComponentClass);
        $ret['generators']['download'] = array(
            'class' => 'Kwf_Component_Generator_Static',
            'component' => $masterComponentClass
        );
        $ret['throwContentChangedOnOwnMasterModelUpdate'] = true;
        $ret['ownModel'] = 'Kwf_Component_FieldModel';
        $ret['dataClass'] = 'Kwc_Basic_DownloadTag_Trl_Data';
        return $ret;
    }

    public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer)
    {
        $ret = parent::getTemplateVars($renderer);
        $ret['url'] = $this->getDownloadUrl();
        return $ret;
    }

    public function getDownloadUrl()
    {
        return $this->getData()->url;
    }

    public function getFilesize()
    {
        $fRow = $this->getFileRow()->getParentRow('File');
        if (!$fRow) return null;
        return $fRow->getFileSize();
    }

    public function getFileRow()
    {
        if ($this->getRow()->own_download) {
            return $this->getData()->getChildComponent('-download')->getComponent()->getFileRow();
        } else {
            return $this->getData()->chained->getComponent()->getFileRow();
        }
    }

    public static function isValidMediaOutput($id, $type, $className)
    {
        return Kwf_Media_Output_Component::isValid($id);
    }

    public static function getMediaOutput($id, $type, $className)
    {
        $c = Kwf_Component_Data_Root::getInstance()->getComponentById($id, array('ignoreVisible'=>true));
        $cls = $c->chained->componentClass;
        $cls = strpos($cls, '.') ? substr($cls, 0, strpos($cls, '.')) : $cls;
        return call_user_func(array($cls, 'getMediaOutput'), $c->chained->componentId, $type, $c->chained->componentClass);
    }
}


text:
package syntaxtree;

public class ASTNode {
  protected int _line;
  protected int _column;

  public ASTNode(int line, int col) {
    _line = line;
    _column = col;
  }

  public int getLine() { return _line; }
  public int getColumn() { return _column; }

  public void setLine(int line)
  {
    _line = line;
  }

  public void setColumn(int column)
  {
    _column = column;
  }
}


text:
package com.formkiq.forms.dto;

import java.io.Serializable;

/**
 * Workflow Output Form Field.
 *
 */
public class WorkflowOutputFormField implements Serializable {

    /** serialVersionUID. */
    private static final long serialVersionUID = -5500529006718496281L;

    /** Form. */
    private String form;

    /** Field. */
    private String field;

    /** Document Field Name. */
    private String documentfieldname;

    /**
     * default constructor.
     */
    public WorkflowOutputFormField() {
    }

    /**
     * @return {@link String}
     */
    public String getForm() {
        return this.form;
    }

    /**
     * @param formname {@link String}
     */
    public void setForm(final String formname) {
        this.form = formname;
    }

    /**
     * @return {@link String}
     */
    public String getField() {
        return this.field;
    }

    /**
     * @param fieldname {@link String}
     */
    public void setField(final String fieldname) {
        this.field = fieldname;
    }

    /**
     * @return {@link String}
     */
    public String getDocumentfieldname() {
        return this.documentfieldname;
    }

    /**
     * @param fieldname {@link String}
     */
    public void setDocumentfieldname(final String fieldname) {
        this.documentfieldname = fieldname;
    }
}


text:
.class public interface abstract Lcom/google/android/gms/internal/zzfn;
.super Ljava/lang/Object;

# virtual methods
.method public abstract clearToken(Landroid/content/Context;Ljava/lang/String;)V
.end method

.method public abstract zzc(Landroid/content/Context;Ljava/lang/String;)Ljava/lang/String;
.end method


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Buellia disciformis var. saxicola H. Olivier

### Remarks
null


text:
function [measOptions] = sensorSet_flow_upstream(Wp)
measOptions.P.enabled      = false;  % Boolean for using power measurements
% measOptions.P.turbIds      = [1 2]; % Turbine ids from which measurements are taken
% measOptions.P.noiseStd     = 2e4;   % Standard deviation noise added to measurement
% measOptions.P.measStd      = 2e4;   % Standard deviation assumed by KF

delta_x = -1*Wp.turbine.Drotor;
nPoints = 4; % number of point measurements span-wise per turbine

measOptions.U.enabled    = true; % Boolean for using flow measurements
measOptions.U.locations = [];
for i = 1:length(Wp.turbine.Crx)
    for y = Wp.turbine.Cry(i)+Wp.turbine.Drotor*linspace(-0.5,0.5,5)
        measOptions.U.locations = [measOptions.U.locations; Wp.turbine.Crx(i)+delta_x, y];
    end
end
measOptions.U.noiseStd   = 1e-1; % Standard deviation noise added to measurement
measOptions.U.measStd    = 1e-1; % Standard deviation assumed by KF
end


text:
package bl.beans;

import org.mongodb.morphia.annotations.Entity;

/**
 * Created by pli on 14-6-28.
 */
@Entity(value = "study_document_entry")
public class StudyDocumentEntryBean extends Bean {
    private String studyDocumentId;//指向study_document表的主键
    private String studyId;
    private String documentId;
    private String entryId; //指向entry表的主键

    public String getStudyDocumentId() {
        return studyDocumentId;
    }

    public void setStudyDocumentId(String studyDocumentId) {
        this.studyDocumentId = studyDocumentId;
    }

    public String getEntryId() {
        return entryId;
    }

    public void setEntryId(String entryId) {
        this.entryId = entryId;
    }

    public String getStudyId() {
        return studyId;
    }

    public void setStudyId(String studyId) {
        this.studyId = studyId;
    }

    public String getDocumentId() {
        return documentId;
    }

    public void setDocumentId(String documentId) {
        this.documentId = documentId;
    }
}


text:
package antlr;

/* ANTLR Translator Generator
 * Project led by Terence Parr at http://www.jGuru.com
 * Software rights: http://www.antlr.org/license.html
 *
 * $Id: //depot/code/org.antlr/release/antlr-2.7.5/antlr/CharLiteralElement.java#1 $
 */

class CharLiteralElement extends GrammarAtom {

    public CharLiteralElement(LexerGrammar g, Token t, boolean inverted, int autoGenType) {
        super(g, t, AUTO_GEN_NONE);
        tokenType = ANTLRLexer.tokenTypeForCharLiteral(t.getText());
        g.charVocabulary.add(tokenType);
        line = t.getLine();
        not = inverted;
        this.autoGenType = autoGenType;
    }

    public void generate() {
        grammar.generator.gen(this);
    }

    public Lookahead look(int k) {
        return grammar.theLLkAnalyzer.look(k, this);
    }
}


text:
using System;
using Newtonsoft.Json;

namespace Nest
{
	internal class ReserializeJsonConverter<TReadAs, TInterface> : JsonConverter
		where TReadAs : class, TInterface
		where TInterface : class
	{
		protected ReadAsTypeJsonConverter<TReadAs> Reader { get; } = new ReadAsTypeJsonConverter<TReadAs>();

		public override bool CanRead => true;

		public override bool CanWrite => true;

		public override bool CanConvert(Type objectType) => typeof(TInterface).IsAssignableFrom(objectType);

		public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
		{
			if (reader.TokenType != JsonToken.StartObject) return null;
			var depth = reader.Depth;
			var deserialized = this.DeserializeJson(reader, objectType, existingValue, serializer);
			return reader.ReadToEnd(depth, deserialized);
		}

		protected TReadAs ReadAs(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) =>
			this.Reader.ReadJson(reader, objectType, existingValue, serializer) as TReadAs;

		protected virtual object DeserializeJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) =>
			this.ReadAs(reader, objectType, existingValue, serializer);

		public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
		{
			var v = value as TInterface;
			if (v == null) return;
			this.SerializeJson(writer, value, v, serializer);
		}

		protected virtual void SerializeJson(JsonWriter writer, object value, TInterface castValue, JsonSerializer serializer)
		{
			this.Reserialize(writer, value, serializer);
		}

		protected void Reserialize(JsonWriter writer, object value, JsonSerializer serializer, Action<JsonWriter> inlineWriter = null)
		{
			var properties = value.GetType().GetCachedObjectProperties();
			if (properties.Count == 0) return;
			writer.WriteStartObject();
			inlineWriter?.Invoke(writer);
			foreach (var p in properties)
			{
				if (p.Ignored) continue;
				var vv = p.ValueProvider.GetValue(value);
				if (vv == null) continue;
				writer.WritePropertyName(p.PropertyName);
				serializer.Serialize(writer, vv);
			}
			writer.WriteEndObject();
		}
	}
}


text:
var ARCHIVE_ID = '3.15532...';

var utils = request.getAttribute('sitevision.utils');
var linkRenderer = utils.getLinkRenderer();
var scriptUtil = utils.getScriptUtil();
var jcrSession = request.getAttribute('sitevision.jcr.session');
var propertyUtil = utils.getPropertyUtil();
var ctxUtil = utils.getPortletContextUtil();

var archive = jcrSession.getNodeByIdentifier(ARCHIVE_ID).getNodes();

// Get article of current page
var currentPage = ctxUtil.getCurrentPage();

if(currentPage.hasProperty('jcr:uuid')) {

    // Get current article id
    var currentArchiveId = currentPage.getProperty('jcr:uuid').string;

    // Initiate a iterate counter
    var index = 0;

    // Iterate over archive
    while(archive.hasNext()) {

        var last;

        if(archive.hasNext()) {

            index++;

            var current = archive.next();

            // Check if we are on current article by comparing Id:s
            if(current.getProperty('jcr:uuid').string === currentArchiveId) {

                // Get next article if has next
                if(archive.hasNext()) {
                    var nextArticle = archive.next();
                } else {
                    var nextArticle = null;
                }
                // Get previous article if index is more than 1
                if(index > 1) {
                    var previousArticle = last;
                } else {
                    var previousArticle = null;
                }

            } else {
                // Else store current to last and move on
                last = current;
            }

        }

    }

}


text:
import React, { Component } from 'react'
import { Textfield, Button, Snackbar } from 'react-mdl';
import { Link } from 'react-router-dom'
import { auth , saveUser } from '../helpers/auth'
import ChooseAvatar from './ChooseAvatar'

export default class Register extends Component {
  state = {
    email: '',
    password: '',
    name:'',
    avatar:'none',
    isSnackbarActive:false,
    snackBarMsg:''
  }
  handleChange = (e) => {
    this.setState({[e.target.name]: e.target.value});
  }
  handleAvatarChange = (avatar) => {
    this.setState({avatar: avatar});
  }
  handleSubmit = (e) => {
    e.preventDefault()
    if (this.state.email && this.state.password && this.state.name && this.state.avatar) {
      auth(this.state.email, this.state.password)
        .then((user) => {
          user.name = this.state.name
          user.customAvatar = this.state.avatar
          saveUser(user)
        })
        .catch((error) => {
          this.setState({
            isSnackbarActive: true,
            snackBarMsg: error.message
          });
        })
    } else {
      this.setState({
            isSnackbarActive: true,
            snackBarMsg: "Fill in all the fields, ya lazy lump!"
      });
    }
  }
  handleTimeoutSnackbar = () => {
    this.setState({ isSnackbarActive: false });
  }
  render () {
    const { isSnackbarActive, snackBarMsg } = this.state;
    return (

REGISTER

          <form onSubmit={this.handleSubmit}>
          <Textfield
              value={this.state.email}
              name="email"
              onChange={this.handleChange}
              label="Email"
              type="email"
              floatingLabel
              style={{width: '300px', 'marginBottom':'20px'}}
          />
          <Textfield
              value={this.state.password}
              name="password"
              onChange={this.handleChange}
              label="Password"
              type="password"
              floatingLabel
              style={{width: '300px', 'marginBottom':'20px'}}
          />
          <Textfield
              value={this.state.name}
              name="name"
              onChange={this.handleChange}
              label="Display Name"
              type="text"
              floatingLabel
              style={{width: '300px', 'marginBottom':'20px'}}
          />
          <ChooseAvatar changeHandler={this.handleAvatarChange} />
          <Button type="submit" raised accent ripple>Register</Button>

<Link to="/login" className="navbar-brand">Login</Link>

          </form>

        <Snackbar
          active={isSnackbarActive}
          onClick={this.handleClickActionSnackbar}
          onTimeout={this.handleTimeoutSnackbar}>{snackBarMsg}</Snackbar>

    )
  }
}


text:
package pt.up.fc.dcc.mousetrap.models;

import android.content.Context;
import android.content.SharedPreferences;

import com.google.gson.Gson;

/**
 * Class to be extended by object that can be stored in preferences
 *
 * @author josepaiva
 */
public class ModelStore {
    private static final String PREFS_NAME = ModelStore.class.getName();

    private static SharedPreferences settings;
    private static SharedPreferences.Editor editor;

    private static ModelStore modelStore;
    private Gson gson;

    private ModelStore(Context context) {

        if(settings == null){
            settings = context.getSharedPreferences(PREFS_NAME,
                    Context.MODE_PRIVATE);
        }

        editor = settings.edit();

        gson = new Gson();
    }

    public static ModelStore getInstance(Context context) {
        if (modelStore == null)
            modelStore = new ModelStore(context);
        return modelStore;
    }

    public void store(Storable s) {
        String id = s.getStoreId();
        String json = s.getJson();
        editor.putString(id, json);
        editor.commit();
    }

    public <T extends Storable> T retrieve(String id, T dflt) {
        String json = settings.getString(id, null);

        if (json == null)
            return dflt;

        return (T) gson.fromJson(json, dflt.getClass());
    }
}


text:
namespace views {

// Return the RadioButton image for given state.
// It returns the "selected" image when |selected| is
// true, or the "unselected" image if false.
// The returned image is global object and should not be freed.
const SkBitmap* GetRadioButtonImage(bool selected);

// Returns the image for submenu arrow for current RTL setting.
const SkBitmap* GetSubmenuArrowImage();

} // namespace views

#endif  // VIEWS_CONTROLS_MENU_MENU_IMAGE_UTIL_GTK_H_


text:
/* #LAST_VIEW_OBJECT */
/* #UPDATED */
package org.test.shop.model.domain.entity.view;

// Generated 30.08.2015 21:00:08 by Hibernate Tools 4.3.1

import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.voodoodyne.jackson.jsog.JSOGGenerator;

import javax.persistence.Table;
import javax.persistence.Entity;
import javax.persistence.Id;

import java.math.BigDecimal;

import javax.persistence.Column;

import org.test.shop.model.domain.SView;

/**
 * ShopRoomTarriffGeneralRateView generated by hbm2java, updated by voovee
 */
@JsonIdentityInfo(generator = JSOGGenerator.class)
@JsonIgnoreProperties({

			  "firmid"
			, "firm"
			, "serieskey"
			, "corporateRateCurrcurrencyid"
			, "originalRateCurrcurrencyid"
})
@Entity
@Table(name="shop_room_tarriff_general_rate_view")
public class ShopRoomTarriffGeneralRateView extends SView  {

	private static final long serialVersionUID = 8459846161194971L;

	private Integer id;
	private Integer paymentTariffId;
	private Integer paymentTariffVersion;
	private Integer priceVersion;
	private Integer humannumber;
	private Integer roomId;
	private BigDecimal corporateRateCost;
	private BigDecimal corporateRateCostNationalCurrency;
	private BigDecimal corporateRateCostUsdCurrency;
	private String corporateRateCostUsdcurrencysign;
	private Integer corporateRateCurrcurrencyid;
	private Integer corporateRateCurrcurrencyversion;
	private String corporateRateCurrencyname;
	private BigDecimal originalRateCost;
	private BigDecimal originalRateCostNationalCurrency;
	private BigDecimal originalRateCostUsdCurrency;
	private String originalRateCostUsdcurrencysign;
	private Integer originalRateCurrcurrencyid;
	private Integer originalRateCurrcurrencyversion;
	private String originalRateCurrencyname;

	public ShopRoomTarriffGeneralRateView() {
	}

	public ShopRoomTarriffGeneralRateView(Integer id,
			Integer paymentTariffId, Integer paymentTariffVersion,
			Integer priceVersion, Integer humannumber, Integer roomId,
			BigDecimal corporateRateCost,
			BigDecimal corporateRateCostNationalCurrency,
			BigDecimal corporateRateCostUsdCurrency,
			String corporateRateCostUsdcurrencysign,
			Integer corporateRateCurrcurrencyid,
			Integer corporateRateCurrcurrencyversion,
			String corporateRateCurrencyname, BigDecimal originalRateCost,
			BigDecimal originalRateCostNationalCurrency,
			BigDecimal originalRateCostUsdCurrency,
			String originalRateCostUsdcurrencysign,
			Integer originalRateCurrcurrencyid,
			Integer originalRateCurrcurrencyversion,
			String originalRateCurrencyname) {
		this.id = id;
		this.paymentTariffId = paymentTariffId;
		this.paymentTariffVersion = paymentTariffVersion;
		this.priceVersion = priceVersion;
		this.humannumber = humannumber;
		this.roomId = roomId;
		this.corporateRateCost = corporateRateCost;
		this.corporateRateCostNationalCurrency = corporateRateCostNationalCurrency;
		this.corporateRateCostUsdCurrency = corporateRateCostUsdCurrency;
		this.corporateRateCostUsdcurrencysign = corporateRateCostUsdcurrencysign;
		this.corporateRateCurrcurrencyid = corporateRateCurrcurrencyid;
		this.corporateRateCurrcurrencyversion = corporateRateCurrcurrencyversion;
		this.corporateRateCurrencyname=corporateRateCurrencyname;
		this.originalRateCost = originalRateCost;
		this.originalRateCostNationalCurrency = originalRateCostNationalCurrency;
		this.originalRateCostUsdCurrency = originalRateCostUsdCurrency;
		this.originalRateCostUsdcurrencysign = originalRateCostUsdcurrencysign;
		this.originalRateCurrcurrencyid = originalRateCurrcurrencyid;
		this.originalRateCurrcurrencyversion = originalRateCurrcurrencyversion;
		this.originalRateCurrencyname=originalRateCurrencyname;
	}

	@Id
	@Column(name="id")
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name="payment_tariff_id")
	public Integer getPaymentTariffId() {
		return this.paymentTariffId;
	}

	public void setPaymentTariffId(Integer paymentTariffId) {
		this.paymentTariffId = paymentTariffId;
	}

	@Column(name="payment_tariff_version")
	public Integer getPaymentTariffVersion() {
		return this.paymentTariffVersion;
	}

	public void setPaymentTariffVersion(Integer paymentTariffVersion) {
		this.paymentTariffVersion = paymentTariffVersion;
	}

	@Column(name="price_version")
	public Integer getPriceVersion() {
		return this.priceVersion;
	}

	public void setPriceVersion(Integer priceVersion) {
		this.priceVersion = priceVersion;
	}

	@Column(name="humannumber")
	public Integer getHumannumber() {
		return this.humannumber;
	}

	public void setHumannumber(Integer humannumber) {
		this.humannumber = humannumber;
	}

	@Column(name="room_id")
	public Integer getRoomId() {
		return this.roomId;
	}

	public void setRoomId(Integer roomId) {
		this.roomId = roomId;
	}

	@Column(name="corporate_rate_cost", precision = 131089, scale = 0)
	public BigDecimal getCorporateRateCost() {
		return this.corporateRateCost;
	}

	public void setCorporateRateCost(BigDecimal corporateRateCost) {
		this.corporateRateCost = corporateRateCost;
	}

	@Column(name="corporate_rate_cost_national_currency", precision = 131089, scale = 0)
	public BigDecimal getCorporateRateCostNationalCurrency() {
		return this.corporateRateCostNationalCurrency;
	}

	public void setCorporateRateCostNationalCurrency(
			BigDecimal corporateRateCostNationalCurrency) {
		this.corporateRateCostNationalCurrency = corporateRateCostNationalCurrency;
	}

	@Column(name="corporate_rate_cost_usd_currency", precision = 131089, scale = 0)
	public BigDecimal getCorporateRateCostUsdCurrency() {
		return this.corporateRateCostUsdCurrency;
	}

	public void setCorporateRateCostUsdCurrency(
			BigDecimal corporateRateCostUsdCurrency) {
		this.corporateRateCostUsdCurrency = corporateRateCostUsdCurrency;
	}

	@Column(name="corporate_rate_cost_usdcurrencysign")
	public String getCorporateRateCostUsdcurrencysign() {
		return this.corporateRateCostUsdcurrencysign;
	}

	public void setCorporateRateCostUsdcurrencysign(
			String corporateRateCostUsdcurrencysign) {
		this.corporateRateCostUsdcurrencysign = corporateRateCostUsdcurrencysign;
	}

	@Column(name="corporate_rate_currcurrencyid")
	public Integer getCorporateRateCurrcurrencyid() {
		return this.corporateRateCurrcurrencyid;
	}

	public void setCorporateRateCurrcurrencyid(
			Integer corporateRateCurrcurrencyid) {
		this.corporateRateCurrcurrencyid = corporateRateCurrcurrencyid;
	}

	@Column(name="corporate_rate_currcurrencyversion")
	public Integer getCorporateRateCurrcurrencyversion() {
		return this.corporateRateCurrcurrencyversion;
	}

	public void setCorporateRateCurrcurrencyversion(
			Integer corporateRateCurrcurrencyversion) {
		this.corporateRateCurrcurrencyversion = corporateRateCurrcurrencyversion;
	}

	@Column(name="corporate_rate_currencyname")
	public String getCorporateRateCurrencyname() {
		return this.corporateRateCurrencyname;
	}

	public void setCorporateRateCurrencyname(String corporateRateCurrencyname) {
		this.corporateRateCurrencyname=corporateRateCurrencyname;
	}

	@Column(name="original_rate_cost", precision = 131089, scale = 0)
	public BigDecimal getOriginalRateCost() {
		return this.originalRateCost;
	}

	public void setOriginalRateCost(BigDecimal originalRateCost) {
		this.originalRateCost = originalRateCost;
	}

	@Column(name="original_rate_cost_national_currency", precision = 131089, scale = 0)
	public BigDecimal getOriginalRateCostNationalCurrency() {
		return this.originalRateCostNationalCurrency;
	}

	public void setOriginalRateCostNationalCurrency(
			BigDecimal originalRateCostNationalCurrency) {
		this.originalRateCostNationalCurrency = originalRateCostNationalCurrency;
	}

	@Column(name="original_rate_cost_usd_currency", precision = 131089, scale = 0)
	public BigDecimal getOriginalRateCostUsdCurrency() {
		return this.originalRateCostUsdCurrency;
	}

	public void setOriginalRateCostUsdCurrency(
			BigDecimal originalRateCostUsdCurrency) {
		this.originalRateCostUsdCurrency = originalRateCostUsdCurrency;
	}

	@Column(name="original_rate_cost_usdcurrencysign")
	public String getOriginalRateCostUsdcurrencysign() {
		return this.originalRateCostUsdcurrencysign;
	}

	public void setOriginalRateCostUsdcurrencysign(
			String originalRateCostUsdcurrencysign) {
		this.originalRateCostUsdcurrencysign = originalRateCostUsdcurrencysign;
	}

	@Column(name="original_rate_currcurrencyid")
	public Integer getOriginalRateCurrcurrencyid() {
		return this.originalRateCurrcurrencyid;
	}

	public void setOriginalRateCurrcurrencyid(Integer originalRateCurrcurrencyid) {
		this.originalRateCurrcurrencyid = originalRateCurrcurrencyid;
	}

	@Column(name="original_rate_currcurrencyversion")
	public Integer getOriginalRateCurrcurrencyversion() {
		return this.originalRateCurrcurrencyversion;
	}

	public void setOriginalRateCurrcurrencyversion(
			Integer originalRateCurrcurrencyversion) {
		this.originalRateCurrcurrencyversion = originalRateCurrcurrencyversion;
	}

	@Column(name="original_rate_currencyname")
	public String getOriginalRateCurrencyname() {
		return this.originalRateCurrencyname;
	}

	public void setOriginalRateCurrencyname(String originalRateCurrencyname) {
		this.originalRateCurrencyname=originalRateCurrencyname;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof ShopRoomTarriffGeneralRateView))
			return false;
		ShopRoomTarriffGeneralRateView castOther = (ShopRoomTarriffGeneralRateView) other;

		return ((this.getId() == castOther.getId()) || (this.getId() != null
				&& castOther.getId() != null && this.getId().equals(
				castOther.getId())))
				&& ((this.getPaymentTariffId() == castOther
						.getPaymentTariffId()) || (this.getPaymentTariffId() != null
						&& castOther.getPaymentTariffId() != null && this
						.getPaymentTariffId().equals(
								castOther.getPaymentTariffId())))
				&& ((this.getPaymentTariffVersion() == castOther
						.getPaymentTariffVersion()) || (this
						.getPaymentTariffVersion() != null
						&& castOther.getPaymentTariffVersion() != null && this
						.getPaymentTariffVersion().equals(
								castOther.getPaymentTariffVersion())))
				&& ((this.getPriceVersion() == castOther.getPriceVersion()) || (this
						.getPriceVersion() != null
						&& castOther.getPriceVersion() != null && this
						.getPriceVersion().equals(castOther.getPriceVersion())))
				&& ((this.getHumannumber() == castOther.getHumannumber()) || (this
						.getHumannumber() != null
						&& castOther.getHumannumber() != null && this
						.getHumannumber().equals(castOther.getHumannumber())))
				&& ((this.getRoomId() == castOther.getRoomId()) || (this
						.getRoomId() != null && castOther.getRoomId() != null && this
						.getRoomId().equals(castOther.getRoomId())))
				&& ((this.getCorporateRateCost() == castOther
						.getCorporateRateCost()) || (this
						.getCorporateRateCost() != null
						&& castOther.getCorporateRateCost() != null && this
						.getCorporateRateCost().equals(
								castOther.getCorporateRateCost())))
				&& ((this.getCorporateRateCostNationalCurrency() == castOther
						.getCorporateRateCostNationalCurrency()) || (this
						.getCorporateRateCostNationalCurrency() != null
						&& castOther.getCorporateRateCostNationalCurrency() != null && this
						.getCorporateRateCostNationalCurrency()
						.equals(castOther
								.getCorporateRateCostNationalCurrency())))
				&& ((this.getCorporateRateCostUsdCurrency() == castOther
						.getCorporateRateCostUsdCurrency()) || (this
						.getCorporateRateCostUsdCurrency() != null
						&& castOther.getCorporateRateCostUsdCurrency() != null && this
						.getCorporateRateCostUsdCurrency().equals(
								castOther.getCorporateRateCostUsdCurrency())))
				&& ((this.getCorporateRateCostUsdcurrencysign() == castOther
						.getCorporateRateCostUsdcurrencysign()) || (this
						.getCorporateRateCostUsdcurrencysign() != null
						&& castOther.getCorporateRateCostUsdcurrencysign() != null && this
						.getCorporateRateCostUsdcurrencysign()
						.equals(castOther.getCorporateRateCostUsdcurrencysign())))
				&& ((this.getCorporateRateCurrcurrencyid() == castOther
						.getCorporateRateCurrcurrencyid()) || (this
						.getCorporateRateCurrcurrencyid() != null
						&& castOther.getCorporateRateCurrcurrencyid() != null && this
						.getCorporateRateCurrcurrencyid().equals(
								castOther.getCorporateRateCurrcurrencyid())))
				&& ((this.getCorporateRateCurrcurrencyversion() == castOther
						.getCorporateRateCurrcurrencyversion()) || (this
						.getCorporateRateCurrcurrencyversion() != null
						&& castOther.getCorporateRateCurrcurrencyversion() != null && this
						.getCorporateRateCurrcurrencyversion()
						.equals(castOther.getCorporateRateCurrcurrencyversion())))
				&& ((this.getCorporateRateCurrencyname() == castOther
						.getCorporateRateCurrencyname()) || (this
						.getCorporateRateCurrencyname() != null
						&& castOther.getCorporateRateCurrencyname() != null && this
						.getCorporateRateCurrencyname().equals(
								castOther.getCorporateRateCurrencyname())))
				&& ((this.getOriginalRateCost() == castOther
						.getOriginalRateCost()) || (this.getOriginalRateCost() != null
						&& castOther.getOriginalRateCost() != null && this
						.getOriginalRateCost().equals(
								castOther.getOriginalRateCost())))
				&& ((this.getOriginalRateCostNationalCurrency() == castOther
						.getOriginalRateCostNationalCurrency()) || (this
						.getOriginalRateCostNationalCurrency() != null
						&& castOther.getOriginalRateCostNationalCurrency() != null && this
						.getOriginalRateCostNationalCurrency()
						.equals(castOther.getOriginalRateCostNationalCurrency())))
				&& ((this.getOriginalRateCostUsdCurrency() == castOther
						.getOriginalRateCostUsdCurrency()) || (this
						.getOriginalRateCostUsdCurrency() != null
						&& castOther.getOriginalRateCostUsdCurrency() != null && this
						.getOriginalRateCostUsdCurrency().equals(
								castOther.getOriginalRateCostUsdCurrency())))
				&& ((this.getOriginalRateCostUsdcurrencysign() == castOther
						.getOriginalRateCostUsdcurrencysign()) || (this
						.getOriginalRateCostUsdcurrencysign() != null
						&& castOther.getOriginalRateCostUsdcurrencysign() != null && this
						.getOriginalRateCostUsdcurrencysign().equals(
								castOther.getOriginalRateCostUsdcurrencysign())))
				&& ((this.getOriginalRateCurrcurrencyid() == castOther
						.getOriginalRateCurrcurrencyid()) || (this
						.getOriginalRateCurrcurrencyid() != null
						&& castOther.getOriginalRateCurrcurrencyid() != null && this
						.getOriginalRateCurrcurrencyid().equals(
								castOther.getOriginalRateCurrcurrencyid())))
				&& ((this.getOriginalRateCurrcurrencyversion() == castOther
						.getOriginalRateCurrcurrencyversion()) || (this
						.getOriginalRateCurrcurrencyversion() != null
						&& castOther.getOriginalRateCurrcurrencyversion() != null && this
						.getOriginalRateCurrcurrencyversion().equals(
								castOther.getOriginalRateCurrcurrencyversion())))
				&& ((this.getOriginalRateCurrencyname() == castOther
						.getOriginalRateCurrencyname()) || (this
						.getOriginalRateCurrencyname() != null
						&& castOther.getOriginalRateCurrencyname() != null && this
						.getOriginalRateCurrencyname().equals(
								castOther.getOriginalRateCurrencyname())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result + (getId() == null ? 0 : this.getId().hashCode());
		result = 37
				* result
				+ (getPaymentTariffId() == null ? 0 : this.getPaymentTariffId()
						.hashCode());
		result = 37
				* result
				+ (getPaymentTariffVersion() == null ? 0 : this
						.getPaymentTariffVersion().hashCode());
		result = 37
				* result
				+ (getPriceVersion() == null ? 0 : this.getPriceVersion()
						.hashCode());
		result = 37
				* result
				+ (getHumannumber() == null ? 0 : this.getHumannumber()
						.hashCode());
		result = 37 * result
				+ (getRoomId() == null ? 0 : this.getRoomId().hashCode());
		result = 37
				* result
				+ (getCorporateRateCost() == null ? 0 : this
						.getCorporateRateCost().hashCode());
		result = 37
				* result
				+ (getCorporateRateCostNationalCurrency() == null ? 0 : this
						.getCorporateRateCostNationalCurrency().hashCode());
		result = 37
				* result
				+ (getCorporateRateCostUsdCurrency() == null ? 0 : this
						.getCorporateRateCostUsdCurrency().hashCode());
		result = 37
				* result
				+ (getCorporateRateCostUsdcurrencysign() == null ? 0 : this
						.getCorporateRateCostUsdcurrencysign().hashCode());
		result = 37
				* result
				+ (getCorporateRateCurrcurrencyid() == null ? 0 : this
						.getCorporateRateCurrcurrencyid().hashCode());
		result = 37
				* result
				+ (getCorporateRateCurrcurrencyversion() == null ? 0 : this
						.getCorporateRateCurrcurrencyversion().hashCode());
		result = 37
				* result
				+ (getCorporateRateCurrencyname() == null ? 0 : this
						.getCorporateRateCurrencyname().hashCode());
		result = 37
				* result
				+ (getOriginalRateCost() == null ? 0 : this
						.getOriginalRateCost().hashCode());
		result = 37
				* result
				+ (getOriginalRateCostNationalCurrency() == null ? 0 : this
						.getOriginalRateCostNationalCurrency().hashCode());
		result = 37
				* result
				+ (getOriginalRateCostUsdCurrency() == null ? 0 : this
						.getOriginalRateCostUsdCurrency().hashCode());
		result = 37
				* result
				+ (getOriginalRateCostUsdcurrencysign() == null ? 0 : this
						.getOriginalRateCostUsdcurrencysign().hashCode());
		result = 37
				* result
				+ (getOriginalRateCurrcurrencyid() == null ? 0 : this
						.getOriginalRateCurrcurrencyid().hashCode());
		result = 37
				* result
				+ (getOriginalRateCurrcurrencyversion() == null ? 0 : this
						.getOriginalRateCurrcurrencyversion().hashCode());
		result = 37
				* result
				+ (getOriginalRateCurrencyname() == null ? 0 : this
						.getOriginalRateCurrencyname().hashCode());
		return result;
	}

// #SETTER_AND_GETTER

// ------------------ Logic part ------------------

	public ShopRoomTarriffGeneralRateView specialInit() {

		return this;
	}
	public ShopRoomTarriffGeneralRateView init() {
		initList();
		initDicts();

		return this;
	}

	public ShopRoomTarriffGeneralRateView customInitList(List<String> list) {

		return this;
	}

	public ShopRoomTarriffGeneralRateView initList() {

		return this;
	}

	public ShopRoomTarriffGeneralRateView initDicts() {
		return this;
	}

}


text:
var assert= require('assert'),
	manager= require("../app/manager");
	Sequelize=require('Sequelize');
	Promise=Sequelize.Promise;

var User=manager.models['user'];

var isPromise = function(v) {
  return v !== null && typeof v === 'object' && typeof v.then === 'function';
};
var resolveAsync = function(object, callback, count, options) {
  if (!object || typeof object !== 'object') {
    return callback(null, object);
  }

  if (count === 0) {
    return callback(new Error('Max promises (' + options.maxPromise + ') reached'));
  }

  if (isPromise(object)) {
    return object.then(function(result) {

      if (isPromise(result)) {
        resolveAsync(result, callback, count - 1, options);
      } else {
        callback(result);
      }
    }, function(err) {
      callback(err);
    });
  }
}

describe('User 测试', function () {
    it('测试数据库连接',function(done){
		this.timeout(5000);
		User.sync({force: true}).then(function () {
		  // Table created
		  return User.create({
			user_id:"1",
			username: 'Hancock'
		  }).then(function(){
			done();
		  });
		});
    });

	it('获取User List',function(done){
		this.timeout(5000);
		User.findAll().then(function(lists){
			assert.equal(lists.length,1);
			done();
		});
	});
	it('sefe',function(done){
			this.timeout(5000);
		return Promise.coroutine(function* (done) {
			console.log(done)
			done();
			var list=User.findAll();
			console.log(yield list)
		});
	});
	it('ser',function(done){
		this.timeout(5000);
		var data;
		var list=User.findAll();
		done();
		/*
		var a=resolveAsync(list,function(ls,cb){
			result=JSON.stringify(ls);
			done();
			return result;
		},10);
		*/
	   /*
	   Promise.props({
			list: list,
		}).then(function(result) {
			console.log(JSON.stringify(result.list));
			done();
		});
		*/
	});

});


text:
using Google.VisualStudioFake.API;
using Microsoft.VisualStudio.Debugger.Interop;
using System;

namespace Google.VisualStudioFake.Internal
{
    /// <summary>
    /// Models for DebugSession
    /// </summary>
    public class DebugSessionContext : IDebugSessionContext
    {
        public ProgramState ProgramState { get; set; } = ProgramState.NotStarted;
        public Exception ProgramException { get; set; }

        public IDebugEngine2 DebugEngine { get; set; }
        public IDebugProgram3 DebugProgram { get; set; }
        public IDebugProcess2 Process { get; set; }

        public IDebugThread2 SelectedThread
        {
            get => _selectedThread;
            set
            {
                if (_selectedThread == value)
                {
                    return;
                }

                _selectedThread = value;
                SelectedThreadChanged?.Invoke();
            }
        }
        IDebugThread2 _selectedThread;
        public event Action SelectedThreadChanged;

        public IDebugStackFrame2 SelectedStackFrame
        {
            get => _selectedStackFrame;
            set
            {
                if (_selectedStackFrame == value)
                {
                    return;
                }

                _selectedStackFrame = value;
                SelectedStackFrameChanged?.Invoke();
            }
        }

        IDebugStackFrame2 _selectedStackFrame;
        public event Action SelectedStackFrameChanged;

        public bool HexadecimalDisplay
        {
            get => _hexadecimalDisplay;
            set
            {
                if (_hexadecimalDisplay == value)
                {
                    return;
                }

                _hexadecimalDisplay = value;
                HexadecimalDisplayChanged?.Invoke();
            }
        }

        bool _hexadecimalDisplay;
        public event Action HexadecimalDisplayChanged;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="app_name">Pig Dice</string>
    <string name="action_settings">Settings</string>
    <string name="player1_name">Player 1</string>
    <string name="player2_name">Player 2</string>
    <string name="hold">HOLD</string>
    <string name="round">ROUND</string>
    <string name="roll">ROLL</string>
    <string name="points">POINTS</string>
    <string name="next_turn">Next Player Turn</string>
    <string name="have_winner">We have a Winner</string>
    <string name="new_game">New Game!</string>
    <string name="congratulations">Congratulations:</string>
    <string name="description_animation">Dice animation with the different numbers and the pig, of curse!</string>

    <!-- Messages for the different numbers -->
    <string-array name="messages_one">
		<item>Sorry but it\'s not your lucky day</item>
		<item>Well, maybe next time.</item>
		<item>Sometimes it is just destiny, isn\'t? </item>
		<item>You need to be a little bit patient!, you have 5 more numbers waiting for you</item>
		<item>Relax it\'s just a game.</item>
		<item>Keep trying, you\'re a winner</item>
    </string-array>

    <string-array name="messages_two">
		<item>Well no so bad, give it another try.</item>
		<item>The 2 is better than the 1, isn\'t?</item>
		<item>I\'ve seen worse, so keep trying</item>
		<item>Don\'t give up and roll it again.</item>
		<item>The 2 add some points, so don\'t miss them.</item>
		<item>Would you like to have a 1? Right? You see my point!</item>
    </string-array>

    <string-array name="messages_three">
    	<item>The half, so the question is: roll or hold?</item>
		<item>wow, that 3 is amazing many will pray for it</item>
		<item>You know you have half bad and good lucky </item>
		<item>The 3 is much better than 2 and of curse than 1</item>
		<item>Keep in that line and pray for the magical 6</item>
		<item>So, it seems like you are a lucky person</item>
	</string-array>

    <string-array name="messages_four">
		<item>Awesome does not appear every day.</item>
		<item>Well you are a lucky man certainly</item>
		<item>¡OMG! That is really impressive</item>
		<item>And without a clover!</item>
	</string-array>

	<string-array name="messages_five">
	    <item>Give me those fives</item>
		<item>So close to be perfect</item>
		<item>I like the five, don\'t you?</item>
		<item>So good, so far</item>
		<item>I\'m impressed you have the luck from your side</item>
		<item>No much to say you\'re the best!</item>
	</string-array>

	<string-array name="messages_six">
	    <item>Did you buy some kind of amulet?</item>
		<item>Oh! That never happen to me.</item>
		<item>The party  just have begin.</item>
		<item>What a great roll</item>
		<item>That is how you roll the dice</item>
		<item>Don\'t stop, let\'s go for more</item>
	</string-array>
</resources>


text:
<?php

defined('BASEPATH') OR exit('No direct script access allowed');

class YahooFinanceCSV {

    public $url = "http://ichart.finance.yahoo.com/table.csv";

    /* getCSV
     * @params $symbol stock symbol, eg: asx.ax, bkl.ax
     * @params $startdate optional start date. If not specified, it will return result from the earliest possible record
     * @params $enddate optional end date. If not specified, it will return result up to the latest possible record
     * @params $freq optional frequency. Possible values: 'd' for daily, 'm' for monthly, 'y' for yearly. Defaulted to 'd'
     *
     * @return csv
     */

    public function __construct() {

    }

    public function getQuotesCSV($symbol, $startdate = NULL, $enddate = NULL, $freq = 'd') {
        $url = $this->url . "?s={$symbol}";

        if (is_string($startdate) && !empty($startdate)) {
            $startdate = new DateTime($startdate);
            $url .= "&a=" . ($startdate->format('n') - 1); // start month -1
            $url .= "&b=" . $startdate->format('j');     // start day
            $url .= "&c=" . $startdate->format('y');     // start year
        }

        if (is_string($enddate) && !empty($enddate)) {
            $enddate = new DateTime($enddate);
            $url .= "&d=" . ($enddate->format('n') - 1);   // end month - 1
            $url .= "&e=" . $enddate->format('j');       // end day
            $url .= "&f=" . $enddate->format('y');       // end year
        }

        $url .= "&g=" . $freq;
        return $this->run($url);
    }

    private function run($url) {
        $handle = curl_init($url);
        curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
        $response = curl_exec($handle);

        $httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE);
        if ($httpCode == 404) {
            return false;
        } else {
            curl_close($handle);
            return $response;
        }
    }

}


text:
#pragma once
#ifndef __H__OCULAR_MATH_BOUNDS_OBB__H__
#define __H__OCULAR_MATH_BOUNDS_OBB__H__

#include "Math/Bounds/Bounds.hpp"
#include "Math/Vector3.hpp"

//------------------------------------------------------------------------------------------

/**
 * \addtogroup Ocular
 * @{
 */
namespace Ocular
{
    /**
     * \addtogroup Math
     * @{
     */
    namespace Math
    {
        class Ray;
        class BoundsSphere;
        class BoundsAABB;
        class Plane;

        /**
         * \class BoundsOBB
         *
         * Implementation of an Oriented Bounding Box.
         *
         * Essentially an OBB is an AABB that can be arbitrarily rotated.
         * They are more expensive to create and their intersection tests
         * are more complicated, but have the benefit of not needing to
         * be recalculated every time their contents are rotated.
         *
         * Additionally, in most cases an OBB will also provide a tighter
         * fit than an AABB.
         */
        class BoundsOBB : public Bounds
        {
        public:

            BoundsOBB(Vector3f const& center, Vector3f const& extents, Vector3f const& xDir, Vector3f const& yDir, Vector3f const& zDir);
            BoundsOBB();
            ~BoundsOBB();

            /**
             * Returns the center of the bounding box.
             */
            Vector3f const& getCenter() const;

            /**
             * /param[in] center
             */
            void setCenter(Vector3f const& center);

            /**
             * Returns the positive half-lengths of the box.
             * These are the distances along each local axis to the box edge.
             */
            Vector3f const& getExtents() const;

            /**
             * /param[in] extents
             */
            void setExtents(Vector3f const& extents);

            /**
             * Returns the normalized direction of the x-axis of the bounding box.
             */
            Vector3f const& getDirectionX() const;

            /**
             * /param[in] dirX
             */
            void setDirectionX(Vector3f const& dirX);

            /**
             * Returns the normalized direction of the y-axis of the bounding box.
             */
            Vector3f const& getDirectionY() const;

            /**
             * /param[in] dirY
             */
            void setDirectionY(Vector3f const& dirY);

            /**
             * Returns the normalized direction of the z-axis of the bounding box.
             */
            Vector3f const& getDirectionZ() const;

            /**
             * /param[in] dirZ
             */
            void setDirectionZ(Vector3f const& dirZ);

            //------------------------------------------------------------------------------
            // Intersection and Containment Testing
            //------------------------------------------------------------------------------

            /**
             * Performs an intersection test on a ray and OBB.
             *
             * \param[in] ray
             * \return TRUE if the ray and OBB intersect.
             */
            bool intersects(Ray const& ray) const;

            /**
             * Performs an intersection test on a bounding sphere and OBB.
             *
             * \param[in] bounds
             * \return TRUE if the bounding sphere and OBB intersect.
             */
            bool intersects(BoundsSphere const& bounds) const;

            /**
             * Performs an intersection test on a AABB and OBB.
             *
             * \param[in] bounds
             * \return TRUE if the AABB and OBB intersect.
             */
            bool intersects(BoundsAABB const& bounds) const;

            /**
             * Performs an intersection test on two OBBs.
             *
             * \param[in] bounds
             * \return TRUE if the two OBBs intersect.
             */
            bool intersects(BoundsOBB const& bounds) const;

            /**
             * Performs an intersection test on a plane and OBB.
             *
             * If the result is Inside, then the OBB is located entirely within the plane's positive half space.

             * If the result is Outside, then the OBB is located entirely outside the plane's positive half space.
             *
             * The positive half space of the plane is the direction that the plane is facing, as described by it's normal.
             *
             * As an example, say we have the plane defined as:
             *
             *      Point: (0.0, 0.0, 0.0)
             *     Normal: (0.0, 1.0, 0.0)
             *
             * The plane is 'facing up' along the world origin.
             *
             * If the intersection test returns Outside, then the AABB is entirely in the +y world space.

             * If the intersection test returns Inside, then the AABB is entirely in the -y world space.
             *
             * \param[in]  plane
             * \param[out] result Detailed intersection result.
             *
             * \return TRUE if the plane and OBB intersects, otherwise FALSE.
             */
            bool intersects(Plane const& plane, IntersectionType* result = nullptr) const;

        protected:

        private:

            Vector3f m_Center;      ///< Center point of the box
            Vector3f m_Extents;     ///< Positive half-lengths
            Vector3f m_DirectionX;  ///< Normalized direction of the X side direction
            Vector3f m_DirectionY;  ///< Normalized direction of the Y side direction
            Vector3f m_DirectionZ;  ///< Normalized direction of the Z side direction
        };
    }
    /**
     * @} End of Doxygen Groups
     */
}
/**
 * @} End of Doxygen Groups
 */

//------------------------------------------------------------------------------------------

#endif


text:
{% extends "registration/registration_base.html" %}
{% load i18n %}
{% block title %}{% trans "Login" %}{% endblock %}
{% block content %}
{% url 'auth_password_reset' as auth_pwd_reset_url %}
{% url 'registration_register' as register_url%}

{% if form.errors %}

{% blocktrans %}Your username and password didn't match. Please try again.{% endblocktrans %}

{% endif %}

<form method="post" action="{% url 'auth_login' %}">{% csrf_token %}

    {% trans form.username.label_tag %}
    {{ form.username }}

    {% trans form.password.label_tag %}
    {{ form.password }}

{% blocktrans %}Forgot your password?
    Need an account?{% endblocktrans %}

<input type="submit" value="{% trans "login" %}" />
<input type="hidden" name="next" value="{{ next }}" />
</form>

{% endblock %}


text:
#include "cydwave.h"
#include "cyddefs.h"
#include "macros.h"

#ifndef LOWRESWAVETABLE
typedef Sint64 WaveAccSigned;
#else
typedef Sint32 WaveAccSigned;
#endif

#ifndef CYD_DISABLE_WAVETABLE
static Sint32 cyd_wave_get_sample_no_interpolation(const CydWavetableEntry *entry, CydWaveAcc wave_acc, int direction)
{
	if (entry->data)
	{
		return entry->data[wave_acc / WAVETABLE_RESOLUTION];
	}
	else
		return 0;
}

static Sint32 cyd_wave_get_sample_linear(const CydWavetableEntry *entry, CydWaveAcc wave_acc, int direction)
{
	if (entry->data)
	{
		if (direction == 0)
		{
			int a = wave_acc / WAVETABLE_RESOLUTION;
			int b = a + 1;

			if (a >= entry->samples || a < 0)
				return 0;

			if ((entry->flags & CYD_WAVE_LOOP) && b >= entry->loop_end)
			{
				if (!(entry->flags & CYD_WAVE_PINGPONG))
					b = b - entry->loop_end + entry->loop_begin;
				else
					b = entry->loop_end - (b - entry->loop_end);
			}

			if (b >= entry->samples)
				return entry->data[a];
			else
				return entry->data[a] + (entry->data[b] - entry->data[a]) * ((CydWaveAccSigned)wave_acc % WAVETABLE_RESOLUTION) / WAVETABLE_RESOLUTION;
		}
		else
		{
			int a = wave_acc / WAVETABLE_RESOLUTION;
			int b = a - 1;

			if (a >= entry->samples || a < 0)
				return 0;

			if ((entry->flags & CYD_WAVE_LOOP) && b < (Sint32)entry->loop_begin)
			{
				if (!(entry->flags & CYD_WAVE_PINGPONG))
					b = b - entry->loop_begin + entry->loop_end;
				else
					b = entry->loop_begin - (b - entry->loop_begin);
			}

			if (b < 0)
				return entry->data[a];
			else
				return entry->data[a] + (entry->data[b] - entry->data[a]) * (WAVETABLE_RESOLUTION - ((CydWaveAccSigned)wave_acc % WAVETABLE_RESOLUTION)) / WAVETABLE_RESOLUTION;
		}
	}
	else
		return 0;
}
#endif // CYD_DISABLE_WAVETABLE

Sint32 cyd_wave_get_sample(const CydWaveState *state, const CydWavetableEntry *wave_entry, CydWaveAcc acc)
{
#ifndef CYD_DISABLE_WAVETABLE
	if (wave_entry->flags & CYD_WAVE_NO_INTERPOLATION)
	{
		return cyd_wave_get_sample_no_interpolation(wave_entry, acc, state->direction);
	}
	else
	{
		return cyd_wave_get_sample_linear(wave_entry, acc, state->direction);
	}

#else
	return 0;
#endif // CYD_DISABLE_WAVETABLE
}

void cyd_wave_cycle(CydWaveState *wave, const CydWavetableEntry *wave_entry)
{
#ifndef CYD_DISABLE_WAVETABLE

	if (wave_entry && wave->playing)
	{
		if (wave->direction == 0)
		{
			wave->acc += wave->frequency;

			if ((wave_entry->flags & CYD_WAVE_LOOP) && wave_entry->loop_end != wave_entry->loop_begin)
			{
				if (wave->acc / WAVETABLE_RESOLUTION >= (Uint64)wave_entry->loop_end)
				{
					if (wave_entry->flags & CYD_WAVE_PINGPONG)
					{
						wave->acc = (Uint64)wave_entry->loop_end * WAVETABLE_RESOLUTION - (wave->acc - (Uint64)wave_entry->loop_end * WAVETABLE_RESOLUTION);
						wave->direction = 1;
					}
					else
					{
						wave->acc = wave->acc - (Uint64)wave_entry->loop_end * WAVETABLE_RESOLUTION + (Uint64)wave_entry->loop_begin * WAVETABLE_RESOLUTION;
					}
				}
			}
			else
			{
				if (wave->acc / WAVETABLE_RESOLUTION >= (Uint64)wave_entry->samples)
				{
					// stop playback
					wave->playing = false;
				}
			}
		}
		else
		{
			wave->acc -= wave->frequency;

			if ((wave_entry->flags & CYD_WAVE_LOOP) && wave_entry->loop_end != wave_entry->loop_begin)
			{
				if ((WaveAccSigned)wave->acc / WAVETABLE_RESOLUTION < (WaveAccSigned)wave_entry->loop_begin)
				{
					if (wave_entry->flags & CYD_WAVE_PINGPONG)
					{
						wave->acc = (WaveAccSigned)wave_entry->loop_begin * WAVETABLE_RESOLUTION - ((WaveAccSigned)wave->acc - (WaveAccSigned)wave_entry->loop_begin * WAVETABLE_RESOLUTION);
						wave->direction = 0;
					}
					else
					{
						wave->acc = wave->acc - (Uint64)wave_entry->loop_begin * WAVETABLE_RESOLUTION + (Uint64)wave_entry->loop_end * WAVETABLE_RESOLUTION;
					}
				}
			}
			else
			{
				if ((WaveAccSigned)wave->acc < 0)
				{
					// stop playback
					wave->playing = false;
				}
			}
		}
	}

#endif // CYD_DISABLE_WAVETABLE
}


text:
import { DataSourceDefinition } from '../lib/BaseFetcher';
import DataGoIdDatasetFetcher from '../fetchers/IdGovCkanDatasetFetcher';
import { fetcherMap } from '../fetchers';

const definition: DataSourceDefinition = {
  name: 'test',
  fetcherClassName: 'DataGoIdDatasetFetcher',
  fetcherParams: {
    // csvUrl: 'http://data.go.id/storage/f/2014-04-07T07%3A36%3A16.048Z/processed-pengguna-alat-kb-2005-2009.csv',
    // datasetIri: 'http://data.go.id/dataset/persentase-pengguna-alat-keluarga-berencana-kb'
    ckanUrl: 'http://data.jakarta.go.id/',
    datasetId: 'data-jumlah-siswa-dan-guru-sd-negeri-provinsi-dki-jakarta'
  }
};

const fetcherInstance = new DataGoIdDatasetFetcher(definition, { fetcherMap });

fetcherInstance.on('triple', triple => {
  const objectPart = triple.object[0] === '"' ? triple.object : `<${triple.object}>`;
  const sentence = `<${triple.subject}> <${triple.predicate}> ${objectPart}.`;
  console.log(sentence);
});

fetcherInstance.fetch();


text:
using Caliburn.Micro;
using Newtonsoft.Json;

namespace AugmentedSzczecin.Models
{

    public class Address : PropertyChangedBase
    {
        [JsonProperty(PropertyName = "city")]
        private string _city;
        public string City
        {
            get
            {
                return _city;
            }
            set
            {
                if (_city != value)
                {
                    _city = value;
                    NotifyOfPropertyChange(() => City);
                }
            }
        }

        [JsonProperty(PropertyName = "street")]
        private string _street;
        public string Street
        {
            get
            {
                return _street;
            }
            set
            {
                if (_street != value)
                {
                    _street = value;
                    NotifyOfPropertyChange(() => Street);
                }
            }
        }

        [JsonProperty(PropertyName = "streetNumber")]
        private string _streetNumber;
        public string StreetNumber
        {
            get
            {
                return _streetNumber;
            }
            set
            {
                if (_streetNumber != value)
                {
                    _streetNumber = value;
                    NotifyOfPropertyChange(() => StreetNumber);
                }
            }
        }

        [JsonProperty(PropertyName = "zipcode")]
        private string _zipCode;
        public string ZipCode
        {
            get
            {
                return _zipCode;
            }
            set
            {
                if (_zipCode != value)
                {
                    _zipCode = value;
                    NotifyOfPropertyChange(() => ZipCode);
                }
            }
        }
    }
}


text:
The following is the list of modifications made to change the JS project to a TS Project:
* Moved original README.md to README-JS.md and added this README.md and CONVERSION.md
* Installed TypeScript typings for angular and related libs `tsd install angular jquery jasmine karma-jasmine angular-mocks angular-protractor selenium-webdriver --save`
* Added 2 `tsconfig.json` files, one for `app` and another for `e2e-tests`. Two files are needed because of different typings for each.
* Renamed the `.js` files to `.ts`.
* As a sample : Converted controller `View1` and `View2` *functions* to *classes* and added a type annotation to use these from tests in a type checked way.
* Minor modifications of typings needed because of conflict in `jquery` vs. `protractor` : https://github.com/borisyankov/DefinitelyTyped/issues/2734.
    * Remove `$` from `jquery.d.ts` in `e2e-tests`.
    * Remove `protractor` def from `app`.

You will notice that stuff like `angular`, `mocks` etc will light up with IntelliSense and you will get errors if you try to misuse these.


text:
package org.apache.maven.plugins.dependency.analyze;

import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.ResolutionScope;

/**
 * Analyzes the dependencies of this project and determines which are: used and declared; used and undeclared; unused
 * and declared. This goal is intended to be used in the build lifecycle, thus it assumes that the
 * test-compile phase has been executed - use the dependency:analyze goal instead when running
 * standalone.
 *

 * By default, maven-dependency-analyzer is used
 * to perform the analysis, with limitations due to the fact that it works at bytecode level, but any analyzer can be
 * plugged in through analyzer parameter.
 *

 *
 * @author Mark Hobson
 * @version $Id$
 * @see AnalyzeMojo
 * @since 2.0
 */
//@formatter:off
@Mojo(
    name = "analyze-only",
    requiresDependencyResolution = ResolutionScope.TEST,
    defaultPhase = LifecyclePhase.VERIFY,
    threadSafe = true
)
//@formatter:on
public class AnalyzeOnlyMojo
    extends AbstractAnalyzeMojo
{
    // subclassed to provide annotations
}


text:
EVT_SERCX2_CONTROL UartEvtSerCx2Control;
EVT_SERCX2_PURGE_FIFOS UartEvtSerCx2PurgeFifos;
EVT_SERCX2_APPLY_CONFIG UartEvtSerCx2ApplyConfig;
EVT_SERCX2_SET_WAIT_MASK UartEvtSerCx2SetWaitMask;


text:
using System.ComponentModel;

namespace Sample.Common {
    public class ProcessInfo : INotifyPropertyChanged {
        private int processId;
        public int ProcessId {
            get { return processId; }
            set {
                if (processId != value) {
                    processId = value;
                    NotifyPropertyChanged("ProcessId");
                }
            }
        }

        private string name;
        public string Name {
            get { return name; }
            set {
                if (name != value) {
                    name = value;
                    NotifyPropertyChanged("Name");
                }
            }
        }

        private int cpuTime;
        public int CpuTime {
            get { return cpuTime; }
            set {
                if (cpuTime != value) {
                    cpuTime = value;
                    NotifyPropertyChanged("CpuTime");
                }
            }
        }

        private long workingSet;
        public long WorkingSet {
            get { return workingSet; }
            set {
                if (workingSet != value) {
                    workingSet = value;
                    NotifyPropertyChanged("WorkingSet");
                }
            }
        }

        public void Update(ProcessInfo processInfo) {
            ProcessId = processInfo.ProcessId;
            Name = processInfo.Name;
            CpuTime = processInfo.CpuTime;
            WorkingSet = processInfo.WorkingSet;
        }

        protected virtual void NotifyPropertyChanged(string propertyName) {
            if (PropertyChanged != null) {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
        public event PropertyChangedEventHandler PropertyChanged;
    }
}


text:
layout: post101
title:  Overview
categories: XAP101
parent: rest-service-overview.html
weight: 300
---

{% summary %}{% endsummary %}

The REST service is a Processing Unit that once it is deployed it starts an embedded jetty server along with a REST service allowing interactions with the Space via the [REST API](./rest-service-api.html).

The Space's name and a port number must be specified. In case of multiple instances of the REST Processing Unit, the port will be the specified port plus a running number starting with zero.

{% note %}
The REST service is not supported with embedded space thus we recommend using it as a separate processing unit.
{%endnote%}

# Deploment Options

### Deploy via CLI
{%refer%} See full instructions [here]({%currentadmurl%}/rest-deploy-command-line-interface.html) {%endrefer%}

### Deploy using a template
A pre-configured processing unit template is provided and can be found at `{XAP_HOME}/deploy/templates/rest`

### Deploy REST Service as part of a custom Processing Unit
A REST Service can be started as part of a custom processing unit by specifying the `<os-core:rest >` annotation as following:

{% highlight xml %}
<os-core:space-proxy id="theSpace" name="theGigaSpace">
<os-core:rest id="mySpaceRestService" giga-space="theGigaSpace" port="8081" />
{% endhighlight %}

or

{% highlight xml %}
<os-core:rest id="mySpaceRestService" space-name="mySpace" port="8081" lookup-groups="myGroups" />
{% endhighlight %}

####\<os-core:rest\> attributes

{: .table .table-bordered .table-condensed}
| Attribute name | Use | Description |
|:-----|:----------|
| port | required | The port which the rest service will be available on. {% wbr %}If there are multiple instances, the port for each instance will be port+runningNumber (starting from 0) |
| giga-space | required* | Reference to GigaSpace |
| space-name |  required* | Name of the Space that the rest should connect to. |
| lookup-groups | optional | The lookup groups to be used when looking for the specified space. {% wbr %} A comma separated list of group names. {% wbr %}Use with space-name attribute only. |
| lookup-locators | optional | The lookup locators to be used when looking for the specified space. {% wbr %} A comma separated list of host:port. {% wbr %}Use with space-name attribute only. |

*giga-space and space-name attributes can not be used together.

#Date Support

Date string is parsed with a different parser from XAP's parser. Therefore, a date format must be defined.

We provide a default format `yyyy-MM-dd HH:mm:ss` but you can override it by providing the `rest.datetime_format` property in the deployment step or by specify it in the pu.xml:

{% highlight xml %}
<os-core:rest id="mySpaceRestService" space-name="mySpace" port="8081" lookup-groups="myGroups">
  <os-core:properties>
    <props>
      <prop key="datetime_format">yyyy-MM-dd HH:mm:ss</prop>
    </props>
  </os-core:properties>
</os-core:rest>
{% endhighlight %}

#Nested SpaceDocument

The REST API supports writing nested SpaceDocument.

The JSON representation is:
{% highlight json %}
{
  "typeName": "theTypeOfTheNestedObject-SpaceDocument",
  "version": 0, //optional
  "transient": true/false, //optional
  "properties": {
    "prop1": "val1",
    "prop2": "val2"
  }
}
{% endhighlight %}

# API and Playground

Once the REST Processing Unit is deployed, you can browse the API and test its methods by accessing the main page at: `http://<rest-instance-host-address>:<rest-port>/`.

The page should look like:

![rest-api-jsondoc.png](/attachment_files/rest-api-jsondoc.png)

{%refer%} Browse the offline API documentation [here](./rest-service-api.html) {%endrefer%}

# Limitations

*   In case that the ports were in use, the deployment will fail.
*   Not supported with embedded space thus we recommend using it as a separate processing unit.
*   The API support writing for Document objects only.
*   Supported collections: Arrays and Lists of SpaceDocument.
*   Currently there is no support for connecting to a secured space.

# Removed APIs

The REST service was a dependant project until version 10.1.0.
Since then, it is an official part of the product.

Tasks API were removed, Pojo and Document API were merged with no support for Pojo writing.

# WAR Deployment and Customization

Another option is to deploy the REST service as [Web Processing Unit](./web-application-overview.html).

In order to do so, you will need to do the following:

1. Clone the project from Github: `git clone https://github.com/GigaSpaces/RESTData.git`

2. Edit the file that is located under src/main/webapp/WEB-INF/config.properties to include your space's properties

3. Package the project using maven: `mvn package -P standalone-war` {% wbr %}This will run the unit tests and package the project to a war file located at target/RESTData.war

4. Deploy the war file as a Web Processing Unit

For example:
{% highlight bash linenos %}
#Specify the space parameters using the following properties:
spaceName=mySpace
lookupGroups=myGroups
#lookupLocators=
#datetime_format=
{% endhighlight %}


text:
Crispus CMS
========================================
[![Build Status](https://travis-ci.org/rbnvrw/crispus.svg?branch=master)](https://travis-ci.org/rbnvrw/crispus)
[![Code Climate](https://codeclimate.com/github/rbnvrw/crispus/badges/gpa.svg)](https://codeclimate.com/github/rbnvrw/crispus)
[![Test Coverage](https://codeclimate.com/github/rbnvrw/crispus/badges/coverage.svg)](https://codeclimate.com/github/rbnvrw/crispus)

Crispus CMS is a light-weight file based content management system.

Installation
--------------------
Installing Crispus CMS is easy: just add it as a dependency of your project via Composer:
```
"require": {
  "rbnvrw/crispus": "dev-master"
}
```
Then use `composer update` to install Crispus CMS in the `vendor` directory.

Usage
--------------------
See my [Crispus example repository](https://github.com/rbnvrw/crispus-example) for an example on how to use Crispus CMS for your website.

Pages are stored in the `pages` directory as directories. The page directory should contain a `config.json` file with the page properties and one or more Markdown files that correspond to the blocks that are used in the current theme that is rendered via Twig.

Global configuration settings are stored in JSON format in `config/config.json`. In this config file, you can also set the theme that is used. Themes are stored in the `themes` directory and use the Twig template engine.


text:
import pentai.base.game as g_m
import players_mgr
import preserved_game as pg_m
import zodb_dict as zd_m
from pentai.db.misc_db import misc
import mru_cache as mru_m
import os
import pentai.base.gs_observer as gso_m

from pentai.base.defines import *
import pentai.base.logger as log

class GamesMgr(gso_m.GSObserver):
    # TODO: Borg pattern?
    def __init__(self, *args, **kwargs):
        log.debug("Entered GamesMgr __init__")
        self.games_dbs = {}
        self.players_mgr = players_mgr.PlayersMgr()
        log.debug("GamesMgr created PlayersMgr")
        id_section = "id_map"
        self.id_lookup = zd_m.get_section(id_section)
        log.debug("GamesMgr 3")
        u_s = "unfinished"
        self.unfinished_db = zd_m.get_section(u_s)
        log.debug("GamesMgr 4")
        f_k = "recently_finished"
        self.finished_db = misc().setdefault(f_k, mru_m.MRUCache(30))
        log.debug("GamesMgr 5")

    def get_filename(self, key):
        if key.__class__ is g_m.Game:
            rk = key.rules.key()
        elif key.__class__ is tuple:
            rk = key[0]
        elif key.__class__ is int and key > 1000000:
            # Test for key >= very large number?
            # -> is from Openings DB
            rk = [19,'s']
        else:
            try:
                rk = self.id_lookup[key]
            except KeyError:
                return None

        fn = "%s_%s" % (rk[1], rk[0])
        return fn

    def ensure_has_id(self, game):
        assert not game is None
        if not hasattr(game, "game_id") or game.game_id is None:
            game_id = self.next_id()
            game.game_id = game_id

        return game.game_id

    def remove_id(self, key):
        if key is None:
            return None
        del self.id_lookup[key]
        zd_m.sync()

    def delete_game(self, key):
        game_db = self.get_db(key)
        if game_db is None:
            # No such game
            log.warn("No such game: %s" % key)
            return

        try:
            del game_db[key]
        except KeyError:
            # Corrupt DB, ignore
            log.warn("No such game: %s" % key)

        try:
            del self.unfinished_db[key]
        except KeyError:
            log.warn("game not in unfinished_db: %s, type: %s" % (key, type(key)))

        try:
            del self.id_lookup[key]
        except KeyError:
            log.warn("game not in id_lookup: %s" % key)
        zd_m.sync()

    def get_db(self, key):
        if key is None:
            return None

        fn = self.get_filename(key)
        if fn is None:
            return None

        try:
            f = self.games_dbs[fn]
        except KeyError:
            f = self.games_dbs[fn] = \
                zd_m.get_section(fn)
        return f

    def next_id(self):
        try:
            curr_id = self.id_lookup["id"]
        except KeyError:
            curr_id = 0
        curr_id += 1
        self.id_lookup["id"] = curr_id

        # Don't need to sync until it's saved
        return curr_id

    def create_game(self, rules=None, p1=None, p2=None):
        g = g_m.Game(rules, p1, p2)
        uid = self.next_id()
        g.game_id = uid
        if not rules is None:
            # Might as well save it now.
            self.id_lookup[uid] = rules.key()

        return g

    def get_players_mgr(self):
        return self.players_mgr

    def save(self, g, game_db=None, update_cache=True):
        for p in g.get_all_players()[1:]:
            self.players_mgr.ensure_has_key(p)

        if game_db is None:
            game_db = self.get_db(g)

        self.ensure_has_id(g)
        pg = pg_m.PreservedGame(g)
        game_db[pg.key()] = pg

        self.id_lookup[g.game_id] = g.rules.key()
        zd_m.sync()

        gid = g.key()

        if g.finished():
            self.finished_db.add(gid)
            try:
                del self.unfinished_db[gid]
            except KeyError:
                pass
        else:
            self.finished_db.delete(gid)
            self.unfinished_db[gid] = gid
        zd_m.sync()

        # Save players
        self.players_mgr.save(g.get_player(1), update_cache)
        self.players_mgr.save(g.get_player(2), update_cache)

    def sync_all(self):
        zd_m.sync()

    def get_unfinished_game(self, g_id):
        if not g_id in self.unfinished_db:
            return None
        return self.get_game(g_id)

    def get_all_unfinished_preserved(self):
        ret = []
        for g_id in self.unfinished_db.iterkeys():
            log.debug("get_all_unfinished: %s" % g_id)
            g = self.get_preserved_game(g_id, update_cache=False)
            ret.append(g)
        return ret

    def get_recently_finished(self):
        ret = []
        for g_id in self.finished_db.top(30):
            log.debug("get_recently_finished: %s" % g_id)
            g = self.get_preserved_game(g_id, update_cache=False)
            ret.append(g)
        return ret

    def get_game(self, g_id, game_db=None, update_cache=True):
        pg = self.get_preserved_game(g_id, game_db, update_cache)

        if pg is None:
            return None

        g = pg.restore(self.players_mgr, update_cache)

        return g

    def get_preserved_game(self, g_id, game_db=None, update_cache=True):

        if g_id is None:
            return None

        if game_db is None:
            game_db = self.get_db(g_id)
            if game_db is None:
                return None

        try:
            pg = game_db[g_id]
        except KeyError:
            return None

        return pg

    def reset_state(self, game):
        pass

    def after_game_won(self, game, colour):
        # TODO: Check draws trigger this.
        self.save(game)


text:
aniketkulkarni.org

Built using Bootstrap and Node/Express/Poet

Todo:
-Add blog system
-Make a blog post


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

namespace Chess_Game
{
    class Move
    {
        public Tuple<int, int> from;

        public Tuple<int, int> to;

        public Move(int x1,int y1,int x2,int y2)
        {
            from = new Tuple<int, int>(x1, y1);

            to = new Tuple<int, int>(x2, y2);
        }

    }
}