text:
package org.imirsel.nema.flowservice.config;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashSet;
import java.util.Properties;
import java.util.Set;
import java.util.logging.Logger;

import javax.annotation.PostConstruct;

import org.imirsel.nema.flowservice.monitor.FileChangeListener;
import org.imirsel.nema.flowservice.monitor.FileMonitor;
import org.springframework.core.io.ClassPathResource;

/**
 * A {@link FlowServiceConfig} that loads the configuration from a Java
 * properties file. Reloads the configuration when changes are made to the
 * properties file.
 *
 * @author kumaramit01
 * @author shirk
 * @since 0.5.0
 */
public class PropertiesBasedFlowServiceConfig extends FlowServiceConfigBase
   implements FileChangeListener {

   private static Logger logger = Logger.getLogger(
         PropertiesBasedFlowServiceConfig.class.getName());

   private String propertiesFileName;
   private Properties properties;
   private File propertiesFile;
   private ClassPathResource propertiesResource;
   private MeandreServerProxyConfig head;
   private Set<MeandreServerProxyConfig> workers;

   public PropertiesBasedFlowServiceConfig() {
   }

   @PostConstruct
   public void init() throws ConfigException {
      workers = new HashSet<MeandreServerProxyConfig>();

      propertiesResource = new ClassPathResource(propertiesFileName);

      loadProperties();
      head = loadHeadConfig();
      workers = loadWorkerConfigs();

      try {
         propertiesFile = propertiesResource.getFile();
         int monitorIntervalInSeconds = 2;
         FileMonitor configFileMonitor = new FileMonitor(this,propertiesFile,
               monitorIntervalInSeconds);
         configFileMonitor.start();
      } catch (IOException e) {
         logger.warning("A file monitor will not be created for " +
               "configuration file " + propertiesFileName + " because it " +
                     "cannot be resolved to an absolute file path.");
      }
   }

   /**
    * Loads the {@link MeandreServerProxyConfig}s for the worker servers.
    *
    * @return The {@link MeandreServerProxyConfig}s for the worker servers.
    * @throws ConfigException if a problem occurs while loading the configs.
    */
   private Set<MeandreServerProxyConfig> loadWorkerConfigs() throws ConfigException {
      Set<MeandreServerProxyConfig> workers =
         new HashSet<MeandreServerProxyConfig>();
      String hosts = properties.getProperty("workerserver.hosts");
      String ports = properties.getProperty("workerserver.ports");
      String usernames = properties.getProperty("workerserver.usernames");
      String passwords = properties.getProperty("workerserver.passwords");
      String maxConcurrentJobs = properties
            .getProperty("workerserver.maxConcurrentJobs");

      String[] hostList = hosts.split(",");
      String[] portList = ports.split(",");
      String[] usernameList = usernames.split(",");
      String[] passwordList = passwords.split(",");
      String[] maxConcurrentJobList = maxConcurrentJobs.split(",");

      // Validate at least one worker is specified
      if("".equals(hosts) && "".equals(ports) && "".equals(usernames) &&
            "".equals(passwords) && "".equals(maxConcurrentJobs)) {
         throw new ConfigException("Invalid flow configuration file. " +
         		"At least one worker server is required.");
      }

      if ((hostList.length == portList.length)
            && (hostList.length == usernameList.length)
            && (hostList.length == passwordList.length)
            && (hostList.length == maxConcurrentJobList.length)) {
         int count = 0;
         for (String host : hostList) {
            int port;
            int maxConcurrentJob;
            try {
               port = Integer.parseInt(portList[count]);
               maxConcurrentJob = Integer
                     .parseInt(maxConcurrentJobList[count]);
            } catch (NumberFormatException e) {
               throw new ConfigException(
                     "Invalid flow service configuration file. Check " +
                     "workerserver.port and workerserver.maxConcurrentJobs " +
                     "to make sure they contain only numbers.");
            }
            String username = usernameList[count];
            String password = passwordList[count];
            MeandreServerProxyConfig config = new SimpleMeandreServerProxyConfig(
                  username, password, host, port, maxConcurrentJob);
            if(workers.contains(config)) {
               throw new ConfigException("Multiple instances of the same " +
               		"worker server were found.");
            }
            workers.add(config);
            count++;
         }
      } else {
         throw new ConfigException(
               "Invalid flow service configuration file. Inconsistent number " +
               "of worker properties.");
      }
      return workers;
   }

   /**
    * Loads the {@link MeandreServerProxyConfig} for the head server.
    *
    * @return The {@link MeandreServerProxyConfig} for the head server.
    * @throws ConfigException if a problem occurs while loading the config.
    */
   private MeandreServerProxyConfig loadHeadConfig() throws ConfigException {
      String headServer = properties.getProperty("headserver.host");
      String headServerPortStr = properties.getProperty("headserver.port");
      String headUsername = properties.getProperty("headserver.username");
      String headPassword = properties.getProperty("headserver.password");
      String headMaxCurrentJobsStr = properties
            .getProperty("headserver.maxConcurrentJobs");

      if(nullOrEmpty(headServer) || nullOrEmpty(headServerPortStr) ||
            nullOrEmpty(headUsername) || nullOrEmpty(headPassword) ||
            nullOrEmpty(headMaxCurrentJobsStr)) {
         throw new ConfigException(
               "Invalid flow service configuration file. Some headserver " +
               "properties are missing.");
      }

      int headServerPort;
      int headMaxCurrentJobs;
      try {
         headServerPort = Integer.parseInt(headServerPortStr);
         headMaxCurrentJobs = Integer.parseInt(headMaxCurrentJobsStr);
      } catch (NumberFormatException e) {
         throw new ConfigException(
             "Invalid flow service configuration file. Check headserver.port " +
             "and headserver.maxConcurrentJobs to make sure they are numbers.");
      }

      return new SimpleMeandreServerProxyConfig(
            headUsername, headPassword, headServer, headServerPort,
            headMaxCurrentJobs);
   }

   /**
    * Load the properties file.
    *
    * @throws ConfigException if a problem occurs while loading the properties
    * file.
    */
   private void loadProperties()
         throws ConfigException {
      if (propertiesResource == null) {
         throw new ConfigException(
               "Could not find flow service configuration file: " +
                                                  propertiesFileName);
      }
      InputStream is = null;
      try {
         is = propertiesResource.getInputStream();
         properties = new Properties();
         properties.load(is);
      } catch (IOException e) {
         throw new ConfigException(e);
      } finally {
         if (is != null) {
            try {
               is.close();
            } catch (IOException e) {
               e.printStackTrace();
            }
         }
      }
      if (properties == null) {
         throw new ConfigException(
               "Invalid flow service configuration file. No properties found.");
      }
   }

   /**
    * @see FlowServiceConfig#getHeadConfig()
    */
   @Override
   public MeandreServerProxyConfig getHeadConfig() {
      return head;
   }

   /**
    * @see FlowServiceConfig#getWorkerConfigs()
    */
   @Override
   public Set<MeandreServerProxyConfig> getWorkerConfigs() {
      return workers;
   }

   /**
    * Return the name of the properties file that contains the configuration.
    *
    * @return Name of the properties file that contains the configuration.
    */
   public String getPropertiesFileName() {
      return propertiesFileName;
   }

   /**
    * Inject the name of the properties file that contains the configuration.
    *
    * @param propertiesFileName The name of the properties file that
    *  contains the configuration.
    */
   public void setPropertiesFileName(String propertiesFileName) {
      this.propertiesFileName = propertiesFileName;
   }

   /**
    * Respond to changes made to the configuration file.
    *
    * @param file A reference to the changed configuration file.
    */
   @Override
   public void fileChanged(File file) {
      try {
         logger.info("Flow Service configuration has changed. Reloading...");
         reload();
         logger.info("Notifiying listeners of updated configuration...");
         notifyListeners();
      } catch (ConfigException e) {
         logger.warning("A problem occured while reloading the "
               + "configuration file: " + e.getMessage());
      }
   }

   /**
    * Reload the configuration file.
    *
    * @throws ConfigException if there is a problem with the configuration file.
    */
   public void reload() throws ConfigException {
      loadProperties();
      MeandreServerProxyConfig newHeadConfig = loadHeadConfig();
      Set<MeandreServerProxyConfig> newWorkerConfigs = loadWorkerConfigs();

      // Ensure the head isn't also a worker.
      if(newWorkerConfigs.contains(newHeadConfig)) {
         throw new ConfigException("A head server cannot also be a worker.");
      }

      // Ensure a worker hasn't been moved to the head.
      if(workers.contains(newHeadConfig)) {
         throw new ConfigException("Worker servers cannot be simultaneously " +
         		"moved from the worker pool and made a head server. Remove " +
         		"the worker first and then make it the head in a subsequent " +
         		"configuration update.");
      }
      // Ensure the head hasn't moved to the worker pool.
      if(newWorkerConfigs.contains(head)) {
         throw new ConfigException("A head server cannot be simultaneously " +
               "removed from the head and placed in the worker pool. Remove " +
               "the head server first and then make it a worker in a " +
               "subsequent configuration update.");
      }

      head = newHeadConfig;
      workers = newWorkerConfigs;
   }

   private boolean nullOrEmpty(String str) {
      if(null==str || "".equals(str)) {
         return true;
      }
      return false;
   }
}


text:
using System;

namespace _03.Greeting
{
    public class Program
    {
        public static void Main()
        {
            string firstName = Console.ReadLine();
            string lastName = Console.ReadLine();
            string age = Console.ReadLine();
            Console.WriteLine($"Hello, {firstName} {lastName}. You are {age} years old.");
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
using Microsoft.SharePoint.Client;
using Microsoft.SharePoint.Client.Taxonomy;
using OfficeDevPnP.Core.Attributes;
using OfficeDevPnP.Core.Diagnostics;

namespace OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.TokenDefinitions
{
    [TokenDefinitionDescription(
        Token = "{sitecollectiontermgroupid}",
        Description = "Returns the id of the site collection term group",
        Example = "{sitecollectiontermgroupid}",
        Returns = "767bc144-e605-4d8c-885a-3a980feb39c6")]
    internal class SiteCollectionTermGroupIdToken : VolatileTokenDefinition
    {
        public SiteCollectionTermGroupIdToken(Web web)
            : base(web, "{sitecollectiontermgroupid}")
        {
        }

        public override string GetReplaceValue()
        {
            if (string.IsNullOrEmpty(CacheValue))
            {
                try
                {
                    // The token is requested. Check if the group exists and if not, create it
                    var site = TokenContext.Site;
                    var session = TaxonomySession.GetTaxonomySession(TokenContext);
                    var termstore = session.GetDefaultSiteCollectionTermStore();
                    var termGroup = termstore.GetSiteCollectionGroup(site, true);
                    TokenContext.Load(termGroup);
                    TokenContext.ExecuteQueryRetry();

                    CacheValue = termGroup.Id.ToString();
                }
                catch(ServerUnauthorizedAccessException)
                {
                    Log.Warning(Constants.LOGGING_SOURCE, CoreResources.TermGroup_No_Access);
                }
            }
            return CacheValue;
        }
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>com.google.gson.annotations Class Hierarchy (Gson 2.6.2 API)</title>
<meta name="date" content="2016-02-26">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Hierarchy For Package com.google.gson.annotations

Package Hierarchies:

All Packages

Annotation Type Hierarchy

com.google.gson.annotations.Until (implements java.lang.annotation.Annotation)

com.google.gson.annotations.Since (implements java.lang.annotation.Annotation)

com.google.gson.annotations.SerializedName (implements java.lang.annotation.Annotation)

com.google.gson.annotations.JsonAdapter (implements java.lang.annotation.Annotation)

com.google.gson.annotations.Expose (implements java.lang.annotation.Annotation)

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2016. All Rights Reserved.


text:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta name="copyright" content="(C) Copyright 2005" />
<meta name="DC.rights.owner" content="(C) Copyright 2005" />
<meta content="public" name="security" />
<meta content="index,follow" name="Robots" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta content="reference" name="DC.Type" />
<meta name="DC.Title" content="CODESET values for import and export procedures" />
<meta name="abstract" content="Import and export procedures accept arguments to specify codeset values. You can specify the codeset (character encoding) for import and export procedures to override the system default." />
<meta name="description" content="Import and export procedures accept arguments to specify codeset values. You can specify the codeset (character encoding) for import and export procedures to override the system default." />
<meta content="import and export procedures, codesets, codeset values" name="DC.subject" />
<meta content="import and export procedures, codesets, codeset values" name="keywords" />
<meta scheme="URI" name="DC.Relation" content="ctoolsimport16245.html" />
<meta scheme="URI" name="DC.Relation" content="ctoolsimport98264.html" />
<meta scheme="URI" name="DC.Relation" content="ctoolsimport27052.html" />
<meta scheme="URI" name="DC.Relation" content="ctoolsimportlobs.html" />
<meta scheme="URI" name="DC.Relation" content="ctoolsimportdefaultformat.html" />
<meta scheme="URI" name="DC.Relation" content="ttoolsimporting.html" />
<meta scheme="URI" name="DC.Relation" content="ttoolsexporting.html" />
<meta scheme="URI" name="DC.Relation" content="rtoolsimport91458.html" />
<meta scheme="URI" name="DC.Relation" content="ctoolsimportjdbc.html" />
<meta scheme="URI" name="DC.Relation" content="ctoolsimportnulls.html" />
<meta content="XHTML" name="DC.Format" />
<meta content="rtoolsimportcodeset" name="DC.Identifier" />
<meta content="en-us" name="DC.Language" />
<link href="commonltr.css" type="text/css" rel="stylesheet" />
<title>CODESET values for import and export procedures</title>

CODESET values for import and export procedures

Import and export procedures accept arguments to specify codeset
values. You can specify the codeset (character encoding) for import and export
procedures to override the system default.

The following table contains a sample of the character encoding
that is supported by JDK 1.x. To review the complete list of character encodings,
refer to your Java documentation.

Table 1. Sample character
encodings. This table contains sample character encodings supported
by JDK1.x.

Character Encoding

Explanation

8859_1

ISO Latin-1

8859_2

ISO Latin-2

8859_7

ISO Latin/Greek

Cp1257

Windows Baltic

Cp1258

Windows Vietnamese

Cp437

PC Original

EUCJIS

Japanese EUC

GB2312

GB2312-80 Simplified Chinese

JIS

JIS

KSC5601

KSC5601 Korean

MacCroatian

Macintosh Croatian

MacCyrillic

Macintosh Cyrillic

SJIS

PC and Windows Japanese

UTF-8

Standard UTF-8

Examples of specifying the codeset in import and export procedures

The following example shows how to specify UTF-8 encoding to export to the <samp class="codeph">staff.dat</samp> table:
CALL SYSCS_UTIL.SYSCS_EXPORT_TABLE
    (NULL,'STAFF','staff.dat',NULL,NULL,'UTF-8')

The following example shows how to specify UTF-8 encoding
to import from the <samp class="codeph">staff.dat</samp> table:
CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE
    (NULL,'STAFF','staff.dat',NULL,NULL,'UTF-8',0)

Parent topic: Using the bulk import and export procedures

Related concepts

Methods for running the import and export procedures

Bulk import and export requirements and considerations

Bulk import and export of large objects

File format for input and output

Import and export procedures from JDBC

How the Import and export procedures process NULL values

Related tasks

Importing data using the built-in procedures

Exporting data using the built-in procedures

Related reference

Examples of bulk import and export


text:
//
//  SLNSLogger.m
//  SuperLogger
//
//  Created by Joel Fischer on 5/20/16.
//  Copyright © 2016 livio. All rights reserved.
//

#import "SLNSLogger.h"

#import "SLLog.h"

#import <dlfcn.h>

NS_ASSUME_NONNULL_BEGIN

@implementation SLNSLogger

#pragma mark - NSLogger

// https://github.com/fpillet/NSLogger/wiki/Using-NSLogger-in-frameworks-and-libraries
/* This code provides a logging function you can use from within frameworks.
 * When using the framework with a client application, the code will either
 * use NSLogger if it is linked in the application, or go with a regular NSLog() call
 *
 * Helpful to provide debug versions of frameworks that can take advantage of NSLogger.
 *
 * This requires NSLogger 1.5.1 or later, which tags its log functions with the proper attribute to
 * prevent them from being stripped. Client application MUST define NSLOGGER_ALLOW_NOSTRIP or use
 * the "NSLogger/NoStrip" CocoaPod
 */

typedef void (*LogMessageF_func)(const char *file, int line, const char *function,
NSString *tag, int level, NSString * const format,
va_list args);

void FrameworkLog(const char *file, int line, const char *function, NSString *tag, int level, ...)
{
    static LogMessageF_func logFunc;
    static dispatch_once_t once;
    dispatch_once(&once, ^{
        logFunc = dlsym(RTLD_DEFAULT, "LogMessageF_va");
    });

    va_list args;
    va_start(args, level);
    NSString * format = va_arg(args, NSString *);
    if (logFunc) {
        // we know that this symbol exists, so we can safely call it
        logFunc(file, line, function, tag, level, format, args);
    } else {
        NSLog(@"[%@] %@", tag, [[NSString alloc] initWithFormat:format arguments:args]);
    }
    va_end(args);
}

#pragma mark - SLNSLogger

- (instancetype)init {
    self = [super init];
    if (!self) {
        return nil;
    }

    _logInRelease = NO;

    return self;
}

+ (instancetype)logger {
    return [[self alloc] init];
}

#pragma mark - SLLogger

- (BOOL)setupLogger {
    return YES;
}

- (void)logWithLog:(SLLog *)log formattedLog:(NSString *)stringLog {
    FrameworkLog(log.fileName.UTF8String, (int)log.line, log.functionName.UTF8String, @"SL", log.level, log.message);
}

- (void)teardownLogger {

}

@end

NS_ASSUME_NONNULL_END


text:
author:
  display_name: Bert Granberg
  email: ugrc@utah.gov
tags:
  - address
  - assessment
  - assessor
  - boundary
  - cadastral
  - cadastre
  - parcels
  - property
  - recorder
  - tax
  - uac
  - valuation
date: 2016-05-26 16:44:03
title: Work Group Recommends Expanded GIS Parcel Sharing
categories:
  - Featured
---

**A Proposal for Voluntary Expanding Parcel Data Sharing**

Earlier this month, the Land Information Records work group, an informal committee organized by Evan Curtis, the State Planning Coordinator with the
Governor's Office of Management and Budget, produced [recommendations](https://drive.google.com/file/d/1E3ks5ndjMKiZqS5b7N6a3_1paJK0jHi_) for expanding the sharing of GIS-based parcel information.

Land Use Information Records Recommendations Document

Participants in the LIR work group include representatives from county, regional, and state government, including the Utah Association of Counties (County Assessors and County Recorders), Wasatch Front Regional Council, Mountainland and Bear River AOGs, Utah League of Cities and Towns, UDOT, DNR, UGRC, the Division of Emergency Management, Blue Stakes, economic developers, and academic researchers.

The LIR work group's recommendations set the stage for voluntary sharing of additional objective/quantitative parcel GIS data, primarily around tax assessment-related information. Specifically the recommendations document establishes objectives, principles (including the role of local and state government), data content items, expected users, and a general process for data aggregation and publishing.

An important realization made by the group was that 'parcel data' or 'parcel record' products have a different meaning to different users and data stewards ([see more detailed explanation](https://drive.google.com/file/d/1EANbFKyk0yBfmWiiY71gKB1BCVrrhZ6_)). The LIR group focused, specifically, on defining a data sharing recommendation around a _**tax year parcel GIS data**_ product, aligned with the finalization of the property tax roll by County Assessors on May 22nd of each year.

The LIR recommendations do not impact the periodic sharing of _**basic parcel GIS data**_ (boundary, ID, address) from the County Recorders to UGRC per [63F-1-506 (3.b.vi)](https://le.utah.gov/xcode/Title63F/Chapter1/63F-1-S506.html). Both the tax year parcel and the basic parcel GIS layers are designed for general purpose uses, and are not substitutes for researching and obtaining the most current, legal land records information on file in County records.

It is hoped that this new expanded parcel GIS layer will be put to immediate use supporting the best possible outcomes in public safety, economic development, transportation, planning, and the provision of public services. Two quick map examples, at the bottom of this post, illustrate how land value and vacant land can be visualized from the expanded parcel information.

Another aim of the work group was to improve the usability of the data (through development of standards and consistent metadata documentation) and the efficiency with which the data sharing is distributed.

#### Next Steps

1. UGRC will interface with counties and the GIS community to propose and finalize the GIS data schema based on the group's recommendations to date. It is hoped this process can be completed by mid-June.

1. Once the proposed data schema is completed, it will be distributed to the county assessors for a final review, followed by an invitation to submit the most recent tax parcel data for the 2016 calendar year. The initial focus will be publishing a GIS layer for the Wasatch Front, Wasatch Back, and other high-growth counties.

1. UGRC will work with counties to collect, aggregate and publish the tax parcels according to the agreed upon schema.

Assessed Land Value, By Acre (Northern Utah County)

Vacant Private Land (Northern Utah County)

*[LIR]: Land Information Records
*[AOG]: Association of Governments


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

namespace BLL
{
    public interface ITicketsMgr
    {
        bool Add(Tickets ticket);
        List<Tickets> GetTickets(string ticketType);
        List<string> BuyTicket(Tickets ticket, int count);
    }
}


text:
#include "vmm_defs.h"
#include "hw_utils.h"
#include "common_libc.h"
#include "vmm_dbg.h"
#include "file_codes.h"
#define VMM_DEADLOOP()          VMM_DEADLOOP_LOG(RESET_C)
#define VMM_ASSERT(__condition) VMM_ASSERT_LOG(RESET_C, __condition)
#ifdef JLMDEBUG
#include "jlmdebug.h"
#endif

#pragma warning( disable : 4214) // warning C4214: nonstandard extension used : bit field types other than int
// With the default Microsoft extensions (/Ze), bitfield structure members can be of any integer type.

#define RESET_CONTROL_REGISTER_IO_PORT         0xCF9

typedef enum {
    SystemResetBit = 1, // 0 = cpu_reset generates an INIT(Soft Reset), 1 = cpu_reset generates platform reset (Hard Reset)
    CpuResetBit    = 2, // 0->1 transition generates the reset type specified by system_reset
    FullResetBit   = 3
} RESET_CONTROL_REGISTER_BITS;

#define SET_SYSTEM_RESET( v )  BIT_SET( v, SystemResetBit )
#define CLR_SYSTEM_RESET( v )  BIT_CLR( v, SystemResetBit )
#define GET_SYSTEM_RESET( v )  BIT_GET( v, SystemResetBit )

#define SET_CPU_RESET( v )  BIT_SET( v, CpuResetBit )
#define CLR_CPU_RESET( v )  BIT_CLR( v, CpuResetBit )
#define GET_CPU_RESET( v )  BIT_GET( v, CpuResetBit )

#define SET_FULL_RESET( v )  BIT_SET( v, FullResetBit )
#define CLR_FULL_RESET( v )  BIT_CLR( v, FullResetBit )
#define GET_FULL_RESET( v )  BIT_GET( v, FullResetBit )

void hw_reset_platform(void)
{
  UINT8  reset_control_register;

  // Write the ICH register required to perform a platform reset (Cold Reset)
  reset_control_register = hw_read_port_8(RESET_CONTROL_REGISTER_IO_PORT);

  SET_CPU_RESET( reset_control_register );
  SET_SYSTEM_RESET( reset_control_register );

  hw_write_port_8 (RESET_CONTROL_REGISTER_IO_PORT, reset_control_register);

  // Never returns
  VMM_DEADLOOP ();
}


text:
package com.amazonaws.services.databasemigrationservice.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.databasemigrationservice.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * ReplicationTaskStatsMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class ReplicationTaskStatsMarshaller {

    private static final MarshallingInfo<Integer> FULLLOADPROGRESSPERCENT_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("FullLoadProgressPercent").build();
    private static final MarshallingInfo<Long> ELAPSEDTIMEMILLIS_BINDING = MarshallingInfo.builder(MarshallingType.LONG)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ElapsedTimeMillis").build();
    private static final MarshallingInfo<Integer> TABLESLOADED_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("TablesLoaded").build();
    private static final MarshallingInfo<Integer> TABLESLOADING_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("TablesLoading").build();
    private static final MarshallingInfo<Integer> TABLESQUEUED_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("TablesQueued").build();
    private static final MarshallingInfo<Integer> TABLESERRORED_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("TablesErrored").build();

    private static final ReplicationTaskStatsMarshaller instance = new ReplicationTaskStatsMarshaller();

    public static ReplicationTaskStatsMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(ReplicationTaskStats replicationTaskStats, ProtocolMarshaller protocolMarshaller) {

        if (replicationTaskStats == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(replicationTaskStats.getFullLoadProgressPercent(), FULLLOADPROGRESSPERCENT_BINDING);
            protocolMarshaller.marshall(replicationTaskStats.getElapsedTimeMillis(), ELAPSEDTIMEMILLIS_BINDING);
            protocolMarshaller.marshall(replicationTaskStats.getTablesLoaded(), TABLESLOADED_BINDING);
            protocolMarshaller.marshall(replicationTaskStats.getTablesLoading(), TABLESLOADING_BINDING);
            protocolMarshaller.marshall(replicationTaskStats.getTablesQueued(), TABLESQUEUED_BINDING);
            protocolMarshaller.marshall(replicationTaskStats.getTablesErrored(), TABLESERRORED_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
enum class PlatformType
{
  x86,
  x64
};

struct LoaderInfo
{
  std::string loaderName;
  PlatformType platformType;
};

static std::vector<LoaderInfo> gloadersNames{{"stub_x86.bin", PlatformType::x86}, {"stub_x86.bin", PlatformType::x64}}; // dup data here just for testing of two loaders :D

class ILoaderPacker:
  public IPackerBase
{
public:
  ILoaderPacker(std::shared_ptr<PeLib::PeFile>& srcPEFile, boost::filesystem::path loadersStoragePath):
    loadersStoragePath_(loadersStoragePath)
    , IPackerBase(srcPEFile, PackerType::kLoaderPacker)
  {}
  virtual ~ILoaderPacker(){};
  virtual void ProcessExecutable(std::vector<uint8_t>& outFileBuffer, const AdditionalDataBlocksType& additionalDataBlocks) = 0;

protected:
  boost::filesystem::path loadersStoragePath_;
};


text:
Clone the Repository:
```
git clone <repo>
```

[Install Node.js](http://nodejs.org/download/) if you dont have it.

Go into the application:
```
cd catch-logs
```

Install the required packages: (Npm comes with Node.js)
```
npm install
```

Configure the log filename which you want to watch (Make changes in `config.json`):
```
{
  "log_filename": "Your filename goes here"
}
```

Start the server:
```
npm start
```

Analyse your logs real-time at:
```
firefox localhost:4000/
```

#### Development :

Better start the server with nodemon, so that server automatically restart if any changes are made to the source files.
```
nodemon modules/server.coffee
```

#### Testing :
Logger : Use this command in different tab for testing
```
sec=0
while true; do echo $sec >> "<log_filename>"; sleep 1; sec=$(($sec + 1)); done
```

###Features:

* Dumps the file into the browser real-time using socket.io.
* Clear logs from the UI using `Clear Log` button or shortcut `g` or `G`.
* Regex Search through the logs.
* AutoScroll to latest log.
* AutoClear logs whenever server restarts. Works great with nodemon.
* Take care of the terminal Ansi-Colors coming as part of the logs. Convert them to CSS colors.

###Todo:

* Make it a npm package.
* Thorough testing: unit and integration.
* User-define filters for coloring: Example = `Exception:` - Red like bootstrap.
* Make lines Collapsable.
* Optimize on search: (show and hide) logic.
* Case insensitive search option.
* Fuzzy Search option.
* Multiple sources of log files.
* Multi-language support.

####Contributors:

[Parag Gupta](https://github.com/paraggupta1993)

#### Special Thanks to :
[Express]()
[Static-favicon]()
[Morgan]()
[Cookie-parser]()
[Body-parser]()
[Debug]()
[Jade]()
[Frontail](https://github.com/mthenw/frontail)
[Stylus]()
[Socket.io]()
[Coffee-script]()
[CBuffer]()


text:
require 'spec_helper'

module Pillar

	describe Serialization do

		before(:each) do
	    Pillar.configure do |config|
			end
	  end

	  class JSONExample
	  	include Pillar::Serialization

	  	attr_accessor :var1, :var2

	    def initialize(params=nil)
	      params ||= { var1: 10, var2: 'test' }
	      params.each do |k,v|
	        instance_variable_set("@#{k}", v) unless v.nil?
	      end
	    end
	  end

	  let(:example) {JSONExample.new}
	  let(:example_json) {'{"json_class":"Pillar::JSONExample","data":{"var1":10,"var2":"test"}}'}
	  let(:e2_json) {'{"json_class":"Pillar::Worker", "data":{"worker_id":"1234b0f4f92ed924a71dd77d56ff2c79", "args":["/git/pillar/examples/print-time.rb"], "env":{"MY_ENV":"/tmp/dump/blah"} } }'}

  	describe "#to_json" do

	    it "should be correct json" do
	    	expect(example.to_json.class).to eq(String)
	    	expect(example.to_json).to eq(example_json)
			end

	  end

	  describe "#from_json" do

	    it "should be correct object" do
	    	actual = Pillar::Serialization.from_json(example_json)
	    	expect(actual.var1).to eq(example.var1)
	    	expect(actual.var2).to eq(example.var2)
			end

			context 'from string' do

				it "should be correct object" do
		    	actual = example_json.from_json
		    	expect(actual.var1).to eq(example.var1)
		    	expect(actual.var2).to eq(example.var2)
				end

			end

		end

	end

end


text:
// <copyright file="DataTransferObjectProvider{T}.cs" company="Logikfabrik">
//   Copyright (c) 2015 anton(at)logikfabrik.se. Licensed under the MIT license.
// </copyright>

namespace Logikfabrik.Umbraco.Jet.Social
{
    using System;
    using System.Linq;
    using global::Umbraco.Core.Persistence;

    /// <summary>
    /// The <see cref="DataTransferObjectProvider{T}" /> class.
    /// </summary>
    /// <typeparam name="T">The data transfer object type.</typeparam>
    public abstract class DataTransferObjectProvider<T> : IDataTransferObjectProvider<T>
        where T : DataTransferObject
    {
        private readonly Lazy<ICacheWrapper> _cache;
        private readonly Lazy<IDatabaseWrapper> _database;
        private readonly Lazy<int> _typeId;

        /// <summary>
        /// Initializes a new instance of the <see cref="DataTransferObjectProvider{T}" /> class.
        /// </summary>
        /// <param name="cache">The cache.</param>
        /// <param name="database">The database.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="cache" /> is <c>null</c>.</exception>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="database" /> is <c>null</c>.</exception>
        protected DataTransferObjectProvider(
            Func<ICacheWrapper> cache,
            Func<IDatabaseWrapper> database)
        {
            if (cache == null)
            {
                throw new ArgumentNullException(nameof(cache));
            }

            if (database == null)
            {
                throw new ArgumentNullException(nameof(database));
            }

            _cache = new Lazy<ICacheWrapper>(cache);

            _database = new Lazy<IDatabaseWrapper>(() =>
            {
                var db = database();

                CreateTables(db);

                return db;
            });

            _typeId = new Lazy<int>(GetEntityTypeId);
        }

        /// <summary>
        /// Gets the cache.
        /// </summary>
        /// <value>
        /// The cache.
        /// </value>
        protected ICacheWrapper Cache => _cache.Value;

        /// <summary>
        /// Updates the specified data transfer object.
        /// </summary>
        /// <param name="dto">The data transfer object to update.</param>
        /// <returns>
        /// The updated data transfer object object.
        /// </returns>
        DataTransferObject IDataTransferObjectProvider.Update(DataTransferObject dto)
        {
            return Update((T)dto);
        }

        /// <summary>
        /// Gets the data transfer object of type <typeparamref name="T" /> with the specified identifier.
        /// </summary>
        /// <param name="id">The data transfer object identifier.</param>
        /// <returns>
        /// The data transfer object of type <typeparamref name="T" /> with the specified identifier.
        /// </returns>
        public virtual T Get(int id)
        {
            var cacheKey = CacheKeyFactory.GetKey<T>(id);

            var dto = _cache.Value.GetObject<T>(cacheKey);

            if (dto != null)
            {
                return dto;
            }

            dto = _database.Value.Get<T>(id);

            if (dto == null)
            {
                return null;
            }

            dto.IsReadOnly = true;

            return dto;
        }

        /// <summary>
        /// Adds the specified data transfer object of type <typeparamref name="T" />.
        /// </summary>
        /// <param name="dto">The data transfer object of type <typeparamref name="T" /> to add.</param>
        /// <returns>
        /// The added data transfer object of type <typeparamref name="T" />.
        /// </returns>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="dto" /> is <c>null</c>.</exception>
        public virtual T Add(T dto)
        {
            if (dto == null)
            {
                throw new ArgumentNullException(nameof(dto));
            }

            DataTransferObjectValidator.ThrowIfReadOnly(dto);

            int id;

            using (var transaction = _database.Value.GetTransaction())
            {
                var entity = new Entity
                {
                    TypeId = _typeId.Value
                };

                id = decimal.ToInt32((decimal)_database.Value.Add(entity));

                dto.Id = id;

                _database.Value.Add(dto);

                transaction.Complete();
            }

            dto.Id = id;
            dto.IsReadOnly = true;

            _cache.Value.AddObject(dto);

            return dto;
        }

        /// <summary>
        /// Queries the provider.
        /// </summary>
        /// <param name="query">The query.</param>
        /// <returns>
        /// Matching data transfer object instances of type <typeparamref name="T" />.
        /// </returns>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="query" /> is <c>null</c>.</exception>
        public QueryResult<T> Query(Query<T> query)
        {
            if (query == null)
            {
                throw new ArgumentNullException(nameof(query));
            }

            var sql = new Sql();

            if (query.Criterias.Any())
            {
                sql = query.Criterias.Aggregate(sql, (current, criteria) => current.Where(criteria));
            }

            sql = query.OrderBy != null
                ? sql.OrderBy<T>(query.OrderBy, _database.Value.SyntaxProvider)
                : sql.OrderBy<T>(obj => obj.Created, _database.Value.SyntaxProvider);

            var page = _database.Value.Page<T>(query.PageIndex, query.PageSize, sql);

            return new QueryResult<T>
            {
                Total = page.TotalItems,
                Objects = page.Items
            };
        }

        /// <summary>
        /// Updates the specified data transfer object of type <typeparamref name="T" />.
        /// </summary>
        /// <param name="dto">The data transfer object of type <typeparamref name="T" /> to update.</param>
        /// <returns>
        /// The updated data transfer object of type <typeparamref name="T" />.
        /// </returns>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="dto" /> is <c>null</c>.</exception>
        public virtual T Update(T dto)
        {
            if (dto == null)
            {
                throw new ArgumentNullException(nameof(dto));
            }

            DataTransferObjectValidator.ThrowIfReadOnly(dto);

            _database.Value.Update(dto);

            dto.IsReadOnly = true;

            _cache.Value.AddObject(dto);

            return dto;
        }

        /// <summary>
        /// Gets the data transfer object with the specified identifier.
        /// </summary>
        /// <param name="id">The data transfer object identifier.</param>
        /// <returns>
        /// The data transfer object with the specified identifier.
        /// </returns>
        DataTransferObject IDataTransferObjectProvider.Get(int id)
        {
            return Get(id);
        }

        /// <summary>
        /// Adds the specified data transfer object.
        /// </summary>
        /// <param name="dto">The data transfer object to add.</param>
        /// <returns>The added data transfer object.</returns>
        DataTransferObject IDataTransferObjectProvider.Add(DataTransferObject dto)
        {
            return Add((T)dto);
        }

        /// <summary>
        /// Removes the data transfer object with the specified identifier.
        /// </summary>
        /// <param name="id">The data transfer object identifier.</param>
        public void Remove(int id)
        {
            using (var transaction = _database.Value.GetTransaction())
            {
                _database.Value.Delete<T>(id);
                _database.Value.Delete<Entity>(id);

                transaction.Complete();
            }

            var cacheKey = CacheKeyFactory.GetKey<T>(id);

            _cache.Value.RemoveObject<T>(cacheKey);
        }

        /// <summary>
        /// Gets the entity type with the specified identifier.
        /// </summary>
        /// <param name="id">The entity type identifier.</param>
        /// <returns>The entity type with the specified identifier.</returns>
        protected Type GetEntityType(int id)
        {
            var sql = new Sql()
                .Select("*")
                .From<Entity>(_database.Value.SyntaxProvider)
                .LeftJoin<EntityType>(_database.Value.SyntaxProvider)
                .On<Entity, EntityType>(_database.Value.SyntaxProvider, e => e.TypeId, et => et.Id)
                .Where<Entity>(e => e.Id == id);

            var entity = _database.Value.Get<Entity>(sql);

            return entity == null ? null : Type.GetType(entity.Type, false);
        }

        /// <summary>
        /// Creates the tables.
        /// </summary>
        /// <param name="database">The database.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="database" /> is <c>null</c>.</exception>
        private void CreateTables(IDatabaseWrapper database)
        {
            if (database == null)
            {
                throw new ArgumentNullException(nameof(database));
            }

            if (!database.TableExists(typeof(EntityType)))
            {
                database.CreateTable(typeof(EntityType));
            }

            if (!database.TableExists(typeof(Entity)))
            {
                database.CreateTable(typeof(Entity));
            }

            if (database.TableExists(typeof(T)))
            {
                return;
            }

            database.CreateTable(typeof(T));
        }

        /// <summary>
        /// Gets the entity type identifier.
        /// </summary>
        /// <returns>The entity type identifier</returns>
        private int GetEntityTypeId()
        {
            var typeName = typeof(T).AssemblyQualifiedName;

            var sql = new Sql().Where<EntityType>(et => et.Type == typeName);

            var entityType = _database.Value.Get<EntityType>(sql);

            if (entityType != null)
            {
                return entityType.Id;
            }

            entityType = new EntityType { Type = typeName };

            return decimal.ToInt32((decimal)_database.Value.Add(entityType));
        }
    }
}


text:
\hypertarget{apply_create_s_c_models_8py}{}\section{code/run\+Experiments/apply\+Create\+S\+C\+Models.py File Reference}
\label{apply_create_s_c_models_8py}\index{code/run\+Experiments/apply\+Create\+S\+C\+Models.\+py@{code/run\+Experiments/apply\+Create\+S\+C\+Models.\+py}}
\subsection*{Namespaces}
\begin{DoxyCompactItemize}
\item
 \hyperlink{namespaceapply_create_s_c_models}{apply\+Create\+S\+C\+Models}
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item
def \hyperlink{namespaceapply_create_s_c_models_acb06a932d401dde3cc06ce800ef529fb}{apply\+Create\+S\+C\+Models.\+exec\+Ga\+Model\+SC} (year, region, depth, qnt\+Years=5, times=10, save=True)
\item
def \hyperlink{namespaceapply_create_s_c_models_abf6dafc972591d94c597acc2fcb90dd4}{apply\+Create\+S\+C\+Models.\+exec\+Etas\+Ga\+Model\+SC} (year, region, depth, qnt\+Years=5, times=10, save=True)
\item
def \hyperlink{namespaceapply_create_s_c_models_ab9bac5d8263793efc4b8db3b957a2087}{apply\+Create\+S\+C\+Models.\+create\+Real\+Model\+SC} (year, region, depth, with\+Mag=True, save=False)
\item
def \hyperlink{namespaceapply_create_s_c_models_ababbf819f509b367f2bb9cda41e8d856}{apply\+Create\+S\+C\+Models.\+call\+G\+A\+Model} (region, depth)
\item
def \hyperlink{namespaceapply_create_s_c_models_a602e755939a08f4bab291ed55646d356}{apply\+Create\+S\+C\+Models.\+call\+Etas\+G\+A\+Model} (region, depth)
\item
def \hyperlink{namespaceapply_create_s_c_models_a320e2283a254f21845fa4b6af7a65e68}{apply\+Create\+S\+C\+Models.\+main} ()
\end{DoxyCompactItemize}


text:
using System;
using System.Linq;
using System.Collections.Generic;

namespace WebSites
{
    public class WebSites
    {
        public static void Main()
        {
            var input = Console.ReadLine();

            var webList = new List<WebSite>();

            while (input != "end")
            {
                var currentInput = input
                    .Split(new[] { ' ', '|', ',' }, StringSplitOptions.RemoveEmptyEntries)
                    .ToList();

                var currentSite = new WebSite()
                {
                    Host = currentInput[0],
                    Domain = currentInput[1],
                    Queries = currentInput.Skip(2).ToList()
                };

                webList.Add(currentSite);

                input = Console.ReadLine();
            }

            foreach (var web in webList)
            {
                if (web.Queries.Count != 0)
                {
                    Console.Write($"https://www.{web.Host}.{web.Domain}/query?=");
                    Console.WriteLine($"[{string.Join("]&[", web.Queries)}]");
                }
                else
                {
                    Console.WriteLine($"https://www.{web.Host}.{web.Domain}");
                }
            }
        }

        public class WebSite
        {
            public string Host { get; set; }

            public string Domain { get; set; }

            public List<string> Queries { get; set; }
        }
    }
}


text:
package org.chocosolver.solver.thread;

/**
 * Master a set of slaves which will work in parallel
 *
 * @param <S>
 */
public class AbstractParallelMaster<S extends AbstractParallelSlave> {

    //***********************************************************************************
    // VARIABLES
    //***********************************************************************************

	public S[] slaves;
	public int nbWorkingSlaves;
    public boolean wait;

    public AbstractParallelMaster() {}

    //***********************************************************************************
    // DISTRIBUTED METHODS
    //***********************************************************************************

    /**
     * Make the slaves work in parallel
     */
    public void distributedSlavery() {
        nbWorkingSlaves = slaves.length;
        for (int i = 0; i < slaves.length; i++) {
            slaves[i].workInParallel();
        }
        wait = true;
        try {
            while (wait)
                Thread.sleep(20);
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(0);
        }
    }

    /**
     * Make the slaves work in sequence
     */
    public void sequentialSlavery() {
        nbWorkingSlaves = slaves.length;
        for (int i = 0; i < slaves.length; i++) {
            slaves[i].work();
        }
    }

    /**
     * A slave notify the master that he fulfilled his task
     */
    public synchronized void wishGranted() {
        nbWorkingSlaves--;
        if (nbWorkingSlaves == 0) {
            wait = false;
        }
    }
}


text:
/*!
** @file IFsh1.c
** @version 01.02
** @brief
**         This component "IntFLASH" implements an access to internal FLASH.
**         The component support reading/writing data into FLASH, erasing of
**         selected sector.
**         The component supports events if the write interrupt is supported.
**         The component supports following modes of write operations:
**           - Write - writing without any test.
**           - Destructive write - sector is erased if necessary.
**           - Safe write - user event is invoked to save and resore data
**                          from the current sector.
**         The component requires on-chip FLASH memory (not used/allocated by
**         other components).
*/
/*!
**  @addtogroup IFsh1_module IFsh1 module documentation
**  @{
*/

/* MODULE IFsh1. */

#include "Events.h"
#include "IFsh1.h"

#ifdef __cplusplus
extern "C" {
#endif

/* Internal method prototypes */

#define IFsh1_TOTAL_FLASH_BLOCK_COUNT  0x01U
#define IFsh1_P_FLASH_SIZE             0x8000U
#define IFsh1_P_FLASH_BLOCK_COUNT      0x01U
#define IFsh1_P_FLASH_BLOCK_SIZE       0x8000U

#define IFsh1_CMD_NONE                 0x00U
#define IFsh1_CMD_READ                 0x01U
#define IFsh1_CMD_ERASE_SECTOR         0x02U
#define IFsh1_CMD_ERASE_BLOCK          0x03U
#define IFsh1_CMD_VERIFY_ERASED_BLOCK  0x04U
#define IFsh1_CMD_WRITE                0x05U
#define IFsh1_CMD_WRITE_ERASE          0x06U

typedef struct IFsh1_TSector_Struct {
  uint32_t Data[IntFlashLdd1_ERASABLE_UNIT_SIZE/4U];
} IFsh1_TSector;

static uint32_t IFsh1_CurrentCommand;  /* Current command */
static bool IFsh1_CmdResult;           /* Last command result */
static bool IFsh1_CmdPending;          /* Current command state */
static bool IFsh1_EnEvent;             /* State of events (enabled/disabled) */

static LDD_TDeviceData* IntFlashLdd1_DevDataPtr;
static LDD_TData *IFsh1_DataAddress;
static LDD_FLASH_TAddress IFsh1_FlashAddress;
static LDD_FLASH_TDataSize IFsh1_DataSize;

byte IFsh1_SetFlash(IFsh1_TDataAddress Source, IFsh1_TAddress Dest, word Count);

/*
** ===================================================================
**     Method      :  IFsh1_SetFlash (component IntFLASH)
**
**     Description :
**         This method is internal. It is used by Processor Expert only.
** ===================================================================
*/
byte IFsh1_SetFlash(IFsh1_TDataAddress Src, IFsh1_TAddress Dst, word Count)
{
  LDD_TError                 Result;
  uint32_t                   x;

  if (IFsh1_CmdPending) {
    return ERR_BUSY;
  }
  for (x=0U; x<Count; x++) {           /* Check if written area is erased */
    if (((uint8_t*)Dst)[x] != 0xFFU) { /* Byte erased? */
      IFsh1_CurrentCommand = IFsh1_CMD_WRITE_ERASE;
      IFsh1_CmdPending = TRUE;
      IFsh1_DataAddress = (LDD_TData *)Src;
      IFsh1_FlashAddress = Dst;
      IFsh1_DataSize = Count;
      Result = IntFlashLdd1_Erase(IntFlashLdd1_DevDataPtr, (LDD_FLASH_TAddress)(Dst & ~(LDD_FLASH_TAddress)IntFlashLdd1_ERASABLE_UNIT_MASK), IntFlashLdd1_ERASABLE_UNIT_SIZE);
      if (Result == ERR_OK) {
        do {
        } while (IFsh1_CmdPending);
        Result = IFsh1_CmdResult;
      } else {
        IFsh1_CmdPending = FALSE;      /* Command parameter error */
        if (Result == ERR_PARAM_ADDRESS) {
          Result = ERR_RANGE;
        }
      }
      return (byte)Result;
    }
  }
  IFsh1_CurrentCommand = IFsh1_CMD_WRITE;
  IFsh1_CmdPending = TRUE;
  Result = IntFlashLdd1_Write(IntFlashLdd1_DevDataPtr, (LDD_TData *)Src, Dst, (LDD_FLASH_TDataSize)Count); /* Start reading from the flash memory */
  if (Result == ERR_OK) {
    do {
    } while (IFsh1_CmdPending);
    Result = IFsh1_CmdResult;
  } else {
    IFsh1_CmdPending = FALSE;          /* Command parameter error */
    if (Result == ERR_PARAM_ADDRESS) {
      Result = ERR_RANGE;
    }
  }
  return (byte)Result;
}

/*
** ===================================================================
**     Method      :  IFsh1_Init (component IntFLASH)
**
**     Description :
**         This method is internal. It is used by Processor Expert only.
** ===================================================================
*/
void IFsh1_Init(void)
{
  IntFlashLdd1_DevDataPtr = IntFlashLdd1_Init(NULL);
  IFsh1_CmdPending = FALSE;
  IFsh1_EnEvent = TRUE;                /* Remember events state */
}

/*
** ===================================================================
**     Method      :  IFsh1_DisableEvent (component IntFLASH)
*/
/*!
**     @brief
**         This method disables all the events except [OnSaveBuffer],
**         [OnRestoreBuffer] and [OnEraseError]. The method is
**         available only if any event is enabled.
**     @return
**                         - Error code, possible codes:
**                           - ERR_OK - OK
**                           - ERR_SPEED - This device does not work in
**                           the active speed mode
*/
/* ===================================================================*/
byte IFsh1_DisableEvent(void)
{
  IFsh1_EnEvent = FALSE;
  return ERR_OK;
}

/*
** ===================================================================
**     Method      :  IFsh1_EnableEvent (component IntFLASH)
*/
/*!
**     @brief
**         This method enables all the events except [OnSaveBuffer],
**         [OnRestoreBuffer] and [OnEraseError]. The method is
**         available only if any event is enabled.
**     @return
**                         - Error code, possible codes:
**                           - ERR_OK - OK
**                           - ERR_SPEED - This device does not work in
**                           the active speed mode
*/
/* ===================================================================*/
byte IFsh1_EnableEvent(void)
{
  IFsh1_EnEvent = TRUE;
  return ERR_OK;
}

/*
** ===================================================================
**     Method      :  IFsh1_EraseFlash (component IntFLASH)
*/
/*!
**     @brief
**         Erases entire memory array of the selected Flash block.
**     @param
**         Block           - Block number of the Flash memory block
**                           that will be erased. Number is in range
**                           zero to maximum available block number. Not
**                           used for Freescale 56800 derivates except
**                           for the Program_Boot_Flash on 56F83xx and
**                           56F81xx derivatives. If the flash memory
**                           contais only one block, this parameter is
**                           ignored.
**     @return
**                         - Error code, possible codes:
**                           - ERR_OK - OK
**                           - ERR_NOTAVAIL - Desired program/erase
**                           operation is not available
**                           - ERR_RANGE - Block number is out of range
**                           - ERR_SPEED - This device does not work in
**                           the active speed mode
**                           - ERR_BUSY - Device is busy
**                           - ERR_VALUE - Flash erase was not successful
*/
/* ===================================================================*/
byte IFsh1_EraseFlash(byte Block)
{
  LDD_TError                 Result;

  if (IFsh1_CmdPending) {
    return ERR_BUSY;
  }
  IFsh1_CurrentCommand = IFsh1_CMD_ERASE_BLOCK;
  IFsh1_CmdPending = TRUE;
  Result = IntFlashLdd1_EraseBlock(IntFlashLdd1_DevDataPtr, ((LDD_FLASH_TAddress)Block * IFsh1_P_FLASH_BLOCK_SIZE));
  if (Result == ERR_OK) {
    do {
    } while (IFsh1_CmdPending);
    Result = IFsh1_CmdResult;
  } else {
    IFsh1_CmdPending = FALSE;          /* Command parameter error */
    if (Result == ERR_PARAM_ADDRESS) {
      Result = ERR_RANGE;
    }
  }
  return (byte)Result;
}

/*
** ===================================================================
**     Method      :  IFsh1_EraseSector (component IntFLASH)
*/
/*!
**     @brief
**         Erases the sector to which address Addr belongs.
**     @param
**         Addr            - Address in FLASH.
**     @return
**                         - Error code, possible codes:
**                           - ERR_OK - OK
**                           - ERR_NOTAVAIL - Desired program/erase
**                           operation is not available
**                           - ERR_RANGE - Address is out of range
**                           - ERR_SPEED - This device does not work in
**                           the active speed mode
**                           - ERR_BUSY - Device is busy
**                           - ERR_PROTECT - Flash is write protect
**                           - ERR_VALUE - Flash sector erase was not
**                           successful
*/
/* ===================================================================*/
byte IFsh1_EraseSector(IFsh1_TAddress Addr)
{
  LDD_TError                 Result;

  if (IFsh1_CmdPending) {
    return ERR_BUSY;
  }
  IFsh1_CurrentCommand = IFsh1_CMD_ERASE_SECTOR;
  IFsh1_CmdPending = TRUE;
  Result = IntFlashLdd1_Erase(IntFlashLdd1_DevDataPtr, (LDD_FLASH_TAddress)(Addr & ~(LDD_FLASH_TAddress)IntFlashLdd1_ERASABLE_UNIT_MASK), IntFlashLdd1_ERASABLE_UNIT_SIZE);
  if (Result == ERR_OK) {
    do {
    } while (IFsh1_CmdPending);
    Result = IFsh1_CmdResult;
  } else {
    IFsh1_CmdPending = FALSE;          /* Command parameter error */
    if (Result == ERR_PARAM_ADDRESS) {
      Result = ERR_RANGE;
    }
  }
  return (byte)Result;
}

/*
** ===================================================================
**     Method      :  IFsh1_SetBlockFlash (component IntFLASH)
*/
/*!
**     @brief
**         Writes data to FLASH. The operation of this method depends
**         on the "Write method" property and state of the flash.
**         Please see more details on general info page of the help.
**     @param
**         Source          - Source address of the data.
**     @param
**         Dest            - Destination address in FLASH.
**     @param
**         Count           - Count of the data fields (in the
**                           smallest addressable units).
**     @return
**                         - Error code, possible codes:
**                           - ERR_OK - OK
**                           - ERR_NOTAVAIL - Desired program/erase
**                           operation is not available
**                           - ERR_RANGE - The address is out of range
**                           - ERR_BUSY - Device is busy
**                           - ERR_SPEED - This device does not work in
**                           the active speed mode
**                           - ERR_PROTECT - Flash is write protect
**                           - ERR_VALUE - Read value is not equal to
**                           written value
*/
/* ===================================================================*/
byte IFsh1_SetBlockFlash(IFsh1_TDataAddress Source, IFsh1_TAddress Dest, word Count)
{
  return IFsh1_SetFlash(Source, Dest, Count);
}

/*
** ===================================================================
**     Method      :  IFsh1_OnOperationComplete (component IntFLASH)
**
**     Description :
**         This method is internal. It is used by Processor Expert only.
** ===================================================================
*/
void IntFlashLdd1_OnOperationComplete(LDD_TUserData *UserDataPtr)
{
  (void)UserDataPtr;                   /* Parameter is not used, suppress unused argument warning */
  IFsh1_CmdResult = ERR_OK;            /* No error appears */
  switch (IFsh1_CurrentCommand) {
    case IFsh1_CMD_WRITE_ERASE:
      IFsh1_CurrentCommand = IFsh1_CMD_WRITE;
      IFsh1_CmdResult = (byte)IntFlashLdd1_Write(IntFlashLdd1_DevDataPtr, IFsh1_DataAddress, IFsh1_FlashAddress, IFsh1_DataSize); /* Start reading from the flash memory */
      if (IFsh1_CmdResult != ERR_OK) { /* Write command error? */
        IFsh1_CmdPending = FALSE;      /* Command is finished */
      }
      return;
    case IFsh1_CMD_WRITE:
      IFsh1_CmdPending = FALSE;        /* Command is finished */
      break;
    default:
      IFsh1_CmdPending = FALSE;        /* Command is finished */
      return;
  }
  if (IFsh1_EnEvent == TRUE) {
    IFsh1_OnWriteEnd();
  }
}

/*
** ===================================================================
**     Method      :  IFsh1_OnError (component IntFLASH)
**
**     Description :
**         This method is internal. It is used by Processor Expert only.
** ===================================================================
*/
void IntFlashLdd1_OnError(LDD_TUserData *UserDataPtr)
{
  LDD_FLASH_TErrorStatus FLASH_LDD_ErrorStatus;

  (void)UserDataPtr;                   /* Parameter is not used, suppress unused argument warning */
  IFsh1_CmdPending = FALSE;
  IFsh1_CurrentCommand = IFsh1_CMD_NONE;
  IntFlashLdd1_GetError(IntFlashLdd1_DevDataPtr, &FLASH_LDD_ErrorStatus);
  if (FLASH_LDD_ErrorStatus.CurrentErrorFlags & LDD_FLASH_PROTECTION_VIOLATION) {
    IFsh1_CmdResult = ERR_PROTECT;     /* Protection violation */
  } else {
    IFsh1_CmdResult = ERR_VALUE;       /* Access error or Read collision error */
  }
}

/* END IFsh1. */

#ifdef __cplusplus
}  /* extern "C" */
#endif

/*!
** @}
*/
/*
** ###################################################################
**
**     This file was created by Processor Expert 10.5 [05.21]
**     for the Freescale Kinetis series of microcontrollers.
**
** ###################################################################
*/


text:
package com.intellij.tasks.impl;

import com.intellij.openapi.project.Project;
import com.intellij.openapi.vcs.CheckinProjectPanel;
import com.intellij.openapi.vcs.changes.CommitContext;
import com.intellij.openapi.vcs.checkin.CheckinHandler;
import com.intellij.openapi.vcs.checkin.CheckinHandlerFactory;
import com.intellij.tasks.LocalTask;
import com.intellij.tasks.Task;
import com.intellij.tasks.TaskManager;
import com.intellij.tasks.TaskRepository;
import com.intellij.tasks.context.WorkingContextManager;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.util.Date;

/**
 * @author Dmitry Avdeev
 *         Date: 12/29/11
 */
public class TaskCheckinHandlerFactory extends CheckinHandlerFactory {

  @NotNull
  @Override
  public CheckinHandler createHandler(final CheckinProjectPanel panel, final CommitContext commitContext) {
    return new CheckinHandler() {
      @Override
      public void checkinSuccessful() {
        final String message = panel.getCommitMessage();
        if (message != null) {
          final Project project = panel.getProject();
          final TaskManagerImpl manager = (TaskManagerImpl)TaskManager.getManager(project);
          if (manager.getState().saveContextOnCommit) {
            Task task = findTaskInRepositories(message, manager);
            if (task == null) {
              task = manager.createLocalTask(message);
            }
            final LocalTask localTask = manager.addTask(task);
            localTask.setUpdated(new Date());

            //noinspection SSBasedInspection
            SwingUtilities.invokeLater(new Runnable() {
              @Override
              public void run() {
                if (!project.isDisposed()) {
                  WorkingContextManager.getInstance(project).saveContext(localTask);
                }
              }
            });
          }
        }
      }
    };
  }

  @Nullable
  private static Task findTaskInRepositories(String message, TaskManager manager) {
    TaskRepository[] repositories = manager.getAllRepositories();
    for (TaskRepository repository : repositories) {
      String id = repository.extractId(message);
      if (id == null) continue;
      LocalTask localTask = manager.findTask(id);
      if (localTask != null) return localTask;
      try {
        Task task = repository.findTask(id);
        if (task != null) {
          return task;
        }
      }
      catch (Exception ignore) {

      }
    }
    return null;
  }
}


text:
Container of some microservices written in Golang. This is example project for the talk at Golang Vietnam's meetup 11h August 2015.

More information's coming soon.


text:
program energy

 != unit (m) :: height
 != unit (kg) :: mass
 != unit (m / s**2) :: gravity
 real, parameter :: mass = 3.00, gravity = .81, height = 4.20

 != unit (1) :: i
 integer :: i = 0
 != unit (1) :: j
 integer :: j = i

 != unit (kg m**2 / s**2) :: potential_energy
 real :: potential_energy

 potential_energy = mass * gravity * height
end program energy


text:
void speak(id self, SEL _cmd, id some) {

    id age = object_getIvar(self, class_getInstanceVariable([self class], "_age"));
    NSString *name = [self valueForKey:@"_name"];
    NSString *sex = object_getIvar(self, class_getInstanceVariable([self class], "_sex"));
    NSLog(@"%@---%@---%@----%@", name, age,sex, some);
}

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        // insert code here...
        NSLog(@"Hello, World!");

        Class Person = objc_allocateClassPair([NSObject class], "Person", 0);

        class_addIvar(Person, "_name", sizeof(NSString *), log2(sizeof(NSString *)), @encode(NSString *));
        class_addIvar(Person, "_age", sizeof(int), sizeof(int), @encode(int));
        class_addIvar(Person, "_sex", sizeof(NSString *), log2(sizeof(NSString *)), @encode(NSString *));

        SEL method = sel_registerName("speak");
        class_addMethod(Person, method, (IMP)speak, "v@:@");
        objc_registerClassPair(Person);

        // 创建一个People的实例
        id people = [[Person alloc] init];
        [people setValue:@"小明" forKey:@"_name"];

        Ivar ageIvar = class_getInstanceVariable(Person, "_age");
        object_setIvar(people, ageIvar, @18);

        Ivar sexIvar = class_getInstanceVariable(Person, "_sex");
        object_setIvar(people, sexIvar, @"M");

        ((void (*)(id, SEL, id))objc_msgSend)(people, method, @"iOS开发");

        people = nil;
        objc_disposeClassPair(Person);

    }
    return 0;
}


text:
package rkt

import (
	"fmt"
	"strconv"
	"strings"

	"github.com/coreos/go-systemd/dbus"
)

// systemdVersion is a type wraps the int to implement kubecontainer.Version interface.
type systemdVersion int

func (s systemdVersion) String() string {
	return fmt.Sprintf("%d", s)
}

func (s systemdVersion) Compare(other string) (int, error) {
	v, err := strconv.Atoi(other)
	if err != nil {
		return -1, err
	}
	if int(s) < v {
		return -1, nil
	} else if int(s) > v {
		return 1, nil
	}
	return 0, nil
}

// systemdInterface is an abstraction of the go-systemd/dbus to make
// it mockable for testing.
// TODO(yifan): Eventually we should move these functionalities to:
// 1. a package for launching/stopping rkt pods.
// 2. rkt api-service interface for listing pods.
// See https://github.com/coreos/rkt/issues/1769.
type systemdInterface interface {
	// Version returns the version of the systemd.
	Version() (systemdVersion, error)
	// ListUnits lists all the loaded units.
	ListUnits() ([]dbus.UnitStatus, error)
	// StopUnits stops the unit with the given name.
	StopUnit(name string, mode string, ch chan<- string) (int, error)
	// RestartUnit restarts the unit with the given name.
	RestartUnit(name string, mode string, ch chan<- string) (int, error)
	// ResetFailedUnit resets the "failed" state of a specific unit.
	ResetFailedUnit(name string) error
}

// systemd implements the systemdInterface using dbus and systemctl.
// All the functions other then Version() are already implemented by go-systemd/dbus.
type systemd struct {
	*dbus.Conn
}

// newSystemd creates a systemd object that implements systemdInterface.
func newSystemd() (*systemd, error) {
	dbusConn, err := dbus.New()
	if err != nil {
		return nil, err
	}
	return &systemd{dbusConn}, nil
}

// Version returns the version of the systemd.
func (s *systemd) Version() (systemdVersion, error) {
	versionStr, err := s.Conn.GetManagerProperty("Version")
	if err != nil {
		return -1, err
	}
	result, err := strconv.Atoi(strings.Trim(versionStr, "\""))
	if err != nil {
		return -1, err
	}
	return systemdVersion(result), nil
}


text:
<?php

namespace backend\models;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use backend\models\Church;

/**
 * ChurchSearch represents the model behind the search form about `backend\models\Church`.
 */
class ChurchSearch extends Church
{
    public $globalRoomSearch;
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['church_id', 'church_renshu'], 'integer'],
            [['church_name', 'church_address', 'globalRoomSearch','church_pastor', 'church_service_time', 'church_contact_info', 'church_vision', 'church_mission'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = Church::find();

        // add conditions that should always apply here

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        // grid filtering conditions
        $query->andFilterWhere([
            'church_id' => $this->church_id,
            'church_service_time' => $this->church_service_time,
            'church_renshu' => $this->church_renshu,
        ]);

        $query->andFilterWhere(['like', 'church_name', $this->church_name])
            ->andFilterWhere(['like', 'church_address', $this->church_address])
            ->andFilterWhere(['like', 'church_pastor', $this->church_pastor])
            ->andFilterWhere(['like', 'church_contact_info', $this->church_contact_info])
            ->andFilterWhere(['like', 'church_vision', $this->church_vision])
            ->andFilterWhere(['like', 'church_mission', $this->church_mission]);

                     //global search
     $query->orFilterWhere(['like', 'church_name', $this->globalRoomSearch])
            ->orFilterWhere(['like', 'church_address', $this->globalRoomSearch])
            ->orFilterWhere(['like', 'church_pastor', $this->globalRoomSearch])
            ->orFilterWhere(['like', 'church_contact_info', $this->globalRoomSearch])
            ->orFilterWhere(['like', 'contact_phone', $this->globalRoomSearch]);

        return $dataProvider;
    }
}


text:
package nl.famscheper.rh01477141.authorization;

import nl.famscheper.rh01477141.authentication.Identity;
import nl.famscheper.rh01477141.config.AuthenticationViewDefinition;
import org.apache.deltaspike.core.api.config.view.controller.PreRenderView;
import org.apache.deltaspike.core.api.config.view.navigation.ViewNavigationHandler;

import javax.enterprise.inject.Model;
import javax.inject.Inject;
import java.io.IOException;

/**
 * Controller for the authorization failures, e.g. when a user is not logged in, or when a user is logged in, but requests access to unauthorized pages.
 *
 * @author Erik-Berndt Scheper
 * @since 30-09-2015
 */
@Model
public class AuthorizationFailureController {

    @Inject
    Identity identity;

    @Inject
    private ViewNavigationHandler viewNavigationHandler;

    @Inject
    private AuthenticationViewDefinition authenticationViewDefinition;

    @PreRenderView
    protected void onPreRenderView() throws IOException {
        if (!identity.isLoggedIn()) {
            this.viewNavigationHandler.navigateTo(authenticationViewDefinition.login());
        }

    }
}


text:
package org.logo.viewer.logo.graphic;

import org.logo.viewer.logo.graphic.actions.AzioneGrafica;

/**
 * Elemento della coda di stampa. Rappresenta uno spostamento della tartaruga
 *
 * @author Marco Speranza
 * @version 0.1
 */
public interface Action {

	/**
	 * Esegue l'azione. Calcola il valore finale a partire che provoca questa
	 * azione
	 *
	 * @param initialPointX
	 *            punto iniziale
	 * @param initialPointY
	 *            punto iniziale
	 * @param angulation
	 *            angolazione
	 * @return istanza di AzioneGrafica che verra' stampata a video
	 */
	public abstract AzioneGrafica esegui(double initialPointX,
			double initialPointY, double angulation);
}


text:
package cz.filipekt.jdcv.network;

/**
 * Represents a "node" XML element in the network source file.
 *
 * @author Tomas Filipek <tom.filipek@seznam.cz>
 */
public class MyNode {

	/**
	 * The unique id of the node
	 */
	private final String id;

	/**
	 * x-coordinate of the node
	 */
	private final double x;

	/**
	 * y-coordinate of the node
	 */
	private final double y;

	/**
	 * @param id The unique id of the node
	 * @param x x-coordinate of the node
	 * @param y y-coordinate of the node
	 */
	public MyNode(String id, double x, double y) {
		super();
		this.id = id;
		this.x = x;
		this.y = y;
	}

	/**
	 * @return The unique id of the node
	 * @see {@link MyNode#id}
	 */
	public String getId() {
		return id;
	}

	/**
	 * @return x-coordinate of the node
	 * @see {@link MyNode#x}
	 */
	public double getX() {
		return x;
	}

	/**
	 * @return y-coordinate of the node
	 * @see {@link MyNode#y}
	 */
	public double getY() {
		return y;
	}

	/**
	 * Implements the unique identification of the {@link MyNode} object
	 * by {@link MyNode#id}
	 * @see {@link MyNode#hashCode()}
	 */
	@Override
	public boolean equals(Object obj) {
		if (obj instanceof MyNode){
			MyNode that = (MyNode)obj;
			return this.id.equals(that.id);
		} else {
			return false;
		}
	}

	/**
	 * Implements the unique identification of the {@link MyNode} object
	 * by {@link MyNode#id}
	 * @see {@link MyNode#equals(Object)}
	 */
	@Override
	public int hashCode() {
		return this.id.hashCode();
	}

}


text:
[#]: subject: "Revolt: An Open-Source Alternative to Discord"
[#]: via: "https://itsfoss.com/revolt/"
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "

Revolt: An Open-Source Alternative to Discord
======

_**Brief**: Revolt is a promising free and open-source choice to replace Discord. Here, we take a look at what it offers along with its initial impressions._

Discord is a feature-rich collaboration platform primarily tailored for gamers. Even though you can use Discord on Linux with no issues, it is still a proprietary solution.

You can choose to use [Element][1] as an open-source solution collaboration platform, but it is not a replacement.

But, Revolt is an impressive Discord alternative that is open-source.

Note

Revolt is in the public beta testing phase and does not offer any mobile applications. It may lack some essential features that you find on Discord.

Let me highlight what you can expect with Revolt and if it can be a replacement for Discord on Linux.

### An Open Source Discord Alternative That You Can Self-Host

![][2]

Revolt is not just a simple open-source replacement, but you also get the ability to self-host.

It does lack a variety of features that Discord offers, but you get a lot of basic functionalities to get a head start to start experimenting.

Even without some features, you could mention it as a feature-rich open-source client. Let us look at the features available right now.

### Features of Revolt

![][3]

While it looks and feels a lot like Discord already, here are some of the key highlights:

  * Ability to create your own server
  * Create text channels and voice channels
  * Assign user roles in a server
  * Tweak the theme (dark/light)
  * Change the accent color
  * Manage the font and emoji packs from available options
  * Custom CSS support
  * Ability to add bots
  * Easy to manage permissions for text/voice channels
  * Send friend requests to other users
  * Saved notes section
  * Ability to control notifications
  * Hardware acceleration support
  * Dedicated desktop settings
  * Self-hosting using Docker
  * User status and custom status support

So, as something in the public beta testing phase, it sounds excellent for starters. You already get most of the core functionalities, but you may want to wait to see it as a full-fledged Discord replacement.

### Initial Impressions of Using Revolt

![][4]

If you have used Discord, the user experience will feel familiar. And that is a good thing here.

For this quick app highlight, I did not compare the resource usage of Discord and Revolt because it is still in beta and won't be an apples-to-apples comparison.

However, in my brief testing, it felt snappy, except the case when you load up a text channel for the first time. When publishing this, it did not have the Two-Factor Authentication (2FA) feature but was supposed to be added in their first milestone (Version 1) release.

![][5]

Some features like user status, permission management, and appearance tweaks looked useful. But, when it comes to the voice channels, it is not the same way as Discord works, at least for now.

I have no idea if they plan to do it the same way, but Discord's voice channel feature is intuitive, fast, and with better controls.

Not to forget, Discord also offers "Discord Stage," which is a Clubhouse-like audio room feature.

Some other features that I couldn't find included:

  * Ability to react to messages
  * Noise suppression feature
  * Change server
  * Server logs
  * Variety of useful bots

Of course, it will take a significant amount of time to catch up with the features offered by Discord, but at least we now have an open-source solution to Discord.

You can explore their [project roadmap/release tracker][6] to see what you can expect in its final/future releases.

### Install Revolt in Linux

Revolt is available for Linux and Windows. You can choose to use it on your web browser without needing a separate application.

But, if you need to have it on your desktop, they offer an AppImage file and a deb package that you can grab from its [GitHub releases section][7].

If you're new to Linux, refer to our resources on [using an AppImage file][8] and [installing deb packages][9] to get started.

Feel free to head to its [Feedback section][10] if you want to help them improve with your bug reports and suggestions. Also, you can explore their [GitHub page][11] for more information.

[Revolt][12]

What do you think about Revolt? Do you believe that it has the potential to become a good open-source replacement to Discord on Linux?

Let me know your thoughts in the comments down below!

--------------------------------------------------------------------------------

via: https://itsfoss.com/revolt/

作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)

本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/element/
[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/revolt-screenshot.png?resize=800%2C506&ssl=1
[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/revolt-desktop-settings.png?resize=800%2C501&ssl=1
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/revolt-screenshot1.png?resize=800%2C509&ssl=1
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/revolt-appearance-setting.png?resize=800%2C524&ssl=1
[6]: https://github.com/orgs/revoltchat/projects/2
[7]: https://github.com/revoltchat/desktop/releases/tag/v1.0.2
[8]: https://itsfoss.com/use-appimage-linux/
[9]: https://itsfoss.com/install-deb-files-ubuntu/
[10]: https://app.revolt.chat/settings/feedback
[11]: https://github.com/revoltchat
[12]: https://revolt.chat


text:
<!doctype html>

<title>Basic Demo Tutorial</title>

<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,200,200italic,300,300italic,400italic,600,600italic,700,700italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/app.css" />

<?php //require 'lib/homepage-hero.php'; ?>

<?php require 'lib/header.php'; ?>

Get in touch, with us!

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquid asperiores aut debitis, eum ex facilis fugiat harum illum inventore molestias necessitatibus omnis possimus praesentium quae quam quisquam, repudiandae voluptas voluptate? Aliquid asperiores aut debitis, eum ex facilis fugiat harum illum inventore molestias necessitatibus omnis possimus praesentium quae quam quisquam, repudiandae voluptas voluptate.

        <form action="process/contact.php" method="post" class="text-left">

                Name
                <input type="text" class="form-control" name="name" id="name" placeholder="Enter your name..." />

                    Phone
                    <input type="text" class="form-control" name="phone" id="phone" placeholder="Enter phone..." />

                    Email
                    <input type="text" class="form-control" name="email" id="email" placeholder="Enter email..." />

                Message
                <textarea class="form-control" name="message" id="message" placeholder="Enter your message..."></textarea>

                <button type="submit" class="btn btn-primary">Send message</button>

        </form>

We have numerous locations globally

Headquarters

            123 Somewhere Rd.

            Silicon Valley, CA 94301

            P: 800-567-4958

Headquarters

                123 Somewhere Rd.

                Silicon Valley, CA 94301

                P: 800-567-4958

Headquarters

                123 Somewhere Rd.

                Silicon Valley, CA 94301

                P: 800-567-4958

Headquarters

                123 Somewhere Rd.

                Silicon Valley, CA 94301

                P: 800-567-4958

<?php require 'lib/footer.php'; ?>


text:
'use strict';

module.exports = `<%
var player = _.find(self.snippets, snippet => {
  return snippet.tags.indexOf('player') !== -1 && snippet.tags.indexOf('html5') !== -1;
});

var desiredThumbnailWidth = 480;

var thumbnail = _.chain(self.snippets)
  // Get thumbnails
  .filter(snippet => snippet.tags.indexOf('thumbnail') !== -1)
  // Sort by width (closest to "desiredThumbnailWidth")
  .sortBy(snippet => Math.abs((snippet.media.width || 0) - desiredThumbnailWidth))
  // Get first
  .first()
  .value();

var href = player.href;

// Modify or set autoplay param. http://stackoverflow.com/questions/7517332
if (player.media.autoplay) {
  var param = player.media.autoplay.split('=');
  var parts = self.utils.url.parse(href, true);

  parts.query[param[0]] = param[1];
  delete parts.search;
  href = self.utils.url.format(parts);
}

var placeholder = '';

var duration;

if (player.media.duration && player.media.duration > 0) {
  var s = player.media.duration % 60;

  duration = [
    Math.floor(player.media.duration / 3600), // hours
    Math.floor(player.media.duration / 60) % 60, // minutes
    s < 10 ? '0' + s : s // seconds with leading '0'
  ];

  // Remove hours if video shorter than hour
  if (duration[0] === 0) {
    duration.shift();
  }
}
%>

<div class="ez-player ez-domain-<%= self.domain.replace(/[.]/g, '_') %> ez-block" data-placeholder="<%- placeholder %>">
  <div class="ez-player-container"  style="padding-bottom: <%= _.round(100 / player.media.width * player.media.height, 4) %>%;">
    <a class="ez-player-placeholder" target="_blank" href="<%- self.src %>" rel="nofollow">
      <div class="ez-player-picture" style="background-image: url('<%- thumbnail.href %>');">

      <% if (self.meta.title) { %>

            <%- self.meta.title %>

      <% } %>

      <% if (duration) { %>

<%= duration.join(':') %>

      <% } %>

`;


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
The Genus Aspergillus 111 (1926)

#### Original name
Aspergillus chevalieri var. chevalieri Thom & Church

### Remarks
null


text:
package file

import (
	"fmt"
	"strings"
)

// Idx is a compact encoding of a source position within a file set.
// It can be converted into a Position for a more convenient, but much
// larger, representation.
type Idx int

// Position describes an arbitrary source position
// including the filename, line, and column location.
type Position struct {
	Filename string // The filename where the error occurred, if any
	Offset   int    // The src offset
	Line     int    // The line number, starting at 1
	Column   int    // The column number, starting at 1 (The character count)

}

// A Position is valid if the line number is > 0.

func (self *Position) isValid() bool {
	return self.Line > 0
}

// String returns a string in one of several forms:
//
//	file:line:column    A valid position with filename
//	line:column         A valid position without filename
//	file                An invalid position with filename
//	-                   An invalid position without filename
//
func (self *Position) String() string {
	str := self.Filename
	if self.isValid() {
		if str != "" {
			str += ":"
		}
		str += fmt.Sprintf("%d:%d", self.Line, self.Column)
	}
	if str == "" {
		str = "-"
	}
	return str
}

// FileSet

// A FileSet represents a set of source files.
type FileSet struct {
	files []*File
	last  *File
}

// AddFile adds a new file with the given filename and src.
//
// This an internal method, but exported for cross-package use.
func (self *FileSet) AddFile(filename, src string) int {
	base := self.nextBase()
	file := &File{
		name: filename,
		src:  src,
		base: base,
	}
	self.files = append(self.files, file)
	self.last = file
	return base
}

func (self *FileSet) nextBase() int {
	if self.last == nil {
		return 1
	}
	return self.last.base + len(self.last.src) + 1
}

func (self *FileSet) File(idx Idx) *File {
	for _, file := range self.files {
		if idx <= Idx(file.base+len(file.src)) {
			return file
		}
	}
	return nil
}

// Position converts an Idx in the FileSet into a Position.
func (self *FileSet) Position(idx Idx) *Position {
	position := &Position{}
	for _, file := range self.files {
		if idx <= Idx(file.base+len(file.src)) {
			offset := int(idx) - file.base
			src := file.src[:offset]
			position.Filename = file.name
			position.Offset = offset
			position.Line = 1 + strings.Count(src, "\n")
			if index := strings.LastIndex(src, "\n"); index >= 0 {
				position.Column = offset - index
			} else {
				position.Column = 1 + len(src)
			}
		}
	}
	return position
}

type File struct {
	name string
	src  string
	base int // This will always be 1 or greater
}

func NewFile(filename, src string, base int) *File {
	return &File{
		name: filename,
		src:  src,
		base: base,
	}
}

// Position converts an Idx in the FileSet into a Position.
func (self *File) Position(idx Idx) *Position {
	position := &Position{}
	offset := int(idx) - self.base
	src := self.src[:offset]
	position.Filename = self.name
	position.Offset = offset
	position.Line = 1 + strings.Count(src, "\n")
	if index := strings.LastIndex(src, "\n"); index >= 0 {
		position.Column = offset - index
	} else {
		position.Column = 1 + len(src)
	}

	return position
}

func (fl *File) Name() string {
	return fl.name
}

func (fl *File) Source() string {
	return fl.src
}

func (fl *File) Base() int {
	return fl.base
}


text:
import reload, {
  normalizeSync,
  getDependencyTree,
  traceToRootModule
} from '/lib/reloader.js';

import _ from 'lodash';

describe('reload', function(){
  beforeEach(function(done){
    // load app.js everytime.
    System.import('example/app.js').then(() => {
      done();
    });
  });

  it('should reload imported file', function(done){
    assert.doesNotThrow(() => {
      sinon.spy(System, 'import');
      reload('example/app.js').then(() => {
        assert(System.import.calledWith(sinon.match(/example\/app\.js/)));
        System.import.restore();
        done();
      });
    });
  });

  it('should not throws error with not imported file', function(){
    assert.doesNotThrow(() => {
      reload('example/not-exsits.js')
    }, /Failed to delete\. because file\(.*\) not imported yet./);
  });

  it('should remove old dom on reload css file', function(done){
    const path = 'example/sample.css';
    const linkTo = _.trim(path, '!');
    let styleNodes = document.querySelectorAll(`link[href*="${linkTo}"]`);
    assert(styleNodes.length > 0);
    styleNodes[0].classList.add('will-remove');
    assert(styleNodes[0].classList.contains('will-remove'));

    assert.doesNotThrow(() => {
      reload(path).then(() => {
        let styleNodes = document.querySelectorAll(`link[href*="${linkTo}"]`);
        assert(styleNodes.length === 1);
        // styleNode must be regenerated.
        assert.isNotOk(styleNodes[0].classList.contains('will-remove'));
        done();
      });
    });
  });

  it('should not throws error with not imported css file', function(){
    assert.doesNotThrow(() => {
      reload('example/nested/not-exists.css!')
    }, /Failed to delete\. because file\(.*\) not imported yet./);
  });

  it('should not call import of single file if bundled', function(done){
    System.config({
      bundles: {
        "build.js": [
          `${location.origin}/example/app.js`,
          `${location.origin}/example/nested/sample.css!github:systemjs/plugin-css@0.1.22/css.js`,
          `${location.origin}/github:systemjs/plugin-css@0.1.22.json`,
          `${location.origin}/example/nested/example.js`,
          `${location.origin}/example/nested/test.js`
        ]
      }
    });

    sinon.spy(System, 'import');
    assert.doesNotThrow(() => {
      reload('example/app.js').then(() => {
        assert.isNotOk(System.import.calledWith(sinon.match(/example\/app\.js/)));
        System.import.restore();
        done();
      });
    });
  });

  it('should call unload/reload hook by correct order on reload', function(done){
    const onReload = sinon.spy();
    const onUnload = sinon.spy();

    const dummyModule = System.newModule({
      _reload: onReload,
      _unload: onUnload,
      default: () => true
    });
    System.set('dummy-module.js', dummyModule);

    const mockedImport = () => {
      return Promise.resolve(dummyModule);
    };

    System.import('dummy-module.js').then((module) => {
      assert(module.default() === true);
      sinon.stub(System, 'import', mockedImport);
      reload('dummy-module.js').then((module) => {
        assert.isOk(module._unload.called === true);
        assert.isOk(module._reload.called === true);
        // call unload first and then reload.
        assert.callOrder(module._unload, module._reload);
        System.import.restore();
        done();
      });
    });
  });
});

describe('normalizeSync', function() {
  beforeEach(function (done) {
    // load app.js everytime.
    System.import('example/app.js').then(() => {
      done();
    });
  });

  it('should return same result with System.normalize', function(done){
    // maybe original normalizeSync is not return correct path.
    //console.log(System.normalizeSync('example/sample.css!'));
    assert.strictEqual(System.normalizeSync('example/sample.css!'), normalizeSync('example/sample.css!'));

    System.normalize('example/sample.css!').then(normalized => {
      // so we need to use original one.
      assert.deepEqual(normalized, normalizeSync('example/sample.css!'));
      done();
    });
  });

  it('should parse relative path correctly', function(done){
    System.normalize('./example/app.js').then(normalized => {
      assert.deepEqual(normalized, normalizeSync('./example/app.js'));
      done();
    });
  });

  it('should parse nested relative path correctly', function(done){
    System.normalize('../example/app.js').then(normalized => {
      assert.deepEqual(normalized, normalizeSync('../example/app.js'));
      done();
    });
  });

  it('should parse deep nested relative path correctly', function(done){
    System.normalize('deepNested/index.js').then(normalized => {
      assert.deepEqual(normalized, normalizeSync('deepNested/index.js'));
      done();
    });
  });

  it('should use basePath if passed.', function(){
    assert.deepEqual(normalizeSync('./deepNested/index.js', '/'), `${location.origin}/deepNested/index.js`);
  });

  it('should use basePath if passed.', function(){
    assert.deepEqual(normalizeSync('./deepNested/index.js', `/nested`), `${location.origin}/nested/deepNested/index.js`);
  });

  it('should arrow absolutePath as basePath.', function(){
    assert.deepEqual(normalizeSync('/deepNested/index.js', `/nested`), `${location.origin}/deepNested/index.js`);
  });

  it('should arrow file contained path as basePath.', function(){
    assert.deepEqual(normalizeSync('./deepNested/index.js', `/nested/index.js`), `${location.origin}/nested/deepNested/index.js`);
  });

  it('should arrow file contained absolute path as basePath.', function(){
    assert.deepEqual(normalizeSync('./deepNested/index.js', `nested/index.js`), `${location.origin}/nested/deepNested/index.js`);
  });

  it('should arrow relative path and absolute path as basePath.', function(){
    assert.deepEqual(normalizeSync('example/nested/deepNested/moreDeepNested/index.js', `${location.origin}/example/nested/deepNested/index.js`), `${location.origin}/example/nested/deepNested/moreDeepNested/index.js`);
  });

  it('should allow url as a basePath if passed.', function(){
    assert.deepEqual(normalizeSync('./deepNested/index.js', `${location.origin}/nested`), `${location.origin}/nested/deepNested/index.js`);
  });

  it('should resolve library url with basePath if passed.', function(){
    assert.match(normalizeSync('lodash', `${location.origin}/nested`), new RegExp(`${location.origin}/jspm_packages/.*/lodash.js$`));
  });

  it('should allow url as a basePath if passed.', function(){
    assert.deepEqual(normalizeSync('./deepNested/index.js', `${location.origin}/nested`), `${location.origin}/nested/deepNested/index.js`);
  });
});

describe('getDependencyTree', function() {
  beforeEach(function (done) {
    // load app.js everytime.
    System.import('example/app.js').then(() => {
      done();
    });
  });

  it('should return leaf module dependency tree', function(){
    // maybe original normalizeSync is not return correct path.
    const url = normalizeSync('example/nested/deepNested/index.js');
    const dependencyTree = getDependencyTree(url);
    assert.deepEqual(dependencyTree, {
      [`${location.origin}/example/nested/index.js`]: [
        `${location.origin}/example/nested/deepNested/index.js`
      ],
      [`${location.origin}/example/nested/deepNested/index.js`]: [
        `${location.origin}/example/nested/deepNested/moreDeepNested/index.js`
      ]
    });
  });

  it('should return root module dependency tree', function(){
    // maybe original normalizeSync is not return correct path.
    const url = normalizeSync('example/app.js');
    const dependencyTree = getDependencyTree(url);
    const files = _.keys(dependencyTree);
    assert.match(files[0], `${location.origin}/example/app.js`);
    assert.match(dependencyTree[files[0]][0], `${location.origin}/example/nested/index.js`);
    assert.match(dependencyTree[files[0]][1], `${location.origin}/example/sample.css!`);
  });
});

describe('traceToRootModule', function() {
  beforeEach(function () {
  });

  it('should return parent modules of dependency tree', function(done) {
    // load app.js everytime.
    System.import('example/app.js').then(() => {
      // maybe original normalizeSync is not return correct path.
      const url = normalizeSync('example/nested/deepNested/moreDeepNested/index.js');
      const parentModules = traceToRootModule(url);
      console.log(parentModules);
      assert.deepEqual(parentModules, [
        `${location.origin}/example/app.js`,
        `${location.origin}/example/nested/index.js`,
        `${location.origin}/example/nested/deepNested/index.js`
      ]);
      done();
    });
  });

  it('should treat circular dependency correctly', function(done) {
    // from https://github.com/ModuleLoader/es6-module-loader/wiki/Circular-References-&-Bindings
    System.import('example/circular/even.js').then(() => {
      const url = normalizeSync('example/circular/even.js');
      const parentModules = traceToRootModule(url);
      try {
        assert.deepEqual(parentModules, [
          `${location.origin}/example/circular/even.js`,
          `${location.origin}/example/circular/odd.js`
        ]);
      } catch (err) {
        console.log(err);
      }
      done();
    });
  });
});


text:
\r\n
  Some Message\r\n
  {\r\n
    value,\r\n
    select,\r\n
    =0 {\r\n
      zero\r\n
    }\r\n
  }