text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">

<meta http-equiv="Content-Language" content="en-us">
<title>Guide</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link rel="stylesheet" type="text/css" href="../style.css">

Building Lua, IM, CD and IUP in
Windows

This is a guide to build all the Lua, IM, CD and IUP libraries in Windows.
Notice that you may not use all the libraries, although this guide will show you
how to build all of
them. You may then choose to build specific libraries.

System Configuration

The Tecmake configuration files are for the GNU make tool.
So first the GNU make must be installed, and it must be in the
PATH before other makes. MingW,
Cygwin and
GnuWin32 distributions have GNU
make binaries ready for download. Some utilities are also
necessary, specially to build the dependencies file: mkdir,
rm (both in CoreUtils) [, which, sed and g++]. If
you don't need the dependencies or some other options just ignore them. Also
some features will work best if bash is installed.

When installing Cygwin unmark all pre-selected items. This is easier to do in
"Partial" mode view. Then select only "make", it will
automatically select other packages that "make" depends on. And
select the mkdir, rm, which, sed
and g++ packages. Change PATH in "Control Panel/System/Advanced/Environment
Variables" and add "c:\cygwin\bin;".

When installing MingW mark C Compiler, C++ Compiler, MSYS
Basic System, and MinGW Developer Toolkit. Change PATH in "Control
Panel/System/Advanced/Environment Variables" and add "C:\mingw4\msys\1.0\bin;C:\mingw4\bin;".

For GnuWin32 it is faster to manually download and install the selected tools
packages. But it does not include a compiler and does not include bash.

Win-Bash contains a "Shell-Complete"
distribution and can also be used. It contains all the tools and bash. It does not include a compiler.

Finally install the compiler of your choice, among the following supported
compilers:

Visual C++ or just
	the Windows SDK.

Gnu gcc (MingW or
	Cygwin)

Open Watcom C++

Embarcadero
	C++ (ex-Borland)

Tecmake Configuration

Since the compilers in Windows are not in the path, you must set a few
environment variables to configure their location. For example:

VC10=c:/progra~2/micros~1/vc               (C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC)
VC10SDK=c:/progra~1/micros~1/Windows\v7.1  (C:\Program Files\Microsoft SDKs\Windows\v7.1)
                                  (if you only installed the Windows SDK with its own compiler set,
                                   then set both variables to the same location)
                                  (VC9,VC9SDK,VC8 and PLATSDK can also be set)
MINGW4=c:/mingw
GCC4=c:/cygwin
OWC1=d:/lng/owc1
BC6=d:/lng/bc6

Noticed that the path used can not have spaces because of the GNU make
internal processing. So you should install or copy the compiler files to a path
with no spaces, or you can use the short path name instead as in the example
above. To obtain the short path name you can use the "shortpath.exe" Tecmake
utility or use the CMD command "dir /X".

If you installed the Visual Studio compiler set, then to use it in the
command line run the "Visual Studio Command Prompt" item in the "Microsoft
Visual Studio 2010\Visual Studio Tools" start menu.

In Windows, there are several compilers that build for the same platform. So
when using the Makefiles included in the distributions of those libraries you
must first specify which compiler you want to use. To do that set the TEC_UNAME
environment variable. This variable will also define if you are going to build
static or dynamic (DLL) libraries, and if building 32 or 64 bits binaries. For
example:

TEC_UNAME=vc10      (Visual C++ 10, static library, 32bits)
TEC_UNAME=dll10     (Visual C++ 10, dynamic library, 32bits)
TEC_UNAME=vc10_64   (Visual C++ 10, static library, 64bits)
TEC_UNAME=dll10_64  (Visual C++ 10, dynamic library, 64bits)
TEC_UNAME=mingw4    (MingW gcc 4, static library, 32bits)
TEC_UNAME=dllw4     (MingW gcc 4, dynamic library, 32bits)
TEC_UNAME=gcc4      (Cygwin Win32 gcc 4, static library, 32bits)
TEC_UNAME=cygw17    (Cygwin Posix gcc 4, both static and dynamic libraries, 32bits)
TEC_UNAME=owc1      (Open Watcom C++ 1, static library, 32bits)
TEC_UNAME=bc6       (Embarcadero C++ 6, static library, 32bits)

Here is an example for MingW:

Download MingW installation tool:
  http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/
Install MingW:
  Select C and C++ Compiles, MSYS Basic System, and MinGW Developer Toolkit.
Configure Environment (Minimum):
  set PATH=C:\mingw4\msys\1.0\bin;C:\mingw4\bin;%PATH%
  set MINGW4=c:/mingw4
  set TEC_UNAME=mingw4
Start Building:
  make

Here is an example for Visual C++:

Download Visual C++ Express edition:
  http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-for-windows-desktop
Install Visual C++ and the Windows SDK (also called Platform SDK)
Download Cygwin:
  http://www.cygwin.com/
Install Cygwin:
  Unselect all option, and select only "make"
Configure Environment (Minimum):
  set PATH=C:\cygwin\bin;%PATH%
  set VC9=C:/PROGRA~1/MICROS~1.0/VC
  set VC9SDK=C:/PROGRA~1/MICROS~2/Windows/v6.0A
Run the "CMD Shell" or "Build Environment" item in the Start Menu.
  or manually run the vcvars32.bat or vcvars64.bat script
  just once, before building any of the targets.

If not using the vcvars*.bat configuration scripts, then you must also set
PATH:

REM The first two are just auxiliary variables.
set VS9=C:\Program Files (x86)\Microsoft Visual Studio 9.0
set VS9SDK=C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin
set PATH=%VS9%\Common7\IDE;%VS9%\VC\BIN;%VS9%\Common7\Tools;%VS9%\Common7\Tools\bin;%VS9%\VC\VCPackages;%VS9SDK%\bin;%PATH%

Source Download

Download the "xxx-X.X_Sources.tar.gz" package from the "Docs and Sources"
directory for the version you want to build. Here are links for the Files section
in Source Forge:

Lua -
http://sourceforge.net/projects/luabinaries/files/

IM -
http://sourceforge.net/projects/imtoolkit/files/

CD -
http://sourceforge.net/projects/canvasdraw/files/

IUP -
http://sourceforge.net/projects/iup/files/

Unpacking

To extract the files use the tar command at a common directory, for example:

mkdir -p xxxx
cd xxxx

[copy the downloaded files, to the xxxx directory]

tar -xpvzf lua5_1_4_Sources.tar.gz    [optional, see note below]
tar -xpvzf im-3.6.2_Sources.tar.gz
tar -xpvzf cd-5.4_Sources.tar.gz
tar -xpvzf iup-3.2_Sources.tar.gz

If you are going to build all the libraries, the makefiles and projects
expect the following directory tree:

/xxxx/
      lua5.1/
      im/
      cd/
      iup/

If you unpack all the source packages in the same directory, that structure will
be automatically created.

Building

As a general rule (excluding system dependencies): IUP depends on CD and IM,
and CD depends on IM. So start by build IM, then CD, then IUP.

To start building go the the "src" directory and type "make". In IUP there are
many "srcxxx" folders, so go to the up directory "iup" and type
"make" that all the
sub folders will be built. For example:

cd im/src
make
cd ../..

cd cd/src
make
cd ../..

cd iup
make
cd ..

TIP: Instead of building all the libraries, try building only the libraries you
are going to use. The provided makefiles will build all the libraries, but take
a look inside them and you will figure out how to build just one library.

Pre-compiled Binaries

Instead of building from sources you can try to use the pre-compiled
binaries. Usually they were build in the latest Windows versions for 32 and 64
bits. The packages are located in the "Windows Libraries"
directory
under the Files section
in Source Forge, with "xxx-X.X_Win32_xx_lib.tar.gz"
and "xxx-X.X_Win64_xx_lib.tar.gz" names.

Do not extract different pre-compiled binaries in the same directory, create a
subdirectory for each one, for example:

mkdir im
cd im
tar -xpvzf ../im-3.6.2_Win32_vc10_lib.tar.gz
cd ..

mkdir cd
cd cd
tar -xpvzf ../cd-5.4_Win32_vc10_lib.tar.gz
cd ..

mkdir iup
cd iup
tar -xpvzf ../iup-3.2_Win32_vc10_lib.tar.gz
cd ..

Usage

For makefiles use:

1) "-I/xxxx/iup/include" to find include files
2) "-L/xxxx/iup/lib/vc10" to find library files
3) "-liup" to specify the library files

For IDEs the configuration involves the same 3 steps above, but each IDE has a different dialog. The IUP toolkit
  has a Guide for some IDEs:

    Borland C++ BuilderX -
http://www.tecgraf.puc-rio.br/iup/en/ide_guide/cppbx.html

Code Blocks - http://www.tecgraf.puc-rio.br/iup/en/ide_guide/codeblocks.html

    Dev-C++ - http://www.tecgraf.puc-rio.br/iup/en/ide_guide/dev-cpp.html

Eclipse for C++ -

http://www.tecgraf.puc-rio.br/iup/en/ide_guide/eclipse.html

Microsoft Visual C++ (Visual Studio 2003) -
http://www.tecgraf.puc-rio.br/iup/en/ide_guide/msvc.html

    Microsoft Visual C++ (Visual Studio 2005) -
http://www.tecgraf.puc-rio.br/iup/en/ide_guide/msvc8.html

Open Watcom - http://www.tecgraf.puc-rio.br/iup/en/ide_guide/owc.html


text:
/**
 * @author Runtian Zhai
 * @license MIT
 *
 */

import java.awt.BorderLayout;
import java.awt.Font;

import javax.swing.JLabel;
import javax.swing.JPanel;

@SuppressWarnings("serial")
public abstract class SynchronizedPanel extends JPanel{
	public abstract void buttonLock();
	public abstract void buttonUnlock();
}

@SuppressWarnings("serial")
class DefaultSynchronizedPanel extends SynchronizedPanel {

	@Override
	public void buttonLock() {}

	@Override
	public void buttonUnlock() {}

	public DefaultSynchronizedPanel() {
		setSize(450, 425);
		setLayout(new BorderLayout());
		JLabel lbl = new JLabel(" ´Ó×ó²àÑ¡ÔñÀ¸ÖÐÑ¡ÔñÒ»Ïî");
		lbl.setFont(new Font("΢ÈíÑźÚ", Font.PLAIN, 16));
		add(lbl, BorderLayout.NORTH);
	}

}

redpajama_set_name: RedPajamaGithub


text:
<%#
 Copyright 2013-2017 the original author or authors from the JHipster project.

 This file is part of the JHipster project, see https://jhipster.github.io/
 for more information.

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

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

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

    angular
        .module('<%=angularAppName%>')
        .factory('GatewayRoutes', GatewayRoutes);

    GatewayRoutes.$inject = ['$resource'];

    function GatewayRoutes ($resource) {
        var service = $resource('api/gateway/routes/:id', {}, {
            'query': { method: 'GET', isArray: true},
            'get': {
                method: 'GET',
                transformResponse: function (data) {
                    data = angular.fromJson(data);
                    return data;
                }
            },
            'update': { method:'PUT' }
        });

        return service;
    }

})();


text:
typedef struct {
        const char* fileName;
} OpenBook;

// Opens a book given a file name. Returns true on success, else false.
bool book_open(const char* fileName, OpenBook* book);

// Closes a book. Returns true on success, else false.
bool book_close(OpenBook* book);

// Looks for moves in the book for the given position.
// Places those moves in buffer, and returns the number of moves placed in the buffer.
// Not suitable for tight loops.
int32_t book_getMoves(GameState* gameState, MoveBuffer* buffer, OpenBook* book);

// Calculates a 64-bit book-specific hash. Similar to the normal hash, this
// removes things like the EP file for better transposition detection.
uint64_t book_bookHash(GameState* gameState);

#endif


text:
package org.fcrepo.kernel.services;

import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;

import javax.jcr.Node;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.jcr.nodetype.NodeType;

import org.fcrepo.jcr.FedoraJcrTypes;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

@RunWith(PowerMockRunner.class)
@PowerMockIgnore({"org.slf4j.*", "javax.xml.parsers.*", "org.apache.xerces.*"})
@PrepareForTest({ServiceHelpers.class})
public class ObjectServiceTest implements FedoraJcrTypes {

    @Mock
    private Session mockSession;

    @Mock
    private Node mockRoot;

    @Mock
    private Node mockNode;

    @Mock
    private NodeType mockNodeType;

    @Before
    public void setUp() throws RepositoryException {
        initMocks(this);
        when(mockSession.getRootNode()).thenReturn(mockRoot);
    }

    @Test
    public void testCreateObject() throws Exception {
        final String testPath = "/foo";
        when(mockRoot.getNode(testPath.substring(1))).thenReturn(mockNode);
        when(mockNodeType.getName()).thenReturn(FEDORA_OBJECT);
        when(mockNode.getMixinNodeTypes()).thenReturn(
                new NodeType[] {mockNodeType});

        final ObjectService testObj = new ObjectService();
        final Node actual =
                testObj.createObject(mockSession, testPath).getNode();
        assertEquals(mockNode, actual);
    }

    @Test
    public void testGetObject() throws RepositoryException {
        when(mockNodeType.getName()).thenReturn(FEDORA_OBJECT);
        when(mockNode.getMixinNodeTypes()).thenReturn(
                new NodeType[] {mockNodeType});

        final String testPath = "/foo";
        when(mockSession.getNode(testPath)).thenReturn(mockNode);
        final ObjectService testObj = new ObjectService();
        testObj.getObject(mockSession, "/foo");
        verify(mockSession).getNode(testPath);
    }

    @Test
    public void testGetObjectNode() throws RepositoryException {
        final String testPath = "/foo";
        final ObjectService testObj = new ObjectService();
        testObj.getObjectNode(mockSession, "/foo");
        verify(mockSession).getNode(testPath);
    }

}


text:
<?php

namespace Dalilak\VenueBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

/**
 * Category Form
 *
 * @author Alaa Attya <alaa.attya91@gmail.com>
 * @package Dalilak.VenueBundle.Form
 * @version 1.0
 * @license  http://www.opensource.org/licenses/mit-license.php The MIT License
 * @category Form
 *
 */
class CategoryType extends AbstractType {

    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options) {
        $builder
                ->add('title')
                ->add('alias')
                ->add('title_ar')
                ->add('venues')
        ;
    }

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver) {
        $resolver->setDefaults(array(
            'data_class' => 'Dalilak\VenueBundle\Entity\Category'
        ));
    }

    /**
     * @return string
     */
    public function getName() {
        return 'dalilak_venuebundle_category';
    }

}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="test.css">
  <title>Zepto Ajax unit tests</title>

Zepto Ajax unit tests

    Running… see browser console for results


text:
arcadian-learning
=================

Arcadian Learning Website


text:
import React, { Component } from 'react';
require('./Loading.less');

export default class Loading extends Component {
  render() {
    return (

    );
  }
}


text:
package org.apache.ambari.server.metric.system.impl;

import static org.easymock.EasyMock.capture;
import static org.easymock.EasyMock.expectLastCall;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.ambari.server.metrics.system.MetricsSink;
import org.apache.ambari.server.metrics.system.SingleMetric;
import org.apache.ambari.server.metrics.system.impl.AmbariMetricSinkImpl;
import org.apache.ambari.server.metrics.system.impl.DatabaseMetricsSource;
import org.apache.ambari.server.metrics.system.impl.JvmMetricsSource;
import org.apache.ambari.server.metrics.system.impl.MetricsConfiguration;
import org.easymock.Capture;
import org.easymock.EasyMock;
import org.easymock.EasyMockRunner;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
import org.junit.Assume;
import org.junit.Test;
import org.junit.runner.RunWith;

import junit.framework.Assert;

@RunWith(EasyMockRunner.class)
public class MetricsSourceTest {

  @Test
  public void testJvmSourceInit_PreJVM1_8() {
    Assume.assumeThat(System.getProperty("java.version"), new LessThanVersionMatcher("1.8"));
    testJvmSourceInit(39);
  }

  @Test
  public void testJvmSourceInit_JVM1_8() {
    Assume.assumeThat(System.getProperty("java.version"), new VersionMatcher("1.8"));
    testJvmSourceInit(40);
  }

  private void testJvmSourceInit(int metricsSize) {
    JvmMetricsSource jvmMetricsSource = new JvmMetricsSource();
    MetricsConfiguration configuration = MetricsConfiguration.getMetricsConfiguration();
    MetricsSink sink = new TestAmbariMetricsSinkImpl();
    jvmMetricsSource.init(configuration, sink);
    org.junit.Assert.assertEquals(jvmMetricsSource.getMetrics().size(), metricsSize);
  }

  /* ****************************************************************
   * Matcher classes used in Assume checks
   * **************************************************************** */
  private class VersionMatcher extends BaseMatcher<String> {
    private final float version;

    VersionMatcher(String version) {
      this.version = Float.parseFloat(version);
    }

    @Override
    public boolean matches(Object o) {
      return parseVersion((String) o) == this.version;
    }

    float parseVersion(String versionString) {
      Pattern p = Pattern.compile("(\\d+(?:\\.\\d+)).*");
      Matcher matcher = p.matcher(versionString);
      if (matcher.matches()) {
        return Float.parseFloat(matcher.group(1));
      } else {
        return 0f;
      }
    }

    @Override
    public void describeTo(Description description) {

    }

    public float getVersion() {
      return version;
    }
  }

  private class LessThanVersionMatcher extends VersionMatcher {

    LessThanVersionMatcher(String version) {
      super(version);
    }

    @Override
    public boolean matches(Object o) {
      return parseVersion((String) o) < getVersion();
    }

    @Override
    public void describeTo(Description description) {

    }
  }

  @Test(timeout=20000)
  public void testDatabaseMetricSourcePublish() throws InterruptedException {
    Map<String, Long> metricsMap = new HashMap<>();

    metricsMap.put("Timer.UpdateObjectQuery.HostRoleCommandEntity", 10000l); // Should be accepted.
    metricsMap.put("Timer.UpdateObjectQuery.HostRoleCommandEntity.SqlPrepare", 5000l); // Should be accepted.
    metricsMap.put("Timer.DirectReadQuery", 6000l); // Should be accepted.
    metricsMap.put("Timer.ReadAllQuery.StackEntity.StackEntity.findByNameAndVersion.SqlPrepare", 15000l); //Should be discarded

    metricsMap.put("Counter.UpdateObjectQuery.HostRoleCommandEntity", 10l); // Should be accepted & should add a computed metric.
    metricsMap.put("Counter.ReadObjectQuery.RequestEntity.request", 4330l); //Should be discarded
    metricsMap.put("Counter.ReadObjectQuery.MetainfoEntity.readMetainfoEntity.CacheMisses", 15l); // Should be accepted.

    DatabaseMetricsSource source = new DatabaseMetricsSource();

    MetricsConfiguration configuration = MetricsConfiguration.getSubsetConfiguration(
      MetricsConfiguration.getMetricsConfiguration(), "source.database.");

    MetricsSink sink = EasyMock.createMock(AmbariMetricSinkImpl.class);
    Capture<List<SingleMetric>> metricsCapture = EasyMock.newCapture();
    sink.publish(capture(metricsCapture));
    expectLastCall().once();

    replay(sink);
    source.init(configuration, sink);
    source.start();
    source.publish(metricsMap);
    Thread.sleep(5000l);
    verify(sink);

    Assert.assertTrue(metricsCapture.getValue().size() == 6);
  }

  @Test
  public void testDatabaseMetricsSourceAcceptMetric() {

    DatabaseMetricsSource source = new DatabaseMetricsSource();
    MetricsConfiguration configuration = MetricsConfiguration.getSubsetConfiguration(
      MetricsConfiguration.getMetricsConfiguration(), "source.database.");
    MetricsSink sink = new TestAmbariMetricsSinkImpl();
    source.init(configuration, sink);

    Assert.assertTrue(source.acceptMetric("Timer.UpdateObjectQuery.HostRoleCommandEntity.SqlPrepare"));
    Assert.assertFalse(source.acceptMetric("Counter.ReadObjectQuery.RequestEntity.request"));
    Assert.assertTrue(source.acceptMetric("Counter.ReadObjectQuery.MetainfoEntity.readMetainfoEntity.CacheMisses"));
  }

}