text:
{-# LANGUAGE ScopedTypeVariables #-}

module Development.Redo.Config (callDepth,
                                callerDepsPath,
                                configDirPath,
                                debugMode,
                                depsDirPath,
                                envCallDepth,
                                envDependencyPath,
                                envDebugMode,
                                envParallelBuild,
                                envSessionID,
                                envShellOptions,
                                envTargetHistory,
                                parallelBuild,
                                printDebug,
                                printError,
                                printInfo,
                                printSuccess,
                                RedoSettings(..),
                                sessionID,
                                shellOptions,
                                targetHistory,
                                targetLockPrefix,
                                tempDirPath,
                                tempOutDirPath,
                                createGlobalLock,
                                destroyGlobalLock
                               ) where

import Control.Applicative
import Control.Exception
import Control.Monad
import System.Console.ANSI
import System.Directory
import System.Environment
import System.FilePath
import System.IO
import System.IO.Unsafe
import System.Posix.Process
import System.Posix.Semaphore
import System.Posix.Types

{-# NOINLINE setUpDirectory #-}
-- | This is the directory where all redo configurations are located.
setUpDirectory :: FilePath -> FilePath
setUpDirectory dir = unsafePerformIO $ do
  createDirectoryIfMissing True dir
  return dir

-- | This is the directory where all redo configurations are located.
configDirPath :: FilePath
configDirPath = setUpDirectory ".redo"

-- | This is the directory where dependency files are located.
depsDirPath :: FilePath
depsDirPath = setUpDirectory $ configDirPath </> "deps"

-- | This is the directory where temporary files are created.
tempDirPath :: FilePath
tempDirPath = setUpDirectory $ configDirPath </> "tmp" </> sessionID

-- | This is the directory where temporary output files are created.
tempOutDirPath :: FilePath
tempOutDirPath = setUpDirectory $ tempDirPath </> "out"

envCallDepth :: String
envCallDepth = "REDO_CALL_DEPTH"

envShellOptions :: String
envShellOptions = "REDO_SH_OPTS"

envDependencyPath :: String
envDependencyPath = "REDO_DEPS_PATH"

envSessionID :: String
envSessionID = "REDO_SESSION_ID"

envDebugMode :: String
envDebugMode = "REDO_DEBUG_MODE"

envTargetHistory :: String
envTargetHistory = "REDO_TARGET_HISTORY"

envParallelBuild :: String
envParallelBuild = "REDO_PARALLEL_BUILD"

globalLockPrefix :: String
globalLockPrefix = "/redo_global_lock_"

targetLockPrefix :: String
targetLockPrefix = "/redo_target_lock_"

shellOptions :: String
{-# NOINLINE shellOptions #-}
shellOptions = unsafePerformIO $ getEnv envShellOptions

sessionID :: String
{-# NOINLINE sessionID #-}
sessionID = unsafePerformIO $ do
  maybeSID <- lookupEnv envSessionID
  case maybeSID of
    Nothing -> show <$> getProcessID
    (Just sid) -> return sid

createGlobalLock :: IO ()
createGlobalLock = do
  _ <- semOpen (globalLockPrefix ++ sessionID) (OpenSemFlags True True) (CMode 448) 1
  return ()

globalLock :: Semaphore
{-# NOINLINE globalLock #-}
globalLock = unsafePerformIO $
  semOpen (globalLockPrefix ++ sessionID) (OpenSemFlags False False) (CMode 448) 0

destroyGlobalLock :: IO ()
destroyGlobalLock = semUnlink $ globalLockPrefix ++ sessionID

withGlobalLock :: IO a -> IO a
withGlobalLock = bracket_ (semWait globalLock) (semPost globalLock)

printWithColor :: [SGR] -> String -> IO ()
printWithColor color s = withGlobalLock $ bracket_
  (hSetSGR stderr color) (hSetSGR stderr [Reset]) (hPutStrLn stderr s)

printInfo :: String -> IO ()
printInfo = printWithColor [SetColor Foreground Vivid Blue]

printSuccess :: String -> IO ()
printSuccess = printWithColor [SetColor Foreground Vivid Green]

printError :: String -> IO ()
printError = printWithColor [SetColor Foreground Vivid Red]

printDebug :: String -> IO ()
printDebug s = when debugMode $ printWithColor [SetColor Foreground Vivid Yellow] s

data RedoSettings = RedoSettings {
  help :: Bool,
  inPar :: Int,
  files :: [FilePath],
  shellOpts :: String,
  debug :: Bool
  } deriving (Show, Read)

callerDepsPath :: Maybe FilePath
{-# NOINLINE callerDepsPath #-}
callerDepsPath = unsafePerformIO $ lookupEnv envDependencyPath

debugMode :: Bool
{-# NOINLINE debugMode #-}
debugMode = read . unsafePerformIO $ getEnv envDebugMode

parallelBuild :: Int
{-# NOINLINE parallelBuild #-}
parallelBuild = read . unsafePerformIO $ getEnv envParallelBuild

-- | Redo is a recursive procedure.  This returns the call depth.
callDepth :: Int
{-# NOINLINE callDepth #-}
callDepth = unsafePerformIO $ maybe 0 read <$> lookupEnv envCallDepth

targetHistory :: [String]
{-# NOINLINE targetHistory #-}
targetHistory = unsafePerformIO $ maybe [] read <$> lookupEnv envTargetHistory


text:
package org.netbeans.cubeon.ui.internals;

import java.io.IOException;
import org.openide.cookies.SaveCookie;
import org.openide.filesystems.FileObject;
import org.openide.loaders.DataFolder;
import org.openide.loaders.DataLoader;
import org.openide.loaders.DataObject;
import org.openide.loaders.DataObjectExistsException;
import org.openide.nodes.Node;
import org.openide.util.HelpCtx;

/**
 *
 * @author Anuradha
 */
public class TaskElementDataObject extends DataObject implements SaveCookie {

    public TaskElementDataObject(FileObject fileObject, DataLoader dataLoader) throws DataObjectExistsException {
        super(fileObject, dataLoader);

    }

    public boolean isDeleteAllowed() {
        return false;
    }

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

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

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

    @Override
    public HelpCtx getHelpCtx() {
        return HelpCtx.DEFAULT_HELP;
    }

    @Override
    protected DataObject handleCopy(DataFolder arg0) throws IOException {
        return null;
    }

    @Override
    protected void handleDelete() throws IOException {
        //DONOTHING
    }

    @Override
    protected FileObject handleRename(String arg0) throws IOException {
        return null;
    }

    @Override
    protected FileObject handleMove(DataFolder arg0) throws IOException {
        return null;
    }

    @Override
    protected DataObject handleCreateFromTemplate(DataFolder arg0, String arg1) throws IOException {
        return null;
    }

    /**
     * Creates the node for this data object which is used for display purposes
     *
     * @return node
     */
    @Override
    protected Node createNodeDelegate() {
        return ((TaskElementFileObject) getPrimaryFile()).getNode();
    }

    public void save() throws IOException {
        SaveCookie cookie = ((TaskElementFileObject) getPrimaryFile()).getNode().getCookie(SaveCookie.class);
        cookie.save();
    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.swarmcom.jsynapse.controller.client.api.v1;

import com.fasterxml.jackson.annotation.JsonView;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
import org.swarmcom.jsynapse.controller.JsynapseApi;
import org.swarmcom.jsynapse.domain.User;
import org.swarmcom.jsynapse.service.user.UserService;

import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;

import static java.lang.String.format;
import static org.springframework.web.bind.annotation.RequestMethod.GET;
import static org.springframework.web.bind.annotation.RequestMethod.PUT;
import static org.swarmcom.jsynapse.controller.JsynapseApi.CLIENT_V1_API;

@RestController
@RequestMapping(value = CLIENT_V1_API)
public class UserRestApi extends JsynapseApi {
    private static final Logger LOGGER = LoggerFactory.getLogger(UserRestApi.class);
    private static final String ACCESS_TOKEN = "access_token";
    private final UserService userService;

    @Inject
    public UserRestApi(final UserService userService) {
        this.userService = userService;
    }

    @JsonView(User.DisplayNameSummary.class)
    @RequestMapping(value = "/profile/{userId}/displayname", method = GET)
    public @ResponseBody User getDisplayName(@PathVariable String userId, HttpServletRequest request) {
        String accessToken = request.getParameter(ACCESS_TOKEN);
        return userService.findLoggedUserById(userId, accessToken);
    }

    @RequestMapping(value = "/profile/{userId}/displayname", method = PUT)
    public void setDisplayName(@PathVariable String userId, @RequestBody final User user, HttpServletRequest request) {
        LOGGER.debug(format("Save display name %s for user id %s", user.getDisplayName(), userId));
        String accessToken = request.getParameter(ACCESS_TOKEN);
        userService.saveDisplayName(userId, user.getDisplayName(), accessToken);
    }

    @JsonView(User.AvatarUrlSummary.class)
    @RequestMapping(value = "/profile/{userId}/avatar_url", method = GET)
    public @ResponseBody User getAvatarUrl(@PathVariable String userId, HttpServletRequest request) {
        String accessToken = request.getParameter(ACCESS_TOKEN);
        return userService.findLoggedUserById(userId, accessToken);
    }

    @RequestMapping(value = "/profile/{userId}/avatar_url", method = PUT)
    public void setAvatarUrl(@PathVariable String userId, @RequestBody final User user, HttpServletRequest request) {
        LOGGER.debug(format("Save avatar url %s for user id %s", user.getAvatarUrl(), userId));
        String accessToken = request.getParameter(ACCESS_TOKEN);
        userService.saveAvatarUrl(userId, user.getAvatarUrl(), accessToken);
    }
}


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

<title>Uses of Class org.apache.poi.hwpf.HWPFDocumentCore (POI API Documentation)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

PREV

NEXT

FRAMES

NO FRAMES

All Classes

Uses of Class
org.apache.poi.hwpf.HWPFDocumentCore

Packages that use HWPFDocumentCore

Package
Description

org.apache.poi.hwpf

org.apache.poi.hwpf.converter

org.apache.poi.hwpf.dev

org.apache.poi.hwpf.usermodel

Uses of HWPFDocumentCore in org.apache.poi.hwpf

Subclasses of HWPFDocumentCore in org.apache.poi.hwpf

Modifier and Type
Class and Description

class
HWPFDocument

This class acts as the bucket that we throw all of the Word data structures
 into.

class
HWPFOldDocument

Provides very simple support for old (Word 6 / Word 95)
  files.

Uses of HWPFDocumentCore in org.apache.poi.hwpf.converter

Methods in org.apache.poi.hwpf.converter that return HWPFDocumentCore

Modifier and Type
Method and Description

static HWPFDocumentCore
AbstractWordUtils.loadDoc(DirectoryNode root)

static HWPFDocumentCore
AbstractWordUtils.loadDoc(java.io.File docFile)

static HWPFDocumentCore
AbstractWordUtils.loadDoc(java.io.InputStream inputStream)

static HWPFDocumentCore
AbstractWordUtils.loadDoc(POIFSFileSystem poifsFileSystem)

Methods in org.apache.poi.hwpf.converter with parameters of type HWPFDocumentCore

Modifier and Type
Method and Description

static java.lang.String
WordToTextConverter.getText(HWPFDocumentCore wordDocument)

protected void
WordToFoConverter.processBookmarks(HWPFDocumentCore wordDocument,
                org.w3c.dom.Element currentBlock,
                Range range,
                int currentTableLevel,
                java.util.List<Bookmark> rangeBookmarks)

protected void
WordToHtmlConverter.processBookmarks(HWPFDocumentCore wordDocument,
                org.w3c.dom.Element currentBlock,
                Range range,
                int currentTableLevel,
                java.util.List<Bookmark> rangeBookmarks)

protected void
WordToTextConverter.processBookmarks(HWPFDocumentCore wordDocument,
                org.w3c.dom.Element currentBlock,
                Range range,
                int currentTableLevel,
                java.util.List<Bookmark> rangeBookmarks)

protected abstract void
AbstractWordConverter.processBookmarks(HWPFDocumentCore wordDocument,
                org.w3c.dom.Element currentBlock,
                Range range,
                int currentTableLevel,
                java.util.List<Bookmark> rangeBookmarks)

Wrap range into bookmark(s) and process it.

protected boolean
AbstractWordConverter.processCharacters(HWPFDocumentCore wordDocument,
                 int currentTableLevel,
                 Range range,
                 org.w3c.dom.Element block)

protected void
AbstractWordConverter.processDeadField(HWPFDocumentCore wordDocument,
                org.w3c.dom.Element currentBlock,
                Range range,
                int currentTableLevel,
                int beginMark,
                int separatorMark,
                int endMark)

void
AbstractWordConverter.processDocument(HWPFDocumentCore wordDocument)

void
WordToHtmlConverter.processDocumentPart(HWPFDocumentCore wordDocument,
                   Range range)

void
WordToTextConverter.processDocumentPart(HWPFDocumentCore wordDocument,
                   Range range)

protected void
AbstractWordConverter.processDocumentPart(HWPFDocumentCore wordDocument,
                   Range range)

protected void
WordToFoConverter.processHyperlink(HWPFDocumentCore wordDocument,
                org.w3c.dom.Element currentBlock,
                Range textRange,
                int currentTableLevel,
                java.lang.String hyperlink)

protected void
WordToHtmlConverter.processHyperlink(HWPFDocumentCore wordDocument,
                org.w3c.dom.Element currentBlock,
                Range textRange,
                int currentTableLevel,
                java.lang.String hyperlink)

protected void
WordToTextConverter.processHyperlink(HWPFDocumentCore wordDocument,
                org.w3c.dom.Element currentBlock,
                Range textRange,
                int currentTableLevel,
                java.lang.String hyperlink)

protected abstract void
AbstractWordConverter.processHyperlink(HWPFDocumentCore wordDocument,
                org.w3c.dom.Element currentBlock,
                Range textRange,
                int currentTableLevel,
                java.lang.String hyperlink)

protected void
WordToFoConverter.processPageBreak(HWPFDocumentCore wordDocument,
                org.w3c.dom.Element flow)

protected void
WordToHtmlConverter.processPageBreak(HWPFDocumentCore wordDocument,
                org.w3c.dom.Element flow)

protected void
WordToTextConverter.processPageBreak(HWPFDocumentCore wordDocument,
                org.w3c.dom.Element flow)

protected abstract void
AbstractWordConverter.processPageBreak(HWPFDocumentCore wordDocument,
                org.w3c.dom.Element flow)

protected void
WordToFoConverter.processPageref(HWPFDocumentCore hwpfDocument,
              org.w3c.dom.Element currentBlock,
              Range textRange,
              int currentTableLevel,
              java.lang.String pageref)

protected void
WordToHtmlConverter.processPageref(HWPFDocumentCore hwpfDocument,
              org.w3c.dom.Element currentBlock,
              Range textRange,
              int currentTableLevel,
              java.lang.String pageref)

protected void
WordToTextConverter.processPageref(HWPFDocumentCore wordDocument,
              org.w3c.dom.Element currentBlock,
              Range textRange,
              int currentTableLevel,
              java.lang.String pageref)

protected abstract void
AbstractWordConverter.processPageref(HWPFDocumentCore wordDocument,
              org.w3c.dom.Element currentBlock,
              Range textRange,
              int currentTableLevel,
              java.lang.String pageref)

protected void
WordToFoConverter.processParagraph(HWPFDocumentCore hwpfDocument,
                org.w3c.dom.Element parentFopElement,
                int currentTableLevel,
                Paragraph paragraph,
                java.lang.String bulletText)

protected void
WordToHtmlConverter.processParagraph(HWPFDocumentCore hwpfDocument,
                org.w3c.dom.Element parentElement,
                int currentTableLevel,
                Paragraph paragraph,
                java.lang.String bulletText)

protected void
WordToTextConverter.processParagraph(HWPFDocumentCore wordDocument,
                org.w3c.dom.Element parentElement,
                int currentTableLevel,
                Paragraph paragraph,
                java.lang.String bulletText)

protected abstract void
AbstractWordConverter.processParagraph(HWPFDocumentCore wordDocument,
                org.w3c.dom.Element parentElement,
                int currentTableLevel,
                Paragraph paragraph,
                java.lang.String bulletText)

protected void
AbstractWordConverter.processParagraphes(HWPFDocumentCore wordDocument,
                  org.w3c.dom.Element flow,
                  Range range,
                  int currentTableLevel)

protected void
WordToFoConverter.processSection(HWPFDocumentCore wordDocument,
              Section section,
              int sectionCounter)

protected void
WordToHtmlConverter.processSection(HWPFDocumentCore wordDocument,
              Section section,
              int sectionCounter)

protected void
WordToTextConverter.processSection(HWPFDocumentCore wordDocument,
              Section section,
              int s)

protected abstract void
AbstractWordConverter.processSection(HWPFDocumentCore wordDocument,
              Section section,
              int s)

protected void
WordToHtmlConverter.processSingleSection(HWPFDocumentCore wordDocument,
                    Section section)

protected void
AbstractWordConverter.processSingleSection(HWPFDocumentCore wordDocument,
                    Section section)

protected void
WordToFoConverter.processTable(HWPFDocumentCore wordDocument,
            org.w3c.dom.Element flow,
            Table table)

protected void
WordToHtmlConverter.processTable(HWPFDocumentCore hwpfDocument,
            org.w3c.dom.Element flow,
            Table table)

protected void
WordToTextConverter.processTable(HWPFDocumentCore wordDocument,
            org.w3c.dom.Element flow,
            Table table)

protected abstract void
AbstractWordConverter.processTable(HWPFDocumentCore wordDocument,
            org.w3c.dom.Element flow,
            Table table)

protected int
AbstractWordConverter.tryDeadField(HWPFDocumentCore wordDocument,
            Range range,
            int currentTableLevel,
            int beginMark,
            org.w3c.dom.Element currentBlock)

Uses of HWPFDocumentCore in org.apache.poi.hwpf.dev

Constructors in org.apache.poi.hwpf.dev with parameters of type HWPFDocumentCore

Constructor and Description

HWPFLister(HWPFDocumentCore doc)

Uses of HWPFDocumentCore in org.apache.poi.hwpf.usermodel

Fields in org.apache.poi.hwpf.usermodel declared as HWPFDocumentCore

Modifier and Type
Field and Description

protected HWPFDocumentCore
Range._doc

The document this range belongs to.

Methods in org.apache.poi.hwpf.usermodel that return HWPFDocumentCore

Modifier and Type
Method and Description

protected HWPFDocumentCore
Range.getDocument()

Constructors in org.apache.poi.hwpf.usermodel with parameters of type HWPFDocumentCore

Constructor and Description

Range(int start,
     int end,
     HWPFDocumentCore doc)

Used to construct a Range from a document.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

PREV

NEXT

FRAMES

NO FRAMES

All Classes

                Copyright 2016 The Apache Software Foundation or
        its licensors, as applicable.


text:
{-# LANGUAGE DeriveDataTypeable #-}

{-
Copyright (c) 2014, Markus Barenhoff <alios@alios.org>
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * Neither the name of the <organization> nor the
      names of its contributors may be used to endorse or promote products
      derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-}

module Data.Geodetic.Coordinate where

import Data.Typeable
import qualified Prelude ()
import Numeric.Units.Dimensional.TF.Prelude

data ECEF t =
  ECEF {
    _coordX :: (Length t),
    _coordY :: (Length t),
    _coordZ :: (Length t)
    } deriving (Show, Eq, Typeable)

dm :: Floating a => a -> a -> PlaneAngle a
dm d m = (d *~ degree) + (m *~ minuteOfArc)

dms :: Floating a => a -> a -> a -> PlaneAngle a
dms d m s = dm d m + (s *~ secondOfArc)


text:
@interface LearnNewTV : UITableViewController

@property (nonatomic)BOOL isNew;
@property (nonatomic, strong) TodoStudyMissionStore *studyStore;

@end


text:
Cyclopentadiene molecule has 11 atoms: C5H6. Thus, there are 33 modes (lowest three acoustic should be close to zero). Note that VASP prints the modes in the *decreasing* eigenvalue (frequency) order. In the current example, the lowest *four* modes are imaginary (probably due to the optimization issues), these will be skipped in the Raman calculation.

For this example `vasp_raman.py` script version [**c4c39a60b8110a608246b67828185811c98d8429**](https://raw.github.com/alexandr-fonari/raman-sc/c4c39a60b8110a608246b67828185811c98d8429/VASP/vasp_raman.py) was used.

The following procedure can be used to obtain Raman activities for the G-point phonons. `POSCAR.phon` and `OUTCAR.phon` should come from a phonon calculation. `INCAR` should have `NWRITE=3` variable set.

### Cyclopentadiene example: One calculation

TODO

### Cyclopentadiene example: Split modes

Create a directory with the following files:
```
INCAR.raman  - should contain LEPSILON=.TRUE. or LCALCEPS=.TRUE. because we want 'MACROSCOPIC STATIC DIELECTRIC TENSOR' in the OUTCAR
KPOINTS      - just kpoints
OUTCAR.phon  - should contain 'Eigenvectors after division by SQRT(mass)' either from VASP itself or from Henkelman's script
POSCAR.phon  - at this point only positive scales are supported.
POTCAR       - hard PAWs usually give better agreement with the experiment (`ATOMTYPE_h` in the potpaw folders)
raman.sub    - see below
raman_sub.sh - see below
```

To generate normal modes `hessfreq.modes` file, run:
```bash
hessfreq_read input-freq.hessfreq
```

Contents of the `raman_sub.sh`:
```bash
#!/bin/bash

nderiv_step_size='2_0.01'

export VASP_RAMAN_RUN='aprun -B /u/afonari/vasp.5.3.2/vasp.5.3/vasp &> job.out'

# manually split modes
Modes[0]='01_10'
Modes[1]='11_20'
Modes[2]='21_29'

for m in ${Modes[*]}
do
    VASP_RAMAN_PARAMS="${m}_${nderiv_step_size}"
    export VASP_RAMAN_PARAMS=${VASP_RAMAN_PARAMS}
    #
    FOLDER="Modes_${VASP_RAMAN_PARAMS}"
    #
    echo "Running VASP in ${FOLDER}"
    #
    if [ -d "${FOLDER}" ]; then
        cd "${FOLDER}"
        qsub raman.sub
        cd ..
    else
        mkdir "${FOLDER}"
        cd "${FOLDER}"
        ln -s ../OUTCAR.phon ./OUTCAR.phon
        ln -s ../POSCAR.phon ./POSCAR.phon
        ln -s ../POTCAR ./POTCAR
        ln -s ../INCAR.raman ./INCAR
        ln -s ../raman.sub ./raman.sub
        ln -s ../KPOINTS ./KPOINTS
        qsub raman.sub
        cd ..
    fi
done

```

Contents of the `raman.sub`:
```bash
#!/bin/bash
#PBS -l select=1:ncpus=32:mpiprocs=32
#PBS -l walltime=01:00:00
#PBS -q debug
#PBS -j oe
#PBS -N CPD-RT
#PBS -V

cd $PBS_O_WORKDIR

ulimit -s unlimited  # remove limit on stack size

python27 vasp_raman.py > vasp_raman.out

```

Submit all calculations using: `bash ./raman_sub.sh`. Three folders will be created where calculations will run: `Modes_01_10_2_0.01`, `Modes_11_20_2_0.01` and `Modes_21_29_2_0.01`.

After all calculations are done, it may be a good idea to save all `OUTCAR.*` files from all the `Modes_*` folders for the future reference. Also, `vasp_raman.dat` will contain Raman activities for the future processing (for example with `broaden.py`).

This script will gather all `OUTCAR.*` files in a back up folder, and also concatenate all `vasp_raman.dat` files in one:
```bash
#!/bin/bash

backup_dir="Raman_Backup"
mkdir -p ${backup_dir}

rm -f vasp_raman.dat

for dir in ./Modes*
do
    cat "${dir}"/vasp_raman.dat >> vasp_raman.tmp
    cp "${dir}"/OUTCAR.* "${backup_dir}"
done

head -n 1 vasp_raman.tmp > vasp_raman.dat
sed '/^#/d' vasp_raman.tmp > vasp_raman.unsorted
sort -k 2 -n vasp_raman.unsorted >> vasp_raman.dat

rm -f vasp_raman.tmp
rm -f vasp_raman.unsorted

```

Finally, broaden and plot Raman spectrum (scripts are in the archive):
```bash
python broaden.py vasp_raman.dat
bash vasp_raman.gnuplot.sh
```

Enjoy your Raman spectrum in `Raman.ps`!

[**Download complete example.**](Cyclopentadiene-Example.tar.gz)

## Contributors

Alexandr Fonari (Georgia Tech, PIs: J.-L. Bredas/V. Coropceanu): [Email](mailto:alexandr.fonari[nospam]gatech.edu)
Shannon Stauffer (UT Austin, PI: G. Henkelman): [Email](mailto:stauffers[nospam]utexas.edu).


text:
@implementation MPPlot

+ (MPGraphValuesRange)rangeForValues:(NSArray *)values
{
    CGFloat min,max;

    min = max = [[values firstObject] floatValue];

    for (NSInteger i=0; i<values.count; i++) {
        CGFloat val = [[values objectAtIndex:i] floatValue];

        if (val>max) {
            max = val;
        }

        if (val<min) {
            min = val;
        }
    }

    if (max == 0) {
        max = 1;
    }

    return MPMakeGraphValuesRange(min, max);
}

- (instancetype)init
{
    self = [super init];

    if (self) {
        _valueRanges = MPMakeGraphValuesRange(CGFLOAT_MIN, CGFLOAT_MAX);
        NSAssert(![self isMemberOfClass:[MPPlot class]], @"You shouldn't init MPPlot directly, use the class method plotWithType:frame:");
    }

    return self;
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];

    if (self) {
        _valueRanges = MPMakeGraphValuesRange(CGFLOAT_MIN, CGFLOAT_MAX);
        NSAssert(![self isMemberOfClass:[MPPlot class]], @"You shouldn't init MPPlot directly, use the class method plotWithType:frame:");
    }

    return self;
}

- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if (self) {
        _valueRanges = MPMakeGraphValuesRange(CGFLOAT_MIN, CGFLOAT_MAX);
        NSAssert(![self isMemberOfClass:[MPPlot class]], @"You shouldn't init MPPlot directly, use the class method plotWithType:frame:");
    }
    return self;
}

+ (id)plotWithType:(MPPlotType)type frame:(CGRect)frame
{
    switch (type) {
        case MPPlotTypeGraph:
            return [[MPGraphView alloc] initWithFrame:frame];
            break;

        case MPPlotTypeBars:
            return [[MPBarsGraphView alloc] initWithFrame:frame];
            break;

        default:
            break;
    }

    return nil;
}

- (void)drawRect:(CGRect)rect
{
    [super drawRect:rect];

    if(self.detailView.superview) {
        [self.detailView removeFromSuperview];
        currentTag=-1;
    }
}

- (NSMutableArray *)pointsForArray:(NSArray *)values
{
    CGFloat min,max;

    if (_useCustomRange && !MPValuesRangeNULL(_valueRanges)) {
        max = _valueRanges.max;
        min = _valueRanges.min;
    } else {
        _valueRanges = [MPPlot rangeForValues:values];
        min = _valueRanges.min;
        max = _valueRanges.max;
    }

    NSMutableArray *pointsArray = [[NSMutableArray alloc] init];

    if(max!=min){
        for (NSString *p in values) {
            CGFloat val = [p floatValue];
            val = ((val-min)/(max-min));
            [pointsArray addObject:@(val)];
        }
    }else{
        [pointsArray addObject:@(1)];
    }

    return pointsArray;
}

#pragma mark setters

- (void)setValues:(NSArray *)values
{
    if (values) {
        _values = [values copy];
        points = [self pointsForArray:_values];
        [self setNeedsDisplay];
    }
}

- (void)setValueRanges:(MPGraphValuesRange)valueRanges
{
    _valueRanges = valueRanges;
    _useCustomRange = YES;

    if (!MPValuesRangeNULL(valueRanges) && self.values) {
        points = [self pointsForArray:self.values];
    }
}

- (void)setAlgorithm:(GraphPointsAlgorithm)customAlgorithm numberOfPoints:(NSUInteger)numberOfPoints withGeneDetailBlock:(GeneDetailLabelBlock)geneBlock
{
    _numberOfPoints = numberOfPoints;
    _customAlgorithm = customAlgorithm;

    if (nil == self.detailLabels) {
        self.detailLabels = [NSMutableArray arrayWithCapacity:numberOfPoints];
    }
    for (UILabel * oldLabel in self.detailLabels) {
        [oldLabel removeFromSuperview];
    }
    [self.detailLabels removeAllObjects];

    NSMutableArray* values=[[NSMutableArray alloc] init];

    for (NSUInteger i=0; i<numberOfPoints; i++) {
        CGFloat val = customAlgorithm(i);
        [values addObject:@(val)];
        if (geneBlock) {
            UILabel * label = geneBlock(val);
            [label sizeToFit];
            [self.detailLabels addObject:label];
        }
    }

    self.values = values;
}

-(void)setFrame:(CGRect)frame
{
    [super setFrame:frame];
    [self setNeedsDisplay];
}

#pragma mark Getters

- (NSNumberFormatter *)detailLabelFormatter
{
    if (!_detailLabelFormatter) {
        _detailLabelFormatter = [[NSNumberFormatter alloc] init];
        _detailLabelFormatter.locale=[NSLocale currentLocale];
        _detailLabelFormatter.numberStyle=NSNumberFormatterDecimalStyle;
    }

    return  _detailLabelFormatter;
}

- (UIColor *)graphColor
{
    return _graphColor ? _graphColor : [UIColor blueColor];
}

- (UIColor *)detailBackgroundColor
{
    return _detailBackgroundColor ? _detailBackgroundColor : [UIColor whiteColor];
}

- (UIColor *)detailTextColor
{
    return _detailTextColor ? _detailTextColor : [[self graphColor] colorWithAlphaComponent:1];
}

- (CGFloat)animationDuration
{
    return _animationDuration>0.0 ? _animationDuration : ANIMATIONDURATION;
}

#pragma mark Internal

- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
    UIView *view = [super hitTest:point withEvent:event];

    if (view==self && self.detailView.superview) {
        [UIView animateWithDuration:.15 animations:^{
            self.detailView.transform=CGAffineTransformMakeScale(0, 0);
        }completion:^(BOOL finished) {
            [self.detailView removeFromSuperview];
            currentTag=-1;
        }];
    }

    return view;
}

- (void)animate
{
    self.waitToUpdate=NO;
    [self setNeedsDisplay];
}

#pragma mark Actions

- (void)tap:(UIButton *)button
{
    if (self.detailLabels.count > 0) {
        // the detail view is shown by geneDetailBlock
        return;
    }

    if (button.tag==currentTag) {
        currentTag = -1;
    }else{
        currentTag = button.tag;
    }

    if (self.detailView.superview) {

        [UIView animateWithDuration:.15 animations:^{
            self.detailView.transform = CGAffineTransformMakeScale(0, 0);
        }completion:^(BOOL finished) {
            [self.detailView removeFromSuperview];
            if(currentTag>=0) {
                [self displayDetailViewAtPoint:button.center];
            }
        }];

    }else{
        [self displayDetailViewAtPoint:button.center];
    }
}

- (void)displayDetailViewAtPoint:(CGPoint)point
{
    if ([[self.values objectAtIndex:currentTag] isKindOfClass:[NSString class]]) {
        self.detailView.text = [self.values objectAtIndex:currentTag];
    }else{
        self.detailView.text = [NSString stringWithFormat:@"%@",[self.detailLabelFormatter stringFromNumber:[self.values objectAtIndex:currentTag]]];
    }

    self.detailView.center = point;
    self.detailView.transform = CGAffineTransformMakeScale(0, 0);
    [self addSubview:self.detailView];

    [UIView animateWithDuration:.2 animations:^{
        self.detailView.transform = CGAffineTransformMakeScale(1, 1);
    }];
}

-(UIView <MPDetailView> *)detailView
{
    if (_detailView) {
        return _detailView;
    }

    UILabel* label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 80, 20)];
    label.textAlignment = NSTextAlignmentCenter;
    label.textColor = self.detailTextColor;
    label.backgroundColor = self.detailBackgroundColor;
    label.layer.borderColor = label.textColor.CGColor;
    label.layer.borderWidth = .5;
    label.layer.cornerRadius = 3;
    label.adjustsFontSizeToFitWidth = YES;
    label.clipsToBounds = YES;

    self.detailView = (UILabel <MPDetailView> *)label;

    return _detailView;
}

@end


text:
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#pragma once

#include "../bvh/bvh.h"

namespace embree
{
  namespace isa
  {
    template<int N>
    class BVHNRefitter
    {
    public:

      /*! Type shortcuts */
      typedef BVHN<N> BVH;
      typedef typename BVH::AABBNode AABBNode;
      typedef typename BVH::NodeRef NodeRef;

      struct LeafBoundsInterface {
        virtual const BBox3fa leafBounds(NodeRef& ref) const = 0;
      };

    public:

      /*! Constructor. */
      BVHNRefitter (BVH* bvh, const LeafBoundsInterface& leafBounds);

      /*! refits the BVH */
      void refit();

    private:
      /* single-threaded subtree extraction based on BVH depth */
      void gather_subtree_refs(NodeRef& ref,
                               size_t &subtrees,
                               const size_t depth = 0);

      /* single-threaded top-level refit */
      BBox3fa refit_toplevel(NodeRef& ref,
                             size_t &subtrees,
							 const BBox3fa *const subTreeBounds,
                             const size_t depth = 0);

      /* single-threaded subtree refit */
      BBox3fa recurse_bottom(NodeRef& ref);

    public:
      BVH* bvh;                              //!< BVH to refit
      const LeafBoundsInterface& leafBounds; //!< calculates bounds of leaves

      static const size_t MAX_SUB_TREE_EXTRACTION_DEPTH = (N==4) ? 4   : (N==8) ? 3    : 3;
      static const size_t MAX_NUM_SUB_TREES             = (N==4) ? 256 : (N==8) ? 512 : N*N*N; // N ^ MAX_SUB_TREE_EXTRACTION_DEPTH
      size_t numSubTrees;
      NodeRef subTrees[MAX_NUM_SUB_TREES];
    };

    template<int N, typename Mesh, typename Primitive>
    class BVHNRefitT : public Builder, public BVHNRefitter<N>::LeafBoundsInterface
    {
    public:

      /*! Type shortcuts */
      typedef BVHN<N> BVH;
      typedef typename BVH::AABBNode AABBNode;
      typedef typename BVH::NodeRef NodeRef;

    public:
      BVHNRefitT (BVH* bvh, Builder* builder, Mesh* mesh, size_t mode);

      virtual void build();

      virtual void clear();

      virtual const BBox3fa leafBounds (NodeRef& ref) const
      {
        size_t num; char* prim = ref.leaf(num);
        if (unlikely(ref == BVH::emptyNode)) return empty;

        BBox3fa bounds = empty;
        for (size_t i=0; i<num; i++)
            bounds.extend(((Primitive*)prim)[i].update(mesh));
        return bounds;
      }

    private:
      BVH* bvh;
      std::unique_ptr<Builder> builder;
      std::unique_ptr<BVHNRefitter<N>> refitter;
      Mesh* mesh;
      unsigned int topologyVersion;
    };
  }
}


text:
import json

from api import app
from api.test import APITest

class TestAPIConceptResourceGET(APITest):
    def __init__(self, *args, **kwargs):
        super(TestAPIConceptResourceGET, self).__init__(*args, **kwargs)
        self.base_url = '/api/concepts'
        self.app = app.test_client()

    def _post_test_concepts(self, number_to_create=10,
                            title_prefix='concept-'):
        added_concepts = []
        for i in range(number_to_create):
            concept_title = '{}{}'.format(title_prefix, i)

            data = {
                'description': 'description-{}'.format(i),
                'title': concept_title
            }
            res = self.post(self.base_url, data=data)
            self.assertEquals(res.status_code, 201)
            added_concepts.append(concept_title)
        return added_concepts

    def test_concepts_route_exists(self):
        res = self.app.get(self.base_url)
        self.assertEqual(res.status_code, 200)

    def test_concepts_route_returns_application_json(self):
        res = self.app.get(self.base_url)
        self.assertEqual(res.content_type, 'application/json')

    def test_response_object_contains_meta(self):
        self._post_test_concepts()
        data = json.loads(self.get(self.base_url).data)
        self.assertTrue(data.get('meta', False))

    def test_response_object_contains_concepts(self):
        self._post_test_concepts()
        data = json.loads(self.get(self.base_url).data)
        self.assertTrue(data.get('concepts', False))

    def test_response_object_contains_meta_and_concepts(self):
        self._post_test_concepts()
        data = json.loads(self.get(self.base_url).data)
        self.assertTrue(data.get('meta', False))
        self.assertTrue(data.get('concepts', False))

    def test_pagination(self):
        number_of_concepts = 100
        for i in range(number_of_concepts):
            data = {
                'description': 'description-{}'.format(i),
                'title': 'concept-{}'.format(i)
            }
            res = self.post(self.base_url, data=data)
            self.assertEquals(res.status_code, 201)

        for page in [1, 4, 6]:
            for limit in range(5):
                url = self.base_url + '?page={}&limit={}'.format(
                    page, limit
                )

                data = json.loads(self.get(url).data)
                self.assertEquals(limit, len(data.get('concepts')))

                for i, r in enumerate(data.get('concepts')):
                    self.assertEquals(
                        r.get('title'), 'concept-{}'.format(i + (page * limit))
                    )

    def test_description_query_parameter_returns_description(self):
        res = self.get(self.base_url + '?description')
        data = json.loads(res.data)
        self.assertTrue(data.get('endpoint') == 'api/concepts')


text:
make:
	apidoc -i source.yml -o ../docs/index.html
clean:
	rm -rf ../docs


text:
<!DOCTYPE html>
<title>
  Multi-line row flex fragmentation: Row expansion and stretching.
</title>
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#pagination">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">

Test passes if there is a filled green square and no red.


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=struct.ReplicationRuleParser.html">

Redirecting to struct.ReplicationRuleParser.html...


text:
<?php

namespace Opensoft\RolloutBundle\Rollout;

/**
 * @author Richard Fullmer <richard.fullmer@opensoftdev.com>
 */
interface GroupDefinitionInterface
{
    /**
     * @return string
     */
    public function getName();

    /**
     * @return string
     */
    public function getDescription();

    /**
     * Return a function which checks for user's inclusion in the group
     *
     * @return \Closure
     */
    public function getCallback();
}


text:
var Response = function(success, message, data) {
    'use strict';

    var self = {};

    self.success = success;
    self.message = message;
    self.data    = data;

    return self;
};

module.exports = Response;


text:
package com.action.shejizhichan.chapter19;

import java.util.Map;

/**
 * @Description TODO
 * @Author wuyunfeng
 * @Date 2020-05-28 9:17
 * @Version 1.0
 */
public class OuterUserInfo extends OuterUser implements IUserInfo {

    private Map baseInfo = (Map) super.getUserBaseInfo();
    private Map homeInfo = (Map) super.getUserHomeInfo();
    private Map officeInfo = (Map) super.getUserOfficeInfo();

    @Override
    public String getUserName() {
        return null;
    }

    @Override
    public String getHomeAddress() {
        String homeAddress = (String) this.homeInfo.get("homeAddress");
        System.out.println(homeAddress);
        return homeAddress;
    }

    @Override
    public String getMobileNumber() {
        String mobileNumber = (String) this.baseInfo.get("mobileNumber");
        System.out.println(mobileNumber);
        return mobileNumber;
    }

    @Override
    public String getOfficeTelNumber() {
        String officeTelNumber = (String) this.officeInfo.get("officeTelNumber");
        System.out.println(officeTelNumber);
        return officeTelNumber;
    }

    @Override
    public String getJobPosition() {
        String jobPosition = (String) this.officeInfo.get("jobPosition");
        System.out.println(jobPosition);
        return jobPosition;
    }

    @Override
    public String getHomeTelNumber() {
        String homeTelNumber = (String) this.homeInfo.get("homeTelNumber");
        System.out.println(homeTelNumber);
        return homeTelNumber;
    }
}


text:
package com.sebaslogen.blendletje.data.remote.model;

import java.util.Objects;

import io.realm.RealmModel;
import io.realm.annotations.RealmClass;

@RealmClass
public class ArticleImagesLinks implements RealmModel {
    private ImageResource small;
    private ImageResource medium;
    private ImageResource large;

    public ArticleImagesLinks() {
    }

    public ArticleImagesLinks(final ImageResource small, final ImageResource medium,
                              final ImageResource large) {
        this.small = small;
        this.medium = medium;
        this.large = large;
    }

    public ImageResource small() {
        return small;
    }

    public ImageResource medium() {
        return medium;
    }

    public ImageResource large() {
        return large;
    }

    @Override
    public String toString() {
        return "ArticleImagesLinks{"
                + "small=" + small + ", "
                + "medium=" + medium + ", "
                + "large=" + large + ", "
                + "}";
    }

    @Override
    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        }
        if (o instanceof ArticleImagesLinks) {
            final ArticleImagesLinks that = (ArticleImagesLinks) o;
            return (Objects.equals(small, that.small()))
                    && (Objects.equals(medium, that.medium()))
                    && (Objects.equals(large, that.large()));
        }
        return false;
    }

    @Override
    public int hashCode() {
        int h = 1;
        if (this.small != null) {
            h *= 1000003;
            h ^= this.small.hashCode();
        }
        if (this.medium != null) {
            h *= 1000003;
            h ^= this.medium.hashCode();
        }
        if (this.large != null) {
            h *= 1000003;
            h ^= this.large.hashCode();
        }
        return h;
    }
}


text:
maestro-builtin-images-plugin
====================

A Maestro Plugin that installs the default task images for the default maestro tasks


text:
/**********
*
* gArgs.h - Galaxy Args class defs.
*
***** History
*
* 12/13/95 tlw - Created.
*
**********/

#ifndef _gArgs_h
#define _gArgs_h

class Args {
   public:
      Args(int count, char * pList[]);  // Constructor.
      ~Args();		     // Destructor.
      char * firstArg(); // Returns first arg, inits index.
      char * nextArg();	// Returns next arg or NULL, updates index.
      int    findArg(const char * arg);  // Looks for Arg that matches arg.
      int    findValue(const char * arg, char * value); // Gets value for arg.
      int    numArgs();	// Returns the number of arguments.
   private:
      int   index;	// index used by firstArg and nextArg.
      int   argCount;	// Number of args.
      char ** argList;	// Pointer to list of argument strings.
};

#endif

/**********     end of gArgs.h     **********/


text:
class TvrageApi::Info < TvrageApi::Base
  include Ov

  # Quick information about tv show
  #
  # access: FREE
  # param:
  #   find('buffy')
  # output: Faraday::Response instance with string
  let :find, String do |show|
    find(show: show)
  end

  # Quick information about tv show
  #
  # access: FREE
  # param:
  #   find('buffy', episode: '1x01')
  #   find('buffy', exact: 1)
  # output: Faraday::Response instance with string
  let :find, String, Hash do |show, optional_options|
    find(optional_options.merge(show: show))
  end

  # Quick information about tv show
  #
  # access: FREE
  # param:
  #   find(show: 'buffy')
  # output: Faraday::Response instance with string
  let :find, Hash do |options|
    find_path_with_params(options).get
  end

  # Quick information about tv show - return only url
  #
  # access: FREE
  # param:
  #   find_url('buffy')
  # output: url string
  let :find_url, String do |show|
    find_url(show: show)
  end

  # Quick information about tv show - return only url
  #
  # access: FREE
  # param:
  #   find_url('buffy', episode: '1x01')
  #   find_url('buffy', exact: 1)
  # output: url string
  let :find_url, String, Hash do |show, optional_options|
    find_url(optional_options.merge(show: show))
  end

  # Quick information about tv show - return only url
  #
  # access: FREE
  # param:
  #   find_url(show: 'buffy')
  # output: url string
  let :find_url, Hash do |options|
    find_path_with_params(options).url
  end

  private

  def find_path_with_params(options)
    path(find_path).params(options)
  end

  def find_path
    'tools/quickinfo.php'
  end
end


text:
require 'ruby2d'

RSpec.describe Ruby2D::Sound do

  describe "#new" do
    it "raises exception if audio file doesn't exist" do
      expect { Sound.new('no_sound_here.wav') }.to raise_error(Ruby2D::Error)
    end

    unless ENV['CI']  # audio cannot be opened on CI; see `music_spec.rb`
      it "creates sound in various formats" do
        Sound.new("#{Ruby2D.test_media}/music.wav")
        Sound.new("#{Ruby2D.test_media}/music.mp3")
        Sound.new("#{Ruby2D.test_media}/music.ogg")
        Sound.new("#{Ruby2D.test_media}/music.flac")
      end

      it "creates sound and sets the media path" do
        snd = Sound.new("#{Ruby2D.test_media}/sound.wav")
        expect(snd.path).to eq("#{Ruby2D.test_media}/sound.wav")
      end
    end
  end
  describe "#volume" do
    unless ENV['CI']
      it "sets the volume on sound instances" do
        snd = Sound.new("#{Ruby2D.test_media}/music.wav")
        expect(snd.volume).to eq(100)
        snd.volume = 68
        expect(snd.volume).to eq(68)
      end

      it "sets volume to 0 or 100 if outside of range" do
        snd = Sound.new("#{Ruby2D.test_media}/music.wav")
        snd.volume = 234
        expect(snd.volume).to eq(100)
        snd.volume = -312
        expect(snd.volume).to eq(0)
        snd.volume = -1
        expect(snd.volume).to eq(0)
      end

      it "sets the mix volume using class methods" do
        Sound.mix_volume = 27
        expect(Sound.mix_volume).to eq(27)
      end

      it "sets mix volume to 0 or 100 if outside of range" do
        Sound.mix_volume = 234
        expect(Sound.mix_volume).to eq(100)
        Sound.mix_volume = -312
        expect(Sound.mix_volume).to eq(0)
        Sound.mix_volume = -1
        expect(Sound.mix_volume).to eq(0)
      end
    end
  end

  describe "#length" do
    unless ENV['CI']
      it "returns the length of the sound clip in seconds" do
        expect(Sound.new("#{Ruby2D.test_media}/sound.wav").length).to eq(1)
        expect(Sound.new("#{Ruby2D.test_media}/sound.mp3").length).to eq(1)
        expect(Sound.new("#{Ruby2D.test_media}/sound.ogg").length).to eq(1)
        expect(Sound.new("#{Ruby2D.test_media}/sound.flac").length).to eq(1)
      end
    end
  end

end


text:
module MysqlTableManager
  class Task::Compact < AbstractTask
    def self.description
      [
        "Compact the table by running a no-op ALTER TABLE against it. The",
        "InnoDB storage engine is assumed.",
      ].join("\n")
    end

    def self.modifies?
      true
    end

    def apply(host, table)
      connection_manager.compact_table(host, table)
    end
  end
end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycologia 22(2): 72 (1930)

#### Original name
Gyalecta rubella Zahlbr.

### Remarks
null


text:
package com.github.obsidianarch.gvengine.core.io;

import com.github.obsidianarch.gvengine.core.Chunk;
import com.github.obsidianarch.gvengine.core.Region;
import com.github.obsidianarch.gvengine.core.Scheduler;

import java.io.*;

/**
 * Contains the reading and writing to regions files.
 *
 * @author Austin
 * @version 14.02.08
 * @since 14.03.30
 */
public final class RegionIO
{

    /**
     * Ensures the the file is created before continuing in a method.
     *
     * @param f
     *         The file to create.
     *
     * @return If the file was created.
     *
     * @since 14.03.30
     */
    private static boolean createFile( File f )
    {
        try
        {
            // create the required directories if they don't exist
            if ( !f.getParentFile().exists() )
            {
                boolean created = f.getParentFile().mkdirs(); // create the directories

                // throw an exception because the path couldn't be created
                if ( !created )
                {
                    throw new IOException( String.format( "Location %s could not be created!", f.getParentFile().getAbsoluteFile() ) );
                }
            }

            // create the file if it doesn't already exist
            if ( !f.exists() )
            {
                boolean created = f.createNewFile(); // attempt to create the file

                // throw an exception because the file couldn't be created
                if ( !created )
                {
                    throw new IOException( String.format( "File %s could not be created!", f.getAbsolutePath() ) );
                }
            }

            return true; // the file was successfully created
        }
        catch ( Exception e )
        {
            Lumberjack.throwable( "RegionIO", e );
            return false; // the file could not be created
        }
    }

    /**
     * Writes a chunk to the correct output stream.
     *
     * @param dos
     *         The output stream to write it to.
     * @param coordinates
     *         The chunk's coordinates.
     * @param voxels
     *         The voxel data.
     *
     * @since 14.03.30
     */
    public static void writeChunk( DataOutputStream dos, int[] coordinates, byte[] voxels )
    {
        try
        {
            for ( int i : coordinates )
            {
                dos.writeInt( i );
            }
            dos.flush();

            for ( byte b : voxels )
            {
                dos.writeByte( b );
            }
            dos.flush();
        }
        catch ( IOException e )
        {
            Lumberjack.throwable( "ChnWrite", e );
        }
    }

    /**
     * Saves the region into the given directory.
     *
     * @param region
     *         The region to write.
     * @param dir
     *         The directory to write to.
     *
     * @since 14.03.30
     */
    public static void saveRegion( Region region, File dir )
    {
        File f = new File( dir, String.format( "r%d %d %d.gven.dat", region.x, region.y, region.z ) );

        if ( !createFile( f ) )
        {
            return;
        }

        Chunk[] chunks = region.getChunks();

        int[][] chunkCoords = new int[ chunks.length ][ 3 ];
        byte[][] voxels = new byte[ chunks.length ][ chunks[ 0 ].getVoxels().length ];

        for ( int i = 0; i < chunks.length; i++ )
        {
            chunkCoords[ i ][ 0 ] = chunks[ i ].x;
            chunkCoords[ i ][ 1 ] = chunks[ i ].y;
            chunkCoords[ i ][ 2 ] = chunks[ i ].z;

            for ( int j = 0; j < voxels[ i ].length; j++ )
            {
                voxels[ i ][ j ] = chunks[ i ].getVoxels()[ j ];
            }
        }

        try
        {
            DataOutputStream dos = new DataOutputStream( new FileOutputStream( f ) );

            // schedule writes for each chunk
            for ( int i = 0; i < chunks.length; i++ )
            {
                Scheduler.enqueueEvent( "writeChunk", RegionIO.class, dos, chunkCoords[ i ], voxels[ i ] );
            }

            // scheduler the closing of the stream after all the writes
            Scheduler.enqueueEvent( "close", dos ); // closes the stream after everything has been written
        }
        catch ( Exception e )
        {
            Lumberjack.throwable( "RegSave", e );
        }
    }

    /**
     * Reads the region from it's file directory.
     *
     * @param region
     *         The region to read.
     * @param dir
     *         The directory where the region file is.
     *
     * @return If the region was loaded properly or not.
     *
     * @since 14.03.30
     */
    public static boolean loadRegion( Region region, File dir )
    {
        File f = new File( dir, String.format( "r%d %d %d.gven.dat", region.x, region.y, region.z ) );

        if ( !createFile( f ) )
        {
            return false;
        }

        try ( DataInputStream dis = new DataInputStream( new FileInputStream( f ) ) )
        {

            // read each chunk
            for ( int i = 0; i < region.chunks.length; i++ )
            {

                // construct the chunk
                Chunk c = new Chunk( region, dis.readInt(), dis.readInt(), dis.readInt() ); // create a chunk based on the chunk's position data

                // read the materials
                for ( int j = 0; j < 4096; j++ )
                {
                    c.setMaterialAt( dis.readByte(), j ); // read the voxel id
                }

                region.chunks[ i ] = c; // set the chunk value
            }
        }
        catch ( Exception e )
        {
            Lumberjack.throwable( "RegLoad", e );
            return false;
        }

        return true;
    }

}