text:
#region "Copyright"

/*
FOR FURTHER DETAILS ABOUT LICENSING, PLEASE VISIT "LICENSE.txt" INSIDE THE SAGEFRAME FOLDER
*/

#endregion

#region "References"

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using SageFrame.Framework;
using System.Data;
using SageFrame.Web;
using SageFrame.PortalSetting;
using System.Collections;
using SageFrame.Web.Utilities;
using SageFrame.SageFrameClass;
using SageFrame.Utilities;
using SageFrame.RolesManagement;
using SageFrame.Shared;
using System.IO;
using System.Text;
using SageFrame.Dashboard;
using SageFrame.Templating;
using System.Web.UI.HtmlControls;
using SageFrame.ModuleMessage;
using SageFrame.Security;
using SageFrame.Common;
using SageFrame.Core;
using SageFrame.Modules.Admin.PortalSettings;

#endregion

namespace SageFrame
{
    public partial class Sagin_Default : PageBase, SageFrameRoute
    {
        #region "Public Variables"

        public string ControlPath = string.Empty, SageFrameAppPath, SageFrameUserName;
        public string appPath = string.Empty;
        public string Extension;
        public string templateFavicon = string.Empty;
        public string userName = string.Empty;

        #endregion

        #region "Event Handlers"

        protected void Page_Init(object sender, EventArgs e)
        {
            SetPageInitPart();
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            SetPageLoadPart();
            CoreJs.IncludeLanguageCoreJs(this.Page);
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1));
            Response.Cache.SetNoStore();
            Response.AppendHeader("pragma", "no-cache");
            SageFrame.Version.SageFrameVersion app = new SageFrame.Version.SageFrameVersion();
            lblVersion.Text = string.Format("V {0}", app.FormatShortVersion(app.Version, true));
        }

        #endregion

        #region "Public methods"

        public void LoadMessageControl()
        {

            PlaceHolder phdPlaceHolder = Page.FindControl("message") as PlaceHolder;
            if (phdPlaceHolder != null)
            {
                LoadControl(phdPlaceHolder, "~/Controls/Message.ascx");
            }
        }

        public override void ShowMessage(string MessageTitle, string Message, string CompleteMessage, bool isSageAsyncPostBack, SageMessageType MessageType)
        {
            string strCssClass = GetMessageCssClass(MessageType);
            int Cont = this.Page.Controls.Count;
            ControlCollection lstControls = Page.FindControl("form1").Controls;
            PlaceHolder phd = Page.FindControl("message") as PlaceHolder;
            if (phd != null)
            {
                foreach (Control c in phd.Controls)
                {
                    if (c.GetType().FullName.ToLower() == "ASP.Controls_message_ascx".ToLower())
                    {
                        SageUserControl tt = (SageUserControl)c;
                        tt.Modules_Message_ShowMessage(tt, MessageTitle, Message, CompleteMessage, isSageAsyncPostBack, MessageType, strCssClass);
                    }
                }
            }
        }

        #endregion

        #region "Private Methods"

        private void SetPageInitPart()
        {
            CheckUserLogin();
            string PageName = Path.GetFileNameWithoutExtension(PagePath);
            //adminImage.ImageUrl = GetUserImage;
            if (PageName != null)
            {
                SecurityPolicy objSecurity = new SecurityPolicy();

                userName = objSecurity.GetUser(GetPortalID);
                templateFavicon = SetFavIcon(GetActiveTemplate);
                Extension = SageFrameSettingKeys.PageExtension;
                ApplicationController objAppController = new ApplicationController();
                objSecurity.UpdateExpireTime(userName, GetPortalID);
                if (!objAppController.CheckRequestExtension(Request))
                {
                    SageInitPart();
                }
                SetGlobalVariable();
                bool IsAdmin = true;
                IncludeStartup(GetPortalID, pchHolder, IsAdmin);
            }
            else
            {
                Response.Redirect(PortalAPI.PageNotAccessibleURL);
            }
        }

        private void CheckUserLogin()
        {
            if (!IsUserLoggedIn())
            {
                StringBuilder redirecPath = new StringBuilder();
                Uri url = HttpContext.Current.Request.Url;
                if (!IsParent)
                {
                    redirecPath.Append(url.Scheme);
                    redirecPath.Append("://");
                    redirecPath.Append(url.Authority);
                    redirecPath.Append(PortalAPI.GetApplicationName);
                    redirecPath.Append("/portal/");
                    redirecPath.Append(GetPortalSEOName);
                    redirecPath.Append("/");
                    redirecPath.Append(PortalAPI.LoginPageWithExtension);
                }
                else
                {
                    redirecPath.Append(url.Scheme);
                    redirecPath.Append("://");
                    redirecPath.Append(url.Authority);
                    redirecPath.Append(PortalAPI.LoginURL);
                }
                string strCurrentURL = Request.Url.ToString();
                if (redirecPath.ToString().Contains("?"))
                {
                    redirecPath.Append("&ReturnUrl=");
                    redirecPath.Append(strCurrentURL);
                }
                else
                {
                    redirecPath.Append("?ReturnUrl=");
                    redirecPath.Append(strCurrentURL);
                }
                HttpContext.Current.Response.Redirect(redirecPath.ToString());
            }
        }

        private void SetGlobalVariable()
        {
            appPath = GetAppPath();
            SageFrameAppPath = appPath;
            RegisterSageGlobalVariable();

        }

        private void SageInitPart()
        {
            ApplicationController objAppController = new ApplicationController();
            if (objAppController.IsInstalled())
            {
                if (!objAppController.CheckRequestExtension(Request))
                {
                    SetPortalCofig();
                    InitializePage();
                    hypUpgrade.NavigateUrl = "~/Admin/sfUpgrader" + Extension;
                    LoadMessageControl();
                    BindModuleControls();
                    SageFrameConfig sfConfig = new SageFrameConfig();
                    string defaultAdminTheme = sfConfig.GetSettingValueByIndividualKey(SageFrameSettingKeys.DefaultAdminTheme);
                    string adminSidebarPosition = sfConfig.GetSettingValueByIndividualKey(SageFrameSettingKeys.AdminSidebarPosition);
                    rdTemplate.SelectedValue = defaultAdminTheme;
                    if (adminSidebarPosition == "left")
                    {
                        rdLeft.Checked = true;
                        divSideBar.Attributes.Add("class", "sideBarLeft");
                    }
                    else
                    {
                        rdRight.Checked = true;
                        divSideBar.Attributes.Add("class", "sideBarRight");
                    }
                }
            }
            else
            {
                HttpContext.Current.Response.Redirect(ResolveUrl("~/Install/InstallWizard.aspx"));
            }
        }
        //private string GetUpgraderUrl()
        //{
        //    string upgradeLink = string.Empty;
        //    if (GetPortalID > 1)
        //    {
        //        upgradeLink = "~/portal/" + GetPortalSEOName + "/Admin/sfUpgrader" + Extension;
        //    }
        //    else
        //    {
        //        upgradeLink = "~/Admin/sfUpgrader" + Extension;
        //    }
        //    return upgradeLink;
        //}

        private void SetPortalCofig()
        {
            Hashtable hstPortals = GetPortals();
            SageUserControl suc = new SageUserControl();
            suc.PagePath = PagePath;
            int portalID = 1;
            #region "Get Portal SEO Name and PortalID"
            if (string.IsNullOrEmpty(Request.QueryString["ptSEO"]))
            {
                if (string.IsNullOrEmpty(PortalSEOName))
                {
                    PortalSEOName = GetDefaultPortalName(hstPortals, 1);
                }
                else if (!hstPortals.ContainsKey(PortalSEOName.ToLower().Trim()))
                {
                    PortalSEOName = GetDefaultPortalName(hstPortals, 1);
                }
                else
                {
                    portalID = int.Parse(hstPortals[PortalSEOName.ToLower().Trim()].ToString());
                }
            }
            else
            {
                PortalSEOName = Request.QueryString["ptSEO"].ToString().ToLower().Trim();
                portalID = Int32.Parse(Request.QueryString["ptlid"].ToString());
            }
            #endregion
            suc.SetPortalSEOName(PortalSEOName.ToLower().Trim());
            Session[SessionKeys.SageFrame_PortalSEOName] = PortalSEOName.ToLower().Trim();
            Session[SessionKeys.SageFrame_PortalID] = portalID;
            Session[SessionKeys.SageFrame_AdminTheme] = ThemeHelper.GetAdminTheme(GetPortalID, GetUsername);
            Globals.sysHst[ApplicationKeys.ActiveTemplate + "_" + portalID] = TemplateController.GetActiveTemplate(GetPortalID).TemplateSeoName;
            Globals.sysHst[ApplicationKeys.ActivePagePreset + "_" + portalID] = PresetHelper.LoadActivePagePreset(GetActiveTemplate, GetPageSEOName(Request.Url.ToString()));
            suc.SetPortalID(portalID);
            SetPortalID(portalID);
            #region "Set user credentials for modules"
            SecurityPolicy objSecurity = new SecurityPolicy();
            if (objSecurity.GetUser(GetPortalID) != string.Empty)
            {
                SettingProvider objSP = new SettingProvider();
                SageFrameConfig sfConfig = new SageFrameConfig();
                string strRoles = string.Empty;
                List<SageUserRole> sageUserRolles = objSP.RoleListGetByUsername(objSecurity.GetUser(GetPortalID), GetPortalID);
                if (sageUserRolles != null)
                {
                    foreach (SageUserRole userRole in sageUserRolles)
                    {
                        strRoles += userRole.RoleId + ",";
                    }
                }
                if (strRoles.Length > 1)
                {
                    strRoles = strRoles.Substring(0, strRoles.Length - 1);
                }
                if (strRoles.Length > 0)
                {
                    SetUserRoles(strRoles);
                }
            }
            #endregion
        }

        private void SetPageLoadPart()
        {
            ApplicationController objAppController = new ApplicationController();
            if (!objAppController.CheckRequestExtension(Request))
            {
                SagePageLoadPart();
            }
        }

        private void SagePageLoadPart()
        {
            if (!IsPostBack)
            {
                string sageNavigateUrl = string.Empty;
                SageFrameConfig sfConfig = new SageFrameConfig();

                if (!IsParent)
                {
                    sageNavigateUrl = GetParentURL + "/portal/" + GetPortalSEOName + "/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage).Replace(" ", "-") + SageFrameSettingKeys.PageExtension;
                }
                else
                {
                    sageNavigateUrl = GetParentURL + "/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage).Replace(" ", "-") + SageFrameSettingKeys.PageExtension;
                }
                hypHome.NavigateUrl = sageNavigateUrl;//GetHostURL + "/Admin/Admin" + Extension;
                // hypHome.Text = sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage);
                //hypHome.ImageUrl = GetAdminImageUrl("home.png", true);
                hypPreview.NavigateUrl = sageNavigateUrl;
                lnkAccount.NavigateUrl = GetProfileLink(sfConfig);
                Image imgProgress = (Image)UpdateProgress1.FindControl("imgPrgress");
                if (imgProgress != null)
                {
                    imgProgress.ImageUrl = GetAdminImageUrl("ajax-loader.gif", true);
                }
                // bool IsAdmin = false;
                SecurityPolicy objSecurity = new SecurityPolicy();
                FormsAuthenticationTicket ticket = objSecurity.GetUserTicket(GetPortalID);
                if (ticket != null)
                {
                    int LoggedInPortalID = int.Parse(ticket.UserData.ToString());
                    if (ticket.Name != ApplicationKeys.anonymousUser)
                    {
                        string[] sysRoles = SystemSetting.SYSTEM_SUPER_ROLES;
                        this.hypUpgrade.Visible = IsParent ? (Roles.IsUserInRole(ticket.Name, sysRoles[1]) ? true : false) : false;

                        if (GetPortalID == LoggedInPortalID || Roles.IsUserInRole(ticket.Name, sysRoles[0]))
                        {
                            RoleController _role = new RoleController();
                            string userinroles = _role.GetRoleNames(GetUsername, LoggedInPortalID);
                            if (userinroles != "" || userinroles != null)
                            {
                                bool isDashboardAccessible = false;
                                foreach (string role in sysRoles)
                                {
                                    if (userinroles.ToLower() == role)
                                    {
                                        isDashboardAccessible = true;
                                    }
                                }
                                if (!isDashboardAccessible)
                                {
                                    divAdminControlPanel.Visible = false;
                                }
                            }
                            else
                            {
                                divAdminControlPanel.Visible = false;
                            }
                        }
                        else
                        {
                            divAdminControlPanel.Visible = false;
                        }
                    }
                    else
                    {
                        divAdminControlPanel.Visible = false;
                    }

                }
                if (IsHandheld())
                {
                    divAdminControlPanel.Visible = false;
                }
            }
            SessionTrackerController sTracController = new SessionTrackerController();
            sTracController.SetSessionTrackerValues(GetPortalID.ToString(), GetUsername);
        }

        private void BindModuleControls()
        {
            string preFix = string.Empty;
            string paneName = string.Empty;
            string ControlSrc = string.Empty;
            string phdContainer = string.Empty;
            string PageSEOName = string.Empty;
            SageUserControl suc = new SageUserControl();
            string PageName = PagePath;
            if (PagePath == null)
            {
                PageName = PagePath;
            }
            else
            {
                PageName = PagePath;
            }
            suc.PagePath = PageName;
            if (PagePath != null)
            {
                PageSEOName = GetPageSEOName(PagePath);
            }
            else
            {
                SageFrameConfig sfConfig = new SageFrameConfig();
                PageSEOName = GetPageSEOName(sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage));
            }
            //:TODO: Need to get controlType and pageID from the selected page from routing path
            //string controlType = "0";
            //string pageID = "2";
            StringBuilder redirecPath = new StringBuilder();
            Uri url = HttpContext.Current.Request.Url;
            if (PageSEOName != string.Empty)
            {
                DataSet dsPageSettings = new DataSet();
                SageFrameConfig sfConfig = new SageFrameConfig();
                dsPageSettings = sfConfig.GetPageSettingsByPageSEONameForAdmin("1", PageSEOName, GetUsername);
                if (bool.Parse(dsPageSettings.Tables[0].Rows[0][0].ToString()) == true)// Is Page Exists
                {
                    if (bool.Parse(dsPageSettings.Tables[0].Rows[0][1].ToString()) == true)// Is Page Aceessable
                    {
                        // Get ModuleControls data table
                        DataTable dtPages = dsPageSettings.Tables[1];
                        if (dtPages != null && dtPages.Rows.Count > 0)
                        {
                            OverridePageInfo(dtPages);
                        }
                        // Get ModuleDefinitions data table
                        DataTable dtPageModule = dsPageSettings.Tables[2];
                        if (dtPageModule != null && dtPageModule.Rows.Count > 0)
                        {
                            for (int i = 0; i < dtPageModule.Rows.Count; i++)
                            {
                                paneName = dtPageModule.Rows[i]["PaneName"].ToString();
                                if (string.IsNullOrEmpty(paneName))
                                    paneName = "ContentPane";
                                string UserModuleID = dtPageModule.Rows[i]["UserModuleID"].ToString();
                                ControlSrc = "/" + dtPageModule.Rows[i]["ControlSrc"].ToString();
                                string SupportsPartialRendering = dtPageModule.Rows[i]["SupportsPartialRendering"].ToString();
                                PlaceHolder phdPlaceHolder = (PlaceHolder)this.FindControl(paneName);
                                if (paneName.ToLower().Equals("navigation")) { divNavigation.Attributes.Add("style", "display:block"); }
                                if (paneName.ToLower().Equals("middlemaincurrent")) { divRight.Attributes.Add("style", "display:block"); }
                                if (paneName.ToLower().Equals("cpanel")) { divBottompanel.Attributes.Add("style", "display:block"); }
                                if (paneName.ToLower().Equals("lefta")) { divLeft.Attributes.Add("style", "display:block"); }
                                if (phdPlaceHolder != null)
                                {
                                    //bool status = LoadModuleInfo(phdPlaceHolder, int.Parse(UserModuleID), 0);
                                    phdPlaceHolder = LoadControl(i.ToString(), bool.Parse(SupportsPartialRendering), phdPlaceHolder, ControlSrc, paneName, UserModuleID, "", "", false, new HtmlGenericControl("div"), new HtmlGenericControl("span"), false);
                                    // if (!status) { LoadModuleInfo(phdPlaceHolder, int.Parse(UserModuleID), 1); }
                                }
                            }
                        }
                    }
                    else
                    {
                        if (!IsParent)
                        {
                            redirecPath.Append(url.Scheme);
                            redirecPath.Append("://");
                            redirecPath.Append(url.Authority);
                            redirecPath.Append(PortalAPI.GetApplicationName);
                            redirecPath.Append("/portal/");
                            redirecPath.Append(GetPortalSEOName);
                            redirecPath.Append("/");
                            redirecPath.Append(PortalAPI.LoginPageWithExtension);
                        }
                        else
                        {
                            redirecPath.Append(url.Scheme);
                            redirecPath.Append("://");
                            redirecPath.Append(url.Authority);
                            redirecPath.Append(PortalAPI.LoginURL);
                        }
                        string strCurrentURL = Request.Url.ToString();
                        if (redirecPath.ToString().Contains("?"))
                        {
                            redirecPath.Append("&ReturnUrl=");
                            redirecPath.Append(strCurrentURL);
                        }
                        else
                        {
                            redirecPath.Append("?ReturnUrl=");
                            redirecPath.Append(strCurrentURL);
                        }
                        HttpContext.Current.Response.Redirect(redirecPath.ToString());
                    }
                }
                else
                {

                    if (!IsParent)
                    {
                        redirecPath.Append(url.Scheme);
                        redirecPath.Append("://");
                        redirecPath.Append(url.Authority);
                        redirecPath.Append(PortalAPI.GetApplicationName);
                        redirecPath.Append("/portal/");
                        redirecPath.Append(GetPortalSEOName);
                        redirecPath.Append("/");
                        redirecPath.Append(PortalAPI.PageNotFoundPageWithExtension);
                    }
                    else
                    {
                        redirecPath.Append(url.Scheme);
                        redirecPath.Append("://");
                        redirecPath.Append(url.Authority);
                        redirecPath.Append(PortalAPI.PageNotFoundURL);
                    }

                    Response.Redirect(ResolveUrl(redirecPath.ToString()));
                }
            }
        }

        private void LoadControl(PlaceHolder ContainerControl, string controlSource)
        {
            UserControl ctl = this.Page.LoadControl(controlSource) as UserControl;
            ctl.EnableViewState = true;
            ContainerControl.Controls.Add(ctl);
        }

        private string GetProfileLink(SageFrameConfig sfConfig)
        {
            string profileURL = "";
            if (!IsParent)
            {
                profileURL = GetParentURL + "/portal/" + GetPortalSEOName + "/" + "sfUser-Profile" + Extension;
            }
            else
            {
                profileURL = GetParentURL + "/Admin/" + "sfUser-Profile" + Extension;
            }
            return profileURL;
        }

        private bool LoadModuleInfo(PlaceHolder Container, int UserModuleID, int position)
        {
            bool status = false;
            ModuleMessageInfo objMessage = ModuleMessageController.GetModuleMessageByUserModuleID(UserModuleID, GetCurrentCulture());
            if (objMessage != null)
            {
                if (objMessage.IsActive)
                {
                    if (objMessage.MessagePosition == position)
                    {
                        string modeStyle = "sfPersist";
                        switch (objMessage.MessageMode)
                        {
                            case 0:
                                modeStyle = "sfPersist";
                                break;
                            case 1:
                                modeStyle = "sfSlideup";
                                break;
                            case 2:
                                modeStyle = "sfFadeout";
                                break;
                        }
                        string messageTypeStyle = "sfInfo";
                        switch (objMessage.MessageType)
                        {
                            case 0:
                                messageTypeStyle = "sfInfo";
                                break;
                            case 1:
                                messageTypeStyle = "sfWarning";
                                break;
                        }
                        string totalStyle = string.Format("{0} {1}", modeStyle, messageTypeStyle);
                        HtmlGenericControl moduleDiv = new HtmlGenericControl("div");
                        moduleDiv.Attributes.Add("class", "sfModuleinfo");
                        StringBuilder sb = new StringBuilder();
                        string CloseForEver = string.Format("close_{0}", UserModuleID);
                        sb.Append("<div class='" + totalStyle + "'><div class='sfLinks'><a class='sfClose' href='#'>Close</a>   <a class='sfNclose' id='" + CloseForEver + "' href='#'>Close and Never Show Again</a></div>");
                        sb.Append(objMessage.Message);
                        sb.Append("</div>");
                        moduleDiv.InnerHtml = sb.ToString();
                        Container.Controls.Add(moduleDiv);
                        status = true;
                    }
                }
            }
            return status;
        }

        protected void rdTemplate_SelectedIndexChanged(object sender, EventArgs e)
        {
            string themeCss = rdTemplate.SelectedValue;
            SettingProvider sageSP = new SettingProvider();
            sageSP.SaveSageSetting(SettingType.SiteAdmin.ToString(), SageFrameSettingKeys.DefaultAdminTheme, themeCss, GetUsername, GetPortalID.ToString());
        }

        protected void rdLeft_CheckedChanged(object sender, EventArgs e)
        {
            divSideBar.Attributes.Remove("style");
            divSideBar.Attributes.Add("style", "float:left");
            divSideBar.Attributes.Add("class", "sideBarLeft");
            SettingProvider sageSP = new SettingProvider();
            sageSP.SaveSageSetting(SettingType.SiteAdmin.ToString(), SageFrameSettingKeys.AdminSidebarPosition, "left", GetUsername, GetPortalID.ToString());
        }

        protected void rdRight_CheckedChanged(object sender, EventArgs e)
        {
            divSideBar.Attributes.Remove("style");
            divSideBar.Attributes.Add("style", "float:right");
            divSideBar.Attributes.Add("class", "sideBarRight");
            SettingProvider sageSP = new SettingProvider();
            sageSP.SaveSageSetting(SettingType.SiteAdmin.ToString(), SageFrameSettingKeys.AdminSidebarPosition, "right", GetUsername, GetPortalID.ToString());
        }

        #endregion

        #region SageFrameRoute Members

        public string PagePath
        {
            get;
            set;
        }

        public string PortalSEOName
        {
            get;
            set;
        }
        public string UserModuleID
        {
            get;
            set;
        }
        public string ControlType
        {
            get;
            set;
        }
        public string ControlMode { get; set; }
        public string Key { get; set; }
        public string Param { get; set; }
        #endregion

    }
}


text:
<?php

namespace Google\Service\ContainerAnalysis;

class Operation extends \Google\Model
{
  public $done;
  protected $errorType = Status::class;
  protected $errorDataType = '';
  public $metadata;
  public $name;
  public $response;

  public function setDone($done)
  {
    $this->done = $done;
  }
  public function getDone()
  {
    return $this->done;
  }
  /**
   * @param Status
   */
  public function setError(Status $error)
  {
    $this->error = $error;
  }
  /**
   * @return Status
   */
  public function getError()
  {
    return $this->error;
  }
  public function setMetadata($metadata)
  {
    $this->metadata = $metadata;
  }
  public function getMetadata()
  {
    return $this->metadata;
  }
  public function setName($name)
  {
    $this->name = $name;
  }
  public function getName()
  {
    return $this->name;
  }
  public function setResponse($response)
  {
    $this->response = $response;
  }
  public function getResponse()
  {
    return $this->response;
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Operation::class, 'Google_Service_ContainerAnalysis_Operation');

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Google\Service\Pubsub;

class BigQueryConfig extends \Google\Model
{
  /**
   * @var bool
   */
  public $dropUnknownFields;
  /**
   * @var string
   */
  public $state;
  /**
   * @var string
   */
  public $table;
  /**
   * @var bool
   */
  public $useTopicSchema;
  /**
   * @var bool
   */
  public $writeMetadata;

  /**
   * @param bool
   */
  public function setDropUnknownFields($dropUnknownFields)
  {
    $this->dropUnknownFields = $dropUnknownFields;
  }
  /**
   * @return bool
   */
  public function getDropUnknownFields()
  {
    return $this->dropUnknownFields;
  }
  /**
   * @param string
   */
  public function setState($state)
  {
    $this->state = $state;
  }
  /**
   * @return string
   */
  public function getState()
  {
    return $this->state;
  }
  /**
   * @param string
   */
  public function setTable($table)
  {
    $this->table = $table;
  }
  /**
   * @return string
   */
  public function getTable()
  {
    return $this->table;
  }
  /**
   * @param bool
   */
  public function setUseTopicSchema($useTopicSchema)
  {
    $this->useTopicSchema = $useTopicSchema;
  }
  /**
   * @return bool
   */
  public function getUseTopicSchema()
  {
    return $this->useTopicSchema;
  }
  /**
   * @param bool
   */
  public function setWriteMetadata($writeMetadata)
  {
    $this->writeMetadata = $writeMetadata;
  }
  /**
   * @return bool
   */
  public function getWriteMetadata()
  {
    return $this->writeMetadata;
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(BigQueryConfig::class, 'Google_Service_Pubsub_BigQueryConfig');


text:
layout: default
---

<article class="recently">

    {{ content }}

</article>


text:
<?php

namespace Gedmo\SoftDeleteable\Traits;

use DateTime;

/**
 * A generic trait to use on your self-deletable entities.
 * There is no mapping information defined in this trait.
 *
 * @author Wesley van Opdorp <wesley.van.opdorp@freshheads.com>
 */
trait SoftDeleteable
{
    /**
     * @var DateTime|null
     */
    protected $deletedAt;

    /**
     * Set or clear the deleted at timestamp.
     *
     * @return self
     */
    public function setDeletedAt(DateTime $deletedAt = null)
    {
        $this->deletedAt = $deletedAt;

        return $this;
    }

    /**
     * Get the deleted at timestamp value. Will return null if
     * the entity has not been soft deleted.
     *
     * @return DateTime|null
     */
    public function getDeletedAt()
    {
        return $this->deletedAt;
    }

    /**
     * Check if the entity has been soft deleted.
     *
     * @return bool
     */
    public function isDeleted()
    {
        return null !== $this->deletedAt;
    }
}


text:
require 'json'
require_relative '../../verify'

json = JSON.parse(File.read(File.join(__dir__, 'canonical-data.json')))

cases = by_property(json['cases'], %w(smallest largest))

# We can't actually get fancy here; searching by diagonal doesn't work.
# https://codereview.stackexchange.com/questions/63304/finding-palindromic-numbers-most-efficiently
# So just search linearly, trying to be a little smart:
# Terminate inner/outer searches when candidate can't beat winner.
# This is fast enough.
# If more is needed, maybe consider exploiting divisibility by 11,
# https://www.xarg.org/puzzle/project-euler/problem-4/
#
# (start: Int) number the search should start from.
# (range_from_start: Int => Range[Int]) make a range starting from the given start.
# (cmp: Symbol) symbol of comparison used to compare winner to a candidate
def palindromes(start, range_from_start, cmp)
  raise 'no' if range_from_start[start].size == 0

  winner = nil
  products = []
  range_from_start[start].each { |a|
    next if a % 10 == 0
    break if winner&.send(cmp, a * a)
    range_from_start[a].each { |b|
      product = a * b
      break if winner&.send(cmp, product)
      next if (d = product.digits).reverse != d
      if product == winner
        products << [a, b].sort
      else
        winner = product
        products = [[a, b].sort]
      end
    }
  }
  {'value' => winner, 'factors' => products}
end

def smallest(min, max)
  palindromes(min, ->x { x..max }, :<)
end

def largest(min, max)
  palindromes(max, ->x { x.downto(min) }, :>)
end

verify(cases['smallest'], property: 'smallest') { |i, _|
  smallest(i['min'], i['max'])
}

verify(cases['largest'], property: 'largest') { |i, _|
  largest(i['min'], i['max'])
}


text:
#Calculo del IMC
while True:
	peso = float(input("Introduzca su peso"))
	altura = float(input ("Introduzca su altura"))
	IMC=peso/altura**2
	print("IMC:",IMC)

	if IMC<=18.0:
	    print("Peso demasiado bajo")
	elif IMC<=24.9:
	    print("Su peso es normal felicidades")
	elif IMC<=29.9:
	    print("Tiene sobrepeso, vigile su dieta")
	elif IMC>29.9:
	    print("Obesidad grave, consulte su médico")
	res=input("Desea salir el programa?: ")
	if res=="si" or res=="Si" or res=="yes":
		break
print("Fin del programa ")


text:
extern "C" {
#endif

void callJavaMethod(JNIEnv *env, jobject thiz) {
    jclass clazz = env->FindClass("com/ryg/JniTestApp/MainActivity");
    if (clazz == NULL) {
        printf("find class MainActivity error!");
        return;
    }
    jmethodID id = env->GetStaticMethodID(clazz, "methodCalledByJni", "(Ljava/lang/String;)V");
    if (id == NULL) {
        printf("find method methodCalledByJni error!");
    }
    jstring msg = env->NewStringUTF("msg send by callJavaMethod in test.cpp.");
    env->CallStaticVoidMethod(clazz, id, msg);
}

jstring Java_com_ryg_JniTestApp_MainActivity_get(JNIEnv *env, jobject thiz) {
    printf("invoke get in c++\n");
    callJavaMethod(env, thiz);
    return env->NewStringUTF("Hello from JNI in libjni-test.so !");
}

void Java_com_ryg_JniTestApp_MainActivity_set(JNIEnv *env, jobject thiz, jstring string) {
    printf("invoke set from C++\n");
    char* str = (char*)env->GetStringUTFChars(string,NULL);
    printf("%s\n", str);
    env->ReleaseStringUTFChars(string, str);
}

#ifdef __cplusplus
}
#endif


text:
<?php $this->load->view('themes/webmin/header'); ?>
<?php $this->load->view('themes/webmin/sidebar'); ?>

Pengaturan

<a href="<?php echo base_url('dashboard')?>">Menu Lain

Pengaturan

Pengaturan Sistem

                <?php if($alert) echo ($alert->status == 'success' ? showAlertSuccess() : showAlertDanger());  ?>
                <form action="<?php echo site_url('webmin/pengaturan/process') ?>" method="post" class="form-horizontal" autocomplete="off">

                            Tahun

                            <input type="number" min="1945" name="dt[tahun]" class="form-control" value="<?php echo $data->tahun ?>" required>
                            <?php if(date('Y') != $data->tahun){ ?>

                                Jangan lupa untuk mengubah tahun sesuai tahun sekarang: <?php echo date('Y') ?>

                            <?php } ?>

Fitur Voting

                            Tanggal Buka

                            <input type="text" name="dt[tanggal_buka]" class="form-control datepicker" value="<?php echo $data->tanggal_buka ?>" required>

                            Tanggal Tutup

                            <input type="text" name="dt[tanggal_tutup]" class="form-control datepicker" value="<?php echo $data->tanggal_tutup ?>" required>

                            <button class="btn btn-primary" type="submit">  Simpan</button>
                            <button type="button" onclick="goBack()" class="btn btn-danger">  Kembali</button>

                </form>

<?php $this->load->view('themes/footer-script'); ?>

<?php $this->load->view('themes/footer'); ?>


text:
set(CMAKE_DEPENDS_LANGUAGES
  "C"
  )
# The set of files for implicit dependencies of each language:
set(CMAKE_DEPENDS_CHECK_C
  "D:/Lucia/Dependencies/glew/src/glew.c" "D:/Lucia/Dependencies/glew/build/CMakeFiles/glew.dir/D_/Lucia/Dependencies/glew/src/glew.obj"
  )
set(CMAKE_C_COMPILER_ID "GNU")

# Preprocessor definitions for this target.
set(CMAKE_TARGET_DEFINITIONS_C
  "GLEW_BUILD"
  "GLEW_NO_GLU"
  )

# The include file search paths:
set(CMAKE_C_TARGET_INCLUDE_PATH
  "cmake/../../include"
  )

# Targets to which this target links.
set(CMAKE_TARGET_LINKED_INFO_FILES
  )

# Fortran module output directory.
set(CMAKE_Fortran_TARGET_MODULE_DIR "")


text:
<!--
  Copyright 2015 Google Inc.

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

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

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

<resources>
    <dimen name="main_clock_height">36dp</dimen>
    <dimen name="main_clock_spacing">4dp</dimen>
    <integer name="main_clock_glyph_anim_delay">500</integer>
    <integer name="main_clock_glyph_anim_duration">2000</integer>

    <dimen name="seconds_clock_height">16dp</dimen>
    <dimen name="seconds_clock_spacing">3dp</dimen>
    <integer name="seconds_clock_glyph_anim_delay">0</integer>
    <integer name="seconds_clock_glyph_anim_duration">750</integer>

    <dimen name="clock_seconds_spacing">5dp</dimen>
</resources>


text:
import { log } from '../helpers/log';
import { ParsedTotals } from '../types';

export function verifyTotals<T extends object>(
	type: string,
	version: string,
	data: T,
	totals: ParsedTotals,
): T {
	// v1.0 doesnt have totals
	if (version === '1.0') {
		return data;
	}

	const totalsToCheck: Record<string, number> = {};

	// Gather totals
	Object.values(data).forEach((emoji) => {
		(emoji as { property: string[] }).property.forEach((property: string) => {
			if (totalsToCheck[property]) {
				totalsToCheck[property] += 1;
			} else {
				totalsToCheck[property] = 1;
			}
		});
	});

	// Check totals
	Object.keys(totals).forEach((property) => {
		if (property in totalsToCheck) {
			const expected = totals[property];
			const actual = totalsToCheck[property];

			if (actual !== expected) {
				log.error(
					'verify',
					`Invalid ${version} ${property} count detected. ` +
						`Expected ${expected}, found ${actual}`,
				);
			}
		}

		delete totalsToCheck[property];
	});

	// Check for unknowns
	Object.keys(totalsToCheck).forEach((property) => {
		log.error('verify', `Unknown ${version} ${type} property ${property}`);
	});

	return data;
}


text:
<?php
print "
Methods: Animating the owner's avatar.
";
?>

    	<?php print wtheadline('Animating the owner\'s avatar', 'requires a one time permissions request which is sent during the first anim() activity. After the permissions have been granted, the breed can trigger a variety of animations upon the owner, seamlessly.'); ?>

        	<?php print method_profile(
'anim',
'[ animation [ , duration ] ]',
array(
'animation','name of the animation, must be within the contents of the breed object or this method will silently fail.',
'duration','set a timeout, in seconds, so you can loop the animation for a controled period of time. Without the duration, the animation persists and remains active until released.'
),
actions_code('"start",
"anim(animation, 10)"'),
'play an animation for 10 seconds',
actions_code('"start",
"anim(animation, 0)"'),
'release the animation after one cycle',
actions_code('"start",
"anim()"'),
'release all animations',
actions_code('"start",
"anim(animation, -1)"'),
'release a specific animation'
);?>

Pet the breed on arrival

			<?php print actions_code('"start",
"bind(touch, owner, come)",

"come",
"move(%owner_pos%,<0,0,0>,walk,normal,arrived)",

"arrived",
"anim(pet,10)"');?>

When touched by the owner, the breed comes to the owner's position. When the breed arrives, the owner is animated for 10 seconds. This example requires an animation named "pet".


text:
FROM php:fpm
MAINTAINER Marcelo Andrade <marcelo@digintent.com>

COPY docker/sources.list /etc/apt/
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update -y && \
	apt-get install -y --force-yes \
	--no-install-recommends \
	-o Dpkg::Options::="--force-confdef" \
	-o Dpkg::Options::="--force-confold" \
	git-core \
	curl \
	wget \
	zlib1g-dev
RUN curl -sS https://getcomposer.org/installer | php && \
    mv composer.phar /usr/local/bin/composer
RUN docker-php-ext-install mbstring
RUN docker-php-ext-install pcntl
RUN docker-php-ext-install zip
RUN pecl install memcached
RUN composer global require fabpot/php-cs-fixer
ENV PATH $PATH:/root/.composer/vendor/bin

WORKDIR /app

CMD ["php", "-a"]


text:
```c

v1 -> v2:

- Use copy_to_iter() to send control queue response

This patch series causes vhost-scsi control queue TMF requests to be
explicitly rejected rather than implicitly ignored in order to prevent
a guest virito-scsi driver to wait indefinitely for a response to a SCSI
TMF request.

In addition, control queue address notification operations
(VIRTIO_SCSI_T_AN_*) get an effective no-op response.

Patch 1/4 implements a control queue handler modeled after the existing
request queue handler.  There is no commonality between the two handlers.

Patch 2/4 factors out the common processing code from the control queue
handler into separate routines.

Patch 3/4 modifies the request handler to use the common processing routines.

Patch 4/4 uses copy_to_iter() to send back control queue responses.

Bijan Mottahedeh (4):
  vhost/scsi: Respond to control queue operations
  vhost/scsi: Extract common handling code from control queue handler
  vhost/scsi: Use common handling code in request queue handler
  vhost/scsi: Use copy_to_iter() to send control queue response

 drivers/vhost/scsi.c | 426 +++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 330 insertions(+), 96 deletions(-)
```
#### [PATCH kvmtool 00/13] Implement reset of virtio devices
##### From: Julien Thierry <julien.thierry@arm.com>

```c

Hi,

This series was developped by Jean-Philippe and is needed for a series
I'll be posting shortly after to load firmwares on arm kvmtool.

Currently, when a guest tries to reset a device, a lot of ressources
aren't reset (threads keep running, virtio queue keep their state, etc).

When the guest only does the reset to initialize the device and there
were no previous users, there is no noticeable issue. But when a guest
has a firmare + Linux, if the firmware uses a virtio device, Linux will
fail to probe that device.

This series aim to properly reset the virtio resources when the guests
requests it.

Reset of net vhost is unsupported for now.

Patch 1 is a bug fix on ioeventfd
Patch 2-6 provide the core support so devices can implement their reset
Patch 7-13 implements the reset for the various virtio devices

Thanks,

Julien

-->

Jean-Philippe Brucker (13):
  ioeventfd: Fix removal of ioeventfd
  virtio: Implement notify_status
  virtio: Add get_vq_count() callback
  virtio: Add get_vq() callback
  virtio: Add exit_vq() callback
  virtio: Add reset() callback
  net/uip: Add exit function
  virtio/net: Clean virtqueue state
  virtio/net: Implement device and virtqueue reset
  virtio/blk: Reset virtqueue
  threadpool: Add cancel() function
  virtio/p9: Implement reset
  virtio/console: Implement reset

 include/kvm/threadpool.h  |   2 +
 include/kvm/uip.h         |   6 ++
 include/kvm/virtio-mmio.h |   1 +
 include/kvm/virtio-pci.h  |   1 +
 include/kvm/virtio.h      |  30 ++++++-
 ioeventfd.c               |   6 +-
 net/uip/core.c            |  17 ++++
 net/uip/dhcp.c            |   6 ++
 net/uip/tcp.c             |  54 ++++++++++---
 net/uip/udp.c             |  41 ++++++++--
 util/threadpool.c         |  25 +++++-
 virtio/9p.c               |  33 +++++++-
 virtio/balloon.c          |  17 +++-
 virtio/blk.c              |  84 ++++++++++++++------
 virtio/console.c          |  49 ++++++++----
 virtio/core.c             |  42 ++++++++++
 virtio/mmio.c             |  52 +++++++++----
 virtio/net.c              | 195 +++++++++++++++++++++++++++++++++-------------
 virtio/pci.c              |  49 ++++++++----
 virtio/rng.c              |  12 ++-
 virtio/scsi.c             |  17 +++-
 21 files changed, 582 insertions(+), 157 deletions(-)
---
1.9.1
```
#### [PATCH kvmtool 0/6] arm: Add support for firmware booting
##### From: Julien Thierry <julien.thierry@arm.com>

```c

Hi,

This series is based on the virtio reset series posted earlier:
https://marc.info/?l=kvm&m=154392174625966&w=2

We would like to be able to load firmwares like UEFI in kvmtool.

The series contains:
A way to load the firmware into RAM and an option to be able to create
non-volatile memory zones and load data into them.

Those non-volatile memory are presented throught the DT with a node:

	<name>@<addr> {
		compatible = "kvmtool,<name>";
		reg = < <addr> <size> >;
	}

These are expected to be dealt with by specific kvmtool driver and not
to be picked up by existing drivers (although technically it is just
plain memory, mapped in the guest).

Cheers,

Julien

-->

Julien Thierry (5):
  arm: Move firmware function
  builtin-run: Do not look for default kernel when firmware is provided
  arm: Support firmware loading
  kvm: Add arch specific reset
  arm: Support non-volatile memory

Sami Mujawar (1):
  rtc: Initialize the Register D for MC146818 RTC

 arm/fdt.c                                |  67 ++++++++--
 arm/include/arm-common/kvm-arch.h        |   5 +-
 arm/include/arm-common/kvm-config-arch.h |  21 +++-
 arm/kvm.c                                | 204 +++++++++++++++++++++++++++++++
 builtin-run.c                            |  24 ++--
 hw/rtc.c                                 |   8 ++
 include/kvm/kvm.h                        |   1 +
 kvm.c                                    |   2 +
 mips/kvm.c                               |   4 +
 powerpc/kvm.c                            |   4 +
 x86/kvm.c                                |   4 +
 11 files changed, 323 insertions(+), 21 deletions(-)
---
1.9.1
```
#### [kvm-unit-tests PATCH 0/5] s390x: Add cross hypervisor and disk boot
##### From: Janosch Frank <frankja@linux.ibm.com>

```c

With these patches kvm unit tests are now bootable under LPAR and
z/VM, as well as from KVM disks. Don't forget to convert the ELF files
to binary via:

objcopy -O binary s390x/test.elf test.bin

For this to work we added:
    * Initial PSW in lowcore
    * Switch to 64 bit and z/Arch
    * SCLP linemode console

This is an early version, linemode currently splits lines a bit too
often and I still need to polish comments and cleanup code.

Janosch Frank (5):
  s390x: Make tests bootable from disk
  s390x: Switch to z/Arch if needed
  s390x: Add BSS clearing for non ELF boot
  s390x: Use interrupts in SCLP and add line mode
  s390x: Fix sclp-ascii.c indents

 lib/s390x/asm/arch_def.h  |   1 +
 lib/s390x/asm/interrupt.h |   2 +
 lib/s390x/interrupt.c     |  12 ++-
 lib/s390x/io.c            |   2 +-
 lib/s390x/sclp-ascii.c    | 220 ++++++++++++++++++++++++++++++++++++++--------
 lib/s390x/sclp.c          |  42 +++++++++
 lib/s390x/sclp.h          |  71 ++++++++++++++-
 s390x/cstart64.S          |  40 ++++++++-
 s390x/flat.lds            |  10 ++-
 9 files changed, 357 insertions(+), 43 deletions(-)
```
#### [PATCH v1 0/2] Use DIAG318 to set Control Program Name & Version
##### From: Collin Walling <walling@linux.ibm.com>

```c

Changelog

    RFC -> v1
        - set distro_id to 0 for now and will be introduced properly as a follow-on
            patch with further details wrt its usage
        - created diag318 union structure to contain CPC data in kvm
        - removed VCPU_EVENT from diag318 handler (we still see a VM_EVENT)

A new diagnose instruction, 318, allows the kernel to set an 8-byte "Control
Program Code" (CPC) that is composed of:

    1-byte Control Program Name Code (CPNC)
    7-byte Control Program Version Code (CPVC) composed of:
        3-bytes for Linux Kernel version (determined at build-time)
        3-bytes for *Distribution Identifier (currently set to 0)
        1-byte trailing NULL

*The distribution identifier will be introduced as a follow-on patch.

This instruction call is executed once-and-only-once during Kernel setup.
The availability of this instruction depends on Read SCP Info byte 134, bit 0.
Diagnose318's functionality is also emulated by KVM, which means we can
enable this feature for a guest even if the host kernel cannot support it.

The CPNC and CPVC are used for problem diagnosis and allows IBM to identify
control program information by answering the following questions:

    "What environment is this guest running in?" (CPNC)
    "What linux version is this guest running?" (CPVC)

Collin Walling (2):
  s390/setup: set control program code via diag 318
  s390/kvm: handle diagnose 318 instruction call

 arch/s390/include/asm/diag.h     | 12 ++++++
 arch/s390/include/asm/kvm_host.h | 13 +++++-
 arch/s390/include/asm/sclp.h     |  1 +
 arch/s390/include/uapi/asm/kvm.h |  5 +++
 arch/s390/kernel/diag.c          |  1 +
 arch/s390/kernel/setup.c         | 21 ++++++++++
 arch/s390/kvm/diag.c             | 12 ++++++
 arch/s390/kvm/kvm-s390.c         | 88 ++++++++++++++++++++++++++++++++++++++++
 arch/s390/kvm/kvm-s390.h         |  1 +
 drivers/s390/char/sclp.h         |  4 +-
 drivers/s390/char/sclp_early.c   |  2 +
 11 files changed, 158 insertions(+), 2 deletions(-)
```


text:
package org.apache.distributedlog.common.config;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

/**
 * Unit test of {@link ConcurrentBaseConfiguration}.
 */
public class TestConcurrentBaseConfiguration {

    @Test(timeout = 20000)
    public void testBasicOperations() throws Exception {
        ConcurrentBaseConfiguration conf = new ConcurrentBaseConfiguration();
        conf.setProperty("prop1", "1");
        assertEquals(1, conf.getInt("prop1"));
        conf.setProperty("prop1", "2");
        assertEquals(2, conf.getInt("prop1"));
        conf.clearProperty("prop1");
        assertEquals(null, conf.getInteger("prop1", null));
        conf.setProperty("prop1", "1");
        conf.setProperty("prop2", "2");
        assertEquals(1, conf.getInt("prop1"));
        assertEquals(2, conf.getInt("prop2"));
        conf.clearProperty("prop1");
        assertEquals(null, conf.getInteger("prop1", null));
        assertEquals(2, conf.getInt("prop2"));
    }

}


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('forms', '0002_turnexform_publish'),
    ]

    operations = [
        migrations.AddField(
            model_name='turnexform',
            name='order',
            field=models.IntegerField(default=0),
            preserve_default=False,
        ),
    ]


text:
// source:

package nl.uva.vlet.data;

import java.io.Serializable;
import java.net.URI;
import java.net.URL;
import java.util.Date;
import java.util.Vector;

import nl.uva.vlet.Global;
import nl.uva.vlet.exception.VRLSyntaxException;
import nl.uva.vlet.presentation.Presentation;
import nl.uva.vlet.vrl.VRL;

/**
 * This class provides a high level interface to resource Attributes.
 *

 * It is implemented using a {type, name,
 * value triple, so that runtime type and name checking can be
 * performed.

 * The VAttributes does not do any type checking, so casting is possible. a
 * getStringValue() after a setValue(int) will return the string representation
 * of the int. Currently the attributes are stored as (java) Strings so this
 * class is not efficient for large binary attributes.

 *

 *
 * @author P.T. de Boer
 */

public class VAttribute implements Cloneable, Serializable, Duplicatable<VAttribute>
{
    private static final long serialVersionUID = 6729623290452678587L;

    private static String booleanEnumValues[] =
    { "false", "true" };

    // ========================================================================
    // Class Methods
    // ========================================================================
    /**
     * Parses a name=value statement Optionally this supports a type
     *
     * @param stat
     * @return
     */
    public static VAttribute createFromAssignment(String stat)
    {
        String strs[] = stat.split("[ ]*=[ ]*");

        if ((strs == null) || (strs.length < 2))
            return null;

        // parse result
        return createFrom(strs[0], strs[1]);
    }

    /**
     * VAtribute Factory: inspect object and create Typed VAttribute.
     * Performance note: since this factory just tries a lot of different
     * methods to parse/check the object value, this method is not efficient.
     */
    public static VAttribute createFrom(String keystr, Object value)
    {
        return new VAttribute(keystr, value);
    }

    public static VAttribute createFromString(VAttributeType attrType, String attrName, String valueStr)
    {
        return new VAttribute(attrType,attrName,valueStr);
    }

    /**
     * Type safe factory method. Object must have specified type
     */
    public static VAttribute createFrom(VAttributeType type, String name, Object value)
    {
        // null value is allowed:
        if (value==null)
            return new VAttribute(type,name, null);

        VAttributeType objType = VAttributeType.getObjectType(value, null);
        if (objType != type)
            throw new Error("Incompatible Object Type. Specified type=" + type + ", object type=" + objType);

        return new VAttribute(type, name, value.toString());
    }

    public static VAttribute createEnumerate(String name, String values[], String value)
    {
        return new VAttribute(name, values, value);
    }

    /**
     * Create From {Name,Type,Value} triple. Type string must match on of
     * VAttributeType !
     */

    public static VAttribute createFromString(String type, String name, String value)
    {
        VAttributeType aType = VAttributeType.valueOf(type);
        return new VAttribute(aType, name, value);
    }

    /**
     * Create DateTime Attribute from nr of millis since Epoch.
     */
    public static VAttribute createDateSinceEpoch(String name, long millis)
    {
        // store as normalized time string:
        String timeStr = Presentation.createNormalizedDateTimeString(millis);
        return new VAttribute(VAttributeType.TIME, name, timeStr);
    }

    /**
     * Create DateTime Attribute from Unix Time using Milli Seconds !
     */
    public static VAttribute createUnixTimeAttribute(String name, long millis)
    {
        return createDateSinceEpoch(name, millis);
    }

    /**
     * Create Date Attribute
     */
    public static VAttribute createFromDate(String name, Date date)
    {
        return new VAttribute(name, date);
    }

    // ========================================================================
    // Instance
    // ========================================================================

    /** The type of the VAttribute */
    private VAttributeType type = null;

    /** The name of the attribute */
    private String name = null;

    /** Current implementation is to store the VAttribute value as a String */
    // Optional implementation: int intVal long longVal float floatVal double
    // doubleVal etc...
    private String value = null;

    /** Whether attribute is editable. */
    private boolean editable = false;

    /** List of enum values, index enumValue determines which enum value is set */
    private StringList enumValues = null;

    /** index into enumValues[] so that: enumAvalues[enumIndex]==value */
    private int enumIndex = 0;

    /** Optional dynamic help text */
    private String helpText;

    private boolean changed;

    /**
     * Main init method to be called by other constructors.

     * This method may only be used by contructors.
     */
    protected int init(VAttributeType type, String name, String value)
    {
        this.type = type;
        this.name = name;
        this.value = value;
        return 0;
    }

    protected void init(VAttributeType type, String name, long value)
    {
        this.type = type;
        this.name = name;
        this.value = "" + value;
    }

    protected void init(String name, boolean b_value)
    {
        init(VAttributeType.BOOLEAN, name, "" + new Boolean(b_value));
    }

    protected void init(String name, String s_value)
    {
        init(VAttributeType.STRING, name, s_value);
    }

    protected void init(String name, int int_value)
    {
        init(VAttributeType.INT, name, "" + new Integer(int_value));
    }

    /** Initialize as Enum Type */
    protected void init(String name, StringList enumValues, int enumIndex)
    {
        this.name = name;
        this.type = VAttributeType.ENUM;
        this.enumValues = enumValues;
        this.enumIndex = enumIndex;

        if ((enumValues != null) && (enumIndex >= 0) && (enumIndex < enumValues.size()))
        {
            this.value = enumValues.get(enumIndex);
        }
        else
        {
            Global.errorPrintf(this, "Error enumIndex out of bound:%d\n", enumIndex);
            value = "";
        }
    }

    protected void init(String name, long long_value)
    {
        Long l = new Long(long_value);

        this.value = l.toString();
        this.name = name;
        this.type = VAttributeType.LONG;
    }

    protected void init(String name, float float_value)
    {
        Float f = new Float(float_value);

        this.value = f.toString();
        this.name = name;
        this.type = VAttributeType.FLOAT;
    }

    protected void init(String name, double val)
    {
        Double d = new Double(val);

        this.value = d.toString();
        this.name = name;
        this.type = VAttributeType.DOUBLE;
    }

    protected void init(String name, Date date)
    {
        // store as normalized time string:
        String timeStr = Presentation.createNormalizedDateTimeString(date);
        init(VAttributeType.TIME, name, timeStr);
    }

    /** Copy Constructor */
    public VAttribute(VAttribute source)
    {
        copyFrom(source);
    }

    protected void copyFrom(VAttribute source)
    {
        // Duplicate String objects: !

        init(source.type, (source.name != null) ? new String(source.name) : "", (source.value != null) ? new String(
                source.value) : "");

        this.editable = source.editable;
        this.enumIndex = source.enumIndex;
        this.enumValues = source.enumValues;
        this.helpText = source.helpText;
        this.changed = false; // new Attribute: reset 'changed' flag.
    }

    /** Constructor to create a 'int' typed and named VAttribute */
    public VAttribute(String name, int val)
    {
        init(name, val);
    }

    /** Constructor to create a 'long' typed and named VAttribute */
    public VAttribute(String name, long val)
    {
        init(name, val);
    }

    /** Constructor to create a 'float' typed and named VAttribute */
    public VAttribute(String name, float val)
    {
        init(name, val);
    }

    /** Constructor to create a 'double' typed and named VAttribute */
    public VAttribute(String name, double val)
    {
        init(name, val);
    }

    /** Constructor to create a enum list of string */
    public VAttribute(String name, String enumValues[], int enumVal)
    {
        init(name, new StringList(enumValues), enumVal);
    }

    /** Constructor to create a enum list of string */
    public VAttribute(String name, StringList enumValues, int enumVal)
    {
        init(name, enumValues, enumVal);
    }

    public VAttribute(String name, Object value)
    {
        this.name = name;
        initValue(value);
    }

    /** Set Value by Object ! */
    protected void initValue(Object value)
    {
        // ===
        // VAttribute itself !
        // ===
        if (value instanceof VAttribute)
        {
            String orgName = this.name;
            this.copyFrom((VAttribute) value);
            this.name = orgName; // Keep Name !
            return;
        }

        if ((value instanceof VRL) || (value instanceof URI) || (value instanceof URL))
        {
            init(VAttributeType.VRL, name, value.toString());
            return;
        }

        boolean recognized = true;
        //
        // try java.lang classes:
        //
        if (value instanceof String)
            init(name, value.toString());
        else if (value instanceof Boolean)
            init(VAttributeType.BOOLEAN, name, value.toString());
        else if (value instanceof Byte)
            init(VAttributeType.INT, name, value.toString());
        else if (value instanceof Integer)
            init(VAttributeType.INT, name, value.toString());
        else if (value instanceof Long)
            init(VAttributeType.LONG, name, value.toString());
        else if (value instanceof java.lang.Character)
            init(VAttributeType.STRING, name, "" + value);
        else if (value instanceof Float)
            init(name, ((Float) value).doubleValue());
        else if (value instanceof Double)
            init(name, ((Double) value).doubleValue());
        else if (value instanceof Date)
            init(name, (Date) value);
        else
        {
            recognized = false;
        }

        if (recognized == true)
            return;

        // Can not use Boolean.parseBoolean() since that returns
        // the value 'false' for anything other than the string value 'true' !
        String str = value.toString();

        if (str.compareToIgnoreCase("true") == 0)
        {
            init(name, true);
            return;
        }
        else if (str.compareToIgnoreCase("false") == 0)
        {
            init(name, false);
            return;
        }

        try
        {
            // try to parse the object value string:
            Long lVal = Long.parseLong(value.toString());
            if (lVal != null)
            {
                init(name, lVal);
                return;
            }
        }
        catch (Throwable e)
        {
            ;
        } // not Long

        try
        {
            // try to parse the object value string:
            Double dVal = Double.parseDouble(value.toString());
            if (dVal != null)
            {
                init(name, dVal);
                return;
            }
        }
        catch (Throwable e)
        {
            ;
        }

        // VRL/URI
        String uristr = value.toString();
        try
        {
            VRL vrl = new VRL(uristr);
            init(VAttributeType.VRL, name, vrl.toString());
            return;
        }
        catch (VRLSyntaxException e)
        {
            ;//
        }

        init(VAttributeType.STRING, name, value.toString());
    }

    /**
     * Create new Enumerated VAttribute with enumVals as possible values and
     * defaultVal (which must be element of enumVals) as default
     */
    public VAttribute(String name, String[] enumVals, String defaultVal)
    {
        int index = 0; // use default of 0!

        if ((enumVals == null) || (enumVals.length <= 0))
            throw new NullPointerException("Cannot not have empty enum value list !");
        StringList enums = new StringList(enumVals);

        // robuustness! add defaultVal if not in enumVals!
        enums.add(defaultVal, true);

        index = enums.find(defaultVal);

        if (index < 0)
            index = 0;

        init(name, enums, index);
    }

    /** Anonymous String typed Value */
    /*
     * public VAttribute(String value) { init(VAttributeType.STRING, null,
     * value); }
     */

    /** Named String typed Value */
    public VAttribute(String name, String value)
    {
        init(VAttributeType.STRING, name, value);
    }

    /** Custom named & typed Attribute */
    public VAttribute(VAttributeType type, String name, String value)
    {
        init(type, name, value);
    }

    /** Custom named & typed Attribute */
    public VAttribute(VAttributeType type, String name, long value)
    {
        init(type, name, value);
    }

    public VAttribute(String name, VRL url)
    {
        init(VAttributeType.VRL, name, "" + url);
    }

    public VAttribute(String keystr, Date date)
    {
        init(keystr, date);
    }

    /**
     * Return duplicate of this object. This method returns the same class
     * instead of the object.clone() method All values are copied.
     *
     * @return
     */

    public VAttribute clone()
    {
        return duplicate(false);
    }

    public VAttribute duplicate()
    {
        return duplicate(false);
    }

    @Override
    public boolean shallowSupported()
    {
        return false;
    }

    @Override
    public VAttribute duplicate(boolean shallow)
    {
        return new VAttribute(this);
    }

    // =================================================================
    // Instance Getters/Setters
    // =================================================================

    /**
     * Get Name of Attribute. Note that the Name may never change during the
     * lifetime of an VAttribute !
     */
    public String getName()
    {
        return this.name;
    }

    /**
     * Get Type of Attribute. Note that the Type may never change during the
     * lifetime of an VAttribute !
     */
    public VAttributeType getType()
    {
        return type;
    }

    /**
     * Return value as actual Java Object with the specified type. This will
     * return an object with a type compatible with VAttributeType class.
     */
    public Object getValueObject()
    {
        if (value==null)
            return null;

        try
        {
            switch (this.type)
            {
                case BOOLEAN:
                    return new Boolean(value);
                case INT:
                    return new Integer(value);
                case LONG:
                    return new Long(value);
                case FLOAT:
                    return new Float(value);
                case DOUBLE:
                    return new Double(value);
                case ENUM:
                    return new String(value);
                case STRING:
                    return new String(value);// duplicate !
                case VRL:
                    return new VRL(value);
                case TIME:
                    return getDateValue();
                default:
                {
                    // OOpsy
                    Global.errorPrintf(this, "***Error: toObject(): Attribute type not supported:%s\n", this);
                    return null;
                }

            }
        }
        // interpret errors:
        catch (VRLSyntaxException e)
        {
            // low level error:
            Global.errorPrintf(this, "***Error: toObject(): Syntax Error for VRL:%s\n", this);
            return null;
        }
        catch (NumberFormatException e)
        {
            // low level error:
            Global.errorPrintf(this, "***Error: toObject(): Syntax Error for:%s\n", value);
            Global.errorPrintf(this, "*** Error: toObject():%s\n", e.getMessage());
            return null;

        }
        catch (Throwable e)
        {
            // low level error:
            Global.errorPrintf(this, "***Error: toObject(): Object conversion error for:%s", value);
            Global.errorPrintStacktrace(e);
            return null;
        }
    }

    /**
     * Return Value as String. To Actual get the typed object used
     * getValueObject()
     */
    public String getValue()
    {
        return value;
    }

    /** Explicit return Value as String */
    public String getStringValue()
    {
        return value;
    }

    /** Get String list of enumeration types */
    public String[] getEnumValues()
    {
        if (type == VAttributeType.ENUM)
        {
            if (enumValues == null)
                return null;
            else
                return enumValues.toArray();
        }

        if (type == VAttributeType.BOOLEAN)
            return booleanEnumValues;

        return null;
    }

    /** Return enum order of current value */
    public int getEnumIndex()
    {
        if (type == VAttributeType.ENUM)
            return enumIndex;

        if (type == VAttributeType.BOOLEAN)
            return (getBooleanValue() ? 1 : 0);

        return 0;
    }

    public boolean hasEnumValue(String val)
    {
        return this.enumValues.contains(val);
    }

    public boolean hasSetValue(String val)
    {
        // Set is Enum:
        return this.hasEnumValue(val);
    }

    // Formatters/Stringifiers

    /** For (debug) printing to stdout only. This is NOT a serializer */
    public String toString()
    {
        String enumStr = "";

        if (isEnumType())
        {
            enumStr = ",{";

            if (this.enumValues != null)
                for (int i = 0; i < this.enumValues.size(); i++)
                {
                    enumStr = enumStr + enumValues.get(i);
                    if (i + 1 < enumValues.size())
                        enumStr = enumStr + ",";
                }

            enumStr = enumStr + "}";

        }

        // convert to VAttribute Triplet
        return "{" + type + "," + name + "," + value + enumStr + ",[" + ((isEditable()) ? "E" : "")
                + ((hasChanged()) ? "C" : "") + "]}";
    }

    public String setValue(String val)
    {
        String oldval=value;
        _setValue(val);
        return oldval;
    }

    /** Set value by object */
    public Object setValue(Object obj)
    {
        Object prev=this.value;
        if (obj==null)
        {
            _setValue(null);
        }
        else
        {
            String strvalue=null;

            if (obj instanceof String)
                strvalue=(String)obj;
            else
                strvalue=obj.toString();

            _setValue(strvalue);
        }

        return prev;
    }

    /** Copy value form other VAttribute, but keep current type and flags */
    public void setValueFrom(VAttribute otherAttr)
    {
        _setValue(otherAttr.value); // private copy
    }

    /** Actual setter implemenetation */
    protected String _setValue(String val)
    {
        String orgVal = value;
        if (val == null)
            value = ""; // null not allowed => auto cast
        else
            value = new String(val); // create private copy

        // update enum index:
        if (type == VAttributeType.ENUM)
        {
            // ? auto set, checks should already have been done before this
            // code.
            // if (enumValues==null)
            // {
            // enumValues=new StringList(val);
            // }

            this.enumIndex = enumValues.find(value);
        }

        this.changed = true;
        return orgVal;
    }

    public boolean isType(VAttributeType otherType)
    {
        return this.getType().equals(otherType);
    }

    /** Reset changed flag. */
    public void setNotChanged()
    {
        this.changed = false;
    }

    /** Whether the value has changed since the last setNotChanged() */
    public boolean hasChanged()
    {
        return changed;
    }

    public void setValue(int val)
    {
        setValue("" + val);
    }

    /**
     * Return true if this VAttribute is editable.
     * No checking is done when a value is set.
     * Even if an attribute is not editable, setValue(...) still can be called.
     */
    public boolean isEditable()
    {
        return this.editable;
    }

    public void setEditable(boolean b)
    {
        this.editable = b;
    }

    // ========================================================================
    // Class Methods
    // ========================================================================

    /** Create a deep copy of Attribute Array */
    public static VAttribute[] duplicateArray(VAttribute[] attrs)
    {
        if (attrs == null)
            return null;

        VAttribute newAttrs[] = new VAttribute[attrs.length];

        for (int i = 0; i < attrs.length; i++)
        {
            if (attrs[i] != null)
                newAttrs[i] = attrs[i].clone();
            else
                newAttrs[i] = null; // be robuust: accept null attributes
        }

        return newAttrs;
    }

    public static VAttribute[] convertVectorToArray(Vector<VAttribute> attributes)
    {
        VAttribute newAttrs[] = new VAttribute[attributes.size()];

        for (int i = 0; i < newAttrs.length; i++)
        {
            if (attributes.elementAt(i) != null)
                newAttrs[i] = attributes.elementAt(i).clone();
            else
                newAttrs[i] = null; // be robuust: accept null attributes
        }

        return newAttrs;
    }

    public int getIntValue()
    {
        if ((value == null) || (value.compareTo("") == 0))
            return -1;

        return new Integer(value); // auto cast !
    }

    public long getLongValue()
    {
        if ((value == null) || (value.compareTo("") == 0))
            return -1;

        // auto cast to millis !
        if (this.type == VAttributeType.TIME)
        {
            return Presentation.createMillisFromNormalizedDateTimeString(value);
        }

        return new Long(value); // auto cast !
    }

    public VRL getVRL() throws VRLSyntaxException
    {
        return new VRL(value);
    }

    public double getDoubleValue()
    {
        return new Double(value); // auto cast !
    }

    public float getFloatValue()
    {
        return new Float(value); // auto cast !
    }

    public boolean getBooleanValue()
    {
        return new Boolean(value); // auto cast !
    }

    /** Ignore case only makes sense for String like Attributes */
    public int compareToIgnoreCase(VAttribute attr2)
    {
        return compareTo(attr2, true);
    }

    public int compareTo(VAttribute attr2)
    {
        return compareTo(attr2, false);
    }

    /**
     * Compares this value to value of other VAttribute 'attr'. The type of this
     * attribute is used and the other attribute is converted (casted) to this
     * type.
     *
     * @param attr
     * @return
     */
    public int compareTo(VAttribute attr, boolean ignoreCase)
    {
        return compare(this,attr,ignoreCase);
    }

    public static int compare(VAttribute a1,VAttribute a2,boolean ignoreCase)
    {
        Object value1=null;
        Object value2=null;
        if (a1!=null)
            value1=a1.value;
        if (a2!=null)
            value2=a2.value;

        // todo: better NULL compare
        if ((value1==null) && (value2==null))
            return 0;

        // NULL compare: must be equivalent with StringUtil.compare() !
        if ((value1==null) && (value2!=null))
            return StringUtil.compare(null,"");
        if (value2==null)
            return StringUtil.compare("",null);

        // equals() method!
        if (value1==value2)
            return 0;

        // PRE: neither a1 nor a2 is null or has null value
        switch (a1.type)
        {
            case INT:
            case LONG:
            case TIME:
                // use long both for int,long and time (millis!)
                if (a1.getLongValue() < a2.getLongValue())
                    return -1;
                else if (a1.getLongValue() > a2.getLongValue())
                    return 1;
                else
                    return 0;
                // break;
            case FLOAT:
                if (a1.getFloatValue() < a2.getFloatValue())
                    return -1;
                else if (a1.getFloatValue() > a2.getFloatValue())
                    return 1;
                else
                    return 0;
                // break;
            case DOUBLE:
                if (a1.getDoubleValue() < a2.getDoubleValue())
                    return -1;
                else if (a1.getDoubleValue() > a2.getDoubleValue())
                    return 1;
                else
                    return 0;
                // break;
            default:
                // default use string representation
                return StringUtil.compare(a1.getStringValue(),a2.getStringValue(), ignoreCase);
                // break;
        }
    }

    public boolean hasName(String nname)
    {
        return (this.name.compareTo(nname) == 0);
    }

    public void setValue(boolean b)
    {
        setValue((b == true) ? "true" : "false");
    }

    /** Will be changed to VAttribute help data base */
    public void setHelpText(String str)
    {
        helpText = str;
    }

    /**
     * Return (mini) help text for ToolTip text Implementation.
     * Will be moved to VAttribute help database.
     */
    public String getHelpText()
    {
        return helpText;
    }

    /** Return value as Date Object */
    public Date getDateValue()
    {
        return Presentation.createDateFromNormalizedDateTimeString(value);
    }

    public boolean isEnumType()
    {
        if (this.type == VAttributeType.ENUM)
            return true;

        return false;
    }

    public static boolean isSectionName(String name)
    {
        if (name == null)
            return false;

        return (name.startsWith("[") || name.startsWith("-["));
    }

    // ========================================================================
    // Aggregate interface (Under Construction)
    // ========================================================================

    /** Returns optional comma seperated value list as StringList. */
    public StringList getStringListValue()
    {
        return getStringListValue("[,]");
    }

    /**
     * Returns value list as StringList using regular expression regExp to split
     * the values.
     */
    public StringList getStringListValue(String regExp)
    {
        return StringList.createFrom(getStringValue(), regExp);
    }

}


text:
FROM ubuntu:14.04
CMD ["grunt", "serve"]
# COPY index.html /src/
# COPY images/ /src/
# COPY css/ /src/
# COPY js /src/
# COPY bower.json /src
EXPOSE 8000
WORKDIR /src
RUN apt-get update; apt-get dist-upgrade -y; apt-get install -y nodejs nodejs-legacy npm
RUN npm install -g bower grunt-cli
ADD . /src
RUN cd /src && npm install && bower --allow-root install


text:
{-# LANGUAGE OverloadedStrings #-}
module HollaBack.Testing.Date.Parser (specs) where

import Data.Attoparsec.Text (parseOnly,
                             maybeResult,
                             eitherResult,
                             Parser)
import Data.Maybe (fromJust)
import Data.Text (Text)
import Test.Hspec (Spec,
                   describe,
                   pending,
                   it)
import Test.Hspec.HUnit
import Test.HUnit.Base ((~?=))

import HollaBack.Date.Types
import HollaBack.Date.Parser

specs :: Spec
specs = do
  describe "tag" $ do
    it "Parses a well-formed tag" $
      parseOnly tag "+Work" ~?= Right work
    it "Does not consume past a second +" $
      parseOnly tag "+Work+School" ~?= Right work
    it "Does not parse raw strings" $
      fails $ parseOnly tag "Work"
--                      describe_tags,
--                      describe_timeUnit,
--                      describe_timeKeyword,
--                      describe_day,
--                      describe_date,
--                      describe_dateTimeSpec,
--                      describe_time]
--
--describe_tag :: Specs
--describe_tag =
--  describe "tag" [
--    it "Parses a well-formed tag"
--    (parseOnly tag "+Work" ~?= Right work),
--    it "Does not consume past a second +"
--    (parseOnly tag "+Work+School" ~?= Right work),
--    it "Does not parse raw strings"
--    (fails $ parseOnly tag "Work")
--  ]
--
--describe_tags :: Specs
--describe_tags =
--  describe "tags" [
--    it "Parses an empty string as an empty list"
--    (parseOnly tags "" ~?= Right []),
--    it "Parses 1 tag"
--    (parseOnly tags "+Work" ~?= Right [work]),
--    it "Parses many tags"
--    (parseOnly tags "+Work+School" ~?= Right [work, school])
--  ]
--
--describe_timeKeyword :: Specs
--describe_timeKeyword =
--  describe "timeKeyword" [
--    it "parses minutes"
--    (parseOnly timeKeyword "mi" ~?= Right Minutes),
--    it "parses hours"
--    (parseOnly timeKeyword "h" ~?= Right Hours),
--    it "parses days"
--    (parseOnly timeKeyword "d" ~?= Right Days),
--    it "parses weeks"
--    (parseOnly timeKeyword "w" ~?= Right Weeks),
--    it "parses months"
--    (parseOnly timeKeyword "mo" ~?= Right Months),
--    it "parses years"
--    (parseOnly timeKeyword "y" ~?= Right Years),
--    it "fails to parse other tokens"
--    (fails $ parseOnly timeKeyword "z")
--  ]
--
--describe_timeUnit :: Specs
--describe_timeUnit =
--  describe "timeUnit" [
--    it "parses well formed TimeUnits"
--    (parseOnly timeUnit "10d" ~?= Right (TimeUnit 10 Days)),
--    it "fails decimal days"
--    (fails $ parseOnly timeKeyword "10.5d")
--  ]
--
--describe_day :: Specs
--describe_day =
--  describe "day" [
--    it "parses mon"
--    (parseOnly day "mon" ~?= Right Monday),
--    it "parses monday"
--    (parseOnly day "monday" ~?= Right Monday),
--    it "parses tue"
--    (parseOnly day "tue" ~?= Right Tuesday),
--    it "parses tues"
--    (parseOnly day "tues" ~?= Right Tuesday),
--    it "parses tuesday"
--    (parseOnly day "tuesday" ~?= Right Tuesday),
--    it "parses wed"
--    (parseOnly day "wed" ~?= Right Wednesday),
--    it "parses wednesday"
--    (parseOnly day "wednesday" ~?= Right Wednesday),
--    it "parses thu"
--    (parseOnly day "thu" ~?= Right Thursday),
--    it "parses thur"
--    (parseOnly day "thur" ~?= Right Thursday),
--    it "parses thurs"
--    (parseOnly day "thurs" ~?= Right Thursday),
--    it "parses thursday"
--    (parseOnly day "thursday" ~?= Right Thursday),
--    it "parses fri"
--    (parseOnly day "fri" ~?= Right Friday),
--    it "parses friday"
--    (parseOnly day "friday" ~?= Right Friday),
--    it "parses sat"
--    (parseOnly day "sat" ~?= Right Saturday),
--    it "parses saturday"
--    (parseOnly day "saturday" ~?= Right Saturday),
--    it "parses sun"
--    (parseOnly day "sun" ~?= Right Sunday),
--    it "parses sunday"
--    (parseOnly day "sunday" ~?= Right Sunday)
--  ]
--
--describe_date :: Specs
--describe_date =
--  describe "date" [
--    it "parses well-formed dates"
--    (parseOnly date "may25" ~?= Right (Date May 25)),
--    it "parses with leading 0s"
--    (parseOnly date "mar05" ~?= Right (Date March 5)),
--    it "parses full month names"
--    (parseOnly date "january3" ~?= Right (Date January 3)),
--    it "is case insensitive"
--    (parseOnly date "January3" ~?= Right (Date January 3))
--  ]
--
--describe_time :: Specs
--describe_time =
--  describe "time" [
--    it "parses AM times"
--    (parseOnly time "3am" ~?= Right threeAm),
--    it "parses PM times"
--    (parseOnly time "9pm" ~?= Right ninePm),
--    it "is case insensitive about the time half"
--    (parseOnly time "9PM" ~?= Right ninePm),
--    it "fails on out-of-bounds times"
--    (pending "implement bounds checks")
--  ]
--  where threeAm = TimeOfDay 3 0 0
--        ninePm  = TimeOfDay 21 0 0
--
--describe_dateTimeSpec :: Specs
--describe_dateTimeSpec =
--  describe "dateTimeSpec" [
--    it "parses RelativeDateTime"
--    (parseOnly dateTimeSpec "13d" ~?= Right relativeDateTime),
--    it "parses SpecificDateTime"
--    (parseOnly dateTimeSpec "Mar13-6pm" ~?= Right specificDateTime),
--    it "parses SpecificWeekdayTime"
--    (parseOnly dateTimeSpec "thurs-1pm" ~?= Right specificWeekdayTime),
--    it "parses SpecificWeekday"
--    (parseOnly dateTimeSpec "fri" ~?= Right specificWeekday),
--    it "parses SpecificTime"
--    (parseOnly dateTimeSpec "5AM" ~?= Right specificTime)
--  ]
--  where relativeDateTime    = RelativeDateTime $ TimeUnit 13 Days
--        specificDateTime    = SpecificDateTime (Date March 13) $ TimeOfDay 18 0 0
--        specificWeekdayTime = SpecificWeekdayTime Thursday $ TimeOfDay 13 0 0
--        specificWeekday     = SpecificWeekday Friday
--        specificTime        = SpecificTime $ TimeOfDay 5 0 0

---- Fixtures
work :: Tag
work = Tag "Work"

school :: Tag
school = Tag "School"

isLeft :: Either a b -> Bool
isLeft (Left _) = True
isLeft _        = False

fails res = isLeft res ~?= True


text:
using System.Diagnostics;
using Microsoft.Extensions.CommandLineUtils;

namespace CliHelpers
{
    public abstract class CliOptionWithValueBase<T> : ICliOptionWithValue<T>
    {
        public CommandLineApplication Command { get; }

        public string OptionName { get; }

        protected CliOptionWithValueBase(ICliOption cliOption)
        {
            Debug.Assert(cliOption != null);

            Command = cliOption.Command;
            OptionName = cliOption.OptionName;
        }
        public abstract T Value();
    }

}


text:
import numpy as np

def run(self,inp):
  """
    RAVEN connection to run the model.  Evaluates x*y*cos(x+y).
    @ In, self, object, arbitrary container from RAVEN
    @ In, inp, dict, arbitrary container from RAVEN
    @ Out, None
  """
  self.ans = self.x*self.y * np.cos(self.x + self.y)


text:
package sjm.examples.query;

/**
 * Signals that a given string is not the name of a known
 * variable.
 *
 * @author Steven J. Metsker
 *
 * @version 1.0
 */
public class UnrecognizedVariableException
	extends RuntimeException {
/**
 * Constructs a UnrecognizedVariableException
 * with no detail message.
 */
public UnrecognizedVariableException() {
	super();
}
/**
 * Constructs a UnrecognizedVariableException
 * with the specified detail message.
 *
 * @param String the detail message.
 */
public UnrecognizedVariableException(String s) {
	super(s);
}
}


text:
import React from 'react';
import { Table, NavLink } from 'reactstrap';

import ProjectListItem from './project-list-item';

const ProjectList = ({ projects, currentPage }) => {
  const renderProjectListItem = (projects) => {
    return projects.map((project, index) => {
        return (
          <ProjectListItem key = { project.url } project = { project } index = { (10 * (currentPage - 1)) + (index + 1) }/>
        );
      }
    );
  }

  return (

            #
            Repository
            Project Description
            Technology Stack

          { renderProjectListItem(projects) }

  );
};

export default ProjectList;


text:
<!DOCTYPE html>

    {% include "head.html" %}

        {% block body %}
        {% endblock %}

        {% include "tail.html" %}