text:
import {expect} from 'chai';
import {
    genCompoundableSuggestions,
    CompoundWordsMethod,
    suggestionCollector,
} from './suggest';
import { readTrie } from './dictionaries.test';

function getTrie() {
    return readTrie('cspell-dict-en_us');
}

const timeout = 10000;

describe('Validate English Suggestions', function() {

    it('Tests suggestions', async function() {
        this.timeout(timeout);
        const trie = await getTrie();
        const collector = suggestionCollector('joyful', 8, undefined, 1);
        collector.collect(genCompoundableSuggestions(
            trie.root,
            collector.word,
            CompoundWordsMethod.NONE
        ));
        const results = collector.suggestions;
        const suggestions = results.map(s => s.word);
        expect(suggestions).to.contain('joyful');
        expect(suggestions[0]).to.be.equal('joyful');
    });

    it('Tests suggestions', async function() {
        this.timeout(timeout);
        const trie = await getTrie();
        // cspell:ignore joyfull
        const collector = suggestionCollector('joyfull', 8);
        collector.collect(genCompoundableSuggestions(
            trie.root,
            collector.word,
            CompoundWordsMethod.SEPARATE_WORDS
        ));
        const results = collector.suggestions;
        const suggestions = results.map(s => s.word);
        expect(suggestions).to.contain('joyful');
        expect(suggestions[0]).to.be.equal('joyfully');
        expect(suggestions[1]).to.be.equal('joyful');
        expect(suggestions).to.be.length(collector.maxNumSuggestions);
    });

    it('Tests compound SEPARATE_WORDS suggestions', async function() {
        this.timeout(timeout);
        const trie = await getTrie();
        // cspell:ignore onetwothreefour
        const collector = suggestionCollector('onetwothreefour', 8, undefined, 3.3);
        collector.collect(genCompoundableSuggestions(
            trie.root,
            collector.word,
            CompoundWordsMethod.SEPARATE_WORDS
        ));
        const results = collector.suggestions;
        const suggestions = results.map(s => s.word);
        expect(suggestions).to.contain('one two three four');
        expect(suggestions[0]).to.be.equal('one two three four');
        expect(suggestions).to.be.length(collector.maxNumSuggestions);
    });

    it('Tests compound JOIN_WORDS suggestions', async function() {
        this.timeout(timeout);
        const trie = await getTrie();
        // cspell:ignore onetwothrefour
        const collector = suggestionCollector('onetwothreefour', 8, undefined, 3);
        collector.collect(genCompoundableSuggestions(
            trie.root,
            collector.word,
            CompoundWordsMethod.JOIN_WORDS
        ));
        const results = collector.suggestions;
        const suggestions = results.map(s => s.word);
        expect(suggestions).to.contain('one+two+three+four');
        expect(suggestions).to.be.length(collector.maxNumSuggestions);
    });

    it('Tests compound suggestions', async function() {
        this.timeout(timeout);
        const trie = await getTrie();
        // cspell:ignore onetwothrefour
        const collector = suggestionCollector('onetwothreefour', 8, undefined, 3);
        collector.collect(genCompoundableSuggestions(
            trie.root,
            collector.word,
            CompoundWordsMethod.JOIN_WORDS
        ));
        const results = collector.suggestions;
        const suggestions = results.map(s => s.word);
        expect(suggestions).to.contain('one+two+three+four');
        expect(suggestions).to.be.length(collector.maxNumSuggestions);
    });

    // Takes a long time.
    it('Tests long compound suggestions', async function() {
        this.timeout(timeout * 2);
        const trie = await getTrie();
        // cspell:ignore testscompundsuggestions
        const collector = suggestionCollector('testscompundsuggestions', 1, undefined, 3);
        collector.collect(genCompoundableSuggestions(
            trie.root,
            collector.word,
            CompoundWordsMethod.SEPARATE_WORDS
        ));
        const results = collector.suggestions;
        const suggestions = results.map(s => s.word);
        // console.log('Results:');
        // console.log(results.map((r, i) => `${i} ${r.cost} ${r.word}`).join('\n'));
        expect(suggestions).to.be.length(collector.maxNumSuggestions);
        expect(suggestions).to.contain('tests compound suggestions');
        expect(suggestions[0]).to.be.equal('tests compound suggestions');
    });
});


text:
import * as React from 'react';
import Swipeable = require('react-swipeable');

class SampleComponent extends React.PureComponent<Swipeable.SwipeableProps> {
  private readonly handleSwiped: Swipeable.OnSwipedCallback = () => {};
  private readonly handleSwiping: Swipeable.OnSwipingCallback = () => {};
  private readonly handleSwipingUp: Swipeable.OnSwipingDirectionCallback = () => {};
  private readonly handleSwipingRight: Swipeable.OnSwipingDirectionCallback = () => {};
  private readonly handleSwipingDown: Swipeable.OnSwipingDirectionCallback = () => {};
  private readonly handleSwipingLeft: Swipeable.OnSwipingDirectionCallback = () => {};
  private readonly handleSwipedUp: Swipeable.OnSwipedDirectionCallback = () => {};
  private readonly handleSwipedRight: Swipeable.OnSwipedDirectionCallback = () => {};
  private readonly handleSwipedDown: Swipeable.OnSwipedDirectionCallback = () => {};
  private readonly handleSwipedLeft: Swipeable.OnSwipedDirectionCallback = () => {};
  private readonly handleTap: Swipeable.OnTapCallback = () => {};
  private readonly handleClick = () => {};
  private readonly swipeRef = React.createRef<HTMLElement>();

  render() {
    return (
      <Swipeable
        onSwiped={this.handleSwiped}
        onSwiping={this.handleSwiping}
        onSwipingUp={this.handleSwipingUp}
        onSwipingRight={this.handleSwipingRight}
        onSwipingDown={this.handleSwipingDown}
        onSwipingLeft={this.handleSwipingLeft}
        onSwipedUp={this.handleSwipedUp}
        onSwipedRight={this.handleSwipedRight}
        onSwipedDown={this.handleSwipedDown}
        onSwipedLeft={this.handleSwipedLeft}
        onTap={this.handleTap}
        flickThreshold={10}
        delta={10}
        preventDefaultTouchmoveEvent
        stopPropagation
        nodeName="swipe"
        trackMouse
        disabled
        innerRef={this.swipeRef}
        onClick={this.handleClick}
        rotationAngle={0}
      >

          This element can be swiped

      </Swipeable>
    );
  }
}

class DivSwipeable extends Swipeable<HTMLDivElement> {}
const TestComponent: React.StatelessComponent = (_) => {
    const handleSwiped = (event: React.TouchEvent<HTMLDivElement>) => {};
    return (
        <DivSwipeable
            nodeName="div"
            onSwiped={handleSwiped}
        >

this is sample code.

        </DivSwipeable>
    );
};

redpajama_set_name: RedPajamaGithub


text:
<Ui xmlns="http://www.blizzard.com/wow/ui/"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://www.blizzard.com/wow/ui/
                   ..\..\FrameXML\UI.xsd">
  <Script File="WoWMusicPlayer.lua"/>
  <Frame name="WoWMusicPlayer">

  </Frame>
</Ui>


text:
#include "tensorflow/compiler/jit/tests/xla_compilation_cache_test_helper.h"

#include <string>

#include "absl/strings/match.h"
#include "tensorflow/compiler/jit/xla_compilation_cache.pb.h"
#include "tensorflow/compiler/xla/service/hlo.pb.h"
#include "tensorflow/core/platform/path.h"
#include "tensorflow/core/public/session.h"

namespace tensorflow {
namespace {

// Creates a float tensor of linearly increasing values, starting from offset.
Tensor CreateInputTensor(const TensorShape& shape, float offset) {
  Tensor tensor(DT_FLOAT, shape);
  for (int64 i = 0; i < tensor.flat<float>().size(); ++i) {
    tensor.flat<float>()(i) = offset + i;
  }
  return tensor;
}

NodeDef MakeNode(
    absl::string_view name, absl::string_view op,
    absl::Span<const std::string> inputs,
    absl::Span<
        const std::pair<std::string, FunctionDefHelper::AttrValueWrapper>>
        attrs) {
  NodeDef node;
  node.set_name(std::string(name));
  node.set_op(std::string(op));
  for (const auto& input : inputs) node.add_input(input);
  for (const auto& attr : attrs)
    node.mutable_attr()->insert({attr.first, attr.second.proto});
  return node;
}

}  // namespace

GraphDef XlaCompilationCacheSerializeTest::GetTestGraph(
    const PartialTensorShape& input_shape) {
  FunctionDef make_test_fn = FunctionDefHelper::Define(
      "TestFn", {"a:float", "b:float", "c:float"}, {"m:float"}, {},
      {{{"d"}, "Add", {"a", "b"}, {{"T", DT_FLOAT}}},
       {{"e"}, "Mul", {"d", "c"}, {{"T", DT_FLOAT}}},
       {{"f"}, "Add", {"e", "a"}, {{"T", DT_FLOAT}}},
       {{"g"}, "Mul", {"f", "b"}, {{"T", DT_FLOAT}}},
       // Force two clusters by excluding this node explicitly.
       {{"h"}, "Add", {"g", "f"}, {{"T", DT_FLOAT}, {"_XlaCompile", false}}},
       {{"i"}, "Add", {"h", "e"}, {{"T", DT_FLOAT}}},
       {{"j"}, "Add", {"i", "h"}, {{"T", DT_FLOAT}}},
       {{"k"}, "Add", {"j", "h"}, {{"T", DT_FLOAT}}},
       {{"l"}, "Add", {"k", "h"}, {{"T", DT_FLOAT}}},
       {{"m"}, "Identity", {"l"}, {{"T", DT_FLOAT}}}});

  GraphDef graph;
  *graph.mutable_library()->add_function() = make_test_fn;
  *graph.add_node() = MakeNode("a", "Placeholder", {},
                               {{"dtype", DT_FLOAT}, {"shape", input_shape}});
  *graph.add_node() = MakeNode("b", "Placeholder", {},
                               {{"dtype", DT_FLOAT}, {"shape", input_shape}});
  *graph.add_node() = MakeNode("c", "Placeholder", {},
                               {{"dtype", DT_FLOAT}, {"shape", input_shape}});
  *graph.add_node() = MakeNode("m", "TestFn", {"a", "b", "c"}, {});
  return graph;
}

Status XlaCompilationCacheSerializeTest::ExecuteWithBatch(const GraphDef& graph,
                                                          int batch) {
  const TensorShape shape({batch, 4});

  // Compute the golden output tensor
  std::vector<Tensor> golden_output_tensors;
  {
    SessionOptions options;
    std::unique_ptr<Session> session(NewSession(options));
    TF_RETURN_IF_ERROR(session->Create(graph));
    RunOptions run_options;

    Tensor input_a = CreateInputTensor(shape, 0);
    Tensor input_b = CreateInputTensor(shape, shape.num_elements());
    Tensor input_c = CreateInputTensor(shape, 2 * shape.num_elements());
    TF_RETURN_IF_ERROR(session->Run(
        run_options,
        {std::make_pair("a", input_a), std::make_pair("b", input_b),
         std::make_pair("c", input_c)},
        {"m"}, {}, &golden_output_tensors, nullptr));
    TF_RETURN_IF_ERROR(session->Close());
  }

  // Compute the XLA compiled output
  std::vector<Tensor> output_tensors;
  {
    SessionOptions options;
    auto& opts =
        *options.config.mutable_graph_options()->mutable_optimizer_options();
    opts.set_global_jit_level(OptimizerOptions::ON_1);
    opts.set_cpu_global_jit(true);

    std::unique_ptr<Session> session(NewSession(options));
    TF_RETURN_IF_ERROR(session->Create(graph));
    RunOptions run_options;
    Tensor input_a = CreateInputTensor(shape, 0);
    Tensor input_b = CreateInputTensor(shape, shape.num_elements());
    Tensor input_c = CreateInputTensor(shape, 2 * shape.num_elements());
    TF_RETURN_IF_ERROR(session->Run(
        run_options,
        {std::make_pair("a", input_a), std::make_pair("b", input_b),
         std::make_pair("c", input_c)},
        {"m"}, {}, &output_tensors, nullptr));
    TF_RETURN_IF_ERROR(session->Close());
  }

  Tensor f32_input(DT_FLOAT, shape);
  for (int64 i = 0; i < f32_input.NumElements(); ++i) {
    EXPECT_NEAR(golden_output_tensors[0].flat<float>()(i),
                output_tensors[0].flat<float>()(i), 1e-3);
  }
  return OkStatus();
}

Status
XlaCompilationCacheSerializeTest::AlterPersistentCacheEntryHloModuleNames(
    absl::string_view persistent_cache_dir_path,
    absl::string_view file_prefix) {
  Env* env = Env::Default();
  std::vector<string> file_names;
  TF_RETURN_IF_ERROR(
      env->GetChildren(tensorflow::testing::TmpDir(), &file_names));

  bool altered = false;
  for (const auto& file_name : file_names) {
    if (absl::EndsWith(file_name, ".pb") &&
        absl::StartsWith(file_name, file_prefix)) {
      XlaSerializedCacheEntry entry;
      auto file_path = io::JoinPath(persistent_cache_dir_path, file_name);
      TF_RETURN_IF_ERROR(ReadTextOrBinaryProto(env, file_path, &entry));
      entry.mutable_hlo_module()->set_name(
          absl::StrCat(entry.hlo_module().name(), "_altered"));
      TF_RETURN_IF_ERROR(WriteBinaryProto(env, file_path, entry));
      altered = true;
    }
  }

  if (!altered) {
    return errors::NotFound(
        "Did not find any persistent XLA compilation cache entries to alter.");
  }
  return OkStatus();
}

}  // namespace tensorflow


text:
package ru.job4j.jsp.crud;

import java.sql.Timestamp;

/** Class User.
 * @author Arseniy Kulkiov
 * @since 19.03.2017
 * @version 1
 */
public class User {
    /**
     * Class field.
     */
    private String name;
    /**
     * Class field.
     */
    private String login;
    /**
     * Class field.
     */
    private String email;
    /**
     * Class field.
     */
    private String createDate;

    /**
     * Getter.
     * @return - return statement.
     */
    public String getName() {
        return name;
    }

    /**
     * Setter.
     * @param name - parameter.
     */
    public void setName(String name) {
        this.name = name;
    }
    /**
     * Getter.
     * @return - return statement.
     */
    public String getLogin() {
        return login;
    }
    /**
     * Setter.
     * @param login - parameter.
     */
    public void setLogin(String login) {
        this.login = login;
    }
    /**
     * Getter.
     * @return - return statement.
     */
    public String getEmail() {
        return email;
    }
    /**
     * Setter.
     * @param email - parameter.
     */
    public void setEmail(String email) {
        this.email = email;
    }
    /**
     * Getter.
     * @return - return statement.
     */
    public String getCreateDate() {
        return createDate;
    }
    /**
     * Setter.
     * @param createDate - parameter.
     */
    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    /**
     * Constructor.
     * @param name - parameter.
     * @param login - parameter.
     * @param email - parameter.
     */
    public User(String name, String login, String email) {
        this.name = name;
        this.login = login;
        this.email = email;
        this.createDate = new Timestamp(System.currentTimeMillis()).toString();
    }

    @Override
    public String toString() {
        return String.format("name: %s, login: %s, email: %s,  createDate: %s", this.name, this.login, this.email, this.createDate);
    }
}


text:
package org.yidu.novel.action;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.yidu.novel.action.base.AbstractPublicListBaseAction;
import org.yidu.novel.bean.ArticleSearchBean;
import org.yidu.novel.cache.CacheManager;
import org.yidu.novel.constant.YiDuConstants;
import org.yidu.novel.entity.TArticle;

import com.google.gson.Gson;

public class SearchAction extends AbstractPublicListBaseAction {
    /**
     * 串行化版本统一标识符
     */
    private static final long serialVersionUID = -4215796997609788238L;
    /**
     * 检索关键字
     */
    private String key;

    /**
     * 页号
     */
    private int page;

    /**
     * 小说列表
     */
    private List<TArticle> articleList = new ArrayList<TArticle>();

    /**
     * 获取 page
     *
     * @return page
     */
    public int getPage() {
    	return page ==0 ? 1 : page;
    }

    /**
     *
     * 设置page
     *
     *
     * @param page
     *            page
     */
    public void setPage(int page) {
        this.page = page;
    }

    /**
     * 获取 articleList
     *
     * @return articleList
     */
    public List<TArticle> getArticleList() {
        return articleList;
    }

    /**
     *
     * 设置articleList
     *
     *
     * @param articleList
     *            articleList
     */
    public void setArticleList(List<TArticle> articleList) {
        this.articleList = articleList;
    }

    /**
     * 获取 key
     *
     * @return key
     */
    public String getKey() {
        return key;
    }

    /**
     *
     * 设置key
     *
     * @param key
     *            key
     */
    public void setKey(String key) {
        this.key = StringUtils.trim(key);
    }

    @Override
    public String getTempName() {
        return "search";
    }

    /**
     * 获取排行榜名字的JSON数据
     *
     * @return 排行榜名字的JSON数据
     */
    public String getTopNameJsonData() {
        Gson gson = new Gson();
        return gson.toJson(YiDuConstants.TOP_NAME_MAP, Map.class);
    }

    @Override
    protected void loadData() {
        logger.debug("loadData start.");

        ArticleSearchBean searchBean = new ArticleSearchBean();
        BeanUtils.copyProperties(this, searchBean);
        searchBean.setPageType(ArticleSearchBean.PageType.publicPage);
        pagination.setPageNumber(page == 0 ? 1 : page);
        pagination.setSortColumn("lastupdate");
        pagination.setSortOrder("ASC");

        Object countInfo = CacheManager.getObject(CacheManager.CacheKeyPrefix.CACHE_KEY_ARTICEL_LIST_COUNT_PREFIX,
                searchBean);
        int count = 0;
        if (countInfo == null) {
            count = articleService.getCount(searchBean);
            CacheManager.putObject(CacheManager.CacheKeyPrefix.CACHE_KEY_ARTICEL_LIST_COUNT_PREFIX, searchBean, count);
        } else {
            count = Integer.parseInt(countInfo.toString());
        }
        // 总件数设置
        pagination.setPreperties(count);
        searchBean.setPagination(pagination);

        articleList = CacheManager.getObject(CacheManager.CacheKeyPrefix.CACHE_KEY_ARTICEL_LIST_PREFIX, searchBean);
        if (articleList == null || articleList.size() == 0) {
            articleList = articleService.find(searchBean);
            CacheManager.putObject(CacheManager.CacheKeyPrefix.CACHE_KEY_ARTICEL_LIST_PREFIX, searchBean, articleList);
        }
        logger.debug("normally end.");
    }

    @Override
    public int getPageType() {
        return YiDuConstants.Pagetype.PAGE_SEARCH;
    }

}


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

namespace Charlotte.Tools
{
	public static class BinaryTools
	{
		public static Comparison<byte> comp = delegate(byte a, byte b)
		{
			return (int)a - (int)b;
		};
	}
}


text:
package com.compufiber.model;

import java.util.*;

import javax.persistence.*;

import org.openxava.annotations.*;
import org.openxava.util.*;
// import com.compufiber.validadores.*;

@Entity
@Table(name="LV_MODELOS")
public class Modelos extends SuperClaseFeliz {
	@Required
//	@PropertyValidator(value=ValidadorTipoIva.class,message="TipoIva duplicado",onlyOnCreate=true)
	@Column(length=7,nullable=false,name="CODIGO",unique=true)
	private Long codigo ;

	@Required
//	@PropertyValidator(value=Validador2014v.class,message="Nombre duplicado")
	@Column(length=40,nullable=false,name="DESCRIPCION",unique=true)
	private String descripcion ;

	public Long getCodigo() {
		return codigo;
	}

	public void setCodigo(Long codigo) {
		this.codigo = codigo;
	}

	public String getDescripcion() {
		return descripcion;
	}

	public void setDescripcion(String descripcion) {
		this.descripcion = descripcion.toUpperCase().trim();
	}

	@PreUpdate
	private void ultimoPaso() {
			Date mifechora = new java.util.Date() ;
			super.setModificadoPor(Users.getCurrent()) ;
			super.setFchUltMod(mifechora)  ;
	}
}


text:
import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing';
import { mapFeatureKey, MapReducer } from '@ansyn/map-facade';
import { OverlayOutOfBoundsComponent } from './overlay-out-of-bounds.component';
import { bboxFromGeoJson, ImageryCommunicatorService } from '@ansyn/imagery';
import { By } from '@angular/platform-browser';
import { of } from 'rxjs';
import { geometry } from '@turf/turf';
import { Store, StoreModule } from '@ngrx/store';
import { TranslateModule } from '@ngx-translate/core';

describe('OverlayOutOfBoundsComponent', () => {
	let component: OverlayOutOfBoundsComponent;
	let fixture: ComponentFixture<OverlayOutOfBoundsComponent>;
	let imageryCommunicatorService: ImageryCommunicatorService;
	let store: Store<any>;

	beforeEach(waitForAsync(() => {
		TestBed.configureTestingModule({
			providers: [ImageryCommunicatorService],
			declarations: [OverlayOutOfBoundsComponent],
			imports: [StoreModule.forRoot({ [mapFeatureKey]: MapReducer }), TranslateModule.forRoot()]
		})
			.compileComponents();
	}));

	beforeEach(inject([ImageryCommunicatorService, Store], (_imageryCommunicatorService: ImageryCommunicatorService, _store: Store<any>) => {
		fixture = TestBed.createComponent(OverlayOutOfBoundsComponent);
		component = fixture.componentInstance;
		fixture.detectChanges();
		imageryCommunicatorService = _imageryCommunicatorService;
		store = _store;
	}));

	it('should create', () => {
		expect(component).toBeTruthy();
	});

	it('click on button should call "backToExtent"', () => {
		spyOn(component, 'backToExtent');
		const button = fixture.debugElement.query(By.css('button'));
		button.triggerEventHandler('click', {});
		expect(component.backToExtent).toHaveBeenCalled();
	});

	it('backToExtent should calc extent and call fitToExtent', () => {
		const mapSettings = <any>{
			id: 'mapId',
			data: { overlay: { footprint: geometry('Polygon', [[[0, 0], [1, 1], [2, 2], [0, 0]]]) } }
		};
		component.mapId = 'mapId';
		const ActiveMap = jasmine.createSpyObj({ fitToExtent: of(true) });
		spyOn(imageryCommunicatorService, 'provide').and.returnValue(<any>{ ActiveMap, mapSettings });
		component.backToExtent();
		const extent = bboxFromGeoJson(imageryCommunicatorService.provide(component.mapId).mapSettings.data.overlay.footprint);
		expect(ActiveMap.fitToExtent).toHaveBeenCalledWith(extent);
	});

});


text:
package com.google.googleidentity.user;

import com.google.common.collect.ImmutableList;
import com.google.googleidentity.oauth2.exception.OAuth2ServerException;
import com.google.inject.Inject;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.sql.DataSource;

/** Jdbc Implementation for {@link UserDetailsService} */
public class JdbcUserDetailsService implements UserDetailsService {

  private final DataSource dataSource;

  private final Logger log = Logger.getLogger("JdbcUserDetailsService");

  @Inject
  JdbcUserDetailsService(DataSource dataSource) {
    this.dataSource = dataSource;
  }

  @Override
  public Optional<UserDetails> getUserByName(String username) {
    Connection conn = null;
    PreparedStatement statement = null;
    ResultSet result = null;
    try {
      conn = dataSource.getConnection();
      String stmt = "SELECT * FROM user " + "WHERE username = ?;";
      statement = conn.prepareStatement(stmt);
      statement.setString(1, username);
      result = statement.executeQuery();
      if (result.next()) {
        Optional<UserDetails> user = Optional.ofNullable(buildUserFromJdbcResult(result));
        return user;
      }
    } catch (SQLException exception) {
      throw new OAuth2ServerException(exception);
    } finally {
      if (result != null) {
        try {
          result.close();
        } catch (SQLException exception2) {
          throw new OAuth2ServerException(exception2);
        }
      }
      if (statement != null) {
        try {
          statement.close();
        } catch (SQLException exception3) {
          throw new OAuth2ServerException(exception3);
        }
      }
      if (conn != null) {
        try {
          conn.close();
        } catch (SQLException exception4) {
          throw new OAuth2ServerException(exception4);
        }
      }
    }
    return Optional.empty();
  }

  @Override
  public boolean updateUser(UserDetails user) {
    Connection conn = null;
    PreparedStatement statement = null;
    try {
      conn = dataSource.getConnection();
      conn.setAutoCommit(false);
      String stmt =
          "UPDATE user "
              + "SET password = ?, email = ?, google_account_id = ? "
              + "WHERE username = ?;";
      statement = conn.prepareStatement(stmt);
      statement.setString(1, user.getPassword());
      statement.setString(2, user.getEmail());
      statement.setString(3, user.getGoogleAccountId());
      statement.setString(4, user.getUsername());
      int count = statement.executeUpdate();
      conn.commit();
      return count == 1;
    } catch (SQLException exception) {
      try {
        if (conn != null) {
          conn.rollback();
        }
      } catch (SQLException exception1) {
        throw new OAuth2ServerException(exception1);
      }
      throw new OAuth2ServerException(exception);
    } finally {
      if (statement != null) {
        try {
          statement.close();
        } catch (SQLException exception3) {
          throw new OAuth2ServerException(exception3);
        }
      }
      if (conn != null) {
        try {
          conn.close();
        } catch (SQLException exception4) {
          throw new OAuth2ServerException(exception4);
        }
      }
    }
  }

  @Override
  public boolean addUser(UserDetails user) {
    Connection conn = null;
    PreparedStatement statement = null;
    ResultSet result = null;
    try {
      conn = dataSource.getConnection();
      conn.setAutoCommit(false);
      String stmt = "SELECT * FROM user WHERE username = ?;";
      statement = conn.prepareStatement(stmt);
      statement.setString(1, user.getUsername());
      result = statement.executeQuery();
      if (!result.next()) {
        stmt = "INSERT INTO user VALUES (?, ?, ?, ?);";
        statement = conn.prepareStatement(stmt);
        statement.setString(1, user.getUsername());
        statement.setString(2, user.getPassword());
        statement.setString(3, user.getEmail());
        statement.setString(4, user.getGoogleAccountId());
        statement.execute();
        conn.commit();
        return true;
      }
    } catch (SQLException exception) {
      try {
        if (conn != null) {
          conn.rollback();
        }
      } catch (SQLException exception1) {
        throw new OAuth2ServerException(exception1);
      }
      throw new OAuth2ServerException(exception);
    } finally {
      if (result != null) {
        try {
          result.close();
        } catch (SQLException exception2) {
          throw new OAuth2ServerException(exception2);
        }
      }
      if (statement != null) {
        try {
          statement.close();
        } catch (SQLException exception3) {
          throw new OAuth2ServerException(exception3);
        }
      }
      if (conn != null) {
        try {
          conn.close();
        } catch (SQLException exception4) {
          throw new OAuth2ServerException(exception4);
        }
      }
    }
    return false;
  }

  @Override
  public Optional<UserDetails> getUserByEmailOrGoogleAccountId(String email, String gid) {
    Connection conn = null;
    PreparedStatement statement = null;
    ResultSet result = null;
    try {
      conn = dataSource.getConnection();
      String stmt = "SELECT * FROM user " + "WHERE email = ? OR google_account_id = ?;";
      statement = conn.prepareStatement(stmt);
      statement.setString(1, email);
      statement.setString(2, gid);
      result = statement.executeQuery();
      if (result.next()) {
        Optional<UserDetails> user = Optional.ofNullable(buildUserFromJdbcResult(result));
        return user;
      }
    } catch (SQLException exception) {
      throw new OAuth2ServerException(exception);
    } finally {
      if (result != null) {
        try {
          result.close();
        } catch (SQLException exception2) {
          throw new OAuth2ServerException(exception2);
        }
      }
      if (statement != null) {
        try {
          statement.close();
        } catch (SQLException exception3) {
          throw new OAuth2ServerException(exception3);
        }
      }
      if (conn != null) {
        try {
          conn.close();
        } catch (SQLException exception4) {
          throw new OAuth2ServerException(exception4);
        }
      }
    }
    return Optional.empty();
  }

  @Override
  public List<UserDetails> listUser() {
    List<UserDetails> list = new LinkedList<>();
    Connection conn = null;
    PreparedStatement statement = null;
    ResultSet result = null;
    try {
      conn = dataSource.getConnection();
      String stmt = "SELECT * FROM user;";
      statement = conn.prepareStatement(stmt);
      result = statement.executeQuery();
      while (result.next()) {
        list.add(buildUserFromJdbcResult(result));
      }
    } catch (SQLException exception) {
      throw new OAuth2ServerException(exception);
    } finally {
      if (result != null) {
        try {
          result.close();
        } catch (SQLException exception2) {
          throw new OAuth2ServerException(exception2);
        }
      }
      if (statement != null) {
        try {
          statement.close();
        } catch (SQLException exception3) {
          throw new OAuth2ServerException(exception3);
        }
      }
      if (conn != null) {
        try {
          conn.close();
        } catch (SQLException exception4) {
          throw new OAuth2ServerException(exception4);
        }
      }
    }
    return ImmutableList.copyOf(list);
  }

  @Override
  public void reset() {
    Connection conn = null;
    PreparedStatement statement = null;
    ResultSet result = null;
    try {
      conn = dataSource.getConnection();
      conn.setAutoCommit(false);
      String stmt = "DELETE FROM user;";
      statement = conn.prepareStatement(stmt);
      statement.execute();
      conn.commit();
    } catch (SQLException exception) {
      try {
        if (conn != null) {
          conn.rollback();
        }
      } catch (SQLException exception1) {
        throw new OAuth2ServerException(exception1);
      }
      throw new OAuth2ServerException(exception);
    } finally {
      if (result != null) {
        try {
          result.close();
        } catch (SQLException exception2) {
          throw new OAuth2ServerException(exception2);
        }
      }
      if (statement != null) {
        try {
          statement.close();
        } catch (SQLException exception3) {
          throw new OAuth2ServerException(exception3);
        }
      }
      if (conn != null) {
        try {
          conn.close();
        } catch (SQLException exception4) {
          throw new OAuth2ServerException(exception4);
        }
      }
    }

  }

  private UserDetails buildUserFromJdbcResult(ResultSet result) throws SQLException {
    return UserDetails.newBuilder()
        .setUsername(result.getString("username"))
        .setPassword(result.getString("password"))
        .setEmail(result.getString("email"))
        .setGoogleAccountId(result.getString("google_account_id"))
        .build();
  }
}


text:
pageClass: rule-details
sidebarDepth: 0
title: vue/singleline-html-element-content-newline
description: require a line break before and after the contents of a singleline element
---
# vue/singleline-html-element-content-newline
> require a line break before and after the contents of a singleline element

- :gear: This rule is included in `"plugin:vue/strongly-recommended"` and `"plugin:vue/recommended"`.
- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.

## :book: Rule Details

This rule enforces a line break before and after the contents of a singleline element.

<eslint-code-block fix :rules="{'vue/singleline-html-element-content-newline': ['error']}">

```vue
<template>
  <!-- ✓ GOOD -->
  <div attr>
    content
  </div>

  <tr attr>
    <td>
      {{ data1 }}
    </td>
    <td>
      {{ data2 }}
    </td>
  </tr>

  <div attr>
    <!-- comment -->
  </div>

  <!-- ✗ BAD -->
  <div attr>content</div>

  <tr attr><td>{{ data1 }}</td><td>{{ data2 }}</td></tr>

  <div attr><!-- comment --></div>
</template>
```

</eslint-code-block>

## :wrench: Options

```json
{
  "vue/singleline-html-element-content-newline": ["error", {
    "ignoreWhenNoAttributes": true,
    "ignoreWhenEmpty": true,
    "ignores": ["pre", "textarea"]
  }]
}
```

- `ignoreWhenNoAttributes` ... allows having contents in one line, when given element has no attributes.
    default `true`
- `ignoreWhenEmpty` ... disables reporting when element has no content.
    default `true`
- `ignores` ... the configuration for element names to ignore line breaks style.
    default `["pre", "textarea"]`

### `"ignoreWhenNoAttributes": true`

<eslint-code-block fix :rules="{'vue/singleline-html-element-content-newline': ['error', {'ignoreWhenNoAttributes': true}]}">

```vue
<template>
  <!-- ✗ BAD -->
  <div attr>content</div>

  <tr attr><td>{{ data1 }}</td><td>{{ data2 }}</td></tr>

  <div attr><!-- comment --></div>
</template>
```

</eslint-code-block>

### `"ignoreWhenNoAttributes": false`

<eslint-code-block fix :rules="{'vue/singleline-html-element-content-newline': ['error', {'ignoreWhenNoAttributes': false}]}">

```vue
<template>
  <!-- ✗ BAD -->
  <div>content</div>

  <tr><td>{{ data1 }}</td><td>{{ data2 }}</td></tr>

  <div><!-- comment --></div>
</template>
```

</eslint-code-block>

## :mag: Implementation

- [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/singleline-html-element-content-newline.js)
- [Test source](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/singleline-html-element-content-newline.js)


text:
Tratta i gruppi non affidabili come

Questa opzione determina in che modo i gruppi non affidabili vengono trattati. E' possibile inserire un GID o selezionare un gruppo, o scegliere il valore di default.

Opzioni di exportfs: anongid

default: -2 o nobody


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="645f0cc8-119a-4523-a843-0bfd93c323ca" name="Default" comment="" />
    <ignored path="PrototypeCI.iws" />
    <ignored path=".idea/workspace.xml" />
    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
  <component name="CreatePatchCommitExecutor">
    <option name="PATCH_PATH" value="" />
  </component>
  <component name="DaemonCodeAnalyzer">
    <disable_hints />
  </component>
  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
  <component name="FavoritesManager">
    <favorites_list name="PrototypeCI" />
  </component>
  <component name="FileEditorManager">
    <leaf>
      <file leaf-file-name="cpconfig.js" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/js/cpconfig.js">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.0" vertical-offset="75" max-vertical-offset="1140">
              <caret line="5" column="32" selection-start-line="5" selection-start-column="32" selection-end-line="5" selection-end-column="32" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="content1.html" pinned="false" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/content1.html">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.16587678" vertical-offset="0" max-vertical-offset="2415">
              <caret line="7" column="33" selection-start-line="7" selection-start-column="33" selection-end-line="7" selection-end-column="33" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="main1.js" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/js/main1.js">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1905">
              <caret line="13" column="0" selection-start-line="13" selection-start-column="0" selection-end-line="13" selection-end-column="0" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="JsGulpfileManager">
    <detection-done>true</detection-done>
  </component>
  <component name="ProjectFrameBounds">
    <option name="x" value="151" />
    <option name="y" value="158" />
    <option name="width" value="1222" />
    <option name="height" value="790" />
  </component>
  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
    <OptionsSetting value="true" id="Add" />
    <OptionsSetting value="true" id="Remove" />
    <OptionsSetting value="true" id="Checkout" />
    <OptionsSetting value="true" id="Update" />
    <OptionsSetting value="true" id="Status" />
    <OptionsSetting value="true" id="Edit" />
    <ConfirmationsSetting value="0" id="Add" />
    <ConfirmationsSetting value="0" id="Remove" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
    </navigator>
    <panes>
      <pane id="ProjectPane">
        <subPane>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="PrototypeCI" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="PrototypeCI" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="PrototypeCI" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="PrototypeCI" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="PrototypeCI" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="js" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="PrototypeCI" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="PrototypeCI" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="img" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
      <pane id="Scope" />
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="WebServerToolWindowFactoryState" value="false" />
    <property name="HbShouldOpenHtmlAsHb" value="" />
    <property name="FullScreen" value="false" />
    <property name="options.lastSelected" value="vcs.Git" />
    <property name="options.splitter.main.proportions" value="0.3" />
    <property name="options.splitter.details.proportions" value="0.2" />
    <property name="SearchEverywhereHistoryKey" value="custom	FILE	file:///Users/pvemula/WebstormProjects/PrototypeCI/css/custom.css
headerwra	null	null
about	ACTION	About" />
    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
    <property name="DefaultHtmlFileTemplate" value="Html5" />
  </component>
  <component name="RecentsManager">
    <key name="CopyFile.RECENT_KEYS">
      <recent name="$PROJECT_DIR$/js" />
      <recent name="$PROJECT_DIR$" />
      <recent name="$PROJECT_DIR$/fonts" />
      <recent name="$PROJECT_DIR$/css" />
    </key>
    <key name="MoveFile.RECENT_KEYS">
      <recent name="$PROJECT_DIR$/js" />
      <recent name="$PROJECT_DIR$/js/vendor" />
      <recent name="$PROJECT_DIR$/css" />
      <recent name="$PROJECT_DIR$" />
    </key>
  </component>
  <component name="RunManager">
    <configuration default="true" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application">
      <method />
    </configuration>
    <configuration default="true" type="DartUnitRunConfigurationType" factoryName="DartUnit">
      <method />
    </configuration>
    <configuration default="true" type="JavaScriptTestRunnerKarma" factoryName="Karma" config-file="">
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="JSTestDriver:ConfigurationType" factoryName="JsTestDriver">
      <setting name="configLocationType" value="CONFIG_FILE" />
      <setting name="settingsFile" value="" />
      <setting name="serverType" value="INTERNAL" />
      <setting name="preferredDebugBrowser" value="Chrome" />
      <method />
    </configuration>
    <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
      <method />
    </configuration>
    <configuration default="true" type="NodeJSConfigurationType" factoryName="Node.js" working-dir="">
      <method />
    </configuration>
    <configuration default="true" type="cucumber.js" factoryName="Cucumber.js">
      <option name="cucumberJsArguments" value="" />
      <option name="executablePath" />
      <option name="filePath" />
      <method />
    </configuration>
    <configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
      <node-options />
      <gulpfile />
      <tasks />
      <pass-parent-envs>true</pass-parent-envs>
      <envs />
      <method />
    </configuration>
    <list size="0" />
  </component>
  <component name="ShelveChangesManager" show_recycled="false" />
  <component name="SvnConfiguration">
    <configuration />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="645f0cc8-119a-4523-a843-0bfd93c323ca" name="Default" comment="" />
      <created>1415586924394</created>
      <option name="number" value="Default" />
      <updated>1415586924394</updated>
    </task>
    <servers />
  </component>
  <component name="ToolWindowManager">
    <frame x="151" y="158" width="1222" height="790" extended-state="0" />
    <editor active="true" />
    <layout>
      <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.24956064" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.23313905" sideWeight="0.5" order="1" side_tool="false" content_ui="combo" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="true" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3295129" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
    </layout>
  </component>
  <component name="Vcs.Log.UiProperties">
    <option name="RECENTLY_FILTERED_USER_GROUPS">
      <collection />
    </option>
    <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
      <collection />
    </option>
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="VcsManagerConfiguration">
    <option name="myTodoPanelSettings">
      <TodoPanelSettings />
    </option>
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager>
      <breakpoints>
        <line-breakpoint enabled="true" type="javascript">
          <url>file://$PROJECT_DIR$/js/upload.js</url>
          <line>52</line>
          <option name="timeStamp" value="1" />
        </line-breakpoint>
        <line-breakpoint enabled="true" type="javascript">
          <url>file://$PROJECT_DIR$/js/main1.js</url>
          <option name="timeStamp" value="3" />
        </line-breakpoint>
      </breakpoints>
      <option name="time" value="4" />
    </breakpoint-manager>
    <watches-manager />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/js/cpconfig.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1140">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/upload.html">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="314" max-vertical-offset="1110">
          <caret line="48" column="78" selection-start-line="48" selection-start-column="78" selection-end-line="48" selection-end-column="78" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/js/cpconfig.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="630" max-vertical-offset="945">
          <caret line="42" column="0" selection-start-line="42" selection-start-column="0" selection-end-line="42" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/cpconfig.html">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="2475">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding>
            <element signature="n#div#0;n#form#0;n#div#0;n#div#0;n#div#0;n#body#0;n#html#0;n#!!top" expanded="false" />
            <element signature="n#div#2;n#form#0;n#div#0;n#div#0;n#div#0;n#body#0;n#html#0;n#!!top" expanded="false" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/upload.html">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1245">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/robots.txt">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="670">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/css/bootstrap-theme.css">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="6945">
          <caret line="32" column="20" selection-start-line="32" selection-start-column="20" selection-end-line="32" selection-end-column="20" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/js/vendor/bootstrap.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="34170">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/css/bootstrap.css">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="52.346153" vertical-offset="5531" max-vertical-offset="95460">
          <caret line="278" column="22" selection-start-line="278" selection-start-column="22" selection-end-line="278" selection-end-column="22" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/js/vendor/jquery.dataTables.min.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.9315069" vertical-offset="1713" max-vertical-offset="2430">
          <caret line="155" column="388" selection-start-line="155" selection-start-column="388" selection-end-line="155" selection-end-column="388" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/js/vendor/offcanvas.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="670">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/js/vendor/jquery-1.10.2.min.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.035128806" vertical-offset="0" max-vertical-offset="427">
          <caret line="3" column="30635" selection-start-line="3" selection-start-column="30635" selection-end-line="3" selection-end-column="30635" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/README.md">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.069767445" vertical-offset="0" max-vertical-offset="645">
          <caret line="3" column="22" selection-start-line="3" selection-start-column="22" selection-end-line="3" selection-end-column="22" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/crossdomain.xml">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="670">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/favicon.ico">
      <provider selected="true" editor-type-id="images">
        <state />
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/css/main.css">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="-1.5447761" vertical-offset="1035" max-vertical-offset="4650">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/img/walmartlogo.png">
      <provider selected="true" editor-type-id="images">
        <state />
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/css/offcanvas.css">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.29104477" vertical-offset="0" max-vertical-offset="990">
          <caret line="13" column="20" selection-start-line="13" selection-start-column="20" selection-end-line="13" selection-end-column="20" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/css/datatable.css">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="10.8447485" vertical-offset="0" max-vertical-offset="7215">
          <caret line="475" column="1" selection-start-line="475" selection-start-column="1" selection-end-line="475" selection-end-column="1" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/404.html">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="-4.375" vertical-offset="0" max-vertical-offset="2445">
          <caret line="7" column="36" selection-start-line="7" selection-start-column="36" selection-end-line="7" selection-end-column="36" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/.htaccess">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="118.8" vertical-offset="2970" max-vertical-offset="8355">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/js/upload.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.09627728" vertical-offset="0" max-vertical-offset="779">
          <caret line="89" column="0" selection-start-line="89" selection-start-column="0" selection-end-line="89" selection-end-column="0" />
          <folding>
            <element signature="n#!!doc;n#getDoc#0" expanded="false" />
            <element signature="n#!!block;n#getDoc#0" expanded="false" />
            <element signature="e#131#239#0" expanded="false" />
            <element signature="e#174#233#0" expanded="false" />
            <element signature="e#255#262#0" expanded="false" />
            <element signature="e#281#338#0" expanded="false" />
            <element signature="e#352#506#0" expanded="false" />
            <element signature="e#522#583#0" expanded="false" />
            <element signature="e#637#1977#0" expanded="false" />
            <element signature="e#775#1291#0" expanded="false" />
            <element signature="e#836#1235#0" expanded="false" />
            <element signature="e#1119#1135#0" expanded="false" />
            <element signature="e#1209#1225#0" expanded="false" />
            <element signature="e#1327#1975#0" expanded="false" />
            <element signature="e#1758#1966#0" expanded="false" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$USER_HOME$/Downloads/arc-response-2014 Nov 12 20-43-28.json">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="646">
          <caret line="0" column="24" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="65739" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/css/custom.css">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="3.0895522" vertical-offset="0" max-vertical-offset="2250">
          <caret line="138" column="19" selection-start-line="138" selection-start-column="19" selection-end-line="138" selection-end-column="19" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/upload.html">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="-17.5" vertical-offset="0" max-vertical-offset="1110">
          <caret line="28" column="28" selection-start-line="28" selection-start-column="28" selection-end-line="28" selection-end-column="28" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/index.html">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="-1.875" vertical-offset="0" max-vertical-offset="720">
          <caret line="3" column="63" selection-start-line="3" selection-start-column="63" selection-end-line="3" selection-end-column="63" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/js/cpconfig.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="75" max-vertical-offset="1140">
          <caret line="5" column="32" selection-start-line="5" selection-start-column="32" selection-end-line="5" selection-end-column="32" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/cpconfig.html">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.36343613" vertical-offset="7260" max-vertical-offset="8145">
          <caret line="505" column="28" selection-start-line="505" selection-start-column="28" selection-end-line="505" selection-end-column="28" />
          <folding>
            <element signature="n#div#0;n#form#0;n#div#0;n#div#0;n#div#0;n#body#0;n#html#0;n#!!top" expanded="false" />
            <element signature="n#div#2;n#form#0;n#div#0;n#div#0;n#div#0;n#body#0;n#html#0;n#!!top" expanded="false" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/content.html">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="-0.0" vertical-offset="0" max-vertical-offset="2415">
          <caret line="0" column="15" selection-start-line="0" selection-start-column="15" selection-end-line="0" selection-end-column="15" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/js/main.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="4533" max-vertical-offset="5835">
          <caret line="351" column="59" selection-start-line="351" selection-start-column="59" selection-end-line="351" selection-end-column="59" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/js/main1.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1905">
          <caret line="13" column="0" selection-start-line="13" selection-start-column="0" selection-end-line="13" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/content1.html">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.16587678" vertical-offset="0" max-vertical-offset="2415">
          <caret line="7" column="33" selection-start-line="7" selection-start-column="33" selection-end-line="7" selection-end-column="33" />
          <folding />
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
<!DOCTYPE html>

    <title>HTML BLOG TEMPLATE</title>
    <meta charset="utf-8">
    <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.css">
    <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.css">
    <link rel="stylesheet" type="text/css" href="Styles/main.css">

          HOME

          WORK ETHIC AND HABITS

EMOTIONAL INTELLIGENCE

          PART 1 OF TECH

REFLECTION

HTML, CSS and the DOM part 2

What is grid based design?

Grid based design is a design priciple which lays out objects in a grid based layout with horizontal and vertical lines.

What's all the hype about responsive webpages?

Responsive websites/webapps are great because they allow users all on sized devices to view a site the same intended way.

What is semantic structure?

Semantic structure is the use of tags which are indicitive of common aspects of a site instead of individual class or ID tags, e.g "" instead of class="header"


text:
import {
  moduleForComponent,
  test
  } from 'ember-qunit';
import Ember from 'ember';
import hbs from 'htmlbars-inline-precompile';

moduleForComponent('em-form', 'em-form multi models', {
  // Specify the other units that are required for this test
  integration: true
});

const myHash = Ember.Object.create({
  modelA: Ember.Object.create({
    name: 'model-a'
  }),
  modelB: Ember.Object.create({
    name: 'model-b'
  })
});

test('a form with hashed models works as expected', function(assert) {
  assert.expect(2);

  this.set('myHash', myHash);

  this.render(hbs`{{#em-form model=myHash submitButton=false showErrorsOnFocusIn=false as |form|}}
      {{form.input name="a" property="modelA.name" label="modelA name:"}}
      {{form.input name="b" property="modelB.name" label="modelB name:"}}
    {{/em-form}}`);

  Ember.run(() => {
    const inputA = this.$().find('input[name="a"]');
    const inputB = this.$().find('input[name="b"]');

    assert.equal(inputA.val(), 'model-a', 'Input A has the correct value');
    assert.equal(inputB.val(), 'model-b', 'Input B has the correct value');
  });
});

test('a form with hashed models updates correct model', function(assert) {
  assert.expect(3);

  this.set('myHash', myHash);

  this.render(hbs`{{#em-form model=myHash submitButton=false showErrorsOnFocusIn=false as |form|}}
      {{form.input name="a" property="modelA.name" label="modelA name:"}}
      {{form.input name="b" property="modelB.name" label="modelB name:"}}
    {{/em-form}}`);

  Ember.run(() => {
    const inputA = this.$().find('input[name="a"]');
    const inputB = this.$().find('input[name="b"]');

    assert.equal(inputA.val(), 'model-a', 'Input A has the correct value');
    assert.equal(inputB.val(), 'model-b', 'Input B has the correct value');

    inputB.val('my-new-val');
    inputB.trigger('change');
  });

  Ember.run(() => {
    assert.equal(myHash.get('modelB.name'), 'my-new-val', 'Input updates its model correctly');
  });
});


text:
// Forked and modified from UXM: https://github.com/treosh/uxm

import ttiPolyfill from "tti-polyfill"

declare let PerformancePaintTiming: any

/**
 * `window.performance` or `null`
 */
const perf = typeof window !== "undefined" ? window.performance : null
const timingAvailable = perf && perf.timing

/**
 * Returns a duration if both inputs are valid and start occurs before end,
 * otherwise returns `null`.
 */
const sanitizedMetrics = (start: number, end: number): number | null =>
  start > 0 && end > 0 && end - start > 0 ? end - start : null

/**
 * Marks a specific point in execution time to signify when something happened
 * or to be used as the start or end of a measurement later
 *
 * https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark
 */
export function mark(markName: string) {
  if (perf && perf.mark) {
    perf.mark(markName)
  }
}

/**
 * Provides a duration between two marks, a starting mark and when measure is called,
 * or since the start of the page load and when measure is called.
 *
 * https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure
 *
 * @param measureName The name of this measurement
 * @param startMarkName A string representing the name of the measure's starting mark. May also be the name of a PerformanceTiming property.
 * @param endMarkName A string representing the name of the measure's ending mark. May also be the name of a PerformanceTiming property.
 */
export function measure(
  measureName: string,
  startMarkName?: string,
  endMarkName?: string
) {
  if (perf && perf.measure) {
    // If the start mark or end mark are specified but don't exist then then
    // measure will throw an exception.
    try {
      perf.measure(measureName, startMarkName, endMarkName)
    } catch (err) {
      console.error(err)
    }
  }
}

/**
 * Aggregates all marks and measures into a single report
 */
export function getUserTiming() {
  if (typeof PerformanceMark === "undefined") return null
  const marks = perf.getEntriesByType("mark").map(mark => {
    return {
      type: "mark",
      name: mark.name,
      startTime: Math.round(mark.startTime),
    }
  })
  const measures = perf.getEntriesByType("measure").map(measure => {
    return {
      type: "measure",
      name: measure.name,
      startTime: Math.round(measure.startTime),
      duration: Math.round(measure.duration),
    }
  })
  return marks.concat(measures)
}

/**
 * The time it takes to render something visually different then what was on
 * the screen during the last navigation
 */
export function getFirstPaint() {
  if (typeof PerformancePaintTiming === "undefined") return null
  const firstPaint = perf
    .getEntriesByType("paint")
    .find(({ name }) => name === "first-paint")
  return firstPaint ? Math.round(firstPaint.startTime) : null
}

/**
 * The time it takes to render the first bit of visible content in the dom
 */
export function getFirstContentfulPaint() {
  if (typeof PerformancePaintTiming === "undefined") return null
  const firstContentfulPaint = perf
    .getEntriesByType("paint")
    .find(({ name }) => name === "first-contentful-paint")
  return firstContentfulPaint
    ? Math.round(firstContentfulPaint.startTime)
    : null
}

/**
 * The time it took for the load event to complete
 */
export function getLoadEventEnd() {
  if (!timingAvailable) return null
  return sanitizedMetrics(perf.timing.requestStart, perf.timing.loadEventEnd)
}

/**
 * Time it takes for the dom to finish parsing and building the initial dom tree.
 * Subresources like css, images will start processing after this event
 *
 * https://varvy.com/performance/dominteractive.html
 */
export function getDomInteractive() {
  if (!timingAvailable) return null
  return sanitizedMetrics(perf.timing.requestStart, perf.timing.domInteractive)
}

/**
 * The domInteractive phase has finished, the dom and CSSOM are complete, and
 * _all parser blocking javascript has been executed_.
 *
 *
 * https://varvy.com/performance/domcontentloaded.html
 */
export function getDomContentLoadedStart() {
  if (!timingAvailable) return null
  return sanitizedMetrics(
    perf.timing.requestStart,
    perf.timing.domContentLoadedEventStart
  )
}

/**
 * DomContentLoaded has finished executing any queued tasks on the event loop
 * TODO: Determine if this metric is valuable and remove it if it is not
 *
 * https://varvy.com/performance/domcontentloaded.html
 */
export function getDomContentLoadedEnd() {
  if (!timingAvailable) return null
  return sanitizedMetrics(
    perf.timing.requestStart,
    perf.timing.domContentLoadedEventEnd
  )
}

/**
 * Time it takes for all of the processing to complete and all of the resources
 * on the page (images, etc.) to finish downloading
 *
 * https://varvy.com/performance/domcomplete.html
 */
export function getDomComplete() {
  if (!timingAvailable) return null
  return sanitizedMetrics(perf.timing.requestStart, perf.timing.domComplete)
}

export async function getTTI() {
  if (!timingAvailable) return null
  return Math.round(await ttiPolyfill.getFirstConsistentlyInteractive())
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<artifactId>advanced</artifactId>
		<groupId>org.arakhne.afc.advanced</groupId>
		<version>14.0-SNAPSHOT</version>
	</parent>

	<artifactId>attributes</artifactId>
	<name>Generic Attribute API</name>
	<inceptionYear>2013</inceptionYear>

	<properties>
		<manifest.file>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifest.file>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.arakhne.afc.core</groupId>
			<artifactId>math</artifactId>
		</dependency>
		<dependency>
			<groupId>org.arakhne.afc.core</groupId>
			<artifactId>references</artifactId>
		</dependency>
		<dependency>
			<groupId>org.arakhne.afc.ui</groupId>
			<artifactId>vector</artifactId>
		</dependency>
		<dependency>
			<groupId>org.arakhne.afc.ui</groupId>
			<artifactId>vector-awt</artifactId>
			<scope>test</scope>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.arakhne.afc.core</groupId>
			<artifactId>testtools</artifactId>
			<scope>test</scope>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.arakhne.afc.core</groupId>
			<artifactId>math</artifactId>
			<type>test-jar</type>
			<scope>test</scope>
			<optional>true</optional>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<compilerArguments>
						<properties>${jdtcompilerconfpath}</properties>
					</compilerArguments>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-checkstyle-plugin</artifactId>
				<configuration>
					<sourceDirectory>src/main/java</sourceDirectory>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<archive>
						<index>false</index>
						<manifestFile>${manifest.file}</manifestFile>
					</archive>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<executions>
					<execution>
						<id>bundle-manifest</id>
						<phase>process-classes</phase>
						<goals>
							<goal>manifest</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<archive>
						<manifestFile>${manifest.file}</manifestFile>
						<manifest>
							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
							<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
						</manifest>
					</archive>

					<instructions>
						<Export-Package>org.arakhne.afc.attrs.*</Export-Package>
					</instructions>
				</configuration>
			</plugin>
		</plugins>
	</build>

</project>


text:
import * as gulp from 'gulp';
import * as gulpLoadPlugins from 'gulp-load-plugins';
import { join } from 'path';

import Config from '../../config';
import { makeTsProject, templateLocals } from '../../utils';

const plugins = <any>gulpLoadPlugins();

const INLINE_OPTIONS = {
  base: Config.TMP_DIR,
  useRelativePaths: true,
  removeLineBreaks: true
};

/**
 * Executes the build process, transpiling the TypeScript files for the production environment.
 */

export = () => {
  let tsProject = makeTsProject();
  let src = [
    'typings/index.d.ts',
    Config.TOOLS_DIR + '/manual_typings/**/*.d.ts',
    join(Config.TMP_DIR, '**/*.ts'),
    '!' + join(Config.TMP_DIR, `**/${Config.BOOTSTRAP_FACTORY_PROD_MODULE}.ts`)
  ];
  let result = gulp.src(src)
    .pipe(plugins.plumber())
    .pipe(plugins.inlineNg2Template(INLINE_OPTIONS))
    .pipe(plugins.typescript(tsProject))
    .once('error', function(e: any) {
      this.once('finish', () => process.exit(1));
    });

  return result.js
    .pipe(plugins.template(templateLocals()))
    .pipe(gulp.dest(Config.TMP_DIR))
    .on('error', (e: any) => {
      console.log(e);
    });
};


text:
class Product < ApplicationRecord
	has_many :line_items
	has_many :line_items
	before_destroy :ensure_not_referenced_by_any_line_item

	validates :title, :description, :image_url, presence: true
	validates :price ,numericality: { greater_than_or_equal_to: 0.01}
	validates :title ,uniqueness: true
	validates :image_url ,allow_blank: true , format: {
		with:  %r{\.(gif|jpg|png)\Z}i,
		message: "must be a URL for GIF,PNG or JPG"
	}
end

 private
    # ensure that there are no line items referencing this product
        def ensure_not_referenced_by_any_line_item
         unless line_items.empty?
            errors.add(:base, 'Line Items present')
            throw :abort
        end
 end


text:
package hip.ch5.kafka;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.util.Properties;

import hip.ch3.avro.AvroStockUtils;
import hip.ch3.avro.gen.Stock;
import hip.util.Cli;
import kafka.producer.KeyedMessage;
import kafka.producer.ProducerConfig;
import kafka.javaapi.producer.Producer;
import org.apache.avro.io.BinaryEncoder;
import org.apache.avro.io.DatumWriter;
import org.apache.avro.io.EncoderFactory;
import org.apache.avro.specific.SpecificDatumWriter;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;

import static hip.util.Cli.ArgBuilder;

/**
 * Writes Avro {@link Stock} data into a Kafka topic.
 */
public class KafkaAvroWriter extends Configured implements Tool {

  /**
   * Main entry point for the example.
   *
   * @param args arguments
   * @throws Exception when something goes wrong
   */
  public static void main(final String[] args) throws Exception {
    int res = ToolRunner.run(new Configuration(), new KafkaAvroWriter(), args);
    System.exit(res);
  }

  /**
   * The MapReduce driver - setup and launch the job.
   *
   * @param args the command-line arguments
   * @return the process exit code
   * @throws Exception if something goes wrong
   */
  public int run(final String[] args) throws Exception {

    Cli cli = Cli.builder().setArgs(args).addOptions(Options.values()).build();
    int result = cli.runCmd();

    if (result != 0) {
      return result;
    }

    File inputFile = new File(cli.getArgValueAsString(Options.STOCKSFILE));
    String brokerList = cli.getArgValueAsString(Options.BROKER_LIST);
    String kTopic = cli.getArgValueAsString(Options.TOPIC);

    Properties props = new Properties();
    props.put("metadata.broker.list", brokerList);
    props.put("serializer.class", kafka.serializer.DefaultEncoder.class.getName());

    ProducerConfig config = new ProducerConfig(props);

    Producer<Integer, byte[]> producer = new Producer<Integer, byte[]>(config);

    for (Stock stock : AvroStockUtils.fromCsvFile(inputFile)) {
      KeyedMessage<Integer, byte[]> msg = new KeyedMessage<Integer, byte[]>(kTopic, toBytes(stock));
      System.out.println("Sending " + msg + " to kafka @ topic " + kTopic);
      producer.send(msg);

    }
    producer.close();
    System.out.println("done!");
    return 0;
  }

  private static final EncoderFactory encoderFactory = EncoderFactory.get();

  public static byte[] toBytes(Stock stock) {
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    BinaryEncoder encoder = encoderFactory.directBinaryEncoder(outputStream, null);

    DatumWriter<Stock> userDatumWriter = new SpecificDatumWriter<Stock>(Stock.class);
    try {
      userDatumWriter.write(stock, encoder);
      encoder.flush();
    } catch (IOException e) {
      throw new RuntimeException(e);
    }

    return outputStream.toByteArray();
  }

  public enum Options implements Cli.ArgGetter {
    STOCKSFILE(ArgBuilder.builder().hasArgument(true).required(true).description("Sample stocks file")),
    BROKER_LIST(ArgBuilder.builder().hasArgument(true).required(true).description("List of CSV-separated Kafka brokers host and port (i.e. localhost:9092,host2:port2")),
    TOPIC(ArgBuilder.builder().hasArgument(true).required(true).description("Kafka topic")),;
    private final Cli.ArgInfo argInfo;

    Options(final ArgBuilder builder) {
      this.argInfo = builder.setArgName(name()).build();
    }

    @Override
    public Cli.ArgInfo getArgInfo() {
      return argInfo;
    }
  }
}


text:
layout: post
date:	2014-01-05 06:53:00
title:  Composition in red, Ramadevara betta, 040114
tags: [archived-posts]
categories: archives
permalink: /:categories/:year/:month/:day/:title/
---

Hands in their prayer pouches, the devotees of Swami Prabhupada descend the rock steps from the Sri Rama Temple at Ramadevara betta, in Ramnagaram, Karnataka.

Red is the colour of worship,that I associate with the Hindu religion, and temples. South Indian temple walls are always painted with vertical red-and-white stripes; vermilion, an auspicious powder used in pUjA, is red (and gives its name to the very colour)....red was the colour of the sacrifices that used to be offered to the gods in the times of yore...

I just happened to look up the path (I was looking for the Yellow-throated Bulbul, to show a birder friend from Kerala) and this vision of Red struck me....


text:
class CollaboratorsController < ApplicationController

  before_action :login_required

  def create
    account = Account.lookup(pick(params, :email)[:email])
    return json(nil, 404) if !account || account.id == current_account.id
    return json({:errors => ['That account has been disabled.']}, 409) if account.role == Account::DISABLED
    success = current_project.add_collaborator account
    return json(account, 409) unless success
    json account.to_json(:include_organization => true)
  end

  def destroy
    account = Account.find(params[:id])
    current_project.remove_collaborator account
    json nil
  end

  private

  def current_project
    Project.accessible(current_account).find(params[:project_id])
  end

end


text:
import EmberObject, { get } from '@ember/object';
import Mixin from '@ember/object/mixin';
import { run } from '@ember/runloop';
import { moduleFor, AbstractTestCase } from 'internal-test-helpers';

moduleFor(
  'Mixin#reopen',
  class extends AbstractTestCase {
    ['@test using reopen() to add more properties to a simple'](assert) {
      let MixinA = Mixin.create({ foo: 'FOO', baz: 'BAZ' });
      MixinA.reopen({ bar: 'BAR', foo: 'FOO2' });
      let obj = {};
      MixinA.apply(obj);

      assert.equal(get(obj, 'foo'), 'FOO2', 'mixin() should override');
      assert.equal(get(obj, 'baz'), 'BAZ', 'preserve MixinA props');
      assert.equal(get(obj, 'bar'), 'BAR', 'include MixinB props');
    }

    ['@test using reopen() and calling _super where there is not a super function does not cause infinite recursion'](
      assert
    ) {
      let Taco = EmberObject.extend({
        createBreakfast() {
          // There is no original createBreakfast function.
          // Calling the wrapped _super function here
          // used to end in an infinite call loop
          this._super(...arguments);
          return 'Breakfast!';
        },
      });

      Taco.reopen({
        createBreakfast() {
          return this._super(...arguments);
        },
      });

      let taco = Taco.create();

      let result;
      run(() => {
        try {
          result = taco.createBreakfast();
        } catch (e) {
          result = 'Your breakfast was interrupted by an infinite stack error.';
        }
      });

      assert.equal(result, 'Breakfast!');
    }
  }
);


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Copyright 2001-2009 The Apache Software Foundation.
*
* 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.
*
*/ -->
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
             version="1.0">
  <persistence-unit name="juddiDatabase" transaction-type="RESOURCE_LOCAL">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>

    <!-- entity classes -->
    <class>org.apache.juddi.model.Address</class>
    <class>org.apache.juddi.model.AddressLine</class>
    <class>org.apache.juddi.model.AuthToken</class>
    <class>org.apache.juddi.model.BindingCategoryBag</class>
    <class>org.apache.juddi.model.BindingDescr</class>
    <class>org.apache.juddi.model.BindingTemplate</class>
    <class>org.apache.juddi.model.BusinessCategoryBag</class>
    <class>org.apache.juddi.model.BusinessDescr</class>
    <class>org.apache.juddi.model.BusinessEntity</class>
    <class>org.apache.juddi.model.BusinessIdentifier</class>
    <class>org.apache.juddi.model.BusinessName</class>
    <class>org.apache.juddi.model.BusinessService</class>
    <class>org.apache.juddi.model.CanonicalizationMethod</class>
    <class>org.apache.juddi.model.CategoryBag</class>
    <class>org.apache.juddi.model.Clerk</class>
    <class>org.apache.juddi.model.ClientSubscriptionInfo</class>
    <class>org.apache.juddi.model.Contact</class>
    <class>org.apache.juddi.model.ContactDescr</class>
    <class>org.apache.juddi.model.DiscoveryUrl</class>
    <class>org.apache.juddi.model.Email</class>
    <class>org.apache.juddi.model.InstanceDetailsDescr</class>
    <class>org.apache.juddi.model.InstanceDetailsDocDescr</class>
    <class>org.apache.juddi.model.KeyedReference</class>
    <class>org.apache.juddi.model.KeyedReferenceGroup</class>
    <class>org.apache.juddi.model.KeyDataValue</class>
    <class>org.apache.juddi.model.KeyInfo</class>
    <class>org.apache.juddi.model.Node</class>
    <class>org.apache.juddi.model.ObjectType</class>
    <class>org.apache.juddi.model.ObjectTypeContent</class>
    <class>org.apache.juddi.model.OverviewDoc</class>
    <class>org.apache.juddi.model.OverviewDocDescr</class>
    <class>org.apache.juddi.model.PersonName</class>
    <class>org.apache.juddi.model.Phone</class>
    <class>org.apache.juddi.model.Publisher</class>
    <class>org.apache.juddi.model.PublisherAssertion</class>
    <class>org.apache.juddi.model.PublisherAssertionId</class>
    <class>org.apache.juddi.model.Reference</class>
    <class>org.apache.juddi.model.ServiceCategoryBag</class>
    <class>org.apache.juddi.model.ServiceDescr</class>
    <class>org.apache.juddi.model.ServiceName</class>
    <class>org.apache.juddi.model.ServiceProjection</class>
    <class>org.apache.juddi.model.ServiceProjectionId</class>
    <class>org.apache.juddi.model.Signature</class>
    <class>org.apache.juddi.model.SignatureMethod</class>
    <class>org.apache.juddi.model.SignatureTransform</class>
    <class>org.apache.juddi.model.SignatureTransformDataValue</class>
    <class>org.apache.juddi.model.SignatureValue</class>
    <class>org.apache.juddi.model.SignedInfo</class>
    <class>org.apache.juddi.model.Subscription</class>
    <class>org.apache.juddi.model.SubscriptionChunkToken</class>
    <class>org.apache.juddi.model.SubscriptionMatch</class>
    <class>org.apache.juddi.model.TempKey</class>
	<class>org.apache.juddi.model.TempKeyPK</class>
    <class>org.apache.juddi.model.Tmodel</class>
    <class>org.apache.juddi.model.TmodelCategoryBag</class>
    <class>org.apache.juddi.model.TmodelDescr</class>
    <class>org.apache.juddi.model.TmodelIdentifier</class>
    <class>org.apache.juddi.model.TmodelInstanceInfo</class>
    <class>org.apache.juddi.model.TmodelInstanceInfoDescr</class>
    <class>org.apache.juddi.model.TransferToken</class>
    <class>org.apache.juddi.model.TransferTokenKey</class>
    <class>org.apache.juddi.model.UddiEntity</class>
    <class>org.apache.juddi.model.UddiEntityPublisher</class>
	<class>org.apache.juddi.model.ValueSetValues</class>

	<class>org.apache.juddi.model.ChangeRecord</class>
	<class>org.apache.juddi.model.CommunicationGraph</class>
	<class>org.apache.juddi.model.Operator</class>
	<class>org.apache.juddi.model.ReplicationConfiguration</class>
	<class>org.apache.juddi.model.Edge</class>
	<class>org.apache.juddi.model.ControlMessage</class>
	<class>org.apache.juddi.model.ReplicationConfigurationNode</class>
    <class>org.apache.juddi.model.EdgeReceiverAlternate</class>

    <properties>
      <property name="hibernate.archive.autodetection" value="class"/>
      <property name="hibernate.hbm2ddl.auto" value="update"/>
      <property name="hibernate.show_sql" value="false"/>

      <!-- derby connection properties -->
      <property name="hibernate.dialect" value="org.hibernate.dialect.DerbyDialect"/>
      <property name="hibernate.connection.driver_class" value="org.apache.derby.jdbc.EmbeddedDriver"/>
      <property name="hibernate.connection.url" value="jdbc:derby:memory:juddi-derby-test-db;create=true"/>
      <property name="hibernate.connection.username" value=""/>
      <property name="hibernate.connection.password" value=""/>

 	  <!--  mysql connection properties

      <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
      <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" />
      <property name="hibernate.connection.username" value="juddiv3" />
      <property name="hibernate.connection.password" value="" />
      <property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/juddiv3" />
-->

      <!-- connection pool properties -->
      <property name="hibernate.dbcp.maxActive" value="100"/>
      <property name="hibernate.dbcp.maxIdle" value="30"/>
      <property name="hibernate.dbcp.maxWait" value="10000"/>

    </properties>
  </persistence-unit>
</persistence>


text:
Howitzer Stat
===============================

[![Build Status](https://travis-ci.org/strongqa/howitzer_stat.png?branch=master)](https://travis-ci.org/strongqa/howitzer_stat)
[![Dependency Status](https://gemnasium.com/romikoops/howitzer_stat.png)](https://gemnasium.com/romikoops/howitzer_stat)

[Howitzer](http://strongqa.github.io/howitzer/) extension used for automated tests coverage visualization of web application pages.

This extension consists of 2 components:
- REST web service based on Sinatra
- Client files (js, css, html markup) intended for injection to a testable web application

## Requirements

**Ruby 1.9.3+**

## Demo

* Screenshot1
* Screenshot2
* Screenshot3

Real demo application is coming soon...

## Documentation

* [Ruby installation in production](https://github.com/strongqa/howitzer_stat/wiki/Ruby-installation-in-production)
* [Deployment to production](https://github.com/strongqa/howitzer_stat/wiki/Deployment-to-production)
* [Client integration](https://github.com/strongqa/howitzer_stat/wiki/Client-integration)
* [Settings List](https://github.com/strongqa/howitzer_stat/wiki/Settings-List)
* [REST API Documentation](https://github.com/strongqa/howitzer_stat/wiki/REST-API)
* [Howitzer](http://strongqa.github.io/howitzer)

## Limitations

* Not many branches and environments are supported.
* Currently only Cucumber scenario can be applied.
* The extension is to be covered by unit tests (both client and server part).
* The Demo web application with HowitzerStat is not available.

We expect to eliminate these limitations in the upcoming releases.

## Contributing

1. Fork the project.
2. Create a new feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push the branch (`git push origin my-new-feature`)
5. Create a new pull request.

### Development Environment

* Create `config/custom.yml` with the following properties:

```
path_to_source: ./demo
port: 7000
domain: localhost
```

* Specify a correct path to the real howitzer based project (path_to_source setting).
* Run a service:

`unicorn -p 7000`

* Navigate to url `http://localhost:7000/test?page=SomePage`

where *SomePage* is one of the Ruby page classes.


text:
#ifndef itkRGBToLuminanceImageAdaptor_h
#define itkRGBToLuminanceImageAdaptor_h

#include "itkImageAdaptor.h"
#include "itkMath.h"

namespace itk
{
namespace Accessor
{
/**
 *\class RGBToLuminancePixelAccessor
 * \brief Give access to Luminance of a color pixel type.
 *
 * RGBToLuminancePixelAccessor is templated over an internal type and an
 * external type representation. This class cast the input applies the function
 * to it and cast the result according to the types defined as template
 * parameters. The input pixel type must support the GetLuminance() method.
 * This is the case of the RGBPixel class for example.
 *
 * \ingroup ImageAdaptors
 * \ingroup ITKImageAdaptors
 */
template <typename TInternalType, typename TExternalType>
class RGBToLuminancePixelAccessor
{
public:
  /** External type alias. It defines the external aspect
   * that this class will exhibit. */
  using ExternalType = TExternalType;

  /** Internal type alias. It defines the internal real
   * representation of data. */
  using InternalType = TInternalType;

  static inline void
  Set(TInternalType & output, const TExternalType & input)
  {
    output = static_cast<TInternalType>(input.GetLuminance());
  }

  static inline TExternalType
  Get(const TInternalType & input)
  {
    return static_cast<TExternalType>(input.GetLuminance());
  }
};
} // end namespace Accessor

/**
 *\class RGBToLuminanceImageAdaptor
 * \brief Presents a color image as being composed of the Luminance of its pixels.
 *
 * Additional casting is performed according to the input and output image
 * types following C++ default casting rules. The input color pixel type must
 * provide a GetLuminance() method.
 *
 * \ingroup ImageAdaptors
 * \ingroup ITKImageAdaptors
 */
template <typename TImage, typename TOutputPixelType>
class RGBToLuminanceImageAdaptor
  : public ImageAdaptor<TImage, Accessor::RGBToLuminancePixelAccessor<typename TImage::PixelType, TOutputPixelType>>
{
public:
  ITK_DISALLOW_COPY_AND_ASSIGN(RGBToLuminanceImageAdaptor);

  /** Standard class type aliases. */
  using Self = RGBToLuminanceImageAdaptor;
  using Superclass =
    ImageAdaptor<TImage, Accessor::RGBToLuminancePixelAccessor<typename TImage::PixelType, TOutputPixelType>>;
  using Pointer = SmartPointer<Self>;
  using ConstPointer = SmartPointer<const Self>;

  /** Method for creation through the object factory. */
  itkNewMacro(Self);

  /** Run-time type information (and related methods). */
  itkTypeMacro(RGBToLuminanceImageAdaptor, ImageAdaptor);

protected:
  RGBToLuminanceImageAdaptor() = default;
  ~RGBToLuminanceImageAdaptor() override = default;
};
} // end namespace itk

#endif


text:
package mg

type Chan string

func (c Chan) Send(data interface{}) {
	post(Response{
		Token: string(c),
		Data:  data,
	})
}


text:
#import <AppKit/AppKit.h>
#import "cocos2d.h"

@interface SequencerExpandBtnCell : NSCell

{
    NSImage* expandedImage;
    NSImage* collapsedImage;

    BOOL isExpanded;
    BOOL canExpand;

    CCNode* node;
    BOOL imagesLoaded;
    NSImage* imgRowBgChannel;
}

@property (nonatomic,assign) BOOL isExpanded;
@property (nonatomic,assign) BOOL canExpand;
@property (nonatomic,retain) NSImage* expandedImage;
@property (nonatomic,retain) NSImage* collapsedImage;
@property (nonatomic,assign) CCNode* node;

@end


text:
package tracer.utils;

import org.eclipse.jdt.core.dom.ASTVisitor;
import org.eclipse.jdt.core.dom.Javadoc;

public class DelCommentsVisitor extends ASTVisitor {

	@Override
	public boolean visit(Javadoc node) {
		node.delete();
		return super.visit(node);
	}

}


text:
<?php

/**
 * PayPal Standard payment "form"
 */
class Mage_Paypal_Block_Standard_Form extends Mage_Payment_Block_Form
{
    /**
     * Payment method code
     * @var string
     */
    protected $_methodCode = Mage_Paypal_Model_Config::METHOD_WPS;

    /**
     * Config model instance
     *
     * @var Mage_Paypal_Model_Config
     */
    protected $_config;

    /**
     * Set template and redirect message
     */
    protected function _construct()
    {
        $this->_config = Mage::getModel('paypal/config')->setMethod($this->getMethodCode());
        $locale = Mage::app()->getLocale();
        $mark = Mage::getConfig()->getBlockClassName('core/template');
        $mark = new $mark;
        $mark->setTemplate('paypal/payment/mark.phtml')
            ->setPaymentAcceptanceMarkHref($this->_config->getPaymentMarkWhatIsPaypalUrl($locale))
            ->setPaymentAcceptanceMarkSrc($this->_config->getPaymentMarkImageUrl($locale->getLocaleCode()))
        ; // known issue: code above will render only static mark image
        $this->setTemplate('paypal/payment/redirect.phtml')
            ->setRedirectMessage(
                Mage::helper('paypal')->__('You will be redirected to the PayPal website when you place an order.')
            )
            ->setMethodTitle('') // Output PayPal mark, omit title
            ->setMethodLabelAfterHtml($mark->toHtml())
        ;
        return parent::_construct();
    }

    /**
     * Payment method code getter
     * @return string
     */
    public function getMethodCode()
    {
        return $this->_methodCode;
    }
}


text:
; imports with all tricks to make it as small as possible - W7

; Ange Albertini, BSD LICENCE 2012-2013

%include 'consts.inc'

IMAGEBASE equ 400000h
org IMAGEBASE
bits 32

SECTIONALIGN equ 1000h
FILEALIGN equ 200h

istruc IMAGE_DOS_HEADER
    at IMAGE_DOS_HEADER.e_magic,  db 'MZ'
    at IMAGE_DOS_HEADER.e_lfanew, dd NT_Headers - IMAGEBASE
iend

%include "nthd_std.inc"

istruc IMAGE_DATA_DIRECTORY_16
    at IMAGE_DATA_DIRECTORY_16.ImportsVA, dd Import_Descriptor - IMAGEBASE
    at IMAGE_DATA_DIRECTORY_16.IATVA,     dd ImportsAddressTable - IMAGEBASE ; required under XP
    at IMAGE_DATA_DIRECTORY_16.IATSize,   dd IMPORTSADDRESSTABLESIZE    ; required under XP
iend

%include 'section_1fa.inc'

%include 'code_printf.inc'

Msg db " * tiny imports (W7)", 0ah, 0
_d

ImportsAddressTable:
Import_Descriptor:
;kernel32.dll_DESCRIPTOR:
    dd 0
    msvcrt.dll_iat:
        __imp__printf:
            dd 80000000h + 1268 ; printf
            dd 0
    dd kernel32.dll - IMAGEBASE
    dd kernel32.dll_iat - IMAGEBASE
;msvcrt.dll_DESCRIPTOR:
    dd 0
    kernel32.dll_iat:
        __imp__ExitProcess:
            dd 80000000h + 284 ; ExitProcess
            dd 0
    dd msvcrt.dll - IMAGEBASE
    dd msvcrt.dll_iat - IMAGEBASE
;terminator
kernel32.dll db 'kernel32' ,0 ; not W2k compatible
msvcrt.dll:
dd 'msvcrt',0
align 4, db 0 ; <= imports terminator NULL

IMPORTSADDRESSTABLESIZE equ $ - ImportsAddressTable
_d

align FILEALIGN, db 0